net/ipv4/fib_lookup.h
Source file repositories/reference/linux-study-clean/net/ipv4/fib_lookup.h
File Facts
- System
- Linux kernel
- Corpus path
net/ipv4/fib_lookup.h- Extension
.h- Size
- 1759 bytes
- Lines
- 66
- 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
linux/types.hlinux/list.hnet/inet_dscp.hnet/ip_fib.hnet/nexthop.h
Detected Declarations
struct fib_aliasstruct fib_propfunction fib_alias_accessedfunction fib_result_assign
Annotated Snippet
struct fib_alias {
struct hlist_node fa_list;
struct fib_info *fa_info;
dscp_t fa_dscp;
u8 fa_type;
u8 fa_state;
u8 fa_slen;
u32 tb_id;
s16 fa_default;
u8 offload;
u8 trap;
u8 offload_failed;
struct rcu_head rcu;
};
#define FA_S_ACCESSED 0x01
/* Don't write on fa_state unless needed, to keep it shared on all cpus */
static inline void fib_alias_accessed(struct fib_alias *fa)
{
u8 fa_state = READ_ONCE(fa->fa_state);
if (!(fa_state & FA_S_ACCESSED))
WRITE_ONCE(fa->fa_state, fa_state | FA_S_ACCESSED);
}
/* Exported by fib_semantics.c */
void fib_release_info(struct fib_info *);
struct fib_info *fib_create_info(struct fib_config *cfg,
struct netlink_ext_ack *extack);
int fib_nh_match(struct net *net, struct fib_config *cfg, struct fib_info *fi,
struct netlink_ext_ack *extack);
bool fib_metrics_match(struct fib_config *cfg, struct fib_info *fi);
int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
const struct fib_rt_info *fri, unsigned int flags);
void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, int dst_len,
u32 tb_id, const struct nl_info *info, unsigned int nlm_flags);
size_t fib_nlmsg_size(struct fib_info *fi);
static inline void fib_result_assign(struct fib_result *res,
struct fib_info *fi)
{
/* we used to play games with refcounts, but we now use RCU */
res->fi = fi;
res->nhc = fib_info_nhc(fi, 0);
}
struct fib_prop {
int error;
u8 scope;
};
extern const struct fib_prop fib_props[RTN_MAX + 1];
#endif /* _FIB_LOOKUP_H */
Annotation
- Immediate include surface: `linux/types.h`, `linux/list.h`, `net/inet_dscp.h`, `net/ip_fib.h`, `net/nexthop.h`.
- Detected declarations: `struct fib_alias`, `struct fib_prop`, `function fib_alias_accessed`, `function fib_result_assign`.
- 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.