Liking cljdoc? Tell your friends :D

clj-ebpf.net

Networking helpers for eBPF programs.

Provides reusable primitives for packet parsing, manipulation, and checksum operations for load balancers, NAT gateways, firewalls, and other networking applications.

Networking helpers for eBPF programs.

Provides reusable primitives for packet parsing, manipulation,
and checksum operations for load balancers, NAT gateways,
firewalls, and other networking applications.
raw docstring

check-boundsclj

(check-bounds data-reg data-end-reg offset fail-label scratch-reg)

Generate instructions to verify packet has required bytes. Returns instructions that jump to fail-label if bounds check fails.

data-reg: Register containing packet data pointer data-end-reg: Register containing data_end pointer offset: Number of bytes needed from data pointer fail-label: Label offset to jump to on failure (positive integer) scratch-reg: Scratch register for calculation

Generate instructions to verify packet has required bytes.
Returns instructions that jump to fail-label if bounds check fails.

data-reg: Register containing packet data pointer
data-end-reg: Register containing data_end pointer
offset: Number of bytes needed from data pointer
fail-label: Label offset to jump to on failure (positive integer)
scratch-reg: Scratch register for calculation
sourceraw docstring

check-bounds-dynamicclj

(check-bounds-dynamic data-reg data-end-reg offset-reg fail-label scratch-reg)

Generate bounds check with dynamic offset in register.

data-reg: Register containing packet data pointer data-end-reg: Register containing data_end pointer offset-reg: Register containing offset value fail-label: Label offset to jump to on failure (positive integer) scratch-reg: Scratch register for calculation

Generate bounds check with dynamic offset in register.

data-reg: Register containing packet data pointer
data-end-reg: Register containing data_end pointer
offset-reg: Register containing offset value
fail-label: Label offset to jump to on failure (positive integer)
scratch-reg: Scratch register for calculation
sourceraw docstring

ETH-ALENclj

source

ETH-HLENclj

source

eth-offsetclj

(eth-offset field)

Return offset within Ethernet header.

field: :dst-mac, :src-mac, :ethertype

Return offset within Ethernet header.

field: :dst-mac, :src-mac, :ethertype
sourceraw docstring

ETH-P-8021ADclj

source

ETH-P-8021Qclj

source

ETH-P-ARPclj

source

ETH-P-IPclj

source

ETH-P-IPV6clj

source

ICMP-HLENclj

source

icmp-offsetclj

(icmp-offset field)

Return offset within ICMP header (from ICMP header start).

field: :type, :code, :check, :rest-of-header

Return offset within ICMP header (from ICMP header start).

field: :type, :code, :check, :rest-of-header
sourceraw docstring

IPPROTO-GREclj

source

IPPROTO-ICMPclj

source

IPPROTO-ICMPV6clj

source

IPPROTO-SCTPclj

source

IPPROTO-TCPclj

source

IPPROTO-UDPclj

source

IPV4-MIN-HLENclj

source

ipv4-offsetclj

(ipv4-offset field)

Return offset within IPv4 header (from IP header start).

field: :version-ihl, :tos, :tot-len, :id, :frag-off, :ttl, :protocol, :check, :saddr, :daddr

Return offset within IPv4 header (from IP header start).

field: :version-ihl, :tos, :tot-len, :id, :frag-off,
       :ttl, :protocol, :check, :saddr, :daddr
sourceraw docstring

IPV6-HLENclj

source

ipv6-offsetclj

(ipv6-offset field)

Return offset within IPv6 header (from IP header start).

field: :version-tc-flow, :payload-len, :next-header, :hop-limit, :saddr, :daddr

Return offset within IPv6 header (from IP header start).

field: :version-tc-flow, :payload-len, :next-header,
       :hop-limit, :saddr, :daddr
sourceraw docstring

load-be16clj

(load-be16 dst-reg src-reg offset)

Load 16-bit value from packet and convert to host byte order.

dst-reg: Destination register src-reg: Register pointing to memory offset: Offset from src-reg

Load 16-bit value from packet and convert to host byte order.

dst-reg: Destination register
src-reg: Register pointing to memory
offset: Offset from src-reg
sourceraw docstring

load-be32clj

(load-be32 dst-reg src-reg offset)

Load 32-bit value from packet and convert to host byte order.

dst-reg: Destination register src-reg: Register pointing to memory offset: Offset from src-reg

Load 32-bit value from packet and convert to host byte order.

dst-reg: Destination register
src-reg: Register pointing to memory
offset: Offset from src-reg
sourceraw docstring

return-actionclj

(return-action action)

Generate instructions to return an action code and exit.

action: Action code (XDP-PASS, TC-ACT-OK, etc.)

Generate instructions to return an action code and exit.

action: Action code (XDP-PASS, TC-ACT-OK, etc.)
sourceraw docstring

save-ctxclj

(save-ctx ctx-reg save-reg)

Save context pointer to callee-saved register. BPF calling convention: r1-r5 are clobbered by helper calls.

ctx-reg: Register containing context (typically :r1) save-reg: Callee-saved register to save to (r6-r9)

Save context pointer to callee-saved register.
BPF calling convention: r1-r5 are clobbered by helper calls.

ctx-reg: Register containing context (typically :r1)
save-reg: Callee-saved register to save to (r6-r9)
sourceraw docstring

store-be16clj

(store-be16 dst-reg offset src-reg scratch-reg)

Convert 16-bit value to network byte order and store.

dst-reg: Register pointing to memory offset: Offset from dst-reg src-reg: Register containing value (host order) scratch-reg: Scratch register for conversion

Convert 16-bit value to network byte order and store.

dst-reg: Register pointing to memory
offset: Offset from dst-reg
src-reg: Register containing value (host order)
scratch-reg: Scratch register for conversion
sourceraw docstring

store-be32clj

(store-be32 dst-reg offset src-reg scratch-reg)

Convert 32-bit value to network byte order and store.

dst-reg: Register pointing to memory offset: Offset from dst-reg src-reg: Register containing value (host order) scratch-reg: Scratch register for conversion

Convert 32-bit value to network byte order and store.

dst-reg: Register pointing to memory
offset: Offset from dst-reg
src-reg: Register containing value (host order)
scratch-reg: Scratch register for conversion
sourceraw docstring

TC-ACT-OKclj

source

TC-ACT-PIPEclj

source

TC-ACT-QUEUEDclj

source

TC-ACT-RECLASSIFYclj

source

TC-ACT-REDIRECTclj

source

TC-ACT-REPEATclj

source

TC-ACT-SHOTclj

source

TC-ACT-STOLENclj

source

tc-load-data-ptrsclj

(tc-load-data-ptrs data-reg data-end-reg ctx-reg)

Load data and data_end pointers from TC/SKB context. SKB: data at offset 76, data_end at offset 80 (32-bit offsets in SKB).

data-reg: Register to store data pointer data-end-reg: Register to store data_end pointer ctx-reg: SKB context register (typically :r1)

Load data and data_end pointers from TC/SKB context.
SKB: data at offset 76, data_end at offset 80 (32-bit offsets in SKB).

data-reg: Register to store data pointer
data-end-reg: Register to store data_end pointer
ctx-reg: SKB context register (typically :r1)
sourceraw docstring

TCP-ACKclj

source

TCP-CWRclj

source

TCP-ECEclj

source

TCP-FINclj

source

TCP-MIN-HLENclj

source

tcp-offsetclj

(tcp-offset field)

Return offset within TCP header (from TCP header start).

field: :sport, :dport, :seq, :ack-seq, :data-off, :flags, :window, :check, :urg-ptr

Return offset within TCP header (from TCP header start).

field: :sport, :dport, :seq, :ack-seq, :data-off,
       :flags, :window, :check, :urg-ptr
sourceraw docstring

TCP-PSHclj

source

TCP-RSTclj

source

TCP-SYNclj

source

TCP-URGclj

source

UDP-HLENclj

source

udp-offsetclj

(udp-offset field)

Return offset within UDP header (from UDP header start).

field: :sport, :dport, :len, :check

Return offset within UDP header (from UDP header start).

field: :sport, :dport, :len, :check
sourceraw docstring

XDP-ABORTEDclj

source

XDP-DROPclj

source

xdp-load-data-ptrsclj

(xdp-load-data-ptrs data-reg data-end-reg ctx-reg)

Load data and data_end pointers from XDP context. XDP md structure: __u32 data; // offset 0 __u32 data_end; // offset 4 __u32 data_meta; // offset 8

data-reg: Register to store data pointer data-end-reg: Register to store data_end pointer ctx-reg: XDP context register (typically :r1)

Load data and data_end pointers from XDP context.
XDP md structure:
  __u32 data;        // offset 0
  __u32 data_end;    // offset 4
  __u32 data_meta;   // offset 8

data-reg: Register to store data pointer
data-end-reg: Register to store data_end pointer
ctx-reg: XDP context register (typically :r1)
sourceraw docstring

XDP-PASSclj

source

XDP-REDIRECTclj

source

XDP-TXclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close