summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkouak <kouak@kouak.org>2015-02-23 01:04:46 +0100
committerDaniil Baturin <daniil@baturin.org>2017-09-14 13:59:44 +0200
commit177f1274b91736c28a577a99786188195dd90848 (patch)
tree498ba93d013ba6e503c2479102c86c004684c4e6
parenta77b7539a77283aac8729e58d47b50ca80dadbd2 (diff)
downloadvyatta-cfg-system-177f1274b91736c28a577a99786188195dd90848.tar.gz
vyatta-cfg-system-177f1274b91736c28a577a99786188195dd90848.zip
Add ingress-qos-mapping/egress-qos-mapping to VLAN configuration (#385)
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.def8
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/egress-qos/node.def9
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/ingress-qos/node.def9
3 files changed, 25 insertions, 1 deletions
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.def b/templates/interfaces/ethernet/node.tag/vif/node.def
index ab6da98e..a1bd652b 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.def
@@ -5,7 +5,13 @@ help: Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
val_help: u32:0-4094; VLAN ID
-create: if ! ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
+create: if [ -n "$VAR(./egress-qos)" ]; then
+ opt-e=" egress-qos-map $VAR(./egress-qos/@) "
+ fi
+ if [ -n "$VAR(./ingress-qos)" ]; then
+ opt-in=" ingress-qos-map $VAR(./ingress-qos/@) "
+ fi
+ if ! ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) $opt-e $opt-in
then echo "Error creating VLAN device $VAR(../@).$VAR(@)"
exit 1
fi
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/egress-qos/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/egress-qos/node.def
new file mode 100644
index 00000000..ea0b5c2a
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/egress-qos/node.def
@@ -0,0 +1,9 @@
+help: VLAN egress QoS
+type: txt
+
+syntax:expression: pattern $VAR(@) "[:0-7 ]+$"; "QoS mapping should be in the format of \"0:7 2:3\" with numbers 0-9"
+
+create:expression: "true"
+update:expression: "false" ; \
+ "egress-qos can only be set at vlan creation for $VAR(../@)"
+comp_help: Format for qos mapping "0:1 1:6 7:6"
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/ingress-qos/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/ingress-qos/node.def
new file mode 100644
index 00000000..3f5d39fc
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/ingress-qos/node.def
@@ -0,0 +1,9 @@
+help: VLAN ingress QoS
+type: txt
+
+syntax:expression: pattern $VAR(@) "[:0-7 ]+$"; "QoS mapping should be in the format of \"0:7 2:3\" with numbers 0-9"
+
+create:expression: "true"
+update:expression: "false" ; \
+ "ingress-qos can only be set at vlan creation for $VAR(../@)"
+comp_help: Format for qos mapping "0:1 1:6 7:6"