include/net/netfilter/nf_dup_netdev.h
Source file repositories/reference/linux-study-clean/include/net/netfilter/nf_dup_netdev.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/netfilter/nf_dup_netdev.h- Extension
.h- Size
- 1289 bytes
- Lines
- 54
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/netfilter/nf_tables.hlinux/netdevice.hlinux/sched.h
Detected Declarations
struct nft_offload_ctxstruct nft_flow_rulefunction nf_dev_xmit_recursionfunction nf_dev_xmit_recursion_incfunction nf_dev_xmit_recursion_decfunction nf_dev_xmit_recursionfunction nf_dev_xmit_recursion_incfunction nf_dev_xmit_recursion_dec
Annotated Snippet
#ifndef _NF_DUP_NETDEV_H_
#define _NF_DUP_NETDEV_H_
#include <net/netfilter/nf_tables.h>
#include <linux/netdevice.h>
#include <linux/sched.h>
void nf_dup_netdev_egress(const struct nft_pktinfo *pkt, int oif);
void nf_fwd_netdev_egress(const struct nft_pktinfo *pkt, int oif);
#define NF_RECURSION_LIMIT 2
#ifndef CONFIG_PREEMPT_RT
static inline bool nf_dev_xmit_recursion(void)
{
return unlikely(__this_cpu_read(softnet_data.xmit.nf_dup_skb_recursion) >
NF_RECURSION_LIMIT);
}
static inline void nf_dev_xmit_recursion_inc(void)
{
__this_cpu_inc(softnet_data.xmit.nf_dup_skb_recursion);
}
static inline void nf_dev_xmit_recursion_dec(void)
{
__this_cpu_dec(softnet_data.xmit.nf_dup_skb_recursion);
}
#else
static inline bool nf_dev_xmit_recursion(void)
{
return unlikely(current->net_xmit.nf_dup_skb_recursion > NF_RECURSION_LIMIT);
}
static inline void nf_dev_xmit_recursion_inc(void)
{
current->net_xmit.nf_dup_skb_recursion++;
}
static inline void nf_dev_xmit_recursion_dec(void)
{
current->net_xmit.nf_dup_skb_recursion--;
}
#endif
struct nft_offload_ctx;
struct nft_flow_rule;
int nft_fwd_dup_netdev_offload(struct nft_offload_ctx *ctx,
struct nft_flow_rule *flow,
enum flow_action_id id, int oif);
#endif
Annotation
- Immediate include surface: `net/netfilter/nf_tables.h`, `linux/netdevice.h`, `linux/sched.h`.
- Detected declarations: `struct nft_offload_ctx`, `struct nft_flow_rule`, `function nf_dev_xmit_recursion`, `function nf_dev_xmit_recursion_inc`, `function nf_dev_xmit_recursion_dec`, `function nf_dev_xmit_recursion`, `function nf_dev_xmit_recursion_inc`, `function nf_dev_xmit_recursion_dec`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.