summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/ethernet/node.tag/disable-link-detect/node.def9
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/disable-link-detect/node.def10
-rw-r--r--templates/interfaces/multilink/node.tag/vif/node.tag/disable-link-detect/node.def9
-rw-r--r--templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/disable-link-detect/node.def9
-rw-r--r--templates/interfaces/serial/node.tag/disable-link-detect/node.def7
-rw-r--r--templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/disable-link-detect/node.def9
-rw-r--r--templates/interfaces/serial/node.tag/ppp/vif/node.tag/disable-link-detect/node.def9
-rw-r--r--templates/protocols/static/arp/node.def43
-rw-r--r--templates/protocols/static/arp/node.tag/hwaddr/node.def7
9 files changed, 64 insertions, 48 deletions
diff --git a/templates/interfaces/ethernet/node.tag/disable-link-detect/node.def b/templates/interfaces/ethernet/node.tag/disable-link-detect/node.def
index d4b4ceaa..22eec7cf 100644
--- a/templates/interfaces/ethernet/node.tag/disable-link-detect/node.def
+++ b/templates/interfaces/ethernet/node.tag/disable-link-detect/node.def
@@ -1,8 +1,3 @@
help: Set to ignore link state changes on this interface
-update:vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../@)" \
- -c "no link-detect"
-delete:vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../@)" \
- -c "link-detect"
-
+update:vyatta-link-detect $VAR(../@) on
+delete:vyatta-link-detect $VAR(../@) off
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable-link-detect/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable-link-detect/node.def
index 250c9a41..97a74ccc 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable-link-detect/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable-link-detect/node.def
@@ -1,9 +1,3 @@
help: Set to ignore link state changes on this interface
-update:vyatta-vtysh -c "configure terminal\" \
- -c "interface $VAR(../../@).$VAR(../@)" \
- -c "no link-detect"
-
-delete:vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../@).$VAR(../@)" \
- -c "link-detect"
-
+update:vyatta-link-detect "$VAR(../../@).$VAR(../@)" on
+delete:vyatta-link-detect "$VAR(../../@).$VAR(../@)" off
diff --git a/templates/interfaces/multilink/node.tag/vif/node.tag/disable-link-detect/node.def b/templates/interfaces/multilink/node.tag/vif/node.tag/disable-link-detect/node.def
index ed220d3d..4cd557d9 100644
--- a/templates/interfaces/multilink/node.tag/vif/node.tag/disable-link-detect/node.def
+++ b/templates/interfaces/multilink/node.tag/vif/node.tag/disable-link-detect/node.def
@@ -1,8 +1,3 @@
help: ignore link state changes on this interface
-update: vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../@).$VAR(../@)" \
- -c "no link-detect"
-delete: vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../@).$VAR(../@)" \
- -c "link-detect"
-
+update:vyatta-link-detect "$VAR(../../@).$VAR(../@)" on
+delete:vyatta-link-detect "$VAR(../../@).$VAR(../@)" off
diff --git a/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/disable-link-detect/node.def b/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/disable-link-detect/node.def
index 0bf660e1..7992791f 100644
--- a/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/disable-link-detect/node.def
+++ b/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/disable-link-detect/node.def
@@ -1,8 +1,3 @@
help: ignore link state changes on this interface
-update: vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../../@).$VAR(../@)" \
- -c "no link-detect"
-delete: vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../../@).$VAR(../@)" \
- -c "link-detect"
-
+update:vyatta-link-detect "$VAR(../../../@).$VAR(../@)" on
+delete:vyatta-link-detect "$VAR(../../../@).$VAR(../@)" off
diff --git a/templates/interfaces/serial/node.tag/disable-link-detect/node.def b/templates/interfaces/serial/node.tag/disable-link-detect/node.def
index 2fc84bdd..03317ea1 100644
--- a/templates/interfaces/serial/node.tag/disable-link-detect/node.def
+++ b/templates/interfaces/serial/node.tag/disable-link-detect/node.def
@@ -1,6 +1,3 @@
help: ignore link state changes on this interface
-update: vyatta-vtysh -c "configure terminal" -c "interface $VAR(../@)" \
- -c "no link-detect"
-delete: vyatta-vtysh -c "configure terminal" -c "interface $VAR(../@)" \
- -c "link-detect "
-
+update: vyatta-link-detect $VAR(../@) off
+delete: vyatta-link-detect $VAR(../@) on
diff --git a/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/disable-link-detect/node.def b/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/disable-link-detect/node.def
index 0bf660e1..7992791f 100644
--- a/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/disable-link-detect/node.def
+++ b/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/disable-link-detect/node.def
@@ -1,8 +1,3 @@
help: ignore link state changes on this interface
-update: vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../../@).$VAR(../@)" \
- -c "no link-detect"
-delete: vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../../@).$VAR(../@)" \
- -c "link-detect"
-
+update:vyatta-link-detect "$VAR(../../../@).$VAR(../@)" on
+delete:vyatta-link-detect "$VAR(../../../@).$VAR(../@)" off
diff --git a/templates/interfaces/serial/node.tag/ppp/vif/node.tag/disable-link-detect/node.def b/templates/interfaces/serial/node.tag/ppp/vif/node.tag/disable-link-detect/node.def
index 0bf660e1..94c73270 100644
--- a/templates/interfaces/serial/node.tag/ppp/vif/node.tag/disable-link-detect/node.def
+++ b/templates/interfaces/serial/node.tag/ppp/vif/node.tag/disable-link-detect/node.def
@@ -1,8 +1,3 @@
help: ignore link state changes on this interface
-update: vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../../@).$VAR(../@)" \
- -c "no link-detect"
-delete: vyatta-vtysh -c "configure terminal" \
- -c "interface $VAR(../../../@).$VAR(../@)" \
- -c "link-detect"
-
+update:vyatta-link-detect "$VAR(../../../@).$VAR(../@)" on
+delete:vyatta-link-detect "$VAR(../../@).$VAR(../@)" off
diff --git a/templates/protocols/static/arp/node.def b/templates/protocols/static/arp/node.def
new file mode 100644
index 00000000..cf028611
--- /dev/null
+++ b/templates/protocols/static/arp/node.def
@@ -0,0 +1,43 @@
+#
+# Vyatta configuration template for protocols.static.arp
+#
+# Author: Bob Gilligan (gilligan@vyatta.com)
+#
+
+tag:
+
+type: ipv4
+
+help: Set a static ARP translation
+
+comp_help: Possible completions:
+ <ipv4>\tIPv4 destination address
+
+#
+# All the work is done here in the "end:" tag. There are four possible cases:
+#
+# 1) A new node and possibly sub-tree with hwaddr has been created
+# 2) Value of hwaddr node in sub-tree has been changed
+# 3) The hwaddr node in sub-tree has been deleted
+# 4) This node (and hence entire sub-tree) has been deleted
+#
+# The flow is the same in all cases. First, we delete any
+# previous static ARP translation that may be in place for this
+# IP addr. This will typically fail in case (1) and in case (4) if the
+# hwaddr node had been previously deleted. Then, if a hwaddr is defined,
+# we add a new startic ARP translation for this IP addr pointing to that
+# hwaddr. This should always succeed, so we don't try to hide error
+# messages from the user.
+#
+# We always force a successful return in order to prevent transient
+# failures of the "arp" command from failing the commit.
+#
+end:
+ ipaddr=$VAR(@)
+ hwaddr=$VAR(hwaddr/@)
+
+ arp -d $ipaddr > /dev/null
+ if [ -n "$hwaddr" ]; then
+ arp -s $ipaddr $hwaddr
+ fi
+ exit 0 \ No newline at end of file
diff --git a/templates/protocols/static/arp/node.tag/hwaddr/node.def b/templates/protocols/static/arp/node.tag/hwaddr/node.def
new file mode 100644
index 00000000..a6677795
--- /dev/null
+++ b/templates/protocols/static/arp/node.tag/hwaddr/node.def
@@ -0,0 +1,7 @@
+type: macaddr
+
+help: Set hardware protocol (e.g. MAC) address to translate to
+
+comp_help: Possible completions:
+ <macaddr>\tHardware protocol (e.g. MAC) address to translate to
+