Added bonus and refactor again

Added the following flags :
-c to make a NUMBER of pings
-f to add flood mode
-i to set an interval of NUMBER seconds between pings
-l to send a NUMBER of pings as fast as possible then swapping to normal mode
-q to add quiet mode

Refactored main.c :
Made flags.c for avoiding the main() function becoming a masterclass and make the file more readable
Moved some function from main.c to utils.c

Made some change to mimic the behavior of the ping binary of inetutils2.0
This commit is contained in:
vauden
2024-11-16 02:23:41 +01:00
parent eb125bde1a
commit 26d9f40030
7 changed files with 188 additions and 71 deletions

View File

@@ -1,7 +1,8 @@
NAME = ./ft_ping
SRCS = src/main.c \
src/utils.c
src/utils.c \
src/flags.c
OBJ_DIR = objs