summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-07-21 21:23:49 +0200
committerChristian Breunig <christian@breunig.cc>2023-07-21 21:57:32 +0200
commit9e5d0384a0b25949edfd0dfc065b6fe572f943e7 (patch)
treecbfac148f777d0dd97bda2b4b58db38f03c1cd02
parent52830ddfad973ff8acac48cc1ce57af655d9ed5a (diff)
downloadvyos-1x-9e5d0384a0b25949edfd0dfc065b6fe572f943e7.tar.gz
vyos-1x-9e5d0384a0b25949edfd0dfc065b6fe572f943e7.zip
ospf: T5377: add "capability opaque" support
-rw-r--r--data/templates/frr/ospfd.frr.j23
-rw-r--r--interface-definitions/include/ospf/protocol-common-config.xml.i13
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_ospf.py2
3 files changed, 18 insertions, 0 deletions
diff --git a/data/templates/frr/ospfd.frr.j2 b/data/templates/frr/ospfd.frr.j2
index 121ecf677..040628e82 100644
--- a/data/templates/frr/ospfd.frr.j2
+++ b/data/templates/frr/ospfd.frr.j2
@@ -133,6 +133,9 @@ router ospf {{ 'vrf ' ~ vrf if vrf is vyos_defined }}
{% if auto_cost.reference_bandwidth is vyos_defined %}
auto-cost reference-bandwidth {{ auto_cost.reference_bandwidth }}
{% endif %}
+{% if capability.opaque is vyos_defined %}
+ capability opaque
+{% endif %}
{% if default_information.originate is vyos_defined %}
default-information originate {{ 'always' if default_information.originate.always is vyos_defined }} {{ 'metric ' + default_information.originate.metric if default_information.originate.metric is vyos_defined }} {{ 'metric-type ' + default_information.originate.metric_type if default_information.originate.metric_type is vyos_defined }} {{ 'route-map ' + default_information.originate.route_map if default_information.originate.route_map is vyos_defined }}
{% endif %}
diff --git a/interface-definitions/include/ospf/protocol-common-config.xml.i b/interface-definitions/include/ospf/protocol-common-config.xml.i
index 438093222..c4778e126 100644
--- a/interface-definitions/include/ospf/protocol-common-config.xml.i
+++ b/interface-definitions/include/ospf/protocol-common-config.xml.i
@@ -326,6 +326,19 @@
</children>
</tagNode>
#include <include/ospf/auto-cost.xml.i>
+<node name="capability">
+ <properties>
+ <help>Enable specific OSPF features</help>
+ </properties>
+ <children>
+ <leafNode name="opaque">
+ <properties>
+ <help>Opaque LSA</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ </children>
+</node>
#include <include/ospf/default-information.xml.i>
<leafNode name="default-metric">
<properties>
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py
index f4b540694..80befbfd6 100755
--- a/smoketest/scripts/cli/test_protocols_ospf.py
+++ b/smoketest/scripts/cli/test_protocols_ospf.py
@@ -484,6 +484,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
supported_grace_time = '400'
router_ids = ['192.0.2.1', '192.0.2.2']
+ self.cli_set(base_path + ['capability', 'opaque'])
self.cli_set(base_path + ['graceful-restart', 'grace-period', period])
self.cli_set(base_path + ['graceful-restart', 'helper', 'planned-only'])
self.cli_set(base_path + ['graceful-restart', 'helper', 'no-strict-lsa-checking'])
@@ -497,6 +498,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
# Verify FRR ospfd configuration
frrconfig = self.getFRRconfig('router ospf')
self.assertIn(f'router ospf', frrconfig)
+ self.assertIn(f' capability opaque', frrconfig)
self.assertIn(f' graceful-restart grace-period {period}', frrconfig)
self.assertIn(f' graceful-restart helper planned-only', frrconfig)
self.assertIn(f' no graceful-restart helper strict-lsa-checking', frrconfig)