include/linux/mroute_base.h
Source file repositories/reference/linux-study-clean/include/linux/mroute_base.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mroute_base.h- Extension
.h- Size
- 12839 bytes
- Lines
- 485
- 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/netdevice.hlinux/rhashtable-types.hlinux/spinlock.hnet/net_namespace.hnet/sock.hnet/fib_notifier.hnet/ip_fib.h
Detected Declarations
struct vif_devicestruct vif_entry_notifier_infostruct mr_mfcstruct mfc_entry_notifier_infostruct mr_tablestruct mr_table_opsstruct mr_tablestruct mr_vif_iterstruct mr_mfc_iterfunction mr_call_vif_notifierfunction mr_call_vif_notifiersfunction mr_cache_putfunction mr_cache_holdfunction mr_call_mfc_notifierfunction mr_call_mfc_notifiersfunction mr_can_free_tablefunction vif_device_initfunction mr_fill_mroutefunction mr_rtm_dumproutefunction mr_dumpfunction mr_mfc_seq_stopfunction mr_mfc_seq_stop
Annotated Snippet
struct vif_device {
struct net_device __rcu *dev;
netdevice_tracker dev_tracker;
unsigned long bytes_in, bytes_out;
unsigned long pkt_in, pkt_out;
unsigned long rate_limit;
unsigned char threshold;
unsigned short flags;
int link;
/* Currently only used by ipmr */
struct netdev_phys_item_id dev_parent_id;
__be32 local, remote;
};
struct vif_entry_notifier_info {
struct fib_notifier_info info;
struct net_device *dev;
unsigned short vif_index;
unsigned short vif_flags;
u32 tb_id;
};
static inline int mr_call_vif_notifier(struct notifier_block *nb,
unsigned short family,
enum fib_event_type event_type,
struct vif_device *vif,
struct net_device *vif_dev,
unsigned short vif_index, u32 tb_id,
struct netlink_ext_ack *extack)
{
struct vif_entry_notifier_info info = {
.info = {
.family = family,
.extack = extack,
},
.dev = vif_dev,
.vif_index = vif_index,
.vif_flags = vif->flags,
.tb_id = tb_id,
};
return call_fib_notifier(nb, event_type, &info.info);
}
static inline int mr_call_vif_notifiers(struct net *net,
unsigned short family,
enum fib_event_type event_type,
struct vif_device *vif,
struct net_device *vif_dev,
unsigned short vif_index, u32 tb_id,
atomic_t *ipmr_seq)
{
struct vif_entry_notifier_info info = {
.info = {
.family = family,
},
.dev = vif_dev,
.vif_index = vif_index,
.vif_flags = vif->flags,
.tb_id = tb_id,
};
ASSERT_RTNL();
atomic_inc(ipmr_seq);
return call_fib_notifiers(net, event_type, &info.info);
}
#ifndef MAXVIFS
/* This one is nasty; value is defined in uapi using different symbols for
* mroute and morute6 but both map into same 32.
*/
#define MAXVIFS 32
#endif
/* Note: This helper is deprecated. */
#define VIF_EXISTS(_mrt, _idx) (!!rcu_access_pointer((_mrt)->vif_table[_idx].dev))
/* mfc_flags:
* MFC_STATIC - the entry was added statically (not by a routing daemon)
* MFC_OFFLOAD - the entry was offloaded to the hardware
*/
enum {
MFC_STATIC = BIT(0),
MFC_OFFLOAD = BIT(1),
};
/**
* struct mr_mfc - common multicast routing entries
* @mnode: rhashtable list
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/rhashtable-types.h`, `linux/spinlock.h`, `net/net_namespace.h`, `net/sock.h`, `net/fib_notifier.h`, `net/ip_fib.h`.
- Detected declarations: `struct vif_device`, `struct vif_entry_notifier_info`, `struct mr_mfc`, `struct mfc_entry_notifier_info`, `struct mr_table`, `struct mr_table_ops`, `struct mr_table`, `struct mr_vif_iter`, `struct mr_mfc_iter`, `function mr_call_vif_notifier`.
- 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.