diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-05 16:54:48 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-05 16:54:48 -0800 |
commit | 0b8d73903c3a1245c95d3ed92756fe3df649bbed (patch) | |
tree | 67e0342479bc718d35c04e657357b3036419e9cb /scripts/VyattaQosMatch.pm | |
parent | 24b46144a00f1346b0c983884e3f11b91b0c4379 (diff) | |
download | vyatta-cfg-qos-0b8d73903c3a1245c95d3ed92756fe3df649bbed.tar.gz vyatta-cfg-qos-0b8d73903c3a1245c95d3ed92756fe3df649bbed.zip |
add support for match based on incoming device and vlan
This is preliminary (still needs testing) but get the syntax and basic structure
in place.
Diffstat (limited to 'scripts/VyattaQosMatch.pm')
-rw-r--r-- | scripts/VyattaQosMatch.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/VyattaQosMatch.pm b/scripts/VyattaQosMatch.pm index fc0958a..31ddf36 100644 --- a/scripts/VyattaQosMatch.pm +++ b/scripts/VyattaQosMatch.pm @@ -5,7 +5,7 @@ use strict; my %fields = ( _dev => undef, - _vlan => undef, + _vif => undef, _ip => { src => undef, dst => undef, @@ -31,7 +31,7 @@ sub _define { my ( $self, $config ) = @_; my $level = $config->setLevel(); - $self->{_vlan} = $config->returnValue("vif"); + $self->{_vif} = VyattaQosUtil::getIfIndex($config->returnValue("vif")); $self->{_dev} = $config->returnValue("interface"); if ($config->exists("ip")) { my %ip; @@ -51,8 +51,6 @@ sub filter { print {$out} "filter add dev $dev parent 1:0 prio 1"; - # TODO match on vlan, device, ... - if (defined $self->{_ip}) { my $ip = $self->{_ip}; print {$out} " protocol ip u32"; @@ -64,5 +62,13 @@ sub filter { print {$out} " match ip dport $$ip{dport} 0xffff" if defined $$ip{dport}; } + if (defined $self->{_dev}) { + print {$out} " basic meta match meta \(rt_iif eq $self->{_dev}\)"; + } + + if (defined $self->{_vif}) { + print {$out} " basic meta match meta \(vlan mask 0xfff eq $self->{_vif}\)"; + } + print {$out} " classid 1:$id\n"; } |