From 56880bec43eef6af8301cdfbe9c764b4257bd24b Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 19 Dec 2007 15:27:04 -0800 Subject: * add completion help/value check. * fix show command. --- scripts/vyatta-show-nat.pl | 2 +- .../nat/rule/node.tag/inbound-interface/node.def | 5 +-- .../nat/rule/node.tag/outbound-interface/node.def | 5 +-- .../service/nat/rule/node.tag/protocols/node.def | 5 +++ .../service/nat/rule/node.tag/type/node.def | 7 +++- xsl/url-decode.xsl | 48 ++++++++++++++++++++++ 6 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 xsl/url-decode.xsl diff --git a/scripts/vyatta-show-nat.pl b/scripts/vyatta-show-nat.pl index 5ae67b8..bb25500 100755 --- a/scripts/vyatta-show-nat.pl +++ b/scripts/vyatta-show-nat.pl @@ -32,7 +32,7 @@ while () { } close STATS; -open(RENDER, "| /opt/vyatta/libexec/xorp/render_xml $xsl_file") or exit 1; +open(RENDER, "| /opt/vyatta/sbin/render_xml $xsl_file") or exit 1; # begin print RENDER "\n"; diff --git a/templates-cfg/service/nat/rule/node.tag/inbound-interface/node.def b/templates-cfg/service/nat/rule/node.tag/inbound-interface/node.def index c87d281..533a592 100644 --- a/templates-cfg/service/nat/rule/node.tag/inbound-interface/node.def +++ b/templates-cfg/service/nat/rule/node.tag/inbound-interface/node.def @@ -1,5 +1,4 @@ type: txt help: "Inbound interface of NAT traffic" -## iptables allow any interface names. -#syntax: exec "sh -c 'if grep -q '\\''^ \\+$(@):'\\'' /proc/net/dev; \ -#then exit 0; else exit 1; fi' " ; "invalid interface $(@)" +#allowed: ls /sys/class/net 2>/dev/null +#comp_help:Enter a network interface name, for example, "eth0" diff --git a/templates-cfg/service/nat/rule/node.tag/outbound-interface/node.def b/templates-cfg/service/nat/rule/node.tag/outbound-interface/node.def index bf3e8a2..096629f 100644 --- a/templates-cfg/service/nat/rule/node.tag/outbound-interface/node.def +++ b/templates-cfg/service/nat/rule/node.tag/outbound-interface/node.def @@ -1,5 +1,4 @@ type: txt help: "Outbound interface for NAT traffic" -## iptables allow any interface names. -#syntax: exec "sh -c 'if grep -q '\\''^ \\+$(@):'\\'' /proc/net/dev; \ -#then exit 0; else exit 1; fi' " ; "invalid interface $(@)" +#allowed: ls /sys/class/net 2>/dev/null +#comp_help:Enter a network interface name, for example, "eth0" diff --git a/templates-cfg/service/nat/rule/node.tag/protocols/node.def b/templates-cfg/service/nat/rule/node.tag/protocols/node.def index 75ccb86..619fad9 100644 --- a/templates-cfg/service/nat/rule/node.tag/protocols/node.def +++ b/templates-cfg/service/nat/rule/node.tag/protocols/node.def @@ -1,3 +1,8 @@ type: txt help: "Protocol to NAT (this can be a protocol name in /etc/protocols, a protocol number, or \"all\")" syntax: exec "/opt/vyatta/sbin/vyatta-validate-type.pl protocol_negate '$(@)'" ; "invalid protocol \"$(@)\"" +#comp_help:Possible completions: +# A protocol name, for example, "tcp" +# A protocol number +# all All protocols +#(Note: a protocol can also be negated, for example, "!tcp") diff --git a/templates-cfg/service/nat/rule/node.tag/type/node.def b/templates-cfg/service/nat/rule/node.tag/type/node.def index 9df10a9..831dd3b 100644 --- a/templates-cfg/service/nat/rule/node.tag/type/node.def +++ b/templates-cfg/service/nat/rule/node.tag/type/node.def @@ -1,4 +1,7 @@ type: txt help: "Source, destination, or masquerade NAT" -syntax: ($(@) == "source" || $(@) == "destination" || $(@) == "masquerade") ; \ -"invalid type $(@)" +syntax: $(@) in "source", "destination", "masquerade"; "invalid type $(@)" +#comp_help:Possible completions: +# source Source NAT +# destination Destination NAT +# masquerade Masquerade NAT diff --git a/xsl/url-decode.xsl b/xsl/url-decode.xsl new file mode 100644 index 0000000..6e3db40 --- /dev/null +++ b/xsl/url-decode.xsl @@ -0,0 +1,48 @@ + + + + + + + + + + + + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +  ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + + + + + + + + + + + + + + + + + + ? + + + + + + + + + + + + -- cgit v1.2.3