aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-03-29 23:18:53 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-01 18:11:37 -0400
commit569a8fc38367dfafd87454f27ac646c8e6b54bca (patch)
treea2fca149e44317cdd567ed45677001155f367556 /include
parent7f116b5b6c2418e9d9ba2c2ba82cbbad45e36fc5 (diff)
netlink: Add nla_put_be{16,32,64}() helpers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/netlink.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index f394fe5d7641..fce17f6538cc 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -772,6 +772,17 @@ static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value)
772} 772}
773 773
774/** 774/**
775 * nla_put_be16 - Add a __be16 netlink attribute to a socket buffer
776 * @skb: socket buffer to add attribute to
777 * @attrtype: attribute type
778 * @value: numeric value
779 */
780static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
781{
782 return nla_put(skb, attrtype, sizeof(__be16), &value);
783}
784
785/**
775 * nla_put_u32 - Add a u32 netlink attribute to a socket buffer 786 * nla_put_u32 - Add a u32 netlink attribute to a socket buffer
776 * @skb: socket buffer to add attribute to 787 * @skb: socket buffer to add attribute to
777 * @attrtype: attribute type 788 * @attrtype: attribute type
@@ -783,7 +794,18 @@ static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value)
783} 794}
784 795
785/** 796/**
786 * nla_put_64 - Add a u64 netlink attribute to a socket buffer 797 * nla_put_be32 - Add a __be32 netlink attribute to a socket buffer
798 * @skb: socket buffer to add attribute to
799 * @attrtype: attribute type
800 * @value: numeric value
801 */
802static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
803{
804 return nla_put(skb, attrtype, sizeof(__be32), &value);
805}
806
807/**
808 * nla_put_u64 - Add a u64 netlink attribute to a socket buffer
787 * @skb: socket buffer to add attribute to 809 * @skb: socket buffer to add attribute to
788 * @attrtype: attribute type 810 * @attrtype: attribute type
789 * @value: numeric value 811 * @value: numeric value
@@ -794,6 +816,17 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
794} 816}
795 817
796/** 818/**
819 * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer
820 * @skb: socket buffer to add attribute to
821 * @attrtype: attribute type
822 * @value: numeric value
823 */
824static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
825{
826 return nla_put(skb, attrtype, sizeof(__be64), &value);
827}
828
829/**
797 * nla_put_string - Add a string netlink attribute to a socket buffer 830 * nla_put_string - Add a string netlink attribute to a socket buffer
798 * @skb: socket buffer to add attribute to 831 * @skb: socket buffer to add attribute to
799 * @attrtype: attribute type 832 * @attrtype: attribute type