include/net/fib_rules.h
Source file repositories/reference/linux-study-clean/include/net/fib_rules.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/fib_rules.h- Extension
.h- Size
- 6248 bytes
- Lines
- 231
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/slab.hlinux/netdevice.hlinux/fib_rules.hlinux/refcount.hnet/flow.hnet/rtnetlink.hnet/fib_notifier.hlinux/indirect_call_wrapper.h
Detected Declarations
struct fib_kuid_rangestruct fib_rulestruct fib_lookup_argstruct fib_rules_opsstruct fib_rule_notifier_infofunction fib_rule_getfunction fib_rule_get_safefunction fib_rule_putfunction fib_rule_get_tablefunction fib_rule_get_tablefunction frh_get_tablefunction fib_rule_port_range_setfunction fib_rule_port_inrangefunction fib_rule_port_matchfunction fib_rule_port_range_validfunction fib_rule_port_range_comparefunction fib_rule_port_is_rangefunction fib_rule_requires_fldissect
Annotated Snippet
struct fib_kuid_range {
kuid_t start;
kuid_t end;
};
struct fib_rule {
struct list_head list;
int iifindex;
int oifindex;
u32 mark;
u32 mark_mask;
u32 flags;
u32 table;
u8 action;
u8 l3mdev;
u8 proto;
u8 ip_proto;
u32 target;
__be64 tun_id;
struct fib_rule __rcu *ctarget;
struct net *fr_net;
refcount_t refcnt;
u32 pref;
int suppress_ifgroup;
int suppress_prefixlen;
char iifname[IFNAMSIZ];
char oifname[IFNAMSIZ];
struct fib_kuid_range uid_range;
struct fib_rule_port_range sport_range;
struct fib_rule_port_range dport_range;
u16 sport_mask;
u16 dport_mask;
u8 iif_is_l3_master;
u8 oif_is_l3_master;
struct rcu_head rcu;
};
struct fib_lookup_arg {
void *lookup_ptr;
const void *lookup_data;
void *result;
struct fib_rule *rule;
u32 table;
int flags;
#define FIB_LOOKUP_NOREF 1
#define FIB_LOOKUP_IGNORE_LINKSTATE 2
};
struct fib_rules_ops {
int family;
struct list_head list;
int rule_size;
int addr_size;
int unresolved_rules;
int nr_goto_rules;
unsigned int fib_rules_seq;
int (*action)(struct fib_rule *,
struct flowi *, int,
struct fib_lookup_arg *);
bool (*suppress)(struct fib_rule *, int,
struct fib_lookup_arg *);
int (*match)(struct fib_rule *,
struct flowi *, int);
int (*configure)(struct fib_rule *,
struct sk_buff *,
struct fib_rule_hdr *,
struct nlattr **,
struct netlink_ext_ack *);
int (*delete)(struct fib_rule *);
int (*compare)(struct fib_rule *,
struct fib_rule_hdr *,
struct nlattr **);
int (*fill)(struct fib_rule *, struct sk_buff *,
struct fib_rule_hdr *);
size_t (*nlmsg_payload)(struct fib_rule *);
/* Called after modifications to the rules set, must flush
* the route cache if one exists. */
void (*flush_cache)(struct fib_rules_ops *ops);
int nlgroup;
struct list_head rules_list;
struct module *owner;
struct net *fro_net;
struct rcu_head rcu;
};
struct fib_rule_notifier_info {
Annotation
- Immediate include surface: `linux/types.h`, `linux/slab.h`, `linux/netdevice.h`, `linux/fib_rules.h`, `linux/refcount.h`, `net/flow.h`, `net/rtnetlink.h`, `net/fib_notifier.h`.
- Detected declarations: `struct fib_kuid_range`, `struct fib_rule`, `struct fib_lookup_arg`, `struct fib_rules_ops`, `struct fib_rule_notifier_info`, `function fib_rule_get`, `function fib_rule_get_safe`, `function fib_rule_put`, `function fib_rule_get_table`, `function fib_rule_get_table`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.