diff options
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r-- | include/net/netlink.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h index 9298218c07f9..a5506c42f03c 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -91,6 +91,7 @@ | |||
91 | * nla_reserve_nohdr(skb, len) reserve room for an attribute w/o hdr | 91 | * nla_reserve_nohdr(skb, len) reserve room for an attribute w/o hdr |
92 | * nla_put(skb, type, len, data) add attribute to skb | 92 | * nla_put(skb, type, len, data) add attribute to skb |
93 | * nla_put_nohdr(skb, len, data) add attribute w/o hdr | 93 | * nla_put_nohdr(skb, len, data) add attribute w/o hdr |
94 | * nla_append(skb, len, data) append data to skb | ||
94 | * | 95 | * |
95 | * Attribute Construction for Basic Types: | 96 | * Attribute Construction for Basic Types: |
96 | * nla_put_u8(skb, type, value) add u8 attribute to skb | 97 | * nla_put_u8(skb, type, value) add u8 attribute to skb |
@@ -217,6 +218,7 @@ struct nla_policy { | |||
217 | */ | 218 | */ |
218 | struct nl_info { | 219 | struct nl_info { |
219 | struct nlmsghdr *nlh; | 220 | struct nlmsghdr *nlh; |
221 | struct net *nl_net; | ||
220 | u32 pid; | 222 | u32 pid; |
221 | }; | 223 | }; |
222 | 224 | ||
@@ -253,6 +255,8 @@ extern int nla_put(struct sk_buff *skb, int attrtype, | |||
253 | int attrlen, const void *data); | 255 | int attrlen, const void *data); |
254 | extern int nla_put_nohdr(struct sk_buff *skb, int attrlen, | 256 | extern int nla_put_nohdr(struct sk_buff *skb, int attrlen, |
255 | const void *data); | 257 | const void *data); |
258 | extern int nla_append(struct sk_buff *skb, int attrlen, | ||
259 | const void *data); | ||
256 | 260 | ||
257 | /************************************************************************** | 261 | /************************************************************************** |
258 | * Netlink Messages | 262 | * Netlink Messages |
@@ -862,7 +866,7 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, | |||
862 | 866 | ||
863 | #define NLA_PUT(skb, attrtype, attrlen, data) \ | 867 | #define NLA_PUT(skb, attrtype, attrlen, data) \ |
864 | do { \ | 868 | do { \ |
865 | if (nla_put(skb, attrtype, attrlen, data) < 0) \ | 869 | if (unlikely(nla_put(skb, attrtype, attrlen, data) < 0)) \ |
866 | goto nla_put_failure; \ | 870 | goto nla_put_failure; \ |
867 | } while(0) | 871 | } while(0) |
868 | 872 | ||
@@ -881,6 +885,9 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, | |||
881 | #define NLA_PUT_LE16(skb, attrtype, value) \ | 885 | #define NLA_PUT_LE16(skb, attrtype, value) \ |
882 | NLA_PUT_TYPE(skb, __le16, attrtype, value) | 886 | NLA_PUT_TYPE(skb, __le16, attrtype, value) |
883 | 887 | ||
888 | #define NLA_PUT_BE16(skb, attrtype, value) \ | ||
889 | NLA_PUT_TYPE(skb, __be16, attrtype, value) | ||
890 | |||
884 | #define NLA_PUT_U32(skb, attrtype, value) \ | 891 | #define NLA_PUT_U32(skb, attrtype, value) \ |
885 | NLA_PUT_TYPE(skb, u32, attrtype, value) | 892 | NLA_PUT_TYPE(skb, u32, attrtype, value) |
886 | 893 | ||
@@ -927,6 +934,15 @@ static inline u16 nla_get_u16(struct nlattr *nla) | |||
927 | } | 934 | } |
928 | 935 | ||
929 | /** | 936 | /** |
937 | * nla_get_be16 - return payload of __be16 attribute | ||
938 | * @nla: __be16 netlink attribute | ||
939 | */ | ||
940 | static inline __be16 nla_get_be16(struct nlattr *nla) | ||
941 | { | ||
942 | return *(__be16 *) nla_data(nla); | ||
943 | } | ||
944 | |||
945 | /** | ||
930 | * nla_get_le16 - return payload of __le16 attribute | 946 | * nla_get_le16 - return payload of __le16 attribute |
931 | * @nla: __le16 netlink attribute | 947 | * @nla: __le16 netlink attribute |
932 | */ | 948 | */ |