Skip to content

Commit f409809

Browse files
author
Cheeze_It
committed
Adding initial traffic engineering work
Adding initial traffic engineering work
1 parent 2ba5089 commit f409809

File tree

5 files changed

+428
-5
lines changed

5 files changed

+428
-5
lines changed

data/templates/frr/daemons.frr.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pbrd=no
3838
bfdd=yes
3939
fabricd=yes
4040
vrrpd=no
41-
pathd=no
41+
pathd=yes
4242

4343
#
4444
# Define defaults for all services even those who shall be kept disabled.

data/templates/frr/zebra.segment_routing.frr.j2

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
11
!
2+
{% if traffic_engineering is vyos_defined %}
3+
segment-routing
4+
traffic-eng
5+
mpls-te on
6+
{% if traffic_engineering.database_import_protocol is vyos_defined %}
7+
{% for protocol, protocol_config in traffic_engineering.database_import_protocol.items() %}
8+
mpls-te import {{ protocol }}
9+
{% endfor %}
10+
{% endif %}
11+
{% if traffic_engineering.segment_list is vyos_defined %}
12+
{% for segment_list, segment_list_config in traffic_engineering.segment_list.items() %}
13+
segment-list {{ segment_list }}
14+
{% if segment_list_config.index.value.items() is vyos_defined %}
15+
{% for index, index_config in segment_list_config.index.value.items() %}
16+
{% if index_config.mpls.label is vyos_defined %}
17+
index {{ index }} mpls label {{ index_config.mpls.label }}
18+
{% endif %}
19+
{% if index_config.nai is vyos_defined %}
20+
{% if index_config.nai.adjacency is vyos_defined %}
21+
{% for address_family, address_family_options in index_config.nai.adjacency.items() %}
22+
index {{ index }} nai adjacency {{ address_family_options.source_identifier }} {{ address_family_options.destination_identifier }}
23+
{% endfor %}
24+
{% endif %}
25+
{% if index_config.nai.prefix is vyos_defined %}
26+
{% for address_family, address_family_options in index_config.nai.prefix.items() %}
27+
{% for prefix, prefix_options in address_family_options.prefix_identifier.items() %}
28+
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 }}
29+
{% endfor %}
30+
{% endfor %}
31+
{% endif %}
32+
{% endif %}
33+
{% endfor %}
34+
{% endif %}
35+
{% endfor %}
36+
{% endif %}
37+
{% endif %}
238
{% if srv6.locator is vyos_defined %}
339
segment-routing
440
srv6

