From 24b46144a00f1346b0c983884e3f11b91b0c4379 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 5 Feb 2008 16:53:46 -0800 Subject: add validation for policy names, and policy update/delete Check names of policys for syntax and uniqueness. Add hooks for update that does refresh of interface (should fix bug). Block deletion of policy that is in use. --- templates/interfaces/ethernet/node.tag/qos-policy/out/node.def | 4 ++-- templates/qos-policy/fair-queue/node.def | 6 ++++-- templates/qos-policy/traffic-shaper/node.def | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/interfaces/ethernet/node.tag/qos-policy/out/node.def b/templates/interfaces/ethernet/node.tag/qos-policy/out/node.def index 20ecd5e..c8f875f 100644 --- a/templates/interfaces/ethernet/node.tag/qos-policy/out/node.def +++ b/templates/interfaces/ethernet/node.tag/qos-policy/out/node.def @@ -1,4 +1,4 @@ type: txt help: Set outbound QOS policy -update:expression: "/opt/vyatta/sbin/vyatta-qos.pl --update $VAR(../../@) out $VAR(@)" -delete:expression: "/opt/vyatta/sbin/vyatta-qos.pl --delete $VAR(../../@) out" +update:expression: "/opt/vyatta/sbin/vyatta-qos.pl --update-interface $VAR(../../@) $VAR(../@) $VAR(@)" +delete:expression: "/opt/vyatta/sbin/vyatta-qos.pl --delete-interface $VAR(../../@) $VAR(../@)" diff --git a/templates/qos-policy/fair-queue/node.def b/templates/qos-policy/fair-queue/node.def index 304e0d4..3ec844e 100644 --- a/templates/qos-policy/fair-queue/node.def +++ b/templates/qos-policy/fair-queue/node.def @@ -1,4 +1,6 @@ tag: type: txt -syntax:expression: pattern $VAR(@) "^[^-]" ; "Qos queue name cannot start with \"-\"" -help: Configure fair queueing based policy +help: Configure fair queueing policy +syntax:expression: exec " /opt/vyatta/sbin/vyatta-qos.pl --validate-name $VAR(@)" +update:expression: "/opt/vyatta/sbin/vyatta-qos.pl --update-policy $VAR(../@) $VAR(@)" +delete:expression: "/opt/vyatta/sbin/vyatta-qos.pl --delete-policy $VAR(@)" diff --git a/templates/qos-policy/traffic-shaper/node.def b/templates/qos-policy/traffic-shaper/node.def index 38d72d2..afb77bd 100644 --- a/templates/qos-policy/traffic-shaper/node.def +++ b/templates/qos-policy/traffic-shaper/node.def @@ -1,4 +1,6 @@ tag: type: txt -syntax:expression: pattern $VAR(@) "^[^-]" ; "Qos queue name cannot start with \"-\"" help: Configure traffic shaping based policy +syntax:expression: exec " /opt/vyatta/sbin/vyatta-qos.pl --validate-name $VAR(@)" +update:expression: "/opt/vyatta/sbin/vyatta-qos.pl --update-policy $VAR(../@) $VAR(@)" +delete:expression: "/opt/vyatta/sbin/vyatta-qos.pl --delete-policy $VAR(@)" -- cgit v1.2.3