#vpn #packets #tracing #trace #ts #target #hash

ya-packet-trace

Utility library for tracking VPN packets in yagna

1 unstable release

0.1.0 May 23, 2023

#21 in #ts

Download history 328/week @ 2023-12-06 39/week @ 2023-12-13 102/week @ 2023-12-20 26/week @ 2023-12-27 254/week @ 2024-01-03 443/week @ 2024-01-10 88/week @ 2024-01-17 202/week @ 2024-01-24 607/week @ 2024-01-31 203/week @ 2024-02-07 307/week @ 2024-02-14 230/week @ 2024-02-21 107/week @ 2024-02-28 115/week @ 2024-03-06 124/week @ 2024-03-13 118/week @ 2024-03-20

494 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