]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - include/linux/netfilter_ingress.h
Merge remote-tracking branch 'file-locks/linux-next'
[karo-tx-linux.git] / include / linux / netfilter_ingress.h
1 #ifndef _NETFILTER_INGRESS_H_
2 #define _NETFILTER_INGRESS_H_
3
4 #include <linux/netfilter.h>
5 #include <linux/netdevice.h>
6
7 #ifdef CONFIG_NETFILTER_INGRESS
8 static inline int nf_hook_ingress_active(struct sk_buff *skb)
9 {
10         return nf_hook_list_active(&skb->dev->nf_hooks_ingress,
11                                    NFPROTO_NETDEV, NF_NETDEV_INGRESS);
12 }
13
14 static inline int nf_hook_ingress(struct sk_buff *skb)
15 {
16         struct nf_hook_state state;
17
18         nf_hook_state_init(&state, &skb->dev->nf_hooks_ingress,
19                            NF_NETDEV_INGRESS, INT_MIN, NFPROTO_NETDEV, NULL,
20                            skb->dev, NULL, dev_net(skb->dev), NULL);
21         return nf_hook_slow(skb, &state);
22 }
23
24 static inline void nf_hook_ingress_init(struct net_device *dev)
25 {
26         INIT_LIST_HEAD(&dev->nf_hooks_ingress);
27 }
28 #else /* CONFIG_NETFILTER_INGRESS */
29 static inline int nf_hook_ingress_active(struct sk_buff *skb)
30 {
31         return 0;
32 }
33
34 static inline int nf_hook_ingress(struct sk_buff *skb)
35 {
36         return 0;
37 }
38
39 static inline void nf_hook_ingress_init(struct net_device *dev) {}
40 #endif /* CONFIG_NETFILTER_INGRESS */
41 #endif /* _NETFILTER_INGRESS_H_ */