x_tables, take 4
Subsystems (3)
PATCH 1/1 x_tables, take 4
Hi!
This is the fourth incarnation of the x_tables patch. It is now compiling clean, and at least those parts that I use in my systems seem to work fine.
I want to run this trough nfsim before submitting it mainline.
I dislike the 'void *' pointers we cast for match/targetinfo, but I think the advantage of code unification is bigger than some typecasts.
Also, we should think about putting all those match/checkentry/target parameters into a structure (which could contain unions to avoid the typeasting). But I think this can happen in a next patch, x_tables changes are already large enough.
Please review and comment,
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
include/linux/netfilter/x_tables.h new file +218 -0
@@ -0,0 +1,218 @@ +#ifndef _X_TABLES_H +#define _X_TABLES_H + +#define XT_FUNCTION_MAXNAMELEN 30 +#define XT_TABLE_MAXNAMELEN 32 + +/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision +* kernel supports, if >= revision. */ +struct xt_get_revision +{ +char name[XT_FUNCTION_MAXNAMELEN -1 ]; + +u_int8_t revision; +}; + +/* CONTINUE verdict for targets */ +#define XT_CONTINUE 0xFFFFFFFF + +/* For standard target */ +#define XT_RETURN (-NF_REPEAT - 1) + +#define XT_ALIGN (s) (((s) + (__alignof__(void *)-1)) & ~(__alignof__(void *)-1)) + +/* Standard return verdict, or do jump. */ +#define XT_STANDARD_TARGET "" +/* Error verdict. */ +#define XT_ERROR_TARGET "ERROR" + +/* +* 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. */ +#define XT_BASE_CTL 64/* base for firewall socket options */ + +#define XT_SO_SET_REPLACE (XT_BASE_CTL) +#define XT_SO_SET_ADD_COUNTERS (XT_BASE_CTL + 1) +#define XT_SO_SET_MAX XT_SO_SET_ADD_COUNTERS + +#define XT_SO_GET_INFO (XT_BASE_CTL) +#define XT_SO_GET_ENTRIES (XT_BASE_CTL + 1) +#define XT_SO_GET_REVISION_MATCH (XT_BASE_CTL + 2) +#define XT_SO_GET_REVISION_TARGET (XT_BASE_CTL + 3) +#define XT_SO_GET_MAX XT_SO_GET_REVISION_TARGET + +struct xt_counters +{ +u_int64_t pcnt, bcnt;/* Packet and byte counters */ +}; + +/* The argument to IPT_SO_ADD_COUNTERS. */ +struct xt_counters_info +{ +/* Which table. */ +char name[XT_TABLE_MAXNAMELEN ]; + +unsigned int num_counters; + +/* The counters (actually `number' of these). */ +struct xt_counters counters[0 ]; +}; + +#define XT_INV_PROTO 0x40/* Invert the sense of PROTO. */ + +#ifdef __KERNEL__ + +#include <linux/netdevice.h> + +#define ASSERT_READ_LOCK (x) +#define ASSERT_WRITE_LOCK (x) +#include <linux/netfilter_ipv4/listhelp.h> + +struct xt_match +{ +struct list_head list; + +const char name[XT_FUNCTION_MAXNAMELEN -1 ]; + +u_int8_t revision; + +/* Return true or false: return FALSE and set *hotdrop = 1 to +force immediate packet drop. */ +/* Arguments changed since 2.6.9, as this must now handle +non-linear skb, using skb_header_pointer and +skb_ip_make_writable. */ +int (*match)(const struct sk_buff *skb, +const struct net_device *in, +const struct net_device *out, +const void *matchinfo, +int offset, +unsigned int protoff, +int *hotdrop); + +/* Called when user tries to insert an entry of this type. */ +/* Should return true or false. */ +int (*checkentry)(const char *tablename, +const void *ip, +void *matchinfo, +unsigned int matchinfosize, +unsigned int hook_mask); + +/* Called when entry of this type deleted. */ +void (*destroy)(void *matchinfo,unsigned int matchinfosize); + +/* Set this to THIS_MODULE if you are a module, otherwise NULL */ +struct module *me; +}; + +/* Registration hooks for targets. */ +struct xt_target +{ +struct list_head list; + +const char name[XT_FUNCTION_MAXNAMELEN -1 ]; + +u_int8_t revision; + +/* Returns verdict. Argument order changed since 2.6.9, as this +must now handle non-linear skbs, using skb_copy_bits and +skb_ip_make_writable. */ +unsigned int (*target)(struct sk_buff **pskb, +const struct net_device *in, +const struct net_device *out, +unsigned int hooknum, +const void *targinfo, +void *userdata); + +/* Called when user tries to insert an entry of this type: +hook_mask is a bitmask of hooks from which it can be +called. */ +/* Should return true or false. */ +int (*checkentry)(const char *tablename, +const void *entry, +void *targinfo, +unsigned int targinfosize, +unsigned int hook_mask); + +/* Called when entry of this type deleted. */ +void (*destroy)(void *targinfo,unsigned int targinfosize); + +/* Set this to THIS_MODULE if you are a module, otherwise NULL */ +struct module *me; +}; + +/* Furniture shopping... */ +struct xt_table +{ +struct list_head list; + +/* A unique name... */ +char name[XT_TABLE_MAXNAMELEN ]; + +/* What hooks you will enter on */ +unsigned int valid_hooks; + +/* Lock for the curtain */ +rwlock_t lock; + +/* Man behind the curtain... */ +//struct ip6t_table_info *private; +void *private; + +/* Set this to THIS_MODULE if you are a module, otherwise NULL */ +struct module *me; + +int af;/* address/protocol family */ +}; + +#include <linux/netfilter_ipv4.h> + +/* The table itself */ +struct xt_table_info +{ +/* Size per table */ +unsigned int size; +/* Number of entries: FIXME. --RR */ +unsigned int number; +/* Initial number of entries. Needed for module usage count */ +unsigned int initial_entries; + +/* Entry points and underflows */ +unsigned int hook_entry[NF_IP_NUMHOOKS ]; +unsigned int underflow[NF_IP_NUMHOOKS ]; + +/* ipt_entry tables: one per CPU */ +char entries[0 ]____cacheline_aligned ; +}; + +extern int xt_register_target (int af,struct xt_target *target); +extern void xt_unregister_target (int af,struct xt_target *target); +extern int xt_register_match (int af,struct xt_match *target); +extern void xt_unregister_match (int af,struct xt_match *target); + +extern int xt_register_table (struct xt_table *table, +struct xt_table_info *bootstrap, +struct xt_table_info *newinfo); +extern void *xt_unregister_table (struct xt_table *table); + +extern struct xt_table_info *xt_replace_table (struct xt_table *table, +unsigned int num_counters, +struct xt_table_info *newinfo, +int *error); + +extern struct xt_match *xt_find_match (int af,const char *name,u8 revision); +extern struct xt_target *xt_find_target (int af,const char *name,u8 revision); +extern struct xt_target *xt_request_find_target (int af,const char *name, +u8 revision); +extern int xt_find_revision (int af,const char *name,u8 revision,int target, +int *err); + +extern struct xt_table *xt_find_table_lock (int af,const char *name); +extern void xt_table_unlock (struct xt_table *t); + +extern int xt_proto_init (int af); +extern void xt_proto_fini (int af); + +#endif /* __KERNEL__ */ + +#endif /* _X_TABLES_H */
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_owner.h new file +20 -0
@@ -0,0 +1,20 @@ +#ifndef _XT_OWNER_H +#define _XT_OWNER_H + +/* match and invert flags */ +#define XT_OWNER_UID 0x01 +#define XT_OWNER_GID 0x02 +#define XT_OWNER_PID 0x04 +#define XT_OWNER_SID 0x08 +#define XT_OWNER_COMM 0x10 + +struct xt_owner_info { +uid_t uid; +gid_t gid; +pid_t pid; +pid_t sid; +char comm[16 ]; +u_int8_t match, invert;/* flags */ +}; + +#endif /*_XT_OWNER_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_owner.h +9 -14
@@ -1,20 +1,15 @@#ifndef _IPT_OWNER_H#define _IPT_OWNER_H -/* match and invert flags */ -#define IPT_OWNER_UID 0x01 -#define IPT_OWNER_GID 0x02 -#define IPT_OWNER_PID 0x04 -#define IPT_OWNER_SID 0x08 -#define IPT_OWNER_COMM 0x10 +/* Backwards compatibility for old userspace */ +#include <linux/netfilter/xt_owner.h> -struct ipt_owner_info { -uid_t uid; -gid_t gid; -pid_t pid; -pid_t sid; -char comm[16 ]; -u_int8_t match, invert;/* flags */ -}; +#define IPT_OWNER_UID XT_OWNER_UID +#define IPT_OWNER_GID XT_OWNER_GID +#define IPT_OWNER_PID XT_OWNER_PID +#define IPT_OWNER_SID XT_OWNER_SID +#define IPT_OWNER_COMM XT_OWNER_COMM + +#define ipt_owner_info xt_owner_info#endif /*_IPT_OWNER_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_owner.h +7 -5
@@ -1,11 +1,13 @@ #ifndef _IP6T_OWNER_H #define _IP6T_OWNER_H -/* match and invert flags */ -#define IP6T_OWNER_UID 0x01 -#define IP6T_OWNER_GID 0x02 -#define IP6T_OWNER_PID 0x04 -#define IP6T_OWNER_SID 0x08 +/* Backwards compatibility for old userspace */ +#include <linux/netfilter/xt_owner.h> + +#define IP6T_OWNER_UID XT_OWNER_UID +#define IP6T_OWNER_GID XT_OWNER_GID +#define IP6T_OWNER_PID XT_OWNER_PID +#define IP6T_OWNER_SID XT_OWNER_SID struct ip6t_owner_info { uid_t uid;
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 +1 -1
@@ -187,7 +187,7 @@ nf_ct_get(const struct sk_buff *skb, enuextern void nf_ct_put (struct nf_conn *ct);/* call to create an explicit dependency on nf_conntrack. */ -extern void need_nf_conntrack (void ); +extern void need_conntrack (void );extern int nf_ct_invert_tuplepr (struct nf_conntrack_tuple *inverse,const struct nf_conntrack_tuple *orig);
net/ipv4/netfilter/Kconfig +90 -182
392 lines not on this page · raw message
net/ipv4/netfilter/Makefile +0 -21
@@ -46,14 +46,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
@@ -61,39 +55,24 @@ 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_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 -317
462 lines not on this page · raw message
net/ipv4/netfilter/arpt_mangle.c +4 -3
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/arptable_filter.c +1 -0
Lines of this file are not shown. View the 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_nat_rule.c +3 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ip_nat_standalone.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ip_tables.c +97 -673
770 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_CLUSTERIP.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_DSCP.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_ECN.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_LOG.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_REJECT.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_TCPMSS.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_TOS.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_TTL.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_ULOG.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_addrtype.c +2 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_ah.c +4 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_comment.c deleted +0 -59
59 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_dscp.c +2 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_ecn.c +3 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_esp.c +4 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_hashlimit.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_iprange.c +2 -2
Lines of this file are not shown. View the 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 +1 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_mac.c deleted +0 -79
79 lines not on this page · raw message
net/ipv4/netfilter/ipt_multiport.c +6 -4
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_owner.c +2 -1
Lines of this file are not shown. View the 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_recent.c +4 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_sctp.c deleted +0 -203
203 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/ipt_tos.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_ttl.c +2 -2
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/iptable_filter.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/iptable_mangle.c +1 -0
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/iptable_raw.c +2 -1
Lines of this file are not shown. View the 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 +29 -50
79 lines not on this page · raw message
net/ipv6/netfilter/Makefile +0 -6
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6_tables.c +101 -680
781 lines not on this page · raw message
net/ipv6/netfilter/ip6t_HL.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_LOG.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_REJECT.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_ah.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_dst.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_esp.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_eui64.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_frag.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_hbh.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_hl.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_ipv6header.c +1 -1
Lines of this file are not shown. View the 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 -80
80 lines not on this page · raw message
net/ipv6/netfilter/ip6t_multiport.c +2 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_owner.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6t_rt.c +1 -1
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6table_filter.c +1 -0
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6table_mangle.c +1 -0
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/ip6table_raw.c +3 -2
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +1 -7
Lines of this file are not shown. View the raw message.
net/netfilter/Kconfig +254 -0
254 lines not on this page · raw message
net/netfilter/Makefile +33 -3
Lines of this file are not shown. View the 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 +578 -0
578 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 +138 -0
138 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 +73 -0
73 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 +107 -0
107 lines not on this page · raw message
net/netfilter/xt_conntrack.c new file +254 -0
254 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 +180 -0
180 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 +99 -0
99 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_owner.c new file +115 -0
115 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
net/sched/ipt.c +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Hi
Quoted 9 lines
This is the fourth incarnation of the
x_tablespatch. It is now compiling clean, and at least those parts that I use in my systems seem to work fine.I want to run this trough nfsim before submitting it mainline.
I dislike the 'void *' pointers we cast for match/targetinfo, but I think the advantage of code unification is bigger than some typecasts.
Quoted 6 lines
Also, we should think about putting all those match/checkentry/target parameters into a structure (which could contain unions to avoid the typeasting). But I think this can happen in a next patch,
x_tableschanges are already large enough.Please review and comment,
Nice work!
But could you rename it to something without "tables"?
It is not related to tables in any way. It is about function based matches and targets, that's why the name "x_tables" is IMHO a bit irritating.
What about the name "x_functions" or something similar?
Best regards
Michael Bellion
Quoted 11 lines · Michael Bellion
Hi
Quoted 9 lines
This is the fourth incarnation of the
x_tablespatch. It is now compiling clean, and at least those parts that I use in my systems seem to work fine.I want to run this trough nfsim before submitting it mainline.
I dislike the 'void *' pointers we cast for match/targetinfo, but I think the advantage of code unification is bigger than some typecasts.
Quoted 8 lines
Quoted 6 lines
Also, we should think about putting all those match/checkentry/target parameters into a structure (which could contain unions to avoid the typeasting). But I think this can happen in a next patch,
x_tableschanges are already large enough.Please review and comment,
Nice work!
Thanks ;)
Quoted 3 lines
But could you rename it to something without "tables"?
It is not related to tables in any way. It is about function based matches and targets, that's why the name "x_tables" is IMHO a bit irritating.
Well, there are pieces of the patch that are related to 'tables' (like the xt_register_table(), etc. functions).
So as this first step, I really only wanted to unify {ip,ip6,arp}_tables. This is not yet the generalized match/target support.
As a second step, I want to cleanup the API for matches/targets, and also introduce the tlv-to-matchinfo and matchinfo-to-tlv members of xt_match / xt_target. Also, the 'verdict' that is returned by targets needs to be removed [for multiple targets], but in a way they
Maybe ew could just call them 'XTended match' and 'XTended target' at that point, this way we could keep with the xt_ prefix. What do you think?
Quoted 1 line
What about the name "
x_functions" or something similar?
Good question. If we can come up with a good (intuitive) name over the next two weeks, I can still change it.
To be honest, I don't think 'x_functions' is more intuitive. Whatever
name we will find, it won't be ideal. the 'x' was just to replace 'ip/ip6/arp'.
If we say 'nf match' and 'nf action', then we end up with nfm and nfa prefixes in structure and functio names, both of which are already used by nfnetlink (NFM_, NFA_), which could be confusing.
packet matches and packet actions would be another option, but 'packet actions' are already used by TC/iproute, if i'm not mistaken.
Comments/Suggestions?
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
On Sat, 12 Nov 2005, Harald Welte wrote:
<CUT>
Quoted 4 lines
As a second step, I want to cleanup the API for matches/targets, and also introduce the tlv-to-matchinfo and matchinfo-to-tlv members of
xt_match/xt_target. Also, the 'verdict' that is returned by targets needs to be removed [for multiple targets], but in a way they
Is it possible to add a match negation at the same time?
Best regards,
Krzysztof Olędzki