Specializing the Data Path - Hooking into the Linux Network Stack
The document outlines various networking concepts and methods in C, specifically related to socket programming and packet filtering in Linux. It includes snippets for setting socket options, registering network hooks, creating filters with Traffic Control (tc), and using BPF (Berkeley Packet Filter) for packet manipulation. Overall, it provides a technical overview of how to interact with network packets at a low level using system calls and kernel functions.
int nf_register_net_hook(struct net*net, const struct nf_hook_ops *ops); int nf_register_net_hooks(struct net *net, const struct nf_hook_ops *reg, unsigned int n); int nf_register_hook(struct nf_hook_ops *reg); int nf_register_hooks(struct nf_hook_ops *reg, unsigned int n);