diff options
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"; } |