summaryrefslogtreecommitdiff
path: root/templates/interfaces
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-09-25 15:55:26 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-09-25 15:55:26 -0700
commite9a79a249cec69fc178098d2f75db9389068510a (patch)
tree0e366094b7fecd3988c243fbbb574015e0c900c8 /templates/interfaces
downloadvyatta-cfg-e9a79a249cec69fc178098d2f75db9389068510a.tar.gz
vyatta-cfg-e9a79a249cec69fc178098d2f75db9389068510a.zip
initial import (from eureka /cli) plus new build system.upstream
Diffstat (limited to 'templates/interfaces')
-rw-r--r--templates/interfaces/ethernet/node.def8
-rw-r--r--templates/interfaces/ethernet/node.tag/address/node.def5
-rw-r--r--templates/interfaces/ethernet/node.tag/description/node.def2
-rw-r--r--templates/interfaces/ethernet/node.tag/duplex/node.def6
-rw-r--r--templates/interfaces/ethernet/node.tag/enable/node.def3
-rw-r--r--templates/interfaces/ethernet/node.tag/hw-id/node.def2
-rw-r--r--templates/interfaces/ethernet/node.tag/mac/node.def4
-rw-r--r--templates/interfaces/ethernet/node.tag/mtu/node.def5
-rw-r--r--templates/interfaces/ethernet/node.tag/speed/node.def6
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.def7
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def5
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def2
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/enable/node.def3
-rw-r--r--templates/interfaces/loopback/node.def8
-rw-r--r--templates/interfaces/loopback/node.tag/address/node.def6
-rw-r--r--templates/interfaces/loopback/node.tag/description/node.def2
-rw-r--r--templates/interfaces/node.def1
17 files changed, 75 insertions, 0 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def
new file mode 100644
index 0000000..b5a320e
--- /dev/null
+++ b/templates/interfaces/ethernet/node.def
@@ -0,0 +1,8 @@
+tag:
+type: txt
+help: "Ethernet interface name"
+syntax: exec " \
+ if [ -z \"`ip addr | grep $(@) `\" ]; then \
+ echo ethernet interface $(@) doesn\\'t exist on this system ; \
+ exit 1 ; \
+ fi ; "
diff --git a/templates/interfaces/ethernet/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/address/node.def
new file mode 100644
index 0000000..41a0b06
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/address/node.def
@@ -0,0 +1,5 @@
+multi:
+type: ipv4net
+help: "Set IPv4 address and prefix for this interface"
+create: "ip addr add $(@) dev $(../@)"; "error setting address $(@) on dev $(../@)"
+delete: "ip addr del $(@) dev $(../@)"; "error deleting address $(@) on dev $(../@)"
diff --git a/templates/interfaces/ethernet/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/description/node.def
new file mode 100644
index 0000000..abd0a26
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/description/node.def
@@ -0,0 +1,2 @@
+type: txt
+help: "description for this interface"
diff --git a/templates/interfaces/ethernet/node.tag/duplex/node.def b/templates/interfaces/ethernet/node.tag/duplex/node.def
new file mode 100644
index 0000000..e15ef39
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/duplex/node.def
@@ -0,0 +1,6 @@
+type: txt
+help: "set the duplex for this interface"
+syntax: $(@) in "half", "full"; "duplex must be half or full"
+commit: $(../speed) != ""; "if duplex is hardcoded, speed must also be hardcoded"
+create: "ethtool -s $(../@) speed $(../speed/@) duplex $(@) autoneg off"
+delete: "ethtool -s $(../@) autoneg on"
diff --git a/templates/interfaces/ethernet/node.tag/enable/node.def b/templates/interfaces/ethernet/node.tag/enable/node.def
new file mode 100644
index 0000000..2b74d58
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/enable/node.def
@@ -0,0 +1,3 @@
+help: "enable interface"
+create: "ip link set $(../@) up"; "error enabling dev $(../@)"
+delete: "ip link set $(../@) down"; "error disabling dev $(../@)"
diff --git a/templates/interfaces/ethernet/node.tag/hw-id/node.def b/templates/interfaces/ethernet/node.tag/hw-id/node.def
new file mode 100644
index 0000000..6097cff
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/hw-id/node.def
@@ -0,0 +1,2 @@
+type: macaddr
+help: "set the original MAC address for this interface"
diff --git a/templates/interfaces/ethernet/node.tag/mac/node.def b/templates/interfaces/ethernet/node.tag/mac/node.def
new file mode 100644
index 0000000..41e4313
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/mac/node.def
@@ -0,0 +1,4 @@
+type: macaddr
+help: "set the MAC address for this interface"
+create: "ip link set $(../@) address $(@)"; "error setting MAC address on dev $(../@)"
+delete: "ip link set $(../@) address $(../hw-id/@)"; "error setting MAC address on dev $(../@) to $(../hw-id/@)"
diff --git a/templates/interfaces/ethernet/node.tag/mtu/node.def b/templates/interfaces/ethernet/node.tag/mtu/node.def
new file mode 100644
index 0000000..33b1238
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/mtu/node.def
@@ -0,0 +1,5 @@
+type: u32
+help: "set the MTU address for this interface"
+syntax: $(@) >= 1 && $(@) <= 1500; "MTU must be between 1 and 1500"
+create: "ip link set $(../@) mtu $(@)"; "error setting MAC address on dev $(../@)"
+delete: "ip link set $(../@) mtu 1500"; "error deleteing MAC address on dev $(../@)"
diff --git a/templates/interfaces/ethernet/node.tag/speed/node.def b/templates/interfaces/ethernet/node.tag/speed/node.def
new file mode 100644
index 0000000..6983355
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/speed/node.def
@@ -0,0 +1,6 @@
+type: txt
+help: "set the speed for this interface"
+syntax: $(@) in "10", "100", "1000"; "Speed must be 10, 100, or 1000"
+commit: $(../duplex/@) != ""; "if speed is hardcoded, duplex must also be hardcoded"
+create: "ethtool -s $(../@) speed $(@) duplex $(../duplex/@) autoneg off"
+delete: "ethtool -s $(../@) autoneg on"
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.def b/templates/interfaces/ethernet/node.tag/vif/node.def
new file mode 100644
index 0000000..06ee1c0
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.def
@@ -0,0 +1,7 @@
+tag:
+type: u32
+help: "vlan ID"
+syntax: $(@) >= 0 && $(@) <= 4095; "vlan ID must be between 0 and 4095"
+create: "modprobe 8021q"; "error loading 802.1q driver"
+create: "vconfig add $(../@) $(@)"; "error adding vlan id $(@) to dev $(../@)"
+delete: "vconfig rem $(../@) $(@)"; "error removing vlan id $(@) from dev $(../@)"
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def
new file mode 100644
index 0000000..345a29e
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def
@@ -0,0 +1,5 @@
+multi:
+type: ipv4net
+help: "Set IPv4 address and prefix for this interface"
+create: "ip addr add $(@) dev $(../../@)"; "error setting address $(@) on dev $(../../@)"
+delete: "ip addr del $(@) dev $(../../@)"; "error deleteing address $(@) on dev $(../../@)"
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def
new file mode 100644
index 0000000..abd0a26
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def
@@ -0,0 +1,2 @@
+type: txt
+help: "description for this interface"
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/enable/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/enable/node.def
new file mode 100644
index 0000000..1e1879f
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/enable/node.def
@@ -0,0 +1,3 @@
+help: "enable interface"
+create: "ip link set $(../../@) up"; "error enabling dev $(../../@)"
+delete: "ip link set $(../../@) down"; "error disabling dev $(../../@)"
diff --git a/templates/interfaces/loopback/node.def b/templates/interfaces/loopback/node.def
new file mode 100644
index 0000000..50df935
--- /dev/null
+++ b/templates/interfaces/loopback/node.def
@@ -0,0 +1,8 @@
+tag:
+type: txt
+help: "loopback interface name"
+syntax: exec " \
+ if [ -z \"`ip addr | grep $(@) `\" ]; then \
+ echo loopback interface $(@) doesn\\'t exist on this system ; \
+ exit 1 ; \
+ fi ; "
diff --git a/templates/interfaces/loopback/node.tag/address/node.def b/templates/interfaces/loopback/node.tag/address/node.def
new file mode 100644
index 0000000..2e7e106
--- /dev/null
+++ b/templates/interfaces/loopback/node.tag/address/node.def
@@ -0,0 +1,6 @@
+multi:
+type: ipv4net
+help: "Set IPv4 address and prefix for this interface"
+# TODO make sure 127.0.0.0/8 not in here.
+create: "ip addr add $(@) dev $(../@)"; "error setting address $(@) on dev $(../@)"
+delete: "ip addr del $(@) dev $(../@)"; "error deleteing address $(@) on dev $(../@)"
diff --git a/templates/interfaces/loopback/node.tag/description/node.def b/templates/interfaces/loopback/node.tag/description/node.def
new file mode 100644
index 0000000..abd0a26
--- /dev/null
+++ b/templates/interfaces/loopback/node.tag/description/node.def
@@ -0,0 +1,2 @@
+type: txt
+help: "description for this interface"
diff --git a/templates/interfaces/node.def b/templates/interfaces/node.def
new file mode 100644
index 0000000..297604a
--- /dev/null
+++ b/templates/interfaces/node.def
@@ -0,0 +1 @@
+help: "Network interface configuration"