ENUM NETLINK_POLICY_TYPE_ATTR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, this is <hotpink>enum netlink_policy_type_attr</hotpink> from the Kernel API Manual (section 9, kernel API, iykyk) and it's basically the master list of policy type attributes β€” the lil named slots that tell netlink how to check the attributes you're passing it. so slay. let's go 🌸


✨ SYNOPSIS ✨

enum netlink_policy_type_attr {
    NL_POLICY_TYPE_ATTR_UNSPEC ,
    NL_POLICY_TYPE_ATTR_TYPE ,
    NL_POLICY_TYPE_ATTR_MIN_VALUE_S ,
    NL_POLICY_TYPE_ATTR_MAX_VALUE_S ,
    NL_POLICY_TYPE_ATTR_MIN_VALUE_U ,
    NL_POLICY_TYPE_ATTR_MAX_VALUE_U ,
    NL_POLICY_TYPE_ATTR_MIN_LENGTH ,
    NL_POLICY_TYPE_ATTR_MAX_LENGTH ,
    NL_POLICY_TYPE_ATTR_POLICY_IDX ,
    NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE ,
    NL_POLICY_TYPE_ATTR_BITFIELD32_MASK ,
    NL_POLICY_TYPE_ATTR_PAD ,
    NL_POLICY_TYPE_ATTR_MASK ,
    __NL_POLICY_TYPE_ATTR_MAX ,
    NL_POLICY_TYPE_ATTR_MAX

};

πŸ’… Constants πŸ’…

like, every single one of them, no skipping, no cap 🫢

  • NL_POLICY_TYPE_ATTR_UNSPEC β€” the unused one πŸ™ˆ literally just vibes, it does nothing
  • NL_POLICY_TYPE_ATTR_TYPE β€” the type of the attribute, enum netlink_attribute_type (U32) πŸ‘‘ this is the main character
  • NL_POLICY_TYPE_ATTR_MIN_VALUE_S β€” minimum value for signed integers (S64)
  • NL_POLICY_TYPE_ATTR_MAX_VALUE_S β€” maximum value for signed integers (S64)
  • NL_POLICY_TYPE_ATTR_MIN_VALUE_U β€” minimum value for unsigned integers (U64)
  • NL_POLICY_TYPE_ATTR_MAX_VALUE_U β€” maximum value for unsigned integers (U64)
  • NL_POLICY_TYPE_ATTR_MIN_LENGTH β€” minimum length for binary attributes, and there's no minimum if it's not given (U32) πŸŽ€
  • NL_POLICY_TYPE_ATTR_MAX_LENGTH β€” maximum length for binary attributes, and there's no maximum if it's not given (U32) πŸŽ€
  • NL_POLICY_TYPE_ATTR_POLICY_IDX β€” the sub policy for nested and nested array types (U32) πŸͺ† it's giving nesting doll energy
  • NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE β€” maximum sub policy attribute for nested and nested array types, and this can in theory be < the size of the policy pointed to by the index, if it's limited inside the nesting (U32) πŸ‘€ yes bestie, read that twice
  • NL_POLICY_TYPE_ATTR_BITFIELD32_MASK β€” the valid mask for the bitfield32 type (U32) ✨
  • NL_POLICY_TYPE_ATTR_PAD β€” pad attribute for 64-bit alignment 🧚 alignment is self-care, fr fr
  • NL_POLICY_TYPE_ATTR_MASK β€” mask of valid bits for unsigned integers (U64) πŸ”₯
  • __NL_POLICY_TYPE_ATTR_MAX β€” number of attributes
  • NL_POLICY_TYPE_ATTR_MAX β€” highest attribute number ⭐
bestie reminder: NL_POLICY_TYPE_ATTR_UNSPEC is unused, and NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE can in theory be < the size of the policy pointed to by the index if it's limited inside the nesting. that's not me being shady, that's literally what the docs say πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie, they're all connected:

  • Kernel file ./include/uapi/linux/netlink.h
  • struct nlmsghdr(9)
  • enum nlmsgerr_attrs(9)
  • enum netlink_attribute_type(9)

okay and finally, the receipts 🧾: this page lives under ./include/uapi/linux, it's stamped October 2026, and it goes by enum netlin...cy_type_attr(9) in the Kernel API Manual. that's the whole thing, you ate that, periodt πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from