net/ipv4/inet_diag.c
Source file repositories/reference/linux-study-clean/net/ipv4/inet_diag.c
File Facts
- System
- Linux kernel
- Corpus path
net/ipv4/inet_diag.c- Extension
.c- Size
- 27907 bytes
- Lines
- 1125
- 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/kernel.hlinux/module.hlinux/types.hlinux/fcntl.hlinux/random.hlinux/slab.hlinux/cache.hlinux/init.hlinux/time.hnet/icmp.hnet/tcp.hnet/ipv6.hnet/inet_common.hnet/inet_connection_sock.hnet/bpf_sk_storage.hnet/netlink.hlinux/inet.hlinux/stddef.hlinux/inet_diag.hlinux/sock_diag.h
Detected Declarations
struct inet_diag_entryfunction inet_diag_unlock_handlerfunction inet_diag_msg_common_fillfunction inet_diag_msg_attrs_fillfunction inet_diag_parse_attrsfunction nlmsg_for_each_attrfunction inet_diag_get_protocolfunction inet_sk_diag_fillfunction timer_pendingfunction inet_diag_cmd_exactfunction bitstring_matchfunction inet_diag_bc_runfunction entry_fill_addrsfunction inet_diag_bc_skfunction valid_ccfunction valid_devcondfunction valid_hostcondfunction valid_port_comparisonfunction valid_markcondfunction valid_cgroupcondfunction inet_diag_bc_auditfunction __inet_diag_dumpfunction inet_sk_diag_fillfunction inet_diag_dumpfunction __inet_diag_dump_startfunction inet_diag_dump_startfunction inet_diag_dump_start_compatfunction inet_diag_dump_donefunction inet_diag_type2protofunction inet_diag_dump_compatfunction inet_diag_get_exact_compatfunction inet_diag_rcv_msg_compatfunction inet_diag_handler_cmdfunction inet_diag_handler_get_infofunction inet_diag_registerfunction inet_diag_unregisterfunction inet_diag_initfunction inet_diag_exitmodule init inet_diag_initexport inet_diag_msg_common_fillexport inet_diag_msg_attrs_fillexport inet_sk_diag_fillexport inet_diag_bc_skexport inet_diag_registerexport inet_diag_unregister
Annotated Snippet
module_init(inet_diag_init);
module_exit(inet_diag_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("INET/INET6: socket monitoring via SOCK_DIAG");
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2 /* AF_INET */);
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 10 /* AF_INET6 */);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/types.h`, `linux/fcntl.h`, `linux/random.h`, `linux/slab.h`, `linux/cache.h`, `linux/init.h`.
- Detected declarations: `struct inet_diag_entry`, `function inet_diag_unlock_handler`, `function inet_diag_msg_common_fill`, `function inet_diag_msg_attrs_fill`, `function inet_diag_parse_attrs`, `function nlmsg_for_each_attr`, `function inet_diag_get_protocol`, `function inet_sk_diag_fill`, `function timer_pending`, `function inet_diag_cmd_exact`.
- 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.