|
@@ -172,6 +172,7 @@ enum {
|
|
NLA_FLAG,
|
|
NLA_FLAG,
|
|
NLA_MSECS,
|
|
NLA_MSECS,
|
|
NLA_NESTED,
|
|
NLA_NESTED,
|
|
|
|
+ NLA_NESTED_ARRAY,
|
|
NLA_NUL_STRING,
|
|
NLA_NUL_STRING,
|
|
NLA_BINARY,
|
|
NLA_BINARY,
|
|
NLA_S8,
|
|
NLA_S8,
|
|
@@ -200,7 +201,8 @@ enum {
|
|
* NLA_NUL_STRING Maximum length of string (excluding NUL)
|
|
* NLA_NUL_STRING Maximum length of string (excluding NUL)
|
|
* NLA_FLAG Unused
|
|
* NLA_FLAG Unused
|
|
* NLA_BINARY Maximum length of attribute payload
|
|
* NLA_BINARY Maximum length of attribute payload
|
|
- * NLA_NESTED Length verification is done by checking len of
|
|
|
|
|
|
+ * NLA_NESTED,
|
|
|
|
+ * NLA_NESTED_ARRAY Length verification is done by checking len of
|
|
* nested header (or empty); len field is used if
|
|
* nested header (or empty); len field is used if
|
|
* validation_data is also used, for the max attr
|
|
* validation_data is also used, for the max attr
|
|
* number in the nested policy.
|
|
* number in the nested policy.
|
|
@@ -230,6 +232,12 @@ enum {
|
|
* `len' to the max attribute number.
|
|
* `len' to the max attribute number.
|
|
* Note that nla_parse() will validate, but of course not
|
|
* Note that nla_parse() will validate, but of course not
|
|
* parse, the nested sub-policies.
|
|
* parse, the nested sub-policies.
|
|
|
|
+ * NLA_NESTED_ARRAY Points to a nested policy to validate, must also set
|
|
|
|
+ * `len' to the max attribute number. 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
|
|
|
|
+ * attributes directly in the nesting don't matter.
|
|
* All other Unused
|
|
* All other Unused
|
|
*
|
|
*
|
|
* Example:
|
|
* Example:
|
|
@@ -255,6 +263,8 @@ struct nla_policy {
|
|
|
|
|
|
#define NLA_POLICY_NESTED(maxattr, policy) \
|
|
#define NLA_POLICY_NESTED(maxattr, policy) \
|
|
{ .type = NLA_NESTED, .validation_data = policy, .len = maxattr }
|
|
{ .type = NLA_NESTED, .validation_data = policy, .len = maxattr }
|
|
|
|
+#define NLA_POLICY_NESTED_ARRAY(maxattr, policy) \
|
|
|
|
+ { .type = NLA_NESTED_ARRAY, .validation_data = policy, .len = maxattr }
|
|
|
|
|
|
/**
|
|
/**
|
|
* struct nl_info - netlink source information
|
|
* struct nl_info - netlink source information
|