From 3584691b35f35e40a1bfc22c34da031141fd0dfa Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 21 Mar 2022 21:41:41 +0100 Subject: qos: T4284: initial XML interface definitions for rewrite --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 29744b323..431f3a8c2 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,12 @@ interface_definitions: $(config_xml_obj) # XXX: delete top level node.def's that now live in other packages # IPSec VPN EAP-RADIUS does not support source-address rm -rf $(TMPL_DIR)/vpn/ipsec/remote-access/radius/source-address + + # T4284 neq QoS implementation is not yet live + find $(TMPL_DIR)/interfaces -name traffic-policy -type d -exec rm -rf {} \; + find $(TMPL_DIR)/interfaces -name redirect -type d -exec rm -rf {} \; + rm -rf $(TMPL_DIR)/interfaces/input + # XXX: test if there are empty node.def files - this is not allowed as these # could mask help strings or mandatory priority statements find $(TMPL_DIR) -name node.def -type f -empty -exec false {} + || sh -c 'echo "There are empty node.def files! Check your interface definitions." && exit 1' -- cgit v1.2.3 From dae259c5dbb6146f584251fe9a39a1a56cf926be Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 22 Mar 2022 07:11:00 +0100 Subject: qos: T4284: delete traffic-policy CLI path via Makefile Implementation is still work in progress, as such the CLI XML definitions are published but the Python code does not work. In this case we must ensure XML backed node.def files are deleted after generation so they do not conflict with the current vyatta-cfg-qos implementation. --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 431f3a8c2..54f3892ba 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,7 @@ interface_definitions: $(config_xml_obj) # T4284 neq QoS implementation is not yet live find $(TMPL_DIR)/interfaces -name traffic-policy -type d -exec rm -rf {} \; find $(TMPL_DIR)/interfaces -name redirect -type d -exec rm -rf {} \; + rm -rf $(TMPL_DIR)/traffic-policy rm -rf $(TMPL_DIR)/interfaces/input # XXX: test if there are empty node.def files - this is not allowed as these -- cgit v1.2.3 From 0bf386cee9b09d2e1a220330d3662c6ca2642645 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 6 Apr 2022 20:09:31 +0200 Subject: qos: T4284: rename "traffic-policy" node to "qos policy" "set traffic-policy" now becomes "set qos policy" "set interface ethernet eth0 traffic-policy" now bvecomes "set qos interface eth0" --- Makefile | 3 +- .../include/interface/traffic-policy.xml.i | 43 - .../include/interface/vif-s.xml.i | 2 - interface-definitions/include/interface/vif.xml.i | 1 - interface-definitions/interfaces-bonding.xml.in | 1 - interface-definitions/interfaces-bridge.xml.in | 1 - interface-definitions/interfaces-dummy.xml.in | 1 - interface-definitions/interfaces-ethernet.xml.in | 1 - interface-definitions/interfaces-geneve.xml.in | 1 - interface-definitions/interfaces-input.xml.in | 1 - interface-definitions/interfaces-l2tpv3.xml.in | 1 - interface-definitions/interfaces-loopback.xml.in | 1 - interface-definitions/interfaces-macsec.xml.in | 1 - interface-definitions/interfaces-openvpn.xml.in | 1 - interface-definitions/interfaces-pppoe.xml.in | 1 - .../interfaces-pseudo-ethernet.xml.in | 1 - interface-definitions/interfaces-tunnel.xml.in | 1 - interface-definitions/interfaces-vti.xml.in | 1 - interface-definitions/interfaces-vxlan.xml.in | 1 - interface-definitions/interfaces-wireguard.xml.in | 1 - interface-definitions/interfaces-wireless.xml.in | 1 - interface-definitions/interfaces-wwan.xml.in | 1 - interface-definitions/qos.xml.in | 1148 +++++++++++--------- src/conf_mode/qos.py | 47 +- 24 files changed, 631 insertions(+), 631 deletions(-) delete mode 100644 interface-definitions/include/interface/traffic-policy.xml.i (limited to 'Makefile') diff --git a/Makefile b/Makefile index 54f3892ba..dc1301100 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,8 @@ interface_definitions: $(config_xml_obj) rm -rf $(TMPL_DIR)/vpn/ipsec/remote-access/radius/source-address # T4284 neq QoS implementation is not yet live - find $(TMPL_DIR)/interfaces -name traffic-policy -type d -exec rm -rf {} \; find $(TMPL_DIR)/interfaces -name redirect -type d -exec rm -rf {} \; - rm -rf $(TMPL_DIR)/traffic-policy + rm -rf $(TMPL_DIR)/qos rm -rf $(TMPL_DIR)/interfaces/input # XXX: test if there are empty node.def files - this is not allowed as these diff --git a/interface-definitions/include/interface/traffic-policy.xml.i b/interface-definitions/include/interface/traffic-policy.xml.i deleted file mode 100644 index cd60b62a5..000000000 --- a/interface-definitions/include/interface/traffic-policy.xml.i +++ /dev/null @@ -1,43 +0,0 @@ - - - - Traffic-policy for interface - - - - - Ingress traffic policy for interface - - traffic-policy drop-tail - traffic-policy fair-queue - traffic-policy fq-codel - traffic-policy limiter - traffic-policy network-emulator - traffic-policy priority-queue - traffic-policy random-detect - traffic-policy rate-control - traffic-policy round-robin - traffic-policy shaper - traffic-policy shaper-hfsc - - - txt - Policy name - - - - - - Egress traffic policy for interface - - traffic-policy - - - txt - Policy name - - - - - - \ No newline at end of file diff --git a/interface-definitions/include/interface/vif-s.xml.i b/interface-definitions/include/interface/vif-s.xml.i index 40a87e3d3..3b305618e 100644 --- a/interface-definitions/include/interface/vif-s.xml.i +++ b/interface-definitions/include/interface/vif-s.xml.i @@ -67,14 +67,12 @@ #include #include #include - #include #include #include #include #include - #include #include diff --git a/interface-definitions/include/interface/vif.xml.i b/interface-definitions/include/interface/vif.xml.i index 615101664..4e7f9b3c2 100644 --- a/interface-definitions/include/interface/vif.xml.i +++ b/interface-definitions/include/interface/vif.xml.i @@ -52,7 +52,6 @@ #include #include #include - #include #include diff --git a/interface-definitions/interfaces-bonding.xml.in b/interface-definitions/interfaces-bonding.xml.in index 20ece5137..5ae67a672 100644 --- a/interface-definitions/interfaces-bonding.xml.in +++ b/interface-definitions/interfaces-bonding.xml.in @@ -208,7 +208,6 @@ #include - #include #include #include #include diff --git a/interface-definitions/interfaces-bridge.xml.in b/interface-definitions/interfaces-bridge.xml.in index 6957067cd..be4c92583 100644 --- a/interface-definitions/interfaces-bridge.xml.in +++ b/interface-definitions/interfaces-bridge.xml.in @@ -211,7 +211,6 @@ #include - #include #include diff --git a/interface-definitions/interfaces-dummy.xml.in b/interface-definitions/interfaces-dummy.xml.in index 988d87502..7f9ae90e5 100644 --- a/interface-definitions/interfaces-dummy.xml.in +++ b/interface-definitions/interfaces-dummy.xml.in @@ -32,7 +32,6 @@ #include #include #include - #include #include diff --git a/interface-definitions/interfaces-ethernet.xml.in b/interface-definitions/interfaces-ethernet.xml.in index 7d28912c0..7fa07e9ec 100644 --- a/interface-definitions/interfaces-ethernet.xml.in +++ b/interface-definitions/interfaces-ethernet.xml.in @@ -197,7 +197,6 @@ #include - #include #include #include #include diff --git a/interface-definitions/interfaces-geneve.xml.in b/interface-definitions/interfaces-geneve.xml.in index 5f2c6bc05..fa5a78be5 100644 --- a/interface-definitions/interfaces-geneve.xml.in +++ b/interface-definitions/interfaces-geneve.xml.in @@ -52,7 +52,6 @@ #include #include - #include #include #include diff --git a/interface-definitions/interfaces-input.xml.in b/interface-definitions/interfaces-input.xml.in index f2eb01c58..2164bfa4e 100644 --- a/interface-definitions/interfaces-input.xml.in +++ b/interface-definitions/interfaces-input.xml.in @@ -22,7 +22,6 @@ #include #include #include - #include diff --git a/interface-definitions/interfaces-l2tpv3.xml.in b/interface-definitions/interfaces-l2tpv3.xml.in index 0dcabf7a0..1f23a89a5 100644 --- a/interface-definitions/interfaces-l2tpv3.xml.in +++ b/interface-definitions/interfaces-l2tpv3.xml.in @@ -125,7 +125,6 @@ - #include #include diff --git a/interface-definitions/interfaces-loopback.xml.in b/interface-definitions/interfaces-loopback.xml.in index 1e093d95b..7ac0545c6 100644 --- a/interface-definitions/interfaces-loopback.xml.in +++ b/interface-definitions/interfaces-loopback.xml.in @@ -28,7 +28,6 @@ #include #include - #include diff --git a/interface-definitions/interfaces-macsec.xml.in b/interface-definitions/interfaces-macsec.xml.in index fbdd1562a..cb3c489aa 100644 --- a/interface-definitions/interfaces-macsec.xml.in +++ b/interface-definitions/interfaces-macsec.xml.in @@ -124,7 +124,6 @@ #include #include - #include #include diff --git a/interface-definitions/interfaces-openvpn.xml.in b/interface-definitions/interfaces-openvpn.xml.in index 761f8bcad..c917b9312 100644 --- a/interface-definitions/interfaces-openvpn.xml.in +++ b/interface-definitions/interfaces-openvpn.xml.in @@ -818,7 +818,6 @@ #include - #include #include diff --git a/interface-definitions/interfaces-pppoe.xml.in b/interface-definitions/interfaces-pppoe.xml.in index adf5f4040..3a0b7a40c 100644 --- a/interface-definitions/interfaces-pppoe.xml.in +++ b/interface-definitions/interfaces-pppoe.xml.in @@ -135,7 +135,6 @@ #include - #include #include diff --git a/interface-definitions/interfaces-pseudo-ethernet.xml.in b/interface-definitions/interfaces-pseudo-ethernet.xml.in index aed2052f5..5f5e9fdef 100644 --- a/interface-definitions/interfaces-pseudo-ethernet.xml.in +++ b/interface-definitions/interfaces-pseudo-ethernet.xml.in @@ -61,7 +61,6 @@ #include #include - #include #include #include diff --git a/interface-definitions/interfaces-tunnel.xml.in b/interface-definitions/interfaces-tunnel.xml.in index b31f22552..42ec62775 100644 --- a/interface-definitions/interfaces-tunnel.xml.in +++ b/interface-definitions/interfaces-tunnel.xml.in @@ -290,7 +290,6 @@ #include #include - #include diff --git a/interface-definitions/interfaces-vti.xml.in b/interface-definitions/interfaces-vti.xml.in index d66fc952e..5893e4c4c 100644 --- a/interface-definitions/interfaces-vti.xml.in +++ b/interface-definitions/interfaces-vti.xml.in @@ -36,7 +36,6 @@ #include #include #include - #include #include #include #include diff --git a/interface-definitions/interfaces-vxlan.xml.in b/interface-definitions/interfaces-vxlan.xml.in index b1a2dfaec..9747b1816 100644 --- a/interface-definitions/interfaces-vxlan.xml.in +++ b/interface-definitions/interfaces-vxlan.xml.in @@ -101,7 +101,6 @@ #include #include #include - #include #include #include diff --git a/interface-definitions/interfaces-wireguard.xml.in b/interface-definitions/interfaces-wireguard.xml.in index 51565cfe6..eb0892f07 100644 --- a/interface-definitions/interfaces-wireguard.xml.in +++ b/interface-definitions/interfaces-wireguard.xml.in @@ -121,7 +121,6 @@ #include - #include #include diff --git a/interface-definitions/interfaces-wireless.xml.in b/interface-definitions/interfaces-wireless.xml.in index a16a7841e..db01657eb 100644 --- a/interface-definitions/interfaces-wireless.xml.in +++ b/interface-definitions/interfaces-wireless.xml.in @@ -783,7 +783,6 @@ monitor #include - #include #include #include diff --git a/interface-definitions/interfaces-wwan.xml.in b/interface-definitions/interfaces-wwan.xml.in index 33bc0cb3d..3cb1645c4 100644 --- a/interface-definitions/interfaces-wwan.xml.in +++ b/interface-definitions/interfaces-wwan.xml.in @@ -42,7 +42,6 @@ #include #include #include - #include #include diff --git a/interface-definitions/qos.xml.in b/interface-definitions/qos.xml.in index d4468543c..e8f575a1e 100644 --- a/interface-definitions/qos.xml.in +++ b/interface-definitions/qos.xml.in @@ -1,721 +1,789 @@ - + - Quality of Service (QOS) policy type - 900 + Quality of Service (QoS) - + - Packet limited First In, First Out queue + Interface to apply QoS policy + + + txt - Policy name + Interface name - [[:alnum:]][-_[:alnum:]]* + - Only alpha-numeric policy name allowed - #include - #include - - - - - Stochastic Fairness Queueing - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - #include - + - Interval in seconds for queue algorithm perturbation - - u32:0 - No perturbation - + Interface ingress traffic policy + + traffic-policy drop-tail + traffic-policy fair-queue + traffic-policy fq-codel + traffic-policy limiter + traffic-policy network-emulator + traffic-policy priority-queue + traffic-policy random-detect + traffic-policy rate-control + traffic-policy round-robin + traffic-policy shaper + traffic-policy shaper-hfsc + - u32:1-127 - Interval in seconds for queue algorithm perturbation (advised: 10) + txt + QoS Policy name - - - - Interval must be in range 0 to 127 - 0 - + - Upper limit of the SFQ + Interface egress traffic policy + + traffic-policy drop-tail + traffic-policy fair-queue + traffic-policy fq-codel + traffic-policy limiter + traffic-policy network-emulator + traffic-policy priority-queue + traffic-policy random-detect + traffic-policy rate-control + traffic-policy round-robin + traffic-policy shaper + traffic-policy shaper-hfsc + - u32:2-127 - Queue size in packets + txt + QoS Policy name - - - - Queue limit must greater than 1 and less than 128 - 127 - + - Fair Queuing Controlled Delay - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed + Service Policy definitions + 900 - #include - #include - #include - #include - #include - #include - - - - - Traffic input limiting policy - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - + - Class ID + Packet limited First In, First Out queue - u32:1-4090 - Class Identifier + txt + Policy name - + [[:alnum:]][-_[:alnum:]]* - Class identifier must be between 1 and 4090 + Only alpha-numeric policy name allowed + + + #include + #include + + + + + Stochastic Fairness Queueing + + txt + Policy name + + + [[:alnum:]][-_[:alnum:]]* + + Only alpha-numeric policy name allowed - #include - #include #include - #include - + + + Interval in seconds for queue algorithm perturbation + + u32:0 + No perturbation + + + u32:1-127 + Interval in seconds for queue algorithm perturbation (advised: 10) + + + + + Interval must be in range 0 to 127 + + 0 + + - Priority for rule evaluation + Upper limit of the SFQ - u32:0-20 - Priority for match rule evaluation + u32:2-127 + Queue size in packets - + - Priority must be between 0 and 20 + Queue limit must greater than 1 and less than 128 - 20 + 127 - - - Default policy - - - #include - #include - - - #include - - - - - Network emulator policy - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - #include - #include - #include - - - Adds delay to packets outgoing to chosen network interface - - <number> - Time in milliseconds - - - - - Priority must be between 0 and 65535 - - - - - Introducing error in a random position for chosen percent of packets - - <number> - Percentage of packets affected - - - - - Priority must be between 0 and 100 - - - - - Add independent loss probability to the packets outgoing to chosen network interface - - <number> - Percentage of packets affected - - - - - Must be between 0 and 100 - - - + - Add independent loss probability to the packets outgoing to chosen network interface + Fair Queuing Controlled Delay - <number> - Percentage of packets affected + txt + Policy name - + [[:alnum:]][-_[:alnum:]]* - Must be between 0 and 100 - - - - - Packet reordering percentage - - <number> - Percentage of packets affected - - - - - Must be between 0 and 100 - - - #include - - - - - Priority queuing based policy - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - - - Class Handle - - u32:1-7 - Priority - - - - - Class handle must be between 1 and 7 + Only alpha-numeric policy name allowed #include #include #include #include - #include #include #include - #include - + - Default policy + Traffic input limiting policy + + txt + Policy name + + + [[:alnum:]][-_[:alnum:]]* + + Only alpha-numeric policy name allowed + + + Class ID + + u32:1-4090 + Class Identifier + + + + + Class identifier must be between 1 and 4090 + + + #include + #include + #include + #include + + + Priority for rule evaluation + + u32:0-20 + Priority for match rule evaluation + + + + + Priority must be between 0 and 20 + + 20 + + + + + + Default policy + + + #include + #include + + #include - #include - #include - #include - #include - #include - #include - - #include - - - - - Priority queuing based policy - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - #include - - auto - - #include - + + - IP precedence + Network emulator policy - u32:0-7 - IP precedence value + txt + Policy name - + [[:alnum:]][-_[:alnum:]]* - IP precedence value must be between 0 and 7 + Only alpha-numeric policy name allowed - #include - + #include + #include + #include + - Average packet size (bytes) + Adds delay to packets outgoing to chosen network interface - u32:16-10240 - Average packet size in bytes + <number> + Time in milliseconds - + - Average packet size must be between 16 and 10240 + Priority must be between 0 and 65535 - 1024 - + - Mark probability for this precedence + Introducing error in a random position for chosen percent of packets <number> - Numeric value (1/N) + Percentage of packets affected - + - Mark probability must be greater than 0 + Priority must be between 0 and 100 - + - Maximum threshold for random detection + Add independent loss probability to the packets outgoing to chosen network interface - u32:0-4096 - Maximum Threshold in packets + <number> + Percentage of packets affected - + - Threshold must be between 0 and 4096 + Must be between 0 and 100 - + - Minimum threshold for random detection + Add independent loss probability to the packets outgoing to chosen network interface - u32:0-4096 - Maximum Threshold in packets + <number> + Percentage of packets affected - + - Threshold must be between 0 and 4096 + Must be between 0 and 100 - - - - - - - Rate limiting policy (Token Bucket Filter) - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - #include - #include - #include - - - Maximum latency - - <number> - Time in milliseconds - - - - - Threshold must be between 0 and 4096 - - 50 - - - - - - Round-Robin based policy - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - #include - - - Class ID - - u32:1-4095 - Class Identifier - - - - - Class identifier must be between 1 and 4095 - - - #include - #include - #include - #include - #include - + - Packet scheduling quantum + Packet reordering percentage - u32:1-4294967295 - Packet scheduling quantum (bytes) + <number> + Percentage of packets affected - + - Quantum must be in range 1 to 4294967295 + Must be between 0 and 100 #include - #include - #include - - - - - Hierarchical Fair Service Curve's policy - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - #include - - auto - - #include - + - Class ID + Priority queuing based policy - u32:1-4095 - Class Identifier + txt + Policy name - + [[:alnum:]][-_[:alnum:]]* - Class identifier must be between 1 and 4095 + Only alpha-numeric policy name allowed - #include - + - Linkshare class settings - - - #include - #include - #include - - - #include - - - Realtime class settings + Class Handle + + u32:1-7 + Priority + + + + + Class handle must be between 1 and 7 - #include - #include - #include + #include + #include + #include + #include + #include + #include + #include + #include - - + + - Upperlimit class settings + Default policy - #include - #include - #include + #include + #include + #include + #include + #include + #include + #include + #include - + - Default policy + Priority queuing based policy + + txt + Policy name + + + [[:alnum:]][-_[:alnum:]]* + + Only alpha-numeric policy name allowed - - - Linkshare class settings - - - #include - #include - #include - - - - - Realtime class settings - - - #include - #include - #include - - - + #include + + auto + + #include + - Upperlimit class settings + IP precedence + + u32:0-7 + IP precedence value + + + + + IP precedence value must be between 0 and 7 - #include - #include - #include + #include + + + Average packet size (bytes) + + u32:16-10240 + Average packet size in bytes + + + + + Average packet size must be between 16 and 10240 + + 1024 + + + + Mark probability for this precedence + + <number> + Numeric value (1/N) + + + + + Mark probability must be greater than 0 + + + + + Maximum threshold for random detection + + u32:0-4096 + Maximum Threshold in packets + + + + + Threshold must be between 0 and 4096 + + + + + Minimum threshold for random detection + + u32:0-4096 + Maximum Threshold in packets + + + + + Threshold must be between 0 and 4096 + + - + - - - - - - Traffic shaping based policy (Hierarchy Token Bucket) - - txt - Policy name - - - [[:alnum:]][-_[:alnum:]]* - - Only alpha-numeric policy name allowed - - - #include - - auto - - + + - Class ID + Rate limiting policy (Token Bucket Filter) - u32:2-4095 - Class Identifier + txt + Policy name - + [[:alnum:]][-_[:alnum:]]* - Class identifier must be between 2 and 4095 + Only alpha-numeric policy name allowed #include - - 100% - + #include #include - + - Bandwidth limit for this class + Maximum latency <number> - Rate in kbit (kilobit per second) - - - <number>%% - Percentage of overall rate - - - <number>bit - bit(1), kbit(10^3), mbit(10^6), gbit, tbit - - - <number>ibit - kibit(1024), mibit(1024^2), gibit(1024^3), tbit(1024^4) - - - <number>ibps - kibps(1024*8), mibps(1024^2*8), gibps, tibps - Byte/sec - - - <number>bps - bps(8),kbps(8*10^3),mbps(8*10^6), gbps, tbps - Byte/sec + Time in milliseconds + + + + Threshold must be between 0 and 4096 + 50 - #include + + + + + Round-Robin based policy + + txt + Policy name + + + [[:alnum:]][-_[:alnum:]]* + + Only alpha-numeric policy name allowed + + #include - #include - #include - #include - + - Priority for usage of excess bandwidth + Class ID - u32:0-7 - Priority order for bandwidth pool + u32:1-4095 + Class Identifier - + - Priority must be between 0 and 7 + Class identifier must be between 1 and 4095 - 20 - - #include - #include - #include - #include + + #include + #include + #include + #include + #include + + + Packet scheduling quantum + + u32:1-4294967295 + Packet scheduling quantum (bytes) + + + + + Quantum must be in range 1 to 4294967295 + + + #include + #include + #include + + - #include - + - Default policy + Hierarchical Fair Service Curve's policy + + txt + Policy name + + + [[:alnum:]][-_[:alnum:]]* + + Only alpha-numeric policy name allowed #include - #include - + + auto + + #include + - Bandwidth limit for this class - - <number> - Rate in kbit (kilobit per second) - - - <number>%% - Percentage of overall rate - + Class ID - <number>bit - bit(1), kbit(10^3), mbit(10^6), gbit, tbit - - - <number>ibit - kibit(1024), mibit(1024^2), gibit(1024^3), tbit(1024^4) - - - <number>ibps - kibps(1024*8), mibps(1024^2*8), gibps, tibps - Byte/sec - - - <number>bps - bps(8),kbps(8*10^3),mbps(8*10^6), gbps, tbps - Byte/sec + u32:1-4095 + Class Identifier + + + + Class identifier must be between 1 and 4095 + + + #include + + + Linkshare class settings + + + #include + #include + #include + + + #include + + + Realtime class settings + + + #include + #include + #include + + + + + Upperlimit class settings + + + #include + #include + #include + + + + + + + Default policy + + + + Linkshare class settings + + + #include + #include + #include + + + + + Realtime class settings + + + #include + #include + #include + + + + + Upperlimit class settings + + + #include + #include + #include + + + + + + + + + Traffic shaping based policy (Hierarchy Token Bucket) + + txt + Policy name + + + [[:alnum:]][-_[:alnum:]]* + + Only alpha-numeric policy name allowed + + + #include + + auto - #include - #include - #include - #include - + - Priority for usage of excess bandwidth + Class ID - u32:0-7 - Priority order for bandwidth pool + u32:2-4095 + Class Identifier - + - Priority must be between 0 and 7 + Class identifier must be between 2 and 4095 - 20 - - #include - #include - #include - #include + + #include + + 100% + + #include + + + Bandwidth limit for this class + + <number> + Rate in kbit (kilobit per second) + + + <number>%% + Percentage of overall rate + + + <number>bit + bit(1), kbit(10^3), mbit(10^6), gbit, tbit + + + <number>ibit + kibit(1024), mibit(1024^2), gibit(1024^3), tbit(1024^4) + + + <number>ibps + kibps(1024*8), mibps(1024^2*8), gibps, tibps - Byte/sec + + + <number>bps + bps(8),kbps(8*10^3),mbps(8*10^6), gbps, tbps - Byte/sec + + + + #include + #include + #include + #include + #include + + + Priority for usage of excess bandwidth + + u32:0-7 + Priority order for bandwidth pool + + + + + Priority must be between 0 and 7 + + 20 + + #include + #include + #include + #include + + + #include + + + Default policy + + + #include + #include + + + Bandwidth limit for this class + + <number> + Rate in kbit (kilobit per second) + + + <number>%% + Percentage of overall rate + + + <number>bit + bit(1), kbit(10^3), mbit(10^6), gbit, tbit + + + <number>ibit + kibit(1024), mibit(1024^2), gibit(1024^3), tbit(1024^4) + + + <number>ibps + kibps(1024*8), mibps(1024^2*8), gibps, tibps - Byte/sec + + + <number>bps + bps(8),kbps(8*10^3),mbps(8*10^6), gbps, tbps - Byte/sec + + + + #include + #include + #include + #include + + + Priority for usage of excess bandwidth + + u32:0-7 + Priority order for bandwidth pool + + + + + Priority must be between 0 and 7 + + 20 + + #include + #include + #include + #include + + - + - + diff --git a/src/conf_mode/qos.py b/src/conf_mode/qos.py index cf447d4b5..dbe3be225 100755 --- a/src/conf_mode/qos.py +++ b/src/conf_mode/qos.py @@ -28,36 +28,33 @@ def get_config(config=None): conf = config else: conf = Config() - base = ['traffic-policy'] + base = ['qos'] if not conf.exists(base): return None qos = conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True) - for traffic_policy in ['drop-tail', 'fair-queue', 'fq-codel', 'limiter', - 'network-emulator', 'priority-queue', 'random-detect', - 'rate-control', 'round-robin', 'shaper', 'shaper-hfsc']: - traffic_policy_us = traffic_policy.replace('-','_') - # Individual policy type not present on CLI - no need to blend in - # any default values - if traffic_policy_us not in qos: - continue - - default_values = defaults(base + [traffic_policy_us]) - - # class is another tag node which requires individual handling - class_default_values = defaults(base + [traffic_policy_us, 'class']) - if 'class' in default_values: - del default_values['class'] - - for policy, policy_config in qos[traffic_policy_us].items(): - qos[traffic_policy_us][policy] = dict_merge( - default_values, qos[traffic_policy_us][policy]) - - if 'class' in policy_config: - for policy_class in policy_config['class']: - qos[traffic_policy_us][policy]['class'][policy_class] = dict_merge( - class_default_values, qos[traffic_policy_us][policy]['class'][policy_class]) + if 'policy' in qos: + for policy in qos['policy']: + # CLI mangles - to _ for better Jinja2 compatibility - do we need + # Jinja2 here? + policy = policy.replace('-','_') + + default_values = defaults(base + ['policy', policy]) + + # class is another tag node which requires individual handling + class_default_values = defaults(base + ['policy', policy, 'class']) + if 'class' in default_values: + del default_values['class'] + + for p_name, p_config in qos['policy'][policy].items(): + qos['policy'][policy][p_name] = dict_merge( + default_values, qos['policy'][policy][p_name]) + + if 'class' in p_config: + for p_class in p_config['class']: + qos['policy'][policy][p_name]['class'][p_class] = dict_merge( + class_default_values, qos['policy'][policy][p_name]['class'][p_class]) import pprint pprint.pprint(qos) -- cgit v1.2.3