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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ 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 struct nf_bridge_frag_data {
  9         char    mac[ETH_HLEN];
 10         bool    vlan_present;
 11         u16     vlan_tci;
 12         __be16  vlan_proto;
 13 };
 14 
 15 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 16 
 17 int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
 18 
 19 static inline void br_drop_fake_rtable(struct sk_buff *skb)
 20 {
 21         struct dst_entry *dst = skb_dst(skb);
 22 
 23         if (dst && (dst->flags & DST_FAKE_RTABLE))
 24                 skb_dst_drop(skb);
 25 }
 26 
 27 static inline struct nf_bridge_info *
 28 nf_bridge_info_get(const struct sk_buff *skb)
 29 {
 30         return skb_ext_find(skb, SKB_EXT_BRIDGE_NF);
 31 }
 32 
 33 static inline bool nf_bridge_info_exists(const struct sk_buff *skb)
 34 {
 35         return skb_ext_exist(skb, SKB_EXT_BRIDGE_NF);
 36 }
 37 
 38 static inline int nf_bridge_get_physinif(const struct sk_buff *skb)
 39 {
 40         const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 41 
 42         if (!nf_bridge)
 43                 return 0;
 44 
 45         return nf_bridge->physinif;
 46 }
 47 
 48 static inline int nf_bridge_get_physoutif(const struct sk_buff *skb)
 49 {
 50         const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 51 
 52         if (!nf_bridge)
 53                 return 0;
 54 
 55         return nf_bridge->physoutdev ? nf_bridge->physoutdev->ifindex : 0;
 56 }
 57 
 58 static inline struct net_device *
 59 nf_bridge_get_physindev(const struct sk_buff *skb, struct net *net)
 60 {
 61         const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 62 
 63         return nf_bridge ? dev_get_by_index_rcu(net, nf_bridge->physinif) : NULL;
 64 }
 65 
 66 static inline struct net_device *
 67 nf_bridge_get_physoutdev(const struct sk_buff *skb)
 68 {
 69         const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 70 
 71         return nf_bridge ? nf_bridge->physoutdev : NULL;
 72 }
 73 
 74 static inline bool nf_bridge_in_prerouting(const struct sk_buff *skb)
 75 {
 76         const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 77 
 78         return nf_bridge && nf_bridge->in_prerouting;
 79 }
 80 #else
 81 #define br_drop_fake_rtable(skb)                do { } while (0)
 82 static inline bool nf_bridge_in_prerouting(const struct sk_buff *skb)
 83 {
 84         return false;
 85 }
 86 #endif /* CONFIG_BRIDGE_NETFILTER */
 87 
 88 #endif
 89 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php