From 177f1274b91736c28a577a99786188195dd90848 Mon Sep 17 00:00:00 2001 From: kouak Date: Mon, 23 Feb 2015 01:04:46 +0100 Subject: Add ingress-qos-mapping/egress-qos-mapping to VLAN configuration (#385) --- templates/interfaces/ethernet/node.tag/vif/node.def | 8 +++++++- .../ethernet/node.tag/vif/node.tag/egress-qos/node.def | 9 +++++++++ .../ethernet/node.tag/vif/node.tag/ingress-qos/node.def | 9 +++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 templates/interfaces/ethernet/node.tag/vif/node.tag/egress-qos/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif/node.tag/ingress-qos/node.def 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" -- cgit v1.2.3