net/l2tp/l2tp_debugfs.c
Source file repositories/reference/linux-study-clean/net/l2tp/l2tp_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
net/l2tp/l2tp_debugfs.c- Extension
.c- Size
- 9155 bytes
- Lines
- 348
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/module.hlinux/skbuff.hlinux/socket.hlinux/hash.hlinux/l2tp.hlinux/in.hlinux/etherdevice.hlinux/spinlock.hlinux/debugfs.hnet/sock.hnet/ip.hnet/icmp.hnet/udp.hnet/inet_common.hnet/inet_hashtables.hnet/tcp_states.hnet/protocol.hnet/xfrm.hnet/net_namespace.hnet/netns/generic.hl2tp_core.h
Detected Declarations
struct l2tp_dfs_seq_datafunction l2tp_dfs_next_tunnelfunction l2tp_dfs_next_sessionfunction l2tp_dfs_seq_stopfunction l2tp_dfs_next_tunnelfunction l2tp_dfs_seq_tunnel_showfunction l2tp_dfs_seq_session_showfunction l2tp_dfs_seq_showfunction l2tp_dfs_seq_openfunction l2tp_dfs_seq_releasefunction l2tp_debugfs_initfunction l2tp_debugfs_exitmodule init l2tp_debugfs_init
Annotated Snippet
static const struct file_operations l2tp_dfs_fops = {
.owner = THIS_MODULE,
.open = l2tp_dfs_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = l2tp_dfs_seq_release,
};
static int __init l2tp_debugfs_init(void)
{
rootdir = debugfs_create_dir("l2tp", NULL);
debugfs_create_file("tunnels", 0600, rootdir, NULL, &l2tp_dfs_fops);
pr_info("L2TP debugfs support\n");
return 0;
}
static void __exit l2tp_debugfs_exit(void)
{
debugfs_remove_recursive(rootdir);
}
module_init(l2tp_debugfs_init);
module_exit(l2tp_debugfs_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
MODULE_DESCRIPTION("L2TP debugfs driver");
MODULE_VERSION("1.0");
Annotation
- Immediate include surface: `linux/module.h`, `linux/skbuff.h`, `linux/socket.h`, `linux/hash.h`, `linux/l2tp.h`, `linux/in.h`, `linux/etherdevice.h`, `linux/spinlock.h`.
- Detected declarations: `struct l2tp_dfs_seq_data`, `function l2tp_dfs_next_tunnel`, `function l2tp_dfs_next_session`, `function l2tp_dfs_seq_stop`, `function l2tp_dfs_next_tunnel`, `function l2tp_dfs_seq_tunnel_show`, `function l2tp_dfs_seq_session_show`, `function l2tp_dfs_seq_show`, `function l2tp_dfs_seq_open`, `function l2tp_dfs_seq_release`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: pattern 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.