#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

#23 in #ts

Download history 369/week @ 2024-01-07 219/week @ 2024-01-14 147/week @ 2024-01-21 498/week @ 2024-01-28 224/week @ 2024-02-04 445/week @ 2024-02-11 157/week @ 2024-02-18 169/week @ 2024-02-25 127/week @ 2024-03-03 74/week @ 2024-03-10 177/week @ 2024-03-17 356/week @ 2024-03-24 403/week @ 2024-03-31 130/week @ 2024-04-07 280/week @ 2024-04-14 583/week @ 2024-04-21

1,401 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