Add a PRIORITY column to the tcfilters file.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-09-09 14:48:32 -07:00
parent 0e1e38b035
commit 9d6e0fd9ed
5 changed files with 33 additions and 6 deletions

View File

@ -1353,7 +1353,7 @@ my %validlengths = ( 32 => '0xffe0', 64 => '0xffc0', 128 => '0xff80', 256 => '0x
# #
sub process_tc_filter() { sub process_tc_filter() {
my ( $devclass, $source, $dest , $proto, $portlist , $sportlist, $tos, $length ) = split_line 'tcfilters file', { class => 0, source => 1, dest => 2, proto => 3, dport => 4, sport => 5, tos => 6, length => 7 }; my ( $devclass, $source, $dest , $proto, $portlist , $sportlist, $tos, $length, $priority ) = split_line 'tcfilters file', { class => 0, source => 1, dest => 2, proto => 3, dport => 4, sport => 5, tos => 6, length => 7 , priority => 8 };
fatal_error 'CLASS must be specified' if $devclass eq '-'; fatal_error 'CLASS must be specified' if $devclass eq '-';
@ -1365,6 +1365,11 @@ sub process_tc_filter() {
my ( $ip, $ip32, $prio , $lo ) = $family == F_IPV4 ? ('ip', 'ip', 10, 2 ) : ('ipv6', 'ip6', 11 , 4 ); my ( $ip, $ip32, $prio , $lo ) = $family == F_IPV4 ? ('ip', 'ip', 10, 2 ) : ('ipv6', 'ip6', 11 , 4 );
if ( $priority ne '-' ) {
$prio = numeric_value $priority;
fatal_error "Invalid priority ($priority)" unless defined $prio && $prio >= 12;
}
my $devref; my $devref;
if ( $device =~ /^[\da-fA-F]+$/ && ! $tcdevices{$device} ) { if ( $device =~ /^[\da-fA-F]+$/ && ! $tcdevices{$device} ) {

View File

@ -5,6 +5,6 @@
# #
# See http://shorewall.net/traffic_shaping.htm for additional information. # See http://shorewall.net/traffic_shaping.htm for additional information.
# #
############################################################################################## ########################################################################################################
#INTERFACE: SOURCE DEST PROTO DEST SOURCE TOS LENGTH #INTERFACE: SOURCE DEST PROTO DEST SOURCE TOS LENGTH PRIORITY
#CLASS PORT(S) PORT(S) #CLASS PORT(S) PORT(S)

View File

@ -189,6 +189,17 @@
<replaceable>number</replaceable> will match the rule.</para> <replaceable>number</replaceable> will match the rule.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><emphasis role="bold">PRIORITY</emphasis> - [<emphasis
role="bold">-</emphasis>|<emphasis>number</emphasis>]</term>
<listitem>
<para>Added in Shorewall 4.5.8. Specifies the rule priority. If not
given, priority 10 is assumed. The priority value must be &gt;=
12.</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>

View File

@ -5,6 +5,6 @@
# #
# See http://shorewall.net/traffic_shaping.htm for additional information. # See http://shorewall.net/traffic_shaping.htm for additional information.
# #
############################################################################################## ########################################################################################################
#INTERFACE: SOURCE DEST PROTO DEST SOURCE TOS LENGTH #INTERFACE: SOURCE DEST PROTO DEST SOURCE TOS LENGTH PRIORITY
#CLASS PORT(S) PORT(S) #CLASS PORT(S) PORT(S)

View File

@ -185,6 +185,17 @@
<replaceable>number</replaceable> will match the rule.</para> <replaceable>number</replaceable> will match the rule.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><emphasis role="bold">PRIORITY</emphasis> - [<emphasis
role="bold">-</emphasis>|<emphasis>number</emphasis>]</term>
<listitem>
<para>Added in Shorewall 4.5.8. Specifies the rule priority. If not
given, priority 11 is assumed. The priority value must be &gt;=
12.</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>