How jesuserr/42cursus_ft_ping works
Project type and purpose
• This is a monolithic, system-level CLI application written in C. It recodes the Unix “ping” command by sending ICMP Echo requests and processing Echo replies over raw sockets.
• Key artifacts:
• srcs/ – all C source modules (main.c, ft_ping.c, parser.c, messages.c, signals.c)
• libft/ – a utility library (string helpers, I/O wrappers, etc.)
• subject/ – project specification PDF
• Makefile, .gitmodules – build and submodule configuration
File structure
• Top level:
• Makefile – orchestrates compile/link steps, pulls in libft
• .gitmodules – references the libft submodule
• srcs/:
• main.c – entry point, high-level control loop
• parser.c – parses command-line arguments into an options struct
• ft_ping.c – core ping logic (initialization, send/receive loop)
• messages.c – formatting output lines, error texts
• signals.c – installs signal handlers (SIGINT, alarms)
• ft_ping.h – shared definitions and structs
• libft/: reused general-purpose functions (memory, strings, I/O)
README for additional insights
• README states only the project summary (“recoding the ping command”), confirming the intended behavior matches POSIX ping.
Detail
• Timing interactions (alarms triggering every second)
• Clean-up logic on SIGINT (printing summary, closing socket)