Commit 1ffad83d authored by Mikko Rapeli's avatar Mikko Rapeli Committed by Pablo Neira Ayuso

netfilter: fix include files for compilation

Add missing header dependencies and other small changes so that each file
compiles alone in userspace.
Signed-off-by: default avatarMikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent dad15819
#ifndef _UAPI__IP_SET_BITMAP_H #ifndef _UAPI__IP_SET_BITMAP_H
#define _UAPI__IP_SET_BITMAP_H #define _UAPI__IP_SET_BITMAP_H
#include <linux/netfilter/ipset/ip_set.h>
/* Bitmap type specific error codes */ /* Bitmap type specific error codes */
enum { enum {
/* The element is out of the range of the set */ /* The element is out of the range of the set */
......
#ifndef _UAPI__IP_SET_HASH_H #ifndef _UAPI__IP_SET_HASH_H
#define _UAPI__IP_SET_HASH_H #define _UAPI__IP_SET_HASH_H
#include <linux/netfilter/ipset/ip_set.h>
/* Hash type specific error codes */ /* Hash type specific error codes */
enum { enum {
/* Hash is full */ /* Hash is full */
......
#ifndef _UAPI__IP_SET_LIST_H #ifndef _UAPI__IP_SET_LIST_H
#define _UAPI__IP_SET_LIST_H #define _UAPI__IP_SET_LIST_H
#include <linux/netfilter/ipset/ip_set.h>
/* List type specific error codes */ /* List type specific error codes */
enum { enum {
/* Set name to be added/deleted/tested does not exist. */ /* Set name to be added/deleted/tested does not exist. */
......
#ifndef _NF_CONNTRACK_TUPLE_COMMON_H #ifndef _NF_CONNTRACK_TUPLE_COMMON_H
#define _NF_CONNTRACK_TUPLE_COMMON_H #define _NF_CONNTRACK_TUPLE_COMMON_H
#include <linux/types.h>
#include <linux/netfilter.h>
enum ip_conntrack_dir { enum ip_conntrack_dir {
IP_CT_DIR_ORIGINAL, IP_CT_DIR_ORIGINAL,
IP_CT_DIR_REPLY, IP_CT_DIR_REPLY,
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define XT_HMARK_H_ #define XT_HMARK_H_
#include <linux/types.h> #include <linux/types.h>
#include <linux/netfilter.h>
enum { enum {
XT_HMARK_SADDR_MASK, XT_HMARK_SADDR_MASK,
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _XT_RATEEST_TARGET_H #define _XT_RATEEST_TARGET_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/if.h>
struct xt_rateest_target_info { struct xt_rateest_target_info {
char name[IFNAMSIZ]; char name[IFNAMSIZ];
......
#ifndef _XT_TEE_TARGET_H #ifndef _XT_TEE_TARGET_H
#define _XT_TEE_TARGET_H #define _XT_TEE_TARGET_H
#include <linux/netfilter.h>
struct xt_tee_tginfo { struct xt_tee_tginfo {
union nf_inet_addr gw; union nf_inet_addr gw;
char oif[16]; char oif[16];
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _XT_TPROXY_H #define _XT_TPROXY_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/netfilter.h>
/* TPROXY target is capable of marking the packet to perform /* TPROXY target is capable of marking the packet to perform
* redirection. We can get rid of that whenever we get support for * redirection. We can get rid of that whenever we get support for
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _UAPI_XT_HASHLIMIT_H #define _UAPI_XT_HASHLIMIT_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/if.h>
/* timings are in milliseconds. */ /* timings are in milliseconds. */
#define XT_HASHLIMIT_SCALE 10000 #define XT_HASHLIMIT_SCALE 10000
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _XT_IPVS_H #define _XT_IPVS_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/netfilter.h>
enum { enum {
XT_IPVS_IPVS_PROPERTY = 1 << 0, /* all other options imply this one */ XT_IPVS_IPVS_PROPERTY = 1 << 0, /* all other options imply this one */
......
#ifndef _XT_MAC_H #ifndef _XT_MAC_H
#define _XT_MAC_H #define _XT_MAC_H
#include <linux/if_ether.h>
struct xt_mac_info { struct xt_mac_info {
unsigned char srcaddr[ETH_ALEN]; unsigned char srcaddr[ETH_ALEN];
int invert; int invert;
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#define _XT_OSF_H #define _XT_OSF_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#define MAXGENRELEN 32 #define MAXGENRELEN 32
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define _UAPI_XT_PHYSDEV_H #define _UAPI_XT_PHYSDEV_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/if.h>
#define XT_PHYSDEV_OP_IN 0x01 #define XT_PHYSDEV_OP_IN 0x01
#define XT_PHYSDEV_OP_OUT 0x02 #define XT_PHYSDEV_OP_OUT 0x02
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#define _XT_POLICY_H #define _XT_POLICY_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/in.h>
#include <linux/in6.h>
#define XT_POLICY_MAX_ELEM 4 #define XT_POLICY_MAX_ELEM 4
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _XT_RATEEST_MATCH_H #define _XT_RATEEST_MATCH_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/if.h>
enum xt_rateest_match_flags { enum xt_rateest_match_flags {
XT_RATEEST_MATCH_INVERT = 1<<0, XT_RATEEST_MATCH_INVERT = 1<<0,
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _LINUX_NETFILTER_XT_RECENT_H 1 #define _LINUX_NETFILTER_XT_RECENT_H 1
#include <linux/types.h> #include <linux/types.h>
#include <linux/netfilter.h>
enum { enum {
XT_RECENT_CHECK = 1 << 0, XT_RECENT_CHECK = 1 << 0,
......
...@@ -66,26 +66,26 @@ struct xt_sctp_info { ...@@ -66,26 +66,26 @@ struct xt_sctp_info {
#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \ #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
__sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap)) __sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap))
static inline bool static inline _Bool
__sctp_chunkmap_is_clear(const __u32 *chunkmap, unsigned int n) __sctp_chunkmap_is_clear(const __u32 *chunkmap, unsigned int n)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < n; ++i) for (i = 0; i < n; ++i)
if (chunkmap[i]) if (chunkmap[i])
return false; return 0;
return true; return 1;
} }
#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \ #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
__sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap)) __sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap))
static inline bool static inline _Bool
__sctp_chunkmap_is_all_set(const __u32 *chunkmap, unsigned int n) __sctp_chunkmap_is_all_set(const __u32 *chunkmap, unsigned int n)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < n; ++i) for (i = 0; i < n; ++i)
if (chunkmap[i] != ~0U) if (chunkmap[i] != ~0U)
return false; return 0;
return true; return 1;
} }
#endif /* _XT_SCTP_H_ */ #endif /* _XT_SCTP_H_ */
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/if.h>
#include <linux/netfilter_arp.h> #include <linux/netfilter_arp.h>
#include <linux/netfilter/x_tables.h> #include <linux/netfilter/x_tables.h>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
/* bridge-specific defines for netfilter. /* bridge-specific defines for netfilter.
*/ */
#include <linux/in.h>
#include <linux/netfilter.h> #include <linux/netfilter.h>
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define __LINUX_BRIDGE_EBT_ARP_H #define __LINUX_BRIDGE_EBT_ARP_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/if_ether.h>
#define EBT_ARP_OPCODE 0x01 #define EBT_ARP_OPCODE 0x01
#define EBT_ARP_HTYPE 0x02 #define EBT_ARP_HTYPE 0x02
......
#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H #ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H
#define __LINUX_BRIDGE_EBT_ARPREPLY_H #define __LINUX_BRIDGE_EBT_ARPREPLY_H
#include <linux/if_ether.h>
struct ebt_arpreply_info { struct ebt_arpreply_info {
unsigned char mac[ETH_ALEN]; unsigned char mac[ETH_ALEN];
int target; int target;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#define __LINUX_BRIDGE_EBT_IP6_H #define __LINUX_BRIDGE_EBT_IP6_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/in6.h>
#define EBT_IP6_SOURCE 0x01 #define EBT_IP6_SOURCE 0x01
#define EBT_IP6_DEST 0x02 #define EBT_IP6_DEST 0x02
......
#ifndef __LINUX_BRIDGE_EBT_NAT_H #ifndef __LINUX_BRIDGE_EBT_NAT_H
#define __LINUX_BRIDGE_EBT_NAT_H #define __LINUX_BRIDGE_EBT_NAT_H
#include <linux/if_ether.h>
#define NAT_ARP_BIT (0x00000010) #define NAT_ARP_BIT (0x00000010)
struct ebt_nat_info { struct ebt_nat_info {
unsigned char mac[ETH_ALEN]; unsigned char mac[ETH_ALEN];
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/if.h>
#include <linux/netfilter_ipv4.h> #include <linux/netfilter_ipv4.h>
#include <linux/netfilter/x_tables.h> #include <linux/netfilter/x_tables.h>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/if.h>
#include <linux/netfilter_ipv6.h> #include <linux/netfilter_ipv6.h>
#include <linux/netfilter/x_tables.h> #include <linux/netfilter/x_tables.h>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define _IP6T_RT_H #define _IP6T_RT_H
#include <linux/types.h> #include <linux/types.h>
/*#include <linux/in6.h>*/ #include <linux/in6.h>
#define IP6T_RT_HOPS 16 #define IP6T_RT_HOPS 16
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment