tc_prog_attach(9)
π
tc_prog_attach(9) π
okay bestie, welcome to the Kernel API Manual entry for tc_prog_attach(9) β it's giving βattach BPF program(s) to an interfaceβ energy, and we are gonna get you all the way together. β¨
β¨ NAME β¨
tc_prog_attach β attach BPF program(s) to an interface. no cap, that's the whole assignment. π
πΈ SYNOPSIS πΈ
int tc_prog_attach (const char *dev , int ingress_fd , int egress_fd );
π ARGUMENTS π
devβ a string containing the interface name, periodt. πingress_fdβ the file descriptor of the program to attach to interface ingress. π¦egress_fdβ the file descriptor of the program to attach to interface egress. πΈ
π DESCRIPTION π
okay so here's the vibe: this function takes file descriptors pointing to at least one, at most two BPF programs, and attaches those programs to an interface's ingress, egress, or both. main character behavior honestly. π
It returns 0 on success. it returns -1 if no valid file descriptor has been found, if the interface name is invalid, or if an error occurred during attach. lowkey important, bestie: check that return value. π
π¦ SEE ALSO π¦
- Kernel file
./tools/testing/selftests/bpf/network_helpers.h open_netns(9)append_tid(9)csum_tcpudp_magic(9)csum_ipv6_magic(9)build_udp_v4_csum(9)build_udp_v6_csum(9)
xoxo, your Unix bestie π β source/version: ./tools/testing/selftests/bpf; date: October 2026. periodt. π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms