net/core/sock_diag.c
Source file repositories/reference/linux-study-clean/net/core/sock_diag.c
File Facts
- System
- Linux kernel
- Corpus path
net/core/sock_diag.c- Extension
.c- Size
- 8237 bytes
- Lines
- 355
- 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/filter.hlinux/mutex.hlinux/socket.hlinux/skbuff.hnet/netlink.hnet/net_namespace.hlinux/module.hnet/sock.hlinux/kernel.hlinux/tcp.hlinux/workqueue.hlinux/nospec.hlinux/cookie.hlinux/inet_diag.hlinux/sock_diag.h
Detected Declarations
struct broadcast_skfunction __sock_gen_cookiefunction sock_diag_check_cookiefunction sock_diag_save_cookiefunction sock_diag_put_meminfofunction sock_diag_put_filterinfofunction sock_diag_nlmsg_sizefunction sock_diag_unlock_handlerfunction sock_diag_broadcast_destroy_workfunction sock_diag_broadcast_destroyfunction sock_diag_register_inet_compatfunction sock_diag_unregister_inet_compatfunction sock_diag_registerfunction sock_diag_unregisterfunction __sock_diag_cmdfunction sock_diag_rcv_msgfunction sock_diag_rcvfunction sock_diag_bindfunction sock_diag_destroyfunction diag_net_initfunction diag_net_exitfunction sock_diag_initmodule init sock_diag_initexport sock_diag_check_cookieexport sock_diag_save_cookieexport sock_diag_put_meminfoexport sock_diag_put_filterinfoexport sock_diag_register_inet_compatexport sock_diag_unregister_inet_compatexport sock_diag_registerexport sock_diag_unregisterexport sock_diag_destroy
Annotated Snippet
device_initcall(sock_diag_init);
Annotation
- Immediate include surface: `linux/filter.h`, `linux/mutex.h`, `linux/socket.h`, `linux/skbuff.h`, `net/netlink.h`, `net/net_namespace.h`, `linux/module.h`, `net/sock.h`.
- Detected declarations: `struct broadcast_sk`, `function __sock_gen_cookie`, `function sock_diag_check_cookie`, `function sock_diag_save_cookie`, `function sock_diag_put_meminfo`, `function sock_diag_put_filterinfo`, `function sock_diag_nlmsg_size`, `function sock_diag_unlock_handler`, `function sock_diag_broadcast_destroy_work`, `function sock_diag_broadcast_destroy`.
- 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.