2 * Copyright (C) 2018 Vmware
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)
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
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
21 #include "northbound.h"
24 #include "lib_errors.h"
29 #include "srcdest_table.h"
31 #include "static_vrf.h"
32 #include "static_routes.h"
33 #include "static_nb.h"
36 static int static_path_list_create(struct nb_cb_create_args
*args
)
38 struct route_node
*rn
;
39 struct static_path
*pn
;
40 const struct lyd_node
*vrf_dnode
;
45 switch (args
->event
) {
47 vrf_dnode
= yang_dnode_get_parent(args
->dnode
,
48 "control-plane-protocol");
49 vrf
= yang_dnode_get_string(vrf_dnode
, "./vrf");
50 table_id
= yang_dnode_get_uint32(args
->dnode
, "./table-id");
53 * TableId is not applicable for VRF. Consider the case of
54 * l3mdev, there is one uint32_t space to work with.
55 * A l3mdev device points at a specific table that it
56 * relates to and a set of interfaces it belongs to.
58 if (table_id
&& (strcmp(vrf
, vrf_get_default_name()) != 0)
59 && !vrf_is_backend_netns()) {
61 args
->errmsg
, args
->errmsg_len
,
62 "%% table param only available when running on netns-based vrfs");
63 return NB_ERR_VALIDATION
;
70 rn
= nb_running_get_entry(args
->dnode
, NULL
, true);
71 distance
= yang_dnode_get_uint8(args
->dnode
, "./distance");
72 table_id
= yang_dnode_get_uint32(args
->dnode
, "./table-id");
73 pn
= static_add_path(rn
, table_id
, distance
);
74 nb_running_set_entry(args
->dnode
, pn
);
80 static int static_path_list_destroy(struct nb_cb_destroy_args
*args
)
82 struct static_path
*pn
;
84 switch (args
->event
) {
90 pn
= nb_running_unset_entry(args
->dnode
);
98 static int static_path_list_tag_modify(struct nb_cb_modify_args
*args
)
100 struct static_path
*pn
;
102 switch (args
->event
) {
108 pn
= nb_running_get_entry(args
->dnode
, NULL
, true);
109 pn
->tag
= yang_dnode_get_uint32(args
->dnode
, NULL
);
110 static_install_path(pn
);
117 struct nexthop_iter
{
122 static int nexthop_iter_cb(const struct lyd_node
*dnode
, void *arg
)
124 struct nexthop_iter
*iter
= arg
;
125 enum static_nh_type nh_type
;
127 nh_type
= yang_dnode_get_enum(dnode
, "./nh-type");
129 if (nh_type
== STATIC_BLACKHOLE
)
130 iter
->blackhole
= true;
134 return YANG_ITER_CONTINUE
;
137 static bool static_nexthop_create(struct nb_cb_create_args
*args
)
139 const struct lyd_node
*pn_dnode
;
140 struct nexthop_iter iter
;
141 struct static_path
*pn
;
142 struct ipaddr ipaddr
;
143 struct static_nexthop
*nh
;
144 enum static_nh_type nh_type
;
148 switch (args
->event
) {
150 ifname
= yang_dnode_get_string(args
->dnode
, "./interface");
151 if (ifname
!= NULL
) {
152 if (strcasecmp(ifname
, "Null0") == 0
153 || strcasecmp(ifname
, "reject") == 0
154 || strcasecmp(ifname
, "blackhole") == 0) {
155 snprintf(args
->errmsg
, args
->errmsg_len
,
156 "%s: Nexthop interface name can not be from reserved keywords(Null0, reject, blackhole)",
158 return NB_ERR_VALIDATION
;
163 iter
.blackhole
= false;
165 pn_dnode
= yang_dnode_get_parent(args
->dnode
, "path-list");
166 yang_dnode_iterate(nexthop_iter_cb
, &iter
, pn_dnode
,
167 "./frr-nexthops/nexthop");
169 if (iter
.blackhole
&& iter
.count
> 1) {
171 args
->errmsg
, args
->errmsg_len
,
172 "Route cannot have blackhole and non-blackhole nexthops simultaneously");
173 return NB_ERR_VALIDATION
;
174 } else if (iter
.count
> zebra_ecmp_count
) {
175 snprintf(args
->errmsg
, args
->errmsg_len
,
176 "Route cannot have more than %d ECMP nexthops",
178 return NB_ERR_VALIDATION
;
185 yang_dnode_get_ip(&ipaddr
, args
->dnode
, "./gateway");
186 nh_type
= yang_dnode_get_enum(args
->dnode
, "./nh-type");
187 ifname
= yang_dnode_get_string(args
->dnode
, "./interface");
188 nh_vrf
= yang_dnode_get_string(args
->dnode
, "./vrf");
189 pn
= nb_running_get_entry(args
->dnode
, NULL
, true);
191 if (!static_add_nexthop_validate(nh_vrf
, nh_type
, &ipaddr
))
193 EC_LIB_NB_CB_CONFIG_VALIDATE
,
194 "Warning!! Local connected address is configured as Gateway IP((%s))",
195 yang_dnode_get_string(args
->dnode
,
197 nh
= static_add_nexthop(pn
, nh_type
, &ipaddr
, ifname
, nh_vrf
,
199 nb_running_set_entry(args
->dnode
, nh
);
206 static bool static_nexthop_destroy(struct nb_cb_destroy_args
*args
)
208 struct static_nexthop
*nh
;
210 switch (args
->event
) {
216 nh
= nb_running_unset_entry(args
->dnode
);
217 static_delete_nexthop(nh
);
224 static int nexthop_mpls_label_stack_entry_create(struct nb_cb_create_args
*args
)
226 struct static_nexthop
*nh
;
230 switch (args
->event
) {
234 args
->errmsg
, args
->errmsg_len
,
235 "%% MPLS not turned on in kernel ignoring static route");
236 return NB_ERR_VALIDATION
;
243 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
244 pos
= yang_get_list_pos(args
->dnode
);
246 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY
,
247 "libyang returns invalid label position");
250 /* Mapping to array = list-index -1 */
252 nh
->snh_label
.label
[index
] = 0;
253 nh
->snh_label
.num_labels
++;
261 nexthop_mpls_label_stack_entry_destroy(struct nb_cb_destroy_args
*args
)
263 struct static_nexthop
*nh
;
268 switch (args
->event
) {
274 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
275 pos
= yang_get_list_pos(args
->dnode
);
277 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY
,
278 "libyang returns invalid label position");
282 old_num_labels
= nh
->snh_label
.num_labels
;
283 nh
->snh_label
.label
[index
] = 0;
284 nh
->snh_label
.num_labels
--;
286 if (old_num_labels
!= nh
->snh_label
.num_labels
)
287 nh
->state
= STATIC_START
;
294 static int static_nexthop_mpls_label_modify(struct nb_cb_modify_args
*args
)
296 struct static_nexthop
*nh
;
299 mpls_label_t old_label
;
301 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
302 pos
= yang_get_list_pos(lyd_parent(args
->dnode
));
304 flog_warn(EC_LIB_NB_CB_CONFIG_APPLY
,
305 "libyang returns invalid label position");
308 /* Mapping to array = list-index -1 */
311 old_label
= nh
->snh_label
.label
[index
];
312 nh
->snh_label
.label
[index
] = yang_dnode_get_uint32(args
->dnode
, NULL
);
314 if (old_label
!= nh
->snh_label
.label
[index
])
315 nh
->state
= STATIC_START
;
320 static int static_nexthop_onlink_modify(struct nb_cb_modify_args
*args
)
322 struct static_nexthop
*nh
;
323 enum static_nh_type nh_type
;
326 switch (args
->event
) {
328 nh_type
= yang_dnode_get_enum(args
->dnode
, "../nh-type");
329 if ((nh_type
!= STATIC_IPV4_GATEWAY_IFNAME
)
330 && (nh_type
!= STATIC_IPV6_GATEWAY_IFNAME
)) {
332 args
->errmsg
, args
->errmsg_len
,
333 "nexthop type is not the ipv4 or ipv6 interface type");
334 return NB_ERR_VALIDATION
;
341 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
342 old_onlink
= nh
->onlink
;
343 nh
->onlink
= yang_dnode_get_bool(args
->dnode
, NULL
);
345 if (old_onlink
!= nh
->onlink
)
346 nh
->state
= STATIC_START
;
353 static int static_nexthop_color_modify(struct nb_cb_modify_args
*args
)
355 struct static_nexthop
*nh
;
358 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
359 old_color
= nh
->color
;
360 nh
->color
= yang_dnode_get_uint32(args
->dnode
, NULL
);
362 if (old_color
!= nh
->color
)
363 nh
->state
= STATIC_START
;
368 static int static_nexthop_color_destroy(struct nb_cb_destroy_args
*args
)
370 struct static_nexthop
*nh
;
373 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
374 old_color
= nh
->color
;
377 if (old_color
!= nh
->color
)
378 nh
->state
= STATIC_START
;
383 static int static_nexthop_bh_type_modify(struct nb_cb_modify_args
*args
)
385 struct static_nexthop
*nh
;
386 enum static_nh_type nh_type
;
388 switch (args
->event
) {
390 nh_type
= yang_dnode_get_enum(args
->dnode
, "../nh-type");
391 if (nh_type
!= STATIC_BLACKHOLE
) {
392 snprintf(args
->errmsg
, args
->errmsg_len
,
393 "nexthop type is not the blackhole type");
394 return NB_ERR_VALIDATION
;
401 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
402 nh
->bh_type
= yang_dnode_get_enum(args
->dnode
, NULL
);
409 void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish(
410 struct nb_cb_apply_finish_args
*args
)
412 struct static_nexthop
*nh
;
414 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
416 static_install_nexthop(nh
);
419 void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish(
420 struct nb_cb_apply_finish_args
*args
)
422 struct static_nexthop
*nh
;
424 nh
= nb_running_get_entry(args
->dnode
, NULL
, true);
426 static_install_nexthop(nh
);
429 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate(
430 struct nb_cb_pre_validate_args
*args
)
432 const struct lyd_node
*mls_dnode
;
435 mls_dnode
= yang_dnode_get(args
->dnode
, "./mpls-label-stack");
436 count
= yang_get_list_elements_count(lyd_child(mls_dnode
));
438 if (count
> MPLS_MAX_LABELS
) {
439 snprintf(args
->errmsg
, args
->errmsg_len
,
440 "Too many labels, Enter %d or fewer",
442 return NB_ERR_VALIDATION
;
447 int routing_control_plane_protocols_name_validate(
448 struct nb_cb_create_args
*args
)
452 name
= yang_dnode_get_string(args
->dnode
, "./name");
453 if (!strmatch(name
, "staticd")) {
454 snprintf(args
->errmsg
, args
->errmsg_len
,
455 "static routing supports only one instance with name staticd");
456 return NB_ERR_VALIDATION
;
462 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list
464 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create(
465 struct nb_cb_create_args
*args
)
468 struct static_vrf
*s_vrf
;
469 struct route_node
*rn
;
470 const struct lyd_node
*vrf_dnode
;
471 struct prefix prefix
;
472 const char *afi_safi
;
477 switch (args
->event
) {
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 prefix_afi
= family2afi(prefix
.family
);
483 if (afi
!= prefix_afi
) {
485 EC_LIB_NB_CB_CONFIG_VALIDATE
,
486 "route node %s creation failed",
487 yang_dnode_get_string(args
->dnode
, "./prefix"));
488 return NB_ERR_VALIDATION
;
495 vrf_dnode
= yang_dnode_get_parent(args
->dnode
,
496 "control-plane-protocol");
497 vrf
= nb_running_get_entry(vrf_dnode
, NULL
, true);
500 yang_dnode_get_prefix(&prefix
, args
->dnode
, "./prefix");
501 afi_safi
= yang_dnode_get_string(args
->dnode
, "./afi-safi");
502 yang_afi_safi_identity2value(afi_safi
, &afi
, &safi
);
504 rn
= static_add_route(afi
, safi
, &prefix
, NULL
, s_vrf
);
505 if (vrf
->vrf_id
== VRF_UNKNOWN
)
507 args
->errmsg
, args
->errmsg_len
,
508 "Static Route to %s not installed currently because dependent config not fully available",
509 yang_dnode_get_string(args
->dnode
, "./prefix"));
510 nb_running_set_entry(args
->dnode
, rn
);
516 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy(
517 struct nb_cb_destroy_args
*args
)
519 struct route_node
*rn
;
521 switch (args
->event
) {
527 rn
= nb_running_unset_entry(args
->dnode
);
528 static_del_route(rn
);
536 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list
538 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create(
539 struct nb_cb_create_args
*args
)
541 return static_path_list_create(args
);
544 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy(
545 struct nb_cb_destroy_args
*args
)
547 return static_path_list_destroy(args
);
552 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/tag
554 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify(
555 struct nb_cb_modify_args
*args
)
557 return static_path_list_tag_modify(args
);
562 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop
564 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create(
565 struct nb_cb_create_args
*args
)
567 return static_nexthop_create(args
);
570 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy(
571 struct nb_cb_destroy_args
*args
)
573 return static_nexthop_destroy(args
);
578 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bh-type
580 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_modify(
581 struct nb_cb_modify_args
*args
)
583 return static_nexthop_bh_type_modify(args
);
588 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/onlink
590 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify(
591 struct nb_cb_modify_args
*args
)
593 return static_nexthop_onlink_modify(args
);
598 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/srte-color
600 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify(
601 struct nb_cb_modify_args
*args
)
603 switch (args
->event
) {
609 if (static_nexthop_color_modify(args
) != NB_OK
)
617 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy(
618 struct nb_cb_destroy_args
*args
)
620 switch (args
->event
) {
626 if (static_nexthop_color_destroy(args
) != NB_OK
)
635 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry
637 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
638 struct nb_cb_create_args
*args
)
640 return nexthop_mpls_label_stack_entry_create(args
);
643 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
644 struct nb_cb_destroy_args
*args
)
646 return nexthop_mpls_label_stack_entry_destroy(args
);
651 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/label
653 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
654 struct nb_cb_modify_args
*args
)
656 switch (args
->event
) {
662 if (static_nexthop_mpls_label_modify(args
) != NB_OK
)
669 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
670 struct nb_cb_destroy_args
*args
)
673 * No operation is required in this call back.
674 * nexthop_mpls_label_stack_entry_destroy() will take care
675 * to reset the label vaue.
677 switch (args
->event
) {
689 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/ttl
691 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
692 struct nb_cb_modify_args
*args
)
694 switch (args
->event
) {
705 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
706 struct nb_cb_destroy_args
*args
)
708 switch (args
->event
) {
721 * /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
723 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
724 struct nb_cb_modify_args
*args
)
726 switch (args
->event
) {
737 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
738 struct nb_cb_destroy_args
*args
)
740 switch (args
->event
) {
753 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bfd-monitoring
755 int route_next_hop_bfd_create(struct nb_cb_create_args
*args
)
757 struct static_nexthop
*sn
;
759 if (args
->event
!= NB_EV_APPLY
)
762 sn
= nb_running_get_entry(args
->dnode
, NULL
, true);
763 static_next_hop_bfd_monitor_enable(sn
, args
->dnode
);
767 int route_next_hop_bfd_destroy(struct nb_cb_destroy_args
*args
)
769 struct static_nexthop
*sn
;
771 if (args
->event
!= NB_EV_APPLY
)
774 sn
= nb_running_get_entry(args
->dnode
, NULL
, true);
775 static_next_hop_bfd_monitor_disable(sn
);
781 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bfd-monitoring/source
783 int route_next_hop_bfd_source_modify(struct nb_cb_modify_args
*args
)
785 struct static_nexthop
*sn
;
786 struct ipaddr source
;
788 if (args
->event
!= NB_EV_APPLY
)
791 sn
= nb_running_get_entry(args
->dnode
, NULL
, true);
792 yang_dnode_get_ip(&source
, args
->dnode
, NULL
);
793 static_next_hop_bfd_source(sn
, &source
);
797 int route_next_hop_bfd_source_destroy(struct nb_cb_destroy_args
*args
)
799 struct static_nexthop
*sn
;
801 if (args
->event
!= NB_EV_APPLY
)
804 sn
= nb_running_get_entry(args
->dnode
, NULL
, true);
805 static_next_hop_bfd_auto_source(sn
);
811 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bfd-monitoring/multi-hop
813 int route_next_hop_bfd_multi_hop_modify(struct nb_cb_modify_args
*args
)
815 struct static_nexthop
*sn
;
817 if (args
->event
!= NB_EV_APPLY
)
820 sn
= nb_running_get_entry(args
->dnode
, NULL
, true);
821 static_next_hop_bfd_multi_hop(sn
,
822 yang_dnode_get_bool(args
->dnode
, NULL
));
829 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bfd-monitoring/profile
831 int route_next_hop_bfd_profile_modify(struct nb_cb_modify_args
*args
)
833 struct static_nexthop
*sn
;
835 if (args
->event
!= NB_EV_APPLY
)
838 sn
= nb_running_get_entry(args
->dnode
, NULL
, true);
839 static_next_hop_bfd_profile(sn
,
840 yang_dnode_get_string(args
->dnode
, NULL
));
845 int route_next_hop_bfd_profile_destroy(struct nb_cb_destroy_args
*args
)
847 struct static_nexthop
*sn
;
849 if (args
->event
!= NB_EV_APPLY
)
852 sn
= nb_running_get_entry(args
->dnode
, NULL
, true);
853 static_next_hop_bfd_profile(sn
, NULL
);
860 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list
862 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create(
863 struct nb_cb_create_args
*args
)
865 struct static_vrf
*s_vrf
;
866 struct route_node
*rn
;
867 struct route_node
*src_rn
;
868 struct prefix_ipv6 src_prefix
= {};
869 struct stable_info
*info
;
871 safi_t safi
= SAFI_UNICAST
;
873 switch (args
->event
) {
879 rn
= nb_running_get_entry(args
->dnode
, NULL
, true);
880 info
= route_table_get_info(rn
->table
);
882 yang_dnode_get_ipv6p(&src_prefix
, args
->dnode
, "./src-prefix");
883 afi
= family2afi(src_prefix
.family
);
885 static_add_route(afi
, safi
, &rn
->p
, &src_prefix
, s_vrf
);
886 nb_running_set_entry(args
->dnode
, src_rn
);
892 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy(
893 struct nb_cb_destroy_args
*args
)
895 struct route_node
*src_rn
;
897 switch (args
->event
) {
903 src_rn
= nb_running_unset_entry(args
->dnode
);
904 static_del_route(src_rn
);
913 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list
915 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create(
916 struct nb_cb_create_args
*args
)
918 return static_path_list_create(args
);
921 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy(
922 struct nb_cb_destroy_args
*args
)
924 return static_path_list_destroy(args
);
929 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/tag
931 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify(
932 struct nb_cb_modify_args
*args
)
934 return static_path_list_tag_modify(args
);
939 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop
941 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create(
942 struct nb_cb_create_args
*args
)
944 return static_nexthop_create(args
);
947 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy(
948 struct nb_cb_destroy_args
*args
)
950 return static_nexthop_destroy(args
);
955 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/bh-type
957 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify(
958 struct nb_cb_modify_args
*args
)
960 return static_nexthop_bh_type_modify(args
);
965 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/onlink
967 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify(
968 struct nb_cb_modify_args
*args
)
970 return static_nexthop_onlink_modify(args
);
975 * /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/srte-color
977 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify(
978 struct nb_cb_modify_args
*args
)
980 switch (args
->event
) {
986 if (static_nexthop_color_modify(args
) != NB_OK
)
995 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy(
996 struct nb_cb_destroy_args
*args
)
998 switch (args
->event
) {
1004 if (static_nexthop_color_destroy(args
) != NB_OK
)
1013 * /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
1015 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
1016 struct nb_cb_create_args
*args
)
1018 return nexthop_mpls_label_stack_entry_create(args
);
1021 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
1022 struct nb_cb_destroy_args
*args
)
1024 return nexthop_mpls_label_stack_entry_destroy(args
);
1029 * /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
1031 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
1032 struct nb_cb_modify_args
*args
)
1034 switch (args
->event
) {
1035 case NB_EV_VALIDATE
:
1040 if (static_nexthop_mpls_label_modify(args
) != NB_OK
)
1047 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
1048 struct nb_cb_destroy_args
*args
)
1051 * No operation is required in this call back.
1052 * nexthop_mpls_label_stack_entry_destroy() will take care
1053 * to reset the label vaue.
1055 switch (args
->event
) {
1056 case NB_EV_VALIDATE
:
1067 * /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
1069 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
1070 struct nb_cb_modify_args
*args
)
1072 switch (args
->event
) {
1073 case NB_EV_VALIDATE
:
1083 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
1084 struct nb_cb_destroy_args
*args
)
1086 switch (args
->event
) {
1087 case NB_EV_VALIDATE
:
1099 * /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
1101 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(
1102 struct nb_cb_modify_args
*args
)
1104 switch (args
->event
) {
1105 case NB_EV_VALIDATE
:
1115 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(
1116 struct nb_cb_destroy_args
*args
)
1118 switch (args
->event
) {
1119 case NB_EV_VALIDATE
: