How buuhis/packet-parser works
Packet Parser captures traffic from a selected interface, dispatches each captured frame through link-layer and IPv4 handling, then parses TCP or UDP; UDP traffic on port 53 receives additional DNS analysis. Parser output goes through a shared logger to the console and output.txt. The README also describes Ethernet, 802.11 and Radiotap support and live monitoring. The graph follows the sampled calls; deeper connection tracking is documented but not evident in the excerpts.
Main entry points: logger.c Shared logger · main.c Capture entry · packet_parser.c Frame and IP dispatch · udp_parser.c UDP analysis
Components 11
Capture and routing
- Capture entry
src/main.c - libpcap capture
- Frame and IP dispatch
src/packet_parser.c
Protocol analysis
- TCP analysis
src/tcp_parser.c - UDP analysis
src/udp_parser.c - DNS deep parsing
src/dns_parser.c
Logging and output
- Shared logger
util/src/logger.c - Console output
- Packet log file
output.txt
Other components
- Operator
- Network interface
Connections 13
- Operator → Capture entry: selects interface
README.md - Capture entry → Network interface: opens for capture
src/main.c - Capture entry → Shared logger: initializes
src/main.c - Capture entry → libpcap capture: starts capture
src/main.c - libpcap capture → Frame and IP dispatch: invokes callback
- Frame and IP dispatch → TCP analysis: dispatches TCP
src/packet_parser.c - Frame and IP dispatch → UDP analysis: dispatches UDP
src/packet_parser.c - UDP analysis → DNS deep parsing: parses port 53
src/udp_parser.c - TCP analysis → Shared logger: logs packet
src/tcp_parser.c - UDP analysis → Shared logger: logs packet
src/udp_parser.c - DNS deep parsing → Shared logger: logs details
src/dns_parser.c - Shared logger → Console output: writes formatted output
util/src/logger.c - Shared logger → Packet log file: appends and flushes
util/src/logger.c