summaryrefslogtreecommitdiff
path: root/scripts/VyattaQosMatch.pm
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-01-30 14:28:27 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-01-30 14:28:27 -0800
commit8e96d1f6674c3649aa2c8266352f9909ed011b81 (patch)
tree598c6e06c723b00f37348d9cd35fdc6d63a44848 /scripts/VyattaQosMatch.pm
parent86fc4e7801919a1da123f34500218a69a30c2059 (diff)
downloadvyatta-cfg-qos-8e96d1f6674c3649aa2c8266352f9909ed011b81.tar.gz
vyatta-cfg-qos-8e96d1f6674c3649aa2c8266352f9909ed011b81.zip
fix typos in management of match rules
the code here still doesn't work but fix obvious stuff.
Diffstat (limited to 'scripts/VyattaQosMatch.pm')
-rw-r--r--scripts/VyattaQosMatch.pm21
1 files changed, 11 insertions, 10 deletions
diff --git a/scripts/VyattaQosMatch.pm b/scripts/VyattaQosMatch.pm
index 72f7a36..59e0477 100644
--- a/scripts/VyattaQosMatch.pm
+++ b/scripts/VyattaQosMatch.pm
@@ -27,14 +27,14 @@ sub new {
return $self;
}
-sub _tos {
- my $tos = shift;
+sub _dsfield {
+ my $dsfield = shift;
my $ret = undef;
- if ( defined $tos ) {
- $ret = VyattaQosUtil::getDsfield($tos);
+ if ( defined $dsfield ) {
+ $ret = VyattaQosUtil::getDsfield($dsfield);
if ( !defined $ret ) {
- $tos = hex($tos);
+ $dsfield = hex($dsfield);
}
}
return $ret;
@@ -48,12 +48,13 @@ sub _define {
$self->{_vlan} = $config->returnValue("vif");
$self->{_dev} = $config->returnValue("interface");
- $self->{_ip}->{_tos} = _tos( $config->returnValue("ip tos") );
+ $self->{_ip}->{_dsfield} = _dsfield( $config->returnValue("ip dsfield") );
$self->{_ip}->{_protocol} = $config->returnValue("ip protocol");
$self->{_ip}->{_src} = $config->returnValue("ip source address");
$self->{_ip}->{_dst} = $config->returnValue("ip destination address");
+
$self->{_ip}->{_sport} = $config->returnValue("ip source port");
- $self->{_ip}->{_dport} = $config->returnValue("ip source dport");
+ $self->{_ip}->{_dport} = $config->returnValue("ip destination port");
}
sub filter {
@@ -64,9 +65,9 @@ sub filter {
# TODO match on vlan, device, ...
if (defined $self->{_ip}) {
print {$out} " u32";
- print {$out} " match ip tos $self->{_ip}->{_tos} 0xff"
- if defined $self->{_ip}->{_tos};
- print {$out} " match ip protocol $self->{_ip}->{_protcol} 0xff"
+ print {$out} " match ip dsfield $self->{_ip}->{_dsfield} 0xff"
+ if defined $self->{_ip}->{_dsfield};
+ print {$out} " match ip protocol $self->{_ip}->{_protocol} 0xff"
if defined $self->{_ip}->{_protocol};
print {$out} " match ip src $self->{_ip}->{_src}"
if defined $self->{_ip}->{_src};