2 * IS-IS Rout(e)ing protocol - isis_te.c
4 * This is an implementation of RFC5305 & RFC 7810
6 * Copyright (C) 2014 Orange Labs
7 * http://www.orange.com
9 * This file is part of GNU Zebra.
11 * GNU Zebra is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2, or (at your option) any
16 * GNU Zebra is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; see the file COPYING; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
42 #include "sockunion.h"
45 #include "isisd/dict.h"
46 #include "isisd/isis_constants.h"
47 #include "isisd/isis_common.h"
48 #include "isisd/isis_flags.h"
49 #include "isisd/isis_circuit.h"
50 #include "isisd/isisd.h"
51 #include "isisd/isis_tlv.h"
52 #include "isisd/isis_lsp.h"
53 #include "isisd/isis_pdu.h"
54 #include "isisd/isis_dynhn.h"
55 #include "isisd/isis_misc.h"
56 #include "isisd/isis_csm.h"
57 #include "isisd/isis_adjacency.h"
58 #include "isisd/isis_spf.h"
59 #include "isisd/isis_te.h"
61 /* Global varial for MPLS TE management */
62 struct isis_mpls_te isisMplsTE
;
64 const char *mode2text
[] = { "Disable", "Area", "AS", "Emulate" };
66 /*------------------------------------------------------------------------*
67 * Followings are control functions for MPLS-TE parameters management.
68 *------------------------------------------------------------------------*/
70 /* Search MPLS TE Circuit context from Interface */
71 static struct mpls_te_circuit
*
72 lookup_mpls_params_by_ifp (struct interface
*ifp
)
74 struct isis_circuit
*circuit
;
76 if ((circuit
= circuit_scan_by_ifp (ifp
)) == NULL
)
82 /* Create new MPLS TE Circuit context */
83 struct mpls_te_circuit
*
86 struct mpls_te_circuit
*mtc
;
88 zlog_debug ("ISIS MPLS-TE: Create new MPLS TE Circuit context");
90 mtc
= XCALLOC(MTYPE_ISIS_MPLS_TE
, sizeof (struct mpls_te_circuit
));
95 mtc
->status
= disable
;
103 /* Copy SUB TLVs parameters into a buffer - No space verification are performed */
104 /* Caller must verify before that there is enough free space in the buffer */
106 add_te_subtlvs(u_char
*buf
, struct mpls_te_circuit
*mtc
)
108 u_char size
, *tlvs
= buf
;
110 zlog_debug ("ISIS MPLS-TE: Add TE Sub TLVs to buffer");
114 zlog_debug("ISIS MPLS-TE: Abort! No MPLS TE Circuit available has been specified");
118 /* Create buffer if not provided */
121 zlog_debug("ISIS MPLS-TE: Abort! No Buffer has been specified");
125 /* TE_SUBTLV_ADMIN_GRP */
126 if (SUBTLV_TYPE(mtc
->admin_grp
) != 0)
128 size
= SUBTLV_SIZE (&(mtc
->admin_grp
.header
));
129 memcpy(tlvs
, &(mtc
->admin_grp
), size
);
134 if (SUBTLV_TYPE(mtc
->llri
) != 0)
136 size
= SUBTLV_SIZE (&(mtc
->llri
.header
));
137 memcpy(tlvs
, &(mtc
->llri
), size
);
141 /* TE_SUBTLV_LCLIF_IPADDR */
142 if (SUBTLV_TYPE(mtc
->local_ipaddr
) != 0)
144 size
= SUBTLV_SIZE (&(mtc
->local_ipaddr
.header
));
145 memcpy(tlvs
, &(mtc
->local_ipaddr
), size
);
149 /* TE_SUBTLV_RMTIF_IPADDR */
150 if (SUBTLV_TYPE(mtc
->rmt_ipaddr
) != 0)
152 size
= SUBTLV_SIZE (&(mtc
->rmt_ipaddr
.header
));
153 memcpy(tlvs
, &(mtc
->rmt_ipaddr
), size
);
157 /* TE_SUBTLV_MAX_BW */
158 if (SUBTLV_TYPE(mtc
->max_bw
) != 0)
160 size
= SUBTLV_SIZE (&(mtc
->max_bw
.header
));
161 memcpy(tlvs
, &(mtc
->max_bw
), size
);
165 /* TE_SUBTLV_MAX_RSV_BW */
166 if (SUBTLV_TYPE(mtc
->max_rsv_bw
) != 0)
168 size
= SUBTLV_SIZE (&(mtc
->max_rsv_bw
.header
));
169 memcpy(tlvs
, &(mtc
->max_rsv_bw
), size
);
173 /* TE_SUBTLV_UNRSV_BW */
174 if (SUBTLV_TYPE(mtc
->unrsv_bw
) != 0)
176 size
= SUBTLV_SIZE (&(mtc
->unrsv_bw
.header
));
177 memcpy(tlvs
, &(mtc
->unrsv_bw
), size
);
181 /* TE_SUBTLV_TE_METRIC */
182 if (SUBTLV_TYPE(mtc
->te_metric
) != 0)
184 size
= SUBTLV_SIZE (&(mtc
->te_metric
.header
));
185 memcpy(tlvs
, &(mtc
->te_metric
), size
);
189 /* TE_SUBTLV_AV_DELAY */
190 if (SUBTLV_TYPE(mtc
->av_delay
) != 0)
192 size
= SUBTLV_SIZE (&(mtc
->av_delay
.header
));
193 memcpy(tlvs
, &(mtc
->av_delay
), size
);
197 /* TE_SUBTLV_MM_DELAY */
198 if (SUBTLV_TYPE(mtc
->mm_delay
) != 0)
200 size
= SUBTLV_SIZE (&(mtc
->mm_delay
.header
));
201 memcpy(tlvs
, &(mtc
->mm_delay
), size
);
205 /* TE_SUBTLV_DELAY_VAR */
206 if (SUBTLV_TYPE(mtc
->delay_var
) != 0)
208 size
= SUBTLV_SIZE (&(mtc
->delay_var
.header
));
209 memcpy(tlvs
, &(mtc
->delay_var
), size
);
213 /* TE_SUBTLV_PKT_LOSS */
214 if (SUBTLV_TYPE(mtc
->pkt_loss
) != 0)
216 size
= SUBTLV_SIZE (&(mtc
->pkt_loss
.header
));
217 memcpy(tlvs
, &(mtc
->pkt_loss
), size
);
221 /* TE_SUBTLV_RES_BW */
222 if (SUBTLV_TYPE(mtc
->res_bw
) != 0)
224 size
= SUBTLV_SIZE (&(mtc
->res_bw
.header
));
225 memcpy(tlvs
, &(mtc
->res_bw
), size
);
229 /* TE_SUBTLV_AVA_BW */
230 if (SUBTLV_TYPE(mtc
->ava_bw
) != 0)
232 size
= SUBTLV_SIZE (&(mtc
->ava_bw
.header
));
233 memcpy(tlvs
, &(mtc
->ava_bw
), size
);
237 /* TE_SUBTLV_USE_BW */
238 if (SUBTLV_TYPE(mtc
->use_bw
) != 0)
240 size
= SUBTLV_SIZE (&(mtc
->use_bw
.header
));
241 memcpy(tlvs
, &(mtc
->use_bw
), size
);
245 /* Update SubTLVs length */
246 mtc
->length
= subtlvs_len(mtc
);
248 zlog_debug("ISIS MPLS-TE: Add %d bytes length SubTLVs", mtc
->length
);
253 /* Compute total Sub-TLVs size */
255 subtlvs_len (struct mpls_te_circuit
*mtc
)
263 /* TE_SUBTLV_ADMIN_GRP */
264 if (SUBTLV_TYPE(mtc
->admin_grp
) != 0)
265 length
+= SUBTLV_SIZE (&(mtc
->admin_grp
.header
));
268 if (SUBTLV_TYPE(mtc
->llri
) != 0)
269 length
+= SUBTLV_SIZE (&mtc
->llri
.header
);
271 /* TE_SUBTLV_LCLIF_IPADDR */
272 if (SUBTLV_TYPE(mtc
->local_ipaddr
) != 0)
273 length
+= SUBTLV_SIZE (&mtc
->local_ipaddr
.header
);
275 /* TE_SUBTLV_RMTIF_IPADDR */
276 if (SUBTLV_TYPE(mtc
->rmt_ipaddr
) != 0)
277 length
+= SUBTLV_SIZE (&mtc
->rmt_ipaddr
.header
);
279 /* TE_SUBTLV_MAX_BW */
280 if (SUBTLV_TYPE(mtc
->max_bw
) != 0)
281 length
+= SUBTLV_SIZE (&mtc
->max_bw
.header
);
283 /* TE_SUBTLV_MAX_RSV_BW */
284 if (SUBTLV_TYPE(mtc
->max_rsv_bw
) != 0)
285 length
+= SUBTLV_SIZE (&mtc
->max_rsv_bw
.header
);
287 /* TE_SUBTLV_UNRSV_BW */
288 if (SUBTLV_TYPE(mtc
->unrsv_bw
) != 0)
289 length
+= SUBTLV_SIZE (&mtc
->unrsv_bw
.header
);
291 /* TE_SUBTLV_TE_METRIC */
292 if (SUBTLV_TYPE(mtc
->te_metric
) != 0)
293 length
+= SUBTLV_SIZE (&mtc
->te_metric
.header
);
295 /* TE_SUBTLV_AV_DELAY */
296 if (SUBTLV_TYPE(mtc
->av_delay
) != 0)
297 length
+= SUBTLV_SIZE (&mtc
->av_delay
.header
);
299 /* TE_SUBTLV_MM_DELAY */
300 if (SUBTLV_TYPE(mtc
->mm_delay
) != 0)
301 length
+= SUBTLV_SIZE (&mtc
->mm_delay
.header
);
303 /* TE_SUBTLV_DELAY_VAR */
304 if (SUBTLV_TYPE(mtc
->delay_var
) != 0)
305 length
+= SUBTLV_SIZE (&mtc
->delay_var
.header
);
307 /* TE_SUBTLV_PKT_LOSS */
308 if (SUBTLV_TYPE(mtc
->pkt_loss
) != 0)
309 length
+= SUBTLV_SIZE (&mtc
->pkt_loss
.header
);
311 /* TE_SUBTLV_RES_BW */
312 if (SUBTLV_TYPE(mtc
->res_bw
) != 0)
313 length
+= SUBTLV_SIZE (&mtc
->res_bw
.header
);
315 /* TE_SUBTLV_AVA_BW */
316 if (SUBTLV_TYPE(mtc
->ava_bw
) != 0)
317 length
+= SUBTLV_SIZE (&mtc
->ava_bw
.header
);
319 /* TE_SUBTLV_USE_BW */
320 if (SUBTLV_TYPE(mtc
->use_bw
) != 0)
321 length
+= SUBTLV_SIZE (&mtc
->use_bw
.header
);
323 /* Check that length is lower than the MAXIMUM SUBTLV size i.e. 256 */
324 if (length
> MAX_SUBTLV_SIZE
)
330 mtc
->length
= (u_char
)length
;
335 /* Following are various functions to set MPLS TE parameters */
337 set_circuitparams_admin_grp (struct mpls_te_circuit
*mtc
, u_int32_t admingrp
)
339 SUBTLV_TYPE(mtc
->admin_grp
) = TE_SUBTLV_ADMIN_GRP
;
340 SUBTLV_LEN(mtc
->admin_grp
) = SUBTLV_DEF_SIZE
;
341 mtc
->admin_grp
.value
= htonl(admingrp
);
345 static void __attribute__ ((unused
))
346 set_circuitparams_llri (struct mpls_te_circuit
*mtc
, u_int32_t local
, u_int32_t remote
)
348 SUBTLV_TYPE(mtc
->llri
) = TE_SUBTLV_LLRI
;
349 SUBTLV_LEN(mtc
->llri
) = TE_SUBTLV_LLRI_SIZE
;
350 mtc
->llri
.local
= htonl(local
);
351 mtc
->llri
.remote
= htonl(remote
);
355 set_circuitparams_local_ipaddr (struct mpls_te_circuit
*mtc
, struct in_addr addr
)
358 SUBTLV_TYPE(mtc
->local_ipaddr
) = TE_SUBTLV_LOCAL_IPADDR
;
359 SUBTLV_LEN(mtc
->local_ipaddr
) = SUBTLV_DEF_SIZE
;
360 mtc
->local_ipaddr
.value
.s_addr
= addr
.s_addr
;
365 set_circuitparams_rmt_ipaddr (struct mpls_te_circuit
*mtc
, struct in_addr addr
)
368 SUBTLV_TYPE(mtc
->rmt_ipaddr
) = TE_SUBTLV_RMT_IPADDR
;
369 SUBTLV_LEN(mtc
->rmt_ipaddr
) = SUBTLV_DEF_SIZE
;
370 mtc
->rmt_ipaddr
.value
.s_addr
= addr
.s_addr
;
375 set_circuitparams_max_bw (struct mpls_te_circuit
*mtc
, float fp
)
377 SUBTLV_TYPE(mtc
->max_bw
) = TE_SUBTLV_MAX_BW
;
378 SUBTLV_LEN(mtc
->max_bw
) = SUBTLV_DEF_SIZE
;
379 mtc
->max_bw
.value
= htonf(fp
);
384 set_circuitparams_max_rsv_bw (struct mpls_te_circuit
*mtc
, float fp
)
386 SUBTLV_TYPE(mtc
->max_rsv_bw
) = TE_SUBTLV_MAX_RSV_BW
;
387 SUBTLV_LEN(mtc
->max_rsv_bw
) = SUBTLV_DEF_SIZE
;
388 mtc
->max_rsv_bw
.value
= htonf(fp
);
393 set_circuitparams_unrsv_bw (struct mpls_te_circuit
*mtc
, int priority
, float fp
)
395 /* Note that TLV-length field is the size of array. */
396 SUBTLV_TYPE(mtc
->unrsv_bw
) = TE_SUBTLV_UNRSV_BW
;
397 SUBTLV_LEN(mtc
->unrsv_bw
) = TE_SUBTLV_UNRSV_SIZE
;
398 mtc
->unrsv_bw
.value
[priority
] = htonf(fp
);
403 set_circuitparams_te_metric (struct mpls_te_circuit
*mtc
, u_int32_t te_metric
)
405 SUBTLV_TYPE(mtc
->te_metric
) = TE_SUBTLV_TE_METRIC
;
406 SUBTLV_LEN(mtc
->te_metric
) = TE_SUBTLV_TE_METRIC_SIZE
;
407 mtc
->te_metric
.value
[0] = (te_metric
>> 16) & 0xFF;
408 mtc
->te_metric
.value
[1] = (te_metric
>> 8) & 0xFF;
409 mtc
->te_metric
.value
[2] = te_metric
& 0xFF;
414 set_circuitparams_inter_as (struct mpls_te_circuit
*mtc
, struct in_addr addr
, u_int32_t as
)
417 /* Set the Remote ASBR IP address and then the associated AS number */
418 SUBTLV_TYPE(mtc
->rip
) = TE_SUBTLV_RIP
;
419 SUBTLV_LEN(mtc
->rip
) = SUBTLV_DEF_SIZE
;
420 mtc
->rip
.value
.s_addr
= addr
.s_addr
;
422 SUBTLV_TYPE(mtc
->ras
) = TE_SUBTLV_RAS
;
423 SUBTLV_LEN(mtc
->ras
) = SUBTLV_DEF_SIZE
;
424 mtc
->ras
.value
= htonl(as
);
428 unset_circuitparams_inter_as (struct mpls_te_circuit
*mtc
)
431 /* Reset the Remote ASBR IP address and then the associated AS number */
432 SUBTLV_TYPE(mtc
->rip
) = 0;
433 SUBTLV_LEN(mtc
->rip
) = 0;
434 mtc
->rip
.value
.s_addr
= 0;
436 SUBTLV_TYPE(mtc
->ras
) = 0;
437 SUBTLV_LEN(mtc
->ras
) = 0;
442 set_circuitparams_av_delay (struct mpls_te_circuit
*mtc
, u_int32_t delay
, u_char anormal
)
445 /* Note that TLV-length field is the size of array. */
446 SUBTLV_TYPE(mtc
->av_delay
) = TE_SUBTLV_AV_DELAY
;
447 SUBTLV_LEN(mtc
->av_delay
) = SUBTLV_DEF_SIZE
;
448 tmp
= delay
& TE_EXT_MASK
;
450 tmp
|= TE_EXT_ANORMAL
;
451 mtc
->av_delay
.value
= htonl(tmp
);
456 set_circuitparams_mm_delay (struct mpls_te_circuit
*mtc
, u_int32_t low
, u_int32_t high
, u_char anormal
)
459 /* Note that TLV-length field is the size of array. */
460 SUBTLV_TYPE(mtc
->mm_delay
) = TE_SUBTLV_MM_DELAY
;
461 SUBTLV_LEN(mtc
->mm_delay
) = TE_SUBTLV_MM_DELAY_SIZE
;
462 tmp
= low
& TE_EXT_MASK
;
464 tmp
|= TE_EXT_ANORMAL
;
465 mtc
->mm_delay
.low
= htonl(tmp
);
466 mtc
->mm_delay
.high
= htonl(high
);
471 set_circuitparams_delay_var (struct mpls_te_circuit
*mtc
, u_int32_t jitter
)
473 /* Note that TLV-length field is the size of array. */
474 SUBTLV_TYPE(mtc
->delay_var
) = TE_SUBTLV_DELAY_VAR
;
475 SUBTLV_LEN(mtc
->delay_var
) = SUBTLV_DEF_SIZE
;
476 mtc
->delay_var
.value
= htonl(jitter
& TE_EXT_MASK
);
481 set_circuitparams_pkt_loss (struct mpls_te_circuit
*mtc
, u_int32_t loss
, u_char anormal
)
484 /* Note that TLV-length field is the size of array. */
485 SUBTLV_TYPE(mtc
->pkt_loss
) = TE_SUBTLV_PKT_LOSS
;
486 SUBTLV_LEN(mtc
->pkt_loss
) = SUBTLV_DEF_SIZE
;
487 tmp
= loss
& TE_EXT_MASK
;
489 tmp
|= TE_EXT_ANORMAL
;
490 mtc
->pkt_loss
.value
= htonl(tmp
);
495 set_circuitparams_res_bw (struct mpls_te_circuit
*mtc
, float fp
)
497 /* Note that TLV-length field is the size of array. */
498 SUBTLV_TYPE(mtc
->res_bw
) = TE_SUBTLV_RES_BW
;
499 SUBTLV_LEN(mtc
->res_bw
) = SUBTLV_DEF_SIZE
;
500 mtc
->res_bw
.value
= htonf(fp
);
505 set_circuitparams_ava_bw (struct mpls_te_circuit
*mtc
, float fp
)
507 /* Note that TLV-length field is the size of array. */
508 SUBTLV_TYPE(mtc
->ava_bw
) = TE_SUBTLV_AVA_BW
;
509 SUBTLV_LEN(mtc
->ava_bw
) = SUBTLV_DEF_SIZE
;
510 mtc
->ava_bw
.value
= htonf(fp
);
515 set_circuitparams_use_bw (struct mpls_te_circuit
*mtc
, float fp
)
517 /* Note that TLV-length field is the size of array. */
518 SUBTLV_TYPE(mtc
->use_bw
) = TE_SUBTLV_USE_BW
;
519 SUBTLV_LEN(mtc
->use_bw
) = SUBTLV_DEF_SIZE
;
520 mtc
->use_bw
.value
= htonf(fp
);
524 /* Main initialization / update function of the MPLS TE Circuit context */
525 /* Call when interface TE Link parameters are modified */
527 isis_link_params_update (struct isis_circuit
*circuit
, struct interface
*ifp
)
530 struct prefix_ipv4
*addr
;
531 struct mpls_te_circuit
*mtc
;
534 if ((circuit
== NULL
) || (ifp
== NULL
))
537 zlog_info ("MPLS-TE: Initialize circuit parameters for interface %s", ifp
->name
);
539 /* Check if MPLS TE Circuit context has not been already created */
540 if (circuit
->mtc
== NULL
)
541 circuit
->mtc
= mpls_te_circuit_new();
545 /* Fulfil MTC TLV from ifp TE Link parameters */
546 if (HAS_LINK_PARAMS(ifp
))
548 mtc
->status
= enable
;
550 if (IS_PARAM_SET(ifp
->link_params
, LP_ADM_GRP
))
551 set_circuitparams_admin_grp (mtc
, ifp
->link_params
->admin_grp
);
553 SUBTLV_TYPE(mtc
->admin_grp
) = 0;
555 /* If not already set, register local IP addr from ip_addr list if it exists */
556 if (SUBTLV_TYPE(mtc
->local_ipaddr
) == 0)
558 if (circuit
->ip_addrs
!= NULL
&& listcount(circuit
->ip_addrs
) != 0)
560 addr
= (struct prefix_ipv4
*)listgetdata ((struct listnode
*)listhead (circuit
->ip_addrs
));
561 set_circuitparams_local_ipaddr (mtc
, addr
->prefix
);
565 /* If not already set, try to determine Remote IP addr if circuit is P2P */
566 if ((SUBTLV_TYPE(mtc
->rmt_ipaddr
) == 0) && (circuit
->circ_type
== CIRCUIT_T_P2P
))
568 struct isis_adjacency
*adj
= circuit
->u
.p2p
.neighbor
;
569 if (adj
->ipv4_addrs
!= NULL
&& listcount(adj
->ipv4_addrs
) != 0)
571 struct in_addr
*ip_addr
;
572 ip_addr
= (struct in_addr
*)listgetdata ((struct listnode
*)listhead (adj
->ipv4_addrs
));
573 set_circuitparams_rmt_ipaddr (mtc
, *ip_addr
);
577 if (IS_PARAM_SET(ifp
->link_params
, LP_MAX_BW
))
578 set_circuitparams_max_bw (mtc
, ifp
->link_params
->max_bw
);
580 SUBTLV_TYPE(mtc
->max_bw
) = 0;
582 if (IS_PARAM_SET(ifp
->link_params
, LP_MAX_RSV_BW
))
583 set_circuitparams_max_rsv_bw (mtc
, ifp
->link_params
->max_rsv_bw
);
585 SUBTLV_TYPE(mtc
->max_rsv_bw
) = 0;
587 if (IS_PARAM_SET(ifp
->link_params
, LP_UNRSV_BW
))
588 for (i
= 0; i
< MAX_CLASS_TYPE
; i
++)
589 set_circuitparams_unrsv_bw (mtc
, i
, ifp
->link_params
->unrsv_bw
[i
]);
591 SUBTLV_TYPE(mtc
->unrsv_bw
) = 0;
593 if (IS_PARAM_SET(ifp
->link_params
, LP_TE_METRIC
))
594 set_circuitparams_te_metric(mtc
, ifp
->link_params
->te_metric
);
596 SUBTLV_TYPE(mtc
->te_metric
) = 0;
598 /* TE metric Extensions */
599 if (IS_PARAM_SET(ifp
->link_params
, LP_DELAY
))
600 set_circuitparams_av_delay(mtc
, ifp
->link_params
->av_delay
, 0);
602 SUBTLV_TYPE(mtc
->av_delay
) = 0;
604 if (IS_PARAM_SET(ifp
->link_params
, LP_MM_DELAY
))
605 set_circuitparams_mm_delay(mtc
, ifp
->link_params
->min_delay
, ifp
->link_params
->max_delay
, 0);
607 SUBTLV_TYPE(mtc
->mm_delay
) = 0;
609 if (IS_PARAM_SET(ifp
->link_params
, LP_DELAY_VAR
))
610 set_circuitparams_delay_var(mtc
, ifp
->link_params
->delay_var
);
612 SUBTLV_TYPE(mtc
->delay_var
) = 0;
614 if (IS_PARAM_SET(ifp
->link_params
, LP_PKT_LOSS
))
615 set_circuitparams_pkt_loss(mtc
, ifp
->link_params
->pkt_loss
, 0);
617 SUBTLV_TYPE(mtc
->pkt_loss
) = 0;
619 if (IS_PARAM_SET(ifp
->link_params
, LP_RES_BW
))
620 set_circuitparams_res_bw(mtc
, ifp
->link_params
->res_bw
);
622 SUBTLV_TYPE(mtc
->res_bw
) = 0;
624 if (IS_PARAM_SET(ifp
->link_params
, LP_AVA_BW
))
625 set_circuitparams_ava_bw(mtc
, ifp
->link_params
->ava_bw
);
627 SUBTLV_TYPE(mtc
->ava_bw
) = 0;
629 if (IS_PARAM_SET(ifp
->link_params
, LP_USE_BW
))
630 set_circuitparams_use_bw(mtc
, ifp
->link_params
->use_bw
);
632 SUBTLV_TYPE(mtc
->use_bw
) = 0;
635 if (IS_PARAM_SET(ifp
->link_params
, LP_RMT_AS
))
636 set_circuitparams_inter_as(mtc
, ifp
->link_params
->rmt_ip
, ifp
->link_params
->rmt_as
);
638 /* reset inter-as TE params */
639 unset_circuitparams_inter_as (mtc
);
641 /* Compute total length of SUB TLVs */
642 mtc
->length
= subtlvs_len(mtc
);
646 mtc
->status
= disable
;
648 /* Finally Update LSP */
650 if (IS_MPLS_TE(isisMplsTE
) && circuit
->area
)
651 lsp_regenerate_schedule (circuit
->area
, circuit
->is_type
, 0);
657 isis_mpls_te_update (struct interface
*ifp
)
659 struct isis_circuit
*circuit
;
665 /* Get circuit context from interface */
666 if ((circuit
= circuit_scan_by_ifp(ifp
)) == NULL
)
669 /* Update TE TLVs ... */
670 isis_link_params_update(circuit
, ifp
);
673 if (IS_MPLS_TE(isisMplsTE
) && circuit
->area
)
674 lsp_regenerate_schedule (circuit
->area
, circuit
->is_type
, 0);
679 /*------------------------------------------------------------------------*
680 * Followings are vty session control functions.
681 *------------------------------------------------------------------------*/
684 show_vty_subtlv_admin_grp (struct vty
*vty
, struct te_subtlv_admin_grp
*tlv
)
688 vty_outln (vty
, " Administrative Group: 0x%x",
689 (u_int32_t
)ntohl(tlv
->value
));
691 zlog_debug (" Administrative Group: 0x%x",
692 (u_int32_t
) ntohl (tlv
->value
));
694 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
698 show_vty_subtlv_llri (struct vty
*vty
, struct te_subtlv_llri
*tlv
)
702 vty_outln (vty
, " Link Local ID: %d",(u_int32_t
)ntohl(tlv
->local
));
703 vty_outln (vty
, " Link Remote ID: %d",
704 (u_int32_t
)ntohl(tlv
->remote
));
708 zlog_debug (" Link Local ID: %d", (u_int32_t
) ntohl (tlv
->local
));
709 zlog_debug (" Link Remote ID: %d", (u_int32_t
) ntohl (tlv
->remote
));
712 return (SUBTLV_HDR_SIZE
+ TE_SUBTLV_LLRI_SIZE
);
716 show_vty_subtlv_local_ipaddr (struct vty
*vty
, struct te_subtlv_local_ipaddr
*tlv
)
719 vty_outln (vty
, " Local Interface IP Address(es): %s",
720 inet_ntoa(tlv
->value
));
722 zlog_debug (" Local Interface IP Address(es): %s", inet_ntoa (tlv
->value
));
724 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
728 show_vty_subtlv_rmt_ipaddr (struct vty
*vty
, struct te_subtlv_rmt_ipaddr
*tlv
)
731 vty_outln (vty
, " Remote Interface IP Address(es): %s",
732 inet_ntoa(tlv
->value
));
734 zlog_debug (" Remote Interface IP Address(es): %s", inet_ntoa (tlv
->value
));
736 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
740 show_vty_subtlv_max_bw (struct vty
*vty
, struct te_subtlv_max_bw
*tlv
)
744 fval
= ntohf (tlv
->value
);
747 vty_outln (vty
, " Maximum Bandwidth: %g (Bytes/sec)", fval
);
749 zlog_debug (" Maximum Bandwidth: %g (Bytes/sec)", fval
);
751 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
755 show_vty_subtlv_max_rsv_bw (struct vty
*vty
, struct te_subtlv_max_rsv_bw
*tlv
)
759 fval
= ntohf (tlv
->value
);
762 vty_outln (vty
, " Maximum Reservable Bandwidth: %g (Bytes/sec)",fval
);
764 zlog_debug (" Maximum Reservable Bandwidth: %g (Bytes/sec)", fval
);
766 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
770 show_vty_subtlv_unrsv_bw (struct vty
*vty
, struct te_subtlv_unrsv_bw
*tlv
)
776 vty_outln (vty
, " Unreserved Bandwidth:");
778 zlog_debug (" Unreserved Bandwidth:");
780 for (i
= 0; i
< MAX_CLASS_TYPE
; i
+=2)
782 fval1
= ntohf (tlv
->value
[i
]);
783 fval2
= ntohf (tlv
->value
[i
+1]);
785 vty_outln (vty
, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", i
, fval1
, i
+1,
788 zlog_debug (" [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", i
, fval1
, i
+1, fval2
);
791 return (SUBTLV_HDR_SIZE
+ TE_SUBTLV_UNRSV_SIZE
);
795 show_vty_subtlv_te_metric (struct vty
*vty
, struct te_subtlv_te_metric
*tlv
)
799 te_metric
= tlv
->value
[2] | tlv
->value
[1] << 8 | tlv
->value
[0] << 16;
801 vty_outln (vty
, " Traffic Engineering Metric: %u", te_metric
);
803 zlog_debug (" Traffic Engineering Metric: %u", te_metric
);
805 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
809 show_vty_subtlv_ras (struct vty
*vty
, struct te_subtlv_ras
*tlv
)
812 vty_outln (vty
, " Inter-AS TE Remote AS number: %u",
815 zlog_debug (" Inter-AS TE Remote AS number: %u", ntohl (tlv
->value
));
817 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
821 show_vty_subtlv_rip (struct vty
*vty
, struct te_subtlv_rip
*tlv
)
824 vty_outln (vty
, " Inter-AS TE Remote ASBR IP address: %s",
825 inet_ntoa(tlv
->value
));
827 zlog_debug (" Inter-AS TE Remote ASBR IP address: %s", inet_ntoa (tlv
->value
));
829 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
833 show_vty_subtlv_av_delay (struct vty
*vty
, struct te_subtlv_av_delay
*tlv
)
838 delay
= (u_int32_t
) ntohl (tlv
->value
) & TE_EXT_MASK
;
839 A
= (u_int32_t
) ntohl (tlv
->value
) & TE_EXT_ANORMAL
;
842 vty_outln (vty
, " %s Average Link Delay: %d (micro-sec)", A
? "Anomalous" : "Normal",
845 zlog_debug (" %s Average Link Delay: %d (micro-sec)", A
? "Anomalous" : "Normal", delay
);
847 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
851 show_vty_subtlv_mm_delay (struct vty
*vty
, struct te_subtlv_mm_delay
*tlv
)
856 low
= (u_int32_t
) ntohl (tlv
->low
) & TE_EXT_MASK
;
857 A
= (u_int32_t
) ntohl (tlv
->low
) & TE_EXT_ANORMAL
;
858 high
= (u_int32_t
) ntohl (tlv
->high
) & TE_EXT_MASK
;
861 vty_outln (vty
, " %s Min/Max Link Delay: %d / %d (micro-sec)", A
? "Anomalous" : "Normal", low
,
864 zlog_debug (" %s Min/Max Link Delay: %d / %d (micro-sec)", A
? "Anomalous" : "Normal", low
, high
);
866 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
870 show_vty_subtlv_delay_var (struct vty
*vty
, struct te_subtlv_delay_var
*tlv
)
874 jitter
= (u_int32_t
) ntohl (tlv
->value
) & TE_EXT_MASK
;
877 vty_outln (vty
, " Delay Variation: %d (micro-sec)", jitter
);
879 zlog_debug (" Delay Variation: %d (micro-sec)", jitter
);
881 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
885 show_vty_subtlv_pkt_loss (struct vty
*vty
, struct te_subtlv_pkt_loss
*tlv
)
891 loss
= (u_int32_t
) ntohl (tlv
->value
) & TE_EXT_MASK
;
892 fval
= (float) (loss
* LOSS_PRECISION
);
893 A
= (u_int32_t
) ntohl (tlv
->value
) & TE_EXT_ANORMAL
;
896 vty_outln (vty
, " %s Link Packet Loss: %g (%%)", A
? "Anomalous" : "Normal",
899 zlog_debug (" %s Link Packet Loss: %g (%%)", A
? "Anomalous" : "Normal", fval
);
901 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
905 show_vty_subtlv_res_bw (struct vty
*vty
, struct te_subtlv_res_bw
*tlv
)
909 fval
= ntohf(tlv
->value
);
912 vty_outln (vty
, " Unidirectional Residual Bandwidth: %g (Bytes/sec)",
915 zlog_debug (" Unidirectional Residual Bandwidth: %g (Bytes/sec)", fval
);
917 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
921 show_vty_subtlv_ava_bw (struct vty
*vty
, struct te_subtlv_ava_bw
*tlv
)
925 fval
= ntohf (tlv
->value
);
928 vty_outln (vty
, " Unidirectional Available Bandwidth: %g (Bytes/sec)",
931 zlog_debug (" Unidirectional Available Bandwidth: %g (Bytes/sec)", fval
);
933 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
937 show_vty_subtlv_use_bw (struct vty
*vty
, struct te_subtlv_use_bw
*tlv
)
941 fval
= ntohf (tlv
->value
);
944 vty_outln (vty
, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)",
947 zlog_debug (" Unidirectional Utilized Bandwidth: %g (Bytes/sec)", fval
);
949 return (SUBTLV_HDR_SIZE
+ SUBTLV_DEF_SIZE
);
953 show_vty_unknown_tlv (struct vty
*vty
, struct subtlv_header
*tlvh
)
956 u_char
*v
= (u_char
*)tlvh
;
960 if (tlvh
->length
!= 0)
962 vty_outln (vty
, " Unknown TLV: [type(%#.2x), length(%#.2x)]",
963 tlvh
->type
, tlvh
->length
);
964 vty_out(vty
, " Dump: [00]");
965 rtn
= 1; /* initialize end of line counter */
966 for (i
= 0; i
< tlvh
->length
; i
++)
968 vty_out (vty
, " %#.2x", v
[i
]);
971 vty_out (vty
, "%s [%.2x]", VTYNL
, i
+ 1);
977 vty_out (vty
, VTYNL
);
980 vty_outln (vty
, " Unknown TLV: [type(%#.2x), length(%#.2x)]",
981 tlvh
->type
, tlvh
->length
);
985 zlog_debug (" Unknown TLV: [type(%#.2x), length(%#.2x)]",
986 tlvh
->type
, tlvh
->length
);
989 return SUBTLV_SIZE(tlvh
);
992 /* Main Show function */
994 mpls_te_print_detail(struct vty
*vty
, struct te_is_neigh
*te
)
996 struct subtlv_header
*tlvh
;
999 zlog_debug ("ISIS MPLS-TE: Show database TE detail");
1001 tlvh
= (struct subtlv_header
*)te
->sub_tlvs
;
1003 for (; sum
< te
->sub_tlvs_length
; tlvh
= SUBTLV_HDR_NEXT (tlvh
))
1007 case TE_SUBTLV_ADMIN_GRP
:
1008 sum
+= show_vty_subtlv_admin_grp (vty
, (struct te_subtlv_admin_grp
*)tlvh
);
1010 case TE_SUBTLV_LLRI
:
1011 sum
+= show_vty_subtlv_llri (vty
, (struct te_subtlv_llri
*)tlvh
);
1013 case TE_SUBTLV_LOCAL_IPADDR
:
1014 sum
+= show_vty_subtlv_local_ipaddr (vty
, (struct te_subtlv_local_ipaddr
*)tlvh
);
1016 case TE_SUBTLV_RMT_IPADDR
:
1017 sum
+= show_vty_subtlv_rmt_ipaddr (vty
, (struct te_subtlv_rmt_ipaddr
*)tlvh
);
1019 case TE_SUBTLV_MAX_BW
:
1020 sum
+= show_vty_subtlv_max_bw (vty
, (struct te_subtlv_max_bw
*)tlvh
);
1022 case TE_SUBTLV_MAX_RSV_BW
:
1023 sum
+= show_vty_subtlv_max_rsv_bw (vty
, (struct te_subtlv_max_rsv_bw
*)tlvh
);
1025 case TE_SUBTLV_UNRSV_BW
:
1026 sum
+= show_vty_subtlv_unrsv_bw (vty
, (struct te_subtlv_unrsv_bw
*)tlvh
);
1028 case TE_SUBTLV_TE_METRIC
:
1029 sum
+= show_vty_subtlv_te_metric (vty
, (struct te_subtlv_te_metric
*)tlvh
);
1032 sum
+= show_vty_subtlv_ras (vty
, (struct te_subtlv_ras
*)tlvh
);
1035 sum
+= show_vty_subtlv_rip (vty
, (struct te_subtlv_rip
*)tlvh
);
1037 case TE_SUBTLV_AV_DELAY
:
1038 sum
+= show_vty_subtlv_av_delay (vty
, (struct te_subtlv_av_delay
*)tlvh
);
1040 case TE_SUBTLV_MM_DELAY
:
1041 sum
+= show_vty_subtlv_mm_delay (vty
, (struct te_subtlv_mm_delay
*)tlvh
);
1043 case TE_SUBTLV_DELAY_VAR
:
1044 sum
+= show_vty_subtlv_delay_var (vty
, (struct te_subtlv_delay_var
*)tlvh
);
1046 case TE_SUBTLV_PKT_LOSS
:
1047 sum
+= show_vty_subtlv_pkt_loss (vty
, (struct te_subtlv_pkt_loss
*)tlvh
);
1049 case TE_SUBTLV_RES_BW
:
1050 sum
+= show_vty_subtlv_res_bw (vty
, (struct te_subtlv_res_bw
*)tlvh
);
1052 case TE_SUBTLV_AVA_BW
:
1053 sum
+= show_vty_subtlv_ava_bw (vty
, (struct te_subtlv_ava_bw
*)tlvh
);
1055 case TE_SUBTLV_USE_BW
:
1056 sum
+= show_vty_subtlv_use_bw (vty
, (struct te_subtlv_use_bw
*)tlvh
);
1059 sum
+= show_vty_unknown_tlv (vty
, tlvh
);
1066 /* Specific MPLS TE router parameters write function */
1068 isis_mpls_te_config_write_router (struct vty
*vty
)
1070 if (IS_MPLS_TE(isisMplsTE
))
1072 vty_outln (vty
, " mpls-te on");
1073 vty_outln (vty
, " mpls-te router-address %s",
1074 inet_ntoa(isisMplsTE
.router_id
));
1081 /*------------------------------------------------------------------------*
1082 * Followings are vty command functions.
1083 *------------------------------------------------------------------------*/
1085 DEFUN (isis_mpls_te_on
,
1086 isis_mpls_te_on_cmd
,
1089 "Enable MPLS-TE functionality\n")
1091 struct listnode
*node
;
1092 struct isis_circuit
*circuit
;
1094 if (IS_MPLS_TE(isisMplsTE
))
1097 if (IS_DEBUG_ISIS(DEBUG_TE
))
1098 zlog_debug ("ISIS MPLS-TE: OFF -> ON");
1100 isisMplsTE
.status
= enable
;
1103 * Following code is intended to handle two cases;
1105 * 1) MPLS-TE was disabled at startup time, but now become enabled.
1106 * In this case, we must enable MPLS-TE Circuit regarding interface MPLS_TE flag
1107 * 2) MPLS-TE was once enabled then disabled, and now enabled again.
1109 for (ALL_LIST_ELEMENTS_RO (isisMplsTE
.cir_list
, node
, circuit
))
1111 if (circuit
->mtc
== NULL
|| IS_FLOOD_AS (circuit
->mtc
->type
))
1114 if ((circuit
->mtc
->status
== disable
)
1115 && HAS_LINK_PARAMS(circuit
->interface
))
1116 circuit
->mtc
->status
= enable
;
1120 /* Reoriginate STD_TE & GMPLS circuits */
1122 lsp_regenerate_schedule (circuit
->area
, circuit
->is_type
, 0);
1128 DEFUN (no_isis_mpls_te_on
,
1129 no_isis_mpls_te_on_cmd
,
1132 "Disable the MPLS-TE functionality\n")
1134 struct listnode
*node
;
1135 struct isis_circuit
*circuit
;
1137 if (isisMplsTE
.status
== disable
)
1140 if (IS_DEBUG_ISIS(DEBUG_TE
))
1141 zlog_debug ("ISIS MPLS-TE: ON -> OFF");
1143 isisMplsTE
.status
= disable
;
1145 /* Flush LSP if circuit engage */
1146 for (ALL_LIST_ELEMENTS_RO (isisMplsTE
.cir_list
, node
, circuit
))
1148 if (circuit
->mtc
== NULL
|| (circuit
->mtc
->status
== disable
))
1151 /* disable MPLS_TE Circuit */
1152 circuit
->mtc
->status
= disable
;
1154 /* Re-originate circuit without STD_TE & GMPLS parameters */
1156 lsp_regenerate_schedule (circuit
->area
, circuit
->is_type
, 0);
1162 DEFUN (isis_mpls_te_router_addr
,
1163 isis_mpls_te_router_addr_cmd
,
1164 "mpls-te router-address A.B.C.D",
1166 "Stable IP address of the advertising router\n"
1167 "MPLS-TE router address in IPv4 address format\n")
1170 struct in_addr value
;
1171 struct listnode
*node
;
1172 struct isis_area
*area
;
1174 if (! inet_aton (argv
[idx_ipv4
]->arg
, &value
))
1176 vty_outln (vty
, "Please specify Router-Addr by A.B.C.D");
1180 isisMplsTE
.router_id
.s_addr
= value
.s_addr
;
1182 if (isisMplsTE
.status
== disable
)
1185 /* Update main Router ID in isis global structure */
1186 isis
->router_id
= value
.s_addr
;
1187 /* And re-schedule LSP update */
1188 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
1189 if (listcount (area
->area_addrs
) > 0)
1190 lsp_regenerate_schedule (area
, area
->is_type
, 0);
1195 DEFUN (isis_mpls_te_inter_as
,
1196 isis_mpls_te_inter_as_cmd
,
1197 "mpls-te inter-as <level-1|level-1-2|level-2-only>",
1199 "Configure MPLS-TE Inter-AS support\n"
1200 "AREA native mode self originate INTER-AS LSP with L1 only flooding scope)\n"
1201 "AREA native mode self originate INTER-AS LSP with L1 and L2 flooding scope)\n"
1202 "AS native mode self originate INTER-AS LSP with L2 only flooding scope\n")
1204 vty_outln (vty
, "Not yet supported");
1208 DEFUN (no_isis_mpls_te_inter_as
,
1209 no_isis_mpls_te_inter_as_cmd
,
1210 "no mpls-te inter-as",
1212 "Disable the MPLS-TE functionality\n"
1213 "Disable MPLS-TE Inter-AS support\n")
1216 vty_outln (vty
, "Not yet supported");
1220 DEFUN (show_isis_mpls_te_router
,
1221 show_isis_mpls_te_router_cmd
,
1222 "show isis mpls-te router",
1226 "Router information\n")
1228 if (IS_MPLS_TE(isisMplsTE
))
1230 vty_outln (vty
, "--- MPLS-TE router parameters ---");
1232 if (ntohs (isisMplsTE
.router_id
.s_addr
) != 0)
1233 vty_outln (vty
, " Router-Address: %s",
1234 inet_ntoa(isisMplsTE
.router_id
));
1236 vty_outln (vty
, " N/A");
1239 vty_outln (vty
, " MPLS-TE is disable on this router");
1245 show_mpls_te_sub (struct vty
*vty
, struct interface
*ifp
)
1247 struct mpls_te_circuit
*mtc
;
1249 if ((IS_MPLS_TE(isisMplsTE
))
1250 && ((mtc
= lookup_mpls_params_by_ifp (ifp
)) != NULL
))
1252 /* Continue only if interface is not passive or support Inter-AS TEv2 */
1253 if (mtc
->status
!= enable
)
1255 if (IS_INTER_AS(mtc
->type
))
1257 vty_outln (vty
, "-- Inter-AS TEv2 link parameters for %s --",
1262 /* MPLS-TE is not activate on this interface */
1263 /* or this interface is passive and Inter-AS TEv2 is not activate */
1264 vty_outln (vty
, " %s: MPLS-TE is disabled on this interface",
1271 vty_outln (vty
, "-- MPLS-TE link parameters for %s --",
1275 show_vty_subtlv_admin_grp (vty
, &mtc
->admin_grp
);
1277 if (SUBTLV_TYPE(mtc
->local_ipaddr
) != 0)
1278 show_vty_subtlv_local_ipaddr (vty
, &mtc
->local_ipaddr
);
1279 if (SUBTLV_TYPE(mtc
->rmt_ipaddr
) != 0)
1280 show_vty_subtlv_rmt_ipaddr (vty
, &mtc
->rmt_ipaddr
);
1282 show_vty_subtlv_max_bw (vty
, &mtc
->max_bw
);
1283 show_vty_subtlv_max_rsv_bw (vty
, &mtc
->max_rsv_bw
);
1284 show_vty_subtlv_unrsv_bw (vty
, &mtc
->unrsv_bw
);
1285 show_vty_subtlv_te_metric (vty
, &mtc
->te_metric
);
1287 if (IS_INTER_AS(mtc
->type
))
1289 if (SUBTLV_TYPE(mtc
->ras
) != 0)
1290 show_vty_subtlv_ras (vty
, &mtc
->ras
);
1291 if (SUBTLV_TYPE(mtc
->rip
) != 0)
1292 show_vty_subtlv_rip (vty
, &mtc
->rip
);
1295 show_vty_subtlv_av_delay (vty
, &mtc
->av_delay
);
1296 show_vty_subtlv_mm_delay (vty
, &mtc
->mm_delay
);
1297 show_vty_subtlv_delay_var (vty
, &mtc
->delay_var
);
1298 show_vty_subtlv_pkt_loss (vty
, &mtc
->pkt_loss
);
1299 show_vty_subtlv_res_bw (vty
, &mtc
->res_bw
);
1300 show_vty_subtlv_ava_bw (vty
, &mtc
->ava_bw
);
1301 show_vty_subtlv_use_bw (vty
, &mtc
->use_bw
);
1302 vty_outln (vty
, "---------------%s", VTYNL
);
1306 vty_outln (vty
, " %s: MPLS-TE is disabled on this interface",
1313 DEFUN (show_isis_mpls_te_interface
,
1314 show_isis_mpls_te_interface_cmd
,
1315 "show isis mpls-te interface [INTERFACE]",
1319 "Interface information\n"
1322 int idx_interface
= 4;
1323 struct interface
*ifp
;
1324 struct listnode
*node
;
1326 /* Show All Interfaces. */
1329 for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT
), node
, ifp
))
1330 show_mpls_te_sub (vty
, ifp
);
1332 /* Interface name is specified. */
1335 if ((ifp
= if_lookup_by_name (argv
[idx_interface
]->arg
, VRF_DEFAULT
)) == NULL
)
1336 vty_outln (vty
, "No such interface name");
1338 show_mpls_te_sub (vty
, ifp
);
1344 /* Initialize MPLS_TE */
1346 isis_mpls_te_init (void)
1349 zlog_debug("ISIS MPLS-TE: Initialize");
1351 /* Initialize MPLS_TE structure */
1352 isisMplsTE
.status
= disable
;
1353 isisMplsTE
.level
= 0;
1354 isisMplsTE
.inter_as
= off
;
1355 isisMplsTE
.interas_areaid
.s_addr
= 0;
1356 isisMplsTE
.cir_list
= list_new();
1357 isisMplsTE
.router_id
.s_addr
= 0;
1359 /* Register new VTY commands */
1360 install_element (VIEW_NODE
, &show_isis_mpls_te_router_cmd
);
1361 install_element (VIEW_NODE
, &show_isis_mpls_te_interface_cmd
);
1363 install_element (ISIS_NODE
, &isis_mpls_te_on_cmd
);
1364 install_element (ISIS_NODE
, &no_isis_mpls_te_on_cmd
);
1365 install_element (ISIS_NODE
, &isis_mpls_te_router_addr_cmd
);
1366 install_element (ISIS_NODE
, &isis_mpls_te_inter_as_cmd
);
1367 install_element (ISIS_NODE
, &no_isis_mpls_te_inter_as_cmd
);