include/net/netlink.h
Source file repositories/reference/linux-study-clean/include/net/netlink.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/netlink.h- Extension
.h- Size
- 76535 bytes
- Lines
- 2489
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/netlink.hlinux/jiffies.hlinux/in6.h
Detected Declarations
struct netlink_range_validationstruct netlink_range_validation_signedstruct nla_policystruct nl_infostruct netlink_policy_dump_stateenum nla_policy_validationenum netlink_validationfunction __NLA_IS_SINT_TYPEfunction nlmsg_msg_sizefunction nlmsg_total_sizefunction nlmsg_padlenfunction nlmsg_lenfunction nlmsg_attrlenfunction nlmsg_okfunction nlmsg_nextfunction nla_parsefunction validatedfunction validatedfunction nla_parsefunction nla_parsefunction nla_parse_deprecatedfunction nla_parse_deprecated_strictfunction nla_validate_deprecatedfunction nla_validatefunction nlmsg_validate_deprecatedfunction nlmsg_reportfunction nlmsg_seqfunction nlmsg_attrlenfunction skb_release_datafunction nlmsg_endfunction nlmsg_trimfunction nlmsg_cancelfunction nlmsg_freefunction nlmsg_consumefunction nlmsg_multicast_filteredfunction nlmsg_multicastfunction nlmsg_unicastfunction sequencefunction nla_attr_sizefunction nla_total_sizefunction nla_padlenfunction nla_typefunction nla_lenfunction nla_okfunction nla_find_nestedfunction nla_parsefunction nla_parse_deprecatedfunction nla_put_u8
Annotated Snippet
struct netlink_range_validation {
u64 min, max;
};
struct netlink_range_validation_signed {
s64 min, max;
};
enum nla_policy_validation {
NLA_VALIDATE_NONE,
NLA_VALIDATE_RANGE,
NLA_VALIDATE_RANGE_WARN_TOO_LONG,
NLA_VALIDATE_MIN,
NLA_VALIDATE_MAX,
NLA_VALIDATE_MASK,
NLA_VALIDATE_RANGE_PTR,
NLA_VALIDATE_FUNCTION,
};
/**
* struct nla_policy - attribute validation policy
* @type: Type of attribute or NLA_UNSPEC
* @validation_type: type of attribute validation done in addition to
* type-specific validation (e.g. range, function call), see
* &enum nla_policy_validation
* @len: Type specific length of payload
*
* Policies are defined as arrays of this struct, the array must be
* accessible by attribute type up to the highest identifier to be expected.
*
* Meaning of `len' field:
* NLA_STRING Maximum length of string
* NLA_NUL_STRING Maximum length of string (excluding NUL)
* NLA_FLAG Unused
* NLA_BINARY Maximum length of attribute payload
* (but see also below with the validation type)
* NLA_NESTED,
* NLA_NESTED_ARRAY Length verification is done by checking len of
* nested header (or empty); len field is used if
* nested_policy is also used, for the max attr
* number in the nested policy.
* NLA_SINT, NLA_UINT,
* NLA_U8, NLA_U16,
* NLA_U32, NLA_U64,
* NLA_S8, NLA_S16,
* NLA_S32, NLA_S64,
* NLA_BE16, NLA_BE32,
* NLA_MSECS Leaving the length field zero will verify the
* given type fits, using it verifies minimum length
* just like "All other"
* NLA_BITFIELD32 Unused
* NLA_REJECT Unused
* All other Minimum length of attribute payload
*
* Meaning of validation union:
* NLA_BITFIELD32 This is a 32-bit bitmap/bitselector attribute and
* `bitfield32_valid' is the u32 value of valid flags
* NLA_REJECT This attribute is always rejected and `reject_message'
* may point to a string to report as the error instead
* of the generic one in extended ACK.
* NLA_NESTED `nested_policy' to a nested policy to validate, must
* also set `len' to the max attribute number. Use the
* provided NLA_POLICY_NESTED() macro.
* Note that nla_parse() will validate, but of course not
* parse, the nested sub-policies.
* NLA_NESTED_ARRAY `nested_policy' points to a nested policy to validate,
* must also set `len' to the max attribute number. Use
* the provided NLA_POLICY_NESTED_ARRAY() macro.
* The difference to NLA_NESTED is the structure:
* NLA_NESTED has the nested attributes directly inside
* while an array has the nested attributes at another
* level down and the attribute types directly in the
* nesting don't matter.
* NLA_UINT,
* NLA_U8,
* NLA_U16,
* NLA_U32,
* NLA_U64,
* NLA_BE16,
* NLA_BE32,
* NLA_SINT,
* NLA_S8,
* NLA_S16,
* NLA_S32,
* NLA_S64 The `min' and `max' fields are used depending on the
* validation_type field, if that is min/max/range then
* the min, max or both are used (respectively) to check
* the value of the integer attribute.
* Note that in the interest of code simplicity and
* struct size both limits are s16, so you cannot
Annotation
- Immediate include surface: `linux/types.h`, `linux/netlink.h`, `linux/jiffies.h`, `linux/in6.h`.
- Detected declarations: `struct netlink_range_validation`, `struct netlink_range_validation_signed`, `struct nla_policy`, `struct nl_info`, `struct netlink_policy_dump_state`, `enum nla_policy_validation`, `enum netlink_validation`, `function __NLA_IS_SINT_TYPE`, `function nlmsg_msg_size`, `function nlmsg_total_size`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
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.