srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_icmp.cpp
AgeCommit message (Collapse)AuthorFilesLines
2026-05-28Decode ICMP embedded flows - show which packet actually triggered an errorsrdusr1-0/+86
Destination Unreachable, Time Exceeded, Redirect, Source Quench, and Parameter Problem (plus their ICMPv6 equivalents) all carry, after their own fixed header, as much of the packet that triggered the error as the network could fit - always at least its IP header plus the first 8 bytes of payload, exactly enough to recover TCP/UDP port numbers. That embedded flow is the actual reason an ICMP error shows up in a capture at all, and wasn't shown before this. Reuses parse_ipv4()/parse_ipv6() directly on the embedded bytes rather than a separate parser - it's a genuine (if truncated) IP packet, not a different format. Two small is_error_type() helpers gate which ICMP types this is attempted for, since echo/timestamp/Neighbor Discovery types don't carry an embedded packet at all. Live-verified with a real traceroute to 8.8.8.8 captured on wlp1s0: genuine Time Exceeded messages from real intermediate routers - this machine's own gateway, then real ISP infrastructure several hops out - all correctly showing the flow that triggered them, matching traceroute's own hop output.
2024-05-27Rename project from wireframe to packeteersrdusr1-2/+2
Decided on the name after weighing alternatives in NAMES.md: packeteer (packet + -eer, "one who wields packets") fit the project's actual scope better than the wire/frame pun once it had grown into full L2-L7 dissection, reassembly, checksums, privilege dropping, and dual TUI/GUI frontends. No existing packet-capture project uses the name; the one real-world collision (Packeteer, Inc., a networking company acquired and folded into Blue Coat/Symantec by 2008) is long defunct. Mechanical rename throughout: CMake project/target names, the wireframe:: namespace and include/wireframe/ directory (git mv, history preserved), every #include path, CLI/GUI help text, and the project's own working directory. NAMES.md rewritten to record the decision instead of leaving stale self-referential etymology behind from the blind rename pass. Verified after every step: full rebuild (all four targets, no warnings) and the full test suite (128/128 cases, 366/366 assertions) both from a fresh reconfigure and again after the directory move.
2024-05-17Add privilege dropping, AF_PACKET demo, ICMP, checksum validation, --help, ↵srdusr1-0/+85
and TCP reassembly Rounds out the build order in PLAN.md with six incremental additions: drop root privileges immediately after opening the capture handle; a standalone AF_PACKET/mmap ring-buffer demo (kept separate from CaptureSession, see its header comment for why); ICMPv4/ICMPv6 type and code decoding; opt-in IPv4/TCP/UDP checksum validation (-c); CLI --help; and opt-in, in-order-only TCP stream reassembly (-a) so HTTP requests/responses split across segments can be seen whole. Each addition is unit-tested and, where it touches live traffic behavior, verified against real captured packets - see PLAN.md's Decisions section for the verification notes on each.