1 /* SPDX-License-Identifier: LGPL-2.1 */
4 * NETLINK Netlink attributes
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation version 2.1
11 * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
18 #include <linux/netlink.h>
19 /* avoid multiple definition of netlink features */
20 #define __LINUX_NETLINK_H
23 * Standard attribute types to specify validation policy
26 NLA_UNSPEC
, /**< Unspecified type, binary data chunk */
27 NLA_U8
, /**< 8 bit integer */
28 NLA_U16
, /**< 16 bit integer */
29 NLA_U32
, /**< 32 bit integer */
30 NLA_U64
, /**< 64 bit integer */
31 NLA_STRING
, /**< NUL terminated character string */
32 NLA_FLAG
, /**< Flag */
33 NLA_MSECS
, /**< Micro seconds (64bit) */
34 NLA_NESTED
, /**< Nested attributes */
38 #define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1)
42 * Attribute validation policy.
44 * See section @core_doc{core_attr_parse,Attribute Parsing} for more details.
47 /** Type of attribute or NLA_UNSPEC */
50 /** Minimal length of payload required */
53 /** Maximal length of payload allowed */
59 * Iterate over a stream of attributes
60 * @arg pos loop counter, set to current attribute
61 * @arg head head of attribute stream
62 * @arg len length of attribute stream
63 * @arg rem initialized to len, holds bytes currently remaining in stream
65 #define nla_for_each_attr(pos, head, len, rem) \
66 for (pos = head, rem = len; \
68 pos = nla_next(pos, &(rem)))
70 int nla_dump_errormsg(struct nlmsghdr
*nlh
);
72 #endif /* __NLATTR_H */