include/linux/netfilter_bridge.h
Source file repositories/reference/linux-study-clean/include/linux/netfilter_bridge.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/netfilter_bridge.h- Extension
.h- Size
- 2134 bytes
- Lines
- 89
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/linux/netfilter_bridge.hlinux/skbuff.h
Detected Declarations
struct nf_bridge_frag_datafunction br_drop_fake_rtablefunction nf_bridge_info_getfunction nf_bridge_info_existsfunction nf_bridge_get_physiniffunction nf_bridge_get_physoutiffunction nf_bridge_get_physindevfunction nf_bridge_get_physoutdevfunction nf_bridge_in_preroutingfunction nf_bridge_in_prerouting
Annotated Snippet
struct nf_bridge_frag_data {
char mac[ETH_HLEN];
bool vlan_present;
u16 vlan_tci;
__be16 vlan_proto;
};
#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
static inline void br_drop_fake_rtable(struct sk_buff *skb)
{
struct dst_entry *dst = skb_dst(skb);
if (dst && (dst->flags & DST_FAKE_RTABLE))
skb_dst_drop(skb);
}
static inline struct nf_bridge_info *
nf_bridge_info_get(const struct sk_buff *skb)
{
return skb_ext_find(skb, SKB_EXT_BRIDGE_NF);
}
static inline bool nf_bridge_info_exists(const struct sk_buff *skb)
{
return skb_ext_exist(skb, SKB_EXT_BRIDGE_NF);
}
static inline int nf_bridge_get_physinif(const struct sk_buff *skb)
{
const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
if (!nf_bridge)
return 0;
return nf_bridge->physinif;
}
static inline int nf_bridge_get_physoutif(const struct sk_buff *skb)
{
const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
if (!nf_bridge)
return 0;
return nf_bridge->physoutdev ? nf_bridge->physoutdev->ifindex : 0;
}
static inline struct net_device *
nf_bridge_get_physindev(const struct sk_buff *skb, struct net *net)
{
const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
return nf_bridge ? dev_get_by_index_rcu(net, nf_bridge->physinif) : NULL;
}
static inline struct net_device *
nf_bridge_get_physoutdev(const struct sk_buff *skb)
{
const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
return nf_bridge ? nf_bridge->physoutdev : NULL;
}
static inline bool nf_bridge_in_prerouting(const struct sk_buff *skb)
{
const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
return nf_bridge && nf_bridge->in_prerouting;
}
#else
#define br_drop_fake_rtable(skb) do { } while (0)
static inline bool nf_bridge_in_prerouting(const struct sk_buff *skb)
{
return false;
}
#endif /* CONFIG_BRIDGE_NETFILTER */
#endif
Annotation
- Immediate include surface: `uapi/linux/netfilter_bridge.h`, `linux/skbuff.h`.
- Detected declarations: `struct nf_bridge_frag_data`, `function br_drop_fake_rtable`, `function nf_bridge_info_get`, `function nf_bridge_info_exists`, `function nf_bridge_get_physinif`, `function nf_bridge_get_physoutif`, `function nf_bridge_get_physindev`, `function nf_bridge_get_physoutdev`, `function nf_bridge_in_prerouting`, `function nf_bridge_in_prerouting`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.