: Add string match
Subsystems (2)
PATCH 2/4 : Add string match
[NETFILTER]: Add string match
Signed-off-by Pablo Neira Ayuso <[email protected]>
Signed-off-by Patrick McHardy <[email protected]>
---
commit d5329f7baf82fbc6339fa9c7a167bd5728be46ea
tree d15ee1f092e13264baeb623a4303ac977df06f4b
parent 8cf07748b0be017ee9776fa5cb25b7d07e771e37
author Pablo Neira Ayuso <[email protected]> Sun, 21 Aug 2005 21:55:43 +0200 committer Patrick McHardy <[email protected]> Sun, 21 Aug 2005 21:55:43 +0200
include/linux/netfilter_ipv4/ipt_string.h | 18 ++++++ net/ipv4/netfilter/Kconfig | 12 ++++ net/ipv4/netfilter/Makefile | 1 net/ipv4/netfilter/ipt_string.c | 91 +++++++++++++++++++++++++++++ 4 files changed, 122 insertions(+), 0 deletions(-)
include/linux/netfilter_ipv4/ipt_string.h new file +18 -0
@@ -0,0 +1,18 @@ +#ifndef _IPT_STRING_H +#define _IPT_STRING_H + +#define IPT_STRING_MAX_PATTERN_SIZE 128 +#define IPT_STRING_MAX_ALGO_NAME_SIZE 16 + +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; +}; + +#endif /*_IPT_STRING_H*/
net/ipv4/netfilter/Kconfig +12 -0
@@ -410,6 +410,18 @@ config IP_NF_MATCH_HASHLIMIT destination IP' or `500pps from any given source IP' with a single IPtables rule. +config IP_NF_MATCH_STRING + tristate 'string match support' + depends on IP_NF_IPTABLES + select TEXTSEARCH + select TEXTSEARCH_KMP + select TEXTSEARCH_FSM + help + This option adds a `string' match, which allows you to look for + pattern matchings in packets. + + To compile it as a module, choose M here. If unsure, say N. + # `filter', generic and specific targets config IP_NF_FILTER tristate "Packet filtering"
net/ipv4/netfilter/Makefile +1 -0
@@ -65,6 +65,7 @@ obj-$(CONFIG_IP_NF_MATCH_REALM) += ipt_r 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
net/ipv4/netfilter/ipt_string.c new file +91 -0
91 lines not on this page · raw message