mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 11:20:53 +01:00
Reverse myself on comments and continuation
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5778 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
080dc4e183
commit
3dfd501aaf
@ -382,8 +382,6 @@ sub read_a_line {
|
||||
|
||||
$currentlinenumber++;
|
||||
|
||||
next if $nextline =~ /^\s*$/; # Ignore Blank Lines
|
||||
|
||||
chomp $nextline;
|
||||
#
|
||||
# Check for continuation
|
||||
@ -394,6 +392,8 @@ sub read_a_line {
|
||||
}
|
||||
|
||||
$line .= $nextline;
|
||||
|
||||
next if $line =~ /^\s*$/; # Ignore ( concatenated ) Blank Lines
|
||||
#
|
||||
# Ignore ( concatenated ) lines that are nothing but comments
|
||||
#
|
||||
|
@ -153,7 +153,7 @@ sub process_tc_rule( $$$$$$$$$$ ) {
|
||||
$mark = "$mark/0xFF" if $connmark = $tcsref->{connmark};
|
||||
|
||||
} else {
|
||||
fatal_error "Invalid MARK ($original_mark) in rule \"$line\"" unless $mark =~ /^([0-9]+|0x[0-9a-f]+)$/ and $designator =~ /^([0-9]+|0x[0-9a-f]+)$/;
|
||||
fatal_error "Invalid MARK ($original_mark)" unless $mark =~ /^([0-9]+|0x[0-9a-f]+)$/ and $designator =~ /^([0-9]+|0x[0-9a-f]+)$/;
|
||||
$chain = 'tcpost';
|
||||
$classid = 1;
|
||||
$mark = $original_mark;
|
||||
@ -260,7 +260,7 @@ sub rate_to_kbit( $ ) {
|
||||
return $1 * 8192 if $rate =~ /^(\d+)mbps$/i;
|
||||
return $1 * 8 if $rate =~ /^(\d+)kbps$/i;
|
||||
return $rate / 128 if $rate =~ /^\d+$/;
|
||||
fatal_error "Invalid Rate ( $rate ) in tcdevice \"$line\"";
|
||||
fatal_error "Invalid Rate ( $rate )";
|
||||
}
|
||||
|
||||
sub calculate_quantum( $ ) {
|
||||
@ -271,8 +271,8 @@ sub calculate_quantum( $ ) {
|
||||
sub validate_tc_device( $$$ ) {
|
||||
my ( $device, $inband, $outband ) = @_;
|
||||
|
||||
fatal_error "Duplicate device ( $device ) in tcdevice \"$line\"" if $tcdevices{$device};
|
||||
fatal_error "Invalid device name ( $device ) in tcdevice \"$line\"" if $device =~ /[:+]/;
|
||||
fatal_error "Duplicate device ( $device )" if $tcdevices{$device};
|
||||
fatal_error "Invalid device name ( $device )" if $device =~ /[:+]/;
|
||||
|
||||
rate_to_kbit $inband;
|
||||
rate_to_kbit $outband;
|
||||
@ -304,16 +304,16 @@ sub validate_tc_class( $$$$$$ ) {
|
||||
'tos-normal-service' => 'tos=0x00/0x1e' );
|
||||
|
||||
my $devref = $tcdevices{$device};
|
||||
fatal_error "Unknown Device ( $device ) in tcclass \"$line\"" unless $devref;
|
||||
fatal_error "Unknown Device ( $device )" unless $devref;
|
||||
my $full = rate_to_kbit $devref->{out_bandwidth};
|
||||
|
||||
$tcclasses{$device} = {} unless $tcclasses{$device};
|
||||
my $tcref = $tcclasses{$device};
|
||||
|
||||
fatal_error "Invalid Mark ( $mark ) in tcclass \"$line\"" unless $mark =~ /^([0-9]+|0x[0-9a-f]+)$/ && numeric_value( $mark ) < 0xff;
|
||||
fatal_error "Invalid Mark ( $mark )" unless $mark =~ /^([0-9]+|0x[0-9a-f]+)$/ && numeric_value( $mark ) < 0xff;
|
||||
|
||||
my $markval = numeric_value( $mark );
|
||||
fatal_error "Duplicate Mark ( $mark ) in tcclass \"$line\"" if $tcref->{$markval};
|
||||
fatal_error "Duplicate Mark ( $mark )" if $tcref->{$markval};
|
||||
|
||||
$tcref->{$markval} = {};
|
||||
$tcref = $tcref->{$markval};
|
||||
@ -340,7 +340,7 @@ sub validate_tc_class( $$$$$$ ) {
|
||||
( undef, $option ) = split /=/, $option;
|
||||
push @{$tcref->{tos}}, $option;
|
||||
} else {
|
||||
fatal_error "Unknown option ( $option ) for tcclass \"$line\"";
|
||||
fatal_error "Unknown option ( $option )";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -365,7 +365,7 @@ sub setup_traffic_shaping() {
|
||||
$first_entry = 0;
|
||||
}
|
||||
|
||||
fatal_error "Invalid tcdevices entry: \"$line\"" if $outband eq '-';
|
||||
fatal_error "Invalid tcdevices entry" if $outband eq '-';
|
||||
validate_tc_device( $device, $inband, $outband );
|
||||
}
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ sub generate_script_2 () {
|
||||
|
||||
open MF, $mf or fatal_error "Unable to open $mf: $!";
|
||||
|
||||
while ( $line = <MF> ) { emit_as_is $line if $line =~ /^\s*loadmodule\b/; }
|
||||
while ( my $line = <MF> ) { emit_as_is $line if $line =~ /^\s*loadmodule\b/; }
|
||||
|
||||
close MF;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user