From 7f4d0bcab32837e15ed2fcd5634f6aded6c3992b Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net" Date: Wed, 5 Sep 2007 13:47:05 +0000 Subject: Build statistic match unconditionally --- extensions/.statistic-testx | 2 -- extensions/Makefile | 2 +- include/linux/netfilter/xt_statistic.h | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) delete mode 100755 extensions/.statistic-testx create mode 100644 include/linux/netfilter/xt_statistic.h diff --git a/extensions/.statistic-testx b/extensions/.statistic-testx deleted file mode 100755 index 843cb41..0000000 --- a/extensions/.statistic-testx +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -[ -f $KERNEL_DIR/net/netfilter/xt_statistic.c -a -f $KERNEL_DIR/include/linux/netfilter/xt_statistic.h ] && echo statistic diff --git a/extensions/Makefile b/extensions/Makefile index 812f134..48e36bd 100644 --- a/extensions/Makefile +++ b/extensions/Makefile @@ -7,7 +7,7 @@ # PF_EXT_SLIB:=ah addrtype conntrack ecn icmp iprange owner policy realm tos ttl unclean DNAT ECN LOG MASQUERADE MIRROR NETMAP REDIRECT REJECT SAME SNAT TOS TTL ULOG PF6_EXT_SLIB:=eui64 hl icmp6 owner policy HL LOG -PFX_EXT_SLIB:=connbytes connmark connlimit comment dscp esp hashlimit helper length limit mac mark multiport physdev pkttype quota sctp state standard tcp tcpmss udp CLASSIFY CONNMARK DSCP MARK NFLOG NFQUEUE NOTRACK TCPMSS TRACE +PFX_EXT_SLIB:=connbytes connmark connlimit comment dscp esp hashlimit helper length limit mac mark multiport physdev pkttype quota sctp state statistic standard tcp tcpmss udp CLASSIFY CONNMARK DSCP MARK NFLOG NFQUEUE NOTRACK TCPMSS TRACE ifeq ($(DO_SELINUX), 1) PF_EXT_SE_SLIB:= diff --git a/include/linux/netfilter/xt_statistic.h b/include/linux/netfilter/xt_statistic.h new file mode 100644 index 0000000..c344e99 --- /dev/null +++ b/include/linux/netfilter/xt_statistic.h @@ -0,0 +1,32 @@ +#ifndef _XT_STATISTIC_H +#define _XT_STATISTIC_H + +enum xt_statistic_mode { + XT_STATISTIC_MODE_RANDOM, + XT_STATISTIC_MODE_NTH, + __XT_STATISTIC_MODE_MAX +}; +#define XT_STATISTIC_MODE_MAX (__XT_STATISTIC_MODE_MAX - 1) + +enum xt_statistic_flags { + XT_STATISTIC_INVERT = 0x1, +}; +#define XT_STATISTIC_MASK 0x1 + +struct xt_statistic_info { + u_int16_t mode; + u_int16_t flags; + union { + struct { + u_int32_t probability; + } random; + struct { + u_int32_t every; + u_int32_t packet; + u_int32_t count; + } nth; + } u; + struct xt_statistic_info *master __attribute__((aligned(8))); +}; + +#endif /* _XT_STATISTIC_H */ -- cgit v1.2.3