1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
[]
= "pktkit"
= "0.1.3"
= "2024"
= "1.88"
= ["Karpeles Lab Inc."]
= "MIT"
= "Zero-copy L2/L3 packet handling toolkit. Frames, packets, hubs, adapters, NAT, virtual TCP/IP, WireGuard, OpenVPN, QEMU networking, TUN/TAP, AF_XDP — all gated behind opt-in cargo features."
= "https://github.com/KarpelesLab/pktkit-rs"
= "https://github.com/KarpelesLab/pktkit-rs"
= "https://docs.rs/pktkit"
= "README.md"
= ["networking", "packet", "tcp", "wireguard", "tun"]
= ["network-programming", "virtualization"]
# The fuzzing harness is a separate crate that depends on this one; it has no
# business in the published package.
= ["fuzz", ".github"]
[]
# By default we ship only the core: Frame, Packet, hubs, pipes, traits.
# Every other capability is opt-in so users only pull the dependencies they need.
= []
# Bridging an L3 device onto an L2 network (ARP, NDP, gateway routing).
= []
# DHCP client codec + DHCPServer. The client is also used by l2adapter
# when StartDHCP() is called.
= []
# Link impairment: delay, jitter, loss, duplication, corruption, rate limits.
# Pure std -- no dependencies.
= []
# Write traffic crossing a device to a .pcap file for Wireshark / tcpdump.
# Pure std -- no dependencies.
= []
# QEMU userspace network socket protocol (client + listener).
= []
# Linux/macOS TUN/TAP device support.
= ["dep:libc"]
# Bind an L2 device to an existing interface with an AF_PACKET socket (Linux).
= ["dep:libc"]
# Linux XDP: load/attach eBPF programs on a device's receive path, with an
# IP-prefix capture program and the maps that drive it.
= ["dep:libc"]
# Linux AF_XDP zero-copy sockets. Layers a userspace datapath on `xdp`.
= ["xdp"]
# Pure-Rust virtual TCP engine.
= []
# Userspace NAT stack (L3Device) routing to real OS sockets.
= ["vtcp"]
# High-level virtual client (Dial / Listen / DNS / minimal HTTP).
= ["vtcp"]
# Packet-level IPv4 NAT, NAT64, ALGs, defrag, UPnP.
# UPnP terminates its SOAP control port with the virtual TCP engine (vtcp).
= ["vtcp"]
# WireGuard tunnel (Noise IK handshake + transport).
= [
"dep:purecrypto",
"purecrypto/hash",
"purecrypto/cipher",
"purecrypto/ec",
"purecrypto/rng",
]
# OpenVPN server (TLS control channel + AES-CBC/GCM data channel).
= [
"dep:purecrypto",
"purecrypto/hash",
"purecrypto/cipher",
"purecrypto/kdf",
"purecrypto/rng",
# The control channel is TLS 1.2 run inside OpenVPN's own reliable
# transport, so it needs the sans-I/O TLS core plus X.509.
"purecrypto/tls",
"purecrypto/x509",
]
# Exposes crate-internal parser entry points to the fuzz targets and the
# randomized robustness test. Not part of `full`; never enable it as a
# dependent -- it is not covered by semver.
= []
# Convenience: enable everything (matches the Go upstream featureset).
= [
"l2adapter",
"dhcp",
"impair",
"pcap",
"qemu",
"tuntap",
"afpacket",
"xdp",
"afxdp",
"vtcp",
"slirp",
"vclient",
"nat",
"wg",
"ovpn",
]
[]
# libc is the only OS-FFI shim we use, gated behind features that need it.
= { = "0.2", = true }
# All cryptography comes from purecrypto: primitives, X.509 and TLS in one
# pure-Rust tree with no foreign code and no build script. `default-features`
# is off so a build pulls only the modules the enabled pktkit features name --
# `wg` does not compile the TLS stack, and `ovpn` does not compile ML-DSA.
= { = "0.7", = true, = false, = ["std", "linux-getrandom"] }
[]
# Tests may exercise OS sockets; nothing extra needed beyond std.
[]
= "pktkit"
= "src/lib.rs"
# Hot-path microbenchmarks. No benchmark framework: the harness is a warmup and
# a timed loop, which keeps the dev-dependency list empty.
[[]]
= "hot_path"
= false
[]
= true
= ["--cfg", "docsrs"]