interface-definitions/protocols_segment-routing.xml.in

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,253 @@
130130
</tagNode>
131131
</children>
132132
</node>
133+
<node name="traffic-engineering">
134+
<properties>
135+
<help>Segment-Routing traffic engineering configuration</help>
136+
</properties>
137+
<children>
138+
<node name="database-import-protocol">
139+
<properties>
140+
<help>Traffic engineering database import protocol</help>
141+
</properties>
142+
<children>
143+
<leafNode name="isis">
144+
<properties>
145+
<help>IS-IS originated traffic engineering database</help>
146+
<valueless/>
147+
</properties>
148+
</leafNode>
149+
<leafNode name="ospfv2">
150+
<properties>
151+
<help>OSPFv2 originated traffic engineering database</help>
152+
<valueless/>
153+
</properties>
154+
</leafNode>
155+
<!--
156+
<leafNode name="ospfv3">
157+
<properties>
158+
<help>OSPFv3 originated traffic engineering database</help>
159+
<valueless/>
160+
</properties>
161+
</leafNode>
162+
-->
163+
</children>
164+
</node>
165+
<tagNode name="segment-list">
166+
<properties>
167+
<help>Traffic engineering segment list</help>
168+
<constraint>
169+
#include <include/constraint/alpha-numeric-hyphen-underscore.xml.i>
170+
</constraint>
171+
</properties>
172+
<children>
173+
<node name="index">
174+
<properties>
175+
<help>Traffic engineering index for segment list</help>
176+
</properties>
177+
<children>
178+
<tagNode name="value">
179+
<properties>
180+
<help>Traffic engineering index value for segment list</help>
181+
<valueHelp>
182+
<format>u32:0-4294967295</format>
183+
<description>Segment list index value</description>
184+
</valueHelp>
185+
<constraint>
186+
<validator name="numeric" argument="--range 0-4294967295"/>
187+
</constraint>
188+
</properties>
189+
<children>
190+
<node name="mpls">
191+
<properties>
192+
<help>MPLS label for index</help>
193+
</properties>
194+
<children>
195+
<leafNode name="label">
196+
<properties>
197+
<help>MPLS label value for index</help>
198+
<valueHelp>
199+
<format>u32:16-1048575</format>
200+
<description>MPLS value for index</description>
201+
</valueHelp>
202+
<constraint>
203+
<validator name="numeric" argument="--range 16-1048575"/>
204+
</constraint>
205+
</properties>
206+
</leafNode>
207+
</children>
208+
</node>
209+
<node name="nai">
210+
<properties>
211+
<help>Node or Adjacency identifier (nai) for index</help>
212+
</properties>
213+
<children>
214+
<node name="adjacency">
215+
<properties>
216+
<help>Adjacency identifier for index</help>
217+
</properties>
218+
<children>
219+
<node name="ipv4">
220+
<properties>
221+
<help>IPv4 address</help>
222+
</properties>
223+
<children>
224+
<leafNode name="source-identifier">
225+
<properties>
226+
<help>Adjacency source address identifier for index</help>
227+
<valueHelp>
228+
<format>ipv4net</format>
229+
<description>IPv4 adjacency source address identifier</description>
230+
</valueHelp>
231+
<constraint>
232+
<validator name="ipv4-address"/>
233+
</constraint>
234+
</properties>
235+
</leafNode>
236+
<leafNode name="destination-identifier">
237+
<properties>
238+
<help>Adjacency destination address identifier for index</help>
239+
<valueHelp>
240+
<format>ipv4net</format>
241+
<description>IPv4 adjacency destination address identifier</description>
242+
</valueHelp>
243+
<constraint>
244+
<validator name="ipv4-address"/>
245+
</constraint>
246+
</properties>
247+
</leafNode>
248+
</children>
249+
</node>
250+
<node name="ipv6">
251+
<properties>
252+
<help>IPv6 address</help>
253+
</properties>
254+
<children>
255+
<leafNode name="source-identifier">
256+
<properties>
257+
<help>Adjacency source address identifier for index</help>
258+
<valueHelp>
259+
<format>ipv6net</format>
260+
<description>IPv6 adjacency source address identifier</description>
261+
</valueHelp>
262+
<constraint>
263+
<validator name="ipv6-address"/>
264+
</constraint>
265+
</properties>
266+
</leafNode>
267+
<leafNode name="destination-identifier">
268+
<properties>
269+
<help>Adjacency destination address identifier for index</help>
270+
<valueHelp>
271+
<format>ipv6net</format>
272+
<description>IPv6 adjacency destination address identifier</description>
273+
</valueHelp>
274+
<constraint>
275+
<validator name="ipv6-address"/>
276+
</constraint>
277+
</properties>
278+
</leafNode>
279+
</children>
280+
</node>
281+
</children>
282+
</node>
283+
<node name="prefix">
284+
<properties>
285+
<help>IGP prefix identifier for index</help>
286+
</properties>
287+
<children>
288+
<node name="ipv4">
289+
<properties>
290+
<help>IPv4 address</help>
291+
</properties>
292+
<children>
293+
<tagNode name="prefix-identifier">
294+
<properties>
295+
<help>IPv4 IGP prefix address identifier for index</help>
296+
<valueHelp>
297+
<format>ipv4net</format>
298+
<description>IPv4 adjacency source address identifier</description>
299+
</valueHelp>
300+
<constraint>
301+
<validator name="ipv4-prefix"/>
302+
</constraint>
303+
</properties>
304+
<children>
305+
<node name="algorithm">
306+
<properties>
307+
<help>IGP prefix algorithm style</help>
308+
</properties>
309+
<children>
310+
<leafNode name="spf">
311+
<properties>
312+
<help>IGP prefix algorithm normal SPF</help>
313+
<valueless/>
314+
</properties>
315+
</leafNode>
316+
<leafNode name="strict-spf">
317+
<properties>
318+
<help>IGP prefix algorithm strict SPF</help>
319+
<valueless/>
320+
</properties>
321+
</leafNode>
322+
</children>
323+
</node>
324+
</children>
325+
</tagNode>
326+
</children>
327+
</node>
328+
<node name="ipv6">
329+
<properties>
330+
<help>IPv6 address</help>
331+
</properties>
332+
<children>
333+
<tagNode name="prefix-identifier">
334+
<properties>
335+
<help>IPv6 IGP prefix address identifier for index</help>
336+
<valueHelp>
337+
<format>ipv6net</format>
338+
<description>IPv6 adjacency source address identifier</description>
339+
</valueHelp>
340+
<constraint>
341+
<validator name="ipv6-prefix"/>
342+
</constraint>
343+
</properties>
344+
<children>
345+
<node name="algorithm">
346+
<properties>
347+
<help>IGP prefix algorithm style</help>
348+
</properties>
349+
<children>
350+
<leafNode name="spf">
351+
<properties>
352+
<help>IGP prefix algorithm normal SPF</help>
353+
<valueless/>
354+
</properties>
355+
</leafNode>
356+
<leafNode name="strict-spf">
357+
<properties>
358+
<help>IGP prefix algorithm strict SPF</help>
359+
<valueless/>
360+
</properties>
361+
</leafNode>
362+
</children>
363+
</node>
364+
</children>
365+
</tagNode>
366+
</children>
367+
</node>
368+
</children>
369+
</node>
370+
</children>
371+
</node>
372+
</children>
373+
</tagNode>
374+
</children>
375+
</node>
376+
</children>
377+
</tagNode>
378+
</children>
379+
</node>
133380
</children>
134381
</node>
135382
</children>

0 commit comments

Comments
 (0)