diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-25 14:15:44 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-25 14:15:44 -0700 |
commit | eedd04171ff3c6017e52830e8e07ec437e1c6663 (patch) | |
tree | 2e6be92570d53c1e134c806e3de7e0477b11c017 /interface-templates/ip/ospf | |
parent | 82b2f6abc7b3b5e3164675c28a27506b39eeb9a7 (diff) | |
download | vyatta-cfg-quagga-eedd04171ff3c6017e52830e8e07ec437e1c6663.tar.gz vyatta-cfg-quagga-eedd04171ff3c6017e52830e8e07ec437e1c6663.zip |
Generate interface templates as part of build
Rather than 100's of copies of the same template, use the same
process as the firewall module to generate the templates.
For this, the are meta-templates in interface-templates directory
which get processed and $IFNAME is replaced by the appropriate CLI
syntax to refer back to the directory name. Changing a quagga
template in most cases can be done by fixing the meta-template.
Diffstat (limited to 'interface-templates/ip/ospf')
16 files changed, 119 insertions, 0 deletions
diff --git a/interface-templates/ip/ospf/authentication/md5/key-id/node.def b/interface-templates/ip/ospf/authentication/md5/key-id/node.def new file mode 100644 index 00000000..630bd3f0 --- /dev/null +++ b/interface-templates/ip/ospf/authentication/md5/key-id/node.def @@ -0,0 +1,16 @@ +tag: +type: u32 +help: Set MD5 key id +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between (1-255)" +commit:expression: $VAR(md5-key/) != ""; "Must add the md5-key for key-id $VAR(@)" +delete:touch /tmp/ospf-md5.$PPID + +end: if [ -f /tmp/ospf-md5.$PPID ] + then vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "no ip ospf message-digest-key $VAR(@)" + rm /tmp/ospf-md5.$PPID \ + else vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "ip ospf message-digest-key $VAR(@) md5 $VAR(md5-key/@)" + fi +comp_help: possible completions: + <1-255> Set the key id diff --git a/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/md5-key/node.def b/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/md5-key/node.def new file mode 100644 index 00000000..5efd3ef7 --- /dev/null +++ b/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/md5-key/node.def @@ -0,0 +1,9 @@ +type: txt +help: Set md5 key +syntax:expression: exec " \ + if [ `echo -n '$VAR(@)' | wc -c` -gt 16 ]; then \ + echo MD5 key must be 16 characters or less ; \ + exit 1 ; \ + fi ; " +comp_help: possible completions: + <text> MD5 Key (16 characters or less) diff --git a/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/node.def b/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/node.def new file mode 100644 index 00000000..d14a2583 --- /dev/null +++ b/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/node.def @@ -0,0 +1 @@ +help: Set md5 key diff --git a/interface-templates/ip/ospf/authentication/md5/node.def b/interface-templates/ip/ospf/authentication/md5/node.def new file mode 100644 index 00000000..9389c838 --- /dev/null +++ b/interface-templates/ip/ospf/authentication/md5/node.def @@ -0,0 +1,5 @@ +help: Set MD5 key id +update:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "no ip ospf authentication" -c "ip ospf authentication message-digest" +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" + -c "no ip ospf authentication" diff --git a/interface-templates/ip/ospf/authentication/node.def b/interface-templates/ip/ospf/authentication/node.def new file mode 100644 index 00000000..ff352a01 --- /dev/null +++ b/interface-templates/ip/ospf/authentication/node.def @@ -0,0 +1,2 @@ +help: Set OSPF interface authentication + diff --git a/interface-templates/ip/ospf/authentication/plaintext-password/node.def b/interface-templates/ip/ospf/authentication/plaintext-password/node.def new file mode 100644 index 00000000..4b31f0d8 --- /dev/null +++ b/interface-templates/ip/ospf/authentication/plaintext-password/node.def @@ -0,0 +1,10 @@ +type: txt +help: Configure plain text password +syntax:expression: pattern $VAR(@) "^[^[:space:]]{1,8}$" ; "Password must be 8 characters or less" +update:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "no ip ospf authentication " -c "ip ospf authentication " \ + -c "ip ospf authentication-key $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "no ip ospf authentication " -c "no ip ospf authentication-key" +comp_help: possible completions: + <text> Plain text password (8 characters or less) diff --git a/interface-templates/ip/ospf/bandwidth/node.def b/interface-templates/ip/ospf/bandwidth/node.def new file mode 100644 index 00000000..1f77079f --- /dev/null +++ b/interface-templates/ip/ospf/bandwidth/node.def @@ -0,0 +1,7 @@ +type: u32 +help: Set bandwidth for specified interface (kilobits/sec) +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 10000000; "Must be between 1-10000000" +update: vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "bandwidth $VAR(@)" +delete: vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "no bandwidth" +comp_help: possible completions: + <1-10000000> Set bandwidth in kilobits/sec (for calculating OSPF cost) diff --git a/interface-templates/ip/ospf/cost/node.def b/interface-templates/ip/ospf/cost/node.def new file mode 100644 index 00000000..da8b545e --- /dev/null +++ b/interface-templates/ip/ospf/cost/node.def @@ -0,0 +1,11 @@ +type: u32 +help: Set interface cost +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" +update:vyatta-vtysh -c "configure terminal" \ + -c "interface $IFNAME" \ + -c "ip ospf cost $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" \ + -c "interface $IFNAME" \ + -c "no ip ospf cost" +comp_help: possible completions: + <1-65535> Set Cost diff --git a/interface-templates/ip/ospf/dead-interval/node.def b/interface-templates/ip/ospf/dead-interval/node.def new file mode 100644 index 00000000..72988f9c --- /dev/null +++ b/interface-templates/ip/ospf/dead-interval/node.def @@ -0,0 +1,8 @@ +type: u32 +help: Set interval after which a neighbor is declared dead +default: 40 +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" +update:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "ip ospf dead-interval $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ip ospf dead-interval "; " +comp_help: possible completions: + <1-65535> Seconds (default 40) diff --git a/interface-templates/ip/ospf/hello-interval/node.def b/interface-templates/ip/ospf/hello-interval/node.def new file mode 100644 index 00000000..9da68fb1 --- /dev/null +++ b/interface-templates/ip/ospf/hello-interval/node.def @@ -0,0 +1,8 @@ +type: u32 +help: Set interval between hello packets +default: 10 +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" +update:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "ip ospf hello-interval $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ip ospf hello-interval" +comp_help: possible completions: + <1-65535> Seconds (default 10) diff --git a/interface-templates/ip/ospf/mtu-ignore/node.def b/interface-templates/ip/ospf/mtu-ignore/node.def new file mode 100644 index 00000000..e2c897e7 --- /dev/null +++ b/interface-templates/ip/ospf/mtu-ignore/node.def @@ -0,0 +1,3 @@ +help: Disable Maximum Transmission Unit (MTU) mismatch detection +create:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "ip ospf mtu-ignore" +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ip ospf mtu-ignore" diff --git a/interface-templates/ip/ospf/network/node.def b/interface-templates/ip/ospf/network/node.def new file mode 100644 index 00000000..bac9d333 --- /dev/null +++ b/interface-templates/ip/ospf/network/node.def @@ -0,0 +1,11 @@ +type: txt +help: Set network type +syntax:expression: $VAR(@) in "broadcast", "non-broadcast", "point-to-multipoint", "point-to-point"; \ + "Must be (broadcast|non-broadcast|point-to-multipoint|point-to-point)" +update:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "ip ospf network $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ip ospf network" +comp_help: possible completions: + broadcast Set broadcast network type + non-broadcast Set non-broadcast network type + point-to-multipoint Set point-to-multipoint network type + point-to-point Set point-to-point network type diff --git a/interface-templates/ip/ospf/node.def b/interface-templates/ip/ospf/node.def new file mode 100644 index 00000000..31980774 --- /dev/null +++ b/interface-templates/ip/ospf/node.def @@ -0,0 +1,2 @@ +help: Set Open Shortest Path First (OSPF) parameters for specified interface +create: sudo /opt/vyatta/sbin/quagga-manager check ospfd diff --git a/interface-templates/ip/ospf/priority/node.def b/interface-templates/ip/ospf/priority/node.def new file mode 100644 index 00000000..152cff9a --- /dev/null +++ b/interface-templates/ip/ospf/priority/node.def @@ -0,0 +1,8 @@ +type: u32 +help: Set router priority +default: 1 +syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 255; "Must be between 0-255" +update:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "ip ospf priority $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ip ospf priority " +comp_help: possible completions: + <0-255> Priority (default 1) diff --git a/interface-templates/ip/ospf/retransmit-interval/node.def b/interface-templates/ip/ospf/retransmit-interval/node.def new file mode 100644 index 00000000..41dbe810 --- /dev/null +++ b/interface-templates/ip/ospf/retransmit-interval/node.def @@ -0,0 +1,10 @@ +type: u32 +help: Set interval between retransmitting lost link state advertisements +default: 5 +syntax:expression: $VAR(@) >= 3 && $VAR(@) <= 65535; "Must be between 3-65535" +update: vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "ip ospf retransmit-interval $VAR(@)" +delete: vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "no ip ospf retransmit-interval" +comp_help: possible completions: + <3-65535> Seconds (default 5) diff --git a/interface-templates/ip/ospf/transmit-delay/node.def b/interface-templates/ip/ospf/transmit-delay/node.def new file mode 100644 index 00000000..761424da --- /dev/null +++ b/interface-templates/ip/ospf/transmit-delay/node.def @@ -0,0 +1,8 @@ +type: u32 +help: Set link state transmit delay +default: 1 +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" +update:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "ip ospf transmit-delay $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ip ospf transmit-delay" +comp_help: possible completions: + <1-65535> Seconds (default 1) |