]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
netfilter: NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 1 Feb 2011 14:20:14 +0000 (15:20 +0100)
committerPatrick McHardy <kaber@trash.net>
Tue, 1 Feb 2011 14:20:14 +0000 (15:20 +0100)
The patch adds the NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros to the
vanilla kernel.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
include/linux/netfilter/nfnetlink.h
include/net/netlink.h

index 361d6b5630ee8105e407477308bed1ab6f03ccf0..2b11fc1a86bedb64cf609537daf476de87d41dcc 100644 (file)
@@ -47,7 +47,8 @@ struct nfgenmsg {
 #define NFNL_SUBSYS_QUEUE              3
 #define NFNL_SUBSYS_ULOG               4
 #define NFNL_SUBSYS_OSF                        5
-#define NFNL_SUBSYS_COUNT              6
+#define NFNL_SUBSYS_IPSET              6
+#define NFNL_SUBSYS_COUNT              7
 
 #ifdef __KERNEL__
 
index 373f1a900cf4784abf1f4e71791f501e222dfe3f..8a3906a08f5fc71c8696984b8361f7a11bfbaf04 100644 (file)
@@ -856,18 +856,27 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
 #define NLA_PUT_BE16(skb, attrtype, value) \
        NLA_PUT_TYPE(skb, __be16, attrtype, value)
 
+#define NLA_PUT_NET16(skb, attrtype, value) \
+       NLA_PUT_BE16(skb, attrtype | NLA_F_NET_BYTEORDER, value)
+
 #define NLA_PUT_U32(skb, attrtype, value) \
        NLA_PUT_TYPE(skb, u32, attrtype, value)
 
 #define NLA_PUT_BE32(skb, attrtype, value) \
        NLA_PUT_TYPE(skb, __be32, attrtype, value)
 
+#define NLA_PUT_NET32(skb, attrtype, value) \
+       NLA_PUT_BE32(skb, attrtype | NLA_F_NET_BYTEORDER, value)
+
 #define NLA_PUT_U64(skb, attrtype, value) \
        NLA_PUT_TYPE(skb, u64, attrtype, value)
 
 #define NLA_PUT_BE64(skb, attrtype, value) \
        NLA_PUT_TYPE(skb, __be64, attrtype, value)
 
+#define NLA_PUT_NET64(skb, attrtype, value) \
+       NLA_PUT_BE64(skb, attrtype | NLA_F_NET_BYTEORDER, value)
+
 #define NLA_PUT_STRING(skb, attrtype, value) \
        NLA_PUT(skb, attrtype, strlen(value) + 1, value)