2 * Copyright (C) 2001,2002 Sampo Saaristo
3 * Tampere University of Technology
4 * Institute of Communications Engineering
5 * Copyright (C) 2018 Volta Networks
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "northbound.h"
32 #include "spf_backoff.h"
33 #include "lib_errors.h"
38 #include "isisd/isisd.h"
39 #include "isisd/isis_nb.h"
40 #include "isisd/isis_common.h"
41 #include "isisd/isis_bfd.h"
42 #include "isisd/isis_circuit.h"
43 #include "isisd/isis_lsp.h"
44 #include "isisd/isis_dynhn.h"
45 #include "isisd/isis_misc.h"
46 #include "isisd/isis_csm.h"
47 #include "isisd/isis_adjacency.h"
48 #include "isisd/isis_spf.h"
49 #include "isisd/isis_spf_private.h"
50 #include "isisd/isis_te.h"
51 #include "isisd/isis_mt.h"
52 #include "isisd/isis_redist.h"
53 #include "isisd/isis_ldp_sync.h"
54 #include "isisd/isis_dr.h"
56 DEFINE_MTYPE_STATIC(ISISD
, ISIS_MPLS_TE
, "ISIS MPLS_TE parameters");
57 DEFINE_MTYPE_STATIC(ISISD
, ISIS_PLIST_NAME
, "ISIS prefix-list name");
59 extern struct zclient
*zclient
;
62 * XPath: /frr-isisd:isis/instance
64 int isis_instance_create(struct nb_cb_create_args
*args
)
66 struct isis_area
*area
;
70 if (args
->event
!= NB_EV_APPLY
)
72 vrf_name
= yang_dnode_get_string(args
->dnode
, "./vrf");
73 area_tag
= yang_dnode_get_string(args
->dnode
, "./area-tag");
74 isis_global_instance_create(vrf_name
);
75 area
= isis_area_lookup_by_vrf(area_tag
, vrf_name
);
77 return NB_ERR_INCONSISTENCY
;
79 area
= isis_area_create(area_tag
, vrf_name
);
81 /* save area in dnode to avoid looking it up all the time */
82 nb_running_set_entry(args
->dnode
, area
);
87 int isis_instance_destroy(struct nb_cb_destroy_args
*args
)
89 struct isis_area
*area
;
92 if (args
->event
!= NB_EV_APPLY
)
94 area
= nb_running_unset_entry(args
->dnode
);
95 vrf_id
= area
->isis
->vrf_id
;
97 /* remove ldp-sync config */
98 if (vrf_id
== VRF_DEFAULT
)
99 isis_ldp_sync_gbl_exit(true);
101 isis_area_destroy(area
);
106 * XPath: /frr-isisd:isis/instance/is-type
108 int isis_instance_is_type_modify(struct nb_cb_modify_args
*args
)
110 struct isis_area
*area
;
113 if (args
->event
!= NB_EV_APPLY
)
116 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
117 type
= yang_dnode_get_enum(args
->dnode
, NULL
);
118 isis_area_is_type_set(area
, type
);
124 * XPath: /frr-isisd:isis/instance/area-address
126 int isis_instance_area_address_create(struct nb_cb_create_args
*args
)
128 struct isis_area
*area
;
129 struct area_addr addr
, *addrr
= NULL
, *addrp
= NULL
;
130 struct listnode
*node
;
132 const char *net_title
= yang_dnode_get_string(args
->dnode
, NULL
);
134 switch (args
->event
) {
136 area
= nb_running_get_entry(args
->dnode
, NULL
, false);
138 return NB_ERR_VALIDATION
;
139 addr
.addr_len
= dotformat2buff(buff
, net_title
);
140 memcpy(addr
.area_addr
, buff
, addr
.addr_len
);
141 if (addr
.area_addr
[addr
.addr_len
- 1] != 0) {
143 args
->errmsg
, args
->errmsg_len
,
144 "nsel byte (last byte) in area address must be 0");
145 return NB_ERR_VALIDATION
;
147 if (area
->isis
->sysid_set
) {
148 /* Check that the SystemID portions match */
149 if (memcmp(area
->isis
->sysid
, GETSYSID((&addr
)),
152 args
->errmsg
, args
->errmsg_len
,
153 "System ID must not change when defining additional area addresses");
154 return NB_ERR_VALIDATION
;
159 addrr
= XMALLOC(MTYPE_ISIS_AREA_ADDR
, sizeof(struct area_addr
));
160 addrr
->addr_len
= dotformat2buff(buff
, net_title
);
161 memcpy(addrr
->area_addr
, buff
, addrr
->addr_len
);
162 args
->resource
->ptr
= addrr
;
165 XFREE(MTYPE_ISIS_AREA_ADDR
, args
->resource
->ptr
);
168 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
169 addrr
= args
->resource
->ptr
;
172 if (area
->isis
->sysid_set
== 0) {
174 * First area address - get the SystemID for this router
176 memcpy(area
->isis
->sysid
, GETSYSID(addrr
),
178 area
->isis
->sysid_set
= 1;
180 /* check that we don't already have this address */
181 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node
,
183 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
185 != (addrr
->addr_len
))
187 if (!memcmp(addrp
->area_addr
, addrr
->area_addr
,
189 XFREE(MTYPE_ISIS_AREA_ADDR
, addrr
);
190 return NB_OK
; /* silent fail */
195 /*Forget the systemID part of the address */
196 addrr
->addr_len
-= (ISIS_SYS_ID_LEN
+ ISIS_NSEL_LEN
);
197 assert(area
->area_addrs
); /* to silence scan-build sillyness */
198 listnode_add(area
->area_addrs
, addrr
);
200 /* only now we can safely generate our LSPs for this area */
201 if (listcount(area
->area_addrs
) > 0) {
202 if (area
->is_type
& IS_LEVEL_1
)
203 lsp_generate(area
, IS_LEVEL_1
);
204 if (area
->is_type
& IS_LEVEL_2
)
205 lsp_generate(area
, IS_LEVEL_2
);
213 int isis_instance_area_address_destroy(struct nb_cb_destroy_args
*args
)
215 struct area_addr addr
, *addrp
= NULL
;
216 struct listnode
*node
;
218 struct isis_area
*area
;
219 const char *net_title
;
220 struct listnode
*cnode
;
221 struct isis_circuit
*circuit
;
224 if (args
->event
!= NB_EV_APPLY
)
227 net_title
= yang_dnode_get_string(args
->dnode
, NULL
);
228 addr
.addr_len
= dotformat2buff(buff
, net_title
);
229 memcpy(addr
.area_addr
, buff
, (int)addr
.addr_len
);
230 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
232 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node
, addrp
)) {
233 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ 1) == addr
.addr_len
234 && !memcmp(addrp
->area_addr
, addr
.area_addr
, addr
.addr_len
))
238 return NB_ERR_INCONSISTENCY
;
240 listnode_delete(area
->area_addrs
, addrp
);
241 XFREE(MTYPE_ISIS_AREA_ADDR
, addrp
);
243 * Last area address - reset the SystemID for this router
245 if (listcount(area
->area_addrs
) == 0) {
246 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, cnode
, circuit
))
247 for (lvl
= IS_LEVEL_1
; lvl
<= IS_LEVEL_2
; ++lvl
) {
248 if (circuit
->u
.bc
.is_dr
[lvl
- 1])
249 isis_dr_resign(circuit
, lvl
);
251 memset(area
->isis
->sysid
, 0, ISIS_SYS_ID_LEN
);
252 area
->isis
->sysid_set
= 0;
254 zlog_debug("Router has no SystemID");
261 * XPath: /frr-isisd:isis/instance/dynamic-hostname
263 int isis_instance_dynamic_hostname_modify(struct nb_cb_modify_args
*args
)
265 struct isis_area
*area
;
267 if (args
->event
!= NB_EV_APPLY
)
270 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
271 isis_area_dynhostname_set(area
, yang_dnode_get_bool(args
->dnode
, NULL
));
277 * XPath: /frr-isisd:isis/instance/attach-send
279 int isis_instance_attached_send_modify(struct nb_cb_modify_args
*args
)
281 struct isis_area
*area
;
284 if (args
->event
!= NB_EV_APPLY
)
287 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
288 attached
= yang_dnode_get_bool(args
->dnode
, NULL
);
289 isis_area_attached_bit_send_set(area
, attached
);
295 * XPath: /frr-isisd:isis/instance/attach-receive-ignore
297 int isis_instance_attached_receive_modify(struct nb_cb_modify_args
*args
)
299 struct isis_area
*area
;
302 if (args
->event
!= NB_EV_APPLY
)
305 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
306 attached
= yang_dnode_get_bool(args
->dnode
, NULL
);
307 isis_area_attached_bit_receive_set(area
, attached
);
313 * XPath: /frr-isisd:isis/instance/attached
315 int isis_instance_attached_modify(struct nb_cb_modify_args
*args
)
321 * XPath: /frr-isisd:isis/instance/overload
323 int isis_instance_overload_modify(struct nb_cb_modify_args
*args
)
325 struct isis_area
*area
;
328 if (args
->event
!= NB_EV_APPLY
)
331 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
332 overload
= yang_dnode_get_bool(args
->dnode
, NULL
);
333 isis_area_overload_bit_set(area
, overload
);
339 * XPath: /frr-isisd:isis/instance/metric-style
341 int isis_instance_metric_style_modify(struct nb_cb_modify_args
*args
)
343 struct isis_area
*area
;
344 bool old_metric
, new_metric
;
345 enum isis_metric_style metric_style
=
346 yang_dnode_get_enum(args
->dnode
, NULL
);
348 if (args
->event
!= NB_EV_APPLY
)
351 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
352 old_metric
= (metric_style
== ISIS_WIDE_METRIC
) ? false : true;
353 new_metric
= (metric_style
== ISIS_NARROW_METRIC
) ? false : true;
354 isis_area_metricstyle_set(area
, old_metric
, new_metric
);
360 * XPath: /frr-isisd:isis/instance/purge-originator
362 int isis_instance_purge_originator_modify(struct nb_cb_modify_args
*args
)
364 struct isis_area
*area
;
366 if (args
->event
!= NB_EV_APPLY
)
369 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
370 area
->purge_originator
= yang_dnode_get_bool(args
->dnode
, NULL
);
376 * XPath: /frr-isisd:isis/instance/lsp/mtu
378 int isis_instance_lsp_mtu_modify(struct nb_cb_modify_args
*args
)
380 struct listnode
*node
;
381 struct isis_circuit
*circuit
;
382 uint16_t lsp_mtu
= yang_dnode_get_uint16(args
->dnode
, NULL
);
383 struct isis_area
*area
;
385 switch (args
->event
) {
387 area
= nb_running_get_entry(args
->dnode
, NULL
, false);
390 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
)) {
391 if (circuit
->state
!= C_STATE_INIT
392 && circuit
->state
!= C_STATE_UP
)
394 if (lsp_mtu
> isis_circuit_pdu_size(circuit
)) {
396 args
->errmsg
, args
->errmsg_len
,
397 "ISIS area contains circuit %s, which has a maximum PDU size of %zu",
398 circuit
->interface
->name
,
399 isis_circuit_pdu_size(circuit
));
400 return NB_ERR_VALIDATION
;
408 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
409 isis_area_lsp_mtu_set(area
, lsp_mtu
);
417 * XPath: /frr-isisd:isis/instance/lsp/timers/level-1/refresh-interval
419 int isis_instance_lsp_refresh_interval_level_1_modify(
420 struct nb_cb_modify_args
*args
)
422 struct isis_area
*area
;
425 if (args
->event
!= NB_EV_APPLY
)
428 refr_int
= yang_dnode_get_uint16(args
->dnode
, NULL
);
429 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
430 isis_area_lsp_refresh_set(area
, IS_LEVEL_1
, refr_int
);
436 * XPath: /frr-isisd:isis/instance/lsp/timers/level-2/refresh-interval
438 int isis_instance_lsp_refresh_interval_level_2_modify(
439 struct nb_cb_modify_args
*args
)
441 struct isis_area
*area
;
444 if (args
->event
!= NB_EV_APPLY
)
447 refr_int
= yang_dnode_get_uint16(args
->dnode
, NULL
);
448 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
449 isis_area_lsp_refresh_set(area
, IS_LEVEL_2
, refr_int
);
455 * XPath: /frr-isisd:isis/instance/lsp/timers/level-1/maximum-lifetime
457 int isis_instance_lsp_maximum_lifetime_level_1_modify(
458 struct nb_cb_modify_args
*args
)
460 struct isis_area
*area
;
463 if (args
->event
!= NB_EV_APPLY
)
466 max_lt
= yang_dnode_get_uint16(args
->dnode
, NULL
);
467 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
468 isis_area_max_lsp_lifetime_set(area
, IS_LEVEL_1
, max_lt
);
474 * XPath: /frr-isisd:isis/instance/lsp/timers/level-2/maximum-lifetime
476 int isis_instance_lsp_maximum_lifetime_level_2_modify(
477 struct nb_cb_modify_args
*args
)
479 struct isis_area
*area
;
482 if (args
->event
!= NB_EV_APPLY
)
485 max_lt
= yang_dnode_get_uint16(args
->dnode
, NULL
);
486 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
487 isis_area_max_lsp_lifetime_set(area
, IS_LEVEL_2
, max_lt
);
493 * XPath: /frr-isisd:isis/instance/lsp/timers/level-1/generation-interval
495 int isis_instance_lsp_generation_interval_level_1_modify(
496 struct nb_cb_modify_args
*args
)
498 struct isis_area
*area
;
501 if (args
->event
!= NB_EV_APPLY
)
504 gen_int
= yang_dnode_get_uint16(args
->dnode
, NULL
);
505 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
506 area
->lsp_gen_interval
[0] = gen_int
;
512 * XPath: /frr-isisd:isis/instance/lsp/timers/level-2/generation-interval
514 int isis_instance_lsp_generation_interval_level_2_modify(
515 struct nb_cb_modify_args
*args
)
517 struct isis_area
*area
;
520 if (args
->event
!= NB_EV_APPLY
)
523 gen_int
= yang_dnode_get_uint16(args
->dnode
, NULL
);
524 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
525 area
->lsp_gen_interval
[1] = gen_int
;
531 * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay
533 void ietf_backoff_delay_apply_finish(struct nb_cb_apply_finish_args
*args
)
535 long init_delay
= yang_dnode_get_uint16(args
->dnode
, "./init-delay");
536 long short_delay
= yang_dnode_get_uint16(args
->dnode
, "./short-delay");
537 long long_delay
= yang_dnode_get_uint16(args
->dnode
, "./long-delay");
538 long holddown
= yang_dnode_get_uint16(args
->dnode
, "./hold-down");
540 yang_dnode_get_uint16(args
->dnode
, "./time-to-learn");
541 struct isis_area
*area
= nb_running_get_entry(args
->dnode
, NULL
, true);
542 size_t bufsiz
= strlen(area
->area_tag
) + sizeof("IS-IS Lx");
543 char *buf
= XCALLOC(MTYPE_TMP
, bufsiz
);
545 snprintf(buf
, bufsiz
, "IS-IS %s L1", area
->area_tag
);
546 spf_backoff_free(area
->spf_delay_ietf
[0]);
547 area
->spf_delay_ietf
[0] =
548 spf_backoff_new(master
, buf
, init_delay
, short_delay
,
549 long_delay
, holddown
, timetolearn
);
551 snprintf(buf
, bufsiz
, "IS-IS %s L2", area
->area_tag
);
552 spf_backoff_free(area
->spf_delay_ietf
[1]);
553 area
->spf_delay_ietf
[1] =
554 spf_backoff_new(master
, buf
, init_delay
, short_delay
,
555 long_delay
, holddown
, timetolearn
);
557 XFREE(MTYPE_TMP
, buf
);
560 int isis_instance_spf_ietf_backoff_delay_create(struct nb_cb_create_args
*args
)
562 /* All the work is done in the apply_finish */
566 int isis_instance_spf_ietf_backoff_delay_destroy(
567 struct nb_cb_destroy_args
*args
)
569 struct isis_area
*area
;
571 if (args
->event
!= NB_EV_APPLY
)
574 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
575 spf_backoff_free(area
->spf_delay_ietf
[0]);
576 spf_backoff_free(area
->spf_delay_ietf
[1]);
577 area
->spf_delay_ietf
[0] = NULL
;
578 area
->spf_delay_ietf
[1] = NULL
;
584 * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/init-delay
586 int isis_instance_spf_ietf_backoff_delay_init_delay_modify(
587 struct nb_cb_modify_args
*args
)
589 /* All the work is done in the apply_finish */
594 * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/short-delay
596 int isis_instance_spf_ietf_backoff_delay_short_delay_modify(
597 struct nb_cb_modify_args
*args
)
599 /* All the work is done in the apply_finish */
604 * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/long-delay
606 int isis_instance_spf_ietf_backoff_delay_long_delay_modify(
607 struct nb_cb_modify_args
*args
)
609 /* All the work is done in the apply_finish */
614 * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/hold-down
616 int isis_instance_spf_ietf_backoff_delay_hold_down_modify(
617 struct nb_cb_modify_args
*args
)
619 /* All the work is done in the apply_finish */
624 * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/time-to-learn
626 int isis_instance_spf_ietf_backoff_delay_time_to_learn_modify(
627 struct nb_cb_modify_args
*args
)
629 /* All the work is done in the apply_finish */
634 * XPath: /frr-isisd:isis/instance/spf/minimum-interval/level-1
636 int isis_instance_spf_minimum_interval_level_1_modify(
637 struct nb_cb_modify_args
*args
)
639 struct isis_area
*area
;
641 if (args
->event
!= NB_EV_APPLY
)
644 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
645 area
->min_spf_interval
[0] = yang_dnode_get_uint16(args
->dnode
, NULL
);
651 * XPath: /frr-isisd:isis/instance/spf/minimum-interval/level-2
653 int isis_instance_spf_minimum_interval_level_2_modify(
654 struct nb_cb_modify_args
*args
)
656 struct isis_area
*area
;
658 if (args
->event
!= NB_EV_APPLY
)
661 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
662 area
->min_spf_interval
[1] = yang_dnode_get_uint16(args
->dnode
, NULL
);
669 * /frr-isisd:isis/instance/spf/prefix-priorities/critical/access-list-name
671 int isis_instance_spf_prefix_priorities_critical_access_list_name_modify(
672 struct nb_cb_modify_args
*args
)
674 struct isis_area
*area
;
675 const char *acl_name
;
676 struct spf_prefix_priority_acl
*ppa
;
678 if (args
->event
!= NB_EV_APPLY
)
681 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
682 acl_name
= yang_dnode_get_string(args
->dnode
, NULL
);
684 ppa
= &area
->spf_prefix_priorities
[SPF_PREFIX_PRIO_CRITICAL
];
685 XFREE(MTYPE_ISIS_ACL_NAME
, ppa
->name
);
686 ppa
->name
= XSTRDUP(MTYPE_ISIS_ACL_NAME
, acl_name
);
687 ppa
->list_v4
= access_list_lookup(AFI_IP
, acl_name
);
688 ppa
->list_v6
= access_list_lookup(AFI_IP6
, acl_name
);
689 lsp_regenerate_schedule(area
, area
->is_type
, 0);
694 int isis_instance_spf_prefix_priorities_critical_access_list_name_destroy(
695 struct nb_cb_destroy_args
*args
)
697 struct isis_area
*area
;
698 struct spf_prefix_priority_acl
*ppa
;
700 if (args
->event
!= NB_EV_APPLY
)
703 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
705 ppa
= &area
->spf_prefix_priorities
[SPF_PREFIX_PRIO_CRITICAL
];
706 XFREE(MTYPE_ISIS_ACL_NAME
, ppa
->name
);
709 lsp_regenerate_schedule(area
, area
->is_type
, 0);
715 * XPath: /frr-isisd:isis/instance/spf/prefix-priorities/high/access-list-name
717 int isis_instance_spf_prefix_priorities_high_access_list_name_modify(
718 struct nb_cb_modify_args
*args
)
720 struct isis_area
*area
;
721 const char *acl_name
;
722 struct spf_prefix_priority_acl
*ppa
;
724 if (args
->event
!= NB_EV_APPLY
)
727 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
728 acl_name
= yang_dnode_get_string(args
->dnode
, NULL
);
730 ppa
= &area
->spf_prefix_priorities
[SPF_PREFIX_PRIO_HIGH
];
731 XFREE(MTYPE_ISIS_ACL_NAME
, ppa
->name
);
732 ppa
->name
= XSTRDUP(MTYPE_ISIS_ACL_NAME
, acl_name
);
733 ppa
->list_v4
= access_list_lookup(AFI_IP
, acl_name
);
734 ppa
->list_v6
= access_list_lookup(AFI_IP6
, acl_name
);
735 lsp_regenerate_schedule(area
, area
->is_type
, 0);
740 int isis_instance_spf_prefix_priorities_high_access_list_name_destroy(
741 struct nb_cb_destroy_args
*args
)
743 struct isis_area
*area
;
744 struct spf_prefix_priority_acl
*ppa
;
746 if (args
->event
!= NB_EV_APPLY
)
749 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
751 ppa
= &area
->spf_prefix_priorities
[SPF_PREFIX_PRIO_HIGH
];
752 XFREE(MTYPE_ISIS_ACL_NAME
, ppa
->name
);
755 lsp_regenerate_schedule(area
, area
->is_type
, 0);
761 * XPath: /frr-isisd:isis/instance/spf/prefix-priorities/medium/access-list-name
763 int isis_instance_spf_prefix_priorities_medium_access_list_name_modify(
764 struct nb_cb_modify_args
*args
)
766 struct isis_area
*area
;
767 const char *acl_name
;
768 struct spf_prefix_priority_acl
*ppa
;
770 if (args
->event
!= NB_EV_APPLY
)
773 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
774 acl_name
= yang_dnode_get_string(args
->dnode
, NULL
);
776 ppa
= &area
->spf_prefix_priorities
[SPF_PREFIX_PRIO_MEDIUM
];
777 XFREE(MTYPE_ISIS_ACL_NAME
, ppa
->name
);
778 ppa
->name
= XSTRDUP(MTYPE_ISIS_ACL_NAME
, acl_name
);
779 ppa
->list_v4
= access_list_lookup(AFI_IP
, acl_name
);
780 ppa
->list_v6
= access_list_lookup(AFI_IP6
, acl_name
);
781 lsp_regenerate_schedule(area
, area
->is_type
, 0);
786 int isis_instance_spf_prefix_priorities_medium_access_list_name_destroy(
787 struct nb_cb_destroy_args
*args
)
789 struct isis_area
*area
;
790 struct spf_prefix_priority_acl
*ppa
;
792 if (args
->event
!= NB_EV_APPLY
)
795 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
797 ppa
= &area
->spf_prefix_priorities
[SPF_PREFIX_PRIO_MEDIUM
];
798 XFREE(MTYPE_ISIS_ACL_NAME
, ppa
->name
);
801 lsp_regenerate_schedule(area
, area
->is_type
, 0);
807 * XPath: /frr-isisd:isis/instance/area-password
809 void area_password_apply_finish(struct nb_cb_apply_finish_args
*args
)
811 const char *password
= yang_dnode_get_string(args
->dnode
, "./password");
812 struct isis_area
*area
= nb_running_get_entry(args
->dnode
, NULL
, true);
813 int pass_type
= yang_dnode_get_enum(args
->dnode
, "./password-type");
815 yang_dnode_get_enum(args
->dnode
, "./authenticate-snp");
818 case ISIS_PASSWD_TYPE_CLEARTXT
:
819 isis_area_passwd_cleartext_set(area
, IS_LEVEL_1
, password
,
822 case ISIS_PASSWD_TYPE_HMAC_MD5
:
823 isis_area_passwd_hmac_md5_set(area
, IS_LEVEL_1
, password
,
829 int isis_instance_area_password_create(struct nb_cb_create_args
*args
)
831 /* actual setting is done in apply_finish */
835 int isis_instance_area_password_destroy(struct nb_cb_destroy_args
*args
)
837 struct isis_area
*area
;
839 if (args
->event
!= NB_EV_APPLY
)
842 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
843 isis_area_passwd_unset(area
, IS_LEVEL_1
);
849 * XPath: /frr-isisd:isis/instance/area-password/password
851 int isis_instance_area_password_password_modify(struct nb_cb_modify_args
*args
)
853 /* actual setting is done in apply_finish */
858 * XPath: /frr-isisd:isis/instance/area-password/password-type
860 int isis_instance_area_password_password_type_modify(
861 struct nb_cb_modify_args
*args
)
863 /* actual setting is done in apply_finish */
868 * XPath: /frr-isisd:isis/instance/area-password/authenticate-snp
870 int isis_instance_area_password_authenticate_snp_modify(
871 struct nb_cb_modify_args
*args
)
873 /* actual setting is done in apply_finish */
878 * XPath: /frr-isisd:isis/instance/domain-password
880 void domain_password_apply_finish(struct nb_cb_apply_finish_args
*args
)
882 const char *password
= yang_dnode_get_string(args
->dnode
, "./password");
883 struct isis_area
*area
= nb_running_get_entry(args
->dnode
, NULL
, true);
884 int pass_type
= yang_dnode_get_enum(args
->dnode
, "./password-type");
886 yang_dnode_get_enum(args
->dnode
, "./authenticate-snp");
889 case ISIS_PASSWD_TYPE_CLEARTXT
:
890 isis_area_passwd_cleartext_set(area
, IS_LEVEL_2
, password
,
893 case ISIS_PASSWD_TYPE_HMAC_MD5
:
894 isis_area_passwd_hmac_md5_set(area
, IS_LEVEL_2
, password
,
900 int isis_instance_domain_password_create(struct nb_cb_create_args
*args
)
902 /* actual setting is done in apply_finish */
906 int isis_instance_domain_password_destroy(struct nb_cb_destroy_args
*args
)
908 struct isis_area
*area
;
910 if (args
->event
!= NB_EV_APPLY
)
913 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
914 isis_area_passwd_unset(area
, IS_LEVEL_2
);
920 * XPath: /frr-isisd:isis/instance/domain-password/password
922 int isis_instance_domain_password_password_modify(
923 struct nb_cb_modify_args
*args
)
925 /* actual setting is done in apply_finish */
930 * XPath: /frr-isisd:isis/instance/domain-password/password-type
932 int isis_instance_domain_password_password_type_modify(
933 struct nb_cb_modify_args
*args
)
935 /* actual setting is done in apply_finish */
940 * XPath: /frr-isisd:isis/instance/domain-password/authenticate-snp
942 int isis_instance_domain_password_authenticate_snp_modify(
943 struct nb_cb_modify_args
*args
)
945 /* actual setting is done in apply_finish */
950 * XPath: /frr-isisd:isis/instance/default-information-originate/ipv4
952 void default_info_origin_apply_finish(const struct lyd_node
*dnode
, int family
)
954 int originate_type
= DEFAULT_ORIGINATE
;
955 unsigned long metric
= 0;
956 const char *routemap
= NULL
;
957 struct isis_area
*area
= nb_running_get_entry(dnode
, NULL
, true);
958 int level
= yang_dnode_get_enum(dnode
, "./level");
960 if (yang_dnode_get_bool(dnode
, "./always")) {
961 originate_type
= DEFAULT_ORIGINATE_ALWAYS
;
962 } else if (family
== AF_INET6
) {
964 "%s: Zebra doesn't implement default-originate for IPv6 yet, so use with care or use default-originate always.",
968 if (yang_dnode_exists(dnode
, "./metric"))
969 metric
= yang_dnode_get_uint32(dnode
, "./metric");
970 if (yang_dnode_exists(dnode
, "./route-map"))
971 routemap
= yang_dnode_get_string(dnode
, "./route-map");
973 isis_redist_set(area
, level
, family
, DEFAULT_ROUTE
, metric
, routemap
,
977 void default_info_origin_ipv4_apply_finish(struct nb_cb_apply_finish_args
*args
)
979 default_info_origin_apply_finish(args
->dnode
, AF_INET
);
982 void default_info_origin_ipv6_apply_finish(struct nb_cb_apply_finish_args
*args
)
984 default_info_origin_apply_finish(args
->dnode
, AF_INET6
);
987 int isis_instance_default_information_originate_ipv4_create(
988 struct nb_cb_create_args
*args
)
990 /* It's all done by default_info_origin_apply_finish */
994 int isis_instance_default_information_originate_ipv4_destroy(
995 struct nb_cb_destroy_args
*args
)
997 struct isis_area
*area
;
1000 if (args
->event
!= NB_EV_APPLY
)
1003 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1004 level
= yang_dnode_get_enum(args
->dnode
, "./level");
1005 isis_redist_unset(area
, level
, AF_INET
, DEFAULT_ROUTE
);
1011 * XPath: /frr-isisd:isis/instance/default-information-originate/ipv4/always
1013 int isis_instance_default_information_originate_ipv4_always_modify(
1014 struct nb_cb_modify_args
*args
)
1016 /* It's all done by default_info_origin_apply_finish */
1021 * XPath: /frr-isisd:isis/instance/default-information-originate/ipv4/route-map
1023 int isis_instance_default_information_originate_ipv4_route_map_modify(
1024 struct nb_cb_modify_args
*args
)
1026 /* It's all done by default_info_origin_apply_finish */
1030 int isis_instance_default_information_originate_ipv4_route_map_destroy(
1031 struct nb_cb_destroy_args
*args
)
1033 /* It's all done by default_info_origin_apply_finish */
1038 * XPath: /frr-isisd:isis/instance/default-information-originate/ipv4/metric
1040 int isis_instance_default_information_originate_ipv4_metric_modify(
1041 struct nb_cb_modify_args
*args
)
1043 /* It's all done by default_info_origin_apply_finish */
1048 * XPath: /frr-isisd:isis/instance/default-information-originate/ipv6
1050 int isis_instance_default_information_originate_ipv6_create(
1051 struct nb_cb_create_args
*args
)
1053 /* It's all done by default_info_origin_apply_finish */
1057 int isis_instance_default_information_originate_ipv6_destroy(
1058 struct nb_cb_destroy_args
*args
)
1060 struct isis_area
*area
;
1063 if (args
->event
!= NB_EV_APPLY
)
1066 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1067 level
= yang_dnode_get_enum(args
->dnode
, "./level");
1068 isis_redist_unset(area
, level
, AF_INET6
, DEFAULT_ROUTE
);
1074 * XPath: /frr-isisd:isis/instance/default-information-originate/ipv6/always
1076 int isis_instance_default_information_originate_ipv6_always_modify(
1077 struct nb_cb_modify_args
*args
)
1079 /* It's all done by default_info_origin_apply_finish */
1084 * XPath: /frr-isisd:isis/instance/default-information-originate/ipv6/route-map
1086 int isis_instance_default_information_originate_ipv6_route_map_modify(
1087 struct nb_cb_modify_args
*args
)
1089 /* It's all done by default_info_origin_apply_finish */
1093 int isis_instance_default_information_originate_ipv6_route_map_destroy(
1094 struct nb_cb_destroy_args
*args
)
1096 /* It's all done by default_info_origin_apply_finish */
1101 * XPath: /frr-isisd:isis/instance/default-information-originate/ipv6/metric
1103 int isis_instance_default_information_originate_ipv6_metric_modify(
1104 struct nb_cb_modify_args
*args
)
1106 /* It's all done by default_info_origin_apply_finish */
1111 * XPath: /frr-isisd:isis/instance/redistribute/ipv4
1113 void redistribute_apply_finish(const struct lyd_node
*dnode
, int family
)
1115 assert(family
== AF_INET
|| family
== AF_INET6
);
1117 unsigned long metric
= 0;
1118 const char *routemap
= NULL
;
1119 struct isis_area
*area
;
1121 type
= yang_dnode_get_enum(dnode
, "./protocol");
1122 level
= yang_dnode_get_enum(dnode
, "./level");
1123 area
= nb_running_get_entry(dnode
, NULL
, true);
1125 if (yang_dnode_exists(dnode
, "./metric"))
1126 metric
= yang_dnode_get_uint32(dnode
, "./metric");
1127 if (yang_dnode_exists(dnode
, "./route-map"))
1128 routemap
= yang_dnode_get_string(dnode
, "./route-map");
1130 isis_redist_set(area
, level
, family
, type
, metric
, routemap
, 0);
1133 void redistribute_ipv4_apply_finish(struct nb_cb_apply_finish_args
*args
)
1135 redistribute_apply_finish(args
->dnode
, AF_INET
);
1138 void redistribute_ipv6_apply_finish(struct nb_cb_apply_finish_args
*args
)
1140 redistribute_apply_finish(args
->dnode
, AF_INET6
);
1143 int isis_instance_redistribute_ipv4_create(struct nb_cb_create_args
*args
)
1145 /* It's all done by redistribute_apply_finish */
1149 int isis_instance_redistribute_ipv4_destroy(struct nb_cb_destroy_args
*args
)
1151 struct isis_area
*area
;
1154 if (args
->event
!= NB_EV_APPLY
)
1157 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1158 level
= yang_dnode_get_enum(args
->dnode
, "./level");
1159 type
= yang_dnode_get_enum(args
->dnode
, "./protocol");
1160 isis_redist_unset(area
, level
, AF_INET
, type
);
1166 * XPath: /frr-isisd:isis/instance/redistribute/ipv4/route-map
1168 int isis_instance_redistribute_ipv4_route_map_modify(
1169 struct nb_cb_modify_args
*args
)
1171 /* It's all done by redistribute_apply_finish */
1175 int isis_instance_redistribute_ipv4_route_map_destroy(
1176 struct nb_cb_destroy_args
*args
)
1178 /* It's all done by redistribute_apply_finish */
1183 * XPath: /frr-isisd:isis/instance/redistribute/ipv4/metric
1185 int isis_instance_redistribute_ipv4_metric_modify(
1186 struct nb_cb_modify_args
*args
)
1188 /* It's all done by redistribute_apply_finish */
1193 * XPath: /frr-isisd:isis/instance/redistribute/ipv6
1195 int isis_instance_redistribute_ipv6_create(struct nb_cb_create_args
*args
)
1197 /* It's all done by redistribute_apply_finish */
1201 int isis_instance_redistribute_ipv6_destroy(struct nb_cb_destroy_args
*args
)
1203 struct isis_area
*area
;
1206 if (args
->event
!= NB_EV_APPLY
)
1209 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1210 level
= yang_dnode_get_enum(args
->dnode
, "./level");
1211 type
= yang_dnode_get_enum(args
->dnode
, "./protocol");
1212 isis_redist_unset(area
, level
, AF_INET6
, type
);
1218 * XPath: /frr-isisd:isis/instance/redistribute/ipv6/route-map
1220 int isis_instance_redistribute_ipv6_route_map_modify(
1221 struct nb_cb_modify_args
*args
)
1223 /* It's all done by redistribute_apply_finish */
1227 int isis_instance_redistribute_ipv6_route_map_destroy(
1228 struct nb_cb_destroy_args
*args
)
1230 /* It's all done by redistribute_apply_finish */
1235 * XPath: /frr-isisd:isis/instance/redistribute/ipv6/metric
1237 int isis_instance_redistribute_ipv6_metric_modify(
1238 struct nb_cb_modify_args
*args
)
1240 /* It's all done by redistribute_apply_finish */
1245 * XPath: /frr-isisd:isis/instance/multi-topology/ipv4-multicast
1247 static int isis_multi_topology_common(enum nb_event event
,
1248 const struct lyd_node
*dnode
,
1249 char *errmsg
, size_t errmsg_len
,
1250 const char *topology
, bool create
)
1252 struct isis_area
*area
;
1253 struct isis_area_mt_setting
*setting
;
1254 uint16_t mtid
= isis_str2mtid(topology
);
1257 case NB_EV_VALIDATE
:
1258 if (mtid
== (uint16_t)-1) {
1259 snprintf(errmsg
, errmsg_len
, "Unknown topology %s",
1261 return NB_ERR_VALIDATION
;
1268 area
= nb_running_get_entry(dnode
, NULL
, true);
1269 setting
= area_get_mt_setting(area
, mtid
);
1270 setting
->enabled
= create
;
1271 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 0);
1278 static int isis_multi_topology_overload_common(enum nb_event event
,
1279 const struct lyd_node
*dnode
,
1280 const char *topology
)
1282 struct isis_area
*area
;
1283 struct isis_area_mt_setting
*setting
;
1284 uint16_t mtid
= isis_str2mtid(topology
);
1286 /* validation is done in isis_multi_topology_common */
1287 if (event
!= NB_EV_APPLY
)
1290 area
= nb_running_get_entry(dnode
, NULL
, true);
1291 setting
= area_get_mt_setting(area
, mtid
);
1292 setting
->overload
= yang_dnode_get_bool(dnode
, NULL
);
1293 if (setting
->enabled
)
1294 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 0);
1299 int isis_instance_multi_topology_ipv4_multicast_create(
1300 struct nb_cb_create_args
*args
)
1302 return isis_multi_topology_common(args
->event
, args
->dnode
,
1303 args
->errmsg
, args
->errmsg_len
,
1304 "ipv4-multicast", true);
1307 int isis_instance_multi_topology_ipv4_multicast_destroy(
1308 struct nb_cb_destroy_args
*args
)
1310 return isis_multi_topology_common(args
->event
, args
->dnode
,
1311 args
->errmsg
, args
->errmsg_len
,
1312 "ipv4-multicast", false);
1316 * XPath: /frr-isisd:isis/instance/multi-topology/ipv4-multicast/overload
1318 int isis_instance_multi_topology_ipv4_multicast_overload_modify(
1319 struct nb_cb_modify_args
*args
)
1321 return isis_multi_topology_overload_common(args
->event
, args
->dnode
,
1326 * XPath: /frr-isisd:isis/instance/multi-topology/ipv4-management
1328 int isis_instance_multi_topology_ipv4_management_create(
1329 struct nb_cb_create_args
*args
)
1331 return isis_multi_topology_common(args
->event
, args
->dnode
,
1332 args
->errmsg
, args
->errmsg_len
,
1336 int isis_instance_multi_topology_ipv4_management_destroy(
1337 struct nb_cb_destroy_args
*args
)
1339 return isis_multi_topology_common(args
->event
, args
->dnode
,
1340 args
->errmsg
, args
->errmsg_len
,
1341 "ipv4-mgmt", false);
1345 * XPath: /frr-isisd:isis/instance/multi-topology/ipv4-management/overload
1347 int isis_instance_multi_topology_ipv4_management_overload_modify(
1348 struct nb_cb_modify_args
*args
)
1350 return isis_multi_topology_overload_common(args
->event
, args
->dnode
,
1355 * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-unicast
1357 int isis_instance_multi_topology_ipv6_unicast_create(
1358 struct nb_cb_create_args
*args
)
1360 return isis_multi_topology_common(args
->event
, args
->dnode
,
1361 args
->errmsg
, args
->errmsg_len
,
1362 "ipv6-unicast", true);
1365 int isis_instance_multi_topology_ipv6_unicast_destroy(
1366 struct nb_cb_destroy_args
*args
)
1368 return isis_multi_topology_common(args
->event
, args
->dnode
,
1369 args
->errmsg
, args
->errmsg_len
,
1370 "ipv6-unicast", false);
1374 * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-unicast/overload
1376 int isis_instance_multi_topology_ipv6_unicast_overload_modify(
1377 struct nb_cb_modify_args
*args
)
1379 return isis_multi_topology_overload_common(args
->event
, args
->dnode
,
1384 * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-multicast
1386 int isis_instance_multi_topology_ipv6_multicast_create(
1387 struct nb_cb_create_args
*args
)
1389 return isis_multi_topology_common(args
->event
, args
->dnode
,
1390 args
->errmsg
, args
->errmsg_len
,
1391 "ipv6-multicast", true);
1394 int isis_instance_multi_topology_ipv6_multicast_destroy(
1395 struct nb_cb_destroy_args
*args
)
1397 return isis_multi_topology_common(args
->event
, args
->dnode
,
1398 args
->errmsg
, args
->errmsg_len
,
1399 "ipv6-multicast", false);
1403 * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-multicast/overload
1405 int isis_instance_multi_topology_ipv6_multicast_overload_modify(
1406 struct nb_cb_modify_args
*args
)
1408 return isis_multi_topology_overload_common(args
->event
, args
->dnode
,
1413 * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-management
1415 int isis_instance_multi_topology_ipv6_management_create(
1416 struct nb_cb_create_args
*args
)
1418 return isis_multi_topology_common(args
->event
, args
->dnode
,
1419 args
->errmsg
, args
->errmsg_len
,
1423 int isis_instance_multi_topology_ipv6_management_destroy(
1424 struct nb_cb_destroy_args
*args
)
1426 return isis_multi_topology_common(args
->event
, args
->dnode
,
1427 args
->errmsg
, args
->errmsg_len
,
1428 "ipv6-mgmt", false);
1432 * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-management/overload
1434 int isis_instance_multi_topology_ipv6_management_overload_modify(
1435 struct nb_cb_modify_args
*args
)
1437 return isis_multi_topology_overload_common(args
->event
, args
->dnode
,
1442 * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-dstsrc
1444 int isis_instance_multi_topology_ipv6_dstsrc_create(
1445 struct nb_cb_create_args
*args
)
1447 return isis_multi_topology_common(args
->event
, args
->dnode
,
1448 args
->errmsg
, args
->errmsg_len
,
1449 "ipv6-dstsrc", true);
1452 int isis_instance_multi_topology_ipv6_dstsrc_destroy(
1453 struct nb_cb_destroy_args
*args
)
1455 return isis_multi_topology_common(args
->event
, args
->dnode
,
1456 args
->errmsg
, args
->errmsg_len
,
1457 "ipv6-dstsrc", false);
1461 * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-dstsrc/overload
1463 int isis_instance_multi_topology_ipv6_dstsrc_overload_modify(
1464 struct nb_cb_modify_args
*args
)
1466 return isis_multi_topology_overload_common(args
->event
, args
->dnode
,
1471 * XPath: /frr-isisd:isis/instance/fast-reroute/level-1/lfa/load-sharing
1473 int isis_instance_fast_reroute_level_1_lfa_load_sharing_modify(
1474 struct nb_cb_modify_args
*args
)
1476 struct isis_area
*area
;
1478 if (args
->event
!= NB_EV_APPLY
)
1481 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1482 area
->lfa_load_sharing
[0] = yang_dnode_get_bool(args
->dnode
, NULL
);
1483 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1489 * XPath: /frr-isisd:isis/instance/fast-reroute/level-1/lfa/priority-limit
1491 int isis_instance_fast_reroute_level_1_lfa_priority_limit_modify(
1492 struct nb_cb_modify_args
*args
)
1494 struct isis_area
*area
;
1496 if (args
->event
!= NB_EV_APPLY
)
1499 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1500 area
->lfa_priority_limit
[0] = yang_dnode_get_enum(args
->dnode
, NULL
);
1501 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1506 int isis_instance_fast_reroute_level_1_lfa_priority_limit_destroy(
1507 struct nb_cb_destroy_args
*args
)
1509 struct isis_area
*area
;
1511 if (args
->event
!= NB_EV_APPLY
)
1514 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1515 area
->lfa_priority_limit
[0] = SPF_PREFIX_PRIO_LOW
;
1516 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1522 * XPath: /frr-isisd:isis/instance/fast-reroute/level-1/lfa/tiebreaker
1524 int isis_instance_fast_reroute_level_1_lfa_tiebreaker_create(
1525 struct nb_cb_create_args
*args
)
1527 struct isis_area
*area
;
1529 enum lfa_tiebreaker_type type
;
1530 struct lfa_tiebreaker
*tie_b
;
1532 if (args
->event
!= NB_EV_APPLY
)
1535 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1536 index
= yang_dnode_get_uint8(args
->dnode
, "./index");
1537 type
= yang_dnode_get_enum(args
->dnode
, "./type");
1539 tie_b
= isis_lfa_tiebreaker_add(area
, ISIS_LEVEL1
, index
, type
);
1540 nb_running_set_entry(args
->dnode
, tie_b
);
1541 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1546 int isis_instance_fast_reroute_level_1_lfa_tiebreaker_destroy(
1547 struct nb_cb_destroy_args
*args
)
1549 struct lfa_tiebreaker
*tie_b
;
1550 struct isis_area
*area
;
1552 if (args
->event
!= NB_EV_APPLY
)
1555 tie_b
= nb_running_unset_entry(args
->dnode
);
1557 isis_lfa_tiebreaker_delete(area
, ISIS_LEVEL1
, tie_b
);
1558 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1564 * XPath: /frr-isisd:isis/instance/fast-reroute/level-1/lfa/tiebreaker/type
1566 int isis_instance_fast_reroute_level_1_lfa_tiebreaker_type_modify(
1567 struct nb_cb_modify_args
*args
)
1569 struct lfa_tiebreaker
*tie_b
;
1570 struct isis_area
*area
;
1572 if (args
->event
!= NB_EV_APPLY
)
1575 tie_b
= nb_running_get_entry(args
->dnode
, NULL
, true);
1577 tie_b
->type
= yang_dnode_get_enum(args
->dnode
, NULL
);
1578 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1584 * XPath: /frr-isisd:isis/instance/fast-reroute/level-1/remote-lfa/prefix-list
1586 int isis_instance_fast_reroute_level_1_remote_lfa_prefix_list_modify(
1587 struct nb_cb_modify_args
*args
)
1589 struct isis_area
*area
;
1590 const char *plist_name
;
1592 if (args
->event
!= NB_EV_APPLY
)
1595 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1596 plist_name
= yang_dnode_get_string(args
->dnode
, NULL
);
1598 area
->rlfa_plist_name
[0] = XSTRDUP(MTYPE_ISIS_PLIST_NAME
, plist_name
);
1599 area
->rlfa_plist
[0] = prefix_list_lookup(AFI_IP
, plist_name
);
1600 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1605 int isis_instance_fast_reroute_level_1_remote_lfa_prefix_list_destroy(
1606 struct nb_cb_destroy_args
*args
)
1608 struct isis_area
*area
;
1610 if (args
->event
!= NB_EV_APPLY
)
1613 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1615 XFREE(MTYPE_ISIS_PLIST_NAME
, area
->rlfa_plist_name
[0]);
1616 area
->rlfa_plist
[0] = NULL
;
1617 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1623 * XPath: /frr-isisd:isis/instance/fast-reroute/level-2/lfa/load-sharing
1625 int isis_instance_fast_reroute_level_2_lfa_load_sharing_modify(
1626 struct nb_cb_modify_args
*args
)
1628 struct isis_area
*area
;
1630 if (args
->event
!= NB_EV_APPLY
)
1633 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1634 area
->lfa_load_sharing
[1] = yang_dnode_get_bool(args
->dnode
, NULL
);
1640 * XPath: /frr-isisd:isis/instance/fast-reroute/level-2/lfa/priority-limit
1642 int isis_instance_fast_reroute_level_2_lfa_priority_limit_modify(
1643 struct nb_cb_modify_args
*args
)
1645 struct isis_area
*area
;
1647 if (args
->event
!= NB_EV_APPLY
)
1650 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1651 area
->lfa_priority_limit
[1] = yang_dnode_get_enum(args
->dnode
, NULL
);
1656 int isis_instance_fast_reroute_level_2_lfa_priority_limit_destroy(
1657 struct nb_cb_destroy_args
*args
)
1659 struct isis_area
*area
;
1661 if (args
->event
!= NB_EV_APPLY
)
1664 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1665 area
->lfa_priority_limit
[1] = SPF_PREFIX_PRIO_LOW
;
1671 * XPath: /frr-isisd:isis/instance/fast-reroute/level-2/lfa/tiebreaker
1673 int isis_instance_fast_reroute_level_2_lfa_tiebreaker_create(
1674 struct nb_cb_create_args
*args
)
1676 struct isis_area
*area
;
1678 enum lfa_tiebreaker_type type
;
1679 struct lfa_tiebreaker
*tie_b
;
1681 if (args
->event
!= NB_EV_APPLY
)
1684 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1685 index
= yang_dnode_get_uint8(args
->dnode
, "./index");
1686 type
= yang_dnode_get_enum(args
->dnode
, "./type");
1688 tie_b
= isis_lfa_tiebreaker_add(area
, ISIS_LEVEL2
, index
, type
);
1689 nb_running_set_entry(args
->dnode
, tie_b
);
1690 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1695 int isis_instance_fast_reroute_level_2_lfa_tiebreaker_destroy(
1696 struct nb_cb_destroy_args
*args
)
1698 struct lfa_tiebreaker
*tie_b
;
1699 struct isis_area
*area
;
1701 if (args
->event
!= NB_EV_APPLY
)
1704 tie_b
= nb_running_unset_entry(args
->dnode
);
1706 isis_lfa_tiebreaker_delete(area
, ISIS_LEVEL2
, tie_b
);
1707 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1713 * XPath: /frr-isisd:isis/instance/fast-reroute/level-2/lfa/tiebreaker/type
1715 int isis_instance_fast_reroute_level_2_lfa_tiebreaker_type_modify(
1716 struct nb_cb_modify_args
*args
)
1718 struct lfa_tiebreaker
*tie_b
;
1719 struct isis_area
*area
;
1721 if (args
->event
!= NB_EV_APPLY
)
1724 tie_b
= nb_running_get_entry(args
->dnode
, NULL
, true);
1726 tie_b
->type
= yang_dnode_get_enum(args
->dnode
, NULL
);
1727 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1733 * XPath: /frr-isisd:isis/instance/fast-reroute/level-2/remote-lfa/prefix-list
1735 int isis_instance_fast_reroute_level_2_remote_lfa_prefix_list_modify(
1736 struct nb_cb_modify_args
*args
)
1738 struct isis_area
*area
;
1739 const char *plist_name
;
1741 if (args
->event
!= NB_EV_APPLY
)
1744 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1745 plist_name
= yang_dnode_get_string(args
->dnode
, NULL
);
1747 area
->rlfa_plist_name
[1] = XSTRDUP(MTYPE_ISIS_PLIST_NAME
, plist_name
);
1748 area
->rlfa_plist
[1] = prefix_list_lookup(AFI_IP
, plist_name
);
1749 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1754 int isis_instance_fast_reroute_level_2_remote_lfa_prefix_list_destroy(
1755 struct nb_cb_destroy_args
*args
)
1757 struct isis_area
*area
;
1759 if (args
->event
!= NB_EV_APPLY
)
1762 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1764 XFREE(MTYPE_ISIS_PLIST_NAME
, area
->rlfa_plist_name
[1]);
1765 area
->rlfa_plist
[1] = NULL
;
1766 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1772 * XPath: /frr-isisd:isis/instance/log-adjacency-changes
1774 int isis_instance_log_adjacency_changes_modify(struct nb_cb_modify_args
*args
)
1776 struct isis_area
*area
;
1777 bool log
= yang_dnode_get_bool(args
->dnode
, NULL
);
1779 if (args
->event
!= NB_EV_APPLY
)
1782 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1783 area
->log_adj_changes
= log
? 1 : 0;
1789 * XPath: /frr-isisd:isis/instance/mpls-te
1791 int isis_instance_mpls_te_create(struct nb_cb_create_args
*args
)
1793 struct listnode
*node
;
1794 struct isis_area
*area
;
1795 struct isis_circuit
*circuit
;
1797 if (args
->event
!= NB_EV_APPLY
)
1800 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1801 if (area
->mta
== NULL
) {
1803 struct mpls_te_area
*new;
1805 zlog_debug("ISIS-TE(%s): Initialize MPLS Traffic Engineering",
1808 new = XCALLOC(MTYPE_ISIS_MPLS_TE
, sizeof(struct mpls_te_area
));
1810 /* Initialize MPLS_TE structure */
1811 new->status
= enable
;
1813 new->inter_as
= off
;
1814 new->interas_areaid
.s_addr
= 0;
1815 new->router_id
.s_addr
= 0;
1819 area
->mta
->status
= enable
;
1822 /* Update Extended TLVs according to Interface link parameters */
1823 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
))
1824 isis_link_params_update(circuit
, circuit
->interface
);
1826 /* Reoriginate STD_TE & GMPLS circuits */
1827 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1832 int isis_instance_mpls_te_destroy(struct nb_cb_destroy_args
*args
)
1834 struct listnode
*node
;
1835 struct isis_area
*area
;
1836 struct isis_circuit
*circuit
;
1838 if (args
->event
!= NB_EV_APPLY
)
1841 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1842 if (IS_MPLS_TE(area
->mta
))
1843 area
->mta
->status
= disable
;
1847 /* Flush LSP if circuit engage */
1848 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
)) {
1849 if (!IS_EXT_TE(circuit
->ext
))
1852 /* disable MPLS_TE Circuit keeping SR one's */
1853 if (IS_SUBTLV(circuit
->ext
, EXT_ADJ_SID
))
1854 circuit
->ext
->status
= EXT_ADJ_SID
;
1855 else if (IS_SUBTLV(circuit
->ext
, EXT_LAN_ADJ_SID
))
1856 circuit
->ext
->status
= EXT_LAN_ADJ_SID
;
1858 circuit
->ext
->status
= 0;
1861 /* Reoriginate STD_TE & GMPLS circuits */
1862 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1864 zlog_debug("ISIS-TE(%s): Disabled MPLS Traffic Engineering",
1871 * XPath: /frr-isisd:isis/instance/mpls-te/router-address
1873 int isis_instance_mpls_te_router_address_modify(struct nb_cb_modify_args
*args
)
1875 struct in_addr value
;
1876 struct isis_area
*area
;
1878 if (args
->event
!= NB_EV_APPLY
)
1881 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1882 /* only proceed if MPLS-TE is enabled */
1883 if (!IS_MPLS_TE(area
->mta
))
1886 /* Update Area Router ID */
1887 yang_dnode_get_ipv4(&value
, args
->dnode
, NULL
);
1888 area
->mta
->router_id
.s_addr
= value
.s_addr
;
1890 /* And re-schedule LSP update */
1891 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1896 int isis_instance_mpls_te_router_address_destroy(
1897 struct nb_cb_destroy_args
*args
)
1899 struct isis_area
*area
;
1901 if (args
->event
!= NB_EV_APPLY
)
1904 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1905 /* only proceed if MPLS-TE is enabled */
1906 if (!IS_MPLS_TE(area
->mta
))
1909 /* Reset Area Router ID */
1910 area
->mta
->router_id
.s_addr
= INADDR_ANY
;
1912 /* And re-schedule LSP update */
1913 lsp_regenerate_schedule(area
, area
->is_type
, 0);
1919 * XPath: /frr-isisd:isis/instance/segment-routing/enabled
1921 int isis_instance_segment_routing_enabled_modify(
1922 struct nb_cb_modify_args
*args
)
1924 struct isis_area
*area
;
1926 if (args
->event
!= NB_EV_APPLY
)
1929 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
1930 area
->srdb
.config
.enabled
= yang_dnode_get_bool(args
->dnode
, NULL
);
1932 if (area
->srdb
.config
.enabled
) {
1933 if (IS_DEBUG_EVENTS
)
1934 zlog_debug("SR: Segment Routing: OFF -> ON");
1936 isis_sr_start(area
);
1938 if (IS_DEBUG_EVENTS
)
1939 zlog_debug("SR: Segment Routing: ON -> OFF");
1948 * XPath: /frr-isisd:isis/instance/segment-routing/label-blocks
1950 int isis_instance_segment_routing_label_blocks_pre_validate(
1951 struct nb_cb_pre_validate_args
*args
)
1953 uint32_t srgb_lbound
;
1954 uint32_t srgb_ubound
;
1955 uint32_t srlb_lbound
;
1956 uint32_t srlb_ubound
;
1958 srgb_lbound
= yang_dnode_get_uint32(args
->dnode
, "./srgb/lower-bound");
1959 srgb_ubound
= yang_dnode_get_uint32(args
->dnode
, "./srgb/upper-bound");
1960 srlb_lbound
= yang_dnode_get_uint32(args
->dnode
, "./srlb/lower-bound");
1961 srlb_ubound
= yang_dnode_get_uint32(args
->dnode
, "./srlb/upper-bound");
1963 /* Check that the block size does not exceed 65535 */
1964 if ((srgb_ubound
- srgb_lbound
+ 1) > 65535) {
1966 args
->errmsg
, args
->errmsg_len
,
1967 "New SR Global Block (%u/%u) exceed the limit of 65535",
1968 srgb_lbound
, srgb_ubound
);
1969 return NB_ERR_VALIDATION
;
1971 if ((srlb_ubound
- srlb_lbound
+ 1) > 65535) {
1972 snprintf(args
->errmsg
, args
->errmsg_len
,
1973 "New SR Local Block (%u/%u) exceed the limit of 65535",
1974 srlb_lbound
, srlb_ubound
);
1975 return NB_ERR_VALIDATION
;
1978 /* Validate SRGB against SRLB */
1979 if (!((srgb_ubound
< srlb_lbound
) || (srgb_lbound
> srlb_ubound
))) {
1981 args
->errmsg
, args
->errmsg_len
,
1982 "SR Global Block (%u/%u) conflicts with Local Block (%u/%u)",
1983 srgb_lbound
, srgb_ubound
, srlb_lbound
, srlb_ubound
);
1984 return NB_ERR_VALIDATION
;
1991 * XPath: /frr-isisd:isis/instance/segment-routing/label-blocks/srgb
1994 void isis_instance_segment_routing_srgb_apply_finish(
1995 struct nb_cb_apply_finish_args
*args
)
1997 struct isis_area
*area
;
1998 uint32_t lower_bound
, upper_bound
;
2000 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
2001 lower_bound
= yang_dnode_get_uint32(args
->dnode
, "./lower-bound");
2002 upper_bound
= yang_dnode_get_uint32(args
->dnode
, "./upper-bound");
2004 isis_sr_cfg_srgb_update(area
, lower_bound
, upper_bound
);
2008 * XPath: /frr-isisd:isis/instance/segment-routing/label-blocks/srgb/lower-bound
2010 int isis_instance_segment_routing_srgb_lower_bound_modify(
2011 struct nb_cb_modify_args
*args
)
2013 uint32_t lower_bound
= yang_dnode_get_uint32(args
->dnode
, NULL
);
2015 switch (args
->event
) {
2016 case NB_EV_VALIDATE
:
2017 if (!IS_MPLS_UNRESERVED_LABEL(lower_bound
)) {
2018 snprintf(args
->errmsg
, args
->errmsg_len
,
2019 "Invalid SRGB lower bound: %u", lower_bound
);
2020 return NB_ERR_VALIDATION
;
2033 * XPath: /frr-isisd:isis/instance/segment-routing/label-blocks/srgb/upper-bound
2035 int isis_instance_segment_routing_srgb_upper_bound_modify(
2036 struct nb_cb_modify_args
*args
)
2038 uint32_t upper_bound
= yang_dnode_get_uint32(args
->dnode
, NULL
);
2040 switch (args
->event
) {
2041 case NB_EV_VALIDATE
:
2042 if (!IS_MPLS_UNRESERVED_LABEL(upper_bound
)) {
2043 snprintf(args
->errmsg
, args
->errmsg_len
,
2044 "Invalid SRGB upper bound: %u", upper_bound
);
2045 return NB_ERR_VALIDATION
;
2058 * XPath: /frr-isisd:isis/instance/segment-routing/label-blocks/srlb
2060 void isis_instance_segment_routing_srlb_apply_finish(
2061 struct nb_cb_apply_finish_args
*args
)
2063 struct isis_area
*area
;
2064 uint32_t lower_bound
, upper_bound
;
2066 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
2067 lower_bound
= yang_dnode_get_uint32(args
->dnode
, "./lower-bound");
2068 upper_bound
= yang_dnode_get_uint32(args
->dnode
, "./upper-bound");
2070 isis_sr_cfg_srlb_update(area
, lower_bound
, upper_bound
);
2074 * XPath: /frr-isisd:isis/instance/segment-routing/label-blocks/srlb/lower-bound
2076 int isis_instance_segment_routing_srlb_lower_bound_modify(
2077 struct nb_cb_modify_args
*args
)
2079 uint32_t lower_bound
= yang_dnode_get_uint32(args
->dnode
, NULL
);
2081 switch (args
->event
) {
2082 case NB_EV_VALIDATE
:
2083 if (!IS_MPLS_UNRESERVED_LABEL(lower_bound
)) {
2084 snprintf(args
->errmsg
, args
->errmsg_len
,
2085 "Invalid SRLB lower bound: %u", lower_bound
);
2086 return NB_ERR_VALIDATION
;
2099 * XPath: /frr-isisd:isis/instance/segment-routing/label-blocks/srlb/upper-bound
2101 int isis_instance_segment_routing_srlb_upper_bound_modify(
2102 struct nb_cb_modify_args
*args
)
2104 uint32_t upper_bound
= yang_dnode_get_uint32(args
->dnode
, NULL
);
2106 switch (args
->event
) {
2107 case NB_EV_VALIDATE
:
2108 if (!IS_MPLS_UNRESERVED_LABEL(upper_bound
)) {
2109 snprintf(args
->errmsg
, args
->errmsg_len
,
2110 "Invalid SRLB upper bound: %u", upper_bound
);
2111 return NB_ERR_VALIDATION
;
2124 * XPath: /frr-isisd:isis/instance/segment-routing/msd/node-msd
2126 int isis_instance_segment_routing_msd_node_msd_modify(
2127 struct nb_cb_modify_args
*args
)
2129 struct isis_area
*area
;
2131 if (args
->event
!= NB_EV_APPLY
)
2134 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
2135 area
->srdb
.config
.msd
= yang_dnode_get_uint8(args
->dnode
, NULL
);
2137 /* Update and regenerate LSP */
2138 lsp_regenerate_schedule(area
, area
->is_type
, 0);
2143 int isis_instance_segment_routing_msd_node_msd_destroy(
2144 struct nb_cb_destroy_args
*args
)
2146 struct isis_area
*area
;
2148 if (args
->event
!= NB_EV_APPLY
)
2151 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
2152 area
->srdb
.config
.msd
= 0;
2154 /* Update and regenerate LSP */
2155 lsp_regenerate_schedule(area
, area
->is_type
, 0);
2161 * XPath: /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid
2163 int isis_instance_segment_routing_prefix_sid_map_prefix_sid_create(
2164 struct nb_cb_create_args
*args
)
2166 struct isis_area
*area
;
2167 struct prefix prefix
;
2168 struct sr_prefix_cfg
*pcfg
;
2170 if (args
->event
!= NB_EV_APPLY
)
2173 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
2174 yang_dnode_get_prefix(&prefix
, args
->dnode
, "./prefix");
2176 pcfg
= isis_sr_cfg_prefix_add(area
, &prefix
);
2177 nb_running_set_entry(args
->dnode
, pcfg
);
2182 int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy(
2183 struct nb_cb_destroy_args
*args
)
2185 struct sr_prefix_cfg
*pcfg
;
2186 struct isis_area
*area
;
2188 if (args
->event
!= NB_EV_APPLY
)
2191 pcfg
= nb_running_unset_entry(args
->dnode
);
2193 isis_sr_cfg_prefix_del(pcfg
);
2194 lsp_regenerate_schedule(area
, area
->is_type
, 0);
2199 int isis_instance_segment_routing_prefix_sid_map_prefix_sid_pre_validate(
2200 struct nb_cb_pre_validate_args
*args
)
2202 const struct lyd_node
*area_dnode
;
2203 struct isis_area
*area
;
2204 struct prefix prefix
;
2205 uint32_t srgb_lbound
;
2206 uint32_t srgb_ubound
;
2207 uint32_t srgb_range
;
2209 enum sr_sid_value_type sid_type
;
2210 struct isis_prefix_sid psid
= {};
2212 yang_dnode_get_prefix(&prefix
, args
->dnode
, "./prefix");
2213 srgb_lbound
= yang_dnode_get_uint32(
2214 args
->dnode
, "../../label-blocks/srgb/lower-bound");
2215 srgb_ubound
= yang_dnode_get_uint32(
2216 args
->dnode
, "../../label-blocks/srgb/upper-bound");
2217 sid
= yang_dnode_get_uint32(args
->dnode
, "./sid-value");
2218 sid_type
= yang_dnode_get_enum(args
->dnode
, "./sid-value-type");
2220 /* Check for invalid indexes/labels. */
2221 srgb_range
= srgb_ubound
- srgb_lbound
+ 1;
2224 case SR_SID_VALUE_TYPE_INDEX
:
2225 if (sid
>= srgb_range
) {
2226 snprintf(args
->errmsg
, args
->errmsg_len
,
2227 "SID index %u falls outside local SRGB range",
2229 return NB_ERR_VALIDATION
;
2232 case SR_SID_VALUE_TYPE_ABSOLUTE
:
2233 if (!IS_MPLS_UNRESERVED_LABEL(sid
)) {
2234 snprintf(args
->errmsg
, args
->errmsg_len
,
2235 "Invalid absolute SID %u", sid
);
2236 return NB_ERR_VALIDATION
;
2238 SET_FLAG(psid
.flags
, ISIS_PREFIX_SID_VALUE
);
2239 SET_FLAG(psid
.flags
, ISIS_PREFIX_SID_LOCAL
);
2243 /* Check for Prefix-SID collisions. */
2244 area_dnode
= yang_dnode_get_parent(args
->dnode
, "instance");
2245 area
= nb_running_get_entry(area_dnode
, NULL
, false);
2247 for (int tree
= SPFTREE_IPV4
; tree
< SPFTREE_COUNT
; tree
++) {
2248 for (int level
= ISIS_LEVEL1
; level
<= ISIS_LEVEL2
;
2250 struct isis_spftree
*spftree
;
2251 struct isis_vertex
*vertex_psid
;
2253 if (!(area
->is_type
& level
))
2255 spftree
= area
->spftree
[tree
][level
- 1];
2259 vertex_psid
= isis_spf_prefix_sid_lookup(
2262 && !prefix_same(&vertex_psid
->N
.ip
.p
.dest
,
2265 args
->errmsg
, args
->errmsg_len
,
2266 "Prefix-SID collision detected, SID %s %u is already in use by prefix %pFX (L%u)",
2269 ISIS_PREFIX_SID_VALUE
)
2273 &vertex_psid
->N
.ip
.p
.dest
,
2275 return NB_ERR_VALIDATION
;
2284 void isis_instance_segment_routing_prefix_sid_map_prefix_sid_apply_finish(
2285 struct nb_cb_apply_finish_args
*args
)
2287 struct sr_prefix_cfg
*pcfg
;
2288 struct isis_area
*area
;
2290 pcfg
= nb_running_get_entry(args
->dnode
, NULL
, true);
2292 lsp_regenerate_schedule(area
, area
->is_type
, 0);
2297 * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value-type
2299 int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify(
2300 struct nb_cb_modify_args
*args
)
2302 struct sr_prefix_cfg
*pcfg
;
2304 if (args
->event
!= NB_EV_APPLY
)
2307 pcfg
= nb_running_get_entry(args
->dnode
, NULL
, true);
2308 pcfg
->sid_type
= yang_dnode_get_enum(args
->dnode
, NULL
);
2315 * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value
2317 int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify(
2318 struct nb_cb_modify_args
*args
)
2320 struct sr_prefix_cfg
*pcfg
;
2322 if (args
->event
!= NB_EV_APPLY
)
2325 pcfg
= nb_running_get_entry(args
->dnode
, NULL
, true);
2326 pcfg
->sid
= yang_dnode_get_uint32(args
->dnode
, NULL
);
2333 * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/last-hop-behavior
2335 int isis_instance_segment_routing_prefix_sid_map_prefix_sid_last_hop_behavior_modify(
2336 struct nb_cb_modify_args
*args
)
2338 struct sr_prefix_cfg
*pcfg
;
2340 if (args
->event
!= NB_EV_APPLY
)
2343 pcfg
= nb_running_get_entry(args
->dnode
, NULL
, true);
2344 pcfg
->last_hop_behavior
= yang_dnode_get_enum(args
->dnode
, NULL
);
2350 * XPath: /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/n-flag-clear
2352 int isis_instance_segment_routing_prefix_sid_map_prefix_sid_n_flag_clear_modify(
2353 struct nb_cb_modify_args
*args
)
2355 struct sr_prefix_cfg
*pcfg
;
2357 if (args
->event
!= NB_EV_APPLY
)
2360 pcfg
= nb_running_get_entry(args
->dnode
, NULL
, true);
2361 pcfg
->n_flag_clear
= yang_dnode_get_bool(args
->dnode
, NULL
);
2367 * XPath: /frr-isisd:isis/instance/mpls/ldp-sync
2369 int isis_instance_mpls_ldp_sync_create(struct nb_cb_create_args
*args
)
2371 struct isis_area
*area
;
2372 struct listnode
*node
;
2373 struct isis_circuit
*circuit
;
2374 struct interface
*ifp
;
2378 switch (args
->event
) {
2379 case NB_EV_VALIDATE
:
2380 area
= nb_running_get_entry(args
->dnode
, NULL
, false);
2381 if (area
== NULL
|| area
->isis
== NULL
)
2382 return NB_ERR_VALIDATION
;
2384 if (area
->isis
->vrf_id
!= VRF_DEFAULT
) {
2385 snprintf(args
->errmsg
, args
->errmsg_len
,
2386 "LDP-Sync only runs on Default VRF");
2387 return NB_ERR_VALIDATION
;
2394 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
2396 vrf
= vrf_lookup_by_id(isis
->vrf_id
);
2398 /* register with opaque client to recv LDP-IGP Sync msgs */
2399 zclient_register_opaque(zclient
, LDP_IGP_SYNC_IF_STATE_UPDATE
);
2400 zclient_register_opaque(zclient
, LDP_IGP_SYNC_ANNOUNCE_UPDATE
);
2402 if (!CHECK_FLAG(isis
->ldp_sync_cmd
.flags
,
2403 LDP_SYNC_FLAG_ENABLE
)) {
2404 SET_FLAG(isis
->ldp_sync_cmd
.flags
,
2405 LDP_SYNC_FLAG_ENABLE
);
2407 /* turn on LDP-IGP Sync on all ptop ISIS interfaces */
2408 FOR_ALL_INTERFACES (vrf
, ifp
) {
2409 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
,
2411 circuit
= circuit_lookup_by_ifp(
2412 ifp
, area
->circuit_list
);
2413 if (circuit
== NULL
)
2415 isis_if_set_ldp_sync_enable(circuit
);
2424 int isis_instance_mpls_ldp_sync_destroy(struct nb_cb_destroy_args
*args
)
2426 if (args
->event
!= NB_EV_APPLY
)
2429 /* remove ldp-sync config */
2430 isis_ldp_sync_gbl_exit(false);
2436 * XPath: /frr-isisd:isis/instance/mpls/ldp-sync/holddown
2438 int isis_instance_mpls_ldp_sync_holddown_modify(struct nb_cb_modify_args
*args
)
2440 struct isis_area
*area
;
2441 struct listnode
*node
;
2442 struct isis_circuit
*circuit
;
2443 struct interface
*ifp
;
2445 uint16_t holddown
= LDP_IGP_SYNC_HOLDDOWN_DEFAULT
;
2448 switch (args
->event
) {
2449 case NB_EV_VALIDATE
:
2450 area
= nb_running_get_entry(args
->dnode
, NULL
, false);
2451 if (area
== NULL
|| area
->isis
== NULL
)
2452 return NB_ERR_VALIDATION
;
2454 if (area
->isis
->vrf_id
!= VRF_DEFAULT
) {
2455 snprintf(args
->errmsg
, args
->errmsg_len
,
2456 "LDP-Sync only runs on Default VRF");
2457 return NB_ERR_VALIDATION
;
2464 area
= nb_running_get_entry(args
->dnode
, NULL
, true);
2466 vrf
= vrf_lookup_by_id(isis
->vrf_id
);
2467 holddown
= yang_dnode_get_uint16(args
->dnode
, NULL
);
2469 if (holddown
== LDP_IGP_SYNC_HOLDDOWN_DEFAULT
)
2470 UNSET_FLAG(isis
->ldp_sync_cmd
.flags
,
2471 LDP_SYNC_FLAG_HOLDDOWN
);
2473 SET_FLAG(isis
->ldp_sync_cmd
.flags
,
2474 LDP_SYNC_FLAG_HOLDDOWN
);
2475 isis
->ldp_sync_cmd
.holddown
= holddown
;
2477 /* set holddown time on all ISIS interfaces */
2478 FOR_ALL_INTERFACES (vrf
, ifp
) {
2479 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
,
2481 circuit
= circuit_lookup_by_ifp(ifp
,
2482 area
->circuit_list
);
2483 if (circuit
== NULL
)
2485 isis_if_set_ldp_sync_holddown(circuit
);
2494 * XPath: /frr-interface:lib/interface/frr-isisd:isis
2496 int lib_interface_isis_create(struct nb_cb_create_args
*args
)
2498 struct isis_area
*area
= NULL
;
2499 struct interface
*ifp
;
2500 struct isis_circuit
*circuit
= NULL
;
2502 const char *area_tag
= yang_dnode_get_string(args
->dnode
, "./area-tag");
2503 const char *vrf_name
= yang_dnode_get_string(args
->dnode
, "./vrf");
2504 uint32_t min_mtu
, actual_mtu
;
2506 switch (args
->event
) {
2510 case NB_EV_VALIDATE
:
2511 /* check if interface mtu is sufficient. If the area has not
2512 * been created yet, assume default MTU for the area
2514 ifp
= nb_running_get_entry(args
->dnode
, NULL
, false);
2515 /* zebra might not know yet about the MTU - nothing we can do */
2516 if (!ifp
|| ifp
->mtu
== 0)
2518 vrf
= vrf_lookup_by_id(ifp
->vrf_id
);
2519 if (ifp
->vrf_id
!= VRF_DEFAULT
&& vrf
2520 && strcmp(vrf
->name
, vrf_name
) != 0) {
2521 snprintf(args
->errmsg
, args
->errmsg_len
,
2522 "interface %s not in vrf %s\n", ifp
->name
,
2524 return NB_ERR_VALIDATION
;
2527 if_is_broadcast(ifp
) ? ifp
->mtu
- LLC_LEN
: ifp
->mtu
;
2529 area
= isis_area_lookup(area_tag
, ifp
->vrf_id
);
2531 min_mtu
= area
->lsp_mtu
;
2534 min_mtu
= yang_get_default_uint16(
2535 "/frr-isisd:isis/instance/lsp/mtu");
2537 min_mtu
= DEFAULT_LSP_MTU
;
2538 #endif /* ifndef FABRICD */
2539 if (actual_mtu
< min_mtu
) {
2540 snprintf(args
->errmsg
, args
->errmsg_len
,
2541 "Interface %s has MTU %u, minimum MTU for the area is %u",
2542 ifp
->name
, actual_mtu
, min_mtu
);
2543 return NB_ERR_VALIDATION
;
2547 area
= isis_area_lookup_by_vrf(area_tag
, vrf_name
);
2548 /* The area should have already be created. We are
2549 * setting the priority of the global isis area creation
2550 * slightly lower, so it should be executed first, but I
2551 * cannot rely on that so here I have to check.
2555 EC_LIB_NB_CB_CONFIG_APPLY
,
2556 "%s: attempt to create circuit for area %s before the area has been created",
2557 __func__
, area_tag
);
2560 ifp
= nb_running_get_entry(args
->dnode
, NULL
, true);
2561 circuit
= isis_circuit_create(area
, ifp
);
2563 && (circuit
->state
== C_STATE_CONF
2564 || circuit
->state
== C_STATE_UP
));
2565 nb_running_set_entry(args
->dnode
, circuit
);
2572 int lib_interface_isis_destroy(struct nb_cb_destroy_args
*args
)
2574 struct isis_circuit
*circuit
;
2576 if (args
->event
!= NB_EV_APPLY
)
2579 circuit
= nb_running_unset_entry(args
->dnode
);
2581 return NB_ERR_INCONSISTENCY
;
2583 /* remove ldp-sync config */
2584 isis_ldp_sync_if_remove(circuit
, true);
2586 /* disable both AFs for this circuit. this will also update the
2587 * CSM state by sending an ISIS_DISABLED signal. If there is no
2588 * area associated to the circuit there is nothing to do
2591 isis_circuit_af_set(circuit
, false, false);
2596 * XPath: /frr-interface:lib/interface/frr-isisd:isis/area-tag
2598 int lib_interface_isis_area_tag_modify(struct nb_cb_modify_args
*args
)
2600 struct isis_circuit
*circuit
;
2601 struct interface
*ifp
;
2603 const char *area_tag
, *ifname
, *vrfname
;
2605 if (args
->event
== NB_EV_VALIDATE
) {
2606 /* libyang doesn't like relative paths across module boundaries
2608 ifname
= yang_dnode_get_string(args
->dnode
->parent
->parent
,
2610 vrfname
= yang_dnode_get_string(args
->dnode
->parent
->parent
,
2612 vrf
= vrf_lookup_by_name(vrfname
);
2614 ifp
= if_lookup_by_name(ifname
, vrf
->vrf_id
);
2619 circuit
= circuit_scan_by_ifp(ifp
);
2620 area_tag
= yang_dnode_get_string(args
->dnode
, NULL
);
2621 if (circuit
&& circuit
->area
&& circuit
->area
->area_tag
2622 && strcmp(circuit
->area
->area_tag
, area_tag
)) {
2623 snprintf(args
->errmsg
, args
->errmsg_len
,
2624 "ISIS circuit is already defined on %s",
2625 circuit
->area
->area_tag
);
2626 return NB_ERR_VALIDATION
;
2634 * XPath: /frr-interface:lib/interface/frr-isisd:isis/vrf
2636 int lib_interface_isis_vrf_modify(struct nb_cb_modify_args
*args
)
2638 struct interface
*ifp
;
2640 const char *ifname
, *vrfname
, *vrf_name
;
2641 struct isis_circuit
*circuit
;
2643 if (args
->event
== NB_EV_VALIDATE
) {
2644 /* libyang doesn't like relative paths across module boundaries
2646 ifname
= yang_dnode_get_string(args
->dnode
->parent
->parent
,
2648 vrfname
= yang_dnode_get_string(args
->dnode
->parent
->parent
,
2650 vrf
= vrf_lookup_by_name(vrfname
);
2652 ifp
= if_lookup_by_name(ifname
, vrf
->vrf_id
);
2657 vrf_name
= yang_dnode_get_string(args
->dnode
, NULL
);
2658 circuit
= circuit_scan_by_ifp(ifp
);
2659 if (circuit
&& circuit
->area
&& circuit
->isis
2660 && strcmp(circuit
->isis
->name
, vrf_name
)) {
2661 snprintf(args
->errmsg
, args
->errmsg_len
,
2662 "ISIS circuit is already defined on vrf %s",
2663 circuit
->isis
->name
);
2664 return NB_ERR_VALIDATION
;
2672 * XPath: /frr-interface:lib/interface/frr-isisd:isis/circuit-type
2674 int lib_interface_isis_circuit_type_modify(struct nb_cb_modify_args
*args
)
2676 int circ_type
= yang_dnode_get_enum(args
->dnode
, NULL
);
2677 struct isis_circuit
*circuit
;
2678 struct interface
*ifp
;
2680 const char *ifname
, *vrfname
;
2681 struct isis
*isis
= NULL
;
2683 switch (args
->event
) {
2684 case NB_EV_VALIDATE
:
2685 /* libyang doesn't like relative paths across module boundaries
2687 ifname
= yang_dnode_get_string(args
->dnode
->parent
->parent
,
2689 vrfname
= yang_dnode_get_string(args
->dnode
->parent
->parent
,
2691 vrf
= vrf_lookup_by_name(vrfname
);
2693 ifp
= if_lookup_by_name(ifname
, vrf
->vrf_id
);
2697 isis
= isis_lookup_by_vrfid(ifp
->vrf_id
);
2699 return NB_ERR_VALIDATION
;
2701 circuit
= circuit_lookup_by_ifp(ifp
, isis
->init_circ_list
);
2702 if (circuit
&& circuit
->state
== C_STATE_UP
2703 && circuit
->area
->is_type
!= IS_LEVEL_1_AND_2
2704 && circuit
->area
->is_type
!= circ_type
) {
2705 snprintf(args
->errmsg
, args
->errmsg_len
,
2706 "Invalid circuit level for area %s",
2707 circuit
->area
->area_tag
);
2708 return NB_ERR_VALIDATION
;
2715 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2716 isis_circuit_is_type_set(circuit
, circ_type
);
2724 * XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv4-routing
2726 int lib_interface_isis_ipv4_routing_modify(struct nb_cb_modify_args
*args
)
2729 struct isis_circuit
*circuit
;
2731 if (args
->event
!= NB_EV_APPLY
)
2734 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2735 ipv4
= yang_dnode_get_bool(args
->dnode
, NULL
);
2736 ipv6
= yang_dnode_get_bool(args
->dnode
, "../ipv6-routing");
2737 isis_circuit_af_set(circuit
, ipv4
, ipv6
);
2743 * XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv6-routing
2745 int lib_interface_isis_ipv6_routing_modify(struct nb_cb_modify_args
*args
)
2748 struct isis_circuit
*circuit
;
2750 if (args
->event
!= NB_EV_APPLY
)
2753 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2754 ipv4
= yang_dnode_get_bool(args
->dnode
, "../ipv4-routing");
2755 ipv6
= yang_dnode_get_bool(args
->dnode
, NULL
);
2756 isis_circuit_af_set(circuit
, ipv4
, ipv6
);
2762 * XPath: /frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring
2764 void lib_interface_isis_bfd_monitoring_apply_finish(
2765 struct nb_cb_apply_finish_args
*args
)
2767 struct isis_circuit
*circuit
;
2769 const char *profile
= NULL
;
2771 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2772 enabled
= yang_dnode_get_bool(args
->dnode
, "./enabled");
2774 if (yang_dnode_exists(args
->dnode
, "./profile"))
2775 profile
= yang_dnode_get_string(args
->dnode
, "./profile");
2778 isis_bfd_circuit_param_set(circuit
, BFD_DEF_MIN_RX
,
2779 BFD_DEF_MIN_TX
, BFD_DEF_DETECT_MULT
,
2782 isis_bfd_circuit_cmd(circuit
, ZEBRA_BFD_DEST_DEREGISTER
);
2783 bfd_info_free(&circuit
->bfd_info
);
2788 * XPath: /frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring/enabled
2790 int lib_interface_isis_bfd_monitoring_enabled_modify(
2791 struct nb_cb_modify_args
*args
)
2793 /* Everything done in apply_finish */
2798 * XPath: /frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring/profile
2800 int lib_interface_isis_bfd_monitoring_profile_modify(
2801 struct nb_cb_modify_args
*args
)
2803 /* Everything done in apply_finish */
2807 int lib_interface_isis_bfd_monitoring_profile_destroy(
2808 struct nb_cb_destroy_args
*args
)
2810 /* Everything done in apply_finish */
2815 * XPath: /frr-interface:lib/interface/frr-isisd:isis/csnp-interval/level-1
2817 int lib_interface_isis_csnp_interval_level_1_modify(
2818 struct nb_cb_modify_args
*args
)
2820 struct isis_circuit
*circuit
;
2822 if (args
->event
!= NB_EV_APPLY
)
2825 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2826 circuit
->csnp_interval
[0] = yang_dnode_get_uint16(args
->dnode
, NULL
);
2832 * XPath: /frr-interface:lib/interface/frr-isisd:isis/csnp-interval/level-2
2834 int lib_interface_isis_csnp_interval_level_2_modify(
2835 struct nb_cb_modify_args
*args
)
2837 struct isis_circuit
*circuit
;
2839 if (args
->event
!= NB_EV_APPLY
)
2842 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2843 circuit
->csnp_interval
[1] = yang_dnode_get_uint16(args
->dnode
, NULL
);
2849 * XPath: /frr-interface:lib/interface/frr-isisd:isis/psnp-interval/level-1
2851 int lib_interface_isis_psnp_interval_level_1_modify(
2852 struct nb_cb_modify_args
*args
)
2854 struct isis_circuit
*circuit
;
2856 if (args
->event
!= NB_EV_APPLY
)
2859 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2860 circuit
->psnp_interval
[0] = yang_dnode_get_uint16(args
->dnode
, NULL
);
2866 * XPath: /frr-interface:lib/interface/frr-isisd:isis/psnp-interval/level-2
2868 int lib_interface_isis_psnp_interval_level_2_modify(
2869 struct nb_cb_modify_args
*args
)
2871 struct isis_circuit
*circuit
;
2873 if (args
->event
!= NB_EV_APPLY
)
2876 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2877 circuit
->psnp_interval
[1] = yang_dnode_get_uint16(args
->dnode
, NULL
);
2883 * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/padding
2885 int lib_interface_isis_hello_padding_modify(struct nb_cb_modify_args
*args
)
2887 struct isis_circuit
*circuit
;
2889 if (args
->event
!= NB_EV_APPLY
)
2892 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2893 circuit
->pad_hellos
= yang_dnode_get_bool(args
->dnode
, NULL
);
2899 * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/interval/level-1
2901 int lib_interface_isis_hello_interval_level_1_modify(
2902 struct nb_cb_modify_args
*args
)
2904 struct isis_circuit
*circuit
;
2907 if (args
->event
!= NB_EV_APPLY
)
2910 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2911 interval
= yang_dnode_get_uint32(args
->dnode
, NULL
);
2912 circuit
->hello_interval
[0] = interval
;
2918 * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/interval/level-2
2920 int lib_interface_isis_hello_interval_level_2_modify(
2921 struct nb_cb_modify_args
*args
)
2923 struct isis_circuit
*circuit
;
2926 if (args
->event
!= NB_EV_APPLY
)
2929 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2930 interval
= yang_dnode_get_uint32(args
->dnode
, NULL
);
2931 circuit
->hello_interval
[1] = interval
;
2937 * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/multiplier/level-1
2939 int lib_interface_isis_hello_multiplier_level_1_modify(
2940 struct nb_cb_modify_args
*args
)
2942 struct isis_circuit
*circuit
;
2945 if (args
->event
!= NB_EV_APPLY
)
2948 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2949 multi
= yang_dnode_get_uint16(args
->dnode
, NULL
);
2950 circuit
->hello_multiplier
[0] = multi
;
2956 * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/multiplier/level-2
2958 int lib_interface_isis_hello_multiplier_level_2_modify(
2959 struct nb_cb_modify_args
*args
)
2961 struct isis_circuit
*circuit
;
2964 if (args
->event
!= NB_EV_APPLY
)
2967 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2968 multi
= yang_dnode_get_uint16(args
->dnode
, NULL
);
2969 circuit
->hello_multiplier
[1] = multi
;
2975 * XPath: /frr-interface:lib/interface/frr-isisd:isis/metric/level-1
2977 int lib_interface_isis_metric_level_1_modify(struct nb_cb_modify_args
*args
)
2979 struct isis_circuit
*circuit
;
2982 if (args
->event
!= NB_EV_APPLY
)
2985 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
2986 met
= yang_dnode_get_uint32(args
->dnode
, NULL
);
2987 isis_circuit_metric_set(circuit
, IS_LEVEL_1
, met
);
2993 * XPath: /frr-interface:lib/interface/frr-isisd:isis/metric/level-2
2995 int lib_interface_isis_metric_level_2_modify(struct nb_cb_modify_args
*args
)
2997 struct isis_circuit
*circuit
;
3000 if (args
->event
!= NB_EV_APPLY
)
3003 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3004 met
= yang_dnode_get_uint32(args
->dnode
, NULL
);
3005 isis_circuit_metric_set(circuit
, IS_LEVEL_2
, met
);
3011 * XPath: /frr-interface:lib/interface/frr-isisd:isis/priority/level-1
3013 int lib_interface_isis_priority_level_1_modify(struct nb_cb_modify_args
*args
)
3015 struct isis_circuit
*circuit
;
3017 if (args
->event
!= NB_EV_APPLY
)
3020 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3021 circuit
->priority
[0] = yang_dnode_get_uint8(args
->dnode
, NULL
);
3027 * XPath: /frr-interface:lib/interface/frr-isisd:isis/priority/level-2
3029 int lib_interface_isis_priority_level_2_modify(struct nb_cb_modify_args
*args
)
3031 struct isis_circuit
*circuit
;
3033 if (args
->event
!= NB_EV_APPLY
)
3036 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3037 circuit
->priority
[1] = yang_dnode_get_uint8(args
->dnode
, NULL
);
3043 * XPath: /frr-interface:lib/interface/frr-isisd:isis/network-type
3045 int lib_interface_isis_network_type_modify(struct nb_cb_modify_args
*args
)
3047 struct isis_circuit
*circuit
;
3048 int net_type
= yang_dnode_get_enum(args
->dnode
, NULL
);
3050 switch (args
->event
) {
3051 case NB_EV_VALIDATE
:
3052 circuit
= nb_running_get_entry(args
->dnode
, NULL
, false);
3055 if (circuit
->circ_type
== CIRCUIT_T_LOOPBACK
) {
3057 args
->errmsg
, args
->errmsg_len
,
3058 "Cannot change network type on loopback interface");
3059 return NB_ERR_VALIDATION
;
3061 if (net_type
== CIRCUIT_T_BROADCAST
3062 && circuit
->state
== C_STATE_UP
3063 && !if_is_broadcast(circuit
->interface
)) {
3065 args
->errmsg
, args
->errmsg_len
,
3066 "Cannot configure non-broadcast interface for broadcast operation");
3067 return NB_ERR_VALIDATION
;
3074 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3075 isis_circuit_circ_type_set(circuit
, net_type
);
3083 * XPath: /frr-interface:lib/interface/frr-isisd:isis/passive
3085 int lib_interface_isis_passive_modify(struct nb_cb_modify_args
*args
)
3087 struct isis_circuit
*circuit
;
3088 struct isis_area
*area
;
3089 struct interface
*ifp
;
3090 bool passive
= yang_dnode_get_bool(args
->dnode
, NULL
);
3092 /* validation only applies if we are setting passive to false */
3093 if (!passive
&& args
->event
== NB_EV_VALIDATE
) {
3094 circuit
= nb_running_get_entry(args
->dnode
, NULL
, false);
3097 ifp
= circuit
->interface
;
3100 if (if_is_loopback(ifp
)) {
3101 snprintf(args
->errmsg
, args
->errmsg_len
,
3102 "Loopback is always passive");
3103 return NB_ERR_VALIDATION
;
3107 if (args
->event
!= NB_EV_APPLY
)
3110 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3111 if (circuit
->state
!= C_STATE_UP
) {
3112 circuit
->is_passive
= passive
;
3114 area
= circuit
->area
;
3115 isis_csm_state_change(ISIS_DISABLE
, circuit
, area
);
3116 circuit
->is_passive
= passive
;
3117 isis_csm_state_change(ISIS_ENABLE
, circuit
, area
);
3124 * XPath: /frr-interface:lib/interface/frr-isisd:isis/password
3126 int lib_interface_isis_password_create(struct nb_cb_create_args
*args
)
3131 int lib_interface_isis_password_destroy(struct nb_cb_destroy_args
*args
)
3133 struct isis_circuit
*circuit
;
3135 if (args
->event
!= NB_EV_APPLY
)
3138 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3139 isis_circuit_passwd_unset(circuit
);
3145 * XPath: /frr-interface:lib/interface/frr-isisd:isis/password/password
3147 int lib_interface_isis_password_password_modify(struct nb_cb_modify_args
*args
)
3149 struct isis_circuit
*circuit
;
3150 const char *password
;
3152 if (args
->event
!= NB_EV_APPLY
)
3155 password
= yang_dnode_get_string(args
->dnode
, NULL
);
3156 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3158 isis_circuit_passwd_set(circuit
, circuit
->passwd
.type
, password
);
3164 * XPath: /frr-interface:lib/interface/frr-isisd:isis/password/password-type
3166 int lib_interface_isis_password_password_type_modify(
3167 struct nb_cb_modify_args
*args
)
3169 struct isis_circuit
*circuit
;
3172 if (args
->event
!= NB_EV_APPLY
)
3175 pass_type
= yang_dnode_get_enum(args
->dnode
, NULL
);
3176 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3177 circuit
->passwd
.type
= pass_type
;
3184 * /frr-interface:lib/interface/frr-isisd:isis/disable-three-way-handshake
3186 int lib_interface_isis_disable_three_way_handshake_modify(
3187 struct nb_cb_modify_args
*args
)
3189 struct isis_circuit
*circuit
;
3191 if (args
->event
!= NB_EV_APPLY
)
3194 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3195 circuit
->disable_threeway_adj
= yang_dnode_get_bool(args
->dnode
, NULL
);
3202 * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-unicast
3204 static int lib_interface_isis_multi_topology_common(
3205 enum nb_event event
, const struct lyd_node
*dnode
, char *errmsg
,
3206 size_t errmsg_len
, uint16_t mtid
)
3208 struct isis_circuit
*circuit
;
3212 case NB_EV_VALIDATE
:
3213 circuit
= nb_running_get_entry(dnode
, NULL
, false);
3214 if (circuit
&& circuit
->area
&& circuit
->area
->oldmetric
) {
3217 "Multi topology IS-IS can only be used with wide metrics");
3218 return NB_ERR_VALIDATION
;
3225 circuit
= nb_running_get_entry(dnode
, NULL
, true);
3226 value
= yang_dnode_get_bool(dnode
, NULL
);
3227 isis_circuit_mt_enabled_set(circuit
, mtid
, value
);
3234 int lib_interface_isis_multi_topology_ipv4_unicast_modify(
3235 struct nb_cb_modify_args
*args
)
3237 return lib_interface_isis_multi_topology_common(
3238 args
->event
, args
->dnode
, args
->errmsg
, args
->errmsg_len
,
3239 ISIS_MT_IPV4_UNICAST
);
3244 * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-multicast
3246 int lib_interface_isis_multi_topology_ipv4_multicast_modify(
3247 struct nb_cb_modify_args
*args
)
3249 return lib_interface_isis_multi_topology_common(
3250 args
->event
, args
->dnode
, args
->errmsg
, args
->errmsg_len
,
3251 ISIS_MT_IPV4_MULTICAST
);
3256 * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-management
3258 int lib_interface_isis_multi_topology_ipv4_management_modify(
3259 struct nb_cb_modify_args
*args
)
3261 return lib_interface_isis_multi_topology_common(
3262 args
->event
, args
->dnode
, args
->errmsg
, args
->errmsg_len
,
3268 * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-unicast
3270 int lib_interface_isis_multi_topology_ipv6_unicast_modify(
3271 struct nb_cb_modify_args
*args
)
3273 return lib_interface_isis_multi_topology_common(
3274 args
->event
, args
->dnode
, args
->errmsg
, args
->errmsg_len
,
3275 ISIS_MT_IPV6_UNICAST
);
3280 * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-multicast
3282 int lib_interface_isis_multi_topology_ipv6_multicast_modify(
3283 struct nb_cb_modify_args
*args
)
3285 return lib_interface_isis_multi_topology_common(
3286 args
->event
, args
->dnode
, args
->errmsg
, args
->errmsg_len
,
3287 ISIS_MT_IPV6_MULTICAST
);
3292 * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-management
3294 int lib_interface_isis_multi_topology_ipv6_management_modify(
3295 struct nb_cb_modify_args
*args
)
3297 return lib_interface_isis_multi_topology_common(
3298 args
->event
, args
->dnode
, args
->errmsg
, args
->errmsg_len
,
3303 * XPath: /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-dstsrc
3305 int lib_interface_isis_multi_topology_ipv6_dstsrc_modify(
3306 struct nb_cb_modify_args
*args
)
3308 return lib_interface_isis_multi_topology_common(
3309 args
->event
, args
->dnode
, args
->errmsg
, args
->errmsg_len
,
3310 ISIS_MT_IPV6_DSTSRC
);
3314 * XPath: /frr-interface:lib/interface/frr-isisd:isis/mpls/ldp-sync
3316 int lib_interface_isis_mpls_ldp_sync_modify(struct nb_cb_modify_args
*args
)
3318 struct isis_circuit
*circuit
;
3319 struct ldp_sync_info
*ldp_sync_info
;
3320 bool ldp_sync_enable
;
3323 switch (args
->event
) {
3324 case NB_EV_VALIDATE
:
3325 circuit
= nb_running_get_entry(args
->dnode
, NULL
, false);
3326 if (circuit
== NULL
|| circuit
->area
== NULL
)
3327 return NB_ERR_VALIDATION
;
3329 if (circuit
->isis
->vrf_id
!= VRF_DEFAULT
) {
3330 snprintf(args
->errmsg
, args
->errmsg_len
,
3331 "LDP-Sync only runs on Default VRF");
3332 return NB_ERR_VALIDATION
;
3339 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3340 ldp_sync_enable
= yang_dnode_get_bool(args
->dnode
, NULL
);
3341 isis
= circuit
->isis
;
3343 if (circuit
->ldp_sync_info
== NULL
)
3344 isis_ldp_sync_if_init(circuit
, isis
);
3345 assert(circuit
->ldp_sync_info
!= NULL
);
3346 ldp_sync_info
= circuit
->ldp_sync_info
;
3348 if (ldp_sync_enable
) {
3349 /* enable LDP-SYNC on an interface
3350 * if ptop interface send message to LDP to get state
3352 SET_FLAG(ldp_sync_info
->flags
, LDP_SYNC_FLAG_IF_CONFIG
);
3353 ldp_sync_info
->enabled
= LDP_IGP_SYNC_ENABLED
;
3354 if (circuit
->circ_type
== CIRCUIT_T_P2P
) {
3355 ldp_sync_info
->state
=
3356 LDP_IGP_SYNC_STATE_REQUIRED_NOT_UP
;
3357 isis_ldp_sync_state_req_msg(circuit
);
3359 zlog_debug("ldp_sync: only runs on P2P links %s",
3360 circuit
->interface
->name
);
3361 ldp_sync_info
->state
=
3362 LDP_IGP_SYNC_STATE_NOT_REQUIRED
;
3365 /* disable LDP-SYNC on an interface
3366 * stop holddown timer if running
3367 * restore isis metric
3369 SET_FLAG(ldp_sync_info
->flags
, LDP_SYNC_FLAG_IF_CONFIG
);
3370 ldp_sync_info
->enabled
= LDP_IGP_SYNC_DEFAULT
;
3371 ldp_sync_info
->state
= LDP_IGP_SYNC_STATE_NOT_REQUIRED
;
3372 THREAD_OFF(ldp_sync_info
->t_holddown
);
3373 isis_ldp_sync_set_if_metric(circuit
, true);
3381 * XPath: /frr-interface:lib/interface/frr-isisd:isis/mpls/holddown
3383 int lib_interface_isis_mpls_holddown_modify(struct nb_cb_modify_args
*args
)
3385 struct isis_circuit
*circuit
;
3386 struct ldp_sync_info
*ldp_sync_info
;
3390 switch (args
->event
) {
3391 case NB_EV_VALIDATE
:
3392 circuit
= nb_running_get_entry(args
->dnode
, NULL
, false);
3393 if (circuit
== NULL
|| circuit
->area
== NULL
)
3394 return NB_ERR_VALIDATION
;
3396 if (circuit
->isis
->vrf_id
!= VRF_DEFAULT
) {
3397 snprintf(args
->errmsg
, args
->errmsg_len
,
3398 "LDP-Sync only runs on Default VRF");
3399 return NB_ERR_VALIDATION
;
3406 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3407 holddown
= yang_dnode_get_uint16(args
->dnode
, NULL
);
3408 isis
= circuit
->isis
;
3410 if (circuit
->ldp_sync_info
== NULL
)
3411 isis_ldp_sync_if_init(circuit
, isis
);
3412 assert(circuit
->ldp_sync_info
!= NULL
);
3413 ldp_sync_info
= circuit
->ldp_sync_info
;
3415 SET_FLAG(ldp_sync_info
->flags
, LDP_SYNC_FLAG_HOLDDOWN
);
3416 ldp_sync_info
->holddown
= holddown
;
3422 int lib_interface_isis_mpls_holddown_destroy(struct nb_cb_destroy_args
*args
)
3424 struct isis_circuit
*circuit
;
3425 struct ldp_sync_info
*ldp_sync_info
;
3428 switch (args
->event
) {
3429 case NB_EV_VALIDATE
:
3430 circuit
= nb_running_get_entry(args
->dnode
, NULL
, false);
3431 if (circuit
== NULL
|| circuit
->ldp_sync_info
== NULL
3432 || circuit
->area
== NULL
)
3433 return NB_ERR_VALIDATION
;
3435 if (circuit
->isis
->vrf_id
!= VRF_DEFAULT
) {
3436 snprintf(args
->errmsg
, args
->errmsg_len
,
3437 "LDP-Sync only runs on Default VRF");
3438 return NB_ERR_VALIDATION
;
3445 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3446 isis
= circuit
->isis
;
3447 ldp_sync_info
= circuit
->ldp_sync_info
;
3448 UNSET_FLAG(ldp_sync_info
->flags
, LDP_SYNC_FLAG_HOLDDOWN
);
3450 if (CHECK_FLAG(isis
->ldp_sync_cmd
.flags
,
3451 LDP_SYNC_FLAG_HOLDDOWN
))
3452 ldp_sync_info
->holddown
= isis
->ldp_sync_cmd
.holddown
;
3454 ldp_sync_info
->holddown
= LDP_IGP_SYNC_HOLDDOWN_DEFAULT
;
3463 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/lfa/enable
3465 int lib_interface_isis_fast_reroute_level_1_lfa_enable_modify(
3466 struct nb_cb_modify_args
*args
)
3468 struct isis_area
*area
;
3469 struct isis_circuit
*circuit
;
3471 if (args
->event
!= NB_EV_APPLY
)
3474 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3475 circuit
->lfa_protection
[0] = yang_dnode_get_bool(args
->dnode
, NULL
);
3476 if (circuit
->lfa_protection
[0])
3477 circuit
->area
->lfa_protected_links
[0]++;
3479 assert(circuit
->area
->lfa_protected_links
[0] > 0);
3480 circuit
->area
->lfa_protected_links
[0]--;
3483 area
= circuit
->area
;
3484 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3491 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/lfa/exclude-interface
3493 int lib_interface_isis_fast_reroute_level_1_lfa_exclude_interface_create(
3494 struct nb_cb_create_args
*args
)
3496 struct isis_area
*area
;
3497 struct isis_circuit
*circuit
;
3498 const char *exclude_ifname
;
3500 if (args
->event
!= NB_EV_APPLY
)
3503 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3504 exclude_ifname
= yang_dnode_get_string(args
->dnode
, NULL
);
3506 isis_lfa_excluded_iface_add(circuit
, ISIS_LEVEL1
, exclude_ifname
);
3507 area
= circuit
->area
;
3508 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3513 int lib_interface_isis_fast_reroute_level_1_lfa_exclude_interface_destroy(
3514 struct nb_cb_destroy_args
*args
)
3516 struct isis_area
*area
;
3517 struct isis_circuit
*circuit
;
3518 const char *exclude_ifname
;
3520 if (args
->event
!= NB_EV_APPLY
)
3523 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3524 exclude_ifname
= yang_dnode_get_string(args
->dnode
, NULL
);
3526 isis_lfa_excluded_iface_delete(circuit
, ISIS_LEVEL1
, exclude_ifname
);
3527 area
= circuit
->area
;
3528 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3535 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/remote-lfa/enable
3537 int lib_interface_isis_fast_reroute_level_1_remote_lfa_enable_modify(
3538 struct nb_cb_modify_args
*args
)
3540 struct isis_area
*area
;
3541 struct isis_circuit
*circuit
;
3543 if (args
->event
!= NB_EV_APPLY
)
3546 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3547 circuit
->rlfa_protection
[0] = yang_dnode_get_bool(args
->dnode
, NULL
);
3548 if (circuit
->rlfa_protection
[0])
3549 circuit
->area
->rlfa_protected_links
[0]++;
3551 assert(circuit
->area
->rlfa_protected_links
[0] > 0);
3552 circuit
->area
->rlfa_protected_links
[0]--;
3555 area
= circuit
->area
;
3556 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3563 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/remote-lfa/maximum-metric
3565 int lib_interface_isis_fast_reroute_level_1_remote_lfa_maximum_metric_modify(
3566 struct nb_cb_modify_args
*args
)
3568 struct isis_area
*area
;
3569 struct isis_circuit
*circuit
;
3571 if (args
->event
!= NB_EV_APPLY
)
3574 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3575 circuit
->rlfa_max_metric
[0] = yang_dnode_get_uint32(args
->dnode
, NULL
);
3577 area
= circuit
->area
;
3578 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3583 int lib_interface_isis_fast_reroute_level_1_remote_lfa_maximum_metric_destroy(
3584 struct nb_cb_destroy_args
*args
)
3586 struct isis_area
*area
;
3587 struct isis_circuit
*circuit
;
3589 if (args
->event
!= NB_EV_APPLY
)
3592 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3593 circuit
->rlfa_max_metric
[0] = 0;
3595 area
= circuit
->area
;
3596 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3603 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable
3605 int lib_interface_isis_fast_reroute_level_1_ti_lfa_enable_modify(
3606 struct nb_cb_modify_args
*args
)
3608 struct isis_area
*area
;
3609 struct isis_circuit
*circuit
;
3611 if (args
->event
!= NB_EV_APPLY
)
3614 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3615 circuit
->tilfa_protection
[0] = yang_dnode_get_bool(args
->dnode
, NULL
);
3616 if (circuit
->tilfa_protection
[0])
3617 circuit
->area
->tilfa_protected_links
[0]++;
3619 assert(circuit
->area
->tilfa_protected_links
[0] > 0);
3620 circuit
->area
->tilfa_protected_links
[0]--;
3623 area
= circuit
->area
;
3624 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3631 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection
3633 int lib_interface_isis_fast_reroute_level_1_ti_lfa_node_protection_modify(
3634 struct nb_cb_modify_args
*args
)
3636 struct isis_area
*area
;
3637 struct isis_circuit
*circuit
;
3639 if (args
->event
!= NB_EV_APPLY
)
3642 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3643 circuit
->tilfa_node_protection
[0] =
3644 yang_dnode_get_bool(args
->dnode
, NULL
);
3646 area
= circuit
->area
;
3647 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3654 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/lfa/enable
3656 int lib_interface_isis_fast_reroute_level_2_lfa_enable_modify(
3657 struct nb_cb_modify_args
*args
)
3659 struct isis_area
*area
;
3660 struct isis_circuit
*circuit
;
3662 if (args
->event
!= NB_EV_APPLY
)
3665 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3666 circuit
->lfa_protection
[1] = yang_dnode_get_bool(args
->dnode
, NULL
);
3667 if (circuit
->lfa_protection
[1])
3668 circuit
->area
->lfa_protected_links
[1]++;
3670 assert(circuit
->area
->lfa_protected_links
[1] > 0);
3671 circuit
->area
->lfa_protected_links
[1]--;
3674 area
= circuit
->area
;
3675 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3682 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/lfa/exclude-interface
3684 int lib_interface_isis_fast_reroute_level_2_lfa_exclude_interface_create(
3685 struct nb_cb_create_args
*args
)
3687 struct isis_area
*area
;
3688 struct isis_circuit
*circuit
;
3689 const char *exclude_ifname
;
3691 if (args
->event
!= NB_EV_APPLY
)
3694 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3695 exclude_ifname
= yang_dnode_get_string(args
->dnode
, NULL
);
3697 isis_lfa_excluded_iface_add(circuit
, ISIS_LEVEL2
, exclude_ifname
);
3698 area
= circuit
->area
;
3699 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3704 int lib_interface_isis_fast_reroute_level_2_lfa_exclude_interface_destroy(
3705 struct nb_cb_destroy_args
*args
)
3707 struct isis_area
*area
;
3708 struct isis_circuit
*circuit
;
3709 const char *exclude_ifname
;
3711 if (args
->event
!= NB_EV_APPLY
)
3714 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3715 exclude_ifname
= yang_dnode_get_string(args
->dnode
, NULL
);
3717 isis_lfa_excluded_iface_delete(circuit
, ISIS_LEVEL2
, exclude_ifname
);
3718 area
= circuit
->area
;
3719 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3726 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/remote-lfa/enable
3728 int lib_interface_isis_fast_reroute_level_2_remote_lfa_enable_modify(
3729 struct nb_cb_modify_args
*args
)
3731 struct isis_area
*area
;
3732 struct isis_circuit
*circuit
;
3734 if (args
->event
!= NB_EV_APPLY
)
3737 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3738 circuit
->rlfa_protection
[1] = yang_dnode_get_bool(args
->dnode
, NULL
);
3739 if (circuit
->rlfa_protection
[1])
3740 circuit
->area
->rlfa_protected_links
[1]++;
3742 assert(circuit
->area
->rlfa_protected_links
[1] > 0);
3743 circuit
->area
->rlfa_protected_links
[1]--;
3746 area
= circuit
->area
;
3747 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3754 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/remote-lfa/maximum-metric
3756 int lib_interface_isis_fast_reroute_level_2_remote_lfa_maximum_metric_modify(
3757 struct nb_cb_modify_args
*args
)
3759 struct isis_area
*area
;
3760 struct isis_circuit
*circuit
;
3762 if (args
->event
!= NB_EV_APPLY
)
3765 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3766 circuit
->rlfa_max_metric
[1] = yang_dnode_get_uint32(args
->dnode
, NULL
);
3768 area
= circuit
->area
;
3769 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3774 int lib_interface_isis_fast_reroute_level_2_remote_lfa_maximum_metric_destroy(
3775 struct nb_cb_destroy_args
*args
)
3777 struct isis_area
*area
;
3778 struct isis_circuit
*circuit
;
3780 if (args
->event
!= NB_EV_APPLY
)
3783 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3784 circuit
->rlfa_max_metric
[1] = 0;
3786 area
= circuit
->area
;
3787 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3794 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable
3796 int lib_interface_isis_fast_reroute_level_2_ti_lfa_enable_modify(
3797 struct nb_cb_modify_args
*args
)
3799 struct isis_area
*area
;
3800 struct isis_circuit
*circuit
;
3802 if (args
->event
!= NB_EV_APPLY
)
3805 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3806 circuit
->tilfa_protection
[1] = yang_dnode_get_bool(args
->dnode
, NULL
);
3807 if (circuit
->tilfa_protection
[1])
3808 circuit
->area
->tilfa_protected_links
[1]++;
3810 assert(circuit
->area
->tilfa_protected_links
[1] > 0);
3811 circuit
->area
->tilfa_protected_links
[1]--;
3814 area
= circuit
->area
;
3815 lsp_regenerate_schedule(area
, area
->is_type
, 0);
3822 * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection
3824 int lib_interface_isis_fast_reroute_level_2_ti_lfa_node_protection_modify(
3825 struct nb_cb_modify_args
*args
)
3827 struct isis_area
*area
;
3828 struct isis_circuit
*circuit
;
3830 if (args
->event
!= NB_EV_APPLY
)
3833 circuit
= nb_running_get_entry(args
->dnode
, NULL
, true);
3834 circuit
->tilfa_node_protection
[1] =
3835 yang_dnode_get_bool(args
->dnode
, NULL
);
3837 area
= circuit
->area
;
3838 lsp_regenerate_schedule(area
, area
->is_type
, 0);