net/netfilter/nf_nat_core.c
Source file repositories/reference/linux-study-clean/net/netfilter/nf_nat_core.c
File Facts
- System
- Linux kernel
- Corpus path
net/netfilter/nf_nat_core.c- Extension
.c- Size
- 37425 bytes
- Lines
- 1372
- 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/module.hlinux/types.hlinux/timer.hlinux/skbuff.hlinux/gfp.hnet/xfrm.hlinux/siphash.hlinux/rtnetlink.hnet/netfilter/nf_conntrack_bpf.hnet/netfilter/nf_conntrack_core.hnet/netfilter/nf_conntrack_helper.hnet/netfilter/nf_conntrack_seqadj.hnet/netfilter/nf_conntrack_zones.hnet/netfilter/nf_nat.hnet/netfilter/nf_nat_helper.huapi/linux/netfilter/nf_nat.hnf_internals.hlinux/netfilter/nfnetlink.hlinux/netfilter/nfnetlink_conntrack.h
Detected Declarations
struct nf_nat_lookup_hook_privstruct nf_nat_hooks_netstruct nat_netstruct nf_nat_proto_cleanfunction nf_nat_ipv4_decode_sessionfunction nf_nat_ipv6_decode_sessionfunction __nf_nat_decode_sessionfunction hash_by_srcfunction entryfunction nf_nat_allow_clashfunction nf_nat_used_tuple_newfunction nf_nat_may_killfunction nf_seq_has_advancedfunction nf_nat_used_tuple_harderfunction nf_nat_inet_in_rangefunction l4proto_in_rangefunction nf_in_rangefunction same_srcfunction find_appropriate_srcfunction hlist_for_each_entry_rcufunction find_best_ips_protofunction nf_nat_l4proto_unique_tuplefunction worstfunction sourcefunction nf_nat_setup_infofunction __nf_nat_alloc_null_bindingfunction nf_nat_alloc_null_bindingfunction nf_nat_packetfunction in_vrf_postroutingfunction nf_nat_inet_fnfunction nf_nat_proto_removefunction nf_nat_cleanup_conntrackfunction nf_nat_proto_cleanfunction nf_nat_l4proto_nlattr_to_rangefunction nfnetlink_parse_nat_protofunction nf_nat_ipv4_nlattr_to_rangefunction nf_nat_ipv6_nlattr_to_rangefunction nfnetlink_parse_natfunction nfnetlink_parse_nat_setupfunction nfnetlink_parse_nat_setupfunction nf_nat_register_fnfunction nf_nat_unregister_fnfunction nf_nat_initfunction nf_nat_cleanupmodule init nf_nat_initexport nf_ct_nat_ext_addexport nf_nat_setup_infoexport nf_nat_alloc_null_binding
Annotated Snippet
module_init(nf_nat_init);
module_exit(nf_nat_cleanup);
Annotation
- Immediate include surface: `linux/module.h`, `linux/types.h`, `linux/timer.h`, `linux/skbuff.h`, `linux/gfp.h`, `net/xfrm.h`, `linux/siphash.h`, `linux/rtnetlink.h`.
- Detected declarations: `struct nf_nat_lookup_hook_priv`, `struct nf_nat_hooks_net`, `struct nat_net`, `struct nf_nat_proto_clean`, `function nf_nat_ipv4_decode_session`, `function nf_nat_ipv6_decode_session`, `function __nf_nat_decode_session`, `function hash_by_src`, `function entry`, `function nf_nat_allow_clash`.
- 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.