From 6391325271be489d29f0b7aa2982952068c6a53c Mon Sep 17 00:00:00 2001 From: jack9603301 Date: Tue, 1 Dec 2020 18:36:56 +0800 Subject: mirror: T3089: Delete the mirror function in this module and prepare for migration --- scripts/vyatta-qos.pl | 22 +++++++++++----------- .../interfaces/ethernet/node.tag/mirror/node.def | 18 ------------------ 2 files changed, 11 insertions(+), 29 deletions(-) delete mode 100644 templates/interfaces/ethernet/node.tag/mirror/node.def diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index b8b1779..3a9a3cc 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -111,7 +111,7 @@ sub list_policy { my %delcmd = ( 'out' => 'root', - 'in' => 'parent ffff:', + 'in' => 'parent fffe:', ); ## delete_interface('eth0') @@ -160,13 +160,13 @@ sub apply_openvpn_action { die "Unknown interface type: $dev" unless $interface; # Clear existing ingress - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null"); + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null"); - system("/sbin/tc qdisc add dev $dev handle ffff: ingress") == 0 + system("/sbin/tc qdisc add dev $dev handle fffe: ingress") == 0 or die "tc qdisc ingress failed"; my $cmd = - "/sbin/tc filter add dev $dev parent ffff:" + "/sbin/tc filter add dev $dev parent fffe:" . " protocol all prio 10 u32" . " match u32 0 0 flowid 1:1" . " action mirred egress $action dev $target"; @@ -174,7 +174,7 @@ sub apply_openvpn_action { system($cmd) == 0 or die "tc action $action command failed"; - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null") + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null") if ($action eq '__undef'); } @@ -319,7 +319,7 @@ sub apply_action{ my $ingress = $config->returnValue('traffic-policy in'); - foreach my $action (qw(mirror redirect)) { + foreach my $action (qw(redirect)) { my $target = $config->returnValue($action); next unless $target; @@ -329,13 +329,13 @@ sub apply_action{ if ($ingress); # Clear existing ingress - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null"); + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null"); - system("/sbin/tc qdisc add dev $dev handle ffff: ingress") == 0 + system("/sbin/tc qdisc add dev $dev handle fffe: ingress") == 0 or die "tc qdisc ingress failed"; my $cmd = - "/sbin/tc filter add dev $dev parent ffff:" + "/sbin/tc filter add dev $dev parent fffe:" . " protocol all prio 10 u32" . " match u32 0 0 flowid 1:1" . " action mirred egress $action dev $target"; @@ -347,7 +347,7 @@ sub apply_action{ } # Drop what ever was there before... - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null") + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null") unless($ingress); } @@ -387,7 +387,7 @@ sub check_target { sub delete_action { foreach my $dev (@_) { - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null"); + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null"); } } diff --git a/templates/interfaces/ethernet/node.tag/mirror/node.def b/templates/interfaces/ethernet/node.tag/mirror/node.def deleted file mode 100644 index b67fd20..0000000 --- a/templates/interfaces/ethernet/node.tag/mirror/node.def +++ /dev/null @@ -1,18 +0,0 @@ -type: txt -help: Incoming packet mirroring destination -allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show=ethernet - -syntax:expression: $VAR(@) != $VAR(../@) ;\ - "interface $VAR(../@): mirroring to same interface not allowed" -val_help: Interface for packet mirroring - -commit:expression: $VAR(../redirect) == ""; \ - "interface $VAR(../@) : can not do both redirect and mirror" - -commit:expression: $VAR(../traffic-policy/in) == ""; \ - "interface $VAR(../@) : can not use ingress policy and mirror" - -commit:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) --check=all" - -update: /opt/vyatta/sbin/vyatta-qos.pl --update-action $VAR(../@) -delete: /opt/vyatta/sbin/vyatta-qos.pl --delete-action $VAR(../@) -- cgit v1.2.3