From ab1c652ab82e772c0d5db9ba270473d36bf20d80 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 1 Apr 2012 19:11:31 -0400 Subject: [PATCH] --- yaml --- r: 300397 b: refs/heads/master c: 6c1dd3b6a35178366eefcd0565aa2c8dd9020987 h: refs/heads/master i: 300395: ea217f384ad8843aabcdc116d9de5e1abe3a2831 v: v3 --- [refs] | 2 +- trunk/include/net/netlink.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 39d6487d6630..b6690131a904 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 969e8e255c0a18c30cf78feca2d2e546b5746fc4 +refs/heads/master: 6c1dd3b6a35178366eefcd0565aa2c8dd9020987 diff --git a/trunk/include/net/netlink.h b/trunk/include/net/netlink.h index fce17f6538cc..73656aa8faaa 100644 --- a/trunk/include/net/netlink.h +++ b/trunk/include/net/netlink.h @@ -782,6 +782,17 @@ static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value) return nla_put(skb, attrtype, sizeof(__be16), &value); } +/** + * nla_put_net16 - Add 16-bit network byte order netlink attribute to a socket buffer + * @skb: socket buffer to add attribute to + * @attrtype: attribute type + * @value: numeric value + */ +static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value) +{ + return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, value); +} + /** * nla_put_u32 - Add a u32 netlink attribute to a socket buffer * @skb: socket buffer to add attribute to @@ -804,6 +815,17 @@ static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value) return nla_put(skb, attrtype, sizeof(__be32), &value); } +/** + * nla_put_net32 - Add 32-bit network byte order netlink attribute to a socket buffer + * @skb: socket buffer to add attribute to + * @attrtype: attribute type + * @value: numeric value + */ +static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value) +{ + return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, value); +} + /** * nla_put_u64 - Add a u64 netlink attribute to a socket buffer * @skb: socket buffer to add attribute to @@ -826,6 +848,17 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value) return nla_put(skb, attrtype, sizeof(__be64), &value); } +/** + * nla_put_net64 - Add 64-bit network byte order netlink attribute to a socket buffer + * @skb: socket buffer to add attribute to + * @attrtype: attribute type + * @value: numeric value + */ +static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value) +{ + return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value); +} + /** * nla_put_string - Add a string netlink attribute to a socket buffer * @skb: socket buffer to add attribute to