diff options
author | Thomas Graf <tgraf@suug.ch> | 2007-09-12 08:44:36 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:16 -0400 |
commit | 8f4c1f9b049df3be11090f1c2c4738700302acae (patch) | |
tree | 51271d32096e4419173072d120176b4428e52a11 /include/linux/netlink.h | |
parent | 9d5010db7ecfd6ec00119d3b185c4c0cd3265167 (diff) |
[NETLINK]: Introduce nested and byteorder flag to netlink attribute
This change allows the generic attribute interface to be used within
the netfilter subsystem where this flag was initially introduced.
The byte-order flag is yet unused, it's intended use is to
allow automatic byte order convertions for all atomic types.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r-- | include/linux/netlink.h | 14 |
1 files changed, 14 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))) |