mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-25 04:01:45 +02:00
Add STATISTIC_MATCH capability
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
20c908ee72
commit
46d8adcfe9
@ -27,8 +27,8 @@
|
|||||||
# and /usr/share/shorewall[6]-lite/shorecap.
|
# and /usr/share/shorewall[6]-lite/shorecap.
|
||||||
#
|
#
|
||||||
|
|
||||||
SHOREWALL_LIBVERSION=40407
|
SHOREWALL_LIBVERSION=40500
|
||||||
SHOREWALL_CAPVERSION=40427
|
SHOREWALL_CAPVERSION=40500
|
||||||
|
|
||||||
[ -n "${g_program:=shorewall}" ]
|
[ -n "${g_program:=shorewall}" ]
|
||||||
[ -n "${VARDIR:=/var/lib/$g_program}" ]
|
[ -n "${VARDIR:=/var/lib/$g_program}" ]
|
||||||
|
@ -1923,6 +1923,7 @@ determine_capabilities() {
|
|||||||
IPTABLES_S=
|
IPTABLES_S=
|
||||||
BASIC_FILTER=
|
BASIC_FILTER=
|
||||||
CT_TARGET=
|
CT_TARGET=
|
||||||
|
STATISTIC_MATCH=
|
||||||
|
|
||||||
chain=fooX$$
|
chain=fooX$$
|
||||||
|
|
||||||
@ -2120,6 +2121,7 @@ determine_capabilities() {
|
|||||||
qt $g_tool -A $chain -j ULOG && ULOG_TARGET=Yes
|
qt $g_tool -A $chain -j ULOG && ULOG_TARGET=Yes
|
||||||
qt $g_tool -A $chain -j NFLOG && NFLOG_TARGET=Yes
|
qt $g_tool -A $chain -j NFLOG && NFLOG_TARGET=Yes
|
||||||
qt $g_tool -A $chain -j MARK --set-mark 5 && MARK_ANYWHERE=Yes
|
qt $g_tool -A $chain -j MARK --set-mark 5 && MARK_ANYWHERE=Yes
|
||||||
|
qt $g_tool -A $chain -m statistic --mode nth --every 2 --packet 1 && STATISTIC_MATCH=Yes
|
||||||
|
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
qt $g_tool -A $chain -j ACCOUNT --addr 192.168.1.0/29 --tname $chain && ACCOUNT_TARGET=Yes
|
qt $g_tool -A $chain -j ACCOUNT --addr 192.168.1.0/29 --tname $chain && ACCOUNT_TARGET=Yes
|
||||||
@ -2229,6 +2231,7 @@ report_capabilities() {
|
|||||||
report_capability "AUDIT Target" $AUDIT_TARGET
|
report_capability "AUDIT Target" $AUDIT_TARGET
|
||||||
report_capability "ipset V5" $IPSET_V5
|
report_capability "ipset V5" $IPSET_V5
|
||||||
report_capability "Condition Match" $CONDITION_MATCH
|
report_capability "Condition Match" $CONDITION_MATCH
|
||||||
|
report_capability "Statistic Match" $STATISTIC_MATCH
|
||||||
|
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
report_capability "iptables -S" $IPTABLES_S
|
report_capability "iptables -S" $IPTABLES_S
|
||||||
@ -2314,6 +2317,7 @@ report_capabilities1() {
|
|||||||
report_capability1 IPTABLES_S
|
report_capability1 IPTABLES_S
|
||||||
report_capability1 BASIC_FILTER
|
report_capability1 BASIC_FILTER
|
||||||
report_capability1 CT_TARGET
|
report_capability1 CT_TARGET
|
||||||
|
report_capability1 STATISTIC_MATCH
|
||||||
|
|
||||||
echo CAPVERSION=$SHOREWALL_CAPVERSION
|
echo CAPVERSION=$SHOREWALL_CAPVERSION
|
||||||
echo KERNELVERSION=$KERNELVERSION
|
echo KERNELVERSION=$KERNELVERSION
|
||||||
|
@ -289,6 +289,8 @@ my %capdesc = ( NAT_ENABLED => 'NAT',
|
|||||||
IPTABLES_S => 'iptables -S',
|
IPTABLES_S => 'iptables -S',
|
||||||
BASIC_FILTER => 'Basic Filter',
|
BASIC_FILTER => 'Basic Filter',
|
||||||
CT_TARGET => 'CT Target',
|
CT_TARGET => 'CT Target',
|
||||||
|
STATISTICS_MATCH =>
|
||||||
|
'Statistics Match',
|
||||||
CAPVERSION => 'Capability Version',
|
CAPVERSION => 'Capability Version',
|
||||||
KERNELVERSION => 'Kernel Version',
|
KERNELVERSION => 'Kernel Version',
|
||||||
);
|
);
|
||||||
@ -453,7 +455,7 @@ sub initialize( $ ) {
|
|||||||
STATEMATCH => '-m state --state',
|
STATEMATCH => '-m state --state',
|
||||||
UNTRACKED => 0,
|
UNTRACKED => 0,
|
||||||
VERSION => "4.4.22.1",
|
VERSION => "4.4.22.1",
|
||||||
CAPVERSION => 40427 ,
|
CAPVERSION => 40500 ,
|
||||||
);
|
);
|
||||||
#
|
#
|
||||||
# From shorewall.conf file
|
# From shorewall.conf file
|
||||||
@ -678,6 +680,7 @@ sub initialize( $ ) {
|
|||||||
IPTABLES_S => undef,
|
IPTABLES_S => undef,
|
||||||
BASIC_FILTER => undef,
|
BASIC_FILTER => undef,
|
||||||
CT_TARGET => undef,
|
CT_TARGET => undef,
|
||||||
|
STATISTICS_MATCH => undef,
|
||||||
CAPVERSION => undef,
|
CAPVERSION => undef,
|
||||||
KERNELVERSION => undef,
|
KERNELVERSION => undef,
|
||||||
);
|
);
|
||||||
@ -2759,6 +2762,10 @@ sub Ct_Target() {
|
|||||||
$ct_target;
|
$ct_target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub Statistics_Match() {
|
||||||
|
qt1( "$iptables -A $sillyname -m statistic --mode nth --every 2 --packet 1" );
|
||||||
|
}
|
||||||
|
|
||||||
our %detect_capability =
|
our %detect_capability =
|
||||||
( ACCOUNT_TARGET =>\&Account_Target,
|
( ACCOUNT_TARGET =>\&Account_Target,
|
||||||
AUDIT_TARGET => \&Audit_Target,
|
AUDIT_TARGET => \&Audit_Target,
|
||||||
@ -2813,6 +2820,7 @@ our %detect_capability =
|
|||||||
RAWPOST_TABLE => \&Rawpost_Table,
|
RAWPOST_TABLE => \&Rawpost_Table,
|
||||||
REALM_MATCH => \&Realm_Match,
|
REALM_MATCH => \&Realm_Match,
|
||||||
RECENT_MATCH => \&Recent_Match,
|
RECENT_MATCH => \&Recent_Match,
|
||||||
|
STATISTICS_MATCH => \&Statistics_Match,
|
||||||
TCPMSS_MATCH => \&Tcpmss_Match,
|
TCPMSS_MATCH => \&Tcpmss_Match,
|
||||||
TIME_MATCH => \&Time_Match,
|
TIME_MATCH => \&Time_Match,
|
||||||
TPROXY_TARGET => \&Tproxy_Target,
|
TPROXY_TARGET => \&Tproxy_Target,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user