net/8021q/vlan.c
Source file repositories/reference/linux-study-clean/net/8021q/vlan.c
File Facts
- System
- Linux kernel
- Corpus path
net/8021q/vlan.c- Extension
.c- Size
- 18464 bytes
- Lines
- 771
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/capability.hlinux/module.hlinux/netdevice.hlinux/skbuff.hlinux/slab.hlinux/init.hlinux/rculist.hnet/arp.hlinux/rtnetlink.hlinux/notifier.hnet/rtnetlink.hnet/net_namespace.hnet/netns/generic.hlinux/uaccess.hlinux/if_vlan.hvlan.hvlanproc.h
Detected Declarations
function vlan_group_prealloc_vidfunction vlan_stacked_transfer_operstatefunction unregister_vlan_devfunction vlan_check_real_devfunction register_vlan_devfunction register_vlan_devicefunction vlan_sync_addressfunction vlan_transfer_featuresfunction __vlan_device_eventfunction vlan_vid0_addfunction vlan_vid0_delfunction vlan_device_eventfunction vlan_group_for_each_devfunction vlan_group_for_each_devfunction vlan_group_for_each_devfunction list_for_each_entry_safefunction vlan_group_for_each_devfunction vlan_group_for_each_devfunction vlan_ioctl_handlerfunction vlan_init_netfunction vlan_exit_netfunction vlan_proto_initfunction vlan_cleanup_modulemodule init vlan_proto_init
Annotated Snippet
module_init(vlan_proto_init);
module_exit(vlan_cleanup_module);
MODULE_DESCRIPTION("802.1Q/802.1ad VLAN Protocol");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);
MODULE_IMPORT_NS("NETDEV_INTERNAL");
Annotation
- Immediate include surface: `linux/capability.h`, `linux/module.h`, `linux/netdevice.h`, `linux/skbuff.h`, `linux/slab.h`, `linux/init.h`, `linux/rculist.h`, `net/arp.h`.
- Detected declarations: `function vlan_group_prealloc_vid`, `function vlan_stacked_transfer_operstate`, `function unregister_vlan_dev`, `function vlan_check_real_dev`, `function register_vlan_dev`, `function register_vlan_device`, `function vlan_sync_address`, `function vlan_transfer_features`, `function __vlan_device_event`, `function vlan_vid0_add`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.