include/net/ip6_fib.h
Source file repositories/reference/linux-study-clean/include/net/ip6_fib.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/ip6_fib.h- Extension
.h- Size
- 18642 bytes
- Lines
- 743
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ipv6_route.hlinux/rtnetlink.hlinux/spinlock.hlinux/notifier.hnet/dst.hnet/flow.hnet/ip_fib.hnet/netlink.hnet/inetpeer.hnet/fib_notifier.hlinux/indirect_call_wrapper.huapi/linux/bpf.h
Detected Declarations
struct rt6_infostruct fib6_infostruct fib6_configstruct fib6_nodestruct fib6_gc_argsstruct rt6keystruct fib6_tablestruct rt6_exception_bucketstruct rt6_exceptionstruct fib6_nhstruct fib6_infostruct rt6_infostruct fib6_resultstruct fib6_walkerstruct rt6_statisticsstruct fib6_tablestruct fib6_entry_notifier_infostruct ipv6_route_iterstruct bpf_iter__ipv6_routeenum fib6_walk_statefunction fib6_routes_require_srcfunction fib6_routes_require_src_incfunction fib6_routes_require_src_incfunction fib6_routes_require_src_decfunction fib6_requires_srcfunction fib6_clean_expiresfunction fib6_set_expiresfunction fib6_check_expiredfunction fib6_get_cookie_safefunction rt6_get_cookiefunction ip6_rt_putfunction fib6_info_holdfunction fib6_info_hold_safefunction fib6_info_releasefunction rt6_get_prefsrcfunction fib6_nh_initfunction fib6_nh_releasefunction fib6_rt_updatefunction fib6_add_gc_listfunction fib6_remove_gc_listfunction fib6_may_remove_gc_listfunction fib6_update_sernum_upto_rootfunction fib6_metric_lockedfunction fib6_has_custom_rulesfunction fib6_rules_early_flow_dissectfunction fib6_has_custom_rulesfunction fib6_rules_initfunction fib6_rules_cleanup
Annotated Snippet
struct fib6_config {
u32 fc_table;
u32 fc_metric;
int fc_dst_len;
int fc_src_len;
int fc_ifindex;
u32 fc_flags;
u32 fc_protocol;
u16 fc_type; /* only 8 bits are used */
u16 fc_delete_all_nh : 1,
fc_ignore_dev_down:1,
__unused : 14;
u32 fc_nh_id;
struct in6_addr fc_dst;
struct in6_addr fc_src;
struct in6_addr fc_prefsrc;
struct in6_addr fc_gateway;
unsigned long fc_expires;
struct nlattr *fc_mx;
int fc_mx_len;
int fc_mp_len;
struct nlattr *fc_mp;
struct nl_info fc_nlinfo;
struct nlattr *fc_encap;
u16 fc_encap_type;
bool fc_is_fdb;
};
struct fib6_node {
struct fib6_node __rcu *parent;
struct fib6_node __rcu *left;
struct fib6_node __rcu *right;
#ifdef CONFIG_IPV6_SUBTREES
struct fib6_node __rcu *subtree;
#endif
struct fib6_info __rcu *leaf;
__u16 fn_bit; /* bit key */
__u16 fn_flags;
int fn_sernum;
struct fib6_info __rcu *rr_ptr;
struct rcu_head rcu;
};
struct fib6_gc_args {
int timeout;
int more;
};
#ifndef CONFIG_IPV6_SUBTREES
#define FIB6_SUBTREE(fn) NULL
static inline bool fib6_routes_require_src(const struct net *net)
{
return false;
}
static inline void fib6_routes_require_src_inc(struct net *net) {}
static inline void fib6_routes_require_src_dec(struct net *net) {}
#else
static inline bool fib6_routes_require_src(const struct net *net)
{
return net->ipv6.fib6_routes_require_src > 0;
}
static inline void fib6_routes_require_src_inc(struct net *net)
{
net->ipv6.fib6_routes_require_src++;
}
static inline void fib6_routes_require_src_dec(struct net *net)
{
net->ipv6.fib6_routes_require_src--;
}
#define FIB6_SUBTREE(fn) (rcu_dereference_protected((fn)->subtree, 1))
#endif
/*
* routing information
*
*/
struct rt6key {
struct in6_addr addr;
Annotation
- Immediate include surface: `linux/ipv6_route.h`, `linux/rtnetlink.h`, `linux/spinlock.h`, `linux/notifier.h`, `net/dst.h`, `net/flow.h`, `net/ip_fib.h`, `net/netlink.h`.
- Detected declarations: `struct rt6_info`, `struct fib6_info`, `struct fib6_config`, `struct fib6_node`, `struct fib6_gc_args`, `struct rt6key`, `struct fib6_table`, `struct rt6_exception_bucket`, `struct rt6_exception`, `struct fib6_nh`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.