#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

#18 in #ts

Download history 447/week @ 2024-06-20 197/week @ 2024-06-27 388/week @ 2024-07-04 114/week @ 2024-07-11 140/week @ 2024-07-18 402/week @ 2024-07-25 413/week @ 2024-08-01 377/week @ 2024-08-08 182/week @ 2024-08-15 207/week @ 2024-08-22 212/week @ 2024-08-29 415/week @ 2024-09-05 255/week @ 2024-09-12 497/week @ 2024-09-19 232/week @ 2024-09-26 254/week @ 2024-10-03

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