iptable比對string的Config和Function
●相對應的Kconfig
linux-4.xx/net/netfilter/Kconfig
config NETFILTER_XT_MATCH_STRING
tristate '"string" match support'
depends on NETFILTER_ADVANCED
select TEXTSEARCH
select TEXTSEARCH_KMP
select TEXTSEARCH_BM
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.
●BM(Boyer-Moore)和 KMP(Knuth-Morris-Pratt)是字串匹配的演算法
相對應的程式位置:
TEXTSEARCH → linux-4.xx/lib/textsearch.c
TEXTSEARCH_KMP → linux-4.xx/lib/ts_kmp.c
TEXTSEARCH_BM → linux-4.xx/lib/ts_bm.c
●比對url的位置
xt_string.c → textsearch_prepare(…)