]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
make netfilter use strict integer types
authorArnd Bergmann <arnd@arndb.de>
Wed, 25 Feb 2009 23:51:43 +0000 (00:51 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Mar 2009 17:14:20 +0000 (18:14 +0100)
Netfilter traditionally uses BSD integer types in its
interface headers. This changes it to use the Linux
strict integer types, like everyone else.

Cc: netfilter-devel@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
39 files changed:
include/linux/netfilter/nf_conntrack_tcp.h
include/linux/netfilter/nfnetlink.h
include/linux/netfilter/nfnetlink_compat.h
include/linux/netfilter/nfnetlink_log.h
include/linux/netfilter/nfnetlink_queue.h
include/linux/netfilter/x_tables.h
include/linux/netfilter/xt_CLASSIFY.h
include/linux/netfilter/xt_CONNMARK.h
include/linux/netfilter/xt_CONNSECMARK.h
include/linux/netfilter/xt_DSCP.h
include/linux/netfilter/xt_MARK.h
include/linux/netfilter/xt_NFLOG.h
include/linux/netfilter/xt_NFQUEUE.h
include/linux/netfilter/xt_RATEEST.h
include/linux/netfilter/xt_SECMARK.h
include/linux/netfilter/xt_TCPMSS.h
include/linux/netfilter/xt_connbytes.h
include/linux/netfilter/xt_connmark.h
include/linux/netfilter/xt_conntrack.h
include/linux/netfilter/xt_dccp.h
include/linux/netfilter/xt_dscp.h
include/linux/netfilter/xt_esp.h
include/linux/netfilter/xt_hashlimit.h
include/linux/netfilter/xt_iprange.h
include/linux/netfilter/xt_length.h
include/linux/netfilter/xt_limit.h
include/linux/netfilter/xt_mark.h
include/linux/netfilter/xt_multiport.h
include/linux/netfilter/xt_owner.h
include/linux/netfilter/xt_physdev.h
include/linux/netfilter/xt_policy.h
include/linux/netfilter/xt_rateest.h
include/linux/netfilter/xt_realm.h
include/linux/netfilter/xt_recent.h
include/linux/netfilter/xt_sctp.h
include/linux/netfilter/xt_statistic.h
include/linux/netfilter/xt_string.h
include/linux/netfilter/xt_tcpmss.h
include/linux/netfilter/xt_tcpudp.h

index a049df4f2236360e2aae61bf3da3e38bf35b6963..3066789b972a08a23e6cd882c51d18e254c9be9a 100644 (file)
@@ -2,6 +2,8 @@
 #define _NF_CONNTRACK_TCP_H
 /* TCP tracking. */
 
+#include <linux/types.h>
+
 /* This is exposed to userspace (ctnetlink) */
 enum tcp_conntrack {
        TCP_CONNTRACK_NONE,
@@ -34,8 +36,8 @@ enum tcp_conntrack {
 #define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED     0x10
 
 struct nf_ct_tcp_flags {
-       u_int8_t flags;
-       u_int8_t mask;
+       __u8 flags;
+       __u8 mask;
 };
 
 #ifdef __KERNEL__
index 7d8e0455ccacb101e79cb9e6a940ccf7f5c41615..e53546cfa353bb8042b4db201f63b493a5cb7080 100644 (file)
@@ -25,8 +25,8 @@ enum nfnetlink_groups {
 /* General form of address family dependent message.
  */
 struct nfgenmsg {
-       u_int8_t  nfgen_family;         /* AF_xxx */
-       u_int8_t  version;              /* nfnetlink version */
+       __u8  nfgen_family;             /* AF_xxx */
+       __u8  version;          /* nfnetlink version */
        __be16    res_id;               /* resource id */
 };
 
index e1451760c9cd3dfc991c707d2b4d90b7062b5fb2..eda55cabceec5ee663829e0f8ce9d683deac0011 100644 (file)
@@ -1,5 +1,8 @@
 #ifndef _NFNETLINK_COMPAT_H
 #define _NFNETLINK_COMPAT_H
+
+#include <linux/types.h>
+
 #ifndef __KERNEL__
 /* Old nfnetlink macros for userspace */
 
@@ -20,8 +23,8 @@
 
 struct nfattr
 {
-       u_int16_t nfa_len;
-       u_int16_t nfa_type;     /* we use 15 bits for the type, and the highest
+       __u16 nfa_len;
+       __u16 nfa_type; /* we use 15 bits for the type, and the highest
                                 * bit to indicate whether the payload is nested */
 };
 
index f661731f3cb161bfb8b1f74e8e0fec4a8facf4b0..d3bab7a2c9b710eeecaecd24f660697b14263196 100644 (file)
@@ -17,14 +17,14 @@ enum nfulnl_msg_types {
 
 struct nfulnl_msg_packet_hdr {
        __be16          hw_protocol;    /* hw protocol (network order) */
-       u_int8_t        hook;           /* netfilter hook */
-       u_int8_t        _pad;
+       __u8    hook;           /* netfilter hook */
+       __u8    _pad;
 };
 
 struct nfulnl_msg_packet_hw {
        __be16          hw_addrlen;
-       u_int16_t       _pad;
-       u_int8_t        hw_addr[8];
+       __u16   _pad;
+       __u8    hw_addr[8];
 };
 
 struct nfulnl_msg_packet_timestamp {
@@ -35,12 +35,12 @@ struct nfulnl_msg_packet_timestamp {
 enum nfulnl_attr_type {
        NFULA_UNSPEC,
        NFULA_PACKET_HDR,
-       NFULA_MARK,                     /* u_int32_t nfmark */
+       NFULA_MARK,                     /* __u32 nfmark */
        NFULA_TIMESTAMP,                /* nfulnl_msg_packet_timestamp */
-       NFULA_IFINDEX_INDEV,            /* u_int32_t ifindex */
-       NFULA_IFINDEX_OUTDEV,           /* u_int32_t ifindex */
-       NFULA_IFINDEX_PHYSINDEV,        /* u_int32_t ifindex */
-       NFULA_IFINDEX_PHYSOUTDEV,       /* u_int32_t ifindex */
+       NFULA_IFINDEX_INDEV,            /* __u32 ifindex */
+       NFULA_IFINDEX_OUTDEV,           /* __u32 ifindex */
+       NFULA_IFINDEX_PHYSINDEV,        /* __u32 ifindex */
+       NFULA_IFINDEX_PHYSOUTDEV,       /* __u32 ifindex */
        NFULA_HWADDR,                   /* nfulnl_msg_packet_hw */
        NFULA_PAYLOAD,                  /* opaque data payload */
        NFULA_PREFIX,                   /* string prefix */
@@ -65,23 +65,23 @@ enum nfulnl_msg_config_cmds {
 };
 
 struct nfulnl_msg_config_cmd {
-       u_int8_t        command;        /* nfulnl_msg_config_cmds */
+       __u8    command;        /* nfulnl_msg_config_cmds */
 } __attribute__ ((packed));
 
 struct nfulnl_msg_config_mode {
        __be32          copy_range;
-       u_int8_t        copy_mode;
-       u_int8_t        _pad;
+       __u8    copy_mode;
+       __u8    _pad;
 } __attribute__ ((packed));
 
 enum nfulnl_attr_config {
        NFULA_CFG_UNSPEC,
        NFULA_CFG_CMD,                  /* nfulnl_msg_config_cmd */
        NFULA_CFG_MODE,                 /* nfulnl_msg_config_mode */
-       NFULA_CFG_NLBUFSIZ,             /* u_int32_t buffer size */
-       NFULA_CFG_TIMEOUT,              /* u_int32_t in 1/100 s */
-       NFULA_CFG_QTHRESH,              /* u_int32_t */
-       NFULA_CFG_FLAGS,                /* u_int16_t */
+       NFULA_CFG_NLBUFSIZ,             /* __u32 buffer size */
+       NFULA_CFG_TIMEOUT,              /* __u32 in 1/100 s */
+       NFULA_CFG_QTHRESH,              /* __u32 */
+       NFULA_CFG_FLAGS,                /* __u16 */
        __NFULA_CFG_MAX
 };
 #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
index 83e789633e353c4b42e48e0aa2b7b4c444b6aea0..2455fe5f4e016938a68c63f1626ea633bde1a46e 100644 (file)
@@ -15,13 +15,13 @@ enum nfqnl_msg_types {
 struct nfqnl_msg_packet_hdr {
        __be32          packet_id;      /* unique ID of packet in queue */
        __be16          hw_protocol;    /* hw protocol (network order) */
-       u_int8_t        hook;           /* netfilter hook */
+       __u8    hook;           /* netfilter hook */
 } __attribute__ ((packed));
 
 struct nfqnl_msg_packet_hw {
        __be16          hw_addrlen;
-       u_int16_t       _pad;
-       u_int8_t        hw_addr[8];
+       __u16   _pad;
+       __u8    hw_addr[8];
 };
 
 struct nfqnl_msg_packet_timestamp {
@@ -33,12 +33,12 @@ enum nfqnl_attr_type {
        NFQA_UNSPEC,
        NFQA_PACKET_HDR,
        NFQA_VERDICT_HDR,               /* nfqnl_msg_verdict_hrd */
-       NFQA_MARK,                      /* u_int32_t nfmark */
+       NFQA_MARK,                      /* __u32 nfmark */
        NFQA_TIMESTAMP,                 /* nfqnl_msg_packet_timestamp */
-       NFQA_IFINDEX_INDEV,             /* u_int32_t ifindex */
-       NFQA_IFINDEX_OUTDEV,            /* u_int32_t ifindex */
-       NFQA_IFINDEX_PHYSINDEV,         /* u_int32_t ifindex */
-       NFQA_IFINDEX_PHYSOUTDEV,        /* u_int32_t ifindex */
+       NFQA_IFINDEX_INDEV,             /* __u32 ifindex */
+       NFQA_IFINDEX_OUTDEV,            /* __u32 ifindex */
+       NFQA_IFINDEX_PHYSINDEV,         /* __u32 ifindex */
+       NFQA_IFINDEX_PHYSOUTDEV,        /* __u32 ifindex */
        NFQA_HWADDR,                    /* nfqnl_msg_packet_hw */
        NFQA_PAYLOAD,                   /* opaque data payload */
 
@@ -61,8 +61,8 @@ enum nfqnl_msg_config_cmds {
 };
 
 struct nfqnl_msg_config_cmd {
-       u_int8_t        command;        /* nfqnl_msg_config_cmds */
-       u_int8_t        _pad;
+       __u8    command;        /* nfqnl_msg_config_cmds */
+       __u8    _pad;
        __be16          pf;             /* AF_xxx for PF_[UN]BIND */
 };
 
@@ -74,7 +74,7 @@ enum nfqnl_config_mode {
 
 struct nfqnl_msg_config_params {
        __be32          copy_range;
-       u_int8_t        copy_mode;      /* enum nfqnl_config_mode */
+       __u8    copy_mode;      /* enum nfqnl_config_mode */
 } __attribute__ ((packed));
 
 
@@ -82,7 +82,7 @@ enum nfqnl_attr_config {
        NFQA_CFG_UNSPEC,
        NFQA_CFG_CMD,                   /* nfqnl_msg_config_cmd */
        NFQA_CFG_PARAMS,                /* nfqnl_msg_config_params */
-       NFQA_CFG_QUEUE_MAXLEN,          /* u_int32_t */
+       NFQA_CFG_QUEUE_MAXLEN,          /* __u32 */
        __NFQA_CFG_MAX
 };
 #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
index c7ee8744d26bb11567d4b789ca0221dc99985c7c..33fd9c949d80a188b4cd42fe5bb7732be2309033 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _X_TABLES_H
 #define _X_TABLES_H
 
+#include <linux/types.h>
+
 #define XT_FUNCTION_MAXNAMELEN 30
 #define XT_TABLE_MAXNAMELEN 32
 
@@ -8,22 +10,22 @@ struct xt_entry_match
 {
        union {
                struct {
-                       u_int16_t match_size;
+                       __u16 match_size;
 
                        /* Used by userspace */
                        char name[XT_FUNCTION_MAXNAMELEN-1];
 
-                       u_int8_t revision;
+                       __u8 revision;
                } user;
                struct {
-                       u_int16_t match_size;
+                       __u16 match_size;
 
                        /* Used inside the kernel */
                        struct xt_match *match;
                } kernel;
 
                /* Total length */
-               u_int16_t match_size;
+               __u16 match_size;
        } u;
 
        unsigned char data[0];
@@ -33,22 +35,22 @@ struct xt_entry_target
 {
        union {
                struct {
-                       u_int16_t target_size;
+                       __u16 target_size;
 
                        /* Used by userspace */
                        char name[XT_FUNCTION_MAXNAMELEN-1];
 
-                       u_int8_t revision;
+                       __u8 revision;
                } user;
                struct {
-                       u_int16_t target_size;
+                       __u16 target_size;
 
                        /* Used inside the kernel */
                        struct xt_target *target;
                } kernel;
 
                /* Total length */
-               u_int16_t target_size;
+               __u16 target_size;
        } u;
 
        unsigned char data[0];
@@ -74,7 +76,7 @@ struct xt_get_revision
 {
        char name[XT_FUNCTION_MAXNAMELEN-1];
 
-       u_int8_t revision;
+       __u8 revision;
 };
 
 /* CONTINUE verdict for targets */
@@ -90,10 +92,10 @@ struct xt_get_revision
  */
 struct _xt_align
 {
-       u_int8_t u8;
-       u_int16_t u16;
-       u_int32_t u32;
-       u_int64_t u64;
+       __u8 u8;
+       __u16 u16;
+       __u32 u32;
+       __u64 u64;
 };
 
 #define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1))         \
@@ -109,7 +111,7 @@ struct _xt_align
 
 struct xt_counters
 {
-       u_int64_t pcnt, bcnt;                   /* Packet and byte counters */
+       __u64 pcnt, bcnt;                       /* Packet and byte counters */
 };
 
 /* The argument to IPT_SO_ADD_COUNTERS. */
index 58111355255dbb1e451f3c366c8f0bcb60c1abcd..a813bf14dd632dcb78e2d301a63e73f9e74997f3 100644 (file)
@@ -1,8 +1,10 @@
 #ifndef _XT_CLASSIFY_H
 #define _XT_CLASSIFY_H
 
+#include <linux/types.h>
+
 struct xt_classify_target_info {
-       u_int32_t priority;
+       __u32 priority;
 };
 
 #endif /*_XT_CLASSIFY_H */
index 4e58ba43c289ab7a8bf943c4c9c54b538a647c80..7635c8ffdadba4eaf2e26044db7c41a1169a61c7 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_CONNMARK_H_target
 #define _XT_CONNMARK_H_target
 
+#include <linux/types.h>
+
 /* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
  * by Henrik Nordstrom <hno@marasystems.com>
  *
@@ -19,12 +21,12 @@ enum {
 struct xt_connmark_target_info {
        unsigned long mark;
        unsigned long mask;
-       u_int8_t mode;
+       __u8 mode;
 };
 
 struct xt_connmark_tginfo1 {
-       u_int32_t ctmark, ctmask, nfmask;
-       u_int8_t mode;
+       __u32 ctmark, ctmask, nfmask;
+       __u8 mode;
 };
 
 #endif /*_XT_CONNMARK_H_target*/
index c6bd75469ba28d66f80da391284a710e731267d0..b973ff80fa1e29cbb67dff66bd1d9bc4960e8e1f 100644 (file)
@@ -1,13 +1,15 @@
 #ifndef _XT_CONNSECMARK_H_target
 #define _XT_CONNSECMARK_H_target
 
+#include <linux/types.h>
+
 enum {
        CONNSECMARK_SAVE = 1,
        CONNSECMARK_RESTORE,
 };
 
 struct xt_connsecmark_target_info {
-       u_int8_t mode;
+       __u8 mode;
 };
 
 #endif /*_XT_CONNSECMARK_H_target */
index 14da1968e2c627c3cc35aed0798a7d90aebd847e..648e0b3bed29a40c753582ed814b9c5f01d736bc 100644 (file)
 #ifndef _XT_DSCP_TARGET_H
 #define _XT_DSCP_TARGET_H
 #include <linux/netfilter/xt_dscp.h>
+#include <linux/types.h>
 
 /* target info */
 struct xt_DSCP_info {
-       u_int8_t dscp;
+       __u8 dscp;
 };
 
 struct xt_tos_target_info {
-       u_int8_t tos_value;
-       u_int8_t tos_mask;
+       __u8 tos_value;
+       __u8 tos_mask;
 };
 
 #endif /* _XT_DSCP_TARGET_H */
index 778b278fd9f278e825a1caae596e11c3b4c47ae7..028304bcc0b15140e1a1337d3a48855f8abe52fb 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_MARK_H_target
 #define _XT_MARK_H_target
 
+#include <linux/types.h>
+
 /* Version 0 */
 struct xt_mark_target_info {
        unsigned long mark;
@@ -15,11 +17,11 @@ enum {
 
 struct xt_mark_target_info_v1 {
        unsigned long mark;
-       u_int8_t mode;
+       __u8 mode;
 };
 
 struct xt_mark_tginfo2 {
-       u_int32_t mark, mask;
+       __u32 mark, mask;
 };
 
 #endif /*_XT_MARK_H_target */
index cdcd0ed58f7aced31dd8f909452a9d7e2dcb1bd8..eaac7b5226e9fc961be793fab52182932557c3bc 100644 (file)
@@ -1,17 +1,19 @@
 #ifndef _XT_NFLOG_TARGET
 #define _XT_NFLOG_TARGET
 
+#include <linux/types.h>
+
 #define XT_NFLOG_DEFAULT_GROUP         0x1
 #define XT_NFLOG_DEFAULT_THRESHOLD     1
 
 #define XT_NFLOG_MASK                  0x0
 
 struct xt_nflog_info {
-       u_int32_t       len;
-       u_int16_t       group;
-       u_int16_t       threshold;
-       u_int16_t       flags;
-       u_int16_t       pad;
+       __u32   len;
+       __u16   group;
+       __u16   threshold;
+       __u16   flags;
+       __u16   pad;
        char            prefix[64];
 };
 
index 9a9af79f74d2a40396f4606dbf37855dd5205b73..982a89f7827272c202a752b69776715594712605 100644 (file)
@@ -8,9 +8,11 @@
 #ifndef _XT_NFQ_TARGET_H
 #define _XT_NFQ_TARGET_H
 
+#include <linux/types.h>
+
 /* target info */
 struct xt_NFQ_info {
-       u_int16_t queuenum;
+       __u16 queuenum;
 };
 
 #endif /* _XT_NFQ_TARGET_H */
index f79e3133cbeae4ec600eb1b7b02b131be57b1d17..6605e20ad8cf0ccf8052f6502a8bf51dcd49ec1b 100644 (file)
@@ -1,10 +1,12 @@
 #ifndef _XT_RATEEST_TARGET_H
 #define _XT_RATEEST_TARGET_H
 
+#include <linux/types.h>
+
 struct xt_rateest_target_info {
        char                    name[IFNAMSIZ];
-       int8_t                  interval;
-       u_int8_t                ewma_log;
+       __s8                    interval;
+       __u8            ewma_log;
 
        /* Used internally by the kernel */
        struct xt_rateest       *est __attribute__((aligned(8)));
index c53fbffa997de7693b9f495a0d3076837e4de931..6fcd3448b18631f04e081cde470f85218dd7f9b8 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_SECMARK_H_target
 #define _XT_SECMARK_H_target
 
+#include <linux/types.h>
+
 /*
  * This is intended for use by various security subsystems (but not
  * at the same time).
 #define SECMARK_SELCTX_MAX     256
 
 struct xt_secmark_target_selinux_info {
-       u_int32_t selsid;
+       __u32 selsid;
        char selctx[SECMARK_SELCTX_MAX];
 };
 
 struct xt_secmark_target_info {
-       u_int8_t mode;
+       __u8 mode;
        union {
                struct xt_secmark_target_selinux_info sel;
        } u;
index 53a292cd47f335aea12067bebb6ccc0bca34627a..9a6960afc134f1e4081c499a40781d84ce146f34 100644 (file)
@@ -1,8 +1,10 @@
 #ifndef _XT_TCPMSS_H
 #define _XT_TCPMSS_H
 
+#include <linux/types.h>
+
 struct xt_tcpmss_info {
-       u_int16_t mss;
+       __u16 mss;
 };
 
 #define XT_TCPMSS_CLAMP_PMTU 0xffff
index c022c989754d8310165eb5095672ad06f85971da..52bd6153b9965d9ac1e3fc8fd545af72f2dc3ee3 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_CONNBYTES_H
 #define _XT_CONNBYTES_H
 
+#include <linux/types.h>
+
 enum xt_connbytes_what {
        XT_CONNBYTES_PKTS,
        XT_CONNBYTES_BYTES,
@@ -19,7 +21,7 @@ struct xt_connbytes_info
                aligned_u64 from;       /* count to be matched */
                aligned_u64 to;         /* count to be matched */
        } count;
-       u_int8_t what;          /* ipt_connbytes_what */
-       u_int8_t direction;     /* ipt_connbytes_direction */
+       __u8 what;              /* ipt_connbytes_what */
+       __u8 direction; /* ipt_connbytes_direction */
 };
 #endif
index 359ef86918dcca37af7e7529578a6fc9236f6898..571e266d004cb3b0ffb9a93a93bf4af268e6d3a6 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_CONNMARK_H
 #define _XT_CONNMARK_H
 
+#include <linux/types.h>
+
 /* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
  * by Henrik Nordstrom <hno@marasystems.com>
  *
 
 struct xt_connmark_info {
        unsigned long mark, mask;
-       u_int8_t invert;
+       __u8 invert;
 };
 
 struct xt_connmark_mtinfo1 {
-       u_int32_t mark, mask;
-       u_int8_t invert;
+       __u32 mark, mask;
+       __u8 invert;
 };
 
 #endif /*_XT_CONNMARK_H*/
index 8f5345275393b61d652a0cd934f656770f0557a7..3430c775194828b6cea57984d14c6c80d45c5fe4 100644 (file)
@@ -63,9 +63,9 @@ struct xt_conntrack_info
        unsigned long expires_min, expires_max;
 
        /* Flags word */
-       u_int8_t flags;
+       __u8 flags;
        /* Inverse flags */
-       u_int8_t invflags;
+       __u8 invflags;
 };
 
 struct xt_conntrack_mtinfo1 {
@@ -73,12 +73,12 @@ struct xt_conntrack_mtinfo1 {
        union nf_inet_addr origdst_addr, origdst_mask;
        union nf_inet_addr replsrc_addr, replsrc_mask;
        union nf_inet_addr repldst_addr, repldst_mask;
-       u_int32_t expires_min, expires_max;
-       u_int16_t l4proto;
+       __u32 expires_min, expires_max;
+       __u16 l4proto;
        __be16 origsrc_port, origdst_port;
        __be16 replsrc_port, repldst_port;
-       u_int16_t match_flags, invert_flags;
-       u_int8_t state_mask, status_mask;
+       __u16 match_flags, invert_flags;
+       __u8 state_mask, status_mask;
 };
 
 #endif /*_XT_CONNTRACK_H*/
index e0221b9d32cbd204ad5ae1611cd84f4d6d0700bf..a579e1b6f04080fbb92a2f6ba171c80e50c7283c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_DCCP_H_
 #define _XT_DCCP_H_
 
+#include <linux/types.h>
+
 #define XT_DCCP_SRC_PORTS              0x01
 #define XT_DCCP_DEST_PORTS             0x02
 #define XT_DCCP_TYPE                   0x04
 #define XT_DCCP_VALID_FLAGS            0x0f
 
 struct xt_dccp_info {
-       u_int16_t dpts[2];  /* Min, Max */
-       u_int16_t spts[2];  /* Min, Max */
+       __u16 dpts[2];  /* Min, Max */
+       __u16 spts[2];  /* Min, Max */
 
-       u_int16_t flags;
-       u_int16_t invflags;
+       __u16 flags;
+       __u16 invflags;
 
-       u_int16_t typemask;
-       u_int8_t option;
+       __u16 typemask;
+       __u8 option;
 };
 
 #endif /* _XT_DCCP_H_ */
index f49bc1a648dc5fd505551e0d4521fcb3f622de52..15f8932ad5ce64ea4adceaa6dd764dda9c233bf6 100644 (file)
 #ifndef _XT_DSCP_H
 #define _XT_DSCP_H
 
+#include <linux/types.h>
+
 #define XT_DSCP_MASK   0xfc    /* 11111100 */
 #define XT_DSCP_SHIFT  2
 #define XT_DSCP_MAX    0x3f    /* 00111111 */
 
 /* match info */
 struct xt_dscp_info {
-       u_int8_t dscp;
-       u_int8_t invert;
+       __u8 dscp;
+       __u8 invert;
 };
 
 struct xt_tos_match_info {
-       u_int8_t tos_mask;
-       u_int8_t tos_value;
-       u_int8_t invert;
+       __u8 tos_mask;
+       __u8 tos_value;
+       __u8 invert;
 };
 
 #endif /* _XT_DSCP_H */
index 9380fb1c27da95099053895b6cee71a61643ea4d..ef6fa4747d0a0c75e41714d80f108b96e36467bd 100644 (file)
@@ -1,10 +1,12 @@
 #ifndef _XT_ESP_H
 #define _XT_ESP_H
 
+#include <linux/types.h>
+
 struct xt_esp
 {
-       u_int32_t spis[2];      /* Security Parameter Index */
-       u_int8_t  invflags;     /* Inverse flags */
+       __u32 spis[2];  /* Security Parameter Index */
+       __u8  invflags; /* Inverse flags */
 };
 
 /* Values for "invflags" field in struct xt_esp. */
index 51b18d83b4778ebc1d69eb71513e5be1faee9809..b1925b5925e959af7482f124e360ce79dfcf51bd 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_HASHLIMIT_H
 #define _XT_HASHLIMIT_H
 
+#include <linux/types.h>
+
 /* timings are in milliseconds. */
 #define XT_HASHLIMIT_SCALE 10000
 /* 1/10,000 sec period => max of 10,000/sec.  Min rate is then 429490
@@ -18,15 +20,15 @@ enum {
 };
 
 struct hashlimit_cfg {
-       u_int32_t mode;   /* bitmask of XT_HASHLIMIT_HASH_* */
-       u_int32_t avg;    /* Average secs between packets * scale */
-       u_int32_t burst;  /* Period multiplier for upper limit. */
+       __u32 mode;       /* bitmask of XT_HASHLIMIT_HASH_* */
+       __u32 avg;    /* Average secs between packets * scale */
+       __u32 burst;  /* Period multiplier for upper limit. */
 
        /* user specified */
-       u_int32_t size;         /* how many buckets */
-       u_int32_t max;          /* max number of entries */
-       u_int32_t gc_interval;  /* gc interval */
-       u_int32_t expire;       /* when do entries expire? */
+       __u32 size;             /* how many buckets */
+       __u32 max;              /* max number of entries */
+       __u32 gc_interval;      /* gc interval */
+       __u32 expire;   /* when do entries expire? */
 };
 
 struct xt_hashlimit_info {
@@ -42,17 +44,17 @@ struct xt_hashlimit_info {
 };
 
 struct hashlimit_cfg1 {
-       u_int32_t mode;   /* bitmask of XT_HASHLIMIT_HASH_* */
-       u_int32_t avg;    /* Average secs between packets * scale */
-       u_int32_t burst;  /* Period multiplier for upper limit. */
+       __u32 mode;       /* bitmask of XT_HASHLIMIT_HASH_* */
+       __u32 avg;    /* Average secs between packets * scale */
+       __u32 burst;  /* Period multiplier for upper limit. */
 
        /* user specified */
-       u_int32_t size;         /* how many buckets */
-       u_int32_t max;          /* max number of entries */
-       u_int32_t gc_interval;  /* gc interval */
-       u_int32_t expire;       /* when do entries expire? */
+       __u32 size;             /* how many buckets */
+       __u32 max;              /* max number of entries */
+       __u32 gc_interval;      /* gc interval */
+       __u32 expire;   /* when do entries expire? */
 
-       u_int8_t srcmask, dstmask;
+       __u8 srcmask, dstmask;
 };
 
 struct xt_hashlimit_mtinfo1 {
index a4299c7d3680e305176ce699adc400d0cb343bed..c1f21a779a45c48797f469b6f6ac3aa6a3078c78 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_NETFILTER_XT_IPRANGE_H
 #define _LINUX_NETFILTER_XT_IPRANGE_H 1
 
+#include <linux/types.h>
+
 enum {
        IPRANGE_SRC     = 1 << 0,       /* match source IP address */
        IPRANGE_DST     = 1 << 1,       /* match destination IP address */
@@ -11,7 +13,7 @@ enum {
 struct xt_iprange_mtinfo {
        union nf_inet_addr src_min, src_max;
        union nf_inet_addr dst_min, dst_max;
-       u_int8_t flags;
+       __u8 flags;
 };
 
 #endif /* _LINUX_NETFILTER_XT_IPRANGE_H */
index 7c2b439f73fec2def37c48b2bb6dedd62364a984..b82ed7c4b1e0db1a9907ba6c69c6f84439dd4255 100644 (file)
@@ -1,9 +1,11 @@
 #ifndef _XT_LENGTH_H
 #define _XT_LENGTH_H
 
+#include <linux/types.h>
+
 struct xt_length_info {
-    u_int16_t  min, max;
-    u_int8_t   invert;
+    __u16      min, max;
+    __u8       invert;
 };
 
 #endif /*_XT_LENGTH_H*/
index b3ce65375ecb746ed6681130fc57d90810695d47..190e98b1f7c91689c5968c06f5db7076c9586e47 100644 (file)
@@ -1,19 +1,21 @@
 #ifndef _XT_RATE_H
 #define _XT_RATE_H
 
+#include <linux/types.h>
+
 /* timings are in milliseconds. */
 #define XT_LIMIT_SCALE 10000
 
 /* 1/10,000 sec period => max of 10,000/sec.  Min rate is then 429490
    seconds, or one every 59 hours. */
 struct xt_rateinfo {
-       u_int32_t avg;    /* Average secs between packets * scale */
-       u_int32_t burst;  /* Period multiplier for upper limit. */
+       __u32 avg;    /* Average secs between packets * scale */
+       __u32 burst;  /* Period multiplier for upper limit. */
 
        /* Used internally by the kernel */
        unsigned long prev;
-       u_int32_t credit;
-       u_int32_t credit_cap, cost;
+       __u32 credit;
+       __u32 credit_cap, cost;
 
        /* Ugly, ugly fucker. */
        struct xt_rateinfo *master;
index fae74bc3f34e753b342391f4dd58e664a932c268..6fa460a3cc29d8d81d2dc46d8c6336a2444545f3 100644 (file)
@@ -1,14 +1,16 @@
 #ifndef _XT_MARK_H
 #define _XT_MARK_H
 
+#include <linux/types.h>
+
 struct xt_mark_info {
     unsigned long mark, mask;
-    u_int8_t invert;
+    __u8 invert;
 };
 
 struct xt_mark_mtinfo1 {
-       u_int32_t mark, mask;
-       u_int8_t invert;
+       __u32 mark, mask;
+       __u8 invert;
 };
 
 #endif /*_XT_MARK_H*/
index d49ee41837101ce431fdd8593ec4a09380e16743..185db499fcbc73ceddd6a4d96e61481d068f43b6 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_MULTIPORT_H
 #define _XT_MULTIPORT_H
 
+#include <linux/types.h>
+
 enum xt_multiport_flags
 {
        XT_MULTIPORT_SOURCE,
@@ -13,18 +15,18 @@ enum xt_multiport_flags
 /* Must fit inside union xt_matchinfo: 16 bytes */
 struct xt_multiport
 {
-       u_int8_t flags;                         /* Type of comparison */
-       u_int8_t count;                         /* Number of ports */
-       u_int16_t ports[XT_MULTI_PORTS];        /* Ports */
+       __u8 flags;                             /* Type of comparison */
+       __u8 count;                             /* Number of ports */
+       __u16 ports[XT_MULTI_PORTS];    /* Ports */
 };
 
 struct xt_multiport_v1
 {
-       u_int8_t flags;                         /* Type of comparison */
-       u_int8_t count;                         /* Number of ports */
-       u_int16_t ports[XT_MULTI_PORTS];        /* Ports */
-       u_int8_t pflags[XT_MULTI_PORTS];        /* Port flags */
-       u_int8_t invert;                        /* Invert flag */
+       __u8 flags;                             /* Type of comparison */
+       __u8 count;                             /* Number of ports */
+       __u16 ports[XT_MULTI_PORTS];    /* Ports */
+       __u8 pflags[XT_MULTI_PORTS];    /* Port flags */
+       __u8 invert;                    /* Invert flag */
 };
 
 #endif /*_XT_MULTIPORT_H*/
index c84e52cfe415f55ee22563d464cf6b7311bb4df2..2081761714b56cba415b413f7801ef113230407a 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_OWNER_MATCH_H
 #define _XT_OWNER_MATCH_H
 
+#include <linux/types.h>
+
 enum {
        XT_OWNER_UID    = 1 << 0,
        XT_OWNER_GID    = 1 << 1,
@@ -8,9 +10,9 @@ enum {
 };
 
 struct xt_owner_match_info {
-       u_int32_t uid_min, uid_max;
-       u_int32_t gid_min, gid_max;
-       u_int8_t match, invert;
+       __u32 uid_min, uid_max;
+       __u32 gid_min, gid_max;
+       __u8 match, invert;
 };
 
 #endif /* _XT_OWNER_MATCH_H */
index 25a7a1815b5b7fe95e10430366e5eae371f470ce..8555e399886d09259fe8d8daa1e688a063983499 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_PHYSDEV_H
 #define _XT_PHYSDEV_H
 
+#include <linux/types.h>
+
 #ifdef __KERNEL__
 #include <linux/if.h>
 #endif
@@ -17,8 +19,8 @@ struct xt_physdev_info {
        char in_mask[IFNAMSIZ];
        char physoutdev[IFNAMSIZ];
        char out_mask[IFNAMSIZ];
-       u_int8_t invert;
-       u_int8_t bitmask;
+       __u8 invert;
+       __u8 bitmask;
 };
 
 #endif /*_XT_PHYSDEV_H*/
index 053d8cc6546401988b13d8fb613d818a7a913deb..7bb64e7c853d3f7cfbf5511d8de78cf39e5758aa 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_POLICY_H
 #define _XT_POLICY_H
 
+#include <linux/types.h>
+
 #define XT_POLICY_MAX_ELEM     4
 
 enum xt_policy_flags
@@ -19,7 +21,7 @@ enum xt_policy_modes
 
 struct xt_policy_spec
 {
-       u_int8_t        saddr:1,
+       __u8    saddr:1,
                        daddr:1,
                        proto:1,
                        mode:1,
@@ -55,9 +57,9 @@ struct xt_policy_elem
 #endif
        };
        __be32                  spi;
-       u_int32_t               reqid;
-       u_int8_t                proto;
-       u_int8_t                mode;
+       __u32           reqid;
+       __u8            proto;
+       __u8            mode;
 
        struct xt_policy_spec   match;
        struct xt_policy_spec   invert;
@@ -66,8 +68,8 @@ struct xt_policy_elem
 struct xt_policy_info
 {
        struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
-       u_int16_t flags;
-       u_int16_t len;
+       __u16 flags;
+       __u16 len;
 };
 
 #endif /* _XT_POLICY_H */
index 2010cb74250ff16baf51d0bfc06b8262cd6e7005..d40a6196842ab3496aa74388d6dfae0b876b920f 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_RATEEST_MATCH_H
 #define _XT_RATEEST_MATCH_H
 
+#include <linux/types.h>
+
 enum xt_rateest_match_flags {
        XT_RATEEST_MATCH_INVERT = 1<<0,
        XT_RATEEST_MATCH_ABS    = 1<<1,
@@ -20,12 +22,12 @@ enum xt_rateest_match_mode {
 struct xt_rateest_match_info {
        char                    name1[IFNAMSIZ];
        char                    name2[IFNAMSIZ];
-       u_int16_t               flags;
-       u_int16_t               mode;
-       u_int32_t               bps1;
-       u_int32_t               pps1;
-       u_int32_t               bps2;
-       u_int32_t               pps2;
+       __u16           flags;
+       __u16           mode;
+       __u32           bps1;
+       __u32           pps1;
+       __u32           bps2;
+       __u32           pps2;
 
        /* Used internally by the kernel */
        struct xt_rateest       *est1 __attribute__((aligned(8)));
index 220e87245716e7d472f630836de7da9de669104a..d4a82ee56a0297979f380a1da7990331686d66fc 100644 (file)
@@ -1,10 +1,12 @@
 #ifndef _XT_REALM_H
 #define _XT_REALM_H
 
+#include <linux/types.h>
+
 struct xt_realm_info {
-       u_int32_t id;
-       u_int32_t mask;
-       u_int8_t invert;
+       __u32 id;
+       __u32 mask;
+       __u8 invert;
 };
 
 #endif /* _XT_REALM_H */
index 5cfeb81c6794d7d4727e6994c569e44fbb3cc553..d2c276609925c59a2dad78213094c1c984ff9ed5 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_NETFILTER_XT_RECENT_H
 #define _LINUX_NETFILTER_XT_RECENT_H 1
 
+#include <linux/types.h>
+
 enum {
        XT_RECENT_CHECK    = 1 << 0,
        XT_RECENT_SET      = 1 << 1,
@@ -15,12 +17,12 @@ enum {
 };
 
 struct xt_recent_mtinfo {
-       u_int32_t seconds;
-       u_int32_t hit_count;
-       u_int8_t check_set;
-       u_int8_t invert;
+       __u32 seconds;
+       __u32 hit_count;
+       __u8 check_set;
+       __u8 invert;
        char name[XT_RECENT_NAME_LEN];
-       u_int8_t side;
+       __u8 side;
 };
 
 #endif /* _LINUX_NETFILTER_XT_RECENT_H */
index 32000ba6ecefced0ffa599db81a32622a2f98ab1..29287be696a2673a6edea49c71c1774e4f12970c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_SCTP_H_
 #define _XT_SCTP_H_
 
+#include <linux/types.h>
+
 #define XT_SCTP_SRC_PORTS              0x01
 #define XT_SCTP_DEST_PORTS             0x02
 #define XT_SCTP_CHUNK_TYPES            0x04
 #define XT_SCTP_VALID_FLAGS            0x07
 
 struct xt_sctp_flag_info {
-       u_int8_t chunktype;
-       u_int8_t flag;
-       u_int8_t flag_mask;
+       __u8 chunktype;
+       __u8 flag;
+       __u8 flag_mask;
 };
 
 #define XT_NUM_SCTP_FLAGS      4
 
 struct xt_sctp_info {
-       u_int16_t dpts[2];  /* Min, Max */
-       u_int16_t spts[2];  /* Min, Max */
+       __u16 dpts[2];  /* Min, Max */
+       __u16 spts[2];  /* Min, Max */
 
-       u_int32_t chunkmap[256 / sizeof (u_int32_t)];  /* Bit mask of chunks to be matched according to RFC 2960 */
+       __u32 chunkmap[256 / sizeof (__u32)];  /* Bit mask of chunks to be matched according to RFC 2960 */
 
 #define SCTP_CHUNK_MATCH_ANY   0x01  /* Match if any of the chunk types are present */
 #define SCTP_CHUNK_MATCH_ALL   0x02  /* Match if all of the chunk types are present */
 #define SCTP_CHUNK_MATCH_ONLY  0x04  /* Match if these are the only chunk types present */
 
-       u_int32_t chunk_match_type;
+       __u32 chunk_match_type;
        struct xt_sctp_flag_info flag_info[XT_NUM_SCTP_FLAGS];
        int flag_count;
 
-       u_int32_t flags;
-       u_int32_t invflags;
+       __u32 flags;
+       __u32 invflags;
 };
 
 #define bytes(type) (sizeof(type) * 8)
 
 #define SCTP_CHUNKMAP_SET(chunkmap, type)              \
        do {                                            \
-               (chunkmap)[type / bytes(u_int32_t)] |=  \
-                       1 << (type % bytes(u_int32_t)); \
+               (chunkmap)[type / bytes(__u32)] |=      \
+                       1 << (type % bytes(__u32));     \
        } while (0)
 
 #define SCTP_CHUNKMAP_CLEAR(chunkmap, type)                    \
        do {                                                    \
-               (chunkmap)[type / bytes(u_int32_t)] &=          \
-                       ~(1 << (type % bytes(u_int32_t)));      \
+               (chunkmap)[type / bytes(__u32)] &=              \
+                       ~(1 << (type % bytes(__u32)));  \
        } while (0)
 
 #define SCTP_CHUNKMAP_IS_SET(chunkmap, type)                   \
 ({                                                             \
-       ((chunkmap)[type / bytes (u_int32_t)] &                 \
-               (1 << (type % bytes (u_int32_t)))) ? 1: 0;      \
+       ((chunkmap)[type / bytes (__u32)] &             \
+               (1 << (type % bytes (__u32)))) ? 1: 0;  \
 })
 
 #define SCTP_CHUNKMAP_RESET(chunkmap) \
@@ -65,7 +67,7 @@ struct xt_sctp_info {
 #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
        __sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap))
 static inline bool
-__sctp_chunkmap_is_clear(const u_int32_t *chunkmap, unsigned int n)
+__sctp_chunkmap_is_clear(const __u32 *chunkmap, unsigned int n)
 {
        unsigned int i;
        for (i = 0; i < n; ++i)
@@ -77,7 +79,7 @@ __sctp_chunkmap_is_clear(const u_int32_t *chunkmap, unsigned int n)
 #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
        __sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap))
 static inline bool
-__sctp_chunkmap_is_all_set(const u_int32_t *chunkmap, unsigned int n)
+__sctp_chunkmap_is_all_set(const __u32 *chunkmap, unsigned int n)
 {
        unsigned int i;
        for (i = 0; i < n; ++i)
index 3d38bc975048285348b9cc5bc1d705232b14bc0d..095f3c66f456548e3940405b0e7181a8eb70772a 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_STATISTIC_H
 #define _XT_STATISTIC_H
 
+#include <linux/types.h>
+
 enum xt_statistic_mode {
        XT_STATISTIC_MODE_RANDOM,
        XT_STATISTIC_MODE_NTH,
@@ -14,17 +16,17 @@ enum xt_statistic_flags {
 #define XT_STATISTIC_MASK              0x1
 
 struct xt_statistic_info {
-       u_int16_t                       mode;
-       u_int16_t                       flags;
+       __u16                   mode;
+       __u16                   flags;
        union {
                struct {
-                       u_int32_t       probability;
+                       __u32   probability;
                } random;
                struct {
-                       u_int32_t       every;
-                       u_int32_t       packet;
+                       __u32   every;
+                       __u32   packet;
                        /* Used internally by the kernel */
-                       u_int32_t       count;
+                       __u32   count;
                } nth;
        } u;
        struct xt_statistic_info        *master __attribute__((aligned(8)));
index 8a6ba7bbef9f18ff1c496f40b85a0cfff0ed0a16..ecbb95fc89ed274d70b756583293ef5a81bb2891 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _XT_STRING_H
 #define _XT_STRING_H
 
+#include <linux/types.h>
+
 #define XT_STRING_MAX_PATTERN_SIZE 128
 #define XT_STRING_MAX_ALGO_NAME_SIZE 16
 
@@ -11,18 +13,18 @@ enum {
 
 struct xt_string_info
 {
-       u_int16_t from_offset;
-       u_int16_t to_offset;
+       __u16 from_offset;
+       __u16 to_offset;
        char      algo[XT_STRING_MAX_ALGO_NAME_SIZE];
        char      pattern[XT_STRING_MAX_PATTERN_SIZE];
-       u_int8_t  patlen;
+       __u8  patlen;
        union {
                struct {
-                       u_int8_t  invert;
+                       __u8  invert;
                } v0;
 
                struct {
-                       u_int8_t  flags;
+                       __u8  flags;
                } v1;
        } u;
 
index e03274c4c79046f7e60741f671a9a845de214f92..fbac56b9e667ec7784d2c3545ba01122fb28a8d4 100644 (file)
@@ -1,9 +1,11 @@
 #ifndef _XT_TCPMSS_MATCH_H
 #define _XT_TCPMSS_MATCH_H
 
+#include <linux/types.h>
+
 struct xt_tcpmss_match_info {
-    u_int16_t mss_min, mss_max;
-    u_int8_t invert;
+    __u16 mss_min, mss_max;
+    __u8 invert;
 };
 
 #endif /*_XT_TCPMSS_MATCH_H*/
index 78bc65f11adf1b83e6ae179b5aebde9eb2df98c3..a490a0bc1d290425db8a724a5c5320fc2230ccb7 100644 (file)
@@ -1,15 +1,17 @@
 #ifndef _XT_TCPUDP_H
 #define _XT_TCPUDP_H
 
+#include <linux/types.h>
+
 /* TCP matching stuff */
 struct xt_tcp
 {
-       u_int16_t spts[2];                      /* Source port range. */
-       u_int16_t dpts[2];                      /* Destination port range. */
-       u_int8_t option;                        /* TCP Option iff non-zero*/
-       u_int8_t flg_mask;                      /* TCP flags mask byte */
-       u_int8_t flg_cmp;                       /* TCP flags compare byte */
-       u_int8_t invflags;                      /* Inverse flags */
+       __u16 spts[2];                  /* Source port range. */
+       __u16 dpts[2];                  /* Destination port range. */
+       __u8 option;                    /* TCP Option iff non-zero*/
+       __u8 flg_mask;                  /* TCP flags mask byte */
+       __u8 flg_cmp;                   /* TCP flags compare byte */
+       __u8 invflags;                  /* Inverse flags */
 };
 
 /* Values for "inv" field in struct ipt_tcp. */
@@ -22,9 +24,9 @@ struct xt_tcp
 /* UDP matching stuff */
 struct xt_udp
 {
-       u_int16_t spts[2];                      /* Source port range. */
-       u_int16_t dpts[2];                      /* Destination port range. */
-       u_int8_t invflags;                      /* Inverse flags */
+       __u16 spts[2];                  /* Source port range. */
+       __u16 dpts[2];                  /* Destination port range. */
+       __u8 invflags;                  /* Inverse flags */
 };
 
 /* Values for "invflags" field in struct ipt_udp. */