Skip to content

Commit

Permalink
Adding initial traffic engineering work
Browse files Browse the repository at this point in the history
Adding initial traffic engineering work
  • Loading branch information
Cheeze_It committed Oct 19, 2024
1 parent 2ba5089 commit f409809
Show file tree
Hide file tree
Showing 5 changed files with 428 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/templates/frr/daemons.frr.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pbrd=no
bfdd=yes
fabricd=yes
vrrpd=no
pathd=no
pathd=yes

#
# Define defaults for all services even those who shall be kept disabled.
Expand Down
36 changes: 36 additions & 0 deletions data/templates/frr/zebra.segment_routing.frr.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
!
{% if traffic_engineering is vyos_defined %}
segment-routing
traffic-eng
mpls-te on
{% if traffic_engineering.database_import_protocol is vyos_defined %}
{% for protocol, protocol_config in traffic_engineering.database_import_protocol.items() %}
mpls-te import {{ protocol }}
{% endfor %}
{% endif %}
{% if traffic_engineering.segment_list is vyos_defined %}
{% for segment_list, segment_list_config in traffic_engineering.segment_list.items() %}
segment-list {{ segment_list }}
{% if segment_list_config.index.value.items() is vyos_defined %}
{% for index, index_config in segment_list_config.index.value.items() %}
{% if index_config.mpls.label is vyos_defined %}
index {{ index }} mpls label {{ index_config.mpls.label }}
{% endif %}
{% if index_config.nai is vyos_defined %}
{% if index_config.nai.adjacency is vyos_defined %}
{% for address_family, address_family_options in index_config.nai.adjacency.items() %}
index {{ index }} nai adjacency {{ address_family_options.source_identifier }} {{ address_family_options.destination_identifier }}
{% endfor %}
{% endif %}
{% if index_config.nai.prefix is vyos_defined %}
{% for address_family, address_family_options in index_config.nai.prefix.items() %}
{% for prefix, prefix_options in address_family_options.prefix_identifier.items() %}
index {{ index }} nai prefix {{ prefix }} {{ 'algorithm 0' if prefix_options.algorithm.spf is vyos_defined }} {{ 'algorithm 1' if prefix_options.algorithm.strict_spf is vyos_defined }}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if srv6.locator is vyos_defined %}
segment-routing
srv6
Expand Down
247 changes: 247 additions & 0 deletions interface-definitions/protocols_segment-routing.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,253 @@
</tagNode>
</children>
</node>
<node name="traffic-engineering">
<properties>
<help>Segment-Routing traffic engineering configuration</help>
</properties>
<children>
<node name="database-import-protocol">
<properties>
<help>Traffic engineering database import protocol</help>
</properties>
<children>
<leafNode name="isis">
<properties>
<help>IS-IS originated traffic engineering database</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="ospfv2">
<properties>
<help>OSPFv2 originated traffic engineering database</help>
<valueless/>
</properties>
</leafNode>
<!--
<leafNode name="ospfv3">
<properties>
<help>OSPFv3 originated traffic engineering database</help>
<valueless/>
</properties>
</leafNode>
-->
</children>
</node>
<tagNode name="segment-list">
<properties>
<help>Traffic engineering segment list</help>
<constraint>
#include <include/constraint/alpha-numeric-hyphen-underscore.xml.i>
</constraint>
</properties>
<children>
<node name="index">
<properties>
<help>Traffic engineering index for segment list</help>
</properties>
<children>
<tagNode name="value">
<properties>
<help>Traffic engineering index value for segment list</help>
<valueHelp>
<format>u32:0-4294967295</format>
<description>Segment list index value</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 0-4294967295"/>
</constraint>
</properties>
<children>
<node name="mpls">
<properties>
<help>MPLS label for index</help>
</properties>
<children>
<leafNode name="label">
<properties>
<help>MPLS label value for index</help>
<valueHelp>
<format>u32:16-1048575</format>
<description>MPLS value for index</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 16-1048575"/>
</constraint>
</properties>
</leafNode>
</children>
</node>
<node name="nai">
<properties>
<help>Node or Adjacency identifier (nai) for index</help>
</properties>
<children>
<node name="adjacency">
<properties>
<help>Adjacency identifier for index</help>
</properties>
<children>
<node name="ipv4">
<properties>
<help>IPv4 address</help>
</properties>
<children>
<leafNode name="source-identifier">
<properties>
<help>Adjacency source address identifier for index</help>
<valueHelp>
<format>ipv4net</format>
<description>IPv4 adjacency source address identifier</description>
</valueHelp>
<constraint>
<validator name="ipv4-address"/>
</constraint>
</properties>
</leafNode>
<leafNode name="destination-identifier">
<properties>
<help>Adjacency destination address identifier for index</help>
<valueHelp>
<format>ipv4net</format>
<description>IPv4 adjacency destination address identifier</description>
</valueHelp>
<constraint>
<validator name="ipv4-address"/>
</constraint>
</properties>
</leafNode>
</children>
</node>
<node name="ipv6">
<properties>
<help>IPv6 address</help>
</properties>
<children>
<leafNode name="source-identifier">
<properties>
<help>Adjacency source address identifier for index</help>
<valueHelp>
<format>ipv6net</format>
<description>IPv6 adjacency source address identifier</description>
</valueHelp>
<constraint>
<validator name="ipv6-address"/>
</constraint>
</properties>
</leafNode>
<leafNode name="destination-identifier">
<properties>
<help>Adjacency destination address identifier for index</help>
<valueHelp>
<format>ipv6net</format>
<description>IPv6 adjacency destination address identifier</description>
</valueHelp>
<constraint>
<validator name="ipv6-address"/>
</constraint>
</properties>
</leafNode>
</children>
</node>
</children>
</node>
<node name="prefix">
<properties>
<help>IGP prefix identifier for index</help>
</properties>
<children>
<node name="ipv4">
<properties>
<help>IPv4 address</help>
</properties>
<children>
<tagNode name="prefix-identifier">
<properties>
<help>IPv4 IGP prefix address identifier for index</help>
<valueHelp>
<format>ipv4net</format>
<description>IPv4 adjacency source address identifier</description>
</valueHelp>
<constraint>
<validator name="ipv4-prefix"/>
</constraint>
</properties>
<children>
<node name="algorithm">
<properties>
<help>IGP prefix algorithm style</help>
</properties>
<children>
<leafNode name="spf">
<properties>
<help>IGP prefix algorithm normal SPF</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="strict-spf">
<properties>
<help>IGP prefix algorithm strict SPF</help>
<valueless/>
</properties>
</leafNode>
</children>
</node>
</children>
</tagNode>
</children>
</node>
<node name="ipv6">
<properties>
<help>IPv6 address</help>
</properties>
<children>
<tagNode name="prefix-identifier">
<properties>
<help>IPv6 IGP prefix address identifier for index</help>
<valueHelp>
<format>ipv6net</format>
<description>IPv6 adjacency source address identifier</description>
</valueHelp>
<constraint>
<validator name="ipv6-prefix"/>
</constraint>
</properties>
<children>
<node name="algorithm">
<properties>
<help>IGP prefix algorithm style</help>
</properties>
<children>
<leafNode name="spf">
<properties>
<help>IGP prefix algorithm normal SPF</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="strict-spf">
<properties>
<help>IGP prefix algorithm strict SPF</help>
<valueless/>
</properties>
</leafNode>
</children>
</node>
</children>
</tagNode>
</children>
</node>
</children>
</node>
</children>
</node>
</children>
</tagNode>
</children>
</node>
</children>
</tagNode>
</children>
</node>
</children>
</node>
</children>
Expand Down
Loading

0 comments on commit f409809

Please sign in to comment.