nf_hook(9)
Okay bestie, welcome to the nf_hook(9) page from the Kernel API Manual πΈ. This is the one about calling a netfilter hook, and the original is lowkey mysterious about the arguments. We are keeping every crumb exactly as it is, no cap β¨.
π NAME π
nf_hook β call a netfilter hook π¦
β¨ SYNOPSIS β¨
int nf_hook (u_int8_t pf , unsigned int hook , struct net *net , struct sock *sk , struct sk_buff *skb , struct net_device *indev , struct net_device *outdev , int (*okfn)(struct net *, struct sock *, struct sk_buff *) );
π ARGUMENTS π
Okay so the original manpage is giving absolutely zero lore for these, and I am not about to invent any. Every single one says -- undescribed --, periodt π
:
pfβ-- undescribed --hookβ-- undescribed --netβ-- undescribed --skβ-- undescribed --skbβ-- undescribed --indevβ-- undescribed --outdevβ-- undescribed --okfnβ-- undescribed --
π₯ DESCRIPTION π₯
Returns 1 if the hook has allowed the packet to pass β
. The function okfn must be invoked by the caller in this case β like, the caller has to do it, no skipping π.
Any other return value indicates the packet has been consumed by the hook π. That is the whole description, bestie, and we are keeping it 100.
π SEE ALSO π
- Kernel file
./include/linux/netfilter.hπ
xoxo, your kernel bestie π β source/version: ./include/linux Β· date: October 2026 Β· page: nf_hook(9) π«Ά
π¦ 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