From 869d864c2a5c82703230c317ab6119c47ad7b618 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 12 Apr 2014 08:12:51 -0700 Subject: Bug #170: Add address, disable, and description options. --- templates/interfaces/l2tpv3/node.tag/address/node.def | 12 ++++++++++++ templates/interfaces/l2tpv3/node.tag/description/node.def | 8 ++++++++ templates/interfaces/l2tpv3/node.tag/disable/node.def | 4 ++++ 3 files changed, 24 insertions(+) create mode 100644 templates/interfaces/l2tpv3/node.tag/address/node.def create mode 100644 templates/interfaces/l2tpv3/node.tag/description/node.def create mode 100644 templates/interfaces/l2tpv3/node.tag/disable/node.def diff --git a/templates/interfaces/l2tpv3/node.tag/address/node.def b/templates/interfaces/l2tpv3/node.tag/address/node.def new file mode 100644 index 00000000..04612379 --- /dev/null +++ b/templates/interfaces/l2tpv3/node.tag/address/node.def @@ -0,0 +1,12 @@ +multi: +type: ipv4net,ipv6net +val_help: ipv4net; IPv4 address and prefix length +val_help: ipv6net; IPv6 address and prefix length +help: IP address + +syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" + +create: sudo /opt/vyatta/sbin/vyatta-address add $VAR(../@) $VAR(@) + +delete: sudo /opt/vyatta/sbin/vyatta-address delete $VAR(../@) $VAR(@) + diff --git a/templates/interfaces/l2tpv3/node.tag/description/node.def b/templates/interfaces/l2tpv3/node.tag/description/node.def new file mode 100644 index 00000000..c6d2789d --- /dev/null +++ b/templates/interfaces/l2tpv3/node.tag/description/node.def @@ -0,0 +1,8 @@ +type: txt +help: Description + +syntax:expression: pattern $VAR(@) "^.{1,256}$" \ + ; "interface description is too long (limit 256 characters)" + +update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../@)/ifalias" +delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" diff --git a/templates/interfaces/l2tpv3/node.tag/disable/node.def b/templates/interfaces/l2tpv3/node.tag/disable/node.def new file mode 100644 index 00000000..26199646 --- /dev/null +++ b/templates/interfaces/l2tpv3/node.tag/disable/node.def @@ -0,0 +1,4 @@ +help: Disable interface +update: ip link set $VAR(../@) down + +delete: ip link set $VAR(../@) up -- cgit v1.2.3