Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Pkg Iptables
Commits
615f9fca
Commit
615f9fca
authored
Dec 21, 2015
by
Arturo Borrero Gonzalez
Browse files
Imported Upstream version 1.6.0
parent
7e95a8db
Changes
153
Hide whitespace changes
Inline
Side-by-side
include/linux/netfilter/nfnetlink.h
0 → 100644
View file @
615f9fca
#ifndef _NFNETLINK_H
#define _NFNETLINK_H
#include <linux/types.h>
#include <linux/netfilter/nfnetlink_compat.h>
enum
nfnetlink_groups
{
NFNLGRP_NONE
,
#define NFNLGRP_NONE NFNLGRP_NONE
NFNLGRP_CONNTRACK_NEW
,
#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
NFNLGRP_CONNTRACK_UPDATE
,
#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
NFNLGRP_CONNTRACK_DESTROY
,
#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
NFNLGRP_CONNTRACK_EXP_NEW
,
#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
NFNLGRP_CONNTRACK_EXP_UPDATE
,
#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
NFNLGRP_CONNTRACK_EXP_DESTROY
,
#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
NFNLGRP_NFTABLES
,
#define NFNLGRP_NFTABLES NFNLGRP_NFTABLES
__NFNLGRP_MAX
,
};
#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
/* General form of address family dependent message.
*/
struct
nfgenmsg
{
__u8
nfgen_family
;
/* AF_xxx */
__u8
version
;
/* nfnetlink version */
__be16
res_id
;
/* resource id */
};
#define NFNETLINK_V0 0
/* netfilter netlink message types are split in two pieces:
* 8 bit subsystem, 8bit operation.
*/
#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
#define NFNL_MSG_TYPE(x) (x & 0x00ff)
/* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS()
* won't work anymore */
#define NFNL_SUBSYS_NONE 0
#define NFNL_SUBSYS_CTNETLINK 1
#define NFNL_SUBSYS_CTNETLINK_EXP 2
#define NFNL_SUBSYS_QUEUE 3
#define NFNL_SUBSYS_ULOG 4
#define NFNL_SUBSYS_OSF 5
#define NFNL_SUBSYS_IPSET 6
#define NFNL_SUBSYS_ACCT 7
#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
#define NFNL_SUBSYS_CTHELPER 9
#define NFNL_SUBSYS_NFTABLES 10
#define NFNL_SUBSYS_NFT_COMPAT 11
#define NFNL_SUBSYS_COUNT 12
/* Reserved control nfnetlink messages */
#define NFNL_MSG_BATCH_BEGIN NLMSG_MIN_TYPE
#define NFNL_MSG_BATCH_END NLMSG_MIN_TYPE+1
#endif
/* _NFNETLINK_H */
include/linux/netfilter/xt_CT.h
View file @
615f9fca
...
...
@@ -6,6 +6,9 @@
enum
{
XT_CT_NOTRACK
=
1
<<
0
,
XT_CT_NOTRACK_ALIAS
=
1
<<
1
,
XT_CT_ZONE_DIR_ORIG
=
1
<<
2
,
XT_CT_ZONE_DIR_REPL
=
1
<<
3
,
XT_CT_ZONE_MARK
=
1
<<
4
,
};
struct
xt_ct_target_info
{
...
...
include/linux/netfilter/xt_cgroup.h
0 → 100644
View file @
615f9fca
#ifndef _XT_CGROUP_H
#define _XT_CGROUP_H
#include <linux/types.h>
struct
xt_cgroup_info
{
__u32
id
;
__u32
invert
;
};
#endif
/* _XT_CGROUP_H */
include/linux/netfilter/xt_ipcomp.h
0 → 100644
View file @
615f9fca
#ifndef _XT_IPCOMP_H
#define _XT_IPCOMP_H
#include <linux/types.h>
struct
xt_ipcomp
{
__u32
spis
[
2
];
/* Security Parameter Index */
__u8
invflags
;
/* Inverse flags */
__u8
hdrres
;
/* Test of the Reserved Filed */
};
/* Values for "invflags" field in struct xt_ipcomp. */
#define XT_IPCOMP_INV_SPI 0x01
/* Invert the sense of spi. */
#define XT_IPCOMP_INV_MASK 0x01
/* All possible flags. */
#endif
/*_XT_IPCOMP_H*/
include/linux/netfilter/xt_osf.h
View file @
615f9fca
...
...
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 5
9 Temple Place, Suite 330
, Boston, MA 0211
1
-130
7
USA
* Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
0211
0
-130
1,
USA
.
*/
#ifndef _XT_OSF_H
...
...
include/linux/netfilter/xt_set.h
View file @
615f9fca
...
...
@@ -65,10 +65,29 @@ struct xt_set_info_target_v2 {
/* Revision 3 match */
struct
xt_set_info_match_v3
{
struct
xt_set_info
match_set
;
struct
ip_set_counter_match0
packets
;
struct
ip_set_counter_match0
bytes
;
__u32
flags
;
};
/* Revision 4 match */
struct
xt_set_info_match_v4
{
struct
xt_set_info
match_set
;
struct
ip_set_counter_match
packets
;
struct
ip_set_counter_match
bytes
;
__u32
flags
;
};
/* Revision 3 target */
struct
xt_set_info_target_v3
{
struct
xt_set_info
add_set
;
struct
xt_set_info
del_set
;
struct
xt_set_info
map_set
;
__u32
flags
;
__u32
timeout
;
};
#endif
/*_XT_SET_H*/
include/linux/netfilter/xt_socket.h
View file @
615f9fca
...
...
@@ -6,6 +6,7 @@
enum
{
XT_SOCKET_TRANSPARENT
=
1
<<
0
,
XT_SOCKET_NOWILDCARD
=
1
<<
1
,
XT_SOCKET_RESTORESKMARK
=
1
<<
2
,
};
struct
xt_socket_mtinfo1
{
...
...
@@ -18,4 +19,11 @@ struct xt_socket_mtinfo2 {
};
#define XT_SOCKET_FLAGS_V2 (XT_SOCKET_TRANSPARENT | XT_SOCKET_NOWILDCARD)
struct
xt_socket_mtinfo3
{
__u8
flags
;
};
#define XT_SOCKET_FLAGS_V3 (XT_SOCKET_TRANSPARENT \
| XT_SOCKET_NOWILDCARD \
| XT_SOCKET_RESTORESKMARK)
#endif
/* _XT_SOCKET_H */
include/linux/netfilter_arp.h
0 → 100644
View file @
615f9fca
#ifndef __LINUX_ARP_NETFILTER_H
#define __LINUX_ARP_NETFILTER_H
/* ARP-specific defines for netfilter.
* (C)2002 Rusty Russell IBM -- This code is GPL.
*/
#include <linux/netfilter.h>
/* There is no PF_ARP. */
#define NF_ARP 0
/* ARP Hooks */
#define NF_ARP_IN 0
#define NF_ARP_OUT 1
#define NF_ARP_FORWARD 2
#define NF_ARP_NUMHOOKS 3
#endif
/* __LINUX_ARP_NETFILTER_H */
include/linux/netfilter_arp/arp_tables.h
0 → 100644
View file @
615f9fca
/*
* Format of an ARP firewall descriptor
*
* src, tgt, src_mask, tgt_mask, arpop, arpop_mask are always stored in
* network byte order.
* flags are stored in host byte order (of course).
*/
#ifndef _ARPTABLES_H
#define _ARPTABLES_H
#include <linux/types.h>
#include <linux/netfilter_arp.h>
#include <linux/netfilter/x_tables.h>
#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
#define arpt_entry_target xt_entry_target
#define arpt_standard_target xt_standard_target
#define arpt_error_target xt_error_target
#define ARPT_CONTINUE XT_CONTINUE
#define ARPT_RETURN XT_RETURN
#define arpt_counters_info xt_counters_info
#define arpt_counters xt_counters
#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
#define ARPT_ERROR_TARGET XT_ERROR_TARGET
#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
#define ARPT_DEV_ADDR_LEN_MAX 16
struct
arpt_devaddr_info
{
char
addr
[
ARPT_DEV_ADDR_LEN_MAX
];
char
mask
[
ARPT_DEV_ADDR_LEN_MAX
];
};
/* Yes, Virginia, you have to zero the padding. */
struct
arpt_arp
{
/* Source and target IP addr */
struct
in_addr
src
,
tgt
;
/* Mask for src and target IP addr */
struct
in_addr
smsk
,
tmsk
;
/* Device hw address length, src+target device addresses */
__u8
arhln
,
arhln_mask
;
struct
arpt_devaddr_info
src_devaddr
;
struct
arpt_devaddr_info
tgt_devaddr
;
/* ARP operation code. */
__be16
arpop
,
arpop_mask
;
/* ARP hardware address and protocol address format. */
__be16
arhrd
,
arhrd_mask
;
__be16
arpro
,
arpro_mask
;
/* The protocol address length is only accepted if it is 4
* so there is no use in offering a way to do filtering on it.
*/
char
iniface
[
IFNAMSIZ
],
outiface
[
IFNAMSIZ
];
unsigned
char
iniface_mask
[
IFNAMSIZ
],
outiface_mask
[
IFNAMSIZ
];
/* Flags word */
__u8
flags
;
/* Inverse flags */
__u16
invflags
;
};
/* Values for "flag" field in struct arpt_ip (general arp structure).
* No flags defined yet.
*/
#define ARPT_F_MASK 0x00
/* All possible flag bits mask. */
/* Values for "inv" field in struct arpt_arp. */
#define ARPT_INV_VIA_IN 0x0001
/* Invert the sense of IN IFACE. */
#define ARPT_INV_VIA_OUT 0x0002
/* Invert the sense of OUT IFACE */
#define ARPT_INV_SRCIP 0x0004
/* Invert the sense of SRC IP. */
#define ARPT_INV_TGTIP 0x0008
/* Invert the sense of TGT IP. */
#define ARPT_INV_SRCDEVADDR 0x0010
/* Invert the sense of SRC DEV ADDR. */
#define ARPT_INV_TGTDEVADDR 0x0020
/* Invert the sense of TGT DEV ADDR. */
#define ARPT_INV_ARPOP 0x0040
/* Invert the sense of ARP OP. */
#define ARPT_INV_ARPHRD 0x0080
/* Invert the sense of ARP HRD. */
#define ARPT_INV_ARPPRO 0x0100
/* Invert the sense of ARP PRO. */
#define ARPT_INV_ARPHLN 0x0200
/* Invert the sense of ARP HLN. */
#define ARPT_INV_MASK 0x03FF
/* All possible flag bits mask. */
/* This structure defines each of the firewall rules. Consists of 3
parts which are 1) general ARP header stuff 2) match specific
stuff 3) the target to perform if the rule matches */
struct
arpt_entry
{
struct
arpt_arp
arp
;
/* Size of arpt_entry + matches */
__u16
target_offset
;
/* Size of arpt_entry + matches + target */
__u16
next_offset
;
/* Back pointer */
unsigned
int
comefrom
;
/* Packet and byte counters. */
struct
xt_counters
counters
;
/* The matches (if any), then the target. */
unsigned
char
elems
[
0
];
};
/*
* New IP firewall options for [gs]etsockopt at the RAW IP level.
* Unlike BSD Linux inherits IP options so you don't have to use a raw
* socket for this. Instead we check rights in the calls.
*
* ATTENTION: check linux/in.h before adding new number here.
*/
#define ARPT_BASE_CTL 96
#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
/* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */
#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
/* The argument to ARPT_SO_GET_INFO */
struct
arpt_getinfo
{
/* Which table: caller fills this in. */
char
name
[
XT_TABLE_MAXNAMELEN
];
/* Kernel fills these in. */
/* Which hook entry points are valid: bitmask */
unsigned
int
valid_hooks
;
/* Hook entry points: one per netfilter hook. */
unsigned
int
hook_entry
[
NF_ARP_NUMHOOKS
];
/* Underflow points. */
unsigned
int
underflow
[
NF_ARP_NUMHOOKS
];
/* Number of entries */
unsigned
int
num_entries
;
/* Size of entries. */
unsigned
int
size
;
};
/* The argument to ARPT_SO_SET_REPLACE. */
struct
arpt_replace
{
/* Which table. */
char
name
[
XT_TABLE_MAXNAMELEN
];
/* Which hook entry points are valid: bitmask. You can't
change this. */
unsigned
int
valid_hooks
;
/* Number of entries */
unsigned
int
num_entries
;
/* Total size of new entries */
unsigned
int
size
;
/* Hook entry points. */
unsigned
int
hook_entry
[
NF_ARP_NUMHOOKS
];
/* Underflow points. */
unsigned
int
underflow
[
NF_ARP_NUMHOOKS
];
/* Information about old entries: */
/* Number of counters (must be equal to current number of entries). */
unsigned
int
num_counters
;
/* The old entries' counters. */
struct
xt_counters
*
counters
;
/* The entries (hang off end: not really an array). */
struct
arpt_entry
entries
[
0
];
};
/* The argument to ARPT_SO_GET_ENTRIES. */
struct
arpt_get_entries
{
/* Which table: user fills this in. */
char
name
[
XT_TABLE_MAXNAMELEN
];
/* User fills this in: total entry size. */
unsigned
int
size
;
/* The entries. */
struct
arpt_entry
entrytable
[
0
];
};
/* Helper functions */
static
__inline__
struct
xt_entry_target
*
arpt_get_target
(
struct
arpt_entry
*
e
)
{
return
(
void
*
)
e
+
e
->
target_offset
;
}
/*
* Main firewall chains definitions and global var's definitions.
*/
#endif
/* _ARPTABLES_H */
include/linux/netfilter_arp/arpt_mangle.h
0 → 100644
View file @
615f9fca
#ifndef _ARPT_MANGLE_H
#define _ARPT_MANGLE_H
#include <linux/netfilter_arp/arp_tables.h>
#define ARPT_MANGLE_ADDR_LEN_MAX sizeof(struct in_addr)
struct
arpt_mangle
{
char
src_devaddr
[
ARPT_DEV_ADDR_LEN_MAX
];
char
tgt_devaddr
[
ARPT_DEV_ADDR_LEN_MAX
];
union
{
struct
in_addr
src_ip
;
}
u_s
;
union
{
struct
in_addr
tgt_ip
;
}
u_t
;
u_int8_t
flags
;
int
target
;
};
#define ARPT_MANGLE_SDEV 0x01
#define ARPT_MANGLE_TDEV 0x02
#define ARPT_MANGLE_SIP 0x04
#define ARPT_MANGLE_TIP 0x08
#define ARPT_MANGLE_MASK 0x0f
#endif
/* _ARPT_MANGLE_H */
include/linux/netfilter_bridge.h
0 → 100644
View file @
615f9fca
#ifndef __LINUX_BRIDGE_NETFILTER_H
#define __LINUX_BRIDGE_NETFILTER_H
/* bridge-specific defines for netfilter.
*/
#include <limits.h>
/* Bridge Hooks */
/* After promisc drops, checksum checks. */
#define NF_BR_PRE_ROUTING 0
/* If the packet is destined for this box. */
#define NF_BR_LOCAL_IN 1
/* If the packet is destined for another interface. */
#define NF_BR_FORWARD 2
/* Packets coming from a local process. */
#define NF_BR_LOCAL_OUT 3
/* Packets about to hit the wire. */
#define NF_BR_POST_ROUTING 4
/* Not really a hook, but used for the ebtables broute table */
#define NF_BR_BROUTING 5
#define NF_BR_NUMHOOKS 6
enum
nf_br_hook_priorities
{
NF_BR_PRI_FIRST
=
INT_MIN
,
NF_BR_PRI_FILTER_BRIDGED
=
-
200
,
NF_BR_PRI_FILTER_OTHER
=
200
,
NF_BR_PRI_NAT_DST_BRIDGED
=
-
300
,
NF_BR_PRI_NAT_DST_OTHER
=
100
,
NF_BR_PRI_NAT_SRC
=
300
,
NF_BR_PRI_LAST
=
INT_MAX
,
};
#endif
include/linux/netfilter_bridge/ebt_802_3.h
0 → 100644
View file @
615f9fca
#ifndef _UAPI__LINUX_BRIDGE_EBT_802_3_H
#define _UAPI__LINUX_BRIDGE_EBT_802_3_H
#include <linux/types.h>
#include <linux/if_ether.h>
#define EBT_802_3_SAP 0x01
#define EBT_802_3_TYPE 0x02
#define EBT_802_3_MATCH "802_3"
/*
* If frame has DSAP/SSAP value 0xaa you must check the SNAP type
* to discover what kind of packet we're carrying.
*/
#define CHECK_TYPE 0xaa
/*
* Control field may be one or two bytes. If the first byte has
* the value 0x03 then the entire length is one byte, otherwise it is two.
* One byte controls are used in Unnumbered Information frames.
* Two byte controls are used in Numbered Information frames.
*/
#define IS_UI 0x03
#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
/* ui has one byte ctrl, ni has two */
struct
hdr_ui
{
__u8
dsap
;
__u8
ssap
;
__u8
ctrl
;
__u8
orig
[
3
];
__be16
type
;
};
struct
hdr_ni
{
__u8
dsap
;
__u8
ssap
;
__be16
ctrl
;
__u8
orig
[
3
];
__be16
type
;
};
struct
ebt_802_3_hdr
{
__u8
daddr
[
ETH_ALEN
];
__u8
saddr
[
ETH_ALEN
];
__be16
len
;
union
{
struct
hdr_ui
ui
;
struct
hdr_ni
ni
;
}
llc
;
};
struct
ebt_802_3_info
{
__u8
sap
;
__be16
type
;
__u8
bitmask
;
__u8
invflags
;
};
#endif
/* _UAPI__LINUX_BRIDGE_EBT_802_3_H */
include/linux/netfilter_bridge/ebt_ip.h
0 → 100644
View file @
615f9fca
/*
* ebt_ip
*
* Authors:
* Bart De Schuymer <bart.de.schuymer@pandora.be>
*
* April, 2002
*
* Changes:
* added ip-sport and ip-dport
* Innominate Security Technologies AG <mhopf@innominate.com>
* September, 2002
*/
#ifndef __LINUX_BRIDGE_EBT_IP_H
#define __LINUX_BRIDGE_EBT_IP_H
#include <linux/types.h>
#define EBT_IP_SOURCE 0x01
#define EBT_IP_DEST 0x02
#define EBT_IP_TOS 0x04
#define EBT_IP_PROTO 0x08
#define EBT_IP_SPORT 0x10
#define EBT_IP_DPORT 0x20
#define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\
EBT_IP_SPORT | EBT_IP_DPORT )
#define EBT_IP_MATCH "ip"
/* the same values are used for the invflags */
struct
ebt_ip_info
{
__be32
saddr
;
__be32
daddr
;
__be32
smsk
;
__be32
dmsk
;
__u8
tos
;
__u8
protocol
;
__u8
bitmask
;
__u8
invflags
;
__u16
sport
[
2
];
__u16
dport
[
2
];
};
#endif
include/linux/netfilter_bridge/ebt_mark_m.h
0 → 100644
View file @
615f9fca
#ifndef __LINUX_BRIDGE_EBT_MARK_M_H
#define __LINUX_BRIDGE_EBT_MARK_M_H
#include <linux/types.h>
#define EBT_MARK_AND 0x01
#define EBT_MARK_OR 0x02
#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
struct
ebt_mark_m_info
{
unsigned
long
mark
,
mask
;
__u8
invert
;
__u8
bitmask
;
};
#define EBT_MARK_MATCH "mark_m"
#endif
include/linux/netfilter_bridge/ebt_mark_t.h
0 → 100644
View file @
615f9fca
#ifndef __LINUX_BRIDGE_EBT_MARK_T_H
#define __LINUX_BRIDGE_EBT_MARK_T_H
/* The target member is reused for adding new actions, the
* value of the real target is -1 to -NUM_STANDARD_TARGETS.
* For backward compatibility, the 4 lsb (2 would be enough,
* but let's play it safe) are kept to designate this target.
* The remaining bits designate the action. By making the set
* action 0xfffffff0, the result will look ok for older
* versions. [September 2006] */
#define MARK_SET_VALUE (0xfffffff0)
#define MARK_OR_VALUE (0xffffffe0)
#define MARK_AND_VALUE (0xffffffd0)
#define MARK_XOR_VALUE (0xffffffc0)
struct
ebt_mark_t_info
{
unsigned
long
mark
;
/* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
int
target
;
};
#define EBT_MARK_TARGET "mark"
#endif
include/linux/netfilter_ipv4/ip_tables.h
View file @
615f9fca
...
...
@@ -73,12 +73,12 @@ struct ipt_ip {
unsigned
char
iniface_mask
[
IFNAMSIZ
],
outiface_mask
[
IFNAMSIZ
];
/* Protocol, 0 = ANY */
u_int16_t
proto
;
__u16
proto
;
/* Flags word */
u_int8_t
flags
;
__u8
flags
;
/* Inverse flags */
u_int8_t
invflags
;
__u8
invflags
;
};
/* Values for "flag" field in struct ipt_ip (general ip structure). */
...
...
@@ -106,9 +106,9 @@ struct ipt_entry {
unsigned
int
nfcache
;
/* Size of ipt_entry + matches */
u_int16_t
target_offset
;
__u16
target_offset
;
/* Size of ipt_entry + matches + target */
u_int16_t
next_offset
;
__u16
next_offset
;
/* Back pointer */
unsigned
int
comefrom
;
...
...
@@ -141,9 +141,9 @@ struct ipt_entry {
/* ICMP matching stuff */
struct
ipt_icmp
{
u_int8_t
type
;
/* type to match */
u_int8_t
code
[
2
];
/* range of code */
u_int8_t
invflags
;
/* Inverse flags */
__u8
type
;
/* type to match */
__u8
code
[
2
];
/* range of code */
__u8
invflags
;
/* Inverse flags */
};
/* Values for "inv" field for struct ipt_icmp. */
...
...
include/linux/netfilter_ipv4/ipt_SAME.h
deleted
100644 → 0
View file @
7e95a8db
#ifndef _IPT_SAME_H
#define _IPT_SAME_H
#include <linux/types.h>
#define IPT_SAME_MAX_RANGE 10
#define IPT_SAME_NODST 0x01
struct
ipt_same_info
{
unsigned
char
info
;
__u32
rangesize
;
__u32
ipnum
;
__u32
*
iparray
;
/* hangs off end. */
struct
nf_nat_ipv4_range
range
[
IPT_SAME_MAX_RANGE
];
};
#endif
/*_IPT_SAME_H*/
include/linux/netfilter_ipv6/ip6_tables.h
View file @
615f9fca
...
...
@@ -73,14 +73,14 @@ struct ip6t_ip6 {
* MH do not match any packets.
* - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
*/
u_int16_t
proto
;
__u16
proto
;
/* TOS to match iff flags & IP6T_F_TOS */
u_int8_t
tos
;
__u8
tos
;
/* Flags word */
u_int8_t
flags
;
__u8
flags
;
/* Inverse flags */
u_int8_t
invflags
;
__u8
invflags
;
};
/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
...
...
@@ -110,9 +110,9 @@ struct ip6t_entry {
unsigned
int
nfcache
;
/* Size of ipt_entry + matches */
u_int16_t
target_offset
;
__u16
target_offset
;
/* Size of ipt_entry + matches + target */
u_int16_t
next_offset
;
__u16
next_offset
;
/* Back pointer */
unsigned
int
comefrom
;
...
...
@@ -176,11 +176,14 @@ struct ip6t_error {
#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
/* obtain original address if REDIRECT'd connection */
#define IP6T_SO_ORIGINAL_DST 80
/* ICMP matching stuff */
struct
ip6t_icmp
{
u_int8_t
type
;
/* type to match */
u_int8_t
code
[
2
];
/* range of code */
u_int8_t
invflags
;
/* Inverse flags */
__u8
type
;
/* type to match */
__u8
code
[
2
];
/* range of code */
__u8
invflags
;
/* Inverse flags */
};
/* Values for "inv" field for struct ipt_icmp. */
...
...
include/linux/netfilter_ipv6/ip6t_REJECT.h
View file @
615f9fca
...
...
@@ -10,7 +10,9 @@ enum ip6t_reject_with {
IP6T_ICMP6_ADDR_UNREACH
,
IP6T_ICMP6_PORT_UNREACH
,
IP6T_ICMP6_ECHOREPLY
,
IP6T_TCP_RESET
IP6T_TCP_RESET
,
IP6T_ICMP6_POLICY_FAIL
,
IP6T_ICMP6_REJECT_ROUTE
};
struct
ip6t_reject_info
{
...
...
include/xtables.h
View file @
615f9fca
...
...
@@ -220,12 +220,12 @@ struct xtables_match
const
char
*
real_name
;
/* Revision of match (0 by default). */
u
_
int8_t
revision
;
uint8_t
revision
;
/* Extension flags */
u
_
int8_t
ext_flags
;
uint8_t
ext_flags
;
u
_
int16_t
family
;
uint16_t
family
;
/* Size of match data. */
size_t
size
;
...
...
@@ -297,12 +297,12 @@ struct xtables_target
const
char
*
real_name
;
/* Revision of target (0 by default). */
u
_
int8_t
revision
;
uint8_t
revision
;
/* Extension flags */
u
_
int8_t
ext_flags
;
uint8_t
ext_flags
;
u
_
int16_t
family
;
uint16_t
family
;
/* Size of target data. */
...
...
@@ -373,7 +373,7 @@ struct xtables_rule_match {
*/
struct
xtables_pprot
{
const
char
*
name
;
u
_
int8_t
num
;
uint8_t
num
;
};
enum
xtables_tryload
{
...
...
@@ -401,6 +401,7 @@ struct xtables_globals
struct
option
*
orig_opts
;
struct
option
*
opts
;
void
(
*
exit_err
)(
enum
xtables_exittype
status
,
const
char
*
msg
,
...)
__attribute__
((
noreturn
,
format
(
printf
,
2
,
3
)));
int
(
*
compat_rev
)(
const
char
*
name
,
uint8_t
rev
,
int
opt
);
};
#define XT_GETOPT_TABLEEND {.name = NULL, .has_arg = false}
...
...
@@ -432,6 +433,8 @@ extern struct xtables_match *xtables_find_match(const char *name,
enum
xtables_tryload
,
struct
xtables_rule_match
**
match
);
extern
struct
xtables_target
*
xtables_find_target
(
const
char
*
name
,
enum
xtables_tryload
);
extern
int
xtables_compatible_revision
(
const
char
*
name
,
uint8_t
revision
,
int
opt
);
extern
void
xtables_rule_matches_free
(
struct
xtables_rule_match
**
matches
);
...
...
@@ -446,12 +449,12 @@ extern bool xtables_strtoul(const char *, char **, uintmax_t *,
extern
bool
xtables_strtoui
(
const
char
*
,
char
**
,
unsigned
int
*
,
unsigned
int
,
unsigned
int
);
extern
int
xtables_service_to_port
(
const
char
*
name
,
const
char
*
proto
);
extern
u
_
int16_t
xtables_parse_port
(
const
char
*
port
,
const
char
*
proto
);
extern
uint16_t
xtables_parse_port
(
const
char
*
port
,
const
char
*
proto
);
extern
void
xtables_parse_interface
(
const
char
*
arg
,
char
*
vianame
,
unsigned
char
*
mask
);
/* this is a special 64bit data type that is 8-byte aligned */
#define aligned_u64 u
_
int64_t __attribute__((aligned(8)))
#define aligned_u64 uint64_t __attribute__((aligned(8)))
extern
struct
xtables_globals
*
xt_params
;
#define xtables_error (xt_params->exit_err)
...
...
@@ -514,7 +517,7 @@ extern void xtables_print_num(uint64_t number, unsigned int format);
#endif
extern
const
struct
xtables_pprot
xtables_chain_protos
[];
extern
u
_
int16_t
xtables_parse_protocol
(
const
char
*
s
);
extern
uint16_t
xtables_parse_protocol
(
const
char
*
s
);
/* kernel revision handling */
extern
int
kernel_version
;
...
...
Prev
1
2
3
4
5
6
7
8
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment