include/net/netfilter/nft_fib.h
Source file repositories/reference/linux-study-clean/include/net/netfilter/nft_fib.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/netfilter/nft_fib.h- Extension
.h- Size
- 1904 bytes
- Lines
- 70
- 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/l3mdev.hnet/netfilter/nf_tables.h
Detected Declarations
struct nft_fibfunction nft_fib_is_loopbackfunction nft_fib_can_skipfunction nft_fib_l3mdev_master_ifindex_rcu
Annotated Snippet
struct nft_fib {
u8 dreg;
u8 result;
u32 flags;
};
extern const struct nla_policy nft_fib_policy[];
static inline bool
nft_fib_is_loopback(const struct sk_buff *skb, const struct net_device *in)
{
return skb->pkt_type == PACKET_LOOPBACK || in->flags & IFF_LOOPBACK;
}
static inline bool nft_fib_can_skip(const struct nft_pktinfo *pkt)
{
const struct net_device *indev = nft_in(pkt);
const struct sock *sk;
switch (nft_hook(pkt)) {
case NF_INET_PRE_ROUTING:
case NF_INET_INGRESS:
case NF_INET_LOCAL_IN:
break;
default:
return false;
}
sk = pkt->skb->sk;
if (sk && sk_fullsock(sk))
return sk->sk_rx_dst_ifindex == indev->ifindex;
return nft_fib_is_loopback(pkt->skb, indev);
}
static inline int nft_fib_l3mdev_master_ifindex_rcu(const struct nft_pktinfo *pkt,
const struct net_device *iif)
{
const struct net_device *dev = iif ? iif : pkt->skb->dev;
return l3mdev_master_ifindex_rcu(dev);
}
int nft_fib_dump(struct sk_buff *skb, const struct nft_expr *expr, bool reset);
int nft_fib_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
const struct nlattr * const tb[]);
int nft_fib_validate(const struct nft_ctx *ctx, const struct nft_expr *expr);
void nft_fib4_eval_type(const struct nft_expr *expr, struct nft_regs *regs,
const struct nft_pktinfo *pkt);
void nft_fib4_eval(const struct nft_expr *expr, struct nft_regs *regs,
const struct nft_pktinfo *pkt);
void nft_fib6_eval_type(const struct nft_expr *expr, struct nft_regs *regs,
const struct nft_pktinfo *pkt);
void nft_fib6_eval(const struct nft_expr *expr, struct nft_regs *regs,
const struct nft_pktinfo *pkt);
void nft_fib_store_result(void *reg, const struct nft_fib *priv,
const struct net_device *dev);
#endif
Annotation
- Immediate include surface: `net/l3mdev.h`, `net/netfilter/nf_tables.h`.
- Detected declarations: `struct nft_fib`, `function nft_fib_is_loopback`, `function nft_fib_can_skip`, `function nft_fib_l3mdev_master_ifindex_rcu`.
- 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.