Info

struct nf_hook_ops

struct list_head list;

nf_hookfn *hook;

struct module *owner;

int pf;

int hooknum;

/* Hooks are ordered in ascending priority. */ int priority;

In addition to the standard elements (list for linking the structure in a doubly linked list, and owner as a pointer to the module data structure of the owner module if the hook is implemented modularly), there are other elements with the following meanings:

□ hook is a pointer to the hook function that requires the same arguments as the nf_hook macro: <netfilter.h>

typedef unsigned int nf_hookfn(unsigned int hooknum, struct sk_buff **skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *));

□ pf and hooknum specify the protocol family and the number associated with the hook. This information could also be derived from the position of the hook list in nf_hooks.

□ The hooks in a list are sorted in ascending priority (indicated by priority). The full signed int range can be used to indicate the priority, but a number of preferred defaults are defined:

Continue reading here: Info

Was this article helpful?

0 0