#vpn #packet #hash #tracing #logging #yagna

ya-packet-trace

Utility library for tracking VPN packets in yagna

1 unstable release

0.1.0 May 23, 2023

#2 in #yagna

Download history 155/week @ 2025-10-16 227/week @ 2025-10-23 127/week @ 2025-10-30 160/week @ 2025-11-06 161/week @ 2025-11-13 157/week @ 2025-11-20 205/week @ 2025-11-27 285/week @ 2025-12-04 148/week @ 2025-12-11 163/week @ 2025-12-18 113/week @ 2025-12-25 204/week @ 2026-01-01 167/week @ 2026-01-08 189/week @ 2026-01-15 196/week @ 2026-01-22 197/week @ 2026-01-29

775 downloads per month
Used in 4 crates (2 directly)

GPL-3.0 license

22KB
221 lines

ya-packet-trace

Utility for tracing VPN packets

Usage

At any interesting point in the flow of VPN packets, invoke the macro like so:

packet_trace!(
    "possibly-slow-subsystem-before",
    {
        // code returning AsRef<[u8]> corresponding to the packet payload
    }
);

packet_trace_maybe!(
    "whatever",
    {
        // code returning Option<AsRef<[u8]>> corresponding to the packet payload
    }
);

Then, if the ya-packet-trace is compiled with the enabled feature, a log like possibly-slow-subsystem-before,<HASH>,<TS> will be printed at TRACE level to target packet-trace.

  • <HASH> is 16-character, 0-padded hex-digest of FxHash output
  • <TS> is current datetime as formatted by chrono with the following format string: %Y-%m-%dT%H:%M:%S%.6f%z.

Dependencies

~1.5MB
~22K SLoC