]> git.proxmox.com Git - mirror_frr.git/blob - staticd/static_nb_config.c
staticd : Added the warning log for route when VRF is not ready.
[mirror_frr.git] / staticd / static_nb_config.c
1 /*
2 * Copyright (C) 2018 Vmware
3 * Vishal Dhingra
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 #include "northbound.h"
20 #include "libfrr.h"
21 #include "log.h"
22 #include "lib_errors.h"
23 #include "prefix.h"
24 #include "table.h"
25 #include "vrf.h"
26 #include "nexthop.h"
27 #include "srcdest_table.h"
28
29 #include "static_vrf.h"
30 #include "static_routes.h"
31 #include "static_nb.h"
32
33
34 static int static_path_list_create(struct nb_cb_create_args *args)
35 {
36 struct route_node *rn;
37 struct static_path *pn;
38 uint8_t distance;
39
40 switch (args->event) {
41 case NB_EV_VALIDATE:
42 case NB_EV_ABORT:
43 case NB_EV_PREPARE:
44 break;
45 case NB_EV_APPLY:
46 rn = nb_running_get_entry(args->dnode, NULL, true);
47 distance = yang_dnode_get_uint8(args->dnode, "./distance");
48 pn = static_add_path(rn, distance);
49 nb_running_set_entry(args->dnode, pn);
50 }
51
52 return NB_OK;
53 }
54
55 static void static_path_list_destroy(struct nb_cb_destroy_args *args,
56 const struct lyd_node *rn_dnode,
57 struct stable_info *info)
58 {
59 struct route_node *rn;
60 struct static_path *pn;
61
62 pn = nb_running_unset_entry(args->dnode);
63 rn = nb_running_get_entry(rn_dnode, NULL, true);
64 static_del_path(rn, pn, info->safi, info->svrf);
65 }
66
67 static void static_path_list_tag_modify(struct nb_cb_modify_args *args,
68 const struct lyd_node *rn_dnode,
69 struct stable_info *info)
70 {
71 struct static_path *pn;
72 struct route_node *rn;
73 route_tag_t tag;
74
75 tag = yang_dnode_get_uint32(args->dnode, NULL);
76 pn = nb_running_get_entry(args->dnode, NULL, true);
77 pn->tag = tag;
78 rn = nb_running_get_entry(rn_dnode, NULL, true);
79
80 static_install_path(rn, pn, info->safi, info->svrf);
81 }
82
83 static int static_path_list_tableid_modify(struct nb_cb_modify_args *args,
84 const struct lyd_node *rn_dnode,
85 struct stable_info *info)
86 {
87 struct static_path *pn;
88 struct route_node *rn;
89 uint32_t table_id;
90 const struct lyd_node *vrf_dnode;
91 const char *vrf;
92
93 switch (args->event) {
94 case NB_EV_VALIDATE:
95 vrf_dnode = yang_dnode_get_parent(args->dnode,
96 "control-plane-protocol");
97 vrf = yang_dnode_get_string(vrf_dnode, "./vrf");
98 table_id = yang_dnode_get_uint32(args->dnode, NULL);
99 if (table_id && (strcmp(vrf, vrf_get_default_name()) != 0)
100 && !vrf_is_backend_netns()) {
101 snprintf(args->errmsg, args->errmsg_len,
102 "%% table param only available when running on netns-based vrfs");
103 return NB_ERR_VALIDATION;
104 }
105 break;
106 case NB_EV_PREPARE:
107 case NB_EV_ABORT:
108 break;
109 case NB_EV_APPLY:
110 table_id = yang_dnode_get_uint32(args->dnode, NULL);
111 pn = nb_running_get_entry(args->dnode, NULL, true);
112 pn->table_id = table_id;
113 rn = nb_running_get_entry(rn_dnode, NULL, true);
114 static_install_path(rn, pn, info->safi, info->svrf);
115 break;
116 }
117
118 return NB_OK;
119 }
120
121 static bool static_nexthop_create(struct nb_cb_create_args *args,
122 const struct lyd_node *rn_dnode,
123 struct stable_info *info)
124 {
125 struct route_node *rn;
126 struct static_path *pn;
127 struct ipaddr ipaddr;
128 struct static_nexthop *nh;
129 int nh_type;
130 const char *ifname;
131 const char *nh_vrf;
132
133 switch (args->event) {
134 case NB_EV_VALIDATE:
135 ifname = yang_dnode_get_string(args->dnode, "./interface");
136 if (ifname != NULL) {
137 if (strcasecmp(ifname, "Null0") == 0
138 || strcasecmp(ifname, "reject") == 0
139 || strcasecmp(ifname, "blackhole") == 0) {
140 snprintf(args->errmsg, args->errmsg_len,
141 "%s: Nexthop interface name can not be from reserved keywords(Null0, reject, blackhole)",
142 ifname);
143 return NB_ERR_VALIDATION;
144 }
145 }
146 break;
147 case NB_EV_PREPARE:
148 case NB_EV_ABORT:
149 break;
150 case NB_EV_APPLY:
151 yang_dnode_get_ip(&ipaddr, args->dnode, "./gateway");
152 nh_type = yang_dnode_get_enum(args->dnode, "./nh-type");
153 ifname = yang_dnode_get_string(args->dnode, "./interface");
154 nh_vrf = yang_dnode_get_string(args->dnode, "./vrf");
155 pn = nb_running_get_entry(args->dnode, NULL, true);
156 rn = nb_running_get_entry(rn_dnode, NULL, true);
157
158 if (!static_add_nexthop_validate(info->svrf, nh_type, &ipaddr))
159 flog_warn(
160 EC_LIB_NB_CB_CONFIG_VALIDATE,
161 "Warning!! Local connected address is configured as Gateway IP((%s))",
162 yang_dnode_get_string(args->dnode,
163 "./gateway"));
164 nh = static_add_nexthop(rn, pn, info->safi, info->svrf, nh_type,
165 &ipaddr, ifname, nh_vrf, 0);
166 if (!nh) {
167 char buf[SRCDEST2STR_BUFFER];
168
169 flog_warn(
170 EC_LIB_NB_CB_CONFIG_APPLY,
171 "%s : nh [%d:%s:%s:%s] nexthop creation failed",
172 srcdest_rnode2str(rn, buf, sizeof(buf)),
173 nh_type, ifname,
174 yang_dnode_get_string(args->dnode, "./gateway"),
175 nh_vrf);
176 return NB_ERR;
177 }
178 nb_running_set_entry(args->dnode, nh);
179 break;
180 }
181
182 return NB_OK;
183 }
184
185 static bool static_nexthop_destroy(struct nb_cb_destroy_args *args,
186 const struct lyd_node *rn_dnode,
187 struct stable_info *info)
188 {
189 struct route_node *rn;
190 struct static_path *pn;
191 const struct lyd_node *pn_dnode;
192 struct static_nexthop *nh;
193 int ret;
194
195 nh = nb_running_unset_entry(args->dnode);
196 pn_dnode = yang_dnode_get_parent(args->dnode, "path-list");
197 pn = nb_running_get_entry(pn_dnode, NULL, true);
198 rn = nb_running_get_entry(rn_dnode, NULL, true);
199
200 ret = static_delete_nexthop(rn, pn, info->safi, info->svrf, nh);
201 if (!ret) {
202 char buf[SRCDEST2STR_BUFFER];
203
204 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
205 "%s : nh [%d:%s:%s:%s] nexthop destroy failed",
206 srcdest_rnode2str(rn, buf, sizeof(buf)),
207 yang_dnode_get_enum(args->dnode, "./nh-type"),
208 yang_dnode_get_string(args->dnode, "./interface"),
209 yang_dnode_get_string(args->dnode, "./gateway"),
210 yang_dnode_get_string(args->dnode, "./vrf"));
211 return NB_ERR;
212 }
213
214 return NB_OK;
215 }
216
217 static int nexthop_mpls_label_stack_entry_create(struct nb_cb_create_args *args)
218 {
219 struct static_nexthop *nh;
220 uint32_t pos;
221 uint8_t index;
222
223 switch (args->event) {
224 case NB_EV_VALIDATE:
225 if (!mpls_enabled) {
226 snprintf(
227 args->errmsg, args->errmsg_len,
228 "%% MPLS not turned on in kernel ignoring static route");
229 return NB_ERR_VALIDATION;
230 }
231 break;
232 case NB_EV_PREPARE:
233 case NB_EV_ABORT:
234 break;
235 case NB_EV_APPLY:
236 nh = nb_running_get_entry(args->dnode, NULL, true);
237 pos = yang_get_list_pos(args->dnode);
238 if (!pos) {
239 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
240 "libyang returns invalid label position");
241 return NB_ERR;
242 }
243 /* Mapping to array = list-index -1 */
244 index = pos - 1;
245 nh->snh_label.label[index] = 0;
246 nh->snh_label.num_labels++;
247 break;
248 }
249
250 return NB_OK;
251 }
252
253 static int
254 nexthop_mpls_label_stack_entry_destroy(struct nb_cb_destroy_args *args)
255 {
256 struct static_nexthop *nh;
257 uint32_t pos;
258 uint8_t index;
259
260 switch (args->event) {
261 case NB_EV_VALIDATE:
262 case NB_EV_PREPARE:
263 case NB_EV_ABORT:
264 break;
265 case NB_EV_APPLY:
266 nh = nb_running_get_entry(args->dnode, NULL, true);
267 pos = yang_get_list_pos(args->dnode);
268 if (!pos) {
269 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
270 "libyang returns invalid label position");
271 return NB_ERR;
272 }
273 index = pos - 1;
274 nh->snh_label.label[index] = 0;
275 nh->snh_label.num_labels--;
276 break;
277 }
278
279 return NB_OK;
280 }
281
282 static int static_nexthop_mpls_label_modify(struct nb_cb_modify_args *args)
283 {
284 struct static_nexthop *nh;
285 uint32_t pos;
286 uint8_t index;
287
288 nh = nb_running_get_entry(args->dnode, NULL, true);
289 pos = yang_get_list_pos(args->dnode->parent);
290 if (!pos) {
291 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
292 "libyang returns invalid label position");
293 return NB_ERR;
294 }
295 /* Mapping to array = list-index -1 */
296 index = pos - 1;
297 nh->snh_label.label[index] = yang_dnode_get_uint32(args->dnode, NULL);
298
299 return NB_OK;
300 }
301
302 static int static_nexthop_onlink_modify(struct nb_cb_modify_args *args)
303 {
304 struct static_nexthop *nh;
305
306 nh = nb_running_get_entry(args->dnode, NULL, true);
307 nh->onlink = yang_dnode_get_bool(args->dnode, NULL);
308
309 return NB_OK;
310 }
311
312 static int static_nexthop_color_modify(struct nb_cb_modify_args *args)
313 {
314 struct static_nexthop *nh;
315
316 nh = nb_running_get_entry(args->dnode, NULL, true);
317 nh->color = yang_dnode_get_uint32(args->dnode, NULL);
318
319 return NB_OK;
320 }
321
322 static int static_nexthop_color_destroy(struct nb_cb_destroy_args *args)
323 {
324 struct static_nexthop *nh;
325
326 nh = nb_running_unset_entry(args->dnode);
327 nh->color = 0;
328
329 return NB_OK;
330 }
331
332 static int static_nexthop_bh_type_modify(struct nb_cb_modify_args *args)
333 {
334 struct static_nexthop *nh;
335
336 nh = nb_running_get_entry(args->dnode, NULL, true);
337 nh->bh_type = yang_dnode_get_enum(args->dnode, NULL);
338
339 return NB_OK;
340 }
341
342
343 void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish(
344 struct nb_cb_apply_finish_args *args)
345 {
346 struct static_nexthop *nh;
347 struct static_path *pn;
348 struct route_node *rn;
349 const struct lyd_node *pn_dnode;
350 const struct lyd_node *rn_dnode;
351 const char *ifname;
352 const char *nh_vrf;
353 struct stable_info *info;
354 int nh_type;
355
356 nh_type = yang_dnode_get_enum(args->dnode, "./nh-type");
357 ifname = yang_dnode_get_string(args->dnode, "./interface");
358 nh_vrf = yang_dnode_get_string(args->dnode, "./vrf");
359
360 nh = nb_running_get_entry(args->dnode, NULL, true);
361
362 pn_dnode = yang_dnode_get_parent(args->dnode, "path-list");
363 pn = nb_running_get_entry(pn_dnode, NULL, true);
364
365 rn_dnode = yang_dnode_get_parent(pn_dnode, "route-list");
366 rn = nb_running_get_entry(rn_dnode, NULL, true);
367 info = route_table_get_info(rn->table);
368
369 static_install_nexthop(rn, pn, nh, info->safi, info->svrf, ifname,
370 nh_type, nh_vrf);
371 }
372
373
374 void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish(
375 struct nb_cb_apply_finish_args *args)
376 {
377 struct static_nexthop *nh;
378 struct static_path *pn;
379 struct route_node *rn;
380 struct route_node *src_rn;
381 const struct lyd_node *pn_dnode;
382 const struct lyd_node *rn_dnode;
383 const struct lyd_node *src_dnode;
384 const char *ifname;
385 const char *nh_vrf;
386 struct stable_info *info;
387 int nh_type;
388
389 nh_type = yang_dnode_get_enum(args->dnode, "./nh-type");
390 ifname = yang_dnode_get_string(args->dnode, "./interface");
391 nh_vrf = yang_dnode_get_string(args->dnode, "./vrf");
392
393 nh = nb_running_get_entry(args->dnode, NULL, true);
394
395 pn_dnode = yang_dnode_get_parent(args->dnode, "path-list");
396 pn = nb_running_get_entry(pn_dnode, NULL, true);
397
398 src_dnode = yang_dnode_get_parent(pn_dnode, "src-list");
399 src_rn = nb_running_get_entry(src_dnode, NULL, true);
400
401 rn_dnode = yang_dnode_get_parent(src_dnode, "route-list");
402 rn = nb_running_get_entry(rn_dnode, NULL, true);
403 info = route_table_get_info(rn->table);
404
405 static_install_nexthop(src_rn, pn, nh, info->safi, info->svrf, ifname,
406 nh_type, nh_vrf);
407 }
408 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate(
409 struct nb_cb_pre_validate_args *args)
410 {
411 const struct lyd_node *mls_dnode;
412 uint32_t count;
413
414 mls_dnode = yang_dnode_get(args->dnode, "./mpls-label-stack");
415 count = yang_get_list_elements_count(yang_dnode_get_child(mls_dnode));
416
417 if (count > MPLS_MAX_LABELS) {
418 snprintf(args->errmsg, args->errmsg_len,
419 "Too many labels, Enter %d or fewer",
420 MPLS_MAX_LABELS);
421 return NB_ERR_VALIDATION;
422 }
423 return NB_OK;
424 }
425
426 int routing_control_plane_protocols_name_validate(
427 struct nb_cb_create_args *args)
428 {
429 const char *name;
430
431 name = yang_dnode_get_string(args->dnode, "./name");
432 if (!strmatch(name, "staticd")) {
433 snprintf(args->errmsg, args->errmsg_len,
434 "static routing supports only one instance with name staticd");
435 return NB_ERR_VALIDATION;
436 }
437 return NB_OK;
438 }
439 /*
440 * XPath:
441 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list
442 */
443 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create(
444 struct nb_cb_create_args *args)
445 {
446 struct vrf *vrf;
447 struct static_vrf *s_vrf;
448 struct route_node *rn;
449 const struct lyd_node *vrf_dnode;
450 struct prefix prefix;
451 const char *afi_safi;
452 afi_t prefix_afi;
453 afi_t afi;
454 safi_t safi;
455
456 switch (args->event) {
457 case NB_EV_VALIDATE:
458 yang_dnode_get_prefix(&prefix, args->dnode, "./prefix");
459 afi_safi = yang_dnode_get_string(args->dnode, "./afi-safi");
460 yang_afi_safi_identity2value(afi_safi, &afi, &safi);
461 prefix_afi = family2afi(prefix.family);
462 if (afi != prefix_afi) {
463 flog_warn(
464 EC_LIB_NB_CB_CONFIG_VALIDATE,
465 "route node %s creation failed",
466 yang_dnode_get_string(args->dnode, "./prefix"));
467 return NB_ERR_VALIDATION;
468 }
469 break;
470 case NB_EV_PREPARE:
471 case NB_EV_ABORT:
472 break;
473 case NB_EV_APPLY:
474 vrf_dnode = yang_dnode_get_parent(args->dnode,
475 "control-plane-protocol");
476 vrf = nb_running_get_entry(vrf_dnode, NULL, true);
477 s_vrf = vrf->info;
478
479 yang_dnode_get_prefix(&prefix, args->dnode, "./prefix");
480 afi_safi = yang_dnode_get_string(args->dnode, "./afi-safi");
481 yang_afi_safi_identity2value(afi_safi, &afi, &safi);
482
483 rn = static_add_route(afi, safi, &prefix, NULL, s_vrf);
484 if (!rn) {
485 flog_warn(
486 EC_LIB_NB_CB_CONFIG_APPLY,
487 "route node %s creation failed",
488 yang_dnode_get_string(args->dnode, "./prefix"));
489 return NB_ERR;
490 }
491 if (vrf->vrf_id == VRF_UNKNOWN)
492 snprintf(
493 args->errmsg, args->errmsg_len,
494 "Static Route to %s not installed currently because dependent config not fully available",
495 yang_dnode_get_string(args->dnode, "./prefix"));
496 nb_running_set_entry(args->dnode, rn);
497 break;
498 }
499 return NB_OK;
500 }
501
502 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy(
503 struct nb_cb_destroy_args *args)
504 {
505 struct route_node *rn;
506 struct stable_info *info;
507
508 switch (args->event) {
509 case NB_EV_VALIDATE:
510 case NB_EV_PREPARE:
511 case NB_EV_ABORT:
512 break;
513 case NB_EV_APPLY:
514 rn = nb_running_unset_entry(args->dnode);
515 info = route_table_get_info(rn->table);
516 static_del_route(rn, info->safi, info->svrf);
517 break;
518 }
519 return NB_OK;
520 }
521
522 /*
523 * XPath:
524 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list
525 */
526 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create(
527 struct nb_cb_create_args *args)
528 {
529 return static_path_list_create(args);
530 }
531
532 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy(
533 struct nb_cb_destroy_args *args)
534 {
535 const struct lyd_node *rn_dnode;
536 struct route_node *rn;
537 struct stable_info *info;
538
539 switch (args->event) {
540 case NB_EV_VALIDATE:
541 case NB_EV_PREPARE:
542 case NB_EV_ABORT:
543 break;
544 case NB_EV_APPLY:
545 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
546 rn = nb_running_get_entry(rn_dnode, NULL, true);
547 info = route_table_get_info(rn->table);
548 static_path_list_destroy(args, rn_dnode, info);
549 break;
550 }
551 return NB_OK;
552 }
553
554 /*
555 * XPath:
556 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/tag
557 */
558 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify(
559 struct nb_cb_modify_args *args)
560 {
561 struct stable_info *info;
562 struct route_node *rn;
563 const struct lyd_node *rn_dnode;
564
565 switch (args->event) {
566 case NB_EV_VALIDATE:
567 case NB_EV_ABORT:
568 case NB_EV_PREPARE:
569 break;
570 case NB_EV_APPLY:
571 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
572 rn = nb_running_get_entry(rn_dnode, NULL, true);
573 info = route_table_get_info(rn->table);
574 static_path_list_tag_modify(args, rn_dnode, info);
575 break;
576 }
577
578 return NB_OK;
579 }
580
581 /*
582 * XPath:
583 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/table-id
584 */
585 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_table_id_modify(
586 struct nb_cb_modify_args *args)
587 {
588 struct route_node *rn;
589 const struct lyd_node *rn_dnode;
590 struct stable_info *info;
591
592 switch (args->event) {
593 case NB_EV_VALIDATE:
594 if (static_path_list_tableid_modify(args, NULL, NULL) != NB_OK)
595 return NB_ERR_VALIDATION;
596 break;
597 case NB_EV_PREPARE:
598 case NB_EV_ABORT:
599 break;
600 case NB_EV_APPLY:
601 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
602 rn = nb_running_get_entry(rn_dnode, NULL, true);
603 info = route_table_get_info(rn->table);
604
605 if (static_path_list_tableid_modify(args, rn_dnode, info)
606 != NB_OK)
607 return NB_ERR_VALIDATION;
608 break;
609 }
610 return NB_OK;
611 }
612
613 /*
614 * XPath:
615 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop
616 */
617 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create(
618 struct nb_cb_create_args *args)
619 {
620 struct route_node *rn;
621 const struct lyd_node *rn_dnode;
622 struct stable_info *info;
623
624 switch (args->event) {
625 case NB_EV_VALIDATE:
626 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
627 if (static_nexthop_create(args, rn_dnode, NULL) != NB_OK)
628 return NB_ERR_VALIDATION;
629 break;
630 case NB_EV_PREPARE:
631 case NB_EV_ABORT:
632 break;
633 case NB_EV_APPLY:
634 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
635 rn = nb_running_get_entry(rn_dnode, NULL, true);
636 info = route_table_get_info(rn->table);
637
638 if (static_nexthop_create(args, rn_dnode, info) != NB_OK)
639 return NB_ERR_VALIDATION;
640 break;
641 }
642 return NB_OK;
643 }
644
645 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy(
646 struct nb_cb_destroy_args *args)
647 {
648 struct route_node *rn;
649 const struct lyd_node *rn_dnode;
650 struct stable_info *info;
651
652 switch (args->event) {
653 case NB_EV_VALIDATE:
654 case NB_EV_PREPARE:
655 case NB_EV_ABORT:
656 break;
657 case NB_EV_APPLY:
658 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
659 rn = nb_running_get_entry(rn_dnode, NULL, true);
660 info = route_table_get_info(rn->table);
661
662 if (static_nexthop_destroy(args, rn_dnode, info) != NB_OK)
663 return NB_ERR;
664 break;
665 }
666 return NB_OK;
667 }
668
669 /*
670 * XPath:
671 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bh-type
672 */
673 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_modify(
674 struct nb_cb_modify_args *args)
675 {
676 switch (args->event) {
677 case NB_EV_VALIDATE:
678 case NB_EV_PREPARE:
679 case NB_EV_ABORT:
680 break;
681 case NB_EV_APPLY:
682 if (static_nexthop_bh_type_modify(args) != NB_OK)
683 return NB_ERR;
684 break;
685 }
686 return NB_OK;
687 }
688
689 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_destroy(
690 struct nb_cb_destroy_args *args)
691 {
692 /* blackhole type has a boolean type with default value,
693 * so no need to do any operations in destroy callback
694 */
695 switch (args->event) {
696 case NB_EV_VALIDATE:
697 case NB_EV_PREPARE:
698 case NB_EV_ABORT:
699 case NB_EV_APPLY:
700 break;
701 }
702 return NB_OK;
703 }
704
705 /*
706 * XPath:
707 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/onlink
708 */
709 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify(
710 struct nb_cb_modify_args *args)
711 {
712 switch (args->event) {
713 case NB_EV_VALIDATE:
714 case NB_EV_PREPARE:
715 case NB_EV_ABORT:
716 break;
717 case NB_EV_APPLY:
718 if (static_nexthop_onlink_modify(args) != NB_OK)
719 return NB_ERR;
720
721 break;
722 }
723 return NB_OK;
724 }
725 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_destroy(
726 struct nb_cb_destroy_args *args)
727 {
728 /* onlink has a boolean type with default value,
729 * so no need to do any operations in destroy callback
730 */
731 switch (args->event) {
732 case NB_EV_VALIDATE:
733 case NB_EV_PREPARE:
734 case NB_EV_ABORT:
735 case NB_EV_APPLY:
736 break;
737 }
738 return NB_OK;
739 }
740
741 /*
742 * XPath:
743 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/srte-color
744 */
745 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify(
746 struct nb_cb_modify_args *args)
747 {
748 switch (args->event) {
749 case NB_EV_VALIDATE:
750 case NB_EV_PREPARE:
751 case NB_EV_ABORT:
752 break;
753 case NB_EV_APPLY:
754 if (static_nexthop_color_modify(args) != NB_OK)
755 return NB_ERR;
756
757 break;
758 }
759 return NB_OK;
760 }
761
762 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy(
763 struct nb_cb_destroy_args *args)
764 {
765 switch (args->event) {
766 case NB_EV_VALIDATE:
767 case NB_EV_PREPARE:
768 case NB_EV_ABORT:
769 break;
770 case NB_EV_APPLY:
771 if (static_nexthop_color_destroy(args) != NB_OK)
772 return NB_ERR;
773 break;
774 }
775 return NB_OK;
776 }
777
778 /*
779 * XPath:
780 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry
781 */
782 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
783 struct nb_cb_create_args *args)
784 {
785 return nexthop_mpls_label_stack_entry_create(args);
786 }
787
788 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
789 struct nb_cb_destroy_args *args)
790 {
791 return nexthop_mpls_label_stack_entry_destroy(args);
792 }
793
794 /*
795 * XPath:
796 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/label
797 */
798 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
799 struct nb_cb_modify_args *args)
800 {
801 switch (args->event) {
802 case NB_EV_VALIDATE:
803 case NB_EV_PREPARE:
804 case NB_EV_ABORT:
805 break;
806 case NB_EV_APPLY:
807 if (static_nexthop_mpls_label_modify(args) != NB_OK)
808 return NB_ERR;
809 break;
810 }
811 return NB_OK;
812 }
813
814 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
815 struct nb_cb_destroy_args *args)
816 {
817 /*
818 * No operation is required in this call back.
819 * nexthop_mpls_label_stack_entry_destroy() will take care
820 * to reset the label vaue.
821 */
822 switch (args->event) {
823 case NB_EV_VALIDATE:
824 case NB_EV_PREPARE:
825 case NB_EV_ABORT:
826 case NB_EV_APPLY:
827 break;
828 }
829 return NB_OK;
830 }
831
832 /*
833 * XPath:
834 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/ttl
835 */
836 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
837 struct nb_cb_modify_args *args)
838 {
839 switch (args->event) {
840 case NB_EV_VALIDATE:
841 case NB_EV_PREPARE:
842 case NB_EV_ABORT:
843 case NB_EV_APPLY:
844 break;
845 }
846
847 return NB_OK;
848 }
849
850 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
851 struct nb_cb_destroy_args *args)
852 {
853 switch (args->event) {
854 case NB_EV_VALIDATE:
855 case NB_EV_PREPARE:
856 case NB_EV_ABORT:
857 case NB_EV_APPLY:
858 break;
859 }
860
861 return NB_OK;
862 }
863
864 /*
865 * XPath:
866 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/traffic-class
867 */
868 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
869 struct nb_cb_modify_args *args)
870 {
871 switch (args->event) {
872 case NB_EV_VALIDATE:
873 case NB_EV_PREPARE:
874 case NB_EV_ABORT:
875 case NB_EV_APPLY:
876 break;
877 }
878
879 return NB_OK;
880 }
881
882 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
883 struct nb_cb_destroy_args *args)
884 {
885 switch (args->event) {
886 case NB_EV_VALIDATE:
887 case NB_EV_PREPARE:
888 case NB_EV_ABORT:
889 case NB_EV_APPLY:
890 break;
891 }
892
893 return NB_OK;
894 }
895
896 /*
897 * XPath:
898 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list
899 */
900 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create(
901 struct nb_cb_create_args *args)
902 {
903 struct static_vrf *s_vrf;
904 struct route_node *rn;
905 struct route_node *src_rn;
906 struct prefix_ipv6 src_prefix = {};
907 struct stable_info *info;
908 afi_t afi;
909 safi_t safi = SAFI_UNICAST;
910
911 switch (args->event) {
912 case NB_EV_VALIDATE:
913 case NB_EV_PREPARE:
914 case NB_EV_ABORT:
915 break;
916 case NB_EV_APPLY:
917 rn = nb_running_get_entry(args->dnode, NULL, true);
918 info = route_table_get_info(rn->table);
919 s_vrf = info->svrf;
920 yang_dnode_get_ipv6p(&src_prefix, args->dnode, "./src-prefix");
921 afi = family2afi(src_prefix.family);
922 src_rn =
923 static_add_route(afi, safi, &rn->p, &src_prefix, s_vrf);
924 if (!src_rn) {
925 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
926 "src rn %s creation failed",
927 yang_dnode_get_string(args->dnode,
928 "./src-prefix"));
929 return NB_ERR;
930 }
931 nb_running_set_entry(args->dnode, src_rn);
932 break;
933 }
934 return NB_OK;
935 }
936
937 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy(
938 struct nb_cb_destroy_args *args)
939 {
940 struct route_node *src_rn;
941 struct route_node *rn;
942 struct stable_info *info;
943 const struct lyd_node *rn_dnode;
944
945 switch (args->event) {
946 case NB_EV_VALIDATE:
947 case NB_EV_PREPARE:
948 case NB_EV_ABORT:
949 break;
950 case NB_EV_APPLY:
951 src_rn = nb_running_unset_entry(args->dnode);
952 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
953 rn = nb_running_get_entry(rn_dnode, NULL, true);
954 info = route_table_get_info(rn->table);
955 static_del_route(src_rn, info->safi, info->svrf);
956 break;
957 }
958
959 return NB_OK;
960 }
961
962 /*
963 * XPath:
964 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list
965 */
966 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create(
967 struct nb_cb_create_args *args)
968 {
969 return static_path_list_create(args);
970 }
971
972 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy(
973 struct nb_cb_destroy_args *args)
974 {
975 struct route_node *rn;
976 const struct lyd_node *rn_dnode;
977 const struct lyd_node *srn_dnode;
978 struct stable_info *info;
979
980 switch (args->event) {
981 case NB_EV_VALIDATE:
982 case NB_EV_PREPARE:
983 case NB_EV_ABORT:
984 break;
985 case NB_EV_APPLY:
986 srn_dnode = yang_dnode_get_parent(args->dnode, "src-list");
987 rn_dnode = yang_dnode_get_parent(srn_dnode, "route-list");
988 rn = nb_running_get_entry(rn_dnode, NULL, true);
989 info = route_table_get_info(rn->table);
990 static_path_list_destroy(args, srn_dnode, info);
991 break;
992 }
993 return NB_OK;
994 }
995
996 /*
997 * XPath:
998 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/tag
999 */
1000 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify(
1001 struct nb_cb_modify_args *args)
1002 {
1003 struct stable_info *info;
1004 struct route_node *rn;
1005 const struct lyd_node *srn_dnode;
1006 const struct lyd_node *rn_dnode;
1007
1008 switch (args->event) {
1009 case NB_EV_VALIDATE:
1010 case NB_EV_ABORT:
1011 case NB_EV_PREPARE:
1012 break;
1013 case NB_EV_APPLY:
1014 srn_dnode = yang_dnode_get_parent(args->dnode, "src-list");
1015 rn_dnode = yang_dnode_get_parent(srn_dnode, "route-list");
1016 rn = nb_running_get_entry(rn_dnode, NULL, true);
1017 info = route_table_get_info(rn->table);
1018 static_path_list_tag_modify(args, srn_dnode, info);
1019 break;
1020 }
1021 return NB_OK;
1022 }
1023
1024 /*
1025 * XPath:
1026 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/table-id
1027 */
1028 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_table_id_modify(
1029 struct nb_cb_modify_args *args)
1030 {
1031 struct route_node *rn;
1032 const struct lyd_node *rn_dnode;
1033 const struct lyd_node *src_dnode;
1034 struct stable_info *info;
1035
1036 switch (args->event) {
1037 case NB_EV_VALIDATE:
1038 if (static_path_list_tableid_modify(args, NULL, NULL) != NB_OK)
1039 return NB_ERR_VALIDATION;
1040 break;
1041 case NB_EV_PREPARE:
1042 case NB_EV_ABORT:
1043 break;
1044 case NB_EV_APPLY:
1045 src_dnode = yang_dnode_get_parent(args->dnode, "src-list");
1046 rn_dnode = yang_dnode_get_parent(src_dnode, "route-list");
1047 rn = nb_running_get_entry(rn_dnode, NULL, true);
1048 info = route_table_get_info(rn->table);
1049
1050 if (static_path_list_tableid_modify(args, src_dnode, info)
1051 != NB_OK)
1052 return NB_ERR_VALIDATION;
1053
1054 break;
1055 }
1056 return NB_OK;
1057 }
1058
1059 /*
1060 * XPath:
1061 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop
1062 */
1063 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create(
1064 struct nb_cb_create_args *args)
1065 {
1066 struct route_node *rn;
1067 const struct lyd_node *rn_dnode;
1068 const struct lyd_node *src_dnode;
1069 struct stable_info *info;
1070
1071 switch (args->event) {
1072 case NB_EV_VALIDATE:
1073 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
1074 if (static_nexthop_create(args, rn_dnode, NULL) != NB_OK)
1075 return NB_ERR_VALIDATION;
1076 break;
1077 case NB_EV_PREPARE:
1078 case NB_EV_ABORT:
1079 break;
1080 case NB_EV_APPLY:
1081 src_dnode = yang_dnode_get_parent(args->dnode, "src-list");
1082 rn_dnode = yang_dnode_get_parent(src_dnode, "route-list");
1083 rn = nb_running_get_entry(rn_dnode, NULL, true);
1084 info = route_table_get_info(rn->table);
1085
1086 if (static_nexthop_create(args, src_dnode, info) != NB_OK)
1087 return NB_ERR_VALIDATION;
1088
1089 break;
1090 }
1091 return NB_OK;
1092 }
1093
1094 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy(
1095 struct nb_cb_destroy_args *args)
1096 {
1097 struct route_node *rn;
1098 const struct lyd_node *rn_dnode;
1099 const struct lyd_node *src_dnode;
1100 struct stable_info *info;
1101
1102 switch (args->event) {
1103 case NB_EV_VALIDATE:
1104 case NB_EV_PREPARE:
1105 case NB_EV_ABORT:
1106 break;
1107 case NB_EV_APPLY:
1108 src_dnode = yang_dnode_get_parent(args->dnode, "src-list");
1109 rn_dnode = yang_dnode_get_parent(src_dnode, "route-list");
1110 rn = nb_running_get_entry(rn_dnode, NULL, true);
1111 info = route_table_get_info(rn->table);
1112
1113 if (static_nexthop_destroy(args, rn_dnode, info) != NB_OK)
1114 return NB_ERR;
1115 break;
1116 }
1117 return NB_OK;
1118 }
1119
1120 /*
1121 * XPath:
1122 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/bh-type
1123 */
1124 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify(
1125 struct nb_cb_modify_args *args)
1126 {
1127 switch (args->event) {
1128 case NB_EV_VALIDATE:
1129 case NB_EV_PREPARE:
1130 case NB_EV_ABORT:
1131 break;
1132 case NB_EV_APPLY:
1133 if (static_nexthop_bh_type_modify(args) != NB_OK)
1134 return NB_ERR;
1135 break;
1136 }
1137 return NB_OK;
1138 }
1139
1140 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_destroy(
1141 struct nb_cb_destroy_args *args)
1142 {
1143 /* blackhole type has a boolean type with default value,
1144 * so no need to do any operations in destroy callback
1145 */
1146 switch (args->event) {
1147 case NB_EV_VALIDATE:
1148 case NB_EV_PREPARE:
1149 case NB_EV_ABORT:
1150 case NB_EV_APPLY:
1151 break;
1152 }
1153
1154 return NB_OK;
1155 }
1156
1157 /*
1158 * XPath:
1159 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/onlink
1160 */
1161 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify(
1162 struct nb_cb_modify_args *args)
1163 {
1164 switch (args->event) {
1165 case NB_EV_VALIDATE:
1166 case NB_EV_PREPARE:
1167 case NB_EV_ABORT:
1168 break;
1169 case NB_EV_APPLY:
1170 if (static_nexthop_onlink_modify(args) != NB_OK)
1171 return NB_ERR;
1172
1173 break;
1174 }
1175 return NB_OK;
1176 }
1177
1178
1179 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_destroy(
1180 struct nb_cb_destroy_args *args)
1181 {
1182 /* onlink has a boolean type with default value,
1183 * so no need to do any operations in destroy callback
1184 */
1185 switch (args->event) {
1186 case NB_EV_VALIDATE:
1187 case NB_EV_PREPARE:
1188 case NB_EV_ABORT:
1189 case NB_EV_APPLY:
1190 break;
1191 }
1192 return NB_OK;
1193 }
1194
1195 /*
1196 * XPath:
1197 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/srte-color
1198 */
1199 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify(
1200 struct nb_cb_modify_args *args)
1201 {
1202 switch (args->event) {
1203 case NB_EV_VALIDATE:
1204 case NB_EV_PREPARE:
1205 case NB_EV_ABORT:
1206 break;
1207 case NB_EV_APPLY:
1208 if (static_nexthop_color_modify(args) != NB_OK)
1209 return NB_ERR;
1210
1211 break;
1212 }
1213 return NB_OK;
1214 }
1215
1216
1217 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy(
1218 struct nb_cb_destroy_args *args)
1219 {
1220 switch (args->event) {
1221 case NB_EV_VALIDATE:
1222 case NB_EV_PREPARE:
1223 case NB_EV_ABORT:
1224 break;
1225 case NB_EV_APPLY:
1226 if (static_nexthop_color_destroy(args) != NB_OK)
1227 return NB_ERR;
1228 break;
1229 }
1230 return NB_OK;
1231 }
1232
1233 /*
1234 * XPath:
1235 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry
1236 */
1237 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
1238 struct nb_cb_create_args *args)
1239 {
1240 return nexthop_mpls_label_stack_entry_create(args);
1241 }
1242
1243 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
1244 struct nb_cb_destroy_args *args)
1245 {
1246 return nexthop_mpls_label_stack_entry_destroy(args);
1247 }
1248
1249 /*
1250 * XPath:
1251 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/label
1252 */
1253 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
1254 struct nb_cb_modify_args *args)
1255 {
1256 switch (args->event) {
1257 case NB_EV_VALIDATE:
1258 case NB_EV_PREPARE:
1259 case NB_EV_ABORT:
1260 break;
1261 case NB_EV_APPLY:
1262 if (static_nexthop_mpls_label_modify(args) != NB_OK)
1263 return NB_ERR;
1264 break;
1265 }
1266 return NB_OK;
1267 }
1268
1269 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
1270 struct nb_cb_destroy_args *args)
1271 {
1272 /*
1273 * No operation is required in this call back.
1274 * nexthop_mpls_label_stack_entry_destroy() will take care
1275 * to reset the label vaue.
1276 */
1277 switch (args->event) {
1278 case NB_EV_VALIDATE:
1279 case NB_EV_PREPARE:
1280 case NB_EV_ABORT:
1281 case NB_EV_APPLY:
1282 break;
1283 }
1284 return NB_OK;
1285 }
1286
1287 /*
1288 * XPath:
1289 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/ttl
1290 */
1291 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
1292 struct nb_cb_modify_args *args)
1293 {
1294 switch (args->event) {
1295 case NB_EV_VALIDATE:
1296 case NB_EV_PREPARE:
1297 case NB_EV_ABORT:
1298 case NB_EV_APPLY:
1299 break;
1300 }
1301
1302 return NB_OK;
1303 }
1304
1305 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
1306 struct nb_cb_destroy_args *args)
1307 {
1308 switch (args->event) {
1309 case NB_EV_VALIDATE:
1310 case NB_EV_PREPARE:
1311 case NB_EV_ABORT:
1312 case NB_EV_APPLY:
1313 break;
1314 }
1315
1316 return NB_OK;
1317 }
1318
1319 /*
1320 * XPath:
1321 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/traffic-class
1322 */
1323 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
1324 struct nb_cb_modify_args *args)
1325 {
1326 switch (args->event) {
1327 case NB_EV_VALIDATE:
1328 case NB_EV_PREPARE:
1329 case NB_EV_ABORT:
1330 case NB_EV_APPLY:
1331 break;
1332 }
1333
1334 return NB_OK;
1335 }
1336
1337 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
1338 struct nb_cb_destroy_args *args)
1339 {
1340 switch (args->event) {
1341 case NB_EV_VALIDATE:
1342 case NB_EV_PREPARE:
1343 case NB_EV_ABORT:
1344 case NB_EV_APPLY:
1345 break;
1346 }
1347
1348 return NB_OK;
1349 }