Expand description
Just enough of the kernel’s BTF (/sys/kernel/btf/vmlinux) to find
where a struct member lives, so the probes can read the netns of a
request on any kernel: Rust eBPF has no CO-RE, so the loader resolves
the offsets here and hands them to the object as globals (crate docs,
“Namespaces”). Trusted code in the loader, so: read-only, every read
bounds-checked, recursion bounded, and an answer only when each member
found lies inside its struct; anything else is an error (the loader
writes failed), never a panic.
Structs§
- Btf
- Cgroup
Offsets - Where the probes find the sender’s cgroup names (crate docs,
“Attribution”):
task_struct.cgroups,css_set.dfl_cgrp,cgroup.kn,kernfs_node.name, and its parent (__parentsince 6.15,parentbefore). - Member 🔒
- Netdev
Offsets - Where the
register_netdeviceprobe finds the new device’s name and netns:net_device.name(char[IFNAMSIZ]) andnet_device.nd_net.net. - Netns
Offsets - Where the probes find a request’s network namespace (crate docs,
“Namespaces”):
skb->sk,sk->__sk_common.skc_net.net, andnet->ns.inum. - Ty 🔒
Constants§
- DEPTH 🔒
- How deep anonymous members and typedef chains are followed.
- KIND_
ARRAY 🔒 - KIND_
CONST 🔒 - KIND_
DATASEC 🔒 - KIND_
DECL_ 🔒TAG - KIND_
ENUM 🔒 - KIND_
ENUM64 🔒 - KIND_
FLOAT 🔒 - KIND_
FUNC_ 🔒PROTO - KIND_
INT 🔒 - KIND_
PTR 🔒 - KIND_
RESTRICT 🔒 - KIND_
STRUCT 🔒 - KIND_
TYPEDEF 🔒 - KIND_
TYPE_ 🔒TAG - KIND_
UNION 🔒 - KIND_
VAR 🔒 - KIND_
VOLATILE 🔒 - MAGIC 🔒
Functions§
- u32_at 🔒