summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2021-05-31 12:08:48 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2021-06-06 00:14:10 +0200
commitb3bce6497cc20cad687efc818d679d71d62fbd26 (patch)
tree67ccbd191f824de18d8b39f0694c040c65e38e78 /data
parent77866ccb16194a2446b2faccb52ec852aa882b96 (diff)
downloadvyos-1x-b3bce6497cc20cad687efc818d679d71d62fbd26.tar.gz
vyos-1x-b3bce6497cc20cad687efc818d679d71d62fbd26.zip
nhrp: T3599: Migrate NHRP to XML/Python
Diffstat (limited to 'data')
-rw-r--r--data/configd-include.json1
-rw-r--r--data/templates/nhrp/opennhrp.conf.tmpl41
2 files changed, 42 insertions, 0 deletions
diff --git a/data/configd-include.json b/data/configd-include.json
index 28267d575..d25fa3de7 100644
--- a/data/configd-include.json
+++ b/data/configd-include.json
@@ -39,6 +39,7 @@
"protocols_igmp.py",
"protocols_isis.py",
"protocols_mpls.py",
+"protocols_nhrp.py",
"protocols_ospf.py",
"protocols_ospfv3.py",
"protocols_pim.py",
diff --git a/data/templates/nhrp/opennhrp.conf.tmpl b/data/templates/nhrp/opennhrp.conf.tmpl
new file mode 100644
index 000000000..308459407
--- /dev/null
+++ b/data/templates/nhrp/opennhrp.conf.tmpl
@@ -0,0 +1,41 @@
+# Created by VyOS - manual changes will be overwritten
+
+{% if tunnel is defined %}
+{% for name, tunnel_conf in tunnel.items() %}
+{% set type = 'spoke' if 'map' in tunnel_conf or 'dynamic_map' in tunnel_conf else 'hub' %}
+{% set profile_name = profile_map[name] if profile_map is defined and name in profile_map else '' %}
+interface {{ name }} #{{ type }} {{ profile_name }}
+{% if 'map' in tunnel_conf %}
+{% for map, map_conf in tunnel_conf.map.items() %}
+{% set cisco = ' cisco' if 'cisco' in map_conf else '' %}
+{% set register = ' register' if 'register' in map_conf else '' %}
+ map {{ map }} {{ map_conf.nbma_address }}{{ register }}{{ cisco }}
+{% endfor %}
+{% endif %}
+{% if 'dynamic_map' in tunnel_conf %}
+{% for map, map_conf in tunnel_conf.dynamic_map.items() %}
+ dynamic-map {{ map }} {{ map_conf.nbma_domain_name }}
+{% endfor %}
+{% endif %}
+{% if 'cisco_authentication' in tunnel_conf %}
+ cisco-authentication {{ tunnel_conf.cisco_authentication }}
+{% endif %}
+{% if 'holding_time' in tunnel_conf %}
+ holding-time {{ tunnel_conf.holding_time }}
+{% endif %}
+{% if 'multicast' in tunnel_conf %}
+ multicast {{ tunnel_conf.multicast }}
+{% endif %}
+{% for key in ['non_caching', 'redirect', 'shortcut', 'shortcut_destination'] %}
+{% if key in tunnel_conf %}
+ {{ key | replace("_", "-") }}
+{% endif %}
+{% endfor %}
+{% if 'shortcut_target' in tunnel_conf %}
+{% for target, shortcut_conf in tunnel_conf.shortcut_target.items() %}
+ shortcut-target {{ target }} {{ shortcut_conf.holding_time if 'holding_time' in shortcut_conf else '' }}
+{% endfor %}
+{% endif %}
+
+{% endfor %}
+{% endif %}