]> git.proxmox.com Git - mirror_frr.git/blob - staticd/static_nb_config.c
Merge pull request #6889 from opensourcerouting/isisd-assorted-fixes
[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 case NB_EV_PREPARE:
226 case NB_EV_ABORT:
227 break;
228 case NB_EV_APPLY:
229 nh = nb_running_get_entry(args->dnode, NULL, true);
230 pos = yang_get_list_pos(args->dnode);
231 if (!pos) {
232 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
233 "libyang returns invalid label position");
234 return NB_ERR;
235 }
236 /* Mapping to array = list-index -1 */
237 index = pos - 1;
238 nh->snh_label.label[index] = 0;
239 nh->snh_label.num_labels++;
240 break;
241 }
242
243 return NB_OK;
244 }
245
246 static int
247 nexthop_mpls_label_stack_entry_destroy(struct nb_cb_destroy_args *args)
248 {
249 struct static_nexthop *nh;
250 uint32_t pos;
251 uint8_t index;
252
253 switch (args->event) {
254 case NB_EV_VALIDATE:
255 case NB_EV_PREPARE:
256 case NB_EV_ABORT:
257 break;
258 case NB_EV_APPLY:
259 nh = nb_running_get_entry(args->dnode, NULL, true);
260 pos = yang_get_list_pos(args->dnode);
261 if (!pos) {
262 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
263 "libyang returns invalid label position");
264 return NB_ERR;
265 }
266 index = pos - 1;
267 nh->snh_label.label[index] = 0;
268 nh->snh_label.num_labels--;
269 break;
270 }
271
272 return NB_OK;
273 }
274
275 static int static_nexthop_mpls_label_modify(struct nb_cb_modify_args *args)
276 {
277 struct static_nexthop *nh;
278 uint32_t pos;
279 uint8_t index;
280
281 nh = nb_running_get_entry(args->dnode, NULL, true);
282 pos = yang_get_list_pos(args->dnode->parent);
283 if (!pos) {
284 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
285 "libyang returns invalid label position");
286 return NB_ERR;
287 }
288 /* Mapping to array = list-index -1 */
289 index = pos - 1;
290 nh->snh_label.label[index] = yang_dnode_get_uint32(args->dnode, NULL);
291
292 return NB_OK;
293 }
294
295 static int static_nexthop_onlink_modify(struct nb_cb_modify_args *args)
296 {
297 struct static_nexthop *nh;
298
299 nh = nb_running_get_entry(args->dnode, NULL, true);
300 nh->onlink = yang_dnode_get_bool(args->dnode, NULL);
301
302 return NB_OK;
303 }
304
305 static int static_nexthop_color_modify(struct nb_cb_modify_args *args)
306 {
307 struct static_nexthop *nh;
308
309 nh = nb_running_get_entry(args->dnode, NULL, true);
310 nh->color = yang_dnode_get_uint32(args->dnode, NULL);
311
312 return NB_OK;
313 }
314
315 static int static_nexthop_color_destroy(struct nb_cb_destroy_args *args)
316 {
317 struct static_nexthop *nh;
318
319 nh = nb_running_unset_entry(args->dnode);
320 nh->color = 0;
321
322 return NB_OK;
323 }
324
325 static int static_nexthop_bh_type_modify(struct nb_cb_modify_args *args)
326 {
327 struct static_nexthop *nh;
328
329 nh = nb_running_get_entry(args->dnode, NULL, true);
330 nh->bh_type = yang_dnode_get_enum(args->dnode, NULL);
331
332 return NB_OK;
333 }
334
335
336 void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish(
337 struct nb_cb_apply_finish_args *args)
338 {
339 struct static_nexthop *nh;
340 struct static_path *pn;
341 struct route_node *rn;
342 const struct lyd_node *pn_dnode;
343 const struct lyd_node *rn_dnode;
344 const char *ifname;
345 const char *nh_vrf;
346 struct stable_info *info;
347 int nh_type;
348
349 nh_type = yang_dnode_get_enum(args->dnode, "./nh-type");
350 ifname = yang_dnode_get_string(args->dnode, "./interface");
351 nh_vrf = yang_dnode_get_string(args->dnode, "./vrf");
352
353 nh = nb_running_get_entry(args->dnode, NULL, true);
354
355 pn_dnode = yang_dnode_get_parent(args->dnode, "path-list");
356 pn = nb_running_get_entry(pn_dnode, NULL, true);
357
358 rn_dnode = yang_dnode_get_parent(pn_dnode, "route-list");
359 rn = nb_running_get_entry(rn_dnode, NULL, true);
360 info = route_table_get_info(rn->table);
361
362 static_install_nexthop(rn, pn, nh, info->safi, info->svrf, ifname,
363 nh_type, nh_vrf);
364 }
365
366
367 void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish(
368 struct nb_cb_apply_finish_args *args)
369 {
370 struct static_nexthop *nh;
371 struct static_path *pn;
372 struct route_node *rn;
373 struct route_node *src_rn;
374 const struct lyd_node *pn_dnode;
375 const struct lyd_node *rn_dnode;
376 const struct lyd_node *src_dnode;
377 const char *ifname;
378 const char *nh_vrf;
379 struct stable_info *info;
380 int nh_type;
381
382 nh_type = yang_dnode_get_enum(args->dnode, "./nh-type");
383 ifname = yang_dnode_get_string(args->dnode, "./interface");
384 nh_vrf = yang_dnode_get_string(args->dnode, "./vrf");
385
386 nh = nb_running_get_entry(args->dnode, NULL, true);
387
388 pn_dnode = yang_dnode_get_parent(args->dnode, "path-list");
389 pn = nb_running_get_entry(pn_dnode, NULL, true);
390
391 src_dnode = yang_dnode_get_parent(pn_dnode, "src-list");
392 src_rn = nb_running_get_entry(src_dnode, NULL, true);
393
394 rn_dnode = yang_dnode_get_parent(src_dnode, "route-list");
395 rn = nb_running_get_entry(rn_dnode, NULL, true);
396 info = route_table_get_info(rn->table);
397
398 static_install_nexthop(src_rn, pn, nh, info->safi, info->svrf, ifname,
399 nh_type, nh_vrf);
400 }
401 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate(
402 struct nb_cb_pre_validate_args *args)
403 {
404 const struct lyd_node *mls_dnode;
405 uint32_t count;
406
407 mls_dnode = yang_dnode_get(args->dnode, "./mpls-label-stack");
408 count = yang_get_list_elements_count(yang_dnode_get_child(mls_dnode));
409
410 if (count > MPLS_MAX_LABELS) {
411 snprintf(args->errmsg, args->errmsg_len,
412 "Too many labels, Enter %d or fewer",
413 MPLS_MAX_LABELS);
414 return NB_ERR_VALIDATION;
415 }
416 return NB_OK;
417 }
418
419 int routing_control_plane_protocols_name_validate(
420 struct nb_cb_create_args *args)
421 {
422 const char *name;
423
424 name = yang_dnode_get_string(args->dnode, "./name");
425 if (!strmatch(name, "staticd")) {
426 snprintf(args->errmsg, args->errmsg_len,
427 "static routing supports only one instance with name staticd");
428 return NB_ERR_VALIDATION;
429 }
430 return NB_OK;
431 }
432 /*
433 * XPath:
434 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list
435 */
436 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create(
437 struct nb_cb_create_args *args)
438 {
439 struct vrf *vrf;
440 struct static_vrf *s_vrf;
441 struct route_node *rn;
442 const struct lyd_node *vrf_dnode;
443 struct prefix prefix;
444 const char *afi_safi;
445 afi_t prefix_afi;
446 afi_t afi;
447 safi_t safi;
448
449 switch (args->event) {
450 case NB_EV_VALIDATE:
451 yang_dnode_get_prefix(&prefix, args->dnode, "./prefix");
452 afi_safi = yang_dnode_get_string(args->dnode, "./afi-safi");
453 yang_afi_safi_identity2value(afi_safi, &afi, &safi);
454 prefix_afi = family2afi(prefix.family);
455 if (afi != prefix_afi) {
456 flog_warn(
457 EC_LIB_NB_CB_CONFIG_VALIDATE,
458 "route node %s creation failed",
459 yang_dnode_get_string(args->dnode, "./prefix"));
460 return NB_ERR_VALIDATION;
461 }
462 break;
463 case NB_EV_PREPARE:
464 case NB_EV_ABORT:
465 break;
466 case NB_EV_APPLY:
467 vrf_dnode = yang_dnode_get_parent(args->dnode,
468 "control-plane-protocol");
469 vrf = nb_running_get_entry(vrf_dnode, NULL, true);
470 s_vrf = vrf->info;
471
472 yang_dnode_get_prefix(&prefix, args->dnode, "./prefix");
473 afi_safi = yang_dnode_get_string(args->dnode, "./afi-safi");
474 yang_afi_safi_identity2value(afi_safi, &afi, &safi);
475
476 rn = static_add_route(afi, safi, &prefix, NULL, s_vrf);
477 if (!rn) {
478 flog_warn(
479 EC_LIB_NB_CB_CONFIG_APPLY,
480 "route node %s creation failed",
481 yang_dnode_get_string(args->dnode, "./prefix"));
482 return NB_ERR;
483 }
484 nb_running_set_entry(args->dnode, rn);
485 break;
486 }
487 return NB_OK;
488 }
489
490 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy(
491 struct nb_cb_destroy_args *args)
492 {
493 struct route_node *rn;
494 struct stable_info *info;
495
496 switch (args->event) {
497 case NB_EV_VALIDATE:
498 case NB_EV_PREPARE:
499 case NB_EV_ABORT:
500 break;
501 case NB_EV_APPLY:
502 rn = nb_running_unset_entry(args->dnode);
503 info = route_table_get_info(rn->table);
504 static_del_route(rn, info->safi, info->svrf);
505 break;
506 }
507 return NB_OK;
508 }
509
510 /*
511 * XPath:
512 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list
513 */
514 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create(
515 struct nb_cb_create_args *args)
516 {
517 return static_path_list_create(args);
518 }
519
520 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy(
521 struct nb_cb_destroy_args *args)
522 {
523 const struct lyd_node *rn_dnode;
524 struct route_node *rn;
525 struct stable_info *info;
526
527 switch (args->event) {
528 case NB_EV_VALIDATE:
529 case NB_EV_PREPARE:
530 case NB_EV_ABORT:
531 break;
532 case NB_EV_APPLY:
533 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
534 rn = nb_running_get_entry(rn_dnode, NULL, true);
535 info = route_table_get_info(rn->table);
536 static_path_list_destroy(args, rn_dnode, info);
537 break;
538 }
539 return NB_OK;
540 }
541
542 /*
543 * XPath:
544 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/tag
545 */
546 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify(
547 struct nb_cb_modify_args *args)
548 {
549 struct stable_info *info;
550 struct route_node *rn;
551 const struct lyd_node *rn_dnode;
552
553 switch (args->event) {
554 case NB_EV_VALIDATE:
555 case NB_EV_ABORT:
556 case NB_EV_PREPARE:
557 break;
558 case NB_EV_APPLY:
559 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
560 rn = nb_running_get_entry(rn_dnode, NULL, true);
561 info = route_table_get_info(rn->table);
562 static_path_list_tag_modify(args, rn_dnode, info);
563 break;
564 }
565
566 return NB_OK;
567 }
568
569 /*
570 * XPath:
571 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/table-id
572 */
573 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_table_id_modify(
574 struct nb_cb_modify_args *args)
575 {
576 struct route_node *rn;
577 const struct lyd_node *rn_dnode;
578 struct stable_info *info;
579
580 switch (args->event) {
581 case NB_EV_VALIDATE:
582 if (static_path_list_tableid_modify(args, NULL, NULL) != NB_OK)
583 return NB_ERR_VALIDATION;
584 break;
585 case NB_EV_PREPARE:
586 case NB_EV_ABORT:
587 break;
588 case NB_EV_APPLY:
589 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
590 rn = nb_running_get_entry(rn_dnode, NULL, true);
591 info = route_table_get_info(rn->table);
592
593 if (static_path_list_tableid_modify(args, rn_dnode, info)
594 != NB_OK)
595 return NB_ERR_VALIDATION;
596 break;
597 }
598 return NB_OK;
599 }
600
601 /*
602 * XPath:
603 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop
604 */
605 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create(
606 struct nb_cb_create_args *args)
607 {
608 struct route_node *rn;
609 const struct lyd_node *rn_dnode;
610 struct stable_info *info;
611
612 switch (args->event) {
613 case NB_EV_VALIDATE:
614 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
615 if (static_nexthop_create(args, rn_dnode, NULL) != NB_OK)
616 return NB_ERR_VALIDATION;
617 break;
618 case NB_EV_PREPARE:
619 case NB_EV_ABORT:
620 break;
621 case NB_EV_APPLY:
622 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
623 rn = nb_running_get_entry(rn_dnode, NULL, true);
624 info = route_table_get_info(rn->table);
625
626 if (static_nexthop_create(args, rn_dnode, info) != NB_OK)
627 return NB_ERR_VALIDATION;
628 break;
629 }
630 return NB_OK;
631 }
632
633 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy(
634 struct nb_cb_destroy_args *args)
635 {
636 struct route_node *rn;
637 const struct lyd_node *rn_dnode;
638 struct stable_info *info;
639
640 switch (args->event) {
641 case NB_EV_VALIDATE:
642 case NB_EV_PREPARE:
643 case NB_EV_ABORT:
644 break;
645 case NB_EV_APPLY:
646 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
647 rn = nb_running_get_entry(rn_dnode, NULL, true);
648 info = route_table_get_info(rn->table);
649
650 if (static_nexthop_destroy(args, rn_dnode, info) != NB_OK)
651 return NB_ERR;
652 break;
653 }
654 return NB_OK;
655 }
656
657 /*
658 * XPath:
659 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bh-type
660 */
661 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_modify(
662 struct nb_cb_modify_args *args)
663 {
664 switch (args->event) {
665 case NB_EV_VALIDATE:
666 case NB_EV_PREPARE:
667 case NB_EV_ABORT:
668 break;
669 case NB_EV_APPLY:
670 if (static_nexthop_bh_type_modify(args) != NB_OK)
671 return NB_ERR;
672 break;
673 }
674 return NB_OK;
675 }
676
677 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_destroy(
678 struct nb_cb_destroy_args *args)
679 {
680 /* blackhole type has a boolean type with default value,
681 * so no need to do any operations in destroy callback
682 */
683 switch (args->event) {
684 case NB_EV_VALIDATE:
685 case NB_EV_PREPARE:
686 case NB_EV_ABORT:
687 case NB_EV_APPLY:
688 break;
689 }
690 return NB_OK;
691 }
692
693 /*
694 * XPath:
695 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/onlink
696 */
697 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify(
698 struct nb_cb_modify_args *args)
699 {
700 switch (args->event) {
701 case NB_EV_VALIDATE:
702 case NB_EV_PREPARE:
703 case NB_EV_ABORT:
704 break;
705 case NB_EV_APPLY:
706 if (static_nexthop_onlink_modify(args) != NB_OK)
707 return NB_ERR;
708
709 break;
710 }
711 return NB_OK;
712 }
713 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_destroy(
714 struct nb_cb_destroy_args *args)
715 {
716 /* onlink has a boolean type with default value,
717 * so no need to do any operations in destroy callback
718 */
719 switch (args->event) {
720 case NB_EV_VALIDATE:
721 case NB_EV_PREPARE:
722 case NB_EV_ABORT:
723 case NB_EV_APPLY:
724 break;
725 }
726 return NB_OK;
727 }
728
729 /*
730 * XPath:
731 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/srte-color
732 */
733 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify(
734 struct nb_cb_modify_args *args)
735 {
736 switch (args->event) {
737 case NB_EV_VALIDATE:
738 case NB_EV_PREPARE:
739 case NB_EV_ABORT:
740 break;
741 case NB_EV_APPLY:
742 if (static_nexthop_color_modify(args) != NB_OK)
743 return NB_ERR;
744
745 break;
746 }
747 return NB_OK;
748 }
749
750 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy(
751 struct nb_cb_destroy_args *args)
752 {
753 switch (args->event) {
754 case NB_EV_VALIDATE:
755 case NB_EV_PREPARE:
756 case NB_EV_ABORT:
757 break;
758 case NB_EV_APPLY:
759 if (static_nexthop_color_destroy(args) != NB_OK)
760 return NB_ERR;
761 break;
762 }
763 return NB_OK;
764 }
765
766 /*
767 * XPath:
768 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry
769 */
770 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
771 struct nb_cb_create_args *args)
772 {
773 return nexthop_mpls_label_stack_entry_create(args);
774 }
775
776 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
777 struct nb_cb_destroy_args *args)
778 {
779 return nexthop_mpls_label_stack_entry_destroy(args);
780 }
781
782 /*
783 * XPath:
784 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/label
785 */
786 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
787 struct nb_cb_modify_args *args)
788 {
789 switch (args->event) {
790 case NB_EV_VALIDATE:
791 case NB_EV_PREPARE:
792 case NB_EV_ABORT:
793 break;
794 case NB_EV_APPLY:
795 if (static_nexthop_mpls_label_modify(args) != NB_OK)
796 return NB_ERR;
797 break;
798 }
799 return NB_OK;
800 }
801
802 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
803 struct nb_cb_destroy_args *args)
804 {
805 /*
806 * No operation is required in this call back.
807 * nexthop_mpls_label_stack_entry_destroy() will take care
808 * to reset the label vaue.
809 */
810 switch (args->event) {
811 case NB_EV_VALIDATE:
812 case NB_EV_PREPARE:
813 case NB_EV_ABORT:
814 case NB_EV_APPLY:
815 break;
816 }
817 return NB_OK;
818 }
819
820 /*
821 * XPath:
822 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/ttl
823 */
824 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
825 struct nb_cb_modify_args *args)
826 {
827 switch (args->event) {
828 case NB_EV_VALIDATE:
829 case NB_EV_PREPARE:
830 case NB_EV_ABORT:
831 case NB_EV_APPLY:
832 break;
833 }
834
835 return NB_OK;
836 }
837
838 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
839 struct nb_cb_destroy_args *args)
840 {
841 switch (args->event) {
842 case NB_EV_VALIDATE:
843 case NB_EV_PREPARE:
844 case NB_EV_ABORT:
845 case NB_EV_APPLY:
846 break;
847 }
848
849 return NB_OK;
850 }
851
852 /*
853 * XPath:
854 * /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
855 */
856 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
857 struct nb_cb_modify_args *args)
858 {
859 switch (args->event) {
860 case NB_EV_VALIDATE:
861 case NB_EV_PREPARE:
862 case NB_EV_ABORT:
863 case NB_EV_APPLY:
864 break;
865 }
866
867 return NB_OK;
868 }
869
870 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
871 struct nb_cb_destroy_args *args)
872 {
873 switch (args->event) {
874 case NB_EV_VALIDATE:
875 case NB_EV_PREPARE:
876 case NB_EV_ABORT:
877 case NB_EV_APPLY:
878 break;
879 }
880
881 return NB_OK;
882 }
883
884 /*
885 * XPath:
886 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list
887 */
888 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create(
889 struct nb_cb_create_args *args)
890 {
891 struct static_vrf *s_vrf;
892 struct route_node *rn;
893 struct route_node *src_rn;
894 struct prefix_ipv6 src_prefix = {};
895 struct stable_info *info;
896 afi_t afi;
897 safi_t safi = SAFI_UNICAST;
898
899 switch (args->event) {
900 case NB_EV_VALIDATE:
901 case NB_EV_PREPARE:
902 case NB_EV_ABORT:
903 break;
904 case NB_EV_APPLY:
905 rn = nb_running_get_entry(args->dnode, NULL, true);
906 info = route_table_get_info(rn->table);
907 s_vrf = info->svrf;
908 yang_dnode_get_ipv6p(&src_prefix, args->dnode, "./src-prefix");
909 afi = family2afi(src_prefix.family);
910 src_rn =
911 static_add_route(afi, safi, &rn->p, &src_prefix, s_vrf);
912 if (!src_rn) {
913 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
914 "src rn %s creation failed",
915 yang_dnode_get_string(args->dnode,
916 "./src-prefix"));
917 return NB_ERR;
918 }
919 nb_running_set_entry(args->dnode, src_rn);
920 break;
921 }
922 return NB_OK;
923 }
924
925 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy(
926 struct nb_cb_destroy_args *args)
927 {
928 struct route_node *src_rn;
929 struct route_node *rn;
930 struct stable_info *info;
931 const struct lyd_node *rn_dnode;
932
933 switch (args->event) {
934 case NB_EV_VALIDATE:
935 case NB_EV_PREPARE:
936 case NB_EV_ABORT:
937 break;
938 case NB_EV_APPLY:
939 src_rn = nb_running_unset_entry(args->dnode);
940 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
941 rn = nb_running_get_entry(rn_dnode, NULL, true);
942 info = route_table_get_info(rn->table);
943 static_del_route(src_rn, info->safi, info->svrf);
944 break;
945 }
946
947 return NB_OK;
948 }
949
950 /*
951 * XPath:
952 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list
953 */
954 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create(
955 struct nb_cb_create_args *args)
956 {
957 return static_path_list_create(args);
958 }
959
960 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy(
961 struct nb_cb_destroy_args *args)
962 {
963 struct route_node *rn;
964 const struct lyd_node *rn_dnode;
965 const struct lyd_node *srn_dnode;
966 struct stable_info *info;
967
968 switch (args->event) {
969 case NB_EV_VALIDATE:
970 case NB_EV_PREPARE:
971 case NB_EV_ABORT:
972 break;
973 case NB_EV_APPLY:
974 srn_dnode = yang_dnode_get_parent(args->dnode, "src-list");
975 rn_dnode = yang_dnode_get_parent(srn_dnode, "route-list");
976 rn = nb_running_get_entry(rn_dnode, NULL, true);
977 info = route_table_get_info(rn->table);
978 static_path_list_destroy(args, srn_dnode, info);
979 break;
980 }
981 return NB_OK;
982 }
983
984 /*
985 * XPath:
986 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/tag
987 */
988 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify(
989 struct nb_cb_modify_args *args)
990 {
991 struct stable_info *info;
992 struct route_node *rn;
993 const struct lyd_node *srn_dnode;
994 const struct lyd_node *rn_dnode;
995
996 switch (args->event) {
997 case NB_EV_VALIDATE:
998 case NB_EV_ABORT:
999 case NB_EV_PREPARE:
1000 break;
1001 case NB_EV_APPLY:
1002 srn_dnode = yang_dnode_get_parent(args->dnode, "src-list");
1003 rn_dnode = yang_dnode_get_parent(srn_dnode, "route-list");
1004 rn = nb_running_get_entry(rn_dnode, NULL, true);
1005 info = route_table_get_info(rn->table);
1006 static_path_list_tag_modify(args, srn_dnode, info);
1007 break;
1008 }
1009 return NB_OK;
1010 }
1011
1012 /*
1013 * XPath:
1014 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/table-id
1015 */
1016 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_table_id_modify(
1017 struct nb_cb_modify_args *args)
1018 {
1019 struct route_node *rn;
1020 const struct lyd_node *rn_dnode;
1021 const struct lyd_node *src_dnode;
1022 struct stable_info *info;
1023
1024 switch (args->event) {
1025 case NB_EV_VALIDATE:
1026 if (static_path_list_tableid_modify(args, NULL, NULL) != NB_OK)
1027 return NB_ERR_VALIDATION;
1028 break;
1029 case NB_EV_PREPARE:
1030 case NB_EV_ABORT:
1031 break;
1032 case NB_EV_APPLY:
1033 src_dnode = yang_dnode_get_parent(args->dnode, "src-list");
1034 rn_dnode = yang_dnode_get_parent(src_dnode, "route-list");
1035 rn = nb_running_get_entry(rn_dnode, NULL, true);
1036 info = route_table_get_info(rn->table);
1037
1038 if (static_path_list_tableid_modify(args, src_dnode, info)
1039 != NB_OK)
1040 return NB_ERR_VALIDATION;
1041
1042 break;
1043 }
1044 return NB_OK;
1045 }
1046
1047 /*
1048 * XPath:
1049 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop
1050 */
1051 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create(
1052 struct nb_cb_create_args *args)
1053 {
1054 struct route_node *rn;
1055 const struct lyd_node *rn_dnode;
1056 const struct lyd_node *src_dnode;
1057 struct stable_info *info;
1058
1059 switch (args->event) {
1060 case NB_EV_VALIDATE:
1061 rn_dnode = yang_dnode_get_parent(args->dnode, "route-list");
1062 if (static_nexthop_create(args, rn_dnode, NULL) != NB_OK)
1063 return NB_ERR_VALIDATION;
1064 break;
1065 case NB_EV_PREPARE:
1066 case NB_EV_ABORT:
1067 break;
1068 case NB_EV_APPLY:
1069 src_dnode = yang_dnode_get_parent(args->dnode, "src-list");
1070 rn_dnode = yang_dnode_get_parent(src_dnode, "route-list");
1071 rn = nb_running_get_entry(rn_dnode, NULL, true);
1072 info = route_table_get_info(rn->table);
1073
1074 if (static_nexthop_create(args, src_dnode, info) != NB_OK)
1075 return NB_ERR_VALIDATION;
1076
1077 break;
1078 }
1079 return NB_OK;
1080 }
1081
1082 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy(
1083 struct nb_cb_destroy_args *args)
1084 {
1085 struct route_node *rn;
1086 const struct lyd_node *rn_dnode;
1087 const struct lyd_node *src_dnode;
1088 struct stable_info *info;
1089
1090 switch (args->event) {
1091 case NB_EV_VALIDATE:
1092 case NB_EV_PREPARE:
1093 case NB_EV_ABORT:
1094 break;
1095 case NB_EV_APPLY:
1096 src_dnode = yang_dnode_get_parent(args->dnode, "src-list");
1097 rn_dnode = yang_dnode_get_parent(src_dnode, "route-list");
1098 rn = nb_running_get_entry(rn_dnode, NULL, true);
1099 info = route_table_get_info(rn->table);
1100
1101 if (static_nexthop_destroy(args, rn_dnode, info) != NB_OK)
1102 return NB_ERR;
1103 break;
1104 }
1105 return NB_OK;
1106 }
1107
1108 /*
1109 * XPath:
1110 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/bh-type
1111 */
1112 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify(
1113 struct nb_cb_modify_args *args)
1114 {
1115 switch (args->event) {
1116 case NB_EV_VALIDATE:
1117 case NB_EV_PREPARE:
1118 case NB_EV_ABORT:
1119 break;
1120 case NB_EV_APPLY:
1121 if (static_nexthop_bh_type_modify(args) != NB_OK)
1122 return NB_ERR;
1123 break;
1124 }
1125 return NB_OK;
1126 }
1127
1128 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_destroy(
1129 struct nb_cb_destroy_args *args)
1130 {
1131 /* blackhole type has a boolean type with default value,
1132 * so no need to do any operations in destroy callback
1133 */
1134 switch (args->event) {
1135 case NB_EV_VALIDATE:
1136 case NB_EV_PREPARE:
1137 case NB_EV_ABORT:
1138 case NB_EV_APPLY:
1139 break;
1140 }
1141
1142 return NB_OK;
1143 }
1144
1145 /*
1146 * XPath:
1147 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/onlink
1148 */
1149 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify(
1150 struct nb_cb_modify_args *args)
1151 {
1152 switch (args->event) {
1153 case NB_EV_VALIDATE:
1154 case NB_EV_PREPARE:
1155 case NB_EV_ABORT:
1156 break;
1157 case NB_EV_APPLY:
1158 if (static_nexthop_onlink_modify(args) != NB_OK)
1159 return NB_ERR;
1160
1161 break;
1162 }
1163 return NB_OK;
1164 }
1165
1166
1167 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_destroy(
1168 struct nb_cb_destroy_args *args)
1169 {
1170 /* onlink has a boolean type with default value,
1171 * so no need to do any operations in destroy callback
1172 */
1173 switch (args->event) {
1174 case NB_EV_VALIDATE:
1175 case NB_EV_PREPARE:
1176 case NB_EV_ABORT:
1177 case NB_EV_APPLY:
1178 break;
1179 }
1180 return NB_OK;
1181 }
1182
1183 /*
1184 * XPath:
1185 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/srte-color
1186 */
1187 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify(
1188 struct nb_cb_modify_args *args)
1189 {
1190 switch (args->event) {
1191 case NB_EV_VALIDATE:
1192 case NB_EV_PREPARE:
1193 case NB_EV_ABORT:
1194 break;
1195 case NB_EV_APPLY:
1196 if (static_nexthop_color_modify(args) != NB_OK)
1197 return NB_ERR;
1198
1199 break;
1200 }
1201 return NB_OK;
1202 }
1203
1204
1205 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy(
1206 struct nb_cb_destroy_args *args)
1207 {
1208 switch (args->event) {
1209 case NB_EV_VALIDATE:
1210 case NB_EV_PREPARE:
1211 case NB_EV_ABORT:
1212 break;
1213 case NB_EV_APPLY:
1214 if (static_nexthop_color_destroy(args) != NB_OK)
1215 return NB_ERR;
1216 break;
1217 }
1218 return NB_OK;
1219 }
1220
1221 /*
1222 * XPath:
1223 * /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
1224 */
1225 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
1226 struct nb_cb_create_args *args)
1227 {
1228 return nexthop_mpls_label_stack_entry_create(args);
1229 }
1230
1231 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
1232 struct nb_cb_destroy_args *args)
1233 {
1234 return nexthop_mpls_label_stack_entry_destroy(args);
1235 }
1236
1237 /*
1238 * XPath:
1239 * /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
1240 */
1241 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
1242 struct nb_cb_modify_args *args)
1243 {
1244 switch (args->event) {
1245 case NB_EV_VALIDATE:
1246 case NB_EV_PREPARE:
1247 case NB_EV_ABORT:
1248 break;
1249 case NB_EV_APPLY:
1250 if (static_nexthop_mpls_label_modify(args) != NB_OK)
1251 return NB_ERR;
1252 break;
1253 }
1254 return NB_OK;
1255 }
1256
1257 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
1258 struct nb_cb_destroy_args *args)
1259 {
1260 /*
1261 * No operation is required in this call back.
1262 * nexthop_mpls_label_stack_entry_destroy() will take care
1263 * to reset the label vaue.
1264 */
1265 switch (args->event) {
1266 case NB_EV_VALIDATE:
1267 case NB_EV_PREPARE:
1268 case NB_EV_ABORT:
1269 case NB_EV_APPLY:
1270 break;
1271 }
1272 return NB_OK;
1273 }
1274
1275 /*
1276 * XPath:
1277 * /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
1278 */
1279 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
1280 struct nb_cb_modify_args *args)
1281 {
1282 switch (args->event) {
1283 case NB_EV_VALIDATE:
1284 case NB_EV_PREPARE:
1285 case NB_EV_ABORT:
1286 case NB_EV_APPLY:
1287 break;
1288 }
1289
1290 return NB_OK;
1291 }
1292
1293 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
1294 struct nb_cb_destroy_args *args)
1295 {
1296 switch (args->event) {
1297 case NB_EV_VALIDATE:
1298 case NB_EV_PREPARE:
1299 case NB_EV_ABORT:
1300 case NB_EV_APPLY:
1301 break;
1302 }
1303
1304 return NB_OK;
1305 }
1306
1307 /*
1308 * XPath:
1309 * /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
1310 */
1311 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(
1312 struct nb_cb_modify_args *args)
1313 {
1314 switch (args->event) {
1315 case NB_EV_VALIDATE:
1316 case NB_EV_PREPARE:
1317 case NB_EV_ABORT:
1318 case NB_EV_APPLY:
1319 break;
1320 }
1321
1322 return NB_OK;
1323 }
1324
1325 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(
1326 struct nb_cb_destroy_args *args)
1327 {
1328 switch (args->event) {
1329 case NB_EV_VALIDATE:
1330 case NB_EV_PREPARE:
1331 case NB_EV_ABORT:
1332 case NB_EV_APPLY:
1333 break;
1334 }
1335
1336 return NB_OK;
1337 }