include/linux/rtnetlink.h
Source file repositories/reference/linux-study-clean/include/linux/rtnetlink.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/rtnetlink.h- Extension
.h- Size
- 7577 bytes
- Lines
- 246
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- 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/mutex.hlinux/netdevice.hlinux/wait.hlinux/refcount.huapi/linux/rtnetlink.h
Detected Declarations
struct ndo_fdb_dump_contextfunction rtnetlink_maybe_sendfunction lockdep_rtnl_is_heldfunction __rtnl_net_lockfunction rtnl_net_unlockfunction rtnl_net_trylockfunction rtnl_net_lock_killablefunction ASSERT_RTNL_NETfunction rtnl_has_listenersfunction rtnl_notify_needed
Annotated Snippet
struct ndo_fdb_dump_context {
unsigned long ifindex;
unsigned long fdb_idx;
};
extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
struct netlink_callback *cb,
struct net_device *dev,
struct net_device *filter_dev,
int *idx);
extern int ndo_dflt_fdb_add(struct ndmsg *ndm,
struct nlattr *tb[],
struct net_device *dev,
const unsigned char *addr,
u16 vid,
u16 flags);
extern int ndo_dflt_fdb_del(struct ndmsg *ndm,
struct nlattr *tb[],
struct net_device *dev,
const unsigned char *addr,
u16 vid);
extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev, u16 mode,
u32 flags, u32 mask, int nlflags,
u32 filter_mask,
int (*vlan_fill)(struct sk_buff *skb,
struct net_device *dev,
u32 filter_mask));
extern void rtnl_offload_xstats_notify(struct net_device *dev);
static inline int rtnl_has_listeners(const struct net *net, u32 group)
{
struct sock *rtnl = net->rtnl;
return netlink_has_listeners(rtnl, group);
}
/**
* rtnl_notify_needed - check if notification is needed
* @net: Pointer to the net namespace
* @nlflags: netlink ingress message flags
* @group: rtnl group
*
* Based on the ingress message flags and rtnl group, returns true
* if a notification is needed, false otherwise.
*/
static inline bool
rtnl_notify_needed(const struct net *net, u16 nlflags, u32 group)
{
return (nlflags & NLM_F_ECHO) || rtnl_has_listeners(net, group);
}
void netif_set_operstate(struct net_device *dev, int newstate);
#endif /* __LINUX_RTNETLINK_H */
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/netdevice.h`, `linux/wait.h`, `linux/refcount.h`, `uapi/linux/rtnetlink.h`.
- Detected declarations: `struct ndo_fdb_dump_context`, `function rtnetlink_maybe_send`, `function lockdep_rtnl_is_held`, `function __rtnl_net_lock`, `function rtnl_net_unlock`, `function rtnl_net_trylock`, `function rtnl_net_lock_killable`, `function ASSERT_RTNL_NET`, `function rtnl_has_listeners`, `function rtnl_notify_needed`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.