net/ipv4/netfilter/ip_tables.c
Source file repositories/reference/linux-study-clean/net/ipv4/netfilter/ip_tables.c
File Facts
- System
- Linux kernel
- Corpus path
net/ipv4/netfilter/ip_tables.c- Extension
.c- Size
- 45081 bytes
- Lines
- 1853
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/cache.hlinux/capability.hlinux/skbuff.hlinux/kmod.hlinux/vmalloc.hlinux/netdevice.hlinux/module.hnet/ip.hnet/compat.hlinux/uaccess.hlinux/mutex.hlinux/proc_fs.hlinux/err.hlinux/cpumask.hlinux/netfilter/x_tables.hlinux/netfilter_ipv4/ip_tables.hnet/netfilter/nf_log.h../../netfilter/xt_repldata.h
Detected Declarations
struct compat_ipt_replacestruct compat_ipt_get_entriesenum nf_ip_trace_commentsfunction ip_packet_matchfunction ip_checkentryfunction ipt_errorfunction get_entryfunction unconditionalfunction ipt_get_target_cfunction get_chainname_rulenumfunction trace_packetfunction ipt_do_tablefunction xt_ematch_foreachfunction mark_source_chainsfunction cleanup_matchfunction check_matchfunction find_check_matchfunction check_targetfunction find_check_entryfunction check_underflowfunction check_entry_size_and_hooksfunction cleanup_entryfunction translate_tablefunction get_countersfunction for_each_possible_cpufunction xt_entry_foreachfunction get_old_countersfunction for_each_possible_cpufunction xt_entry_foreachfunction copy_entries_to_userfunction compat_standard_from_userfunction compat_standard_to_userfunction compat_calc_entryfunction compat_table_infofunction get_infofunction get_entriesfunction __do_replacefunction do_replacefunction do_add_countersfunction compat_copy_entry_to_userfunction xt_ematch_foreachfunction compat_find_calc_matchfunction compat_release_entryfunction check_compat_entry_size_and_hooksfunction compat_copy_entry_from_userfunction translate_compat_tablefunction compat_do_replacefunction compat_copy_entries_to_user
Annotated Snippet
module_init(ip_tables_init);
module_exit(ip_tables_fini);
Annotation
- Immediate include surface: `linux/cache.h`, `linux/capability.h`, `linux/skbuff.h`, `linux/kmod.h`, `linux/vmalloc.h`, `linux/netdevice.h`, `linux/module.h`, `net/ip.h`.
- Detected declarations: `struct compat_ipt_replace`, `struct compat_ipt_get_entries`, `enum nf_ip_trace_comments`, `function ip_packet_match`, `function ip_checkentry`, `function ipt_error`, `function get_entry`, `function unconditional`, `function ipt_get_target_c`, `function get_chainname_rulenum`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.