net/psample/psample.c
Source file repositories/reference/linux-study-clean/net/psample/psample.c
File Facts
- System
- Linux kernel
- Corpus path
net/psample/psample.c- Extension
.c- Size
- 14232 bytes
- Lines
- 534
- 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.
- 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/kernel.hlinux/skbuff.hlinux/module.hlinux/timekeeping.hnet/net_namespace.hnet/sock.hnet/netlink.hnet/genetlink.hnet/psample.hlinux/spinlock.hnet/ip_tunnels.hnet/dst_metadata.h
Detected Declarations
enum psample_nl_multicast_groupsfunction psample_group_nl_fillfunction psample_nl_cmd_get_group_dumpitfunction psample_group_notifyfunction psample_group_destroyfunction psample_group_lookupfunction psample_group_takefunction psample_group_putfunction __psample_ip_tun_to_nlattrfunction psample_ip_tun_to_nlattrfunction psample_tunnel_meta_lenfunction psample_sample_packetfunction psample_module_initfunction psample_module_exitmodule init psample_module_initexport psample_group_getexport psample_group_takeexport psample_group_putexport psample_sample_packet
Annotated Snippet
module_init(psample_module_init);
module_exit(psample_module_exit);
MODULE_AUTHOR("Yotam Gigi <yotam.gi@gmail.com>");
MODULE_DESCRIPTION("netlink channel for packet sampling");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/skbuff.h`, `linux/module.h`, `linux/timekeeping.h`, `net/net_namespace.h`, `net/sock.h`, `net/netlink.h`.
- Detected declarations: `enum psample_nl_multicast_groups`, `function psample_group_nl_fill`, `function psample_nl_cmd_get_group_dumpit`, `function psample_group_notify`, `function psample_group_destroy`, `function psample_group_lookup`, `function psample_group_take`, `function psample_group_put`, `function __psample_ip_tun_to_nlattr`, `function psample_ip_tun_to_nlattr`.
- 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.
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.