Add constants for %used values.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-07-01 15:36:16 -07:00
parent 565fb74795
commit 6803ce5d41

View File

@ -393,6 +393,10 @@ our %capdesc = ( NAT_ENABLED => 'NAT',
our %used; our %used;
use constant {
USED => 1,
REQUIRED => 2 };
use constant { use constant {
ICMP => 1, ICMP => 1,
TCP => 6, TCP => 6,
@ -5105,9 +5109,9 @@ sub get_configuration( $$$$ ) {
if ( have_capability 'CONNTRACK_MATCH') { if ( have_capability 'CONNTRACK_MATCH') {
$globals{STATEMATCH} = '-m conntrack --ctstate'; $globals{STATEMATCH} = '-m conntrack --ctstate';
$used{CONNTRACK_MATCH} = 2; $used{CONNTRACK_MATCH} = REQUIRED;
} else { } else {
$used{STATE_MATCH} = 2; $used{STATE_MATCH} = REQUIRED;
} }
# #
# The following is not documented as it is not likely useful to the user base in general # The following is not documented as it is not likely useful to the user base in general
@ -5926,7 +5930,7 @@ sub report_used_capabilities() {
progress_message2 "Configuration uses these capabilities ('*' denotes required):"; progress_message2 "Configuration uses these capabilities ('*' denotes required):";
for ( sort grep $_ ne 'KERNELVERSION', keys %used ) { for ( sort grep $_ ne 'KERNELVERSION', keys %used ) {
if ( $used{$_} > 1 ) { if ( ( $used{$_} || 0 ) & REQUIRED ) {
progress_message2 " $_*"; progress_message2 " $_*";
} else { } else {
progress_message2 " $_"; progress_message2 " $_";