x_tables
Subsystems (5)
PATCH 1/1 x_tables
Hi Dave!
Finally, I included all the suggestions/comments for x_tables "take 5", ran the nfsim testsuite and feel confident that this is ready for prime time.
Please apply this huge one for 2.6.16,
Thanks!
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data structures and backend interfaces for the three evil clones ip_tables, ip6_tables and arp_tables. In an ideal world we would never have allowed this kind of copy+paste programming... but well, our world isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables are now implemented as xt_FOOBAR.c files and provide module aliases to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/, include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code, gradually getting rid of all the layer 3 specific assumptions.
---
include/linux/netfilter/nf_conntrack_common.h +3 -0
@@ -154,6 +154,9 @@ struct ip_conntrack_statunsigned int expect_delete; }; +/* call to create an explicit dependency on nf_conntrack. */ +extern void need_conntrack (void ); +#endif /* __KERNEL__ */ #endif /* _NF_CONNTRACK_COMMON_H */
include/linux/netfilter/x_tables.h new file +224 -0
224 lines not on this page · raw message
include/linux/netfilter/xt_CLASSIFY.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef _XT_CLASSIFY_H +#define _XT_CLASSIFY_H + +struct xt_classify_target_info { +u_int32_t priority; +}; + +#endif /*_XT_CLASSIFY_H */
include/linux/netfilter/xt_CONNMARK.h new file +25 -0
@@ -0,0 +1,25 @@ +#ifndef _XT_CONNMARK_H_target +#define _XT_CONNMARK_H_target + +/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com> +* by Henrik Nordstrom <[email protected]> +* +* 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. +*/ + +enum { +XT_CONNMARK_SET =0 , +XT_CONNMARK_SAVE , +XT_CONNMARK_RESTORE +}; + +struct xt_connmark_target_info { +unsigned long mark; +unsigned long mask; +u_int8_t mode; +}; + +#endif /*_XT_CONNMARK_H_target*/
include/linux/netfilter/xt_MARK.h new file +21 -0
@@ -0,0 +1,21 @@ +#ifndef _XT_MARK_H_target +#define _XT_MARK_H_target + +/* Version 0 */ +struct xt_mark_target_info { +unsigned long mark; +}; + +/* Version 1 */ +enum { +XT_MARK_SET =0 , +XT_MARK_AND , +XT_MARK_OR , +}; + +struct xt_mark_target_info_v1 { +unsigned long mark; +u_int8_t mode; +}; + +#endif /*_XT_MARK_H_target */
include/linux/netfilter/xt_NFQUEUE.h new file +16 -0
@@ -0,0 +1,16 @@ +/* iptables module for using NFQUEUE mechanism +* +* (C) 2005 Harald Welte <[email protected]> +* +* This software is distributed under GNU GPL v2, 1991 +* +*/ +#ifndef _XT_NFQ_TARGET_H +#define _XT_NFQ_TARGET_H + +/* target info */ +struct xt_NFQ_info { +u_int16_t queuenum; +}; + +#endif /* _XT_NFQ_TARGET_H */
include/linux/netfilter/xt_comment.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef _XT_COMMENT_H +#define _XT_COMMENT_H + +#define XT_MAX_COMMENT_LEN 256 + +struct xt_comment_info { +unsigned char comment[XT_MAX_COMMENT_LEN ]; +}; + +#endif /* XT_COMMENT_H */
include/linux/netfilter/xt_connbytes.h new file +25 -0
@@ -0,0 +1,25 @@ +#ifndef _XT_CONNBYTES_H +#define _XT_CONNBYTES_H + +enum xt_connbytes_what { +XT_CONNBYTES_PKTS , +XT_CONNBYTES_BYTES , +XT_CONNBYTES_AVGPKT , +}; + +enum xt_connbytes_direction { +XT_CONNBYTES_DIR_ORIGINAL , +XT_CONNBYTES_DIR_REPLY , +XT_CONNBYTES_DIR_BOTH , +}; + +struct xt_connbytes_info +{ +struct { +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 */ +}; +#endif
include/linux/netfilter/xt_connmark.h new file +18 -0
@@ -0,0 +1,18 @@ +#ifndef _XT_CONNMARK_H +#define _XT_CONNMARK_H + +/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com> +* by Henrik Nordstrom <[email protected]> +* +* 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. +*/ + +struct xt_connmark_info { +unsigned long mark, mask; +u_int8_t invert; +}; + +#endif /*_XT_CONNMARK_H*/
include/linux/netfilter/xt_conntrack.h new file +63 -0
63 lines not on this page · raw message
include/linux/netfilter/xt_dccp.h new file +23 -0
@@ -0,0 +1,23 @@ +#ifndef _XT_DCCP_H_ +#define _XT_DCCP_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 { +u_int16_t dpts[2 ];/* Min, Max */ +u_int16_t spts[2 ];/* Min, Max */ + +u_int16_t flags; +u_int16_t invflags; + +u_int16_t typemask; +u_int8_t option; +}; + +#endif /* _XT_DCCP_H_ */ +
include/linux/netfilter/xt_helper.h new file +8 -0
@@ -0,0 +1,8 @@ +#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_length.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef _XT_LENGTH_H +#define _XT_LENGTH_H + +struct xt_length_info { +u_int16_t min, max; +u_int8_t invert; +}; + +#endif /*_XT_LENGTH_H*/
include/linux/netfilter/xt_limit.h new file +21 -0
@@ -0,0 +1,21 @@ +#ifndef _XT_RATE_H +#define _XT_RATE_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. */ + +/* Used internally by the kernel */ +unsigned long prev; +u_int32_t credit; +u_int32_t credit_cap, cost; + +/* Ugly, ugly fucker. */ +struct xt_rateinfo *master; +}; +#endif /*_XT_RATE_H*/
include/linux/netfilter/xt_mac.h new file +8 -0
@@ -0,0 +1,8 @@ +#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 new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef _XT_MARK_H +#define _XT_MARK_H + +struct xt_mark_info { +unsigned long mark, mask; +u_int8_t invert; +}; + +#endif /*_XT_MARK_H*/
include/linux/netfilter/xt_physdev.h new file +24 -0
@@ -0,0 +1,24 @@ +#ifndef _XT_PHYSDEV_H +#define _XT_PHYSDEV_H + +#ifdef __KERNEL__ +#include <linux/if.h> +#endif + +#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 ]; +u_int8_t invert; +u_int8_t bitmask; +}; + +#endif /*_XT_PHYSDEV_H*/
include/linux/netfilter/xt_pkttype.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef _XT_PKTTYPE_H +#define _XT_PKTTYPE_H + +struct xt_pkttype_info { +int pkttype; +int invert; +}; +#endif /*_XT_PKTTYPE_H*/
include/linux/netfilter/xt_realm.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef _XT_REALM_H +#define _XT_REALM_H + +struct xt_realm_info { +u_int32_t id; +u_int32_t mask; +u_int8_t invert; +}; + +#endif /* _XT_REALM_H */
include/linux/netfilter/xt_sctp.h new file +107 -0
107 lines not on this page · raw message
include/linux/netfilter/xt_state.h new file +13 -0
@@ -0,0 +1,13 @@ +#ifndef _XT_STATE_H +#define _XT_STATE_H + +#define XT_STATE_BIT (ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) +#define XT_STATE_INVALID (1 << 0) + +#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1)) + +struct xt_state_info +{ +unsigned int statemask; +}; +#endif /*_XT_STATE_H*/
include/linux/netfilter/xt_string.h new file +18 -0
@@ -0,0 +1,18 @@ +#ifndef _XT_STRING_H +#define _XT_STRING_H + +#define XT_STRING_MAX_PATTERN_SIZE 128 +#define XT_STRING_MAX_ALGO_NAME_SIZE 16 + +struct xt_string_info +{ +u_int16_t from_offset; +u_int16_t to_offset; +char algo[XT_STRING_MAX_ALGO_NAME_SIZE ]; +char pattern[XT_STRING_MAX_PATTERN_SIZE ]; +u_int8_t patlen; +u_int8_t invert; +struct ts_config __attribute__((aligned (8 ))) *config; +}; + +#endif /*_XT_STRING_H*/
include/linux/netfilter/xt_tcpmss.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef _XT_TCPMSS_MATCH_H +#define _XT_TCPMSS_MATCH_H + +struct xt_tcpmss_match_info { +u_int16_t mss_min, mss_max; +u_int8_t invert; +}; + +#endif /*_XT_TCPMSS_MATCH_H*/
include/linux/netfilter/xt_tcpudp.h new file +36 -0
@@ -0,0 +1,36 @@ +#ifndef _XT_TCPUDP_H +#define _XT_TCPUDP_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 */ +}; + +/* Values for "inv" field in struct ipt_tcp. */ +#define XT_TCP_INV_SRCPT 0x01/* Invert the sense of source ports. */ +#define XT_TCP_INV_DSTPT 0x02/* Invert the sense of dest ports. */ +#define XT_TCP_INV_FLAGS 0x04/* Invert the sense of TCP flags. */ +#define XT_TCP_INV_OPTION 0x08/* Invert the sense of option test. */ +#define XT_TCP_INV_MASK 0x0F/* All possible flags. */ + +/* 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 */ +}; + +/* Values for "invflags" field in struct ipt_udp. */ +#define XT_UDP_INV_SRCPT 0x01/* Invert the sense of source ports. */ +#define XT_UDP_INV_DSTPT 0x02/* Invert the sense of dest ports. */ +#define XT_UDP_INV_MASK 0x03/* All possible flags. */ + + +#endif
include/linux/netfilter_arp/arp_tables.h +26 -99
180 lines not on this page · raw message
include/linux/netfilter_ipv4/ip_conntrack.h +0 -3
@@ -199,9 +199,6 @@ ip_conntrack_put(struct ip_conntrack *ctnf_conntrack_put (&ct->ct_general); } -/* call to create an explicit dependency on ip_conntrack. */ -extern void need_ip_conntrack (void ); -extern int invert_tuplepr (struct ip_conntrack_tuple *inverse,const struct ip_conntrack_tuple *orig);
include/linux/netfilter_ipv4/ip_tables.h +52 -175
298 lines not on this page · raw message
include/linux/netfilter_ipv4/ipt_CLASSIFY.h +2 -3
@@ -1,8 +1,7 @@#ifndef _IPT_CLASSIFY_H#define _IPT_CLASSIFY_H -struct ipt_classify_target_info { -u_int32_t priority; -}; +#include <linux/netfilter/xt_CLASSIFY.h> +#define ipt_classify_target_info xt_classify_target_info#endif /*_IPT_CLASSIFY_H */
include/linux/netfilter_ipv4/ipt_CONNMARK.h +5 -11
@@ -9,17 +9,11 @@* the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ +#include <linux/netfilter/xt_CONNMARK.h> +#define IPT_CONNMARK_SET XT_CONNMARK_SET +#define IPT_CONNMARK_SAVE XT_CONNMARK_SAVE +#define IPT_CONNMARK_RESTORE XT_CONNMARK_RESTORE -enum { -IPT_CONNMARK_SET =0 , -IPT_CONNMARK_SAVE , -IPT_CONNMARK_RESTORE -}; - -struct ipt_connmark_target_info { -unsigned long mark; -unsigned long mask; -u_int8_t mode; -}; +#define ipt_connmark_target_info xt_connmark_target_info#endif /*_IPT_CONNMARK_H_target*/
include/linux/netfilter_ipv4/ipt_MARK.h +11 -13
@@ -1,20 +1,18 @@#ifndef _IPT_MARK_H_target#define _IPT_MARK_H_target +/* Backwards compatibility for old userspace */ + +#include <linux/netfilter/xt_MARK.h> +/* Version 0 */ -struct ipt_mark_target_info { -unsigned long mark; -}; +#define ipt_mark_target_info xt_mark_target_info/* Version 1 */ -enum { -IPT_MARK_SET =0 , -IPT_MARK_AND , -IPT_MARK_OR -}; - -struct ipt_mark_target_info_v1 { -unsigned long mark; -u_int8_t mode; -}; +#define IPT_MARK_SET XT_MARK_SET +#define IPT_MARK_AND XT_MARK_AND +#define IPT_MARK_OR XT_MARK_OR + +#define ipt_mark_target_info_v1 xt_mark_target_info_v1 +#endif /*_IPT_MARK_H_target*/
include/linux/netfilter_ipv4/ipt_NFQUEUE.h +4 -4
@@ -8,9 +8,9 @@#ifndef _IPT_NFQ_TARGET_H#define _IPT_NFQ_TARGET_H -/* target info */ -struct ipt_NFQ_info { -u_int16_t queuenum; -}; +/* Backwards compatibility for old userspace */ +#include <linux/netfilter/xt_NFQUEUE.h> + +#define ipt_NFQ_info xt_NFQ_info#endif /* _IPT_DSCP_TARGET_H */
include/linux/netfilter_ipv4/ipt_comment.h +4 -4
@@ -1,10 +1,10 @@#ifndef _IPT_COMMENT_H#define _IPT_COMMENT_H -#define IPT_MAX_COMMENT_LEN 256 +#include <linux/netfilter/xt_comment.h> -struct ipt_comment_info { -unsigned char comment[IPT_MAX_COMMENT_LEN ]; -}; +#define IPT_MAX_COMMENT_LEN XT_MAX_COMMENT_LEN + +#define ipt_comment_info xt_comment_info#endif /* _IPT_COMMENT_H */
include/linux/netfilter_ipv4/ipt_connbytes.h +12 -19
@@ -1,25 +1,18 @@#ifndef _IPT_CONNBYTES_H#define _IPT_CONNBYTES_H -enum ipt_connbytes_what { -IPT_CONNBYTES_PKTS , -IPT_CONNBYTES_BYTES , -IPT_CONNBYTES_AVGPKT , -}; +#include <net/netfilter/xt_connbytes.h> +#define ipt_connbytes_what xt_connbytes_what -enum ipt_connbytes_direction { -IPT_CONNBYTES_DIR_ORIGINAL , -IPT_CONNBYTES_DIR_REPLY , -IPT_CONNBYTES_DIR_BOTH , -}; +#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PACKETS +#define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES +#define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT + +#define ipt_connbytes_direction xt_connbytes_direction +#define IPT_CONNBYTES_DIR_ORIGINAL XT_CONNBYTES_DIR_ORIGINAL +#define IPT_CONNBYTES_DIR_REPLY XT_CONNBYTES_DIR_REPLY +#define IPT_CONNBYTES_DIR_BOTH XT_CONNBYTES_DIR_BOTH + +#define ipt_connbytes_info xt_connbytes_info -struct ipt_connbytes_info -{ -struct { -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 */ -};#endif
include/linux/netfilter_ipv4/ipt_connmark.h +2 -13
@@ -1,18 +1,7 @@#ifndef _IPT_CONNMARK_H#define _IPT_CONNMARK_H -/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com> -* by Henrik Nordstrom <[email protected]> -* -* 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. -*/ - -struct ipt_connmark_info { -unsigned long mark, mask; -u_int8_t invert; -}; +#include <linux/netfilter/xt_connmark.h> +#define ipt_connmark_info xt_connmark_info#endif /*_IPT_CONNMARK_H*/
include/linux/netfilter_ipv4/ipt_conntrack.h +16 -48
72 lines not on this page · raw message
include/linux/netfilter_ipv4/ipt_dccp.h +7 -15
@@ -1,23 +1,15 @@#ifndef _IPT_DCCP_H_#define _IPT_DCCP_H_ -#define IPT_DCCP_SRC_PORTS 0x01 -#define IPT_DCCP_DEST_PORTS 0x02 -#define IPT_DCCP_TYPE 0x04 -#define IPT_DCCP_OPTION 0x08 +#include <linux/netfilter/xt_dccp.h> +#define IPT_DCCP_SRC_PORTS XT_DCCP_SRC_PORTS +#define IPT_DCCP_DEST_PORTS XT_DCCP_DEST_PORTS +#define IPT_DCCP_TYPE XT_DCCP_TYPE +#define IPT_DCCP_OPTION XT_DCCP_OPTION -#define IPT_DCCP_VALID_FLAGS 0x0f +#define IPT_DCCP_VALID_FLAGS XT_DCCP_VALID_FLAGS -struct ipt_dccp_info { -u_int16_t dpts[2 ];/* Min, Max */ -u_int16_t spts[2 ];/* Min, Max */ - -u_int16_t flags; -u_int16_t invflags; - -u_int16_t typemask; -u_int8_t option; -}; +#define ipt_dccp_info xt_dccp_info#endif /* _IPT_DCCP_H_ */
include/linux/netfilter_ipv4/ipt_helper.h +3 -4
@@ -1,8 +1,7 @@#ifndef _IPT_HELPER_H#define _IPT_HELPER_H -struct ipt_helper_info { -int invert; -char name[30 ]; -}; +#include <linux/netfilter/xt_helper.h> +#define ipt_helper_info xt_helper_info +#endif /* _IPT_HELPER_H */
include/linux/netfilter_ipv4/ipt_length.h +2 -4
@@ -1,9 +1,7 @@#ifndef _IPT_LENGTH_H#define _IPT_LENGTH_H -struct ipt_length_info { -u_int16_t min, max; -u_int8_t invert; -}; +#include <linux/netfilter/xt_length.h> +#define ipt_length_info xt_length_info#endif /*_IPT_LENGTH_H*/
include/linux/netfilter_ipv4/ipt_limit.h +3 -16
@@ -1,21 +1,8 @@#ifndef _IPT_RATE_H#define _IPT_RATE_H -/* timings are in milliseconds. */ -#define IPT_LIMIT_SCALE 10000 +#include <linux/netfilter/xt_limit.h> +#define IPT_LIMIT_SCALE XT_LIMIT_SCALE +#define ipt_rateinfo xt_rateinfo -/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 -seconds, or one every 59 hours. */ -struct ipt_rateinfo { -u_int32_t avg;/* Average secs between packets * scale */ -u_int32_t burst;/* Period multiplier for upper limit. */ - -/* Used internally by the kernel */ -unsigned long prev; -u_int32_t credit; -u_int32_t credit_cap, cost; - -/* Ugly, ugly fucker. */ -struct ipt_rateinfo *master; -};#endif /*_IPT_RATE_H*/
include/linux/netfilter_ipv4/ipt_mac.h +3 -4
@@ -1,8 +1,7 @@#ifndef _IPT_MAC_H#define _IPT_MAC_H -struct ipt_mac_info { -unsigned char srcaddr[ETH_ALEN ]; -int invert; -}; +#include <linux/netfilter/xt_mac.h> +#define ipt_mac_info xt_mac_info +#endif /*_IPT_MAC_H*/
include/linux/netfilter_ipv4/ipt_mark.h +4 -4
@@ -1,9 +1,9 @@#ifndef _IPT_MARK_H#define _IPT_MARK_H -struct ipt_mark_info { -unsigned long mark, mask; -u_int8_t invert; -}; +/* Backwards compatibility for old userspace */ +#include <linux/netfilter/xt_mark.h> + +#define ipt_mark_info xt_mark_info#endif /*_IPT_MARK_H*/
include/linux/netfilter_ipv4/ipt_physdev.h +10 -17
@@ -1,24 +1,17 @@#ifndef _IPT_PHYSDEV_H#define _IPT_PHYSDEV_H -#ifdef __KERNEL__ -#include <linux/if.h> -#endif +/* Backwards compatibility for old userspace */ -#define IPT_PHYSDEV_OP_IN 0x01 -#define IPT_PHYSDEV_OP_OUT 0x02 -#define IPT_PHYSDEV_OP_BRIDGED 0x04 -#define IPT_PHYSDEV_OP_ISIN 0x08 -#define IPT_PHYSDEV_OP_ISOUT 0x10 -#define IPT_PHYSDEV_OP_MASK (0x20 - 1) +#include <linux/netfilter/xt_physdev.h> -struct ipt_physdev_info { -char physindev[IFNAMSIZ ]; -char in_mask[IFNAMSIZ ]; -char physoutdev[IFNAMSIZ ]; -char out_mask[IFNAMSIZ ]; -u_int8_t invert; -u_int8_t bitmask; -}; +#define IPT_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN +#define IPT_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT +#define IPT_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED +#define IPT_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN +#define IPT_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT +#define IPT_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK + +#define ipt_physdev_info xt_physdev_info#endif /*_IPT_PHYSDEV_H*/
include/linux/netfilter_ipv4/ipt_pkttype.h +3 -4
@@ -1,8 +1,7 @@#ifndef _IPT_PKTTYPE_H#define _IPT_PKTTYPE_H -struct ipt_pkttype_info { -int pkttype; -int invert; -}; +#include <linux/netfilter/xt_pkttype.h> +#define ipt_pkttype_info xt_pkttype_info +#endif /*_IPT_PKTTYPE_H*/
include/linux/netfilter_ipv4/ipt_realm.h +2 -5
@@ -1,10 +1,7 @@#ifndef _IPT_REALM_H#define _IPT_REALM_H -struct ipt_realm_info { -u_int32_t id; -u_int32_t mask; -u_int8_t invert; -}; +#include <linux/netfilter/xt_realm.h> +#define ipt_realm_info xt_realm_info#endif /* _IPT_REALM_H */
include/linux/netfilter_ipv4/ipt_state.h +9 -7
@@ -1,13 +1,15 @@#ifndef _IPT_STATE_H#define _IPT_STATE_H -#define IPT_STATE_BIT (ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) -#define IPT_STATE_INVALID (1 << 0) +/* Backwards compatibility for old userspace */ -#define IPT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1)) +#include <linux/netfilter/xt_state.h> + +#define IPT_STATE_BIT XT_STATE_BIT +#define IPT_STATE_INVALID XT_STATE_INVALID + +#define IPT_STATE_UNTRACKED XT_STATE_UNTRACKED + +#define ipt_state_info xt_state_info -struct ipt_state_info -{ -unsigned int statemask; -};#endif /*_IPT_STATE_H*/
include/linux/netfilter_ipv4/ipt_string.h +4 -12
@@ -1,18 +1,10 @@#ifndef _IPT_STRING_H#define _IPT_STRING_H -#define IPT_STRING_MAX_PATTERN_SIZE 128 -#define IPT_STRING_MAX_ALGO_NAME_SIZE 16 +#include <linux/netfilter/xt_string.h> -struct ipt_string_info -{ -u_int16_t from_offset; -u_int16_t to_offset; -char algo[IPT_STRING_MAX_ALGO_NAME_SIZE ]; -char pattern[IPT_STRING_MAX_PATTERN_SIZE ]; -u_int8_t patlen; -u_int8_t invert; -struct ts_config __attribute__((aligned (8 ))) *config; -}; +#define IPT_STRING_MAX_PATTERN_SIZE XT_STRING_MAX_PATTERN_SIZE +#define IPT_STRING_MAX_ALGO_NAME_SIZE XT_STRING_MAX_ALGO_NAME_SIZE +#define ipt_string_info xt_string_info#endif /*_IPT_STRING_H*/
include/linux/netfilter_ipv4/ipt_tcpmss.h +2 -4
@@ -1,9 +1,7 @@#ifndef _IPT_TCPMSS_MATCH_H#define _IPT_TCPMSS_MATCH_H -struct ipt_tcpmss_match_info { -u_int16_t mss_min, mss_max; -u_int8_t invert; -}; +#include <linux/netfilter/xt_tcpmss.h> +#define ipt_tcpmss_match_info xt_tcpmss_match_info#endif /*_IPT_TCPMSS_MATCH_H*/
include/linux/netfilter_ipv6/ip6_tables.h +45 -165
277 lines not on this page · raw message
include/linux/netfilter_ipv6/ip6t_MARK.h +5 -4
@@ -1,8 +1,9 @@#ifndef _IP6T_MARK_H_target#define _IP6T_MARK_H_target -struct ip6t_mark_target_info { -unsigned long mark; -}; +/* Backwards compatibility for old userspace */ +#include <linux/netfilter/xt_MARK.h> -#endif /*_IPT_MARK_H_target*/ +#define ip6t_mark_target_info xt_mark_target_info + +#endif /*_IP6T_MARK_H_target*/
include/linux/netfilter_ipv6/ip6t_length.h +2 -4
@@ -1,10 +1,8 @@#ifndef _IP6T_LENGTH_H#define _IP6T_LENGTH_H -struct ip6t_length_info { -u_int16_t min, max; -u_int8_t invert; -}; +#include <linux/netfilter/xt_length.h> +#define ip6t_length_info xt_length_info#endif /*_IP6T_LENGTH_H*/
include/linux/netfilter_ipv6/ip6t_limit.h +4 -17
@@ -1,21 +1,8 @@#ifndef _IP6T_RATE_H#define _IP6T_RATE_H -/* timings are in milliseconds. */ -#define IP6T_LIMIT_SCALE 10000 +#include <linux/netfilter/xt_limit.h> +#define IP6T_LIMIT_SCALE XT_LIMIT_SCALE +#define ip6t_rateinfo xt_rateinfo -/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 -seconds, or one every 59 hours. */ -struct ip6t_rateinfo { -u_int32_t avg;/* Average secs between packets * scale */ -u_int32_t burst;/* Period multiplier for upper limit. */ - -/* Used internally by the kernel */ -unsigned long prev; -u_int32_t credit; -u_int32_t credit_cap, cost; - -/* Ugly, ugly fucker. */ -struct ip6t_rateinfo *master; -}; -#endif /*_IPT_RATE_H*/ +#endif /*_IP6T_RATE_H*/
include/linux/netfilter_ipv6/ip6t_mac.h +4 -5
@@ -1,8 +1,7 @@#ifndef _IP6T_MAC_H#define _IP6T_MAC_H -struct ip6t_mac_info { -unsigned char srcaddr[ETH_ALEN ]; -int invert; -}; -#endif /*_IPT_MAC_H*/ +#include <linux/netfilter/xt_mac.h> +#define ip6t_mac_info xt_mac_info + +#endif /*_IP6T_MAC_H*/
include/linux/netfilter_ipv6/ip6t_mark.h +4 -4
@@ -1,9 +1,9 @@#ifndef _IP6T_MARK_H#define _IP6T_MARK_H -struct ip6t_mark_info { -unsigned long mark, mask; -u_int8_t invert; -}; +/* Backwards compatibility for old userspace */ +#include <linux/netfilter/xt_mark.h> + +#define ip6t_mark_info xt_mark_info#endif /*_IPT_MARK_H*/
include/linux/netfilter_ipv6/ip6t_physdev.h +10 -17
@@ -1,24 +1,17 @@#ifndef _IP6T_PHYSDEV_H#define _IP6T_PHYSDEV_H -#ifdef __KERNEL__ -#include <linux/if.h> -#endif +/* Backwards compatibility for old userspace */ -#define IP6T_PHYSDEV_OP_IN 0x01 -#define IP6T_PHYSDEV_OP_OUT 0x02 -#define IP6T_PHYSDEV_OP_BRIDGED 0x04 -#define IP6T_PHYSDEV_OP_ISIN 0x08 -#define IP6T_PHYSDEV_OP_ISOUT 0x10 -#define IP6T_PHYSDEV_OP_MASK (0x20 - 1) +#include <linux/netfilter/xt_physdev.h> -struct ip6t_physdev_info { -char physindev[IFNAMSIZ ]; -char in_mask[IFNAMSIZ ]; -char physoutdev[IFNAMSIZ ]; -char out_mask[IFNAMSIZ ]; -u_int8_t invert; -u_int8_t bitmask; -}; +#define IP6T_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN +#define IP6T_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT +#define IP6T_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED +#define IP6T_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN +#define IP6T_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT +#define IP6T_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK + +#define ip6t_physdev_info xt_physdev_info#endif /*_IP6T_PHYSDEV_H*/
include/net/netfilter/ipv4/nf_conntrack_ipv4.h +0 -3
@@ -37,7 +37,4 @@ struct nf_conntrack_ipv4 {struct sk_buff *nf_ct_ipv4_ct_gather_frags (struct sk_buff *skb); -/* call to create an explicit dependency on nf_conntrack_l3proto_ipv4. */ -extern void need_ip_conntrack (void ); -#endif /*_NF_CONNTRACK_IPV4_H*/
include/net/netfilter/nf_conntrack.h +0 -3
@@ -221,9 +221,6 @@ extern void nf_ct_helper_put(struct nf_cextern struct nf_conntrack_helper *__nf_conntrack_helper_find_byname (const char *name); -/* call to create an explicit dependency on nf_conntrack. */ -extern void need_nf_conntrack (void ); -extern int nf_ct_invert_tuplepr (struct nf_conntrack_tuple *inverse,const struct nf_conntrack_tuple *orig);
net/bridge/netfilter/ebt_log.c +1 -0
@@ -15,6 +15,7 @@#include <linux/netfilter.h> #include <linux/module.h> #include <linux/ip.h> +#include <linux/in.h> #include <linux/if_arp.h> #include <linux/spinlock.h>
net/ipv4/netfilter/Kconfig +2 -248
325 lines not on this page · raw message
net/ipv4/netfilter/Makefile +0 -21
@@ -47,14 +47,8 @@ obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o # matches obj-$(CONFIG_IP_NF_MATCH_HELPER) += ipt_helper.o -obj-$(CONFIG_IP_NF_MATCH_LIMIT) += ipt_limit.o obj-$(CONFIG_IP_NF_MATCH_HASHLIMIT) += ipt_hashlimit.o -obj-$(CONFIG_IP_NF_MATCH_SCTP) += ipt_sctp.o -obj-$(CONFIG_IP_NF_MATCH_DCCP) += ipt_dccp.o -obj-$(CONFIG_IP_NF_MATCH_MARK) += ipt_mark.o -obj-$(CONFIG_IP_NF_MATCH_MAC) += ipt_mac.o obj-$(CONFIG_IP_NF_MATCH_IPRANGE) += ipt_iprange.o -obj-$(CONFIG_IP_NF_MATCH_PKTTYPE) += ipt_pkttype.o obj-$(CONFIG_IP_NF_MATCH_MULTIPORT) += ipt_multiport.o obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
@@ -62,40 +56,25 @@ obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_ obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o obj-$(CONFIG_IP_NF_MATCH_DSCP) += ipt_dscp.o obj-$(CONFIG_IP_NF_MATCH_AH_ESP) += ipt_ah.o ipt_esp.o -obj-$(CONFIG_IP_NF_MATCH_LENGTH) += ipt_length.o obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o -obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o -obj-$(CONFIG_IP_NF_MATCH_CONNMARK) += ipt_connmark.o -obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += ipt_conntrack.o -obj-$(CONFIG_IP_NF_MATCH_CONNBYTES) += ipt_connbytes.o -obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o -obj-$(CONFIG_IP_NF_MATCH_REALM) += ipt_realm.o obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o -obj-$(CONFIG_IP_NF_MATCH_PHYSDEV) += ipt_physdev.o obj-$(CONFIG_IP_NF_MATCH_POLICY) += ipt_policy.o -obj-$(CONFIG_IP_NF_MATCH_COMMENT) += ipt_comment.o -obj-$(CONFIG_IP_NF_MATCH_STRING) += ipt_string.o # targets obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o obj-$(CONFIG_IP_NF_TARGET_DSCP) += ipt_DSCP.o -obj-$(CONFIG_IP_NF_TARGET_MARK) += ipt_MARK.o obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o obj-$(CONFIG_IP_NF_TARGET_SAME) += ipt_SAME.o -obj-$(CONFIG_IP_NF_TARGET_CLASSIFY) += ipt_CLASSIFY.o obj-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += ip_nat_snmp_basic.o obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o -obj-$(CONFIG_IP_NF_TARGET_CONNMARK) += ipt_CONNMARK.o obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o obj-$(CONFIG_IP_NF_TARGET_TCPMSS) += ipt_TCPMSS.o -obj-$(CONFIG_IP_NF_TARGET_NOTRACK) += ipt_NOTRACK.o obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o -obj-$(CONFIG_IP_NF_TARGET_NFQUEUE) += ipt_NFQUEUE.o # generic ARP tables obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o
net/ipv4/netfilter/arp_tables.c +79 -365
572 lines not on this page · raw message
net/ipv4/netfilter/ip_conntrack_standalone.c +2 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ip_tables.c +95 -747
842 lines not on this page · raw message
net/ipv4/netfilter/ipt_CLASSIFY.c deleted +0 -90
90 lines not on this page · raw message
net/ipv4/netfilter/ipt_CONNMARK.c deleted +0 -122
122 lines not on this page · raw message
net/ipv4/netfilter/ipt_MARK.c deleted +0 -172
172 lines not on this page · raw message
net/ipv4/netfilter/ipt_NFQUEUE.c deleted +0 -70
70 lines not on this page · raw message
net/ipv4/netfilter/ipt_NOTRACK.c deleted +0 -76
76 lines not on this page · raw message
net/ipv4/netfilter/ipt_comment.c deleted +0 -59
59 lines not on this page · raw message
net/ipv4/netfilter/ipt_connbytes.c deleted +0 -161
161 lines not on this page · raw message
net/ipv4/netfilter/ipt_connmark.c deleted +0 -88
88 lines not on this page · raw message
net/ipv4/netfilter/ipt_conntrack.c deleted +0 -232
232 lines not on this page · raw message
net/ipv4/netfilter/ipt_dccp.c deleted +0 -176
176 lines not on this page · raw message
net/ipv4/netfilter/ipt_helper.c deleted +0 -168
168 lines not on this page · raw message
net/ipv4/netfilter/ipt_length.c deleted +0 -64
64 lines not on this page · raw message
net/ipv4/netfilter/ipt_limit.c deleted +0 -157
157 lines not on this page · raw message
net/ipv4/netfilter/ipt_mac.c deleted +0 -80
80 lines not on this page · raw message
net/ipv4/netfilter/ipt_mark.c deleted +0 -71
71 lines not on this page · raw message
net/ipv4/netfilter/ipt_physdev.c deleted +0 -135
135 lines not on this page · raw message
net/ipv4/netfilter/ipt_pkttype.c deleted +0 -70
70 lines not on this page · raw message
net/ipv4/netfilter/ipt_realm.c deleted +0 -76
76 lines not on this page · raw message
net/ipv4/netfilter/ipt_sctp.c deleted +0 -203
203 lines not on this page · raw message
net/ipv4/netfilter/ipt_state.c deleted +0 -74
74 lines not on this page · raw message
net/ipv4/netfilter/ipt_string.c deleted +0 -91
91 lines not on this page · raw message
net/ipv4/netfilter/ipt_tcpmss.c deleted +0 -127
127 lines not on this page · raw message
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +1 -6
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/Kconfig +1 -71
72 lines not on this page · raw message
net/ipv6/netfilter/ip6_tables.c +101 -727
828 lines not on this page · raw message
net/ipv6/netfilter/ip6t_MARK.c deleted +0 -81
81 lines not on this page · raw message
net/ipv6/netfilter/ip6t_NFQUEUE.c deleted +0 -70
70 lines not on this page · raw message
net/ipv6/netfilter/ip6t_length.c deleted +0 -66
66 lines not on this page · raw message
net/ipv6/netfilter/ip6t_limit.c deleted +0 -147
147 lines not on this page · raw message
net/ipv6/netfilter/ip6t_mac.c deleted +0 -81
81 lines not on this page · raw message
net/ipv6/netfilter/ip6t_mark.c deleted +0 -66
66 lines not on this page · raw message
net/ipv6/netfilter/ip6t_physdev.c deleted +0 -135
135 lines not on this page · raw message
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +1 -7
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/nf_conntrack_reasm.c +16 -29
45 lines not on this page · raw message
net/netfilter/Kconfig +258 -0
258 lines not on this page · raw message
net/netfilter/nf_conntrack_standalone.c +2 -2
Lines of this file are not shown. View the raw message.
net/netfilter/x_tables.c new file +624 -0
624 lines not on this page · raw message
net/netfilter/xt_CLASSIFY.c new file +109 -0
109 lines not on this page · raw message
net/netfilter/xt_CONNMARK.c new file +141 -0
141 lines not on this page · raw message
net/netfilter/xt_MARK.c new file +191 -0
191 lines not on this page · raw message
net/netfilter/xt_NFQUEUE.c new file +107 -0
107 lines not on this page · raw message
net/netfilter/xt_NOTRACK.c new file +92 -0
92 lines not on this page · raw message
net/netfilter/xt_comment.c new file +80 -0
80 lines not on this page · raw message
net/netfilter/xt_connbytes.c new file +180 -0
180 lines not on this page · raw message
net/netfilter/xt_connmark.c new file +109 -0
109 lines not on this page · raw message
net/netfilter/xt_conntrack.c new file +238 -0
238 lines not on this page · raw message
net/netfilter/xt_dccp.c new file +221 -0
221 lines not on this page · raw message
net/netfilter/xt_helper.c new file +188 -0
188 lines not on this page · raw message
net/netfilter/xt_length.c new file +98 -0
98 lines not on this page · raw message
net/netfilter/xt_limit.c new file +175 -0
175 lines not on this page · raw message
net/netfilter/xt_mac.c new file +100 -0
100 lines not on this page · raw message
net/netfilter/xt_mark.c new file +91 -0
91 lines not on this page · raw message
net/netfilter/xt_physdev.c new file +155 -0
155 lines not on this page · raw message
net/netfilter/xt_pkttype.c new file +82 -0
82 lines not on this page · raw message
net/netfilter/xt_realm.c new file +79 -0
79 lines not on this page · raw message
net/netfilter/xt_sctp.c new file +250 -0
250 lines not on this page · raw message
net/netfilter/xt_state.c new file +96 -0
96 lines not on this page · raw message
net/netfilter/xt_string.c new file +111 -0
111 lines not on this page · raw message
net/netfilter/xt_tcpmss.c new file +172 -0
172 lines not on this page · raw message
net/netfilter/xt_tcpudp.c new file +333 -0
333 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Part of the diff is not shown here. View the raw message.
David S. Miller
maintainerFrom: Harald Welte <[email protected]>
Date: Thu, 12 Jan 2006 21:47:34 +0100
Quoted 5 lines
Finally, I included all the suggestions/comments for
x_tables"take 5", ran the nfsim testsuite and feel confident that this is ready for prime time.Please apply this huge one for 2.6.16,
It's been in my tree since last night, I'll try to see if I can get Linus to eat this along with TIPC which are the last two major things I plan to try and merge.
Let's get into bug fix mode people...