Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60c195c7 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Ingo Molnar
Browse files

make netfilter use strict integer types



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: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 1d7f83d5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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__
+2 −2
Original line number Diff line number Diff line
@@ -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 */
};

+5 −2
Original line number Diff line number Diff line
#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 */
};

+16 −16
Original line number Diff line number Diff line
@@ -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)
+12 −12
Original line number Diff line number Diff line
@@ -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)
Loading