net/netfilter/nf_tables_api.c
Source file repositories/reference/linux-study-clean/net/netfilter/nf_tables_api.c
File Facts
- System
- Linux kernel
- Corpus path
net/netfilter/nf_tables_api.c- Extension
.c- Size
- 308799 bytes
- Lines
- 12285
- 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.
- 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/module.hlinux/init.hlinux/list.hlinux/skbuff.hlinux/netlink.hlinux/vmalloc.hlinux/rhashtable.hlinux/audit.hlinux/netfilter.hlinux/netfilter_ipv4.hlinux/netfilter/nfnetlink.hlinux/netfilter/nf_tables.hnet/netfilter/nf_flow_table.hnet/netfilter/nf_tables_core.hnet/netfilter/nf_tables.hnet/netfilter/nf_tables_offload.hnet/net_namespace.hnet/sock.h
Detected Declarations
struct nft_audit_datastruct nft_set_elem_catchallstruct nft_module_requeststruct nftnl_skb_parmsstruct nft_hook_dump_ctxstruct nft_chain_hookstruct nft_expr_infostruct nft_rule_dump_ctxstruct nft_set_dump_argsstruct nft_set_dump_ctxstruct nft_obj_dump_ctxstruct nft_flowtable_hookstruct nft_flowtable_filterfunction nft_validate_state_updatefunction nft_chain_vstate_validfunction nft_ctx_initfunction nft_trans_list_delfunction nft_trans_destroyfunction __nft_set_trans_bindfunction nft_set_trans_bindfunction nft_set_trans_unbindfunction __nft_chain_trans_bindfunction nft_chain_trans_bindfunction nf_tables_bind_chainfunction nf_tables_unbind_chainfunction nft_netdev_register_hooksfunction list_for_each_entryfunction list_for_each_entryfunction nft_netdev_hook_free_opsfunction list_for_each_entry_safefunction nft_netdev_hook_freefunction __nft_netdev_hook_free_rcufunction nft_netdev_hook_free_rcufunction nft_netdev_hook_unlink_free_rcufunction nft_trans_hook_destroyfunction nft_netdev_unregister_trans_hookfunction list_for_each_entry_safefunction nft_netdev_unregister_hooksfunction list_for_each_entry_safefunction nf_tables_register_hookfunction __nf_tables_unregister_hookfunction nf_tables_unregister_hookfunction nft_trans_collapse_set_elem_allowedfunction nft_trans_collapse_set_elemfunction nft_trans_try_collapsefunction nft_trans_commit_list_add_tailfunction nft_trans_commit_list_add_elemfunction nft_trans_table_add
Annotated Snippet
module_init(nf_tables_module_init);
module_exit(nf_tables_module_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
MODULE_DESCRIPTION("Framework for packet filtering and classification");
MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_NFTABLES);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/list.h`, `linux/skbuff.h`, `linux/netlink.h`, `linux/vmalloc.h`, `linux/rhashtable.h`, `linux/audit.h`.
- Detected declarations: `struct nft_audit_data`, `struct nft_set_elem_catchall`, `struct nft_module_request`, `struct nftnl_skb_parms`, `struct nft_hook_dump_ctx`, `struct nft_chain_hook`, `struct nft_expr_info`, `struct nft_rule_dump_ctx`, `struct nft_set_dump_args`, `struct nft_set_dump_ctx`.
- 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.
- 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.