TC ingress program for PROXY protocol v2 header injection.
This program runs on the TC ingress path (after XDP DNAT) and injects PROXY protocol v2 headers into the first data packet of each connection that has proxy-protocol enabled.
Flow:
TC ingress program for PROXY protocol v2 header injection. This program runs on the TC ingress path (after XDP DNAT) and injects PROXY protocol v2 headers into the first data packet of each connection that has proxy-protocol enabled. Flow: 1. Parse packet headers (Ethernet, IPv4/IPv6, TCP) 2. Lookup conntrack entry by 5-tuple 3. Check if proxy_enabled flag is set 4. Track TCP state (NEW -> SYN_SENT -> SYN_RECV -> ESTABLISHED) 5. On first DATA packet in ESTABLISHED: inject PROXY v2 header 6. Set header_injected flag and seq_offset for subsequent packets
(attach-to-interface prog iface & {:keys [priority] :or {priority 1}})Attach TC program to interface ingress. Returns true on success.
Attach TC program to interface ingress. Returns true on success.
(attach-to-interfaces prog interfaces & opts)Attach TC ingress program to multiple interfaces.
Attach TC ingress program to multiple interfaces.
(build-tc-ingress-proxy-program map-fds)Build the TC ingress program for PROXY protocol v2 header injection.
This program:
map-fds: Map containing :conntrack-map from unified maps
Returns assembled TC program bytecode.
Build the TC ingress program for PROXY protocol v2 header injection. This program: 1. Parses Ethernet/IP/TCP headers 2. Looks up conntrack entry by 5-tuple 3. Checks proxy_enabled flag 4. Tracks TCP state machine 5. Injects PROXY v2 header on first data packet in ESTABLISHED state 6. Adjusts sequence numbers for subsequent packets map-fds: Map containing :conntrack-map from unified maps Returns assembled TC program bytecode.
(build-tc-pass-program)Build a simple TC program that passes all packets.
Build a simple TC program that passes all packets.
(detach-from-interface iface & {:keys [priority] :or {priority 1}})Detach TC ingress program from interface.
Detach TC ingress program from interface.
(detach-from-interfaces interfaces & opts)Detach TC ingress program from multiple interfaces.
Detach TC ingress program from multiple interfaces.
(load-program maps)Load TC ingress program into kernel. Returns a BpfProgram record or throws on error.
Load TC ingress program into kernel. Returns a BpfProgram record or throws on error.
(tc-load-skb-data)Load SKB data and data_end pointers. SKB structure: data at offset 76, data_end at offset 80 Saves: SKB -> r6, data -> r7, data_end -> r8
Load SKB data and data_end pointers. SKB structure: data at offset 76, data_end at offset 80 Saves: SKB -> r6, data -> r7, data_end -> r8
(tc-reload-data-ptrs)Reload data pointers from saved SKB context (r6). Required after helpers that may invalidate pointers.
Reload data pointers from saved SKB context (r6). Required after helpers that may invalidate pointers.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |