#ifndef __IP_SET_COMPAT_H #define __IP_SET_COMPAT_H #ifndef CONFIG_IP_SET_MAX #ifdef IP_SET_MAX #define CONFIG_IP_SET_MAX IP_SET_MAX #else #define CONFIG_IP_SET_MAX 256 #endif #endif #@HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_STRUCT_XT_ACTION_PARAM #@HAVE_VZALLOC@ HAVE_VZALLOC #@HAVE_ETHER_ADDR_EQUAL@ HAVE_ETHER_ADDR_EQUAL #@HAVE_NLA_PUT_BE64@ HAVE_NLA_PUT_BE64 #@HAVE_NL_INFO_PORTID@ HAVE_NL_INFO_PORTID #define HAVE_NETLINK_DUMP_START_ARGS @HAVE_NETLINK_DUMP_START_ARGS@ #@HAVE_NS_CAPABLE@ HAVE_NS_CAPABLE #@HAVE_NFNL_LOCK_SUBSYS@ HAVE_NFNL_LOCK_SUBSYS #@HAVE_EXPORT_H@ HAVE_EXPORT_H #define HAVE_IPV6_SKIP_EXTHDR_ARGS @HAVE_IPV6_SKIP_EXTHDR_ARGS@ #@HAVE_CHECKENTRY_BOOL@ HAVE_CHECKENTRY_BOOL #@HAVE_XT_TARGET_PARAM@ HAVE_XT_TARGET_PARAM #@HAVE_NET_OPS_ID@ HAVE_NET_OPS_ID #@HAVE_USER_NS_IN_STRUCT_NET@ HAVE_USER_NS_IN_STRUCT_NET #@HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE@ HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE /* Not everything could be moved here. Compatibility stuffs can be found in * xt_set.c, ip_set_core.c, ip_set_getport.c, pfxlen.c too. */ #include #include #ifndef rcu_dereference_bh #define rcu_dereference_bh(p) rcu_dereference(p) #endif #ifndef rcu_dereference_protected #define rcu_dereference_protected(p, c) rcu_dereference(p) #endif #ifndef __rcu #define __rcu #endif #ifdef CHECK_KCONFIG #ifndef CONFIG_SPARSE_RCU_POINTER #error "CONFIG_SPARSE_RCU_POINTER must be enabled" #endif #endif #if defined(CONFIG_NETFILTER_NETLINK) || defined(CONFIG_NETFILTER_NETLINK_MODULE) #else #error "NETFILTER_NETLINK must be enabled: select NFACCT/NFQUEUE/LOG over NFNETLINK" #endif #ifndef HAVE_STRUCT_XT_ACTION_PARAM #define xt_action_param xt_match_param #endif #ifndef HAVE_VZALLOC #define vzalloc(size) __vmalloc(size,\ GFP_KERNEL|__GFP_ZERO|__GFP_HIGHMEM,\ PAGE_KERNEL) #endif #ifndef HAVE_ETHER_ADDR_EQUAL #include static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) { return !compare_ether_addr(addr1, addr2); } #endif #ifndef HAVE_NLA_PUT_BE64 static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value) { return nla_put(skb, attrtype, sizeof(__be64), &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); } #endif #ifdef HAVE_NL_INFO_PORTID #define NETLINK_PORTID(skb) NETLINK_CB(skb).portid #else #define NETLINK_PORTID(skb) NETLINK_CB(skb).pid #endif #ifndef HAVE_NS_CAPABLE #define ns_capable(ns, cap) capable(cap) #endif #ifdef HAVE_NFNL_LOCK_SUBSYS #define lock_nfnl() nfnl_lock(NFNL_SUBSYS_IPSET) #define unlock_nfnl() nfnl_unlock(NFNL_SUBSYS_IPSET) #else #define lock_nfnl() nfnl_lock() #define unlock_nfnl() nfnl_unlock() #endif #ifdef NLA_PUT_NET16 static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value) { return nla_put(skb, attrtype, sizeof(__be16), &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); } static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value) { return nla_put(skb, attrtype, sizeof(__be32), &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); } #endif #endif /* __IP_SET_COMPAT_H */