~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/netfilter_bridge.h

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __LINUX_BRIDGE_NETFILTER_H
  3 #define __LINUX_BRIDGE_NETFILTER_H
  4 
  5 #include <uapi/linux/netfilter_bridge.h>
  6 #include <linux/skbuff.h>
  7 
  8 enum nf_br_hook_priorities {
  9         NF_BR_PRI_FIRST = INT_MIN,
 10         NF_BR_PRI_NAT_DST_BRIDGED = -300,
 11         NF_BR_PRI_FILTER_BRIDGED = -200,
 12         NF_BR_PRI_BRNF = 0,
 13         NF_BR_PRI_NAT_DST_OTHER = 100,
 14         NF_BR_PRI_FILTER_OTHER = 200,
 15         NF_BR_PRI_NAT_SRC = 300,
 16         NF_BR_PRI_LAST = INT_MAX,
 17 };
 18 
 19 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 20 
 21 int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
 22 
 23 static inline void br_drop_fake_rtable(struct sk_buff *skb)
 24 {
 25         struct dst_entry *dst = skb_dst(skb);
 26 
 27         if (dst && (dst->flags & DST_FAKE_RTABLE))
 28                 skb_dst_drop(skb);
 29 }
 30 
 31 static inline int nf_bridge_get_physinif(const struct sk_buff *skb)
 32 {
 33         struct nf_bridge_info *nf_bridge;
 34 
 35         if (skb->nf_bridge == NULL)
 36                 return 0;
 37 
 38         nf_bridge = skb->nf_bridge;
 39         return nf_bridge->physindev ? nf_bridge->physindev->ifindex : 0;
 40 }
 41 
 42 static inline int nf_bridge_get_physoutif(const struct sk_buff *skb)
 43 {
 44         struct nf_bridge_info *nf_bridge;
 45 
 46         if (skb->nf_bridge == NULL)
 47                 return 0;
 48 
 49         nf_bridge = skb->nf_bridge;
 50         return nf_bridge->physoutdev ? nf_bridge->physoutdev->ifindex : 0;
 51 }
 52 
 53 static inline struct net_device *
 54 nf_bridge_get_physindev(const struct sk_buff *skb)
 55 {
 56         return skb->nf_bridge ? skb->nf_bridge->physindev : NULL;
 57 }
 58 
 59 static inline struct net_device *
 60 nf_bridge_get_physoutdev(const struct sk_buff *skb)
 61 {
 62         return skb->nf_bridge ? skb->nf_bridge->physoutdev : NULL;
 63 }
 64 
 65 static inline bool nf_bridge_in_prerouting(const struct sk_buff *skb)
 66 {
 67         return skb->nf_bridge && skb->nf_bridge->in_prerouting;
 68 }
 69 #else
 70 #define br_drop_fake_rtable(skb)                do { } while (0)
 71 static inline bool nf_bridge_in_prerouting(const struct sk_buff *skb)
 72 {
 73         return false;
 74 }
 75 #endif /* CONFIG_BRIDGE_NETFILTER */
 76 
 77 #endif
 78 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp