diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netlink.h | 14 | ||||
-rw-r--r-- | include/net/netlink.h | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index d2843ae4a83a..e638256ce472 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -131,6 +131,20 @@ struct nlattr | |||
131 | __u16 nla_type; | 131 | __u16 nla_type; |
132 | }; | 132 | }; |
133 | 133 | ||
134 | /* | ||
135 | * nla_type (16 bits) | ||
136 | * +---+---+-------------------------------+ | ||
137 | * | N | O | Attribute Type | | ||
138 | * +---+---+-------------------------------+ | ||
139 | * N := Carries nested attributes | ||
140 | * O := Payload stored in network byte order | ||
141 | * | ||
142 | * Note: The N and O flag are mutually exclusive. | ||
143 | */ | ||
144 | #define NLA_F_NESTED (1 << 15) | ||
145 | #define NLA_F_NET_BYTEORDER (1 << 14) | ||
146 | #define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER) | ||
147 | |||
134 | #define NLA_ALIGNTO 4 | 148 | #define NLA_ALIGNTO 4 |
135 | #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) | 149 | #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) |
136 | #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) | 150 | #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) |
diff --git a/include/net/netlink.h b/include/net/netlink.h index d7b824be5422..695e613a207b 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -667,6 +667,15 @@ static inline int nla_padlen(int payload) | |||
667 | } | 667 | } |
668 | 668 | ||
669 | /** | 669 | /** |
670 | * nla_type - attribute type | ||
671 | * @nla: netlink attribute | ||
672 | */ | ||
673 | static inline int nla_type(const struct nlattr *nla) | ||
674 | { | ||
675 | return nla->nla_type & NLA_TYPE_MASK; | ||
676 | } | ||
677 | |||
678 | /** | ||
670 | * nla_data - head of payload | 679 | * nla_data - head of payload |
671 | * @nla: netlink attribute | 680 | * @nla: netlink attribute |
672 | */ | 681 | */ |