diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 19:11:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-02 04:33:41 -0400 |
commit | 6c1dd3b6a35178366eefcd0565aa2c8dd9020987 (patch) | |
tree | 5fe5b5683f7e961e92e9103e54bc885a083a76fc | |
parent | 969e8e255c0a18c30cf78feca2d2e546b5746fc4 (diff) |
netlink: Add nla_put_net{16,32,64}() helpers.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/netlink.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h index fce17f6538cc..73656aa8faaa 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -783,6 +783,17 @@ static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value) | |||
783 | } | 783 | } |
784 | 784 | ||
785 | /** | 785 | /** |
786 | * nla_put_net16 - Add 16-bit network byte order netlink attribute to a socket buffer | ||
787 | * @skb: socket buffer to add attribute to | ||
788 | * @attrtype: attribute type | ||
789 | * @value: numeric value | ||
790 | */ | ||
791 | static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value) | ||
792 | { | ||
793 | return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, value); | ||
794 | } | ||
795 | |||
796 | /** | ||
786 | * nla_put_u32 - Add a u32 netlink attribute to a socket buffer | 797 | * nla_put_u32 - Add a u32 netlink attribute to a socket buffer |
787 | * @skb: socket buffer to add attribute to | 798 | * @skb: socket buffer to add attribute to |
788 | * @attrtype: attribute type | 799 | * @attrtype: attribute type |
@@ -805,6 +816,17 @@ static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value) | |||
805 | } | 816 | } |
806 | 817 | ||
807 | /** | 818 | /** |
819 | * nla_put_net32 - Add 32-bit network byte order netlink attribute to a socket buffer | ||
820 | * @skb: socket buffer to add attribute to | ||
821 | * @attrtype: attribute type | ||
822 | * @value: numeric value | ||
823 | */ | ||
824 | static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value) | ||
825 | { | ||
826 | return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, value); | ||
827 | } | ||
828 | |||
829 | /** | ||
808 | * nla_put_u64 - Add a u64 netlink attribute to a socket buffer | 830 | * nla_put_u64 - Add a u64 netlink attribute to a socket buffer |
809 | * @skb: socket buffer to add attribute to | 831 | * @skb: socket buffer to add attribute to |
810 | * @attrtype: attribute type | 832 | * @attrtype: attribute type |
@@ -827,6 +849,17 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value) | |||
827 | } | 849 | } |
828 | 850 | ||
829 | /** | 851 | /** |
852 | * nla_put_net64 - Add 64-bit network byte order netlink attribute to a socket buffer | ||
853 | * @skb: socket buffer to add attribute to | ||
854 | * @attrtype: attribute type | ||
855 | * @value: numeric value | ||
856 | */ | ||
857 | static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value) | ||
858 | { | ||
859 | return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value); | ||
860 | } | ||
861 | |||
862 | /** | ||
830 | * nla_put_string - Add a string netlink attribute to a socket buffer | 863 | * nla_put_string - Add a string netlink attribute to a socket buffer |
831 | * @skb: socket buffer to add attribute to | 864 | * @skb: socket buffer to add attribute to |
832 | * @attrtype: attribute type | 865 | * @attrtype: attribute type |