1 #ifndef _NETFILTER_INGRESS_H_
2 #define _NETFILTER_INGRESS_H_
4 #include <linux/netfilter.h>
5 #include <linux/netdevice.h>
7 #ifdef CONFIG_NETFILTER_INGRESS
8 static inline int nf_hook_ingress_active(struct sk_buff *skb)
10 return nf_hook_list_active(&skb->dev->nf_hooks_ingress,
11 NFPROTO_NETDEV, NF_NETDEV_INGRESS);
14 static inline int nf_hook_ingress(struct sk_buff *skb)
16 struct nf_hook_state state;
18 nf_hook_state_init(&state, &skb->dev->nf_hooks_ingress,
19 NF_NETDEV_INGRESS, INT_MIN, NFPROTO_NETDEV, NULL,
20 skb->dev, NULL, NULL);
21 return nf_hook_slow(skb, &state);
24 static inline void nf_hook_ingress_init(struct net_device *dev)
26 INIT_LIST_HEAD(&dev->nf_hooks_ingress);
28 #else /* CONFIG_NETFILTER_INGRESS */
29 static inline int nf_hook_ingress_active(struct sk_buff *skb)
34 static inline int nf_hook_ingress(struct sk_buff *skb)
39 static inline void nf_hook_ingress_init(struct net_device *dev) {}
40 #endif /* CONFIG_NETFILTER_INGRESS */
41 #endif /* _NETFILTER_INGRESS_H_ */