]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/linux/netlink.h
util: update kernel headers (v5.9-rc5)
[thirdparty/systemd.git] / src / basic / linux / netlink.h
index 0a4d73317759c9ee523d7d5482548b3171c821e6..eac8a6a648ea3cd7c6df262f7451c0597e63b24f 100644 (file)
@@ -249,4 +249,107 @@ struct nla_bitfield32 {
        __u32 selector;
 };
 
+/*
+ * policy descriptions - it's specific to each family how this is used
+ * Normally, it should be retrieved via a dump inside another attribute
+ * specifying where it applies.
+ */
+
+/**
+ * enum netlink_attribute_type - type of an attribute
+ * @NL_ATTR_TYPE_INVALID: unused
+ * @NL_ATTR_TYPE_FLAG: flag attribute (present/not present)
+ * @NL_ATTR_TYPE_U8: 8-bit unsigned attribute
+ * @NL_ATTR_TYPE_U16: 16-bit unsigned attribute
+ * @NL_ATTR_TYPE_U32: 32-bit unsigned attribute
+ * @NL_ATTR_TYPE_U64: 64-bit unsigned attribute
+ * @NL_ATTR_TYPE_S8: 8-bit signed attribute
+ * @NL_ATTR_TYPE_S16: 16-bit signed attribute
+ * @NL_ATTR_TYPE_S32: 32-bit signed attribute
+ * @NL_ATTR_TYPE_S64: 64-bit signed attribute
+ * @NL_ATTR_TYPE_BINARY: binary data, min/max length may be specified
+ * @NL_ATTR_TYPE_STRING: string, min/max length may be specified
+ * @NL_ATTR_TYPE_NUL_STRING: NUL-terminated string,
+ *     min/max length may be specified
+ * @NL_ATTR_TYPE_NESTED: nested, i.e. the content of this attribute
+ *     consists of sub-attributes. The nested policy and maxtype
+ *     inside may be specified.
+ * @NL_ATTR_TYPE_NESTED_ARRAY: nested array, i.e. the content of this
+ *     attribute contains sub-attributes whose type is irrelevant
+ *     (just used to separate the array entries) and each such array
+ *     entry has attributes again, the policy for those inner ones
+ *     and the corresponding maxtype may be specified.
+ * @NL_ATTR_TYPE_BITFIELD32: &struct nla_bitfield32 attribute
+ */
+enum netlink_attribute_type {
+       NL_ATTR_TYPE_INVALID,
+
+       NL_ATTR_TYPE_FLAG,
+
+       NL_ATTR_TYPE_U8,
+       NL_ATTR_TYPE_U16,
+       NL_ATTR_TYPE_U32,
+       NL_ATTR_TYPE_U64,
+
+       NL_ATTR_TYPE_S8,
+       NL_ATTR_TYPE_S16,
+       NL_ATTR_TYPE_S32,
+       NL_ATTR_TYPE_S64,
+
+       NL_ATTR_TYPE_BINARY,
+       NL_ATTR_TYPE_STRING,
+       NL_ATTR_TYPE_NUL_STRING,
+
+       NL_ATTR_TYPE_NESTED,
+       NL_ATTR_TYPE_NESTED_ARRAY,
+
+       NL_ATTR_TYPE_BITFIELD32,
+};
+
+/**
+ * enum netlink_policy_type_attr - policy type attributes
+ * @NL_POLICY_TYPE_ATTR_UNSPEC: unused
+ * @NL_POLICY_TYPE_ATTR_TYPE: type of the attribute,
+ *     &enum netlink_attribute_type (U32)
+ * @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, no minimum if not given (U32)
+ * @NL_POLICY_TYPE_ATTR_MAX_LENGTH: maximum length for binary
+ *     attributes, no maximum if not given (U32)
+ * @NL_POLICY_TYPE_ATTR_POLICY_IDX: sub policy for nested and
+ *     nested array types (U32)
+ * @NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE: maximum sub policy
+ *     attribute for nested and nested array types, this can
+ *     in theory be < the size of the policy pointed to by
+ *     the index, if limited inside the nesting (U32)
+ * @NL_POLICY_TYPE_ATTR_BITFIELD32_MASK: valid mask for the
+ *     bitfield32 type (U32)
+ * @NL_POLICY_TYPE_ATTR_PAD: pad attribute for 64-bit alignment
+ */
+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,
+
+       /* keep last */
+       __NL_POLICY_TYPE_ATTR_MAX,
+       NL_POLICY_TYPE_ATTR_MAX = __NL_POLICY_TYPE_ATTR_MAX - 1
+};
+
 #endif /* _UAPI__LINUX_NETLINK_H */