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
7e95a8db
Commit
7e95a8db
authored
Dec 21, 2015
by
Arturo Borrero Gonzalez
Browse files
Imported Upstream version 1.4.21
parents
Changes
395
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
395 of 395+
files are displayed.
Plain diff
Email patch
include/linux/netfilter/xt_conntrack.h
0 → 100644
View file @
7e95a8db
/* Header file for kernel module to match connection tracking information.
* GPL (C) 2001 Marc Boucher (marc@mbsi.ca).
*/
#ifndef _XT_CONNTRACK_H
#define _XT_CONNTRACK_H
#include <linux/types.h>
#include <linux/netfilter/nf_conntrack_tuple_common.h>
#define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
#define XT_CONNTRACK_STATE_INVALID (1 << 0)
#define XT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1))
#define XT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2))
#define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3))
/* flags, invflags: */
enum
{
XT_CONNTRACK_STATE
=
1
<<
0
,
XT_CONNTRACK_PROTO
=
1
<<
1
,
XT_CONNTRACK_ORIGSRC
=
1
<<
2
,
XT_CONNTRACK_ORIGDST
=
1
<<
3
,
XT_CONNTRACK_REPLSRC
=
1
<<
4
,
XT_CONNTRACK_REPLDST
=
1
<<
5
,
XT_CONNTRACK_STATUS
=
1
<<
6
,
XT_CONNTRACK_EXPIRES
=
1
<<
7
,
XT_CONNTRACK_ORIGSRC_PORT
=
1
<<
8
,
XT_CONNTRACK_ORIGDST_PORT
=
1
<<
9
,
XT_CONNTRACK_REPLSRC_PORT
=
1
<<
10
,
XT_CONNTRACK_REPLDST_PORT
=
1
<<
11
,
XT_CONNTRACK_DIRECTION
=
1
<<
12
,
XT_CONNTRACK_STATE_ALIAS
=
1
<<
13
,
};
struct
xt_conntrack_mtinfo1
{
union
nf_inet_addr
origsrc_addr
,
origsrc_mask
;
union
nf_inet_addr
origdst_addr
,
origdst_mask
;
union
nf_inet_addr
replsrc_addr
,
replsrc_mask
;
union
nf_inet_addr
repldst_addr
,
repldst_mask
;
__u32
expires_min
,
expires_max
;
__u16
l4proto
;
__be16
origsrc_port
,
origdst_port
;
__be16
replsrc_port
,
repldst_port
;
__u16
match_flags
,
invert_flags
;
__u8
state_mask
,
status_mask
;
};
struct
xt_conntrack_mtinfo2
{
union
nf_inet_addr
origsrc_addr
,
origsrc_mask
;
union
nf_inet_addr
origdst_addr
,
origdst_mask
;
union
nf_inet_addr
replsrc_addr
,
replsrc_mask
;
union
nf_inet_addr
repldst_addr
,
repldst_mask
;
__u32
expires_min
,
expires_max
;
__u16
l4proto
;
__be16
origsrc_port
,
origdst_port
;
__be16
replsrc_port
,
repldst_port
;
__u16
match_flags
,
invert_flags
;
__u16
state_mask
,
status_mask
;
};
struct
xt_conntrack_mtinfo3
{
union
nf_inet_addr
origsrc_addr
,
origsrc_mask
;
union
nf_inet_addr
origdst_addr
,
origdst_mask
;
union
nf_inet_addr
replsrc_addr
,
replsrc_mask
;
union
nf_inet_addr
repldst_addr
,
repldst_mask
;
__u32
expires_min
,
expires_max
;
__u16
l4proto
;
__u16
origsrc_port
,
origdst_port
;
__u16
replsrc_port
,
repldst_port
;
__u16
match_flags
,
invert_flags
;
__u16
state_mask
,
status_mask
;
__u16
origsrc_port_high
,
origdst_port_high
;
__u16
replsrc_port_high
,
repldst_port_high
;
};
#endif
/*_XT_CONNTRACK_H*/
include/linux/netfilter/xt_cpu.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_CPU_H
#define _XT_CPU_H
#include <linux/types.h>
struct
xt_cpu_info
{
__u32
cpu
;
__u32
invert
;
};
#endif
/*_XT_CPU_H*/
include/linux/netfilter/xt_dccp.h
0 → 100644
View file @
7e95a8db
#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_OPTION 0x08
#define XT_DCCP_VALID_FLAGS 0x0f
struct
xt_dccp_info
{
__u16
dpts
[
2
];
/* Min, Max */
__u16
spts
[
2
];
/* Min, Max */
__u16
flags
;
__u16
invflags
;
__u16
typemask
;
__u8
option
;
};
#endif
/* _XT_DCCP_H_ */
include/linux/netfilter/xt_devgroup.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_DEVGROUP_H
#define _XT_DEVGROUP_H
#include <linux/types.h>
enum
xt_devgroup_flags
{
XT_DEVGROUP_MATCH_SRC
=
0x1
,
XT_DEVGROUP_INVERT_SRC
=
0x2
,
XT_DEVGROUP_MATCH_DST
=
0x4
,
XT_DEVGROUP_INVERT_DST
=
0x8
,
};
struct
xt_devgroup_info
{
__u32
flags
;
__u32
src_group
;
__u32
src_mask
;
__u32
dst_group
;
__u32
dst_mask
;
};
#endif
/* _XT_DEVGROUP_H */
include/linux/netfilter/xt_dscp.h
0 → 100644
View file @
7e95a8db
/* x_tables module for matching the IPv4/IPv6 DSCP field
*
* (C) 2002 Harald Welte <laforge@gnumonks.org>
* This software is distributed under GNU GPL v2, 1991
*
* See RFC2474 for a description of the DSCP field within the IP Header.
*
* xt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp
*/
#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
{
__u8
dscp
;
__u8
invert
;
};
struct
xt_tos_match_info
{
__u8
tos_mask
;
__u8
tos_value
;
__u8
invert
;
};
#endif
/* _XT_DSCP_H */
include/linux/netfilter/xt_ecn.h
0 → 100644
View file @
7e95a8db
/* iptables module for matching the ECN header in IPv4 and TCP header
*
* (C) 2002 Harald Welte <laforge@netfilter.org>
*
* This software is distributed under GNU GPL v2, 1991
*/
#ifndef _XT_ECN_H
#define _XT_ECN_H
#include <linux/types.h>
#include <linux/netfilter/xt_dscp.h>
#define XT_ECN_IP_MASK (~XT_DSCP_MASK)
#define XT_ECN_OP_MATCH_IP 0x01
#define XT_ECN_OP_MATCH_ECE 0x10
#define XT_ECN_OP_MATCH_CWR 0x20
#define XT_ECN_OP_MATCH_MASK 0xce
/* match info */
struct
xt_ecn_info
{
__u8
operation
;
__u8
invert
;
__u8
ip_ect
;
union
{
struct
{
__u8
ect
;
}
tcp
;
}
proto
;
};
#endif
/* _XT_ECN_H */
include/linux/netfilter/xt_esp.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_ESP_H
#define _XT_ESP_H
#include <linux/types.h>
struct
xt_esp
{
__u32
spis
[
2
];
/* Security Parameter Index */
__u8
invflags
;
/* Inverse flags */
};
/* Values for "invflags" field in struct xt_esp. */
#define XT_ESP_INV_SPI 0x01
/* Invert the sense of spi. */
#define XT_ESP_INV_MASK 0x01
/* All possible flags. */
#endif
/*_XT_ESP_H*/
include/linux/netfilter/xt_hashlimit.h
0 → 100644
View file @
7e95a8db
#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
seconds, or one packet every 59 hours. */
/* packet length accounting is done in 16-byte steps */
#define XT_HASHLIMIT_BYTE_SHIFT 4
/* details of this structure hidden by the implementation */
struct
xt_hashlimit_htable
;
enum
{
XT_HASHLIMIT_HASH_DIP
=
1
<<
0
,
XT_HASHLIMIT_HASH_DPT
=
1
<<
1
,
XT_HASHLIMIT_HASH_SIP
=
1
<<
2
,
XT_HASHLIMIT_HASH_SPT
=
1
<<
3
,
XT_HASHLIMIT_INVERT
=
1
<<
4
,
XT_HASHLIMIT_BYTES
=
1
<<
5
,
};
struct
hashlimit_cfg
{
__u32
mode
;
/* bitmask of XT_HASHLIMIT_HASH_* */
__u32
avg
;
/* Average secs between packets * scale */
__u32
burst
;
/* Period multiplier for upper limit. */
/* user specified */
__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
{
char
name
[
IFNAMSIZ
];
/* name */
struct
hashlimit_cfg
cfg
;
/* Used internally by the kernel */
struct
xt_hashlimit_htable
*
hinfo
;
union
{
void
*
ptr
;
struct
xt_hashlimit_info
*
master
;
}
u
;
};
struct
hashlimit_cfg1
{
__u32
mode
;
/* bitmask of XT_HASHLIMIT_HASH_* */
__u32
avg
;
/* Average secs between packets * scale */
__u32
burst
;
/* Period multiplier for upper limit. */
/* user specified */
__u32
size
;
/* how many buckets */
__u32
max
;
/* max number of entries */
__u32
gc_interval
;
/* gc interval */
__u32
expire
;
/* when do entries expire? */
__u8
srcmask
,
dstmask
;
};
struct
xt_hashlimit_mtinfo1
{
char
name
[
IFNAMSIZ
];
struct
hashlimit_cfg1
cfg
;
/* Used internally by the kernel */
struct
xt_hashlimit_htable
*
hinfo
__attribute__
((
aligned
(
8
)));
};
#endif
/*_XT_HASHLIMIT_H*/
include/linux/netfilter/xt_helper.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_HELPER_H
#define _XT_HELPER_H
struct
xt_helper_info
{
int
invert
;
char
name
[
30
];
};
#endif
/* _XT_HELPER_H */
include/linux/netfilter/xt_iprange.h
0 → 100644
View file @
7e95a8db
#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 */
IPRANGE_SRC_INV
=
1
<<
4
,
/* negate the condition */
IPRANGE_DST_INV
=
1
<<
5
,
/* -"- */
};
struct
xt_iprange_mtinfo
{
union
nf_inet_addr
src_min
,
src_max
;
union
nf_inet_addr
dst_min
,
dst_max
;
__u8
flags
;
};
#endif
/* _LINUX_NETFILTER_XT_IPRANGE_H */
include/linux/netfilter/xt_ipvs.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_IPVS_H
#define _XT_IPVS_H
#include <linux/types.h>
enum
{
XT_IPVS_IPVS_PROPERTY
=
1
<<
0
,
/* all other options imply this one */
XT_IPVS_PROTO
=
1
<<
1
,
XT_IPVS_VADDR
=
1
<<
2
,
XT_IPVS_VPORT
=
1
<<
3
,
XT_IPVS_DIR
=
1
<<
4
,
XT_IPVS_METHOD
=
1
<<
5
,
XT_IPVS_VPORTCTL
=
1
<<
6
,
XT_IPVS_MASK
=
(
1
<<
7
)
-
1
,
XT_IPVS_ONCE_MASK
=
XT_IPVS_MASK
&
~
XT_IPVS_IPVS_PROPERTY
};
struct
xt_ipvs_mtinfo
{
union
nf_inet_addr
vaddr
,
vmask
;
__be16
vport
;
__u8
l4proto
;
__u8
fwd_method
;
__be16
vportctl
;
__u8
invert
;
__u8
bitmask
;
};
#endif
/* _XT_IPVS_H */
include/linux/netfilter/xt_length.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_LENGTH_H
#define _XT_LENGTH_H
#include <linux/types.h>
struct
xt_length_info
{
__u16
min
,
max
;
__u8
invert
;
};
#endif
/*_XT_LENGTH_H*/
include/linux/netfilter/xt_limit.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_RATE_H
#define _XT_RATE_H
#include <linux/types.h>
/* timings are in milliseconds. */
#define XT_LIMIT_SCALE 10000
struct
xt_limit_priv
;
/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
seconds, or one every 59 hours. */
struct
xt_rateinfo
{
__u32
avg
;
/* Average secs between packets * scale */
__u32
burst
;
/* Period multiplier for upper limit. */
/* Used internally by the kernel */
unsigned
long
prev
;
/* moved to xt_limit_priv */
__u32
credit
;
/* moved to xt_limit_priv */
__u32
credit_cap
,
cost
;
struct
xt_limit_priv
*
master
;
};
#endif
/*_XT_RATE_H*/
include/linux/netfilter/xt_mac.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_MAC_H
#define _XT_MAC_H
struct
xt_mac_info
{
unsigned
char
srcaddr
[
ETH_ALEN
];
int
invert
;
};
#endif
/*_XT_MAC_H*/
include/linux/netfilter/xt_mark.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_MARK_H
#define _XT_MARK_H
#include <linux/types.h>
struct
xt_mark_tginfo2
{
__u32
mark
,
mask
;
};
struct
xt_mark_mtinfo1
{
__u32
mark
,
mask
;
__u8
invert
;
};
#endif
/*_XT_MARK_H*/
include/linux/netfilter/xt_multiport.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_MULTIPORT_H
#define _XT_MULTIPORT_H
#include <linux/types.h>
enum
xt_multiport_flags
{
XT_MULTIPORT_SOURCE
,
XT_MULTIPORT_DESTINATION
,
XT_MULTIPORT_EITHER
};
#define XT_MULTI_PORTS 15
/* Must fit inside union xt_matchinfo: 16 bytes */
struct
xt_multiport
{
__u8
flags
;
/* Type of comparison */
__u8
count
;
/* Number of ports */
__u16
ports
[
XT_MULTI_PORTS
];
/* Ports */
};
struct
xt_multiport_v1
{
__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*/
include/linux/netfilter/xt_nfacct.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_NFACCT_MATCH_H
#define _XT_NFACCT_MATCH_H
#include <linux/types.h>
#ifndef NFACCT_NAME_MAX
#define NFACCT_NAME_MAX 32
#endif
struct
nf_acct
;
struct
xt_nfacct_match_info
{
char
name
[
NFACCT_NAME_MAX
];
struct
nf_acct
*
nfacct
;
};
#endif
/* _XT_NFACCT_MATCH_H */
include/linux/netfilter/xt_osf.h
0 → 100644
View file @
7e95a8db
/*
* Copyright (c) 2003+ Evgeniy Polyakov <johnpol@2ka.mxt.ru>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _XT_OSF_H
#define _XT_OSF_H
#include <linux/types.h>
#define MAXGENRELEN 32
#define XT_OSF_GENRE (1<<0)
#define XT_OSF_TTL (1<<1)
#define XT_OSF_LOG (1<<2)
#define XT_OSF_INVERT (1<<3)
#define XT_OSF_LOGLEVEL_ALL 0
/* log all matched fingerprints */
#define XT_OSF_LOGLEVEL_FIRST 1
/* log only the first matced fingerprint */
#define XT_OSF_LOGLEVEL_ALL_KNOWN 2
/* do not log unknown packets */
#define XT_OSF_TTL_TRUE 0
/* True ip and fingerprint TTL comparison */
#define XT_OSF_TTL_LESS 1
/* Check if ip TTL is less than fingerprint one */
#define XT_OSF_TTL_NOCHECK 2
/* Do not compare ip and fingerprint TTL at all */
struct
xt_osf_info
{
char
genre
[
MAXGENRELEN
];
__u32
len
;
__u32
flags
;
__u32
loglevel
;
__u32
ttl
;
};
/*
* Wildcard MSS (kind of).
* It is used to implement a state machine for the different wildcard values
* of the MSS and window sizes.
*/
struct
xt_osf_wc
{
__u32
wc
;
__u32
val
;
};
/*
* This struct represents IANA options
* http://www.iana.org/assignments/tcp-parameters
*/
struct
xt_osf_opt
{
__u16
kind
,
length
;
struct
xt_osf_wc
wc
;
};
struct
xt_osf_user_finger
{
struct
xt_osf_wc
wss
;
__u8
ttl
,
df
;
__u16
ss
,
mss
;
__u16
opt_num
;
char
genre
[
MAXGENRELEN
];
char
version
[
MAXGENRELEN
];
char
subtype
[
MAXGENRELEN
];
/* MAX_IPOPTLEN is maximum if all options are NOPs or EOLs */
struct
xt_osf_opt
opt
[
MAX_IPOPTLEN
];
};
struct
xt_osf_nlmsg
{
struct
xt_osf_user_finger
f
;
struct
iphdr
ip
;
struct
tcphdr
tcp
;
};
/* Defines for IANA option kinds */
enum
iana_options
{
OSFOPT_EOL
=
0
,
/* End of options */
OSFOPT_NOP
,
/* NOP */
OSFOPT_MSS
,
/* Maximum segment size */
OSFOPT_WSO
,
/* Window scale option */
OSFOPT_SACKP
,
/* SACK permitted */
OSFOPT_SACK
,
/* SACK */
OSFOPT_ECHO
,
OSFOPT_ECHOREPLY
,
OSFOPT_TS
,
/* Timestamp option */
OSFOPT_POCP
,
/* Partial Order Connection Permitted */
OSFOPT_POSP
,
/* Partial Order Service Profile */
/* Others are not used in the current OSF */
OSFOPT_EMPTY
=
255
,
};
/*
* Initial window size option state machine: multiple of mss, mtu or
* plain numeric value. Can also be made as plain numeric value which
* is not a multiple of specified value.
*/
enum
xt_osf_window_size_options
{
OSF_WSS_PLAIN
=
0
,
OSF_WSS_MSS
,
OSF_WSS_MTU
,
OSF_WSS_MODULO
,
OSF_WSS_MAX
,
};
/*
* Add/remove fingerprint from the kernel.
*/
enum
xt_osf_msg_types
{
OSF_MSG_ADD
,
OSF_MSG_REMOVE
,
OSF_MSG_MAX
,
};
enum
xt_osf_attr_type
{
OSF_ATTR_UNSPEC
,
OSF_ATTR_FINGER
,
OSF_ATTR_MAX
,
};
#endif
/* _XT_OSF_H */
include/linux/netfilter/xt_owner.h
0 → 100644
View file @
7e95a8db
#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
,
XT_OWNER_SOCKET
=
1
<<
2
,
};
struct
xt_owner_match_info
{
__u32
uid_min
,
uid_max
;
__u32
gid_min
,
gid_max
;
__u8
match
,
invert
;
};
#endif
/* _XT_OWNER_MATCH_H */
include/linux/netfilter/xt_physdev.h
0 → 100644
View file @
7e95a8db
#ifndef _XT_PHYSDEV_H
#define _XT_PHYSDEV_H
#include <linux/types.h>
#define XT_PHYSDEV_OP_IN 0x01
#define XT_PHYSDEV_OP_OUT 0x02
#define XT_PHYSDEV_OP_BRIDGED 0x04
#define XT_PHYSDEV_OP_ISIN 0x08
#define XT_PHYSDEV_OP_ISOUT 0x10
#define XT_PHYSDEV_OP_MASK (0x20 - 1)
struct
xt_physdev_info
{
char
physindev
[
IFNAMSIZ
];
char
in_mask
[
IFNAMSIZ
];
char
physoutdev
[
IFNAMSIZ
];
char
out_mask
[
IFNAMSIZ
];
__u8
invert
;
__u8
bitmask
;
};
#endif
/*_XT_PHYSDEV_H*/
Prev
1
…
11
12
13
14
15
16
17
18
19
20
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