mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
[NETFILTER]: Add new iptables "connbytes" match
This patch ads a new "connbytes" match that utilizes the CONFIG_NF_CT_ACCT per-connection byte and packet counters. Using it you can do things like packet classification on average packet size within a connection. Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0ba2c6e8c0
commit
9d810fd2d2
4 changed files with 202 additions and 1 deletions
25
include/linux/netfilter_ipv4/ipt_connbytes.h
Normal file
25
include/linux/netfilter_ipv4/ipt_connbytes.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef _IPT_CONNBYTES_H
|
||||
#define _IPT_CONNBYTES_H
|
||||
|
||||
enum ipt_connbytes_what {
|
||||
IPT_CONNBYTES_WHAT_PKTS,
|
||||
IPT_CONNBYTES_WHAT_BYTES,
|
||||
IPT_CONNBYTES_WHAT_AVGPKT,
|
||||
};
|
||||
|
||||
enum ipt_connbytes_direction {
|
||||
IPT_CONNBYTES_DIR_ORIGINAL,
|
||||
IPT_CONNBYTES_DIR_REPLY,
|
||||
IPT_CONNBYTES_DIR_BOTH,
|
||||
};
|
||||
|
||||
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
|
||||
Loading…
Reference in a new issue