aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netlink.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index bcb27e3a312..11dc2e7f679 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -167,6 +167,7 @@ enum {
167 NLA_FLAG, 167 NLA_FLAG,
168 NLA_MSECS, 168 NLA_MSECS,
169 NLA_NESTED, 169 NLA_NESTED,
170 NLA_NUL_STRING,
170 __NLA_TYPE_MAX, 171 __NLA_TYPE_MAX,
171}; 172};
172 173
@@ -175,21 +176,27 @@ enum {
175/** 176/**
176 * struct nla_policy - attribute validation policy 177 * struct nla_policy - attribute validation policy
177 * @type: Type of attribute or NLA_UNSPEC 178 * @type: Type of attribute or NLA_UNSPEC
178 * @minlen: Minimal length of payload required to be available 179 * @len: Type specific length of payload
179 * 180 *
180 * Policies are defined as arrays of this struct, the array must be 181 * Policies are defined as arrays of this struct, the array must be
181 * accessible by attribute type up to the highest identifier to be expected. 182 * accessible by attribute type up to the highest identifier to be expected.
182 * 183 *
184 * Meaning of `len' field:
185 * NLA_STRING Maximum length of string
186 * NLA_NUL_STRING Maximum length of string (excluding NUL)
187 * NLA_FLAG Unused
188 * All other Exact length of attribute payload
189 *
183 * Example: 190 * Example:
184 * static struct nla_policy my_policy[ATTR_MAX+1] __read_mostly = { 191 * static struct nla_policy my_policy[ATTR_MAX+1] __read_mostly = {
185 * [ATTR_FOO] = { .type = NLA_U16 }, 192 * [ATTR_FOO] = { .type = NLA_U16 },
186 * [ATTR_BAR] = { .type = NLA_STRING }, 193 * [ATTR_BAR] = { .type = NLA_STRING, len = BARSIZ },
187 * [ATTR_BAZ] = { .minlen = sizeof(struct mystruct) }, 194 * [ATTR_BAZ] = { .len = sizeof(struct mystruct) },
188 * }; 195 * };
189 */ 196 */
190struct nla_policy { 197struct nla_policy {
191 u16 type; 198 u16 type;
192 u16 minlen; 199 u16 len;
193}; 200};
194 201
195/** 202/**