How vkerob/ft_ping works
ft_ping is an IPv4 ICMP echo utility. Its workflow parses a target and options, resolves the host, configures an ICMP socket, then sends echo requests and handles replies until stopped or timed out; it prints per-reply information and final packet/RTT statistics. The README also documents payload patterns, flood/preload, TTL/TOS, IP timestamps, numeric output and verbose diagnostics. The map follows the sampled entry point and modules; some receive-path details are only partially excerpted, so uncertain internal wiring is omitted.
Main entry points: main.c Program entry · packet.c Ping loop · packet_receive.c Receive and decode · packet_send.c Echo transmission
Components 16
Invocation setup
- Program entry
main.c - Options and help
src/parse_args.c - Option parsing helpers
src/parse_utils.c - IPv4 resolution
src/utils.c - ICMP socket setup
src/socket.c - Signal handling
src/signal.c
Probe runtime
- Ping loop
src/packet.c - Echo request update
src/packet_utils.c - Echo transmission
src/packet_send.c - ICMP checksum
src/packet_utils.c
Reply handling
- Receive and decode
src/packet_receive.c - Reply wait
src/packet_receive.c - Ping statistics
src/packet_utils.c
Network services
- IPv4 ICMP socket
- Host name service
Other components
- CLI user
Connections 19
- CLI user → Program entry: invokes
- Program entry → Options and help: parses options
- Options and help → Option parsing helpers: validates values
- Program entry → IPv4 resolution: resolves target
- IPv4 resolution → Host name service: queries IPv4
- Program entry → ICMP socket setup: creates socket
- ICMP socket setup → IPv4 ICMP socket: configures socket
- Program entry → Signal handling: sets handlers
- Program entry → Ping loop: starts probing
- Ping loop → Echo request update: updates sequence
- Ping loop → Echo transmission: sends requests
- Echo transmission → ICMP checksum: calculates checksum
- Echo transmission → IPv4 ICMP socket: sends ICMP
- Ping loop → Receive and decode: handles readiness
- Receive and decode → IPv4 ICMP socket: receives packets
- Ping loop → Reply wait: waits after run
- Reply wait → Receive and decode: processes arrivals
- Receive and decode → Host name service: looks up sender
- Ping loop → Ping statistics: prints summary