]>
Commit | Line | Data |
---|---|---|
20bd27e2 EDP |
1 | /* |
2 | * Copyright (C) 2001,2002 Sampo Saaristo | |
3 | * Tampere University of Technology | |
4 | * Institute of Communications Engineering | |
5 | * Copyright (C) 2018 Volta Networks | |
6 | * Emanuele Di Pascale | |
7 | * | |
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) | |
11 | * any later version. | |
12 | * | |
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 | |
16 | * more details. | |
17 | * | |
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 | |
21 | */ | |
22 | ||
23 | #include <zebra.h> | |
24 | #include "northbound.h" | |
25 | #include "libfrr.h" | |
26 | #include "linklist.h" | |
27 | #include "log.h" | |
c3e6ac0b RZ |
28 | #include "lib/bfd.h" |
29 | #include "isisd/isis_bfd.h" | |
20bd27e2 EDP |
30 | #include "isisd/isis_constants.h" |
31 | #include "isisd/isis_common.h" | |
32 | #include "isisd/isis_flags.h" | |
33 | #include "isisd/isis_circuit.h" | |
34 | #include "isisd/isisd.h" | |
35 | #include "isisd/isis_lsp.h" | |
36 | #include "isisd/isis_pdu.h" | |
37 | #include "isisd/isis_dynhn.h" | |
38 | #include "isisd/isis_misc.h" | |
39 | #include "isisd/isis_csm.h" | |
40 | #include "isisd/isis_adjacency.h" | |
41 | #include "isisd/isis_spf.h" | |
42 | #include "isisd/isis_te.h" | |
43 | #include "isisd/isis_memory.h" | |
44 | #include "isisd/isis_mt.h" | |
45 | #include "isisd/isis_cli.h" | |
46 | #include "isisd/isis_redist.h" | |
47 | #include "lib/spf_backoff.h" | |
48 | #include "lib/lib_errors.h" | |
49 | #include "lib/vrf.h" | |
50 | ||
aec5ef49 RW |
51 | /* |
52 | * Helper functions. | |
53 | */ | |
54 | static const char *isis_yang_adj_state(enum isis_adj_state state) | |
55 | { | |
56 | switch (state) { | |
57 | case ISIS_ADJ_DOWN: | |
58 | return "down"; | |
59 | case ISIS_ADJ_UP: | |
60 | return "up"; | |
61 | case ISIS_ADJ_INITIALIZING: | |
62 | return "init"; | |
63 | default: | |
64 | return "failed"; | |
65 | } | |
66 | } | |
67 | ||
20bd27e2 EDP |
68 | /* |
69 | * XPath: /frr-isisd:isis/instance | |
70 | */ | |
71 | static int isis_instance_create(enum nb_event event, | |
72 | const struct lyd_node *dnode, | |
73 | union nb_resource *resource) | |
74 | { | |
aaf2fd21 EDP |
75 | struct isis_area *area; |
76 | const char *area_tag; | |
77 | ||
78 | if (event != NB_EV_APPLY) | |
79 | return NB_OK; | |
80 | ||
81 | area_tag = yang_dnode_get_string(dnode, "./area-tag"); | |
82 | area = isis_area_lookup(area_tag); | |
83 | if (area) | |
84 | return NB_ERR_INCONSISTENCY; | |
85 | ||
86 | area = isis_area_create(area_tag); | |
87 | /* save area in dnode to avoid looking it up all the time */ | |
ccd43ada | 88 | nb_running_set_entry(dnode, area); |
aaf2fd21 | 89 | |
20bd27e2 EDP |
90 | return NB_OK; |
91 | } | |
92 | ||
5ad218a6 | 93 | static int isis_instance_destroy(enum nb_event event, |
20bd27e2 EDP |
94 | const struct lyd_node *dnode) |
95 | { | |
ccd43ada | 96 | struct isis_area *area; |
aaf2fd21 EDP |
97 | |
98 | if (event != NB_EV_APPLY) | |
99 | return NB_OK; | |
100 | ||
ccd43ada RW |
101 | area = nb_running_unset_entry(dnode); |
102 | isis_area_destroy(area->area_tag); | |
aaf2fd21 | 103 | |
20bd27e2 EDP |
104 | return NB_OK; |
105 | } | |
106 | ||
107 | /* | |
108 | * XPath: /frr-isisd:isis/instance/is-type | |
109 | */ | |
110 | static int isis_instance_is_type_modify(enum nb_event event, | |
111 | const struct lyd_node *dnode, | |
112 | union nb_resource *resource) | |
113 | { | |
aaf2fd21 EDP |
114 | struct isis_area *area; |
115 | int type; | |
116 | ||
117 | if (event != NB_EV_APPLY) | |
118 | return NB_OK; | |
119 | ||
ccd43ada | 120 | area = nb_running_get_entry(dnode, NULL, true); |
aaf2fd21 EDP |
121 | type = yang_dnode_get_enum(dnode, NULL); |
122 | isis_area_is_type_set(area, type); | |
123 | ||
20bd27e2 EDP |
124 | return NB_OK; |
125 | } | |
126 | ||
127 | /* | |
128 | * XPath: /frr-isisd:isis/instance/area-address | |
129 | */ | |
130 | static int isis_instance_area_address_create(enum nb_event event, | |
131 | const struct lyd_node *dnode, | |
132 | union nb_resource *resource) | |
133 | { | |
f084ea55 EDP |
134 | struct isis_area *area; |
135 | struct area_addr addr, *addrr = NULL, *addrp = NULL; | |
136 | struct listnode *node; | |
137 | uint8_t buff[255]; | |
138 | const char *net_title = yang_dnode_get_string(dnode, NULL); | |
139 | ||
140 | switch (event) { | |
141 | case NB_EV_VALIDATE: | |
142 | addr.addr_len = dotformat2buff(buff, net_title); | |
143 | memcpy(addr.area_addr, buff, addr.addr_len); | |
144 | if (addr.area_addr[addr.addr_len - 1] != 0) { | |
145 | flog_warn( | |
146 | EC_LIB_NB_CB_CONFIG_VALIDATE, | |
147 | "nsel byte (last byte) in area address must be 0"); | |
148 | return NB_ERR_VALIDATION; | |
149 | } | |
150 | if (isis->sysid_set) { | |
151 | /* Check that the SystemID portions match */ | |
152 | if (memcmp(isis->sysid, GETSYSID((&addr)), | |
153 | ISIS_SYS_ID_LEN)) { | |
154 | flog_warn( | |
155 | EC_LIB_NB_CB_CONFIG_VALIDATE, | |
156 | "System ID must not change when defining additional area addresses"); | |
157 | return NB_ERR_VALIDATION; | |
158 | } | |
159 | } | |
160 | break; | |
161 | case NB_EV_PREPARE: | |
162 | addrr = XMALLOC(MTYPE_ISIS_AREA_ADDR, sizeof(struct area_addr)); | |
163 | addrr->addr_len = dotformat2buff(buff, net_title); | |
164 | memcpy(addrr->area_addr, buff, addrr->addr_len); | |
165 | resource->ptr = addrr; | |
166 | break; | |
167 | case NB_EV_ABORT: | |
168 | XFREE(MTYPE_ISIS_AREA_ADDR, resource->ptr); | |
169 | break; | |
170 | case NB_EV_APPLY: | |
ccd43ada | 171 | area = nb_running_get_entry(dnode, NULL, true); |
f084ea55 EDP |
172 | addrr = resource->ptr; |
173 | ||
174 | if (isis->sysid_set == 0) { | |
175 | /* | |
176 | * First area address - get the SystemID for this router | |
177 | */ | |
178 | memcpy(isis->sysid, GETSYSID(addrr), ISIS_SYS_ID_LEN); | |
179 | isis->sysid_set = 1; | |
180 | } else { | |
181 | /* check that we don't already have this address */ | |
182 | for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node, | |
183 | addrp)) { | |
184 | if ((addrp->addr_len + ISIS_SYS_ID_LEN | |
185 | + ISIS_NSEL_LEN) | |
186 | != (addrr->addr_len)) | |
187 | continue; | |
188 | if (!memcmp(addrp->area_addr, addrr->area_addr, | |
189 | addrr->addr_len)) { | |
190 | XFREE(MTYPE_ISIS_AREA_ADDR, addrr); | |
191 | return NB_OK; /* silent fail */ | |
192 | } | |
193 | } | |
194 | } | |
195 | ||
196 | /*Forget the systemID part of the address */ | |
197 | addrr->addr_len -= (ISIS_SYS_ID_LEN + ISIS_NSEL_LEN); | |
198 | assert(area->area_addrs); /* to silence scan-build sillyness */ | |
199 | listnode_add(area->area_addrs, addrr); | |
200 | ||
201 | /* only now we can safely generate our LSPs for this area */ | |
202 | if (listcount(area->area_addrs) > 0) { | |
203 | if (area->is_type & IS_LEVEL_1) | |
204 | lsp_generate(area, IS_LEVEL_1); | |
205 | if (area->is_type & IS_LEVEL_2) | |
206 | lsp_generate(area, IS_LEVEL_2); | |
207 | } | |
208 | break; | |
209 | } | |
210 | ||
20bd27e2 EDP |
211 | return NB_OK; |
212 | } | |
213 | ||
5ad218a6 | 214 | static int isis_instance_area_address_destroy(enum nb_event event, |
20bd27e2 EDP |
215 | const struct lyd_node *dnode) |
216 | { | |
f084ea55 EDP |
217 | struct area_addr addr, *addrp = NULL; |
218 | struct listnode *node; | |
219 | uint8_t buff[255]; | |
220 | struct isis_area *area; | |
221 | const char *net_title; | |
222 | ||
223 | if (event != NB_EV_APPLY) | |
224 | return NB_OK; | |
225 | ||
226 | net_title = yang_dnode_get_string(dnode, NULL); | |
227 | addr.addr_len = dotformat2buff(buff, net_title); | |
228 | memcpy(addr.area_addr, buff, (int)addr.addr_len); | |
ccd43ada | 229 | area = nb_running_get_entry(dnode, NULL, true); |
f084ea55 EDP |
230 | for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node, addrp)) { |
231 | if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == addr.addr_len | |
232 | && !memcmp(addrp->area_addr, addr.area_addr, addr.addr_len)) | |
233 | break; | |
234 | } | |
235 | if (!addrp) | |
236 | return NB_ERR_INCONSISTENCY; | |
237 | ||
238 | listnode_delete(area->area_addrs, addrp); | |
239 | XFREE(MTYPE_ISIS_AREA_ADDR, addrp); | |
240 | /* | |
241 | * Last area address - reset the SystemID for this router | |
242 | */ | |
243 | if (listcount(area->area_addrs) == 0) { | |
244 | memset(isis->sysid, 0, ISIS_SYS_ID_LEN); | |
245 | isis->sysid_set = 0; | |
246 | if (isis->debugs & DEBUG_EVENTS) | |
247 | zlog_debug("Router has no SystemID"); | |
248 | } | |
249 | ||
20bd27e2 EDP |
250 | return NB_OK; |
251 | } | |
252 | ||
253 | /* | |
254 | * XPath: /frr-isisd:isis/instance/dynamic-hostname | |
255 | */ | |
256 | static int isis_instance_dynamic_hostname_modify(enum nb_event event, | |
257 | const struct lyd_node *dnode, | |
258 | union nb_resource *resource) | |
259 | { | |
6bb043cd EDP |
260 | struct isis_area *area; |
261 | ||
262 | if (event != NB_EV_APPLY) | |
263 | return NB_OK; | |
264 | ||
ccd43ada | 265 | area = nb_running_get_entry(dnode, NULL, true); |
6bb043cd EDP |
266 | isis_area_dynhostname_set(area, yang_dnode_get_bool(dnode, NULL)); |
267 | ||
20bd27e2 EDP |
268 | return NB_OK; |
269 | } | |
270 | ||
271 | /* | |
272 | * XPath: /frr-isisd:isis/instance/attached | |
273 | */ | |
5f1e5e3f | 274 | static int isis_instance_attached_modify(enum nb_event event, |
20bd27e2 EDP |
275 | const struct lyd_node *dnode, |
276 | union nb_resource *resource) | |
277 | { | |
05a3f9f0 | 278 | struct isis_area *area; |
5f1e5e3f | 279 | bool attached; |
05a3f9f0 EDP |
280 | |
281 | if (event != NB_EV_APPLY) | |
282 | return NB_OK; | |
283 | ||
ccd43ada | 284 | area = nb_running_get_entry(dnode, NULL, true); |
5f1e5e3f EDP |
285 | attached = yang_dnode_get_bool(dnode, NULL); |
286 | isis_area_attached_bit_set(area, attached); | |
05a3f9f0 | 287 | |
20bd27e2 EDP |
288 | return NB_OK; |
289 | } | |
290 | ||
291 | /* | |
292 | * XPath: /frr-isisd:isis/instance/overload | |
293 | */ | |
5f1e5e3f | 294 | static int isis_instance_overload_modify(enum nb_event event, |
20bd27e2 EDP |
295 | const struct lyd_node *dnode, |
296 | union nb_resource *resource) | |
297 | { | |
05a3f9f0 | 298 | struct isis_area *area; |
5f1e5e3f | 299 | bool overload; |
05a3f9f0 EDP |
300 | |
301 | if (event != NB_EV_APPLY) | |
302 | return NB_OK; | |
303 | ||
ccd43ada | 304 | area = nb_running_get_entry(dnode, NULL, true); |
5f1e5e3f EDP |
305 | overload = yang_dnode_get_bool(dnode, NULL); |
306 | isis_area_overload_bit_set(area, overload); | |
05a3f9f0 | 307 | |
20bd27e2 EDP |
308 | return NB_OK; |
309 | } | |
310 | ||
311 | /* | |
312 | * XPath: /frr-isisd:isis/instance/metric-style | |
313 | */ | |
314 | static int isis_instance_metric_style_modify(enum nb_event event, | |
315 | const struct lyd_node *dnode, | |
316 | union nb_resource *resource) | |
317 | { | |
e0df3206 EDP |
318 | struct isis_area *area; |
319 | bool old_metric, new_metric; | |
320 | enum isis_metric_style metric_style = yang_dnode_get_enum(dnode, NULL); | |
321 | ||
322 | if (event != NB_EV_APPLY) | |
323 | return NB_OK; | |
324 | ||
ccd43ada | 325 | area = nb_running_get_entry(dnode, NULL, true); |
e0df3206 EDP |
326 | old_metric = (metric_style == ISIS_WIDE_METRIC) ? false : true; |
327 | new_metric = (metric_style == ISIS_NARROW_METRIC) ? false : true; | |
328 | isis_area_metricstyle_set(area, old_metric, new_metric); | |
329 | ||
20bd27e2 EDP |
330 | return NB_OK; |
331 | } | |
332 | ||
333 | /* | |
334 | * XPath: /frr-isisd:isis/instance/purge-originator | |
335 | */ | |
5f1e5e3f | 336 | static int isis_instance_purge_originator_modify(enum nb_event event, |
20bd27e2 EDP |
337 | const struct lyd_node *dnode, |
338 | union nb_resource *resource) | |
339 | { | |
66e45e10 EDP |
340 | struct isis_area *area; |
341 | ||
342 | if (event != NB_EV_APPLY) | |
343 | return NB_OK; | |
344 | ||
ccd43ada | 345 | area = nb_running_get_entry(dnode, NULL, true); |
5f1e5e3f | 346 | area->purge_originator = yang_dnode_get_bool(dnode, NULL); |
66e45e10 | 347 | |
20bd27e2 EDP |
348 | return NB_OK; |
349 | } | |
350 | ||
351 | /* | |
352 | * XPath: /frr-isisd:isis/instance/lsp/mtu | |
353 | */ | |
354 | static int isis_instance_lsp_mtu_modify(enum nb_event event, | |
355 | const struct lyd_node *dnode, | |
356 | union nb_resource *resource) | |
357 | { | |
27a45d16 EDP |
358 | struct listnode *node; |
359 | struct isis_circuit *circuit; | |
360 | uint16_t lsp_mtu = yang_dnode_get_uint16(dnode, NULL); | |
361 | struct isis_area *area; | |
362 | ||
363 | switch (event) { | |
364 | case NB_EV_VALIDATE: | |
ccd43ada | 365 | area = nb_running_get_entry(dnode, NULL, false); |
27a45d16 EDP |
366 | if (!area) |
367 | break; | |
368 | for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) { | |
369 | if (circuit->state != C_STATE_INIT | |
370 | && circuit->state != C_STATE_UP) | |
371 | continue; | |
372 | if (lsp_mtu > isis_circuit_pdu_size(circuit)) { | |
373 | flog_warn( | |
374 | EC_LIB_NB_CB_CONFIG_VALIDATE, | |
375 | "ISIS area contains circuit %s, which has a maximum PDU size of %zu", | |
376 | circuit->interface->name, | |
377 | isis_circuit_pdu_size(circuit)); | |
378 | return NB_ERR_VALIDATION; | |
379 | } | |
380 | } | |
381 | break; | |
382 | case NB_EV_PREPARE: | |
383 | case NB_EV_ABORT: | |
384 | break; | |
385 | case NB_EV_APPLY: | |
ccd43ada | 386 | area = nb_running_get_entry(dnode, NULL, true); |
27a45d16 EDP |
387 | isis_area_lsp_mtu_set(area, lsp_mtu); |
388 | break; | |
389 | } | |
390 | ||
20bd27e2 EDP |
391 | return NB_OK; |
392 | } | |
393 | ||
394 | /* | |
395 | * XPath: /frr-isisd:isis/instance/lsp/refresh-interval/level-1 | |
396 | */ | |
397 | static int | |
398 | isis_instance_lsp_refresh_interval_level_1_modify(enum nb_event event, | |
399 | const struct lyd_node *dnode, | |
400 | union nb_resource *resource) | |
401 | { | |
7e869004 EDP |
402 | struct isis_area *area; |
403 | uint16_t refr_int; | |
404 | ||
405 | if (event != NB_EV_APPLY) | |
406 | return NB_OK; | |
407 | ||
408 | refr_int = yang_dnode_get_uint16(dnode, NULL); | |
ccd43ada | 409 | area = nb_running_get_entry(dnode, NULL, true); |
7e869004 EDP |
410 | isis_area_lsp_refresh_set(area, IS_LEVEL_1, refr_int); |
411 | ||
20bd27e2 EDP |
412 | return NB_OK; |
413 | } | |
414 | ||
415 | /* | |
416 | * XPath: /frr-isisd:isis/instance/lsp/refresh-interval/level-2 | |
417 | */ | |
418 | static int | |
419 | isis_instance_lsp_refresh_interval_level_2_modify(enum nb_event event, | |
420 | const struct lyd_node *dnode, | |
421 | union nb_resource *resource) | |
422 | { | |
7e869004 EDP |
423 | struct isis_area *area; |
424 | uint16_t refr_int; | |
425 | ||
426 | if (event != NB_EV_APPLY) | |
427 | return NB_OK; | |
428 | ||
429 | refr_int = yang_dnode_get_uint16(dnode, NULL); | |
ccd43ada | 430 | area = nb_running_get_entry(dnode, NULL, true); |
7e869004 EDP |
431 | isis_area_lsp_refresh_set(area, IS_LEVEL_2, refr_int); |
432 | ||
20bd27e2 EDP |
433 | return NB_OK; |
434 | } | |
435 | ||
436 | /* | |
437 | * XPath: /frr-isisd:isis/instance/lsp/maximum-lifetime/level-1 | |
438 | */ | |
439 | static int | |
440 | isis_instance_lsp_maximum_lifetime_level_1_modify(enum nb_event event, | |
441 | const struct lyd_node *dnode, | |
442 | union nb_resource *resource) | |
443 | { | |
ea120aa0 EDP |
444 | struct isis_area *area; |
445 | uint16_t max_lt; | |
446 | ||
447 | if (event != NB_EV_APPLY) | |
448 | return NB_OK; | |
449 | ||
450 | max_lt = yang_dnode_get_uint16(dnode, NULL); | |
ccd43ada | 451 | area = nb_running_get_entry(dnode, NULL, true); |
ea120aa0 EDP |
452 | isis_area_max_lsp_lifetime_set(area, IS_LEVEL_1, max_lt); |
453 | ||
20bd27e2 EDP |
454 | return NB_OK; |
455 | } | |
456 | ||
457 | /* | |
458 | * XPath: /frr-isisd:isis/instance/lsp/maximum-lifetime/level-2 | |
459 | */ | |
460 | static int | |
461 | isis_instance_lsp_maximum_lifetime_level_2_modify(enum nb_event event, | |
462 | const struct lyd_node *dnode, | |
463 | union nb_resource *resource) | |
464 | { | |
ea120aa0 EDP |
465 | struct isis_area *area; |
466 | uint16_t max_lt; | |
467 | ||
468 | if (event != NB_EV_APPLY) | |
469 | return NB_OK; | |
470 | ||
471 | max_lt = yang_dnode_get_uint16(dnode, NULL); | |
ccd43ada | 472 | area = nb_running_get_entry(dnode, NULL, true); |
ea120aa0 EDP |
473 | isis_area_max_lsp_lifetime_set(area, IS_LEVEL_2, max_lt); |
474 | ||
20bd27e2 EDP |
475 | return NB_OK; |
476 | } | |
477 | ||
478 | /* | |
479 | * XPath: /frr-isisd:isis/instance/lsp/generation-interval/level-1 | |
480 | */ | |
481 | static int isis_instance_lsp_generation_interval_level_1_modify( | |
482 | enum nb_event event, const struct lyd_node *dnode, | |
483 | union nb_resource *resource) | |
484 | { | |
1d6fe72e EDP |
485 | struct isis_area *area; |
486 | uint16_t gen_int; | |
487 | ||
488 | if (event != NB_EV_APPLY) | |
489 | return NB_OK; | |
490 | ||
491 | gen_int = yang_dnode_get_uint16(dnode, NULL); | |
ccd43ada | 492 | area = nb_running_get_entry(dnode, NULL, true); |
1d6fe72e EDP |
493 | area->lsp_gen_interval[0] = gen_int; |
494 | ||
20bd27e2 EDP |
495 | return NB_OK; |
496 | } | |
497 | ||
498 | /* | |
499 | * XPath: /frr-isisd:isis/instance/lsp/generation-interval/level-2 | |
500 | */ | |
501 | static int isis_instance_lsp_generation_interval_level_2_modify( | |
502 | enum nb_event event, const struct lyd_node *dnode, | |
503 | union nb_resource *resource) | |
504 | { | |
1d6fe72e EDP |
505 | struct isis_area *area; |
506 | uint16_t gen_int; | |
507 | ||
508 | if (event != NB_EV_APPLY) | |
509 | return NB_OK; | |
510 | ||
511 | gen_int = yang_dnode_get_uint16(dnode, NULL); | |
ccd43ada | 512 | area = nb_running_get_entry(dnode, NULL, true); |
1d6fe72e EDP |
513 | area->lsp_gen_interval[1] = gen_int; |
514 | ||
20bd27e2 EDP |
515 | return NB_OK; |
516 | } | |
517 | ||
518 | /* | |
519 | * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay | |
520 | */ | |
5336ba30 EDP |
521 | static void ietf_backoff_delay_apply_finish(const struct lyd_node *dnode) |
522 | { | |
523 | long init_delay = yang_dnode_get_uint16(dnode, "./init-delay"); | |
524 | long short_delay = yang_dnode_get_uint16(dnode, "./short-delay"); | |
525 | long long_delay = yang_dnode_get_uint16(dnode, "./long-delay"); | |
526 | long holddown = yang_dnode_get_uint16(dnode, "./hold-down"); | |
527 | long timetolearn = yang_dnode_get_uint16(dnode, "./time-to-learn"); | |
ccd43ada | 528 | struct isis_area *area = nb_running_get_entry(dnode, NULL, true); |
5336ba30 EDP |
529 | size_t bufsiz = strlen(area->area_tag) + sizeof("IS-IS Lx"); |
530 | char *buf = XCALLOC(MTYPE_TMP, bufsiz); | |
531 | ||
532 | snprintf(buf, bufsiz, "IS-IS %s L1", area->area_tag); | |
533 | spf_backoff_free(area->spf_delay_ietf[0]); | |
534 | area->spf_delay_ietf[0] = | |
535 | spf_backoff_new(master, buf, init_delay, short_delay, | |
536 | long_delay, holddown, timetolearn); | |
537 | ||
538 | snprintf(buf, bufsiz, "IS-IS %s L2", area->area_tag); | |
539 | spf_backoff_free(area->spf_delay_ietf[1]); | |
540 | area->spf_delay_ietf[1] = | |
541 | spf_backoff_new(master, buf, init_delay, short_delay, | |
542 | long_delay, holddown, timetolearn); | |
543 | ||
544 | XFREE(MTYPE_TMP, buf); | |
545 | } | |
546 | ||
20bd27e2 EDP |
547 | static int |
548 | isis_instance_spf_ietf_backoff_delay_create(enum nb_event event, | |
549 | const struct lyd_node *dnode, | |
550 | union nb_resource *resource) | |
551 | { | |
5336ba30 | 552 | /* All the work is done in the apply_finish */ |
20bd27e2 EDP |
553 | return NB_OK; |
554 | } | |
555 | ||
556 | static int | |
5ad218a6 | 557 | isis_instance_spf_ietf_backoff_delay_destroy(enum nb_event event, |
20bd27e2 EDP |
558 | const struct lyd_node *dnode) |
559 | { | |
5336ba30 EDP |
560 | struct isis_area *area; |
561 | ||
562 | if (event != NB_EV_APPLY) | |
563 | return NB_OK; | |
564 | ||
ccd43ada | 565 | area = nb_running_get_entry(dnode, NULL, true); |
5336ba30 EDP |
566 | spf_backoff_free(area->spf_delay_ietf[0]); |
567 | spf_backoff_free(area->spf_delay_ietf[1]); | |
568 | area->spf_delay_ietf[0] = NULL; | |
569 | area->spf_delay_ietf[1] = NULL; | |
570 | ||
20bd27e2 EDP |
571 | return NB_OK; |
572 | } | |
573 | ||
574 | /* | |
575 | * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/init-delay | |
576 | */ | |
577 | static int isis_instance_spf_ietf_backoff_delay_init_delay_modify( | |
578 | enum nb_event event, const struct lyd_node *dnode, | |
579 | union nb_resource *resource) | |
580 | { | |
5336ba30 | 581 | /* All the work is done in the apply_finish */ |
20bd27e2 EDP |
582 | return NB_OK; |
583 | } | |
584 | ||
585 | /* | |
586 | * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/short-delay | |
587 | */ | |
588 | static int isis_instance_spf_ietf_backoff_delay_short_delay_modify( | |
589 | enum nb_event event, const struct lyd_node *dnode, | |
590 | union nb_resource *resource) | |
591 | { | |
5336ba30 | 592 | /* All the work is done in the apply_finish */ |
20bd27e2 EDP |
593 | return NB_OK; |
594 | } | |
595 | ||
596 | /* | |
597 | * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/long-delay | |
598 | */ | |
599 | static int isis_instance_spf_ietf_backoff_delay_long_delay_modify( | |
600 | enum nb_event event, const struct lyd_node *dnode, | |
601 | union nb_resource *resource) | |
602 | { | |
5336ba30 | 603 | /* All the work is done in the apply_finish */ |
20bd27e2 EDP |
604 | return NB_OK; |
605 | } | |
606 | ||
607 | /* | |
608 | * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/hold-down | |
609 | */ | |
610 | static int isis_instance_spf_ietf_backoff_delay_hold_down_modify( | |
611 | enum nb_event event, const struct lyd_node *dnode, | |
612 | union nb_resource *resource) | |
613 | { | |
5336ba30 | 614 | /* All the work is done in the apply_finish */ |
20bd27e2 EDP |
615 | return NB_OK; |
616 | } | |
617 | ||
618 | /* | |
619 | * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay/time-to-learn | |
620 | */ | |
621 | static int isis_instance_spf_ietf_backoff_delay_time_to_learn_modify( | |
622 | enum nb_event event, const struct lyd_node *dnode, | |
623 | union nb_resource *resource) | |
624 | { | |
5336ba30 | 625 | /* All the work is done in the apply_finish */ |
20bd27e2 EDP |
626 | return NB_OK; |
627 | } | |
628 | ||
629 | /* | |
630 | * XPath: /frr-isisd:isis/instance/spf/minimum-interval/level-1 | |
631 | */ | |
632 | static int | |
633 | isis_instance_spf_minimum_interval_level_1_modify(enum nb_event event, | |
634 | const struct lyd_node *dnode, | |
635 | union nb_resource *resource) | |
636 | { | |
dcb1dcd6 EDP |
637 | struct isis_area *area; |
638 | ||
639 | if (event != NB_EV_APPLY) | |
640 | return NB_OK; | |
641 | ||
ccd43ada | 642 | area = nb_running_get_entry(dnode, NULL, true); |
dcb1dcd6 EDP |
643 | area->min_spf_interval[0] = yang_dnode_get_uint16(dnode, NULL); |
644 | ||
20bd27e2 EDP |
645 | return NB_OK; |
646 | } | |
647 | ||
648 | /* | |
649 | * XPath: /frr-isisd:isis/instance/spf/minimum-interval/level-2 | |
650 | */ | |
651 | static int | |
652 | isis_instance_spf_minimum_interval_level_2_modify(enum nb_event event, | |
653 | const struct lyd_node *dnode, | |
654 | union nb_resource *resource) | |
655 | { | |
dcb1dcd6 EDP |
656 | struct isis_area *area; |
657 | ||
658 | if (event != NB_EV_APPLY) | |
659 | return NB_OK; | |
660 | ||
ccd43ada | 661 | area = nb_running_get_entry(dnode, NULL, true); |
dcb1dcd6 EDP |
662 | area->min_spf_interval[1] = yang_dnode_get_uint16(dnode, NULL); |
663 | ||
20bd27e2 EDP |
664 | return NB_OK; |
665 | } | |
666 | ||
667 | /* | |
668 | * XPath: /frr-isisd:isis/instance/area-password | |
669 | */ | |
933536e3 EDP |
670 | static void area_password_apply_finish(const struct lyd_node *dnode) |
671 | { | |
672 | const char *password = yang_dnode_get_string(dnode, "./password"); | |
ccd43ada | 673 | struct isis_area *area = nb_running_get_entry(dnode, NULL, true); |
933536e3 EDP |
674 | int pass_type = yang_dnode_get_enum(dnode, "./password-type"); |
675 | uint8_t snp_auth = yang_dnode_get_enum(dnode, "./authenticate-snp"); | |
676 | ||
677 | switch (pass_type) { | |
678 | case ISIS_PASSWD_TYPE_CLEARTXT: | |
679 | isis_area_passwd_cleartext_set(area, IS_LEVEL_1, password, | |
680 | snp_auth); | |
681 | break; | |
682 | case ISIS_PASSWD_TYPE_HMAC_MD5: | |
683 | isis_area_passwd_hmac_md5_set(area, IS_LEVEL_1, password, | |
684 | snp_auth); | |
685 | break; | |
686 | } | |
687 | } | |
688 | ||
20bd27e2 EDP |
689 | static int isis_instance_area_password_create(enum nb_event event, |
690 | const struct lyd_node *dnode, | |
691 | union nb_resource *resource) | |
692 | { | |
933536e3 | 693 | /* actual setting is done in apply_finish */ |
20bd27e2 EDP |
694 | return NB_OK; |
695 | } | |
696 | ||
5ad218a6 | 697 | static int isis_instance_area_password_destroy(enum nb_event event, |
20bd27e2 EDP |
698 | const struct lyd_node *dnode) |
699 | { | |
933536e3 EDP |
700 | struct isis_area *area; |
701 | ||
702 | if (event != NB_EV_APPLY) | |
703 | return NB_OK; | |
704 | ||
ccd43ada | 705 | area = nb_running_get_entry(dnode, NULL, true); |
933536e3 EDP |
706 | isis_area_passwd_unset(area, IS_LEVEL_1); |
707 | ||
20bd27e2 EDP |
708 | return NB_OK; |
709 | } | |
710 | ||
711 | /* | |
712 | * XPath: /frr-isisd:isis/instance/area-password/password | |
713 | */ | |
714 | static int | |
715 | isis_instance_area_password_password_modify(enum nb_event event, | |
716 | const struct lyd_node *dnode, | |
717 | union nb_resource *resource) | |
718 | { | |
933536e3 | 719 | /* actual setting is done in apply_finish */ |
20bd27e2 EDP |
720 | return NB_OK; |
721 | } | |
722 | ||
723 | /* | |
724 | * XPath: /frr-isisd:isis/instance/area-password/password-type | |
725 | */ | |
726 | static int | |
727 | isis_instance_area_password_password_type_modify(enum nb_event event, | |
728 | const struct lyd_node *dnode, | |
729 | union nb_resource *resource) | |
730 | { | |
933536e3 | 731 | /* actual setting is done in apply_finish */ |
20bd27e2 EDP |
732 | return NB_OK; |
733 | } | |
734 | ||
735 | /* | |
736 | * XPath: /frr-isisd:isis/instance/area-password/authenticate-snp | |
737 | */ | |
738 | static int isis_instance_area_password_authenticate_snp_modify( | |
739 | enum nb_event event, const struct lyd_node *dnode, | |
740 | union nb_resource *resource) | |
741 | { | |
933536e3 | 742 | /* actual setting is done in apply_finish */ |
20bd27e2 EDP |
743 | return NB_OK; |
744 | } | |
745 | ||
746 | /* | |
747 | * XPath: /frr-isisd:isis/instance/domain-password | |
748 | */ | |
933536e3 EDP |
749 | static void domain_password_apply_finish(const struct lyd_node *dnode) |
750 | { | |
751 | const char *password = yang_dnode_get_string(dnode, "./password"); | |
ccd43ada | 752 | struct isis_area *area = nb_running_get_entry(dnode, NULL, true); |
933536e3 EDP |
753 | int pass_type = yang_dnode_get_enum(dnode, "./password-type"); |
754 | uint8_t snp_auth = yang_dnode_get_enum(dnode, "./authenticate-snp"); | |
755 | ||
756 | switch (pass_type) { | |
757 | case ISIS_PASSWD_TYPE_CLEARTXT: | |
758 | isis_area_passwd_cleartext_set(area, IS_LEVEL_2, password, | |
759 | snp_auth); | |
760 | break; | |
761 | case ISIS_PASSWD_TYPE_HMAC_MD5: | |
762 | isis_area_passwd_hmac_md5_set(area, IS_LEVEL_2, password, | |
763 | snp_auth); | |
764 | break; | |
765 | } | |
766 | } | |
767 | ||
20bd27e2 EDP |
768 | static int isis_instance_domain_password_create(enum nb_event event, |
769 | const struct lyd_node *dnode, | |
770 | union nb_resource *resource) | |
771 | { | |
933536e3 | 772 | /* actual setting is done in apply_finish */ |
20bd27e2 EDP |
773 | return NB_OK; |
774 | } | |
775 | ||
5ad218a6 | 776 | static int isis_instance_domain_password_destroy(enum nb_event event, |
20bd27e2 EDP |
777 | const struct lyd_node *dnode) |
778 | { | |
933536e3 EDP |
779 | struct isis_area *area; |
780 | ||
781 | if (event != NB_EV_APPLY) | |
782 | return NB_OK; | |
783 | ||
ccd43ada | 784 | area = nb_running_get_entry(dnode, NULL, true); |
933536e3 EDP |
785 | isis_area_passwd_unset(area, IS_LEVEL_2); |
786 | ||
20bd27e2 EDP |
787 | return NB_OK; |
788 | } | |
789 | ||
790 | /* | |
791 | * XPath: /frr-isisd:isis/instance/domain-password/password | |
792 | */ | |
793 | static int | |
794 | isis_instance_domain_password_password_modify(enum nb_event event, | |
795 | const struct lyd_node *dnode, | |
796 | union nb_resource *resource) | |
797 | { | |
933536e3 | 798 | /* actual setting is done in apply_finish */ |
20bd27e2 EDP |
799 | return NB_OK; |
800 | } | |
801 | ||
802 | /* | |
803 | * XPath: /frr-isisd:isis/instance/domain-password/password-type | |
804 | */ | |
805 | static int | |
806 | isis_instance_domain_password_password_type_modify(enum nb_event event, | |
807 | const struct lyd_node *dnode, | |
808 | union nb_resource *resource) | |
809 | { | |
933536e3 | 810 | /* actual setting is done in apply_finish */ |
20bd27e2 EDP |
811 | return NB_OK; |
812 | } | |
813 | ||
814 | /* | |
815 | * XPath: /frr-isisd:isis/instance/domain-password/authenticate-snp | |
816 | */ | |
817 | static int isis_instance_domain_password_authenticate_snp_modify( | |
818 | enum nb_event event, const struct lyd_node *dnode, | |
819 | union nb_resource *resource) | |
820 | { | |
933536e3 | 821 | /* actual setting is done in apply_finish */ |
20bd27e2 EDP |
822 | return NB_OK; |
823 | } | |
824 | ||
825 | /* | |
826 | * XPath: /frr-isisd:isis/instance/default-information-originate/ipv4 | |
827 | */ | |
8b104c10 EDP |
828 | static void default_info_origin_apply_finish(const struct lyd_node *dnode, |
829 | int family) | |
830 | { | |
831 | int originate_type = DEFAULT_ORIGINATE; | |
832 | unsigned long metric = 0; | |
833 | const char *routemap = NULL; | |
ccd43ada | 834 | struct isis_area *area = nb_running_get_entry(dnode, NULL, true); |
8b104c10 EDP |
835 | int level = yang_dnode_get_enum(dnode, "./level"); |
836 | ||
5f1e5e3f | 837 | if (yang_dnode_get_bool(dnode, "./always")) { |
8b104c10 EDP |
838 | originate_type = DEFAULT_ORIGINATE_ALWAYS; |
839 | } else if (family == AF_INET6) { | |
840 | zlog_warn( | |
841 | "%s: Zebra doesn't implement default-originate for IPv6 yet, so use with care or use default-originate always.", | |
842 | __func__); | |
843 | } | |
844 | ||
845 | if (yang_dnode_exists(dnode, "./metric")) | |
846 | metric = yang_dnode_get_uint32(dnode, "./metric"); | |
82c25998 | 847 | if (yang_dnode_exists(dnode, "./route-map")) |
8b104c10 EDP |
848 | routemap = yang_dnode_get_string(dnode, "./route-map"); |
849 | ||
850 | isis_redist_set(area, level, family, DEFAULT_ROUTE, metric, routemap, | |
851 | originate_type); | |
852 | } | |
853 | ||
854 | static void default_info_origin_ipv4_apply_finish(const struct lyd_node *dnode) | |
855 | { | |
856 | default_info_origin_apply_finish(dnode, AF_INET); | |
857 | } | |
858 | ||
859 | static void default_info_origin_ipv6_apply_finish(const struct lyd_node *dnode) | |
860 | { | |
861 | default_info_origin_apply_finish(dnode, AF_INET6); | |
862 | } | |
863 | ||
20bd27e2 EDP |
864 | static int isis_instance_default_information_originate_ipv4_create( |
865 | enum nb_event event, const struct lyd_node *dnode, | |
866 | union nb_resource *resource) | |
867 | { | |
8b104c10 | 868 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
869 | return NB_OK; |
870 | } | |
871 | ||
5ad218a6 | 872 | static int isis_instance_default_information_originate_ipv4_destroy( |
20bd27e2 EDP |
873 | enum nb_event event, const struct lyd_node *dnode) |
874 | { | |
8b104c10 EDP |
875 | struct isis_area *area; |
876 | int level; | |
877 | ||
878 | if (event != NB_EV_APPLY) | |
879 | return NB_OK; | |
880 | ||
ccd43ada | 881 | area = nb_running_get_entry(dnode, NULL, true); |
8b104c10 EDP |
882 | level = yang_dnode_get_enum(dnode, "./level"); |
883 | isis_redist_unset(area, level, AF_INET, DEFAULT_ROUTE); | |
884 | ||
20bd27e2 EDP |
885 | return NB_OK; |
886 | } | |
887 | ||
888 | /* | |
889 | * XPath: /frr-isisd:isis/instance/default-information-originate/ipv4/always | |
890 | */ | |
5f1e5e3f | 891 | static int isis_instance_default_information_originate_ipv4_always_modify( |
20bd27e2 EDP |
892 | enum nb_event event, const struct lyd_node *dnode, |
893 | union nb_resource *resource) | |
894 | { | |
8b104c10 | 895 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
896 | return NB_OK; |
897 | } | |
898 | ||
20bd27e2 EDP |
899 | /* |
900 | * XPath: /frr-isisd:isis/instance/default-information-originate/ipv4/route-map | |
901 | */ | |
902 | static int isis_instance_default_information_originate_ipv4_route_map_modify( | |
903 | enum nb_event event, const struct lyd_node *dnode, | |
904 | union nb_resource *resource) | |
905 | { | |
8b104c10 | 906 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
907 | return NB_OK; |
908 | } | |
909 | ||
5ad218a6 | 910 | static int isis_instance_default_information_originate_ipv4_route_map_destroy( |
20bd27e2 EDP |
911 | enum nb_event event, const struct lyd_node *dnode) |
912 | { | |
8b104c10 | 913 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
914 | return NB_OK; |
915 | } | |
916 | ||
917 | /* | |
918 | * XPath: /frr-isisd:isis/instance/default-information-originate/ipv4/metric | |
919 | */ | |
920 | static int isis_instance_default_information_originate_ipv4_metric_modify( | |
921 | enum nb_event event, const struct lyd_node *dnode, | |
922 | union nb_resource *resource) | |
923 | { | |
8b104c10 | 924 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
925 | return NB_OK; |
926 | } | |
927 | ||
20bd27e2 EDP |
928 | /* |
929 | * XPath: /frr-isisd:isis/instance/default-information-originate/ipv6 | |
930 | */ | |
931 | static int isis_instance_default_information_originate_ipv6_create( | |
932 | enum nb_event event, const struct lyd_node *dnode, | |
933 | union nb_resource *resource) | |
934 | { | |
8b104c10 | 935 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
936 | return NB_OK; |
937 | } | |
938 | ||
5ad218a6 | 939 | static int isis_instance_default_information_originate_ipv6_destroy( |
20bd27e2 EDP |
940 | enum nb_event event, const struct lyd_node *dnode) |
941 | { | |
8b104c10 EDP |
942 | struct isis_area *area; |
943 | int level; | |
944 | ||
945 | if (event != NB_EV_APPLY) | |
946 | return NB_OK; | |
947 | ||
ccd43ada | 948 | area = nb_running_get_entry(dnode, NULL, true); |
8b104c10 EDP |
949 | level = yang_dnode_get_enum(dnode, "./level"); |
950 | isis_redist_unset(area, level, AF_INET6, DEFAULT_ROUTE); | |
951 | ||
20bd27e2 EDP |
952 | return NB_OK; |
953 | } | |
954 | ||
955 | /* | |
956 | * XPath: /frr-isisd:isis/instance/default-information-originate/ipv6/always | |
957 | */ | |
5f1e5e3f | 958 | static int isis_instance_default_information_originate_ipv6_always_modify( |
20bd27e2 EDP |
959 | enum nb_event event, const struct lyd_node *dnode, |
960 | union nb_resource *resource) | |
961 | { | |
8b104c10 | 962 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
963 | return NB_OK; |
964 | } | |
965 | ||
20bd27e2 EDP |
966 | /* |
967 | * XPath: /frr-isisd:isis/instance/default-information-originate/ipv6/route-map | |
968 | */ | |
969 | static int isis_instance_default_information_originate_ipv6_route_map_modify( | |
970 | enum nb_event event, const struct lyd_node *dnode, | |
971 | union nb_resource *resource) | |
972 | { | |
8b104c10 | 973 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
974 | return NB_OK; |
975 | } | |
976 | ||
5ad218a6 | 977 | static int isis_instance_default_information_originate_ipv6_route_map_destroy( |
20bd27e2 EDP |
978 | enum nb_event event, const struct lyd_node *dnode) |
979 | { | |
8b104c10 | 980 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
981 | return NB_OK; |
982 | } | |
983 | ||
984 | /* | |
985 | * XPath: /frr-isisd:isis/instance/default-information-originate/ipv6/metric | |
986 | */ | |
987 | static int isis_instance_default_information_originate_ipv6_metric_modify( | |
988 | enum nb_event event, const struct lyd_node *dnode, | |
989 | union nb_resource *resource) | |
990 | { | |
8b104c10 | 991 | /* It's all done by default_info_origin_apply_finish */ |
20bd27e2 EDP |
992 | return NB_OK; |
993 | } | |
994 | ||
20bd27e2 EDP |
995 | /* |
996 | * XPath: /frr-isisd:isis/instance/redistribute/ipv4 | |
997 | */ | |
a041ac8e EDP |
998 | static void redistribute_apply_finish(const struct lyd_node *dnode, int family) |
999 | { | |
1000 | assert(family == AF_INET || family == AF_INET6); | |
1001 | int type, level; | |
1002 | unsigned long metric = 0; | |
1003 | const char *routemap = NULL; | |
1004 | struct isis_area *area; | |
1005 | ||
1006 | type = yang_dnode_get_enum(dnode, "./protocol"); | |
1007 | level = yang_dnode_get_enum(dnode, "./level"); | |
ccd43ada | 1008 | area = nb_running_get_entry(dnode, NULL, true); |
a041ac8e EDP |
1009 | |
1010 | if (yang_dnode_exists(dnode, "./metric")) | |
1011 | metric = yang_dnode_get_uint32(dnode, "./metric"); | |
82c25998 | 1012 | if (yang_dnode_exists(dnode, "./route-map")) |
a041ac8e EDP |
1013 | routemap = yang_dnode_get_string(dnode, "./route-map"); |
1014 | ||
1015 | isis_redist_set(area, level, family, type, metric, routemap, 0); | |
1016 | } | |
1017 | ||
1018 | static void redistribute_ipv4_apply_finish(const struct lyd_node *dnode) | |
1019 | { | |
1020 | redistribute_apply_finish(dnode, AF_INET); | |
1021 | } | |
1022 | ||
1023 | static void redistribute_ipv6_apply_finish(const struct lyd_node *dnode) | |
1024 | { | |
1025 | redistribute_apply_finish(dnode, AF_INET6); | |
1026 | } | |
1027 | ||
20bd27e2 EDP |
1028 | static int isis_instance_redistribute_ipv4_create(enum nb_event event, |
1029 | const struct lyd_node *dnode, | |
1030 | union nb_resource *resource) | |
1031 | { | |
a041ac8e | 1032 | /* It's all done by redistribute_apply_finish */ |
20bd27e2 EDP |
1033 | return NB_OK; |
1034 | } | |
1035 | ||
5ad218a6 | 1036 | static int isis_instance_redistribute_ipv4_destroy(enum nb_event event, |
20bd27e2 EDP |
1037 | const struct lyd_node *dnode) |
1038 | { | |
a041ac8e EDP |
1039 | struct isis_area *area; |
1040 | int level, type; | |
1041 | ||
1042 | if (event != NB_EV_APPLY) | |
1043 | return NB_OK; | |
1044 | ||
ccd43ada | 1045 | area = nb_running_get_entry(dnode, NULL, true); |
a041ac8e EDP |
1046 | level = yang_dnode_get_enum(dnode, "./level"); |
1047 | type = yang_dnode_get_enum(dnode, "./protocol"); | |
1048 | isis_redist_unset(area, level, AF_INET, type); | |
1049 | ||
20bd27e2 EDP |
1050 | return NB_OK; |
1051 | } | |
1052 | ||
1053 | /* | |
1054 | * XPath: /frr-isisd:isis/instance/redistribute/ipv4/route-map | |
1055 | */ | |
1056 | static int | |
1057 | isis_instance_redistribute_ipv4_route_map_modify(enum nb_event event, | |
1058 | const struct lyd_node *dnode, | |
1059 | union nb_resource *resource) | |
1060 | { | |
a041ac8e | 1061 | /* It's all done by redistribute_apply_finish */ |
20bd27e2 EDP |
1062 | return NB_OK; |
1063 | } | |
1064 | ||
1065 | static int | |
5ad218a6 | 1066 | isis_instance_redistribute_ipv4_route_map_destroy(enum nb_event event, |
20bd27e2 EDP |
1067 | const struct lyd_node *dnode) |
1068 | { | |
a041ac8e | 1069 | /* It's all done by redistribute_apply_finish */ |
20bd27e2 EDP |
1070 | return NB_OK; |
1071 | } | |
1072 | ||
1073 | /* | |
1074 | * XPath: /frr-isisd:isis/instance/redistribute/ipv4/metric | |
1075 | */ | |
1076 | static int | |
1077 | isis_instance_redistribute_ipv4_metric_modify(enum nb_event event, | |
1078 | const struct lyd_node *dnode, | |
1079 | union nb_resource *resource) | |
1080 | { | |
a041ac8e | 1081 | /* It's all done by redistribute_apply_finish */ |
20bd27e2 EDP |
1082 | return NB_OK; |
1083 | } | |
1084 | ||
20bd27e2 EDP |
1085 | /* |
1086 | * XPath: /frr-isisd:isis/instance/redistribute/ipv6 | |
1087 | */ | |
1088 | static int isis_instance_redistribute_ipv6_create(enum nb_event event, | |
1089 | const struct lyd_node *dnode, | |
1090 | union nb_resource *resource) | |
1091 | { | |
a041ac8e | 1092 | /* It's all done by redistribute_apply_finish */ |
20bd27e2 EDP |
1093 | return NB_OK; |
1094 | } | |
1095 | ||
5ad218a6 | 1096 | static int isis_instance_redistribute_ipv6_destroy(enum nb_event event, |
20bd27e2 EDP |
1097 | const struct lyd_node *dnode) |
1098 | { | |
a041ac8e EDP |
1099 | struct isis_area *area; |
1100 | int level, type; | |
1101 | ||
1102 | if (event != NB_EV_APPLY) | |
1103 | return NB_OK; | |
1104 | ||
ccd43ada | 1105 | area = nb_running_get_entry(dnode, NULL, true); |
a041ac8e EDP |
1106 | level = yang_dnode_get_enum(dnode, "./level"); |
1107 | type = yang_dnode_get_enum(dnode, "./protocol"); | |
1108 | isis_redist_unset(area, level, AF_INET6, type); | |
1109 | ||
20bd27e2 EDP |
1110 | return NB_OK; |
1111 | } | |
1112 | ||
1113 | /* | |
1114 | * XPath: /frr-isisd:isis/instance/redistribute/ipv6/route-map | |
1115 | */ | |
1116 | static int | |
1117 | isis_instance_redistribute_ipv6_route_map_modify(enum nb_event event, | |
1118 | const struct lyd_node *dnode, | |
1119 | union nb_resource *resource) | |
1120 | { | |
a041ac8e | 1121 | /* It's all done by redistribute_apply_finish */ |
20bd27e2 EDP |
1122 | return NB_OK; |
1123 | } | |
1124 | ||
1125 | static int | |
5ad218a6 | 1126 | isis_instance_redistribute_ipv6_route_map_destroy(enum nb_event event, |
20bd27e2 EDP |
1127 | const struct lyd_node *dnode) |
1128 | { | |
a041ac8e | 1129 | /* It's all done by redistribute_apply_finish */ |
20bd27e2 EDP |
1130 | return NB_OK; |
1131 | } | |
1132 | ||
1133 | /* | |
1134 | * XPath: /frr-isisd:isis/instance/redistribute/ipv6/metric | |
1135 | */ | |
1136 | static int | |
1137 | isis_instance_redistribute_ipv6_metric_modify(enum nb_event event, | |
1138 | const struct lyd_node *dnode, | |
1139 | union nb_resource *resource) | |
1140 | { | |
a041ac8e | 1141 | /* It's all done by redistribute_apply_finish */ |
20bd27e2 EDP |
1142 | return NB_OK; |
1143 | } | |
1144 | ||
20bd27e2 EDP |
1145 | /* |
1146 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv4-multicast | |
1147 | */ | |
22af6a80 EDP |
1148 | static int isis_multi_topology_common(enum nb_event event, |
1149 | const struct lyd_node *dnode, | |
1150 | const char *topology, bool create) | |
1151 | { | |
1152 | struct isis_area *area; | |
1153 | struct isis_area_mt_setting *setting; | |
1154 | uint16_t mtid = isis_str2mtid(topology); | |
1155 | ||
1156 | switch (event) { | |
1157 | case NB_EV_VALIDATE: | |
1158 | if (mtid == (uint16_t)-1) { | |
1159 | flog_warn(EC_LIB_NB_CB_CONFIG_VALIDATE, | |
1160 | "Unknown topology %s", topology); | |
1161 | return NB_ERR_VALIDATION; | |
1162 | } | |
1163 | break; | |
1164 | case NB_EV_PREPARE: | |
1165 | case NB_EV_ABORT: | |
1166 | break; | |
1167 | case NB_EV_APPLY: | |
ccd43ada | 1168 | area = nb_running_get_entry(dnode, NULL, true); |
22af6a80 EDP |
1169 | setting = area_get_mt_setting(area, mtid); |
1170 | setting->enabled = create; | |
1171 | lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 0); | |
1172 | break; | |
1173 | } | |
1174 | ||
1175 | return NB_OK; | |
1176 | } | |
1177 | ||
1178 | static int isis_multi_topology_overload_common(enum nb_event event, | |
1179 | const struct lyd_node *dnode, | |
5f1e5e3f | 1180 | const char *topology) |
22af6a80 EDP |
1181 | { |
1182 | struct isis_area *area; | |
1183 | struct isis_area_mt_setting *setting; | |
1184 | uint16_t mtid = isis_str2mtid(topology); | |
1185 | ||
1186 | /* validation is done in isis_multi_topology_common */ | |
1187 | if (event != NB_EV_APPLY) | |
1188 | return NB_OK; | |
1189 | ||
ccd43ada | 1190 | area = nb_running_get_entry(dnode, NULL, true); |
22af6a80 | 1191 | setting = area_get_mt_setting(area, mtid); |
5f1e5e3f | 1192 | setting->overload = yang_dnode_get_bool(dnode, NULL); |
22af6a80 EDP |
1193 | if (setting->enabled) |
1194 | lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 0); | |
1195 | ||
1196 | return NB_OK; | |
1197 | } | |
1198 | ||
20bd27e2 EDP |
1199 | static int |
1200 | isis_instance_multi_topology_ipv4_multicast_create(enum nb_event event, | |
1201 | const struct lyd_node *dnode, | |
1202 | union nb_resource *resource) | |
1203 | { | |
22af6a80 | 1204 | return isis_multi_topology_common(event, dnode, "ipv4-multicast", true); |
20bd27e2 EDP |
1205 | } |
1206 | ||
1207 | static int | |
5ad218a6 | 1208 | isis_instance_multi_topology_ipv4_multicast_destroy(enum nb_event event, |
20bd27e2 EDP |
1209 | const struct lyd_node *dnode) |
1210 | { | |
22af6a80 EDP |
1211 | return isis_multi_topology_common(event, dnode, "ipv4-multicast", |
1212 | false); | |
20bd27e2 EDP |
1213 | } |
1214 | ||
1215 | /* | |
1216 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv4-multicast/overload | |
1217 | */ | |
5f1e5e3f | 1218 | static int isis_instance_multi_topology_ipv4_multicast_overload_modify( |
20bd27e2 EDP |
1219 | enum nb_event event, const struct lyd_node *dnode, |
1220 | union nb_resource *resource) | |
1221 | { | |
22af6a80 | 1222 | return isis_multi_topology_overload_common(event, dnode, |
5f1e5e3f | 1223 | "ipv4-multicast"); |
20bd27e2 EDP |
1224 | } |
1225 | ||
1226 | /* | |
1227 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv4-management | |
1228 | */ | |
1229 | static int isis_instance_multi_topology_ipv4_management_create( | |
1230 | enum nb_event event, const struct lyd_node *dnode, | |
1231 | union nb_resource *resource) | |
1232 | { | |
22af6a80 | 1233 | return isis_multi_topology_common(event, dnode, "ipv4-mgmt", true); |
20bd27e2 EDP |
1234 | } |
1235 | ||
5ad218a6 | 1236 | static int isis_instance_multi_topology_ipv4_management_destroy( |
20bd27e2 EDP |
1237 | enum nb_event event, const struct lyd_node *dnode) |
1238 | { | |
22af6a80 | 1239 | return isis_multi_topology_common(event, dnode, "ipv4-mgmt", false); |
20bd27e2 EDP |
1240 | } |
1241 | ||
1242 | /* | |
1243 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv4-management/overload | |
1244 | */ | |
5f1e5e3f | 1245 | static int isis_instance_multi_topology_ipv4_management_overload_modify( |
20bd27e2 EDP |
1246 | enum nb_event event, const struct lyd_node *dnode, |
1247 | union nb_resource *resource) | |
1248 | { | |
5f1e5e3f | 1249 | return isis_multi_topology_overload_common(event, dnode, "ipv4-mgmt"); |
20bd27e2 EDP |
1250 | } |
1251 | ||
1252 | /* | |
1253 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-unicast | |
1254 | */ | |
1255 | static int | |
1256 | isis_instance_multi_topology_ipv6_unicast_create(enum nb_event event, | |
1257 | const struct lyd_node *dnode, | |
1258 | union nb_resource *resource) | |
1259 | { | |
22af6a80 | 1260 | return isis_multi_topology_common(event, dnode, "ipv6-unicast", true); |
20bd27e2 EDP |
1261 | } |
1262 | ||
1263 | static int | |
5ad218a6 | 1264 | isis_instance_multi_topology_ipv6_unicast_destroy(enum nb_event event, |
20bd27e2 EDP |
1265 | const struct lyd_node *dnode) |
1266 | { | |
22af6a80 | 1267 | return isis_multi_topology_common(event, dnode, "ipv6-unicast", false); |
20bd27e2 EDP |
1268 | } |
1269 | ||
1270 | /* | |
1271 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-unicast/overload | |
1272 | */ | |
5f1e5e3f | 1273 | static int isis_instance_multi_topology_ipv6_unicast_overload_modify( |
20bd27e2 EDP |
1274 | enum nb_event event, const struct lyd_node *dnode, |
1275 | union nb_resource *resource) | |
1276 | { | |
5f1e5e3f EDP |
1277 | return isis_multi_topology_overload_common(event, dnode, |
1278 | "ipv6-unicast"); | |
20bd27e2 EDP |
1279 | } |
1280 | ||
1281 | /* | |
1282 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-multicast | |
1283 | */ | |
1284 | static int | |
1285 | isis_instance_multi_topology_ipv6_multicast_create(enum nb_event event, | |
1286 | const struct lyd_node *dnode, | |
1287 | union nb_resource *resource) | |
1288 | { | |
22af6a80 | 1289 | return isis_multi_topology_common(event, dnode, "ipv6-multicast", true); |
20bd27e2 EDP |
1290 | } |
1291 | ||
1292 | static int | |
5ad218a6 | 1293 | isis_instance_multi_topology_ipv6_multicast_destroy(enum nb_event event, |
20bd27e2 EDP |
1294 | const struct lyd_node *dnode) |
1295 | { | |
22af6a80 EDP |
1296 | return isis_multi_topology_common(event, dnode, "ipv6-multicast", |
1297 | false); | |
20bd27e2 EDP |
1298 | } |
1299 | ||
1300 | /* | |
1301 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-multicast/overload | |
1302 | */ | |
5f1e5e3f | 1303 | static int isis_instance_multi_topology_ipv6_multicast_overload_modify( |
20bd27e2 EDP |
1304 | enum nb_event event, const struct lyd_node *dnode, |
1305 | union nb_resource *resource) | |
1306 | { | |
22af6a80 | 1307 | return isis_multi_topology_overload_common(event, dnode, |
5f1e5e3f | 1308 | "ipv6-multicast"); |
20bd27e2 EDP |
1309 | } |
1310 | ||
1311 | /* | |
1312 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-management | |
1313 | */ | |
1314 | static int isis_instance_multi_topology_ipv6_management_create( | |
1315 | enum nb_event event, const struct lyd_node *dnode, | |
1316 | union nb_resource *resource) | |
1317 | { | |
22af6a80 | 1318 | return isis_multi_topology_common(event, dnode, "ipv6-mgmt", true); |
20bd27e2 EDP |
1319 | } |
1320 | ||
5ad218a6 | 1321 | static int isis_instance_multi_topology_ipv6_management_destroy( |
20bd27e2 EDP |
1322 | enum nb_event event, const struct lyd_node *dnode) |
1323 | { | |
22af6a80 | 1324 | return isis_multi_topology_common(event, dnode, "ipv6-mgmt", false); |
20bd27e2 EDP |
1325 | } |
1326 | ||
1327 | /* | |
1328 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-management/overload | |
1329 | */ | |
5f1e5e3f | 1330 | static int isis_instance_multi_topology_ipv6_management_overload_modify( |
20bd27e2 EDP |
1331 | enum nb_event event, const struct lyd_node *dnode, |
1332 | union nb_resource *resource) | |
1333 | { | |
5f1e5e3f | 1334 | return isis_multi_topology_overload_common(event, dnode, "ipv6-mgmt"); |
20bd27e2 EDP |
1335 | } |
1336 | ||
1337 | /* | |
1338 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-dstsrc | |
1339 | */ | |
1340 | static int | |
1341 | isis_instance_multi_topology_ipv6_dstsrc_create(enum nb_event event, | |
1342 | const struct lyd_node *dnode, | |
1343 | union nb_resource *resource) | |
1344 | { | |
22af6a80 | 1345 | return isis_multi_topology_common(event, dnode, "ipv6-dstsrc", true); |
20bd27e2 EDP |
1346 | } |
1347 | ||
1348 | static int | |
5ad218a6 | 1349 | isis_instance_multi_topology_ipv6_dstsrc_destroy(enum nb_event event, |
20bd27e2 EDP |
1350 | const struct lyd_node *dnode) |
1351 | { | |
22af6a80 | 1352 | return isis_multi_topology_common(event, dnode, "ipv6-dstsrc", false); |
20bd27e2 EDP |
1353 | } |
1354 | ||
1355 | /* | |
1356 | * XPath: /frr-isisd:isis/instance/multi-topology/ipv6-dstsrc/overload | |
1357 | */ | |
5f1e5e3f | 1358 | static int isis_instance_multi_topology_ipv6_dstsrc_overload_modify( |
20bd27e2 EDP |
1359 | enum nb_event event, const struct lyd_node *dnode, |
1360 | union nb_resource *resource) | |
1361 | { | |
5f1e5e3f | 1362 | return isis_multi_topology_overload_common(event, dnode, "ipv6-dstsrc"); |
20bd27e2 EDP |
1363 | } |
1364 | ||
1365 | /* | |
1366 | * XPath: /frr-isisd:isis/instance/log-adjacency-changes | |
1367 | */ | |
1368 | static int | |
5f1e5e3f | 1369 | isis_instance_log_adjacency_changes_modify(enum nb_event event, |
20bd27e2 EDP |
1370 | const struct lyd_node *dnode, |
1371 | union nb_resource *resource) | |
1372 | { | |
2adf66ff | 1373 | struct isis_area *area; |
5f1e5e3f | 1374 | bool log = yang_dnode_get_bool(dnode, NULL); |
2adf66ff EDP |
1375 | |
1376 | if (event != NB_EV_APPLY) | |
1377 | return NB_OK; | |
1378 | ||
ccd43ada | 1379 | area = nb_running_get_entry(dnode, NULL, true); |
5f1e5e3f | 1380 | area->log_adj_changes = log ? 1 : 0; |
2adf66ff | 1381 | |
20bd27e2 EDP |
1382 | return NB_OK; |
1383 | } | |
1384 | ||
1385 | /* | |
2e2a8b91 | 1386 | * XPath: /frr-isisd:isis/instance/mpls-te |
20bd27e2 | 1387 | */ |
2e2a8b91 | 1388 | static int isis_instance_mpls_te_create(enum nb_event event, |
20bd27e2 EDP |
1389 | const struct lyd_node *dnode, |
1390 | union nb_resource *resource) | |
1391 | { | |
d1a80ef6 | 1392 | struct listnode *node; |
2e2a8b91 | 1393 | struct isis_area *area; |
d1a80ef6 EDP |
1394 | struct isis_circuit *circuit; |
1395 | ||
1396 | if (event != NB_EV_APPLY) | |
1397 | return NB_OK; | |
1398 | ||
004b0be9 | 1399 | area = nb_running_get_entry(dnode, NULL, true); |
2e2a8b91 OD |
1400 | if (area->mta == NULL) { |
1401 | ||
1402 | struct mpls_te_area *new; | |
1403 | ||
1b3f47d0 | 1404 | zlog_debug("ISIS-TE(%s): Initialize MPLS Traffic Engineering", |
2e2a8b91 OD |
1405 | area->area_tag); |
1406 | ||
1407 | new = XCALLOC(MTYPE_ISIS_MPLS_TE, sizeof(struct mpls_te_area)); | |
1408 | ||
1409 | /* Initialize MPLS_TE structure */ | |
1410 | new->status = enable; | |
1411 | new->level = 0; | |
1412 | new->inter_as = off; | |
1413 | new->interas_areaid.s_addr = 0; | |
1414 | new->router_id.s_addr = 0; | |
1415 | ||
1416 | area->mta = new; | |
1417 | } else { | |
1418 | area->mta->status = enable; | |
1419 | } | |
d1a80ef6 EDP |
1420 | |
1421 | /* | |
1422 | * Following code is intended to handle two cases; | |
1423 | * | |
1424 | * 1) MPLS-TE was disabled at startup time, but now become enabled. | |
1425 | * In this case, we must enable MPLS-TE Circuit regarding interface | |
1426 | * MPLS_TE flag | |
1427 | * 2) MPLS-TE was once enabled then disabled, and now enabled again. | |
1428 | */ | |
2e2a8b91 | 1429 | for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) { |
1b3f47d0 | 1430 | if (circuit->ext == NULL) |
d1a80ef6 EDP |
1431 | continue; |
1432 | ||
1b3f47d0 | 1433 | if (!IS_EXT_TE(circuit->ext) |
d1a80ef6 | 1434 | && HAS_LINK_PARAMS(circuit->interface)) |
1b3f47d0 | 1435 | isis_link_params_update(circuit, circuit->interface); |
d1a80ef6 EDP |
1436 | else |
1437 | continue; | |
1438 | ||
1439 | /* Reoriginate STD_TE & GMPLS circuits */ | |
1440 | if (circuit->area) | |
1441 | lsp_regenerate_schedule(circuit->area, circuit->is_type, | |
1442 | 0); | |
1443 | } | |
1444 | ||
20bd27e2 EDP |
1445 | return NB_OK; |
1446 | } | |
1447 | ||
2e2a8b91 | 1448 | static int isis_instance_mpls_te_destroy(enum nb_event event, |
20bd27e2 EDP |
1449 | const struct lyd_node *dnode) |
1450 | { | |
d1a80ef6 | 1451 | struct listnode *node; |
2e2a8b91 | 1452 | struct isis_area *area; |
d1a80ef6 EDP |
1453 | struct isis_circuit *circuit; |
1454 | ||
1455 | if (event != NB_EV_APPLY) | |
1456 | return NB_OK; | |
1457 | ||
004b0be9 | 1458 | area = nb_running_get_entry(dnode, NULL, true); |
2e2a8b91 OD |
1459 | if (IS_MPLS_TE(area->mta)) |
1460 | area->mta->status = disable; | |
1461 | else | |
1462 | return NB_OK; | |
d1a80ef6 EDP |
1463 | |
1464 | /* Flush LSP if circuit engage */ | |
2e2a8b91 | 1465 | for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) { |
1b3f47d0 | 1466 | if (!IS_EXT_TE(circuit->ext)) |
d1a80ef6 EDP |
1467 | continue; |
1468 | ||
1b3f47d0 OD |
1469 | /* disable MPLS_TE Circuit keeping SR one's */ |
1470 | if (IS_SUBTLV(circuit->ext, EXT_ADJ_SID)) | |
1471 | circuit->ext->status = EXT_ADJ_SID; | |
1472 | else if (IS_SUBTLV(circuit->ext, EXT_LAN_ADJ_SID)) | |
1473 | circuit->ext->status = EXT_LAN_ADJ_SID; | |
1474 | else | |
1475 | circuit->ext->status = 0; | |
d1a80ef6 EDP |
1476 | |
1477 | /* Re-originate circuit without STD_TE & GMPLS parameters */ | |
1478 | if (circuit->area) | |
1479 | lsp_regenerate_schedule(circuit->area, circuit->is_type, | |
1480 | 0); | |
1481 | } | |
1482 | ||
1b3f47d0 OD |
1483 | zlog_debug("ISIS-TE(%s): Disabled MPLS Traffic Engineering", |
1484 | area->area_tag); | |
1485 | ||
20bd27e2 EDP |
1486 | return NB_OK; |
1487 | } | |
1488 | ||
1489 | /* | |
2e2a8b91 | 1490 | * XPath: /frr-isisd:isis/instance/mpls-te/router-address |
20bd27e2 | 1491 | */ |
2e2a8b91 | 1492 | static int isis_instance_mpls_te_router_address_modify(enum nb_event event, |
20bd27e2 EDP |
1493 | const struct lyd_node *dnode, |
1494 | union nb_resource *resource) | |
1495 | { | |
d1a80ef6 | 1496 | struct in_addr value; |
d1a80ef6 EDP |
1497 | struct isis_area *area; |
1498 | ||
1499 | if (event != NB_EV_APPLY) | |
1500 | return NB_OK; | |
1501 | ||
004b0be9 | 1502 | area = nb_running_get_entry(dnode, NULL, true); |
d1a80ef6 | 1503 | /* only proceed if MPLS-TE is enabled */ |
2e2a8b91 | 1504 | if (!IS_MPLS_TE(area->mta)) |
d1a80ef6 EDP |
1505 | return NB_OK; |
1506 | ||
2e2a8b91 OD |
1507 | /* Update Area Router ID */ |
1508 | yang_dnode_get_ipv4(&value, dnode, NULL); | |
1509 | area->mta->router_id.s_addr = value.s_addr; | |
1510 | ||
d1a80ef6 | 1511 | /* And re-schedule LSP update */ |
2e2a8b91 OD |
1512 | if (listcount(area->area_addrs) > 0) |
1513 | lsp_regenerate_schedule(area, area->is_type, 0); | |
d1a80ef6 | 1514 | |
20bd27e2 EDP |
1515 | return NB_OK; |
1516 | } | |
1517 | ||
2e2a8b91 | 1518 | static int isis_instance_mpls_te_router_address_destroy(enum nb_event event, |
20bd27e2 EDP |
1519 | const struct lyd_node *dnode) |
1520 | { | |
d1a80ef6 EDP |
1521 | struct isis_area *area; |
1522 | ||
1523 | if (event != NB_EV_APPLY) | |
1524 | return NB_OK; | |
1525 | ||
004b0be9 | 1526 | area = nb_running_get_entry(dnode, NULL, true); |
d1a80ef6 | 1527 | /* only proceed if MPLS-TE is enabled */ |
2e2a8b91 | 1528 | if (!IS_MPLS_TE(area->mta)) |
d1a80ef6 EDP |
1529 | return NB_OK; |
1530 | ||
2e2a8b91 OD |
1531 | /* Reset Area Router ID */ |
1532 | area->mta->router_id.s_addr = INADDR_ANY; | |
1533 | ||
d1a80ef6 | 1534 | /* And re-schedule LSP update */ |
2e2a8b91 OD |
1535 | if (listcount(area->area_addrs) > 0) |
1536 | lsp_regenerate_schedule(area, area->is_type, 0); | |
d1a80ef6 | 1537 | |
20bd27e2 EDP |
1538 | return NB_OK; |
1539 | } | |
1540 | ||
1541 | /* | |
1542 | * XPath: /frr-interface:lib/interface/frr-isisd:isis | |
1543 | */ | |
1544 | static int lib_interface_isis_create(enum nb_event event, | |
1545 | const struct lyd_node *dnode, | |
1546 | union nb_resource *resource) | |
1547 | { | |
aaf2fd21 EDP |
1548 | struct isis_area *area; |
1549 | struct interface *ifp; | |
1550 | struct isis_circuit *circuit; | |
1551 | const char *area_tag = yang_dnode_get_string(dnode, "./area-tag"); | |
75b66915 | 1552 | uint32_t min_mtu, actual_mtu; |
aaf2fd21 | 1553 | |
75b66915 EDP |
1554 | switch (event) { |
1555 | case NB_EV_PREPARE: | |
1556 | case NB_EV_ABORT: | |
1557 | break; | |
1558 | case NB_EV_VALIDATE: | |
1559 | /* check if interface mtu is sufficient. If the area has not | |
1560 | * been created yet, assume default MTU for the area | |
1561 | */ | |
1562 | ifp = nb_running_get_entry(dnode, NULL, true); | |
1563 | /* zebra might not know yet about the MTU - nothing we can do */ | |
1564 | if (ifp->mtu == 0) | |
1565 | break; | |
1566 | actual_mtu = | |
1567 | if_is_broadcast(ifp) ? ifp->mtu - LLC_LEN : ifp->mtu; | |
1568 | area = isis_area_lookup(area_tag); | |
1569 | if (area) | |
1570 | min_mtu = area->lsp_mtu; | |
1571 | else | |
1572 | #ifndef FABRICD | |
1573 | min_mtu = yang_get_default_uint16( | |
1574 | "/frr-isisd:isis/instance/lsp/mtu"); | |
1575 | #else | |
1576 | min_mtu = DEFAULT_LSP_MTU; | |
1577 | #endif /* ifndef FABRICD */ | |
1578 | if (actual_mtu < min_mtu) { | |
1579 | flog_warn(EC_LIB_NB_CB_CONFIG_VALIDATE, | |
1580 | "Interface %s has MTU %" PRIu32 | |
1581 | ", minimum MTU for the area is %" PRIu32 "", | |
1582 | ifp->name, actual_mtu, min_mtu); | |
1583 | return NB_ERR_VALIDATION; | |
1584 | } | |
1585 | break; | |
1586 | case NB_EV_APPLY: | |
1587 | area = isis_area_lookup(area_tag); | |
1588 | /* The area should have already be created. We are | |
1589 | * setting the priority of the global isis area creation | |
1590 | * slightly lower, so it should be executed first, but I | |
1591 | * cannot rely on that so here I have to check. | |
1592 | */ | |
1593 | if (!area) { | |
1594 | flog_err( | |
1595 | EC_LIB_NB_CB_CONFIG_APPLY, | |
1596 | "%s: attempt to create circuit for area %s before the area has been created", | |
1597 | __func__, area_tag); | |
1598 | abort(); | |
1599 | } | |
aaf2fd21 | 1600 | |
75b66915 EDP |
1601 | ifp = nb_running_get_entry(dnode, NULL, true); |
1602 | circuit = isis_circuit_create(area, ifp); | |
1603 | assert(circuit | |
1604 | && (circuit->state == C_STATE_CONF | |
1605 | || circuit->state == C_STATE_UP)); | |
1606 | nb_running_set_entry(dnode, circuit); | |
1607 | break; | |
aaf2fd21 EDP |
1608 | } |
1609 | ||
20bd27e2 EDP |
1610 | return NB_OK; |
1611 | } | |
1612 | ||
5ad218a6 | 1613 | static int lib_interface_isis_destroy(enum nb_event event, |
20bd27e2 EDP |
1614 | const struct lyd_node *dnode) |
1615 | { | |
aaf2fd21 EDP |
1616 | struct isis_circuit *circuit; |
1617 | ||
1618 | if (event != NB_EV_APPLY) | |
1619 | return NB_OK; | |
1620 | ||
ccd43ada | 1621 | circuit = nb_running_unset_entry(dnode); |
aaf2fd21 EDP |
1622 | if (!circuit) |
1623 | return NB_ERR_INCONSISTENCY; | |
5991e935 | 1624 | if (circuit->state == C_STATE_UP || circuit->state == C_STATE_CONF) |
aaf2fd21 | 1625 | isis_csm_state_change(ISIS_DISABLE, circuit, circuit->area); |
aaf2fd21 | 1626 | |
20bd27e2 EDP |
1627 | return NB_OK; |
1628 | } | |
1629 | ||
1630 | /* | |
1631 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/area-tag | |
1632 | */ | |
1633 | static int lib_interface_isis_area_tag_modify(enum nb_event event, | |
1634 | const struct lyd_node *dnode, | |
1635 | union nb_resource *resource) | |
1636 | { | |
aaf2fd21 EDP |
1637 | struct isis_circuit *circuit; |
1638 | struct interface *ifp; | |
1639 | struct vrf *vrf; | |
1640 | const char *area_tag, *ifname, *vrfname; | |
1641 | ||
1642 | if (event == NB_EV_VALIDATE) { | |
1643 | /* libyang doesn't like relative paths across module boundaries | |
1644 | */ | |
1645 | ifname = yang_dnode_get_string(dnode->parent->parent, "./name"); | |
1646 | vrfname = yang_dnode_get_string(dnode->parent->parent, "./vrf"); | |
1647 | vrf = vrf_lookup_by_name(vrfname); | |
1648 | assert(vrf); | |
a36898e7 | 1649 | ifp = if_lookup_by_name(ifname, vrf->vrf_id); |
aaf2fd21 EDP |
1650 | if (!ifp) |
1651 | return NB_OK; | |
1652 | circuit = circuit_lookup_by_ifp(ifp, isis->init_circ_list); | |
1653 | area_tag = yang_dnode_get_string(dnode, NULL); | |
1654 | if (circuit && circuit->area && circuit->area->area_tag | |
1655 | && strcmp(circuit->area->area_tag, area_tag)) { | |
1656 | flog_warn(EC_LIB_NB_CB_CONFIG_VALIDATE, | |
1657 | "ISIS circuit is already defined on %s", | |
1658 | circuit->area->area_tag); | |
1659 | return NB_ERR_VALIDATION; | |
1660 | } | |
1661 | } | |
1662 | ||
20bd27e2 EDP |
1663 | return NB_OK; |
1664 | } | |
1665 | ||
1666 | /* | |
1667 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/circuit-type | |
1668 | */ | |
1669 | static int lib_interface_isis_circuit_type_modify(enum nb_event event, | |
1670 | const struct lyd_node *dnode, | |
1671 | union nb_resource *resource) | |
1672 | { | |
aaf2fd21 EDP |
1673 | int circ_type = yang_dnode_get_enum(dnode, NULL); |
1674 | struct isis_circuit *circuit; | |
1675 | struct interface *ifp; | |
1676 | struct vrf *vrf; | |
1677 | const char *ifname, *vrfname; | |
1678 | ||
1679 | switch (event) { | |
1680 | case NB_EV_VALIDATE: | |
1681 | /* libyang doesn't like relative paths across module boundaries | |
1682 | */ | |
1683 | ifname = yang_dnode_get_string(dnode->parent->parent, "./name"); | |
1684 | vrfname = yang_dnode_get_string(dnode->parent->parent, "./vrf"); | |
1685 | vrf = vrf_lookup_by_name(vrfname); | |
1686 | assert(vrf); | |
a36898e7 | 1687 | ifp = if_lookup_by_name(ifname, vrf->vrf_id); |
aaf2fd21 EDP |
1688 | if (!ifp) |
1689 | break; | |
1690 | circuit = circuit_lookup_by_ifp(ifp, isis->init_circ_list); | |
1691 | if (circuit && circuit->state == C_STATE_UP | |
1692 | && circuit->area->is_type != IS_LEVEL_1_AND_2 | |
1693 | && circuit->area->is_type != circ_type) { | |
1694 | flog_warn(EC_LIB_NB_CB_CONFIG_VALIDATE, | |
1695 | "Invalid circuit level for area %s", | |
1696 | circuit->area->area_tag); | |
1697 | return NB_ERR_VALIDATION; | |
1698 | } | |
1699 | break; | |
1700 | case NB_EV_PREPARE: | |
1701 | case NB_EV_ABORT: | |
1702 | break; | |
1703 | case NB_EV_APPLY: | |
ccd43ada | 1704 | circuit = nb_running_get_entry(dnode, NULL, true); |
aaf2fd21 EDP |
1705 | isis_circuit_is_type_set(circuit, circ_type); |
1706 | break; | |
1707 | } | |
1708 | ||
20bd27e2 EDP |
1709 | return NB_OK; |
1710 | } | |
1711 | ||
1712 | /* | |
1713 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv4-routing | |
1714 | */ | |
5f1e5e3f | 1715 | static int lib_interface_isis_ipv4_routing_modify(enum nb_event event, |
20bd27e2 EDP |
1716 | const struct lyd_node *dnode, |
1717 | union nb_resource *resource) | |
1718 | { | |
5f1e5e3f | 1719 | bool ipv4, ipv6; |
aaf2fd21 EDP |
1720 | struct isis_circuit *circuit; |
1721 | ||
1722 | if (event != NB_EV_APPLY) | |
1723 | return NB_OK; | |
1724 | ||
ccd43ada | 1725 | circuit = nb_running_get_entry(dnode, NULL, true); |
5f1e5e3f EDP |
1726 | ipv4 = yang_dnode_get_bool(dnode, NULL); |
1727 | ipv6 = yang_dnode_get_bool(dnode, "../ipv6-routing"); | |
1728 | isis_circuit_af_set(circuit, ipv4, ipv6); | |
aaf2fd21 | 1729 | |
20bd27e2 EDP |
1730 | return NB_OK; |
1731 | } | |
1732 | ||
1733 | /* | |
1734 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv6-routing | |
1735 | */ | |
5f1e5e3f | 1736 | static int lib_interface_isis_ipv6_routing_modify(enum nb_event event, |
20bd27e2 EDP |
1737 | const struct lyd_node *dnode, |
1738 | union nb_resource *resource) | |
1739 | { | |
5f1e5e3f | 1740 | bool ipv4, ipv6; |
aaf2fd21 EDP |
1741 | struct isis_circuit *circuit; |
1742 | ||
1743 | if (event != NB_EV_APPLY) | |
1744 | return NB_OK; | |
1745 | ||
ccd43ada | 1746 | circuit = nb_running_get_entry(dnode, NULL, true); |
5f1e5e3f EDP |
1747 | ipv4 = yang_dnode_exists(dnode, "../ipv4-routing"); |
1748 | ipv6 = yang_dnode_get_bool(dnode, NULL); | |
1749 | isis_circuit_af_set(circuit, ipv4, ipv6); | |
aaf2fd21 | 1750 | |
20bd27e2 EDP |
1751 | return NB_OK; |
1752 | } | |
1753 | ||
c3e6ac0b RZ |
1754 | /* |
1755 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring | |
1756 | */ | |
1757 | static int lib_interface_isis_bfd_monitoring_modify(enum nb_event event, | |
1758 | const struct lyd_node *dnode, | |
1759 | union nb_resource *resource) | |
1760 | { | |
1761 | struct isis_circuit *circuit; | |
1762 | bool bfd_monitoring; | |
1763 | ||
1764 | if (event != NB_EV_APPLY) | |
1765 | return NB_OK; | |
1766 | ||
1767 | circuit = nb_running_get_entry(dnode, NULL, true); | |
1768 | bfd_monitoring = yang_dnode_get_bool(dnode, NULL); | |
1769 | ||
1770 | if (bfd_monitoring) { | |
c3e6ac0b RZ |
1771 | isis_bfd_circuit_param_set(circuit, BFD_DEF_MIN_RX, |
1772 | BFD_DEF_MIN_TX, BFD_DEF_DETECT_MULT, | |
1773 | true); | |
1774 | } else { | |
c3e6ac0b RZ |
1775 | isis_bfd_circuit_cmd(circuit, ZEBRA_BFD_DEST_DEREGISTER); |
1776 | bfd_info_free(&circuit->bfd_info); | |
1777 | } | |
1778 | ||
1779 | return NB_OK; | |
1780 | } | |
1781 | ||
20bd27e2 EDP |
1782 | /* |
1783 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/csnp-interval/level-1 | |
1784 | */ | |
1785 | static int | |
1786 | lib_interface_isis_csnp_interval_level_1_modify(enum nb_event event, | |
1787 | const struct lyd_node *dnode, | |
1788 | union nb_resource *resource) | |
1789 | { | |
9ce808b9 EDP |
1790 | struct isis_circuit *circuit; |
1791 | ||
1792 | if (event != NB_EV_APPLY) | |
1793 | return NB_OK; | |
1794 | ||
ccd43ada | 1795 | circuit = nb_running_get_entry(dnode, NULL, true); |
9ce808b9 EDP |
1796 | circuit->csnp_interval[0] = yang_dnode_get_uint16(dnode, NULL); |
1797 | ||
20bd27e2 EDP |
1798 | return NB_OK; |
1799 | } | |
1800 | ||
1801 | /* | |
1802 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/csnp-interval/level-2 | |
1803 | */ | |
1804 | static int | |
1805 | lib_interface_isis_csnp_interval_level_2_modify(enum nb_event event, | |
1806 | const struct lyd_node *dnode, | |
1807 | union nb_resource *resource) | |
1808 | { | |
9ce808b9 EDP |
1809 | struct isis_circuit *circuit; |
1810 | ||
1811 | if (event != NB_EV_APPLY) | |
1812 | return NB_OK; | |
1813 | ||
ccd43ada | 1814 | circuit = nb_running_get_entry(dnode, NULL, true); |
9ce808b9 EDP |
1815 | circuit->csnp_interval[1] = yang_dnode_get_uint16(dnode, NULL); |
1816 | ||
20bd27e2 EDP |
1817 | return NB_OK; |
1818 | } | |
1819 | ||
1820 | /* | |
1821 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/psnp-interval/level-1 | |
1822 | */ | |
1823 | static int | |
1824 | lib_interface_isis_psnp_interval_level_1_modify(enum nb_event event, | |
1825 | const struct lyd_node *dnode, | |
1826 | union nb_resource *resource) | |
1827 | { | |
9ce808b9 EDP |
1828 | struct isis_circuit *circuit; |
1829 | ||
1830 | if (event != NB_EV_APPLY) | |
1831 | return NB_OK; | |
1832 | ||
ccd43ada | 1833 | circuit = nb_running_get_entry(dnode, NULL, true); |
9ce808b9 EDP |
1834 | circuit->psnp_interval[0] = yang_dnode_get_uint16(dnode, NULL); |
1835 | ||
20bd27e2 EDP |
1836 | return NB_OK; |
1837 | } | |
1838 | ||
1839 | /* | |
1840 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/psnp-interval/level-2 | |
1841 | */ | |
1842 | static int | |
1843 | lib_interface_isis_psnp_interval_level_2_modify(enum nb_event event, | |
1844 | const struct lyd_node *dnode, | |
1845 | union nb_resource *resource) | |
1846 | { | |
9ce808b9 EDP |
1847 | struct isis_circuit *circuit; |
1848 | ||
1849 | if (event != NB_EV_APPLY) | |
1850 | return NB_OK; | |
1851 | ||
ccd43ada | 1852 | circuit = nb_running_get_entry(dnode, NULL, true); |
9ce808b9 EDP |
1853 | circuit->psnp_interval[1] = yang_dnode_get_uint16(dnode, NULL); |
1854 | ||
20bd27e2 EDP |
1855 | return NB_OK; |
1856 | } | |
1857 | ||
1858 | /* | |
1859 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/padding | |
1860 | */ | |
1861 | static int lib_interface_isis_hello_padding_modify(enum nb_event event, | |
1862 | const struct lyd_node *dnode, | |
1863 | union nb_resource *resource) | |
1864 | { | |
7b6b75e5 EDP |
1865 | struct isis_circuit *circuit; |
1866 | ||
1867 | if (event != NB_EV_APPLY) | |
1868 | return NB_OK; | |
1869 | ||
ccd43ada | 1870 | circuit = nb_running_get_entry(dnode, NULL, true); |
7b6b75e5 EDP |
1871 | circuit->pad_hellos = yang_dnode_get_bool(dnode, NULL); |
1872 | ||
20bd27e2 EDP |
1873 | return NB_OK; |
1874 | } | |
1875 | ||
1876 | /* | |
1877 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/interval/level-1 | |
1878 | */ | |
1879 | static int | |
1880 | lib_interface_isis_hello_interval_level_1_modify(enum nb_event event, | |
1881 | const struct lyd_node *dnode, | |
1882 | union nb_resource *resource) | |
1883 | { | |
356a2e3c EDP |
1884 | struct isis_circuit *circuit; |
1885 | uint32_t interval; | |
1886 | ||
1887 | if (event != NB_EV_APPLY) | |
1888 | return NB_OK; | |
1889 | ||
ccd43ada | 1890 | circuit = nb_running_get_entry(dnode, NULL, true); |
356a2e3c EDP |
1891 | interval = yang_dnode_get_uint32(dnode, NULL); |
1892 | circuit->hello_interval[0] = interval; | |
1893 | ||
20bd27e2 EDP |
1894 | return NB_OK; |
1895 | } | |
1896 | ||
1897 | /* | |
1898 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/interval/level-2 | |
1899 | */ | |
1900 | static int | |
1901 | lib_interface_isis_hello_interval_level_2_modify(enum nb_event event, | |
1902 | const struct lyd_node *dnode, | |
1903 | union nb_resource *resource) | |
1904 | { | |
356a2e3c EDP |
1905 | struct isis_circuit *circuit; |
1906 | uint32_t interval; | |
1907 | ||
1908 | if (event != NB_EV_APPLY) | |
1909 | return NB_OK; | |
1910 | ||
ccd43ada | 1911 | circuit = nb_running_get_entry(dnode, NULL, true); |
356a2e3c EDP |
1912 | interval = yang_dnode_get_uint32(dnode, NULL); |
1913 | circuit->hello_interval[1] = interval; | |
1914 | ||
20bd27e2 EDP |
1915 | return NB_OK; |
1916 | } | |
1917 | ||
1918 | /* | |
1919 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/multiplier/level-1 | |
1920 | */ | |
1921 | static int | |
1922 | lib_interface_isis_hello_multiplier_level_1_modify(enum nb_event event, | |
1923 | const struct lyd_node *dnode, | |
1924 | union nb_resource *resource) | |
1925 | { | |
4e75a67d EDP |
1926 | struct isis_circuit *circuit; |
1927 | uint16_t multi; | |
1928 | ||
1929 | if (event != NB_EV_APPLY) | |
1930 | return NB_OK; | |
1931 | ||
ccd43ada | 1932 | circuit = nb_running_get_entry(dnode, NULL, true); |
4e75a67d EDP |
1933 | multi = yang_dnode_get_uint16(dnode, NULL); |
1934 | circuit->hello_multiplier[0] = multi; | |
1935 | ||
20bd27e2 EDP |
1936 | return NB_OK; |
1937 | } | |
1938 | ||
1939 | /* | |
1940 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/multiplier/level-2 | |
1941 | */ | |
1942 | static int | |
1943 | lib_interface_isis_hello_multiplier_level_2_modify(enum nb_event event, | |
1944 | const struct lyd_node *dnode, | |
1945 | union nb_resource *resource) | |
1946 | { | |
4e75a67d EDP |
1947 | struct isis_circuit *circuit; |
1948 | uint16_t multi; | |
1949 | ||
1950 | if (event != NB_EV_APPLY) | |
1951 | return NB_OK; | |
1952 | ||
ccd43ada | 1953 | circuit = nb_running_get_entry(dnode, NULL, true); |
4e75a67d EDP |
1954 | multi = yang_dnode_get_uint16(dnode, NULL); |
1955 | circuit->hello_multiplier[1] = multi; | |
1956 | ||
20bd27e2 EDP |
1957 | return NB_OK; |
1958 | } | |
1959 | ||
1960 | /* | |
1961 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/metric/level-1 | |
1962 | */ | |
1963 | static int | |
1964 | lib_interface_isis_metric_level_1_modify(enum nb_event event, | |
1965 | const struct lyd_node *dnode, | |
1966 | union nb_resource *resource) | |
1967 | { | |
be49219c EDP |
1968 | struct isis_circuit *circuit; |
1969 | unsigned int met; | |
1970 | ||
1971 | if (event != NB_EV_APPLY) | |
1972 | return NB_OK; | |
1973 | ||
ccd43ada | 1974 | circuit = nb_running_get_entry(dnode, NULL, true); |
be49219c EDP |
1975 | met = yang_dnode_get_uint32(dnode, NULL); |
1976 | isis_circuit_metric_set(circuit, IS_LEVEL_1, met); | |
1977 | ||
20bd27e2 EDP |
1978 | return NB_OK; |
1979 | } | |
1980 | ||
1981 | /* | |
1982 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/metric/level-2 | |
1983 | */ | |
1984 | static int | |
1985 | lib_interface_isis_metric_level_2_modify(enum nb_event event, | |
1986 | const struct lyd_node *dnode, | |
1987 | union nb_resource *resource) | |
1988 | { | |
be49219c EDP |
1989 | struct isis_circuit *circuit; |
1990 | unsigned int met; | |
1991 | ||
1992 | if (event != NB_EV_APPLY) | |
1993 | return NB_OK; | |
1994 | ||
ccd43ada | 1995 | circuit = nb_running_get_entry(dnode, NULL, true); |
be49219c EDP |
1996 | met = yang_dnode_get_uint32(dnode, NULL); |
1997 | isis_circuit_metric_set(circuit, IS_LEVEL_2, met); | |
1998 | ||
20bd27e2 EDP |
1999 | return NB_OK; |
2000 | } | |
2001 | ||
2002 | /* | |
2003 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/priority/level-1 | |
2004 | */ | |
2005 | static int | |
2006 | lib_interface_isis_priority_level_1_modify(enum nb_event event, | |
2007 | const struct lyd_node *dnode, | |
2008 | union nb_resource *resource) | |
2009 | { | |
d59c2d6b EDP |
2010 | struct isis_circuit *circuit; |
2011 | ||
2012 | if (event != NB_EV_APPLY) | |
2013 | return NB_OK; | |
2014 | ||
ccd43ada | 2015 | circuit = nb_running_get_entry(dnode, NULL, true); |
d59c2d6b EDP |
2016 | circuit->priority[0] = yang_dnode_get_uint8(dnode, NULL); |
2017 | ||
20bd27e2 EDP |
2018 | return NB_OK; |
2019 | } | |
2020 | ||
2021 | /* | |
2022 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/priority/level-2 | |
2023 | */ | |
2024 | static int | |
2025 | lib_interface_isis_priority_level_2_modify(enum nb_event event, | |
2026 | const struct lyd_node *dnode, | |
2027 | union nb_resource *resource) | |
2028 | { | |
d59c2d6b EDP |
2029 | struct isis_circuit *circuit; |
2030 | ||
2031 | if (event != NB_EV_APPLY) | |
2032 | return NB_OK; | |
2033 | ||
ccd43ada | 2034 | circuit = nb_running_get_entry(dnode, NULL, true); |
d59c2d6b EDP |
2035 | circuit->priority[1] = yang_dnode_get_uint8(dnode, NULL); |
2036 | ||
20bd27e2 EDP |
2037 | return NB_OK; |
2038 | } | |
2039 | ||
2040 | /* | |
2041 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/network-type | |
2042 | */ | |
2043 | static int lib_interface_isis_network_type_modify(enum nb_event event, | |
2044 | const struct lyd_node *dnode, | |
2045 | union nb_resource *resource) | |
2046 | { | |
d0820765 EDP |
2047 | struct isis_circuit *circuit; |
2048 | int net_type = yang_dnode_get_enum(dnode, NULL); | |
2049 | ||
2050 | switch (event) { | |
2051 | case NB_EV_VALIDATE: | |
ccd43ada | 2052 | circuit = nb_running_get_entry(dnode, NULL, false); |
d0820765 EDP |
2053 | if (!circuit) |
2054 | break; | |
2e29ab9c | 2055 | if (circuit->circ_type == CIRCUIT_T_LOOPBACK) { |
d0820765 EDP |
2056 | flog_warn( |
2057 | EC_LIB_NB_CB_CONFIG_VALIDATE, | |
2e29ab9c | 2058 | "Cannot change network type on loopback interface"); |
d0820765 EDP |
2059 | return NB_ERR_VALIDATION; |
2060 | } | |
2061 | if (net_type == CIRCUIT_T_BROADCAST | |
2062 | && circuit->state == C_STATE_UP | |
2063 | && !if_is_broadcast(circuit->interface)) { | |
2064 | flog_warn( | |
2065 | EC_LIB_NB_CB_CONFIG_VALIDATE, | |
2066 | "Cannot configure non-broadcast interface for broadcast operation"); | |
2067 | return NB_ERR_VALIDATION; | |
2068 | } | |
2069 | break; | |
2070 | case NB_EV_PREPARE: | |
2071 | case NB_EV_ABORT: | |
2072 | break; | |
2073 | case NB_EV_APPLY: | |
ccd43ada | 2074 | circuit = nb_running_get_entry(dnode, NULL, true); |
d0820765 EDP |
2075 | isis_circuit_circ_type_set(circuit, net_type); |
2076 | break; | |
2077 | } | |
2078 | ||
20bd27e2 EDP |
2079 | return NB_OK; |
2080 | } | |
2081 | ||
20bd27e2 EDP |
2082 | /* |
2083 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/passive | |
2084 | */ | |
5f1e5e3f | 2085 | static int lib_interface_isis_passive_modify(enum nb_event event, |
20bd27e2 EDP |
2086 | const struct lyd_node *dnode, |
2087 | union nb_resource *resource) | |
2088 | { | |
a6a36c41 EDP |
2089 | struct isis_circuit *circuit; |
2090 | struct isis_area *area; | |
a6a36c41 | 2091 | struct interface *ifp; |
5f1e5e3f | 2092 | bool passive = yang_dnode_get_bool(dnode, NULL); |
a6a36c41 | 2093 | |
5f1e5e3f EDP |
2094 | /* validation only applies if we are setting passive to false */ |
2095 | if (!passive && event == NB_EV_VALIDATE) { | |
ccd43ada | 2096 | circuit = nb_running_get_entry(dnode, NULL, false); |
a6a36c41 | 2097 | if (!circuit) |
5f1e5e3f | 2098 | return NB_OK; |
a6a36c41 EDP |
2099 | ifp = circuit->interface; |
2100 | if (!ifp) | |
5f1e5e3f | 2101 | return NB_OK; |
a6a36c41 EDP |
2102 | if (if_is_loopback(ifp)) { |
2103 | flog_warn(EC_LIB_NB_CB_CONFIG_VALIDATE, | |
2104 | "Loopback is always passive"); | |
2105 | return NB_ERR_VALIDATION; | |
2106 | } | |
5f1e5e3f EDP |
2107 | } |
2108 | ||
2109 | if (event != NB_EV_APPLY) | |
2110 | return NB_OK; | |
2111 | ||
ccd43ada | 2112 | circuit = nb_running_get_entry(dnode, NULL, true); |
5f1e5e3f EDP |
2113 | if (circuit->state != C_STATE_UP) { |
2114 | circuit->is_passive = passive; | |
2115 | } else { | |
2116 | area = circuit->area; | |
2117 | isis_csm_state_change(ISIS_DISABLE, circuit, area); | |
2118 | circuit->is_passive = passive; | |
2119 | isis_csm_state_change(ISIS_ENABLE, circuit, area); | |
a6a36c41 EDP |
2120 | } |
2121 | ||
20bd27e2 EDP |
2122 | return NB_OK; |
2123 | } | |
2124 | ||
2125 | /* | |
2126 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/password | |
2127 | */ | |
2128 | static int lib_interface_isis_password_create(enum nb_event event, | |
2129 | const struct lyd_node *dnode, | |
2130 | union nb_resource *resource) | |
2131 | { | |
20bd27e2 EDP |
2132 | return NB_OK; |
2133 | } | |
2134 | ||
5ad218a6 | 2135 | static int lib_interface_isis_password_destroy(enum nb_event event, |
20bd27e2 EDP |
2136 | const struct lyd_node *dnode) |
2137 | { | |
3e20c83a EDP |
2138 | struct isis_circuit *circuit; |
2139 | ||
2140 | if (event != NB_EV_APPLY) | |
2141 | return NB_OK; | |
2142 | ||
ccd43ada | 2143 | circuit = nb_running_get_entry(dnode, NULL, true); |
3e20c83a EDP |
2144 | isis_circuit_passwd_unset(circuit); |
2145 | ||
20bd27e2 EDP |
2146 | return NB_OK; |
2147 | } | |
2148 | ||
2149 | /* | |
2150 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/password/password | |
2151 | */ | |
2152 | static int | |
2153 | lib_interface_isis_password_password_modify(enum nb_event event, | |
2154 | const struct lyd_node *dnode, | |
2155 | union nb_resource *resource) | |
2156 | { | |
3e20c83a EDP |
2157 | struct isis_circuit *circuit; |
2158 | const char *password; | |
2159 | ||
2160 | if (event != NB_EV_APPLY) | |
2161 | return NB_OK; | |
2162 | ||
2163 | password = yang_dnode_get_string(dnode, NULL); | |
ccd43ada | 2164 | circuit = nb_running_get_entry(dnode, NULL, true); |
e28544ed QY |
2165 | |
2166 | isis_circuit_passwd_set(circuit, circuit->passwd.type, password); | |
3e20c83a | 2167 | |
20bd27e2 EDP |
2168 | return NB_OK; |
2169 | } | |
2170 | ||
2171 | /* | |
2172 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/password/password-type | |
2173 | */ | |
2174 | static int | |
2175 | lib_interface_isis_password_password_type_modify(enum nb_event event, | |
2176 | const struct lyd_node *dnode, | |
2177 | union nb_resource *resource) | |
2178 | { | |
3e20c83a EDP |
2179 | struct isis_circuit *circuit; |
2180 | uint8_t pass_type; | |
2181 | ||
2182 | if (event != NB_EV_APPLY) | |
2183 | return NB_OK; | |
2184 | ||
2185 | pass_type = yang_dnode_get_enum(dnode, NULL); | |
ccd43ada | 2186 | circuit = nb_running_get_entry(dnode, NULL, true); |
3e20c83a EDP |
2187 | circuit->passwd.type = pass_type; |
2188 | ||
20bd27e2 EDP |
2189 | return NB_OK; |
2190 | } | |
2191 | ||
2192 | /* | |
2193 | * XPath: | |
2194 | * /frr-interface:lib/interface/frr-isisd:isis/disable-three-way-handshake | |
2195 | */ | |
5f1e5e3f | 2196 | static int lib_interface_isis_disable_three_way_handshake_modify( |
20bd27e2 EDP |
2197 | enum nb_event event, const struct lyd_node *dnode, |
2198 | union nb_resource *resource) | |
2199 | { | |
5f2ce446 EDP |
2200 | struct isis_circuit *circuit; |
2201 | ||
2202 | if (event != NB_EV_APPLY) | |
2203 | return NB_OK; | |
2204 | ||
ccd43ada | 2205 | circuit = nb_running_get_entry(dnode, NULL, true); |
5f1e5e3f | 2206 | circuit->disable_threeway_adj = yang_dnode_get_bool(dnode, NULL); |
5f2ce446 | 2207 | |
20bd27e2 EDP |
2208 | return NB_OK; |
2209 | } | |
2210 | ||
2211 | /* | |
2212 | * XPath: | |
2213 | * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-unicast | |
2214 | */ | |
83d043f6 EDP |
2215 | static int lib_interface_isis_multi_topology_common( |
2216 | enum nb_event event, const struct lyd_node *dnode, uint16_t mtid) | |
2217 | { | |
2218 | struct isis_circuit *circuit; | |
2219 | bool value; | |
2220 | ||
2221 | switch (event) { | |
2222 | case NB_EV_VALIDATE: | |
ccd43ada | 2223 | circuit = nb_running_get_entry(dnode, NULL, false); |
83d043f6 EDP |
2224 | if (circuit && circuit->area && circuit->area->oldmetric) { |
2225 | flog_warn( | |
2226 | EC_LIB_NB_CB_CONFIG_VALIDATE, | |
2227 | "Multi topology IS-IS can only be used with wide metrics"); | |
2228 | return NB_ERR_VALIDATION; | |
2229 | } | |
2230 | break; | |
2231 | case NB_EV_PREPARE: | |
2232 | case NB_EV_ABORT: | |
2233 | break; | |
2234 | case NB_EV_APPLY: | |
ccd43ada | 2235 | circuit = nb_running_get_entry(dnode, NULL, true); |
83d043f6 EDP |
2236 | value = yang_dnode_get_bool(dnode, NULL); |
2237 | isis_circuit_mt_enabled_set(circuit, mtid, value); | |
2238 | break; | |
2239 | } | |
2240 | ||
2241 | return NB_OK; | |
2242 | } | |
2243 | ||
20bd27e2 EDP |
2244 | static int lib_interface_isis_multi_topology_ipv4_unicast_modify( |
2245 | enum nb_event event, const struct lyd_node *dnode, | |
2246 | union nb_resource *resource) | |
2247 | { | |
83d043f6 EDP |
2248 | return lib_interface_isis_multi_topology_common(event, dnode, |
2249 | ISIS_MT_IPV4_UNICAST); | |
20bd27e2 EDP |
2250 | } |
2251 | ||
2252 | /* | |
2253 | * XPath: | |
2254 | * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-multicast | |
2255 | */ | |
2256 | static int lib_interface_isis_multi_topology_ipv4_multicast_modify( | |
2257 | enum nb_event event, const struct lyd_node *dnode, | |
2258 | union nb_resource *resource) | |
2259 | { | |
83d043f6 EDP |
2260 | return lib_interface_isis_multi_topology_common(event, dnode, |
2261 | ISIS_MT_IPV4_MULTICAST); | |
20bd27e2 EDP |
2262 | } |
2263 | ||
2264 | /* | |
2265 | * XPath: | |
2266 | * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-management | |
2267 | */ | |
2268 | static int lib_interface_isis_multi_topology_ipv4_management_modify( | |
2269 | enum nb_event event, const struct lyd_node *dnode, | |
2270 | union nb_resource *resource) | |
2271 | { | |
83d043f6 EDP |
2272 | return lib_interface_isis_multi_topology_common(event, dnode, |
2273 | ISIS_MT_IPV4_MGMT); | |
20bd27e2 EDP |
2274 | } |
2275 | ||
2276 | /* | |
2277 | * XPath: | |
2278 | * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-unicast | |
2279 | */ | |
2280 | static int lib_interface_isis_multi_topology_ipv6_unicast_modify( | |
2281 | enum nb_event event, const struct lyd_node *dnode, | |
2282 | union nb_resource *resource) | |
2283 | { | |
83d043f6 EDP |
2284 | return lib_interface_isis_multi_topology_common(event, dnode, |
2285 | ISIS_MT_IPV6_UNICAST); | |
20bd27e2 EDP |
2286 | } |
2287 | ||
2288 | /* | |
2289 | * XPath: | |
2290 | * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-multicast | |
2291 | */ | |
2292 | static int lib_interface_isis_multi_topology_ipv6_multicast_modify( | |
2293 | enum nb_event event, const struct lyd_node *dnode, | |
2294 | union nb_resource *resource) | |
2295 | { | |
83d043f6 EDP |
2296 | return lib_interface_isis_multi_topology_common(event, dnode, |
2297 | ISIS_MT_IPV6_MULTICAST); | |
20bd27e2 EDP |
2298 | } |
2299 | ||
2300 | /* | |
2301 | * XPath: | |
2302 | * /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-management | |
2303 | */ | |
2304 | static int lib_interface_isis_multi_topology_ipv6_management_modify( | |
2305 | enum nb_event event, const struct lyd_node *dnode, | |
2306 | union nb_resource *resource) | |
2307 | { | |
83d043f6 EDP |
2308 | return lib_interface_isis_multi_topology_common(event, dnode, |
2309 | ISIS_MT_IPV6_MGMT); | |
20bd27e2 EDP |
2310 | } |
2311 | ||
2312 | /* | |
2313 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-dstsrc | |
2314 | */ | |
2315 | static int lib_interface_isis_multi_topology_ipv6_dstsrc_modify( | |
2316 | enum nb_event event, const struct lyd_node *dnode, | |
2317 | union nb_resource *resource) | |
2318 | { | |
83d043f6 EDP |
2319 | return lib_interface_isis_multi_topology_common(event, dnode, |
2320 | ISIS_MT_IPV6_DSTSRC); | |
20bd27e2 EDP |
2321 | } |
2322 | ||
aec5ef49 RW |
2323 | /* |
2324 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency | |
2325 | */ | |
2326 | static const void * | |
2327 | lib_interface_isis_adjacencies_adjacency_get_next(const void *parent_list_entry, | |
2328 | const void *list_entry) | |
2329 | { | |
2330 | struct interface *ifp; | |
2331 | struct isis_circuit *circuit; | |
2332 | struct isis_adjacency *adj, *adj_next = NULL; | |
2333 | struct list *list; | |
2334 | struct listnode *node, *node_next; | |
2335 | ||
2336 | /* Get first adjacency. */ | |
2337 | if (list_entry == NULL) { | |
2338 | ifp = (struct interface *)parent_list_entry; | |
2339 | if (!ifp) | |
2340 | return NULL; | |
2341 | ||
2342 | circuit = circuit_scan_by_ifp(ifp); | |
2343 | if (!circuit) | |
2344 | return NULL; | |
2345 | ||
2346 | switch (circuit->circ_type) { | |
2347 | case CIRCUIT_T_BROADCAST: | |
2348 | for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; | |
2349 | level++) { | |
2350 | adj = listnode_head( | |
2351 | circuit->u.bc.adjdb[level - 1]); | |
2352 | if (adj) | |
2353 | break; | |
2354 | } | |
2355 | break; | |
2356 | case CIRCUIT_T_P2P: | |
2357 | adj = circuit->u.p2p.neighbor; | |
2358 | break; | |
2359 | default: | |
2360 | adj = NULL; | |
2361 | break; | |
2362 | } | |
2363 | ||
2364 | return adj; | |
2365 | } | |
2366 | ||
2367 | /* Get next adjacency. */ | |
2368 | adj = (struct isis_adjacency *)list_entry; | |
2369 | circuit = adj->circuit; | |
2370 | switch (circuit->circ_type) { | |
2371 | case CIRCUIT_T_BROADCAST: | |
2372 | list = circuit->u.bc.adjdb[adj->level - 1]; | |
2373 | node = listnode_lookup(list, adj); | |
2374 | node_next = listnextnode(node); | |
2375 | if (node_next) | |
2376 | adj_next = listgetdata(node_next); | |
2377 | else if (adj->level == ISIS_LEVEL1) { | |
2378 | /* | |
2379 | * Once we finish the L1 adjacencies, move to the L2 | |
2380 | * adjacencies list. | |
2381 | */ | |
2382 | list = circuit->u.bc.adjdb[ISIS_LEVEL2 - 1]; | |
2383 | adj_next = listnode_head(list); | |
2384 | } | |
2385 | break; | |
2386 | case CIRCUIT_T_P2P: | |
2387 | /* P2P circuits have at most one adjacency. */ | |
2388 | default: | |
2389 | break; | |
2390 | } | |
2391 | ||
2392 | return adj_next; | |
2393 | } | |
2394 | ||
2395 | /* | |
2396 | * XPath: | |
2397 | * /frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-sys-type | |
2398 | */ | |
2399 | static struct yang_data * | |
2400 | lib_interface_isis_adjacencies_adjacency_neighbor_sys_type_get_elem( | |
2401 | const char *xpath, const void *list_entry) | |
2402 | { | |
2403 | const struct isis_adjacency *adj = list_entry; | |
2404 | ||
2405 | return yang_data_new_enum(xpath, adj->level); | |
2406 | } | |
2407 | ||
2408 | /* | |
2409 | * XPath: | |
2410 | * /frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-sysid | |
2411 | */ | |
2412 | static struct yang_data * | |
2413 | lib_interface_isis_adjacencies_adjacency_neighbor_sysid_get_elem( | |
2414 | const char *xpath, const void *list_entry) | |
2415 | { | |
2416 | const struct isis_adjacency *adj = list_entry; | |
2417 | ||
2418 | return yang_data_new_string(xpath, sysid_print(adj->sysid)); | |
2419 | } | |
2420 | ||
2421 | /* | |
2422 | * XPath: | |
2423 | * /frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-extended-circuit-id | |
2424 | */ | |
2425 | static struct yang_data * | |
2426 | lib_interface_isis_adjacencies_adjacency_neighbor_extended_circuit_id_get_elem( | |
2427 | const char *xpath, const void *list_entry) | |
2428 | { | |
2429 | const struct isis_adjacency *adj = list_entry; | |
2430 | ||
2431 | return yang_data_new_uint32(xpath, adj->circuit->circuit_id); | |
2432 | } | |
2433 | ||
2434 | /* | |
2435 | * XPath: | |
2436 | * /frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-snpa | |
2437 | */ | |
2438 | static struct yang_data * | |
2439 | lib_interface_isis_adjacencies_adjacency_neighbor_snpa_get_elem( | |
2440 | const char *xpath, const void *list_entry) | |
2441 | { | |
2442 | const struct isis_adjacency *adj = list_entry; | |
2443 | ||
2444 | return yang_data_new_string(xpath, snpa_print(adj->snpa)); | |
2445 | } | |
2446 | ||
2447 | /* | |
2448 | * XPath: | |
2449 | * /frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/hold-timer | |
2450 | */ | |
2451 | static struct yang_data * | |
2452 | lib_interface_isis_adjacencies_adjacency_hold_timer_get_elem( | |
2453 | const char *xpath, const void *list_entry) | |
2454 | { | |
2455 | const struct isis_adjacency *adj = list_entry; | |
2456 | ||
2457 | return yang_data_new_uint16(xpath, adj->hold_time); | |
2458 | } | |
2459 | ||
2460 | /* | |
2461 | * XPath: | |
2462 | * /frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-priority | |
2463 | */ | |
2464 | static struct yang_data * | |
2465 | lib_interface_isis_adjacencies_adjacency_neighbor_priority_get_elem( | |
2466 | const char *xpath, const void *list_entry) | |
2467 | { | |
2468 | const struct isis_adjacency *adj = list_entry; | |
2469 | ||
2470 | return yang_data_new_uint8(xpath, adj->prio[adj->level - 1]); | |
2471 | } | |
2472 | ||
2473 | /* | |
2474 | * XPath: | |
2475 | * /frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/state | |
2476 | */ | |
2477 | static struct yang_data * | |
2478 | lib_interface_isis_adjacencies_adjacency_state_get_elem(const char *xpath, | |
2479 | const void *list_entry) | |
2480 | { | |
2481 | const struct isis_adjacency *adj = list_entry; | |
2482 | ||
2483 | return yang_data_new_string(xpath, isis_yang_adj_state(adj->adj_state)); | |
2484 | } | |
2485 | ||
c32496ee RW |
2486 | /* |
2487 | * XPath: | |
2488 | * /frr-interface:lib/interface/frr-isisd:isis/event-counters/adjacency-changes | |
2489 | */ | |
2490 | static struct yang_data * | |
2491 | lib_interface_isis_event_counters_adjacency_changes_get_elem( | |
2492 | const char *xpath, const void *list_entry) | |
2493 | { | |
2494 | struct interface *ifp; | |
2495 | struct isis_circuit *circuit; | |
2496 | ||
2497 | ifp = (struct interface *)list_entry; | |
2498 | if (!ifp) | |
2499 | return NULL; | |
2500 | ||
2501 | circuit = circuit_scan_by_ifp(ifp); | |
2502 | if (!circuit) | |
2503 | return NULL; | |
2504 | ||
2505 | return yang_data_new_uint32(xpath, circuit->adj_state_changes); | |
2506 | } | |
2507 | ||
2508 | /* | |
2509 | * XPath: | |
2510 | * /frr-interface:lib/interface/frr-isisd:isis/event-counters/adjacency-number | |
2511 | */ | |
2512 | static struct yang_data * | |
2513 | lib_interface_isis_event_counters_adjacency_number_get_elem( | |
2514 | const char *xpath, const void *list_entry) | |
2515 | { | |
2516 | struct interface *ifp; | |
2517 | struct isis_circuit *circuit; | |
2518 | struct isis_adjacency *adj; | |
2519 | struct listnode *node; | |
2520 | uint32_t total = 0; | |
2521 | ||
2522 | ifp = (struct interface *)list_entry; | |
2523 | if (!ifp) | |
2524 | return NULL; | |
2525 | ||
2526 | circuit = circuit_scan_by_ifp(ifp); | |
2527 | if (!circuit) | |
2528 | return NULL; | |
2529 | ||
2530 | /* | |
2531 | * TODO: keep track of the number of adjacencies instead of calculating | |
2532 | * it on demand. | |
2533 | */ | |
2534 | switch (circuit->circ_type) { | |
2535 | case CIRCUIT_T_BROADCAST: | |
2536 | for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { | |
2537 | for (ALL_LIST_ELEMENTS_RO( | |
2538 | circuit->u.bc.adjdb[level - 1], node, adj)) | |
2539 | total++; | |
2540 | } | |
2541 | break; | |
2542 | case CIRCUIT_T_P2P: | |
2543 | adj = circuit->u.p2p.neighbor; | |
2544 | if (adj) | |
2545 | total = 1; | |
2546 | break; | |
2547 | default: | |
2548 | break; | |
2549 | } | |
2550 | ||
2551 | return yang_data_new_uint32(xpath, total); | |
2552 | } | |
2553 | ||
2554 | /* | |
2555 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/event-counters/init-fails | |
2556 | */ | |
2557 | static struct yang_data * | |
2558 | lib_interface_isis_event_counters_init_fails_get_elem(const char *xpath, | |
2559 | const void *list_entry) | |
2560 | { | |
2561 | struct interface *ifp; | |
2562 | struct isis_circuit *circuit; | |
2563 | ||
2564 | ifp = (struct interface *)list_entry; | |
2565 | if (!ifp) | |
2566 | return NULL; | |
2567 | ||
2568 | circuit = circuit_scan_by_ifp(ifp); | |
2569 | if (!circuit) | |
2570 | return NULL; | |
2571 | ||
2572 | return yang_data_new_uint32(xpath, circuit->init_failures); | |
2573 | } | |
2574 | ||
2575 | /* | |
2576 | * XPath: | |
2577 | * /frr-interface:lib/interface/frr-isisd:isis/event-counters/adjacency-rejects | |
2578 | */ | |
2579 | static struct yang_data * | |
2580 | lib_interface_isis_event_counters_adjacency_rejects_get_elem( | |
2581 | const char *xpath, const void *list_entry) | |
2582 | { | |
2583 | struct interface *ifp; | |
2584 | struct isis_circuit *circuit; | |
2585 | ||
2586 | ifp = (struct interface *)list_entry; | |
2587 | if (!ifp) | |
2588 | return NULL; | |
2589 | ||
2590 | circuit = circuit_scan_by_ifp(ifp); | |
2591 | if (!circuit) | |
2592 | return NULL; | |
2593 | ||
2594 | return yang_data_new_uint32(xpath, circuit->rej_adjacencies); | |
2595 | } | |
2596 | ||
2597 | /* | |
2598 | * XPath: | |
2599 | * /frr-interface:lib/interface/frr-isisd:isis/event-counters/id-len-mismatch | |
2600 | */ | |
2601 | static struct yang_data * | |
2602 | lib_interface_isis_event_counters_id_len_mismatch_get_elem( | |
2603 | const char *xpath, const void *list_entry) | |
2604 | { | |
2605 | struct interface *ifp; | |
2606 | struct isis_circuit *circuit; | |
2607 | ||
2608 | ifp = (struct interface *)list_entry; | |
2609 | if (!ifp) | |
2610 | return NULL; | |
2611 | ||
2612 | circuit = circuit_scan_by_ifp(ifp); | |
2613 | if (!circuit) | |
2614 | return NULL; | |
2615 | ||
2616 | return yang_data_new_uint32(xpath, circuit->id_len_mismatches); | |
2617 | } | |
2618 | ||
2619 | /* | |
2620 | * XPath: | |
2621 | * /frr-interface:lib/interface/frr-isisd:isis/event-counters/max-area-addresses-mismatch | |
2622 | */ | |
2623 | static struct yang_data * | |
2624 | lib_interface_isis_event_counters_max_area_addresses_mismatch_get_elem( | |
2625 | const char *xpath, const void *list_entry) | |
2626 | { | |
2627 | struct interface *ifp; | |
2628 | struct isis_circuit *circuit; | |
2629 | ||
2630 | ifp = (struct interface *)list_entry; | |
2631 | if (!ifp) | |
2632 | return NULL; | |
2633 | ||
2634 | circuit = circuit_scan_by_ifp(ifp); | |
2635 | if (!circuit) | |
2636 | return NULL; | |
2637 | ||
2638 | return yang_data_new_uint32(xpath, circuit->max_area_addr_mismatches); | |
2639 | } | |
2640 | ||
2641 | /* | |
2642 | * XPath: | |
2643 | * /frr-interface:lib/interface/frr-isisd:isis/event-counters/authentication-type-fails | |
2644 | */ | |
2645 | static struct yang_data * | |
2646 | lib_interface_isis_event_counters_authentication_type_fails_get_elem( | |
2647 | const char *xpath, const void *list_entry) | |
2648 | { | |
2649 | struct interface *ifp; | |
2650 | struct isis_circuit *circuit; | |
2651 | ||
2652 | ifp = (struct interface *)list_entry; | |
2653 | if (!ifp) | |
2654 | return NULL; | |
2655 | ||
2656 | circuit = circuit_scan_by_ifp(ifp); | |
2657 | if (!circuit) | |
2658 | return NULL; | |
2659 | ||
2660 | return yang_data_new_uint32(xpath, circuit->auth_type_failures); | |
2661 | } | |
2662 | ||
2663 | /* | |
2664 | * XPath: | |
2665 | * /frr-interface:lib/interface/frr-isisd:isis/event-counters/authentication-fails | |
2666 | */ | |
2667 | static struct yang_data * | |
2668 | lib_interface_isis_event_counters_authentication_fails_get_elem( | |
2669 | const char *xpath, const void *list_entry) | |
2670 | { | |
2671 | struct interface *ifp; | |
2672 | struct isis_circuit *circuit; | |
2673 | ||
2674 | ifp = (struct interface *)list_entry; | |
2675 | if (!ifp) | |
2676 | return NULL; | |
2677 | ||
2678 | circuit = circuit_scan_by_ifp(ifp); | |
2679 | if (!circuit) | |
2680 | return NULL; | |
2681 | ||
2682 | return yang_data_new_uint32(xpath, circuit->auth_failures); | |
2683 | } | |
2684 | ||
9414b6f6 EDP |
2685 | /* |
2686 | * NOTIFICATIONS | |
2687 | */ | |
2688 | static void notif_prep_instance_hdr(const char *xpath, | |
2689 | const struct isis_area *area, | |
2690 | const char *routing_instance, | |
2691 | struct list *args) | |
2692 | { | |
2693 | char xpath_arg[XPATH_MAXLEN]; | |
2694 | struct yang_data *data; | |
2695 | ||
2696 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/routing-instance", xpath); | |
2697 | data = yang_data_new_string(xpath_arg, routing_instance); | |
2698 | listnode_add(args, data); | |
2699 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/routing-protocol-name", | |
2700 | xpath); | |
2701 | data = yang_data_new_string(xpath_arg, area->area_tag); | |
2702 | listnode_add(args, data); | |
2703 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/isis-level", xpath); | |
2704 | data = yang_data_new_enum(xpath_arg, area->is_type); | |
2705 | listnode_add(args, data); | |
2706 | } | |
2707 | ||
56e22fb6 EDP |
2708 | static void notif_prepr_iface_hdr(const char *xpath, |
2709 | const struct isis_circuit *circuit, | |
2710 | struct list *args) | |
2711 | { | |
2712 | char xpath_arg[XPATH_MAXLEN]; | |
2713 | struct yang_data *data; | |
2714 | ||
2715 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/interface-name", xpath); | |
2716 | data = yang_data_new_string(xpath_arg, circuit->interface->name); | |
2717 | listnode_add(args, data); | |
2718 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/interface-level", xpath); | |
2719 | data = yang_data_new_enum(xpath_arg, circuit->is_type); | |
2720 | listnode_add(args, data); | |
2721 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/extended-circuit-id", xpath); | |
2722 | /* we do not seem to have the extended version of the circuit_id */ | |
2723 | data = yang_data_new_uint32(xpath_arg, (uint32_t)circuit->circuit_id); | |
2724 | listnode_add(args, data); | |
2725 | } | |
2726 | ||
9414b6f6 EDP |
2727 | /* |
2728 | * XPath: | |
2729 | * /frr-isisd:database-overload | |
2730 | */ | |
2731 | void isis_notif_db_overload(const struct isis_area *area, bool overload) | |
2732 | { | |
2733 | const char *xpath = "/frr-isisd:database-overload"; | |
2734 | struct list *arguments = yang_data_list_new(); | |
2735 | char xpath_arg[XPATH_MAXLEN]; | |
2736 | struct yang_data *data; | |
2737 | ||
2738 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2739 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/overload", xpath); | |
2740 | data = yang_data_new_enum(xpath_arg, !!overload); | |
2741 | listnode_add(arguments, data); | |
2742 | ||
2743 | nb_notification_send(xpath, arguments); | |
2744 | } | |
2745 | ||
56e22fb6 EDP |
2746 | /* |
2747 | * XPath: | |
2748 | * /frr-isisd:lsp-too-large | |
2749 | */ | |
2750 | void isis_notif_lsp_too_large(const struct isis_circuit *circuit, | |
2751 | uint32_t pdu_size, const char *lsp_id) | |
2752 | { | |
2753 | const char *xpath = "/frr-isisd:lsp-too-large"; | |
2754 | struct list *arguments = yang_data_list_new(); | |
2755 | char xpath_arg[XPATH_MAXLEN]; | |
2756 | struct yang_data *data; | |
2757 | struct isis_area *area = circuit->area; | |
2758 | ||
2759 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2760 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
2761 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/pdu-size", xpath); | |
2762 | data = yang_data_new_uint32(xpath_arg, pdu_size); | |
2763 | listnode_add(arguments, data); | |
2764 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); | |
2765 | data = yang_data_new_string(xpath_arg, lsp_id); | |
2766 | listnode_add(arguments, data); | |
2767 | ||
2768 | nb_notification_send(xpath, arguments); | |
2769 | } | |
2770 | ||
392b89f3 EDP |
2771 | /* |
2772 | * XPath: | |
2773 | * /frr-isisd:if-state-change | |
2774 | */ | |
2775 | void isis_notif_if_state_change(const struct isis_circuit *circuit, bool down) | |
2776 | { | |
2777 | const char *xpath = "/frr-isisd:if-state-change"; | |
2778 | struct list *arguments = yang_data_list_new(); | |
2779 | char xpath_arg[XPATH_MAXLEN]; | |
2780 | struct yang_data *data; | |
2781 | struct isis_area *area = circuit->area; | |
2782 | ||
2783 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2784 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
2785 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/state", xpath); | |
2786 | data = yang_data_new_enum(xpath_arg, !!down); | |
2787 | listnode_add(arguments, data); | |
2788 | ||
2789 | nb_notification_send(xpath, arguments); | |
2790 | } | |
2791 | ||
a2370545 EDP |
2792 | /* |
2793 | * XPath: | |
2794 | * /frr-isisd:corrupted-lsp-detected | |
2795 | */ | |
2796 | void isis_notif_corrupted_lsp(const struct isis_area *area, const char *lsp_id) | |
2797 | { | |
2798 | const char *xpath = "/frr-isisd:corrupted-lsp-detected"; | |
2799 | struct list *arguments = yang_data_list_new(); | |
2800 | char xpath_arg[XPATH_MAXLEN]; | |
2801 | struct yang_data *data; | |
2802 | ||
2803 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2804 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); | |
2805 | data = yang_data_new_string(xpath_arg, lsp_id); | |
2806 | listnode_add(arguments, data); | |
2807 | ||
2808 | nb_notification_send(xpath, arguments); | |
2809 | } | |
2810 | ||
b21b068d EDP |
2811 | /* |
2812 | * XPath: | |
2813 | * /frr-isisd:attempt-to-exceed-max-sequence | |
2814 | */ | |
2815 | void isis_notif_lsp_exceed_max(const struct isis_area *area, const char *lsp_id) | |
2816 | { | |
2817 | const char *xpath = "/frr-isisd:attempt-to-exceed-max-sequence"; | |
2818 | struct list *arguments = yang_data_list_new(); | |
2819 | char xpath_arg[XPATH_MAXLEN]; | |
2820 | struct yang_data *data; | |
2821 | ||
2822 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2823 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); | |
2824 | data = yang_data_new_string(xpath_arg, lsp_id); | |
2825 | listnode_add(arguments, data); | |
2826 | ||
2827 | nb_notification_send(xpath, arguments); | |
2828 | } | |
2829 | ||
2ab5a2d1 EDP |
2830 | /* |
2831 | * XPath: | |
2832 | * /frr-isisd:max-area-addresses-mismatch | |
2833 | */ | |
2834 | void isis_notif_max_area_addr_mismatch(const struct isis_circuit *circuit, | |
2835 | uint8_t max_area_addrs, | |
2836 | const char *raw_pdu) | |
2837 | { | |
2838 | const char *xpath = "/frr-isisd:max-area-addresses-mismatch"; | |
2839 | struct list *arguments = yang_data_list_new(); | |
2840 | char xpath_arg[XPATH_MAXLEN]; | |
2841 | struct yang_data *data; | |
2842 | struct isis_area *area = circuit->area; | |
2843 | ||
2844 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2845 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
2846 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/max-area-addresses", xpath); | |
2847 | data = yang_data_new_uint8(xpath_arg, max_area_addrs); | |
2848 | listnode_add(arguments, data); | |
2849 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath); | |
2850 | data = yang_data_new(xpath_arg, raw_pdu); | |
2851 | listnode_add(arguments, data); | |
2852 | ||
2853 | nb_notification_send(xpath, arguments); | |
2854 | } | |
2855 | ||
3380c990 EDP |
2856 | /* |
2857 | * XPath: | |
2858 | * /frr-isisd:authentication-type-failure | |
2859 | */ | |
2860 | void isis_notif_authentication_type_failure(const struct isis_circuit *circuit, | |
2861 | const char *raw_pdu) | |
2862 | { | |
2863 | const char *xpath = "/frr-isisd:authentication-type-failure"; | |
2864 | struct list *arguments = yang_data_list_new(); | |
2865 | char xpath_arg[XPATH_MAXLEN]; | |
2866 | struct yang_data *data; | |
2867 | struct isis_area *area = circuit->area; | |
2868 | ||
2869 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2870 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
2871 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath); | |
2872 | data = yang_data_new(xpath_arg, raw_pdu); | |
2873 | listnode_add(arguments, data); | |
2874 | ||
2875 | nb_notification_send(xpath, arguments); | |
2876 | } | |
2877 | ||
2878 | /* | |
2879 | * XPath: | |
2880 | * /frr-isisd:authentication-failure | |
2881 | */ | |
2882 | void isis_notif_authentication_failure(const struct isis_circuit *circuit, | |
2883 | const char *raw_pdu) | |
2884 | { | |
2885 | const char *xpath = "/frr-isisd:authentication-failure"; | |
2886 | struct list *arguments = yang_data_list_new(); | |
2887 | char xpath_arg[XPATH_MAXLEN]; | |
2888 | struct yang_data *data; | |
2889 | struct isis_area *area = circuit->area; | |
2890 | ||
2891 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2892 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
2893 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath); | |
2894 | data = yang_data_new(xpath_arg, raw_pdu); | |
2895 | listnode_add(arguments, data); | |
2896 | ||
2897 | nb_notification_send(xpath, arguments); | |
2898 | } | |
2899 | ||
de983bb8 EDP |
2900 | /* |
2901 | * XPath: | |
2902 | * /frr-isisd:adjacency-state-change | |
2903 | */ | |
2904 | void isis_notif_adj_state_change(const struct isis_adjacency *adj, | |
2905 | int new_state, const char *reason) | |
2906 | { | |
2907 | const char *xpath = "/frr-isisd:adjacency-state-change"; | |
2908 | struct list *arguments = yang_data_list_new(); | |
2909 | char xpath_arg[XPATH_MAXLEN]; | |
2910 | struct yang_data *data; | |
2911 | struct isis_circuit *circuit = adj->circuit; | |
2912 | struct isis_area *area = circuit->area; | |
2913 | struct isis_dynhn *dyn = dynhn_find_by_id(adj->sysid); | |
2914 | ||
2915 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2916 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
2917 | if (dyn) { | |
2918 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/neighbor", xpath); | |
2919 | data = yang_data_new_string(xpath_arg, dyn->hostname); | |
2920 | listnode_add(arguments, data); | |
2921 | } | |
2922 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/neighbor-system-id", xpath); | |
2923 | data = yang_data_new_string(xpath_arg, sysid_print(adj->sysid)); | |
2924 | listnode_add(arguments, data); | |
2925 | ||
2926 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/state", xpath); | |
aec5ef49 | 2927 | data = yang_data_new_string(xpath_arg, isis_yang_adj_state(new_state)); |
de983bb8 EDP |
2928 | listnode_add(arguments, data); |
2929 | if (new_state == ISIS_ADJ_DOWN) { | |
2930 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/reason", xpath); | |
2931 | data = yang_data_new_string(xpath_arg, reason); | |
2932 | listnode_add(arguments, data); | |
2933 | } | |
2934 | ||
2935 | nb_notification_send(xpath, arguments); | |
2936 | } | |
2937 | ||
af6911c9 EDP |
2938 | /* |
2939 | * XPath: | |
2940 | * /frr-isisd:rejected-adjacency | |
2941 | */ | |
2942 | void isis_notif_reject_adjacency(const struct isis_circuit *circuit, | |
2943 | const char *reason, const char *raw_pdu) | |
2944 | { | |
2945 | const char *xpath = "/frr-isisd:rejected-adjacency"; | |
2946 | struct list *arguments = yang_data_list_new(); | |
2947 | char xpath_arg[XPATH_MAXLEN]; | |
2948 | struct yang_data *data; | |
2949 | struct isis_area *area = circuit->area; | |
2950 | ||
2951 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2952 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
2953 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/reason", xpath); | |
2954 | data = yang_data_new_string(xpath_arg, reason); | |
2955 | listnode_add(arguments, data); | |
2956 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath); | |
2957 | data = yang_data_new(xpath_arg, raw_pdu); | |
2958 | listnode_add(arguments, data); | |
2959 | ||
2960 | nb_notification_send(xpath, arguments); | |
2961 | } | |
2962 | ||
9d92b84b EDP |
2963 | /* |
2964 | * XPath: | |
2965 | * /frr-isisd:area-mismatch | |
2966 | */ | |
2967 | void isis_notif_area_mismatch(const struct isis_circuit *circuit, | |
2968 | const char *raw_pdu) | |
2969 | { | |
2970 | const char *xpath = "/frr-isisd:area-mismatch"; | |
2971 | struct list *arguments = yang_data_list_new(); | |
2972 | char xpath_arg[XPATH_MAXLEN]; | |
2973 | struct yang_data *data; | |
2974 | struct isis_area *area = circuit->area; | |
2975 | ||
2976 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
2977 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
2978 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath); | |
2979 | data = yang_data_new(xpath_arg, raw_pdu); | |
2980 | listnode_add(arguments, data); | |
2981 | ||
2982 | nb_notification_send(xpath, arguments); | |
2983 | } | |
2984 | ||
8375020a EDP |
2985 | /* |
2986 | * XPath: | |
2987 | * /frr-isisd:lsp-received | |
2988 | */ | |
2989 | void isis_notif_lsp_received(const struct isis_circuit *circuit, | |
2990 | const char *lsp_id, uint32_t seqno, | |
2991 | uint32_t timestamp, const char *sys_id) | |
2992 | { | |
2993 | const char *xpath = "/frr-isisd:lsp-received"; | |
2994 | struct list *arguments = yang_data_list_new(); | |
2995 | char xpath_arg[XPATH_MAXLEN]; | |
2996 | struct yang_data *data; | |
2997 | struct isis_area *area = circuit->area; | |
2998 | ||
2999 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
3000 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
3001 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); | |
3002 | data = yang_data_new_string(xpath_arg, lsp_id); | |
3003 | listnode_add(arguments, data); | |
3004 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/sequence", xpath); | |
3005 | data = yang_data_new_uint32(xpath_arg, seqno); | |
3006 | listnode_add(arguments, data); | |
3007 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/received-timestamp", xpath); | |
3008 | data = yang_data_new_uint32(xpath_arg, timestamp); | |
3009 | listnode_add(arguments, data); | |
3010 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/neighbor-system-id", xpath); | |
3011 | data = yang_data_new_string(xpath_arg, sys_id); | |
3012 | listnode_add(arguments, data); | |
3013 | ||
3014 | nb_notification_send(xpath, arguments); | |
3015 | } | |
3016 | ||
998011fa EDP |
3017 | /* |
3018 | * XPath: | |
3019 | * /frr-isisd:lsp-generation | |
3020 | */ | |
3021 | void isis_notif_lsp_gen(const struct isis_area *area, const char *lsp_id, | |
3022 | uint32_t seqno, uint32_t timestamp) | |
3023 | { | |
3024 | const char *xpath = "/frr-isisd:lsp-generation"; | |
3025 | struct list *arguments = yang_data_list_new(); | |
3026 | char xpath_arg[XPATH_MAXLEN]; | |
3027 | struct yang_data *data; | |
3028 | ||
3029 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
3030 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); | |
3031 | data = yang_data_new_string(xpath_arg, lsp_id); | |
3032 | listnode_add(arguments, data); | |
3033 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/sequence", xpath); | |
3034 | data = yang_data_new_uint32(xpath_arg, seqno); | |
3035 | listnode_add(arguments, data); | |
3036 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/send-timestamp", xpath); | |
3037 | data = yang_data_new_uint32(xpath_arg, timestamp); | |
3038 | listnode_add(arguments, data); | |
3039 | ||
3040 | nb_notification_send(xpath, arguments); | |
3041 | } | |
3042 | ||
e98d7633 EDP |
3043 | /* |
3044 | * XPath: | |
3045 | * /frr-isisd:id-len-mismatch | |
3046 | */ | |
3047 | void isis_notif_id_len_mismatch(const struct isis_circuit *circuit, | |
3048 | uint8_t rcv_id_len, const char *raw_pdu) | |
3049 | { | |
3050 | const char *xpath = "/frr-isisd:id-len-mismatch"; | |
3051 | struct list *arguments = yang_data_list_new(); | |
3052 | char xpath_arg[XPATH_MAXLEN]; | |
3053 | struct yang_data *data; | |
3054 | struct isis_area *area = circuit->area; | |
3055 | ||
3056 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
3057 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
3058 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/pdu-field-len", xpath); | |
3059 | data = yang_data_new_uint8(xpath_arg, rcv_id_len); | |
3060 | listnode_add(arguments, data); | |
3061 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath); | |
3062 | data = yang_data_new(xpath_arg, raw_pdu); | |
3063 | listnode_add(arguments, data); | |
3064 | ||
3065 | nb_notification_send(xpath, arguments); | |
3066 | } | |
3067 | ||
0532bd84 EDP |
3068 | /* |
3069 | * XPath: | |
3070 | * /frr-isisd:version-skew | |
3071 | */ | |
3072 | void isis_notif_version_skew(const struct isis_circuit *circuit, | |
3073 | uint8_t version, const char *raw_pdu) | |
3074 | { | |
3075 | const char *xpath = "/frr-isisd:version-skew"; | |
3076 | struct list *arguments = yang_data_list_new(); | |
3077 | char xpath_arg[XPATH_MAXLEN]; | |
3078 | struct yang_data *data; | |
3079 | struct isis_area *area = circuit->area; | |
3080 | ||
3081 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
3082 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
3083 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/protocol-version", xpath); | |
3084 | data = yang_data_new_uint8(xpath_arg, version); | |
3085 | listnode_add(arguments, data); | |
3086 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath); | |
3087 | data = yang_data_new(xpath_arg, raw_pdu); | |
3088 | listnode_add(arguments, data); | |
3089 | ||
3090 | nb_notification_send(xpath, arguments); | |
3091 | } | |
3092 | ||
86370604 EDP |
3093 | /* |
3094 | * XPath: | |
3095 | * /frr-isisd:lsp-error-detected | |
3096 | */ | |
3097 | void isis_notif_lsp_error(const struct isis_circuit *circuit, | |
3098 | const char *lsp_id, const char *raw_pdu, | |
3099 | __attribute__((unused)) uint32_t offset, | |
3100 | __attribute__((unused)) uint8_t tlv_type) | |
3101 | { | |
3102 | const char *xpath = "/frr-isisd:lsp-error-detected"; | |
3103 | struct list *arguments = yang_data_list_new(); | |
3104 | char xpath_arg[XPATH_MAXLEN]; | |
3105 | struct yang_data *data; | |
3106 | struct isis_area *area = circuit->area; | |
3107 | ||
3108 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
3109 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
3110 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); | |
3111 | data = yang_data_new_string(xpath_arg, lsp_id); | |
3112 | listnode_add(arguments, data); | |
3113 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath); | |
3114 | data = yang_data_new(xpath_arg, raw_pdu); | |
3115 | listnode_add(arguments, data); | |
3116 | /* ignore offset and tlv_type which cannot be set properly */ | |
3117 | ||
3118 | nb_notification_send(xpath, arguments); | |
3119 | } | |
3120 | ||
897989f8 EDP |
3121 | /* |
3122 | * XPath: | |
3123 | * /frr-isisd:sequence-number-skipped | |
3124 | */ | |
3125 | void isis_notif_seqno_skipped(const struct isis_circuit *circuit, | |
3126 | const char *lsp_id) | |
3127 | { | |
3128 | const char *xpath = "/frr-isisd:sequence-number-skipped"; | |
3129 | struct list *arguments = yang_data_list_new(); | |
3130 | char xpath_arg[XPATH_MAXLEN]; | |
3131 | struct yang_data *data; | |
3132 | struct isis_area *area = circuit->area; | |
3133 | ||
3134 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
3135 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
3136 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); | |
3137 | data = yang_data_new_string(xpath_arg, lsp_id); | |
3138 | listnode_add(arguments, data); | |
3139 | ||
3140 | nb_notification_send(xpath, arguments); | |
3141 | } | |
3142 | ||
d32f213a EDP |
3143 | /* |
3144 | * XPath: | |
3145 | * /frr-isisd:own-lsp-purge | |
3146 | */ | |
3147 | void isis_notif_own_lsp_purge(const struct isis_circuit *circuit, | |
3148 | const char *lsp_id) | |
3149 | { | |
3150 | const char *xpath = "/frr-isisd:own-lsp-purge"; | |
3151 | struct list *arguments = yang_data_list_new(); | |
3152 | char xpath_arg[XPATH_MAXLEN]; | |
3153 | struct yang_data *data; | |
3154 | struct isis_area *area = circuit->area; | |
3155 | ||
3156 | notif_prep_instance_hdr(xpath, area, "default", arguments); | |
3157 | notif_prepr_iface_hdr(xpath, circuit, arguments); | |
3158 | snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); | |
3159 | data = yang_data_new_string(xpath_arg, lsp_id); | |
3160 | listnode_add(arguments, data); | |
3161 | ||
3162 | nb_notification_send(xpath, arguments); | |
3163 | } | |
3164 | ||
20bd27e2 EDP |
3165 | /* clang-format off */ |
3166 | const struct frr_yang_module_info frr_isisd_info = { | |
3167 | .name = "frr-isisd", | |
3168 | .nodes = { | |
3169 | { | |
3170 | .xpath = "/frr-isisd:isis/instance", | |
53280f93 DL |
3171 | .cbs = { |
3172 | .cli_show = cli_show_router_isis, | |
3173 | .create = isis_instance_create, | |
3174 | .destroy = isis_instance_destroy, | |
3175 | }, | |
aaf2fd21 | 3176 | .priority = NB_DFLT_PRIORITY - 1, |
20bd27e2 EDP |
3177 | }, |
3178 | { | |
3179 | .xpath = "/frr-isisd:isis/instance/is-type", | |
53280f93 DL |
3180 | .cbs = { |
3181 | .cli_show = cli_show_isis_is_type, | |
3182 | .modify = isis_instance_is_type_modify, | |
3183 | }, | |
20bd27e2 EDP |
3184 | }, |
3185 | { | |
3186 | .xpath = "/frr-isisd:isis/instance/area-address", | |
53280f93 DL |
3187 | .cbs = { |
3188 | .cli_show = cli_show_isis_area_address, | |
3189 | .create = isis_instance_area_address_create, | |
3190 | .destroy = isis_instance_area_address_destroy, | |
3191 | }, | |
20bd27e2 EDP |
3192 | }, |
3193 | { | |
3194 | .xpath = "/frr-isisd:isis/instance/dynamic-hostname", | |
53280f93 DL |
3195 | .cbs = { |
3196 | .cli_show = cli_show_isis_dynamic_hostname, | |
3197 | .modify = isis_instance_dynamic_hostname_modify, | |
3198 | }, | |
20bd27e2 EDP |
3199 | }, |
3200 | { | |
3201 | .xpath = "/frr-isisd:isis/instance/attached", | |
53280f93 DL |
3202 | .cbs = { |
3203 | .cli_show = cli_show_isis_attached, | |
3204 | .modify = isis_instance_attached_modify, | |
3205 | }, | |
20bd27e2 EDP |
3206 | }, |
3207 | { | |
3208 | .xpath = "/frr-isisd:isis/instance/overload", | |
53280f93 DL |
3209 | .cbs = { |
3210 | .cli_show = cli_show_isis_overload, | |
3211 | .modify = isis_instance_overload_modify, | |
3212 | }, | |
20bd27e2 EDP |
3213 | }, |
3214 | { | |
3215 | .xpath = "/frr-isisd:isis/instance/metric-style", | |
53280f93 DL |
3216 | .cbs = { |
3217 | .cli_show = cli_show_isis_metric_style, | |
3218 | .modify = isis_instance_metric_style_modify, | |
3219 | }, | |
20bd27e2 EDP |
3220 | }, |
3221 | { | |
3222 | .xpath = "/frr-isisd:isis/instance/purge-originator", | |
53280f93 DL |
3223 | .cbs = { |
3224 | .cli_show = cli_show_isis_purge_origin, | |
3225 | .modify = isis_instance_purge_originator_modify, | |
3226 | }, | |
20bd27e2 EDP |
3227 | }, |
3228 | { | |
3229 | .xpath = "/frr-isisd:isis/instance/lsp/mtu", | |
53280f93 DL |
3230 | .cbs = { |
3231 | .cli_show = cli_show_isis_lsp_mtu, | |
3232 | .modify = isis_instance_lsp_mtu_modify, | |
3233 | }, | |
20bd27e2 | 3234 | }, |
7e869004 EDP |
3235 | { |
3236 | .xpath = "/frr-isisd:isis/instance/lsp/refresh-interval", | |
53280f93 DL |
3237 | .cbs = { |
3238 | .cli_show = cli_show_isis_lsp_ref_interval, | |
3239 | }, | |
7e869004 | 3240 | }, |
20bd27e2 EDP |
3241 | { |
3242 | .xpath = "/frr-isisd:isis/instance/lsp/refresh-interval/level-1", | |
53280f93 DL |
3243 | .cbs = { |
3244 | .modify = isis_instance_lsp_refresh_interval_level_1_modify, | |
3245 | }, | |
20bd27e2 EDP |
3246 | }, |
3247 | { | |
3248 | .xpath = "/frr-isisd:isis/instance/lsp/refresh-interval/level-2", | |
53280f93 DL |
3249 | .cbs = { |
3250 | .modify = isis_instance_lsp_refresh_interval_level_2_modify, | |
3251 | }, | |
20bd27e2 | 3252 | }, |
ea120aa0 EDP |
3253 | { |
3254 | .xpath = "/frr-isisd:isis/instance/lsp/maximum-lifetime", | |
53280f93 DL |
3255 | .cbs = { |
3256 | .cli_show = cli_show_isis_lsp_max_lifetime, | |
3257 | }, | |
ea120aa0 | 3258 | }, |
20bd27e2 EDP |
3259 | { |
3260 | .xpath = "/frr-isisd:isis/instance/lsp/maximum-lifetime/level-1", | |
53280f93 DL |
3261 | .cbs = { |
3262 | .modify = isis_instance_lsp_maximum_lifetime_level_1_modify, | |
3263 | }, | |
20bd27e2 EDP |
3264 | }, |
3265 | { | |
3266 | .xpath = "/frr-isisd:isis/instance/lsp/maximum-lifetime/level-2", | |
53280f93 DL |
3267 | .cbs = { |
3268 | .modify = isis_instance_lsp_maximum_lifetime_level_2_modify, | |
3269 | }, | |
20bd27e2 | 3270 | }, |
1d6fe72e EDP |
3271 | { |
3272 | .xpath = "/frr-isisd:isis/instance/lsp/generation-interval", | |
53280f93 DL |
3273 | .cbs = { |
3274 | .cli_show = cli_show_isis_lsp_gen_interval, | |
3275 | }, | |
1d6fe72e | 3276 | }, |
20bd27e2 EDP |
3277 | { |
3278 | .xpath = "/frr-isisd:isis/instance/lsp/generation-interval/level-1", | |
53280f93 DL |
3279 | .cbs = { |
3280 | .modify = isis_instance_lsp_generation_interval_level_1_modify, | |
3281 | }, | |
20bd27e2 EDP |
3282 | }, |
3283 | { | |
3284 | .xpath = "/frr-isisd:isis/instance/lsp/generation-interval/level-2", | |
53280f93 DL |
3285 | .cbs = { |
3286 | .modify = isis_instance_lsp_generation_interval_level_2_modify, | |
3287 | }, | |
20bd27e2 EDP |
3288 | }, |
3289 | { | |
3290 | .xpath = "/frr-isisd:isis/instance/spf/ietf-backoff-delay", | |
53280f93 DL |
3291 | .cbs = { |
3292 | .apply_finish = ietf_backoff_delay_apply_finish, | |
3293 | .cli_show = cli_show_isis_spf_ietf_backoff, | |
3294 | .create = isis_instance_spf_ietf_backoff_delay_create, | |
3295 | .destroy = isis_instance_spf_ietf_backoff_delay_destroy, | |
3296 | }, | |
20bd27e2 EDP |
3297 | }, |
3298 | { | |
3299 | .xpath = "/frr-isisd:isis/instance/spf/ietf-backoff-delay/init-delay", | |
53280f93 DL |
3300 | .cbs = { |
3301 | .modify = isis_instance_spf_ietf_backoff_delay_init_delay_modify, | |
3302 | }, | |
20bd27e2 EDP |
3303 | }, |
3304 | { | |
3305 | .xpath = "/frr-isisd:isis/instance/spf/ietf-backoff-delay/short-delay", | |
53280f93 DL |
3306 | .cbs = { |
3307 | .modify = isis_instance_spf_ietf_backoff_delay_short_delay_modify, | |
3308 | }, | |
20bd27e2 EDP |
3309 | }, |
3310 | { | |
3311 | .xpath = "/frr-isisd:isis/instance/spf/ietf-backoff-delay/long-delay", | |
53280f93 DL |
3312 | .cbs = { |
3313 | .modify = isis_instance_spf_ietf_backoff_delay_long_delay_modify, | |
3314 | }, | |
20bd27e2 EDP |
3315 | }, |
3316 | { | |
3317 | .xpath = "/frr-isisd:isis/instance/spf/ietf-backoff-delay/hold-down", | |
53280f93 DL |
3318 | .cbs = { |
3319 | .modify = isis_instance_spf_ietf_backoff_delay_hold_down_modify, | |
3320 | }, | |
20bd27e2 EDP |
3321 | }, |
3322 | { | |
3323 | .xpath = "/frr-isisd:isis/instance/spf/ietf-backoff-delay/time-to-learn", | |
53280f93 DL |
3324 | .cbs = { |
3325 | .modify = isis_instance_spf_ietf_backoff_delay_time_to_learn_modify, | |
3326 | }, | |
20bd27e2 | 3327 | }, |
dcb1dcd6 EDP |
3328 | { |
3329 | .xpath = "/frr-isisd:isis/instance/spf/minimum-interval", | |
53280f93 DL |
3330 | .cbs = { |
3331 | .cli_show = cli_show_isis_spf_min_interval, | |
3332 | }, | |
dcb1dcd6 | 3333 | }, |
20bd27e2 EDP |
3334 | { |
3335 | .xpath = "/frr-isisd:isis/instance/spf/minimum-interval/level-1", | |
53280f93 DL |
3336 | .cbs = { |
3337 | .modify = isis_instance_spf_minimum_interval_level_1_modify, | |
3338 | }, | |
20bd27e2 EDP |
3339 | }, |
3340 | { | |
3341 | .xpath = "/frr-isisd:isis/instance/spf/minimum-interval/level-2", | |
53280f93 DL |
3342 | .cbs = { |
3343 | .modify = isis_instance_spf_minimum_interval_level_2_modify, | |
3344 | }, | |
20bd27e2 EDP |
3345 | }, |
3346 | { | |
3347 | .xpath = "/frr-isisd:isis/instance/area-password", | |
53280f93 DL |
3348 | .cbs = { |
3349 | .apply_finish = area_password_apply_finish, | |
3350 | .cli_show = cli_show_isis_area_pwd, | |
3351 | .create = isis_instance_area_password_create, | |
3352 | .destroy = isis_instance_area_password_destroy, | |
3353 | }, | |
20bd27e2 EDP |
3354 | }, |
3355 | { | |
3356 | .xpath = "/frr-isisd:isis/instance/area-password/password", | |
53280f93 DL |
3357 | .cbs = { |
3358 | .modify = isis_instance_area_password_password_modify, | |
3359 | }, | |
20bd27e2 EDP |
3360 | }, |
3361 | { | |
3362 | .xpath = "/frr-isisd:isis/instance/area-password/password-type", | |
53280f93 DL |
3363 | .cbs = { |
3364 | .modify = isis_instance_area_password_password_type_modify, | |
3365 | }, | |
20bd27e2 EDP |
3366 | }, |
3367 | { | |
3368 | .xpath = "/frr-isisd:isis/instance/area-password/authenticate-snp", | |
53280f93 DL |
3369 | .cbs = { |
3370 | .modify = isis_instance_area_password_authenticate_snp_modify, | |
3371 | }, | |
20bd27e2 EDP |
3372 | }, |
3373 | { | |
3374 | .xpath = "/frr-isisd:isis/instance/domain-password", | |
53280f93 DL |
3375 | .cbs = { |
3376 | .apply_finish = domain_password_apply_finish, | |
3377 | .cli_show = cli_show_isis_domain_pwd, | |
3378 | .create = isis_instance_domain_password_create, | |
3379 | .destroy = isis_instance_domain_password_destroy, | |
3380 | }, | |
20bd27e2 EDP |
3381 | }, |
3382 | { | |
3383 | .xpath = "/frr-isisd:isis/instance/domain-password/password", | |
53280f93 DL |
3384 | .cbs = { |
3385 | .modify = isis_instance_domain_password_password_modify, | |
3386 | }, | |
20bd27e2 EDP |
3387 | }, |
3388 | { | |
3389 | .xpath = "/frr-isisd:isis/instance/domain-password/password-type", | |
53280f93 DL |
3390 | .cbs = { |
3391 | .modify = isis_instance_domain_password_password_type_modify, | |
3392 | }, | |
20bd27e2 EDP |
3393 | }, |
3394 | { | |
3395 | .xpath = "/frr-isisd:isis/instance/domain-password/authenticate-snp", | |
53280f93 DL |
3396 | .cbs = { |
3397 | .modify = isis_instance_domain_password_authenticate_snp_modify, | |
3398 | }, | |
20bd27e2 EDP |
3399 | }, |
3400 | { | |
3401 | .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4", | |
53280f93 DL |
3402 | .cbs = { |
3403 | .apply_finish = default_info_origin_ipv4_apply_finish, | |
3404 | .cli_show = cli_show_isis_def_origin_ipv4, | |
3405 | .create = isis_instance_default_information_originate_ipv4_create, | |
3406 | .destroy = isis_instance_default_information_originate_ipv4_destroy, | |
3407 | }, | |
20bd27e2 EDP |
3408 | }, |
3409 | { | |
3410 | .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4/always", | |
53280f93 DL |
3411 | .cbs = { |
3412 | .modify = isis_instance_default_information_originate_ipv4_always_modify, | |
3413 | }, | |
20bd27e2 EDP |
3414 | }, |
3415 | { | |
3416 | .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4/route-map", | |
53280f93 DL |
3417 | .cbs = { |
3418 | .destroy = isis_instance_default_information_originate_ipv4_route_map_destroy, | |
3419 | .modify = isis_instance_default_information_originate_ipv4_route_map_modify, | |
3420 | }, | |
20bd27e2 EDP |
3421 | }, |
3422 | { | |
3423 | .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4/metric", | |
53280f93 DL |
3424 | .cbs = { |
3425 | .modify = isis_instance_default_information_originate_ipv4_metric_modify, | |
3426 | }, | |
20bd27e2 EDP |
3427 | }, |
3428 | { | |
3429 | .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6", | |
53280f93 DL |
3430 | .cbs = { |
3431 | .apply_finish = default_info_origin_ipv6_apply_finish, | |
3432 | .cli_show = cli_show_isis_def_origin_ipv6, | |
3433 | .create = isis_instance_default_information_originate_ipv6_create, | |
3434 | .destroy = isis_instance_default_information_originate_ipv6_destroy, | |
3435 | }, | |
20bd27e2 EDP |
3436 | }, |
3437 | { | |
3438 | .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6/always", | |
53280f93 DL |
3439 | .cbs = { |
3440 | .modify = isis_instance_default_information_originate_ipv6_always_modify, | |
3441 | }, | |
20bd27e2 EDP |
3442 | }, |
3443 | { | |
3444 | .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6/route-map", | |
53280f93 DL |
3445 | .cbs = { |
3446 | .destroy = isis_instance_default_information_originate_ipv6_route_map_destroy, | |
3447 | .modify = isis_instance_default_information_originate_ipv6_route_map_modify, | |
3448 | }, | |
20bd27e2 EDP |
3449 | }, |
3450 | { | |
3451 | .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6/metric", | |
53280f93 DL |
3452 | .cbs = { |
3453 | .modify = isis_instance_default_information_originate_ipv6_metric_modify, | |
3454 | }, | |
20bd27e2 EDP |
3455 | }, |
3456 | { | |
3457 | .xpath = "/frr-isisd:isis/instance/redistribute/ipv4", | |
53280f93 DL |
3458 | .cbs = { |
3459 | .apply_finish = redistribute_ipv4_apply_finish, | |
3460 | .cli_show = cli_show_isis_redistribute_ipv4, | |
3461 | .create = isis_instance_redistribute_ipv4_create, | |
3462 | .destroy = isis_instance_redistribute_ipv4_destroy, | |
3463 | }, | |
20bd27e2 EDP |
3464 | }, |
3465 | { | |
3466 | .xpath = "/frr-isisd:isis/instance/redistribute/ipv4/route-map", | |
53280f93 DL |
3467 | .cbs = { |
3468 | .destroy = isis_instance_redistribute_ipv4_route_map_destroy, | |
3469 | .modify = isis_instance_redistribute_ipv4_route_map_modify, | |
3470 | }, | |
20bd27e2 EDP |
3471 | }, |
3472 | { | |
3473 | .xpath = "/frr-isisd:isis/instance/redistribute/ipv4/metric", | |
53280f93 DL |
3474 | .cbs = { |
3475 | .modify = isis_instance_redistribute_ipv4_metric_modify, | |
3476 | }, | |
20bd27e2 EDP |
3477 | }, |
3478 | { | |
3479 | .xpath = "/frr-isisd:isis/instance/redistribute/ipv6", | |
53280f93 DL |
3480 | .cbs = { |
3481 | .apply_finish = redistribute_ipv6_apply_finish, | |
3482 | .cli_show = cli_show_isis_redistribute_ipv6, | |
3483 | .create = isis_instance_redistribute_ipv6_create, | |
3484 | .destroy = isis_instance_redistribute_ipv6_destroy, | |
3485 | }, | |
20bd27e2 EDP |
3486 | }, |
3487 | { | |
3488 | .xpath = "/frr-isisd:isis/instance/redistribute/ipv6/route-map", | |
53280f93 DL |
3489 | .cbs = { |
3490 | .destroy = isis_instance_redistribute_ipv6_route_map_destroy, | |
3491 | .modify = isis_instance_redistribute_ipv6_route_map_modify, | |
3492 | }, | |
20bd27e2 EDP |
3493 | }, |
3494 | { | |
3495 | .xpath = "/frr-isisd:isis/instance/redistribute/ipv6/metric", | |
53280f93 DL |
3496 | .cbs = { |
3497 | .modify = isis_instance_redistribute_ipv6_metric_modify, | |
3498 | }, | |
20bd27e2 EDP |
3499 | }, |
3500 | { | |
3501 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-multicast", | |
53280f93 DL |
3502 | .cbs = { |
3503 | .cli_show = cli_show_isis_mt_ipv4_multicast, | |
3504 | .create = isis_instance_multi_topology_ipv4_multicast_create, | |
3505 | .destroy = isis_instance_multi_topology_ipv4_multicast_destroy, | |
3506 | }, | |
20bd27e2 EDP |
3507 | }, |
3508 | { | |
3509 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-multicast/overload", | |
53280f93 DL |
3510 | .cbs = { |
3511 | .modify = isis_instance_multi_topology_ipv4_multicast_overload_modify, | |
3512 | }, | |
20bd27e2 EDP |
3513 | }, |
3514 | { | |
3515 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-management", | |
53280f93 DL |
3516 | .cbs = { |
3517 | .cli_show = cli_show_isis_mt_ipv4_mgmt, | |
3518 | .create = isis_instance_multi_topology_ipv4_management_create, | |
3519 | .destroy = isis_instance_multi_topology_ipv4_management_destroy, | |
3520 | }, | |
20bd27e2 EDP |
3521 | }, |
3522 | { | |
3523 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-management/overload", | |
53280f93 DL |
3524 | .cbs = { |
3525 | .modify = isis_instance_multi_topology_ipv4_management_overload_modify, | |
3526 | }, | |
20bd27e2 EDP |
3527 | }, |
3528 | { | |
3529 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-unicast", | |
53280f93 DL |
3530 | .cbs = { |
3531 | .cli_show = cli_show_isis_mt_ipv6_unicast, | |
3532 | .create = isis_instance_multi_topology_ipv6_unicast_create, | |
3533 | .destroy = isis_instance_multi_topology_ipv6_unicast_destroy, | |
3534 | }, | |
20bd27e2 EDP |
3535 | }, |
3536 | { | |
3537 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-unicast/overload", | |
53280f93 DL |
3538 | .cbs = { |
3539 | .modify = isis_instance_multi_topology_ipv6_unicast_overload_modify, | |
3540 | }, | |
20bd27e2 EDP |
3541 | }, |
3542 | { | |
3543 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-multicast", | |
53280f93 DL |
3544 | .cbs = { |
3545 | .cli_show = cli_show_isis_mt_ipv6_multicast, | |
3546 | .create = isis_instance_multi_topology_ipv6_multicast_create, | |
3547 | .destroy = isis_instance_multi_topology_ipv6_multicast_destroy, | |
3548 | }, | |
20bd27e2 EDP |
3549 | }, |
3550 | { | |
3551 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-multicast/overload", | |
53280f93 DL |
3552 | .cbs = { |
3553 | .modify = isis_instance_multi_topology_ipv6_multicast_overload_modify, | |
3554 | }, | |
20bd27e2 EDP |
3555 | }, |
3556 | { | |
3557 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-management", | |
53280f93 DL |
3558 | .cbs = { |
3559 | .cli_show = cli_show_isis_mt_ipv6_mgmt, | |
3560 | .create = isis_instance_multi_topology_ipv6_management_create, | |
3561 | .destroy = isis_instance_multi_topology_ipv6_management_destroy, | |
3562 | }, | |
20bd27e2 EDP |
3563 | }, |
3564 | { | |
3565 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-management/overload", | |
53280f93 DL |
3566 | .cbs = { |
3567 | .modify = isis_instance_multi_topology_ipv6_management_overload_modify, | |
3568 | }, | |
20bd27e2 EDP |
3569 | }, |
3570 | { | |
3571 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-dstsrc", | |
53280f93 DL |
3572 | .cbs = { |
3573 | .cli_show = cli_show_isis_mt_ipv6_dstsrc, | |
3574 | .create = isis_instance_multi_topology_ipv6_dstsrc_create, | |
3575 | .destroy = isis_instance_multi_topology_ipv6_dstsrc_destroy, | |
3576 | }, | |
20bd27e2 EDP |
3577 | }, |
3578 | { | |
3579 | .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-dstsrc/overload", | |
53280f93 DL |
3580 | .cbs = { |
3581 | .modify = isis_instance_multi_topology_ipv6_dstsrc_overload_modify, | |
3582 | }, | |
20bd27e2 EDP |
3583 | }, |
3584 | { | |
3585 | .xpath = "/frr-isisd:isis/instance/log-adjacency-changes", | |
53280f93 DL |
3586 | .cbs = { |
3587 | .cli_show = cli_show_isis_log_adjacency, | |
3588 | .modify = isis_instance_log_adjacency_changes_modify, | |
3589 | }, | |
20bd27e2 EDP |
3590 | }, |
3591 | { | |
2e2a8b91 | 3592 | .xpath = "/frr-isisd:isis/instance/mpls-te", |
53280f93 DL |
3593 | .cbs = { |
3594 | .cli_show = cli_show_isis_mpls_te, | |
3595 | .create = isis_instance_mpls_te_create, | |
3596 | .destroy = isis_instance_mpls_te_destroy, | |
3597 | }, | |
20bd27e2 EDP |
3598 | }, |
3599 | { | |
2e2a8b91 | 3600 | .xpath = "/frr-isisd:isis/instance/mpls-te/router-address", |
53280f93 DL |
3601 | .cbs = { |
3602 | .cli_show = cli_show_isis_mpls_te_router_addr, | |
3603 | .destroy = isis_instance_mpls_te_router_address_destroy, | |
3604 | .modify = isis_instance_mpls_te_router_address_modify, | |
3605 | }, | |
20bd27e2 EDP |
3606 | }, |
3607 | { | |
3608 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis", | |
53280f93 DL |
3609 | .cbs = { |
3610 | .create = lib_interface_isis_create, | |
3611 | .destroy = lib_interface_isis_destroy, | |
3612 | }, | |
20bd27e2 EDP |
3613 | }, |
3614 | { | |
3615 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/area-tag", | |
53280f93 DL |
3616 | .cbs = { |
3617 | .modify = lib_interface_isis_area_tag_modify, | |
3618 | }, | |
20bd27e2 EDP |
3619 | }, |
3620 | { | |
3621 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/circuit-type", | |
53280f93 DL |
3622 | .cbs = { |
3623 | .cli_show = cli_show_ip_isis_circ_type, | |
3624 | .modify = lib_interface_isis_circuit_type_modify, | |
3625 | }, | |
20bd27e2 EDP |
3626 | }, |
3627 | { | |
3628 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/ipv4-routing", | |
53280f93 DL |
3629 | .cbs = { |
3630 | .cli_show = cli_show_ip_isis_ipv4, | |
3631 | .modify = lib_interface_isis_ipv4_routing_modify, | |
3632 | }, | |
20bd27e2 EDP |
3633 | }, |
3634 | { | |
3635 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/ipv6-routing", | |
53280f93 DL |
3636 | .cbs = { |
3637 | .cli_show = cli_show_ip_isis_ipv6, | |
3638 | .modify = lib_interface_isis_ipv6_routing_modify, | |
3639 | }, | |
20bd27e2 | 3640 | }, |
c3e6ac0b RZ |
3641 | { |
3642 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring", | |
98ec2b3e RZ |
3643 | .cbs = { |
3644 | .modify = lib_interface_isis_bfd_monitoring_modify, | |
3645 | .cli_show = cli_show_ip_isis_bfd_monitoring, | |
3646 | } | |
c3e6ac0b | 3647 | }, |
9ce808b9 EDP |
3648 | { |
3649 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/csnp-interval", | |
53280f93 DL |
3650 | .cbs = { |
3651 | .cli_show = cli_show_ip_isis_csnp_interval, | |
3652 | }, | |
9ce808b9 | 3653 | }, |
20bd27e2 EDP |
3654 | { |
3655 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/csnp-interval/level-1", | |
53280f93 DL |
3656 | .cbs = { |
3657 | .modify = lib_interface_isis_csnp_interval_level_1_modify, | |
3658 | }, | |
20bd27e2 EDP |
3659 | }, |
3660 | { | |
3661 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/csnp-interval/level-2", | |
53280f93 DL |
3662 | .cbs = { |
3663 | .modify = lib_interface_isis_csnp_interval_level_2_modify, | |
3664 | }, | |
20bd27e2 | 3665 | }, |
9ce808b9 EDP |
3666 | { |
3667 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/psnp-interval", | |
53280f93 DL |
3668 | .cbs = { |
3669 | .cli_show = cli_show_ip_isis_psnp_interval, | |
3670 | }, | |
9ce808b9 | 3671 | }, |
20bd27e2 EDP |
3672 | { |
3673 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/psnp-interval/level-1", | |
53280f93 DL |
3674 | .cbs = { |
3675 | .modify = lib_interface_isis_psnp_interval_level_1_modify, | |
3676 | }, | |
20bd27e2 EDP |
3677 | }, |
3678 | { | |
3679 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/psnp-interval/level-2", | |
53280f93 DL |
3680 | .cbs = { |
3681 | .modify = lib_interface_isis_psnp_interval_level_2_modify, | |
3682 | }, | |
20bd27e2 EDP |
3683 | }, |
3684 | { | |
3685 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/padding", | |
53280f93 DL |
3686 | .cbs = { |
3687 | .cli_show = cli_show_ip_isis_hello_padding, | |
3688 | .modify = lib_interface_isis_hello_padding_modify, | |
3689 | }, | |
20bd27e2 | 3690 | }, |
356a2e3c EDP |
3691 | { |
3692 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/interval", | |
53280f93 DL |
3693 | .cbs = { |
3694 | .cli_show = cli_show_ip_isis_hello_interval, | |
3695 | }, | |
356a2e3c | 3696 | }, |
20bd27e2 EDP |
3697 | { |
3698 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/interval/level-1", | |
53280f93 DL |
3699 | .cbs = { |
3700 | .modify = lib_interface_isis_hello_interval_level_1_modify, | |
3701 | }, | |
20bd27e2 EDP |
3702 | }, |
3703 | { | |
3704 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/interval/level-2", | |
53280f93 DL |
3705 | .cbs = { |
3706 | .modify = lib_interface_isis_hello_interval_level_2_modify, | |
3707 | }, | |
20bd27e2 | 3708 | }, |
4e75a67d EDP |
3709 | { |
3710 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/multiplier", | |
53280f93 DL |
3711 | .cbs = { |
3712 | .cli_show = cli_show_ip_isis_hello_multi, | |
3713 | }, | |
4e75a67d | 3714 | }, |
20bd27e2 EDP |
3715 | { |
3716 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/multiplier/level-1", | |
53280f93 DL |
3717 | .cbs = { |
3718 | .modify = lib_interface_isis_hello_multiplier_level_1_modify, | |
3719 | }, | |
20bd27e2 EDP |
3720 | }, |
3721 | { | |
3722 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/multiplier/level-2", | |
53280f93 DL |
3723 | .cbs = { |
3724 | .modify = lib_interface_isis_hello_multiplier_level_2_modify, | |
3725 | }, | |
20bd27e2 | 3726 | }, |
be49219c EDP |
3727 | { |
3728 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/metric", | |
53280f93 DL |
3729 | .cbs = { |
3730 | .cli_show = cli_show_ip_isis_metric, | |
3731 | }, | |
be49219c | 3732 | }, |
20bd27e2 EDP |
3733 | { |
3734 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/metric/level-1", | |
53280f93 DL |
3735 | .cbs = { |
3736 | .modify = lib_interface_isis_metric_level_1_modify, | |
3737 | }, | |
20bd27e2 EDP |
3738 | }, |
3739 | { | |
3740 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/metric/level-2", | |
53280f93 DL |
3741 | .cbs = { |
3742 | .modify = lib_interface_isis_metric_level_2_modify, | |
3743 | }, | |
20bd27e2 | 3744 | }, |
d59c2d6b EDP |
3745 | { |
3746 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/priority", | |
53280f93 DL |
3747 | .cbs = { |
3748 | .cli_show = cli_show_ip_isis_priority, | |
3749 | }, | |
d59c2d6b | 3750 | }, |
20bd27e2 EDP |
3751 | { |
3752 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/priority/level-1", | |
53280f93 DL |
3753 | .cbs = { |
3754 | .modify = lib_interface_isis_priority_level_1_modify, | |
3755 | }, | |
20bd27e2 EDP |
3756 | }, |
3757 | { | |
3758 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/priority/level-2", | |
53280f93 DL |
3759 | .cbs = { |
3760 | .modify = lib_interface_isis_priority_level_2_modify, | |
3761 | }, | |
20bd27e2 EDP |
3762 | }, |
3763 | { | |
3764 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/network-type", | |
53280f93 DL |
3765 | .cbs = { |
3766 | .cli_show = cli_show_ip_isis_network_type, | |
3767 | .modify = lib_interface_isis_network_type_modify, | |
3768 | }, | |
20bd27e2 EDP |
3769 | }, |
3770 | { | |
3771 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/passive", | |
53280f93 DL |
3772 | .cbs = { |
3773 | .cli_show = cli_show_ip_isis_passive, | |
3774 | .modify = lib_interface_isis_passive_modify, | |
3775 | }, | |
20bd27e2 EDP |
3776 | }, |
3777 | { | |
3778 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/password", | |
53280f93 DL |
3779 | .cbs = { |
3780 | .cli_show = cli_show_ip_isis_password, | |
3781 | .create = lib_interface_isis_password_create, | |
3782 | .destroy = lib_interface_isis_password_destroy, | |
3783 | }, | |
20bd27e2 EDP |
3784 | }, |
3785 | { | |
3786 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/password/password", | |
53280f93 DL |
3787 | .cbs = { |
3788 | .modify = lib_interface_isis_password_password_modify, | |
3789 | }, | |
20bd27e2 EDP |
3790 | }, |
3791 | { | |
3792 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/password/password-type", | |
53280f93 DL |
3793 | .cbs = { |
3794 | .modify = lib_interface_isis_password_password_type_modify, | |
3795 | }, | |
20bd27e2 EDP |
3796 | }, |
3797 | { | |
3798 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/disable-three-way-handshake", | |
53280f93 DL |
3799 | .cbs = { |
3800 | .cli_show = cli_show_ip_isis_threeway_shake, | |
3801 | .modify = lib_interface_isis_disable_three_way_handshake_modify, | |
3802 | }, | |
20bd27e2 EDP |
3803 | }, |
3804 | { | |
3805 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-unicast", | |
53280f93 DL |
3806 | .cbs = { |
3807 | .cli_show = cli_show_ip_isis_mt_ipv4_unicast, | |
3808 | .modify = lib_interface_isis_multi_topology_ipv4_unicast_modify, | |
3809 | }, | |
20bd27e2 EDP |
3810 | }, |
3811 | { | |
3812 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-multicast", | |
53280f93 DL |
3813 | .cbs = { |
3814 | .cli_show = cli_show_ip_isis_mt_ipv4_multicast, | |
3815 | .modify = lib_interface_isis_multi_topology_ipv4_multicast_modify, | |
3816 | }, | |
20bd27e2 EDP |
3817 | }, |
3818 | { | |
3819 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv4-management", | |
53280f93 DL |
3820 | .cbs = { |
3821 | .cli_show = cli_show_ip_isis_mt_ipv4_mgmt, | |
3822 | .modify = lib_interface_isis_multi_topology_ipv4_management_modify, | |
3823 | }, | |
20bd27e2 EDP |
3824 | }, |
3825 | { | |
3826 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-unicast", | |
53280f93 DL |
3827 | .cbs = { |
3828 | .cli_show = cli_show_ip_isis_mt_ipv6_unicast, | |
3829 | .modify = lib_interface_isis_multi_topology_ipv6_unicast_modify, | |
3830 | }, | |
20bd27e2 EDP |
3831 | }, |
3832 | { | |
3833 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-multicast", | |
53280f93 DL |
3834 | .cbs = { |
3835 | .cli_show = cli_show_ip_isis_mt_ipv6_multicast, | |
3836 | .modify = lib_interface_isis_multi_topology_ipv6_multicast_modify, | |
3837 | }, | |
20bd27e2 EDP |
3838 | }, |
3839 | { | |
3840 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-management", | |
53280f93 DL |
3841 | .cbs = { |
3842 | .cli_show = cli_show_ip_isis_mt_ipv6_mgmt, | |
3843 | .modify = lib_interface_isis_multi_topology_ipv6_management_modify, | |
3844 | }, | |
20bd27e2 EDP |
3845 | }, |
3846 | { | |
3847 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/multi-topology/ipv6-dstsrc", | |
53280f93 DL |
3848 | .cbs = { |
3849 | .cli_show = cli_show_ip_isis_mt_ipv6_dstsrc, | |
3850 | .modify = lib_interface_isis_multi_topology_ipv6_dstsrc_modify, | |
3851 | }, | |
20bd27e2 | 3852 | }, |
aec5ef49 RW |
3853 | { |
3854 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency", | |
3855 | .cbs = { | |
3856 | .get_next = lib_interface_isis_adjacencies_adjacency_get_next, | |
3857 | } | |
3858 | }, | |
3859 | { | |
3860 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-sys-type", | |
3861 | .cbs = { | |
3862 | .get_elem = lib_interface_isis_adjacencies_adjacency_neighbor_sys_type_get_elem, | |
3863 | } | |
3864 | }, | |
3865 | { | |
3866 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-sysid", | |
3867 | .cbs = { | |
3868 | .get_elem = lib_interface_isis_adjacencies_adjacency_neighbor_sysid_get_elem, | |
3869 | } | |
3870 | }, | |
3871 | { | |
3872 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-extended-circuit-id", | |
3873 | .cbs = { | |
3874 | .get_elem = lib_interface_isis_adjacencies_adjacency_neighbor_extended_circuit_id_get_elem, | |
3875 | } | |
3876 | }, | |
3877 | { | |
3878 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-snpa", | |
3879 | .cbs = { | |
3880 | .get_elem = lib_interface_isis_adjacencies_adjacency_neighbor_snpa_get_elem, | |
3881 | } | |
3882 | }, | |
3883 | { | |
3884 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/hold-timer", | |
3885 | .cbs = { | |
3886 | .get_elem = lib_interface_isis_adjacencies_adjacency_hold_timer_get_elem, | |
3887 | } | |
3888 | }, | |
3889 | { | |
3890 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/neighbor-priority", | |
3891 | .cbs = { | |
3892 | .get_elem = lib_interface_isis_adjacencies_adjacency_neighbor_priority_get_elem, | |
3893 | } | |
3894 | }, | |
3895 | { | |
3896 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/adjacencies/adjacency/state", | |
3897 | .cbs = { | |
3898 | .get_elem = lib_interface_isis_adjacencies_adjacency_state_get_elem, | |
3899 | } | |
3900 | }, | |
c32496ee RW |
3901 | { |
3902 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/event-counters/adjacency-changes", | |
3903 | .cbs = { | |
3904 | .get_elem = lib_interface_isis_event_counters_adjacency_changes_get_elem, | |
3905 | } | |
3906 | }, | |
3907 | { | |
3908 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/event-counters/adjacency-number", | |
3909 | .cbs = { | |
3910 | .get_elem = lib_interface_isis_event_counters_adjacency_number_get_elem, | |
3911 | } | |
3912 | }, | |
3913 | { | |
3914 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/event-counters/init-fails", | |
3915 | .cbs = { | |
3916 | .get_elem = lib_interface_isis_event_counters_init_fails_get_elem, | |
3917 | } | |
3918 | }, | |
3919 | { | |
3920 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/event-counters/adjacency-rejects", | |
3921 | .cbs = { | |
3922 | .get_elem = lib_interface_isis_event_counters_adjacency_rejects_get_elem, | |
3923 | } | |
3924 | }, | |
3925 | { | |
3926 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/event-counters/id-len-mismatch", | |
3927 | .cbs = { | |
3928 | .get_elem = lib_interface_isis_event_counters_id_len_mismatch_get_elem, | |
3929 | } | |
3930 | }, | |
3931 | { | |
3932 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/event-counters/max-area-addresses-mismatch", | |
3933 | .cbs = { | |
3934 | .get_elem = lib_interface_isis_event_counters_max_area_addresses_mismatch_get_elem, | |
3935 | } | |
3936 | }, | |
3937 | { | |
3938 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/event-counters/authentication-type-fails", | |
3939 | .cbs = { | |
3940 | .get_elem = lib_interface_isis_event_counters_authentication_type_fails_get_elem, | |
3941 | } | |
3942 | }, | |
3943 | { | |
3944 | .xpath = "/frr-interface:lib/interface/frr-isisd:isis/event-counters/authentication-fails", | |
3945 | .cbs = { | |
3946 | .get_elem = lib_interface_isis_event_counters_authentication_fails_get_elem, | |
3947 | } | |
3948 | }, | |
20bd27e2 EDP |
3949 | { |
3950 | .xpath = NULL, | |
3951 | }, | |
3952 | } | |
3953 | }; |