net/mpls/af_mpls.c
Source file repositories/reference/linux-study-clean/net/mpls/af_mpls.c
File Facts
- System
- Linux kernel
- Corpus path
net/mpls/af_mpls.c- Extension
.c- Size
- 67182 bytes
- Lines
- 2893
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/skbuff.hlinux/socket.hlinux/sysctl.hlinux/net.hlinux/module.hlinux/if_arp.hlinux/ipv6.hlinux/mpls.hlinux/netconf.hlinux/nospec.hlinux/vmalloc.hlinux/percpu.hnet/gso.hnet/ip.hnet/dst.hnet/sock.hnet/arp.hnet/ip_fib.hnet/netevent.hnet/ip_tunnels.hnet/netns/generic.hnet/ipv6.hnet/rtnh.hinternal.h
Detected Declarations
struct mpls_route_configfunction ipgre_mpls_encap_hlenfunction ipgre_tunnel_encap_add_mpls_opsfunction ipgre_tunnel_encap_del_mpls_opsfunction ipgre_tunnel_encap_add_mpls_opsfunction ipgre_tunnel_encap_del_mpls_opsfunction mpls_output_possiblefunction mpls_nh_header_sizefunction mpls_dev_mtufunction mpls_pkt_too_bigfunction mpls_stats_inc_outucastpktsfunction mpls_multipath_hashfunction pskb_may_pullfunction hopfunction mpls_egressfunction mpls_forwardfunction mpls_rt_free_rcufunction change_nexthopsfunction mpls_rt_freefunction mpls_notify_routefunction mpls_route_updatefunction find_free_labelfunction mpls_nh_assign_devfunction nla_get_viafunction mpls_nh_build_from_cfgfunction mpls_nh_buildfunction mpls_count_nexthopsfunction mpls_nh_build_multifunction change_nexthopsfunction mpls_label_okfunction mpls_route_addfunction mpls_route_delfunction mpls_get_statsfunction for_each_possible_cpufunction mpls_fill_stats_affunction mpls_get_stats_af_sizefunction mpls_netconf_fill_devconffunction mpls_netconf_msgsize_devconffunction mpls_netconf_notify_devconffunction mpls_netconf_valid_get_reqfunction mpls_netconf_get_devconffunction mpls_netconf_dump_devconffunction mpls_conf_procfunction mpls_dev_sysctl_registerfunction mpls_dev_sysctl_unregisterfunction for_each_possible_cpufunction mpls_dev_destroy_rcufunction mpls_ifdown
Annotated Snippet
module_init(mpls_init);
static void __exit mpls_exit(void)
{
rtnl_unregister_all(PF_MPLS);
rtnl_af_unregister(&mpls_af_ops);
dev_remove_pack(&mpls_packet_type);
unregister_netdevice_notifier(&mpls_dev_notifier);
unregister_pernet_subsys(&mpls_net_ops);
ipgre_tunnel_encap_del_mpls_ops();
}
module_exit(mpls_exit);
MODULE_DESCRIPTION("MultiProtocol Label Switching");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS_NETPROTO(PF_MPLS);
Annotation
- Immediate include surface: `linux/types.h`, `linux/skbuff.h`, `linux/socket.h`, `linux/sysctl.h`, `linux/net.h`, `linux/module.h`, `linux/if_arp.h`, `linux/ipv6.h`.
- Detected declarations: `struct mpls_route_config`, `function ipgre_mpls_encap_hlen`, `function ipgre_tunnel_encap_add_mpls_ops`, `function ipgre_tunnel_encap_del_mpls_ops`, `function ipgre_tunnel_encap_add_mpls_ops`, `function ipgre_tunnel_encap_del_mpls_ops`, `function mpls_output_possible`, `function mpls_nh_header_size`, `function mpls_dev_mtu`, `function mpls_pkt_too_big`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.