mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-15 19:01:19 +01:00
Clone a small function
This commit is contained in:
parent
8f0d0ac5a7
commit
d64edf3470
@ -31,7 +31,7 @@ use Shorewall::Chains qw( :DEFAULT :internal) ;
|
|||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw( validate_policy apply_policy_rules complete_standard_chain setup_syn_flood_chains save_policies optimize_policy_chains get_target_param policy_actions );
|
our @EXPORT = qw( validate_policy apply_policy_rules complete_standard_chain setup_syn_flood_chains save_policies optimize_policy_chains policy_actions );
|
||||||
our @EXPORT_OK = qw( );
|
our @EXPORT_OK = qw( );
|
||||||
our $VERSION = '4.4_16';
|
our $VERSION = '4.4_16';
|
||||||
|
|
||||||
@ -54,6 +54,13 @@ sub initialize() {
|
|||||||
QUEUE => 'none' );
|
QUEUE => 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Return a list of actions used by the policies
|
||||||
|
#
|
||||||
|
sub policy_actions() {
|
||||||
|
keys %policy_actions;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Split the passed target into the basic target and parameter
|
# Split the passed target into the basic target and parameter
|
||||||
#
|
#
|
||||||
@ -67,13 +74,6 @@ sub get_target_param( $ ) {
|
|||||||
( $target, $param );
|
( $target, $param );
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Return a list of actions used by the policies
|
|
||||||
#
|
|
||||||
sub policy_actions() {
|
|
||||||
keys %policy_actions;
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Convert a chain into a policy chain.
|
# Convert a chain into a policy chain.
|
||||||
#
|
#
|
||||||
|
@ -128,6 +128,19 @@ sub split_action ( $ ) {
|
|||||||
( $target, join ":", @a );
|
( $target, join ":", @a );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Split the passed target into the basic target and parameter
|
||||||
|
#
|
||||||
|
sub get_target_param( $ ) {
|
||||||
|
my ( $target, $param ) = split '/', $_[0];
|
||||||
|
|
||||||
|
unless ( defined $param ) {
|
||||||
|
( $target, $param ) = ( $1, $2 ) if $target =~ /^(.*?)[(](.*)[)]$/;
|
||||||
|
}
|
||||||
|
|
||||||
|
( $target, $param );
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create a normalized action name from the passed pieces.
|
# Create a normalized action name from the passed pieces.
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user