nf_hook(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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