2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-04-24 14:38:43 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Vmware
|
|
|
|
* Vishal Dhingra
|
|
|
|
*/
|
2021-04-23 12:04:58 +02:00
|
|
|
#include <zebra.h>
|
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
#include "northbound.h"
|
|
|
|
#include "libfrr.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "lib_errors.h"
|
|
|
|
#include "prefix.h"
|
|
|
|
#include "table.h"
|
|
|
|
#include "vrf.h"
|
|
|
|
#include "nexthop.h"
|
|
|
|
#include "srcdest_table.h"
|
|
|
|
|
|
|
|
#include "static_vrf.h"
|
|
|
|
#include "static_routes.h"
|
|
|
|
#include "static_nb.h"
|
2023-11-30 17:29:20 +01:00
|
|
|
#include "static_zebra.h"
|
2020-04-24 14:38:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
static int static_path_list_create(struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
struct static_path *pn;
|
2021-01-10 09:04:45 +01:00
|
|
|
const struct lyd_node *vrf_dnode;
|
|
|
|
const char *vrf;
|
2020-04-24 14:38:43 +02:00
|
|
|
uint8_t distance;
|
2021-01-10 09:04:45 +01:00
|
|
|
uint32_t table_id;
|
2020-04-24 14:38:43 +02:00
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
2021-01-10 09:04:45 +01:00
|
|
|
vrf_dnode = yang_dnode_get_parent(args->dnode,
|
|
|
|
"control-plane-protocol");
|
2023-11-29 20:37:23 +01:00
|
|
|
vrf = yang_dnode_get_string(vrf_dnode, "vrf");
|
|
|
|
table_id = yang_dnode_get_uint32(args->dnode, "table-id");
|
2021-01-10 09:04:45 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* TableId is not applicable for VRF. Consider the case of
|
|
|
|
* l3mdev, there is one uint32_t space to work with.
|
|
|
|
* A l3mdev device points at a specific table that it
|
|
|
|
* relates to and a set of interfaces it belongs to.
|
|
|
|
*/
|
|
|
|
if (table_id && (strcmp(vrf, vrf_get_default_name()) != 0)
|
|
|
|
&& !vrf_is_backend_netns()) {
|
|
|
|
snprintf(
|
|
|
|
args->errmsg, args->errmsg_len,
|
|
|
|
"%% table param only available when running on netns-based vrfs");
|
|
|
|
return NB_ERR_VALIDATION;
|
|
|
|
}
|
|
|
|
break;
|
2020-04-24 14:38:43 +02:00
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
rn = nb_running_get_entry(args->dnode, NULL, true);
|
2023-11-29 20:37:23 +01:00
|
|
|
distance = yang_dnode_get_uint8(args->dnode, "distance");
|
|
|
|
table_id = yang_dnode_get_uint32(args->dnode, "table-id");
|
2021-01-10 09:04:45 +01:00
|
|
|
pn = static_add_path(rn, table_id, distance);
|
2020-04-24 14:38:43 +02:00
|
|
|
nb_running_set_entry(args->dnode, pn);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
static int static_path_list_destroy(struct nb_cb_destroy_args *args)
|
2020-04-24 14:38:43 +02:00
|
|
|
{
|
|
|
|
struct static_path *pn;
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
pn = nb_running_unset_entry(args->dnode);
|
|
|
|
static_del_path(pn);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
static int static_path_list_tag_modify(struct nb_cb_modify_args *args)
|
2020-04-24 14:38:43 +02:00
|
|
|
{
|
|
|
|
struct static_path *pn;
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
pn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
pn->tag = yang_dnode_get_uint32(args->dnode, NULL);
|
|
|
|
static_install_path(pn);
|
|
|
|
break;
|
|
|
|
}
|
2020-04-24 14:38:43 +02:00
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
return NB_OK;
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
2021-02-26 16:32:37 +01:00
|
|
|
struct nexthop_iter {
|
2022-02-17 15:49:41 +01:00
|
|
|
uint32_t count;
|
2021-02-26 16:32:37 +01:00
|
|
|
bool blackhole;
|
|
|
|
};
|
|
|
|
|
|
|
|
static int nexthop_iter_cb(const struct lyd_node *dnode, void *arg)
|
|
|
|
{
|
|
|
|
struct nexthop_iter *iter = arg;
|
2021-08-16 14:38:57 +02:00
|
|
|
enum static_nh_type nh_type;
|
2021-02-26 16:32:37 +01:00
|
|
|
|
2023-11-29 20:37:23 +01:00
|
|
|
nh_type = yang_dnode_get_enum(dnode, "nh-type");
|
2021-02-26 16:32:37 +01:00
|
|
|
|
|
|
|
if (nh_type == STATIC_BLACKHOLE)
|
|
|
|
iter->blackhole = true;
|
|
|
|
|
|
|
|
iter->count++;
|
|
|
|
|
|
|
|
return YANG_ITER_CONTINUE;
|
|
|
|
}
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
static bool static_nexthop_create(struct nb_cb_create_args *args)
|
2020-04-24 14:38:43 +02:00
|
|
|
{
|
2021-02-26 16:32:37 +01:00
|
|
|
const struct lyd_node *pn_dnode;
|
|
|
|
struct nexthop_iter iter;
|
2020-04-24 14:38:43 +02:00
|
|
|
struct static_path *pn;
|
|
|
|
struct ipaddr ipaddr;
|
|
|
|
struct static_nexthop *nh;
|
2021-08-16 14:38:57 +02:00
|
|
|
enum static_nh_type nh_type;
|
2020-04-24 14:38:43 +02:00
|
|
|
const char *ifname;
|
|
|
|
const char *nh_vrf;
|
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
2023-11-29 20:37:23 +01:00
|
|
|
ifname = yang_dnode_get_string(args->dnode, "interface");
|
2024-01-30 21:51:46 +01:00
|
|
|
if (ifname != NULL) {
|
2020-04-24 14:38:43 +02:00
|
|
|
if (strcasecmp(ifname, "Null0") == 0
|
|
|
|
|| strcasecmp(ifname, "reject") == 0
|
|
|
|
|| strcasecmp(ifname, "blackhole") == 0) {
|
|
|
|
snprintf(args->errmsg, args->errmsg_len,
|
|
|
|
"%s: Nexthop interface name can not be from reserved keywords(Null0, reject, blackhole)",
|
|
|
|
ifname);
|
|
|
|
return NB_ERR_VALIDATION;
|
|
|
|
}
|
|
|
|
}
|
2021-02-26 16:32:37 +01:00
|
|
|
|
|
|
|
iter.count = 0;
|
|
|
|
iter.blackhole = false;
|
|
|
|
|
|
|
|
pn_dnode = yang_dnode_get_parent(args->dnode, "path-list");
|
|
|
|
yang_dnode_iterate(nexthop_iter_cb, &iter, pn_dnode,
|
|
|
|
"./frr-nexthops/nexthop");
|
|
|
|
|
|
|
|
if (iter.blackhole && iter.count > 1) {
|
|
|
|
snprintf(
|
|
|
|
args->errmsg, args->errmsg_len,
|
2022-02-17 15:48:07 +01:00
|
|
|
"Route cannot have blackhole and non-blackhole nexthops simultaneously");
|
2021-02-26 16:32:37 +01:00
|
|
|
return NB_ERR_VALIDATION;
|
2022-02-17 15:49:41 +01:00
|
|
|
} else if (iter.count > zebra_ecmp_count) {
|
|
|
|
snprintf(args->errmsg, args->errmsg_len,
|
|
|
|
"Route cannot have more than %d ECMP nexthops",
|
|
|
|
zebra_ecmp_count);
|
|
|
|
return NB_ERR_VALIDATION;
|
2021-02-26 16:32:37 +01:00
|
|
|
}
|
2020-04-24 14:38:43 +02:00
|
|
|
break;
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
2023-11-29 20:37:23 +01:00
|
|
|
yang_dnode_get_ip(&ipaddr, args->dnode, "gateway");
|
|
|
|
nh_type = yang_dnode_get_enum(args->dnode, "nh-type");
|
|
|
|
ifname = yang_dnode_get_string(args->dnode, "interface");
|
|
|
|
nh_vrf = yang_dnode_get_string(args->dnode, "vrf");
|
2020-04-24 14:38:43 +02:00
|
|
|
pn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
|
2024-01-31 13:10:09 +01:00
|
|
|
if (strmatch(ifname, "(null)"))
|
|
|
|
ifname = "";
|
|
|
|
|
2021-02-17 11:06:56 +01:00
|
|
|
if (!static_add_nexthop_validate(nh_vrf, nh_type, &ipaddr))
|
2020-04-24 14:38:43 +02:00
|
|
|
flog_warn(
|
|
|
|
EC_LIB_NB_CB_CONFIG_VALIDATE,
|
|
|
|
"Warning!! Local connected address is configured as Gateway IP((%s))",
|
|
|
|
yang_dnode_get_string(args->dnode,
|
|
|
|
"./gateway"));
|
2021-07-09 21:55:29 +02:00
|
|
|
nh = static_add_nexthop(pn, nh_type, &ipaddr, ifname, nh_vrf,
|
|
|
|
0);
|
2020-04-24 14:38:43 +02:00
|
|
|
nb_running_set_entry(args->dnode, nh);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
static bool static_nexthop_destroy(struct nb_cb_destroy_args *args)
|
2020-04-24 14:38:43 +02:00
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
nh = nb_running_unset_entry(args->dnode);
|
|
|
|
static_delete_nexthop(nh);
|
|
|
|
break;
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2023-07-26 18:01:20 +02:00
|
|
|
static int nexthop_srv6_segs_stack_entry_create(struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
uint32_t pos;
|
|
|
|
uint8_t index;
|
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
pos = yang_get_list_pos(args->dnode);
|
|
|
|
if (!pos) {
|
|
|
|
flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
|
|
|
|
"libyang returns invalid seg position");
|
|
|
|
return NB_ERR;
|
|
|
|
}
|
|
|
|
/* Mapping to array = list-index -1 */
|
|
|
|
index = pos - 1;
|
|
|
|
memset(&nh->snh_seg.seg[index], 0, sizeof(struct in6_addr));
|
|
|
|
nh->snh_seg.num_segs++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int nexthop_srv6_segs_stack_entry_destroy(struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
uint32_t pos;
|
|
|
|
uint8_t index;
|
|
|
|
int old_num_segs;
|
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
pos = yang_get_list_pos(args->dnode);
|
|
|
|
if (!pos) {
|
|
|
|
flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
|
|
|
|
"libyang returns invalid seg position");
|
|
|
|
return NB_ERR;
|
|
|
|
}
|
|
|
|
index = pos - 1;
|
|
|
|
old_num_segs = nh->snh_seg.num_segs;
|
|
|
|
memset(&nh->snh_seg.seg[index], 0, sizeof(struct in6_addr));
|
|
|
|
nh->snh_seg.num_segs--;
|
|
|
|
|
|
|
|
if (old_num_segs != nh->snh_seg.num_segs)
|
|
|
|
nh->state = STATIC_START;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int static_nexthop_srv6_segs_modify(struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
uint32_t pos;
|
|
|
|
uint8_t index;
|
|
|
|
struct in6_addr old_seg;
|
|
|
|
struct in6_addr cli_seg;
|
|
|
|
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
pos = yang_get_list_pos(lyd_parent(args->dnode));
|
|
|
|
if (!pos) {
|
|
|
|
flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
|
|
|
|
"libyang returns invalid seg position");
|
|
|
|
return NB_ERR;
|
|
|
|
}
|
|
|
|
/* Mapping to array = list-index -1 */
|
|
|
|
index = pos - 1;
|
|
|
|
|
|
|
|
old_seg = nh->snh_seg.seg[index];
|
|
|
|
yang_dnode_get_ipv6(&cli_seg, args->dnode, NULL);
|
|
|
|
|
|
|
|
memcpy(&nh->snh_seg.seg[index], &cli_seg, sizeof(struct in6_addr));
|
|
|
|
|
|
|
|
if (memcmp(&old_seg, &nh->snh_seg.seg[index],
|
|
|
|
sizeof(struct in6_addr)) != 0)
|
|
|
|
nh->state = STATIC_START;
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
static int nexthop_mpls_label_stack_entry_create(struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
uint32_t pos;
|
|
|
|
uint8_t index;
|
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
2020-08-10 09:00:09 +02:00
|
|
|
if (!mpls_enabled) {
|
|
|
|
snprintf(
|
|
|
|
args->errmsg, args->errmsg_len,
|
|
|
|
"%% MPLS not turned on in kernel ignoring static route");
|
|
|
|
return NB_ERR_VALIDATION;
|
|
|
|
}
|
|
|
|
break;
|
2020-04-24 14:38:43 +02:00
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
pos = yang_get_list_pos(args->dnode);
|
|
|
|
if (!pos) {
|
|
|
|
flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
|
|
|
|
"libyang returns invalid label position");
|
|
|
|
return NB_ERR;
|
|
|
|
}
|
|
|
|
/* Mapping to array = list-index -1 */
|
|
|
|
index = pos - 1;
|
|
|
|
nh->snh_label.label[index] = 0;
|
|
|
|
nh->snh_label.num_labels++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
nexthop_mpls_label_stack_entry_destroy(struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
uint32_t pos;
|
|
|
|
uint8_t index;
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
uint old_num_labels;
|
2020-04-24 14:38:43 +02:00
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
pos = yang_get_list_pos(args->dnode);
|
|
|
|
if (!pos) {
|
|
|
|
flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
|
|
|
|
"libyang returns invalid label position");
|
|
|
|
return NB_ERR;
|
|
|
|
}
|
|
|
|
index = pos - 1;
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
old_num_labels = nh->snh_label.num_labels;
|
2020-04-24 14:38:43 +02:00
|
|
|
nh->snh_label.label[index] = 0;
|
|
|
|
nh->snh_label.num_labels--;
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
|
|
|
|
if (old_num_labels != nh->snh_label.num_labels)
|
|
|
|
nh->state = STATIC_START;
|
2020-04-24 14:38:43 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int static_nexthop_mpls_label_modify(struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
uint32_t pos;
|
|
|
|
uint8_t index;
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
mpls_label_t old_label;
|
2020-04-24 14:38:43 +02:00
|
|
|
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
2021-05-04 16:41:58 +02:00
|
|
|
pos = yang_get_list_pos(lyd_parent(args->dnode));
|
2020-04-24 14:38:43 +02:00
|
|
|
if (!pos) {
|
|
|
|
flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
|
|
|
|
"libyang returns invalid label position");
|
|
|
|
return NB_ERR;
|
|
|
|
}
|
|
|
|
/* Mapping to array = list-index -1 */
|
|
|
|
index = pos - 1;
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
|
|
|
|
old_label = nh->snh_label.label[index];
|
2020-04-24 14:38:43 +02:00
|
|
|
nh->snh_label.label[index] = yang_dnode_get_uint32(args->dnode, NULL);
|
|
|
|
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
if (old_label != nh->snh_label.label[index])
|
|
|
|
nh->state = STATIC_START;
|
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int static_nexthop_onlink_modify(struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
2021-08-16 14:38:57 +02:00
|
|
|
enum static_nh_type nh_type;
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
bool old_onlink;
|
2020-04-24 14:38:43 +02:00
|
|
|
|
2021-01-13 18:02:32 +01:00
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
nh_type = yang_dnode_get_enum(args->dnode, "../nh-type");
|
|
|
|
if ((nh_type != STATIC_IPV4_GATEWAY_IFNAME)
|
|
|
|
&& (nh_type != STATIC_IPV6_GATEWAY_IFNAME)) {
|
|
|
|
snprintf(
|
|
|
|
args->errmsg, args->errmsg_len,
|
|
|
|
"nexthop type is not the ipv4 or ipv6 interface type");
|
|
|
|
return NB_ERR_VALIDATION;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
old_onlink = nh->onlink;
|
2021-01-13 18:02:32 +01:00
|
|
|
nh->onlink = yang_dnode_get_bool(args->dnode, NULL);
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
|
|
|
|
if (old_onlink != nh->onlink)
|
|
|
|
nh->state = STATIC_START;
|
2021-01-13 18:02:32 +01:00
|
|
|
break;
|
|
|
|
}
|
2020-04-24 14:38:43 +02:00
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2020-02-14 15:49:25 +01:00
|
|
|
static int static_nexthop_color_modify(struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
uint32_t old_color;
|
2020-02-14 15:49:25 +01:00
|
|
|
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
old_color = nh->color;
|
2020-02-14 15:49:25 +01:00
|
|
|
nh->color = yang_dnode_get_uint32(args->dnode, NULL);
|
|
|
|
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
if (old_color != nh->color)
|
|
|
|
nh->state = STATIC_START;
|
|
|
|
|
2020-02-14 15:49:25 +01:00
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int static_nexthop_color_destroy(struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
uint32_t old_color;
|
2020-02-14 15:49:25 +01:00
|
|
|
|
2022-11-25 15:19:28 +01:00
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
old_color = nh->color;
|
2020-02-14 15:49:25 +01:00
|
|
|
nh->color = 0;
|
|
|
|
|
staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:
Example of brokenness:
eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:05 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
Known via "static", distance 1, metric 0, best
Last update 00:00:12 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
Fixed behavior:
eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:04 ago
* 192.168.119.1, via enp39s0, label 16020, weight 1
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
Known via "static", distance 1, metric 0, best
Last update 00:00:01 ago
* 192.168.119.1, via enp39s0, label 16040, weight 1
I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 21:41:42 +02:00
|
|
|
if (old_color != nh->color)
|
|
|
|
nh->state = STATIC_START;
|
|
|
|
|
2020-02-14 15:49:25 +01:00
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
static int static_nexthop_bh_type_modify(struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
2021-08-16 14:38:57 +02:00
|
|
|
enum static_nh_type nh_type;
|
2020-04-24 14:38:43 +02:00
|
|
|
|
2021-01-13 18:02:32 +01:00
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
nh_type = yang_dnode_get_enum(args->dnode, "../nh-type");
|
|
|
|
if (nh_type != STATIC_BLACKHOLE) {
|
|
|
|
snprintf(args->errmsg, args->errmsg_len,
|
|
|
|
"nexthop type is not the blackhole type");
|
|
|
|
return NB_ERR_VALIDATION;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
nh->bh_type = yang_dnode_get_enum(args->dnode, NULL);
|
|
|
|
break;
|
|
|
|
}
|
2020-04-24 14:38:43 +02:00
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish(
|
|
|
|
struct nb_cb_apply_finish_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
static_install_nexthop(nh);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish(
|
|
|
|
struct nb_cb_apply_finish_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *nh;
|
|
|
|
|
|
|
|
nh = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
|
2021-07-09 21:55:29 +02:00
|
|
|
static_install_nexthop(nh);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
2021-07-09 21:55:29 +02:00
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate(
|
|
|
|
struct nb_cb_pre_validate_args *args)
|
|
|
|
{
|
|
|
|
const struct lyd_node *mls_dnode;
|
|
|
|
uint32_t count;
|
|
|
|
|
2023-11-29 20:37:23 +01:00
|
|
|
mls_dnode = yang_dnode_get(args->dnode, "mpls-label-stack");
|
2021-05-04 16:41:58 +02:00
|
|
|
count = yang_get_list_elements_count(lyd_child(mls_dnode));
|
2020-04-24 14:38:43 +02:00
|
|
|
|
|
|
|
if (count > MPLS_MAX_LABELS) {
|
|
|
|
snprintf(args->errmsg, args->errmsg_len,
|
|
|
|
"Too many labels, Enter %d or fewer",
|
|
|
|
MPLS_MAX_LABELS);
|
|
|
|
return NB_ERR_VALIDATION;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_name_validate(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
|
2023-11-29 20:37:23 +01:00
|
|
|
name = yang_dnode_get_string(args->dnode, "name");
|
2020-04-24 14:38:43 +02:00
|
|
|
if (!strmatch(name, "staticd")) {
|
|
|
|
snprintf(args->errmsg, args->errmsg_len,
|
|
|
|
"static routing supports only one instance with name staticd");
|
|
|
|
return NB_ERR_VALIDATION;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
2024-02-01 23:57:59 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_staticd_create(struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
struct static_vrf *svrf;
|
|
|
|
const char *vrf;
|
|
|
|
|
|
|
|
vrf = yang_dnode_get_string(args->dnode, "vrf");
|
|
|
|
svrf = static_vrf_alloc(vrf);
|
|
|
|
nb_running_set_entry(args->dnode, svrf);
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_staticd_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct static_vrf *svrf;
|
|
|
|
struct route_table *stable;
|
|
|
|
struct route_node *rn;
|
|
|
|
afi_t afi;
|
|
|
|
safi_t safi;
|
|
|
|
|
|
|
|
svrf = nb_running_unset_entry(args->dnode);
|
|
|
|
|
|
|
|
FOREACH_AFI_SAFI (afi, safi) {
|
|
|
|
stable = svrf->stable[afi][safi];
|
|
|
|
if (!stable)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
for (rn = route_top(stable); rn; rn = route_next(rn))
|
|
|
|
static_del_route(rn);
|
|
|
|
}
|
|
|
|
|
|
|
|
static_vrf_free(svrf);
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
2024-02-01 23:57:59 +01:00
|
|
|
struct static_vrf *svrf;
|
2020-04-24 14:38:43 +02:00
|
|
|
struct route_node *rn;
|
|
|
|
const struct lyd_node *vrf_dnode;
|
|
|
|
struct prefix prefix;
|
2020-07-02 08:54:50 +02:00
|
|
|
const char *afi_safi;
|
|
|
|
afi_t prefix_afi;
|
2020-04-24 14:38:43 +02:00
|
|
|
afi_t afi;
|
2020-07-02 08:54:50 +02:00
|
|
|
safi_t safi;
|
2020-04-24 14:38:43 +02:00
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
2023-11-29 20:37:23 +01:00
|
|
|
yang_dnode_get_prefix(&prefix, args->dnode, "prefix");
|
|
|
|
afi_safi = yang_dnode_get_string(args->dnode, "afi-safi");
|
2020-07-02 08:54:50 +02:00
|
|
|
yang_afi_safi_identity2value(afi_safi, &afi, &safi);
|
|
|
|
prefix_afi = family2afi(prefix.family);
|
|
|
|
if (afi != prefix_afi) {
|
|
|
|
flog_warn(
|
|
|
|
EC_LIB_NB_CB_CONFIG_VALIDATE,
|
|
|
|
"route node %s creation failed",
|
2023-11-29 20:37:23 +01:00
|
|
|
yang_dnode_get_string(args->dnode, "prefix"));
|
2020-07-02 08:54:50 +02:00
|
|
|
return NB_ERR_VALIDATION;
|
|
|
|
}
|
|
|
|
break;
|
2020-04-24 14:38:43 +02:00
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
vrf_dnode = yang_dnode_get_parent(args->dnode,
|
|
|
|
"control-plane-protocol");
|
2024-02-01 23:57:59 +01:00
|
|
|
svrf = nb_running_get_entry(vrf_dnode, NULL, true);
|
2020-04-24 14:38:43 +02:00
|
|
|
|
2023-11-29 20:37:23 +01:00
|
|
|
yang_dnode_get_prefix(&prefix, args->dnode, "prefix");
|
|
|
|
afi_safi = yang_dnode_get_string(args->dnode, "afi-safi");
|
2020-07-02 08:54:50 +02:00
|
|
|
yang_afi_safi_identity2value(afi_safi, &afi, &safi);
|
2020-04-24 14:38:43 +02:00
|
|
|
|
2024-02-01 23:57:59 +01:00
|
|
|
rn = static_add_route(afi, safi, &prefix, NULL, svrf);
|
|
|
|
if (!svrf->vrf || svrf->vrf->vrf_id == VRF_UNKNOWN)
|
2020-08-10 09:00:09 +02:00
|
|
|
snprintf(
|
|
|
|
args->errmsg, args->errmsg_len,
|
|
|
|
"Static Route to %s not installed currently because dependent config not fully available",
|
2023-11-29 20:37:23 +01:00
|
|
|
yang_dnode_get_string(args->dnode, "prefix"));
|
2020-04-24 14:38:43 +02:00
|
|
|
nb_running_set_entry(args->dnode, rn);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
rn = nb_running_unset_entry(args->dnode);
|
2021-07-09 21:55:29 +02:00
|
|
|
static_del_route(rn);
|
2020-04-24 14:38:43 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
return static_path_list_create(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
2021-07-09 21:55:29 +02:00
|
|
|
return static_path_list_destroy(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/tag
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
2021-07-09 21:55:29 +02:00
|
|
|
return static_path_list_tag_modify(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
2021-07-09 21:55:29 +02:00
|
|
|
return static_nexthop_create(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
2021-07-09 21:55:29 +02:00
|
|
|
return static_nexthop_destroy(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bh-type
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
2021-01-13 18:02:32 +01:00
|
|
|
return static_nexthop_bh_type_modify(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/onlink
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
2021-01-13 18:02:32 +01:00
|
|
|
return static_nexthop_onlink_modify(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
2020-02-14 15:49:25 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/srte-color
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
if (static_nexthop_color_modify(args) != NB_OK)
|
|
|
|
return NB_ERR;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
if (static_nexthop_color_destroy(args) != NB_OK)
|
|
|
|
return NB_ERR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2023-07-26 18:01:20 +02:00
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/srv6-segs-stack/entry
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_srv6_segs_stack_entry_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
return nexthop_srv6_segs_stack_entry_create(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_srv6_segs_stack_entry_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
return nexthop_srv6_segs_stack_entry_destroy(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/srv6-segs-stack/entry/seg
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_srv6_segs_stack_entry_seg_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
if (static_nexthop_srv6_segs_modify(args) != NB_OK)
|
|
|
|
return NB_ERR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_srv6_segs_stack_entry_seg_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* No operation is required in this call back.
|
|
|
|
* nexthop_srv6_segs_stack_entry_destroy() will take care
|
|
|
|
* to reset the seg vaue.
|
|
|
|
*/
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
return nexthop_mpls_label_stack_entry_create(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
return nexthop_mpls_label_stack_entry_destroy(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/label
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
if (static_nexthop_mpls_label_modify(args) != NB_OK)
|
|
|
|
return NB_ERR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* No operation is required in this call back.
|
|
|
|
* nexthop_mpls_label_stack_entry_destroy() will take care
|
|
|
|
* to reset the label vaue.
|
|
|
|
*/
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/mpls-label-stack/entry/ttl
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /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
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2021-03-24 13:39:55 +01:00
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bfd-monitoring
|
|
|
|
*/
|
|
|
|
int route_next_hop_bfd_create(struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *sn;
|
|
|
|
|
|
|
|
if (args->event != NB_EV_APPLY)
|
|
|
|
return NB_OK;
|
|
|
|
|
|
|
|
sn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
static_next_hop_bfd_monitor_enable(sn, args->dnode);
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int route_next_hop_bfd_destroy(struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *sn;
|
|
|
|
|
|
|
|
if (args->event != NB_EV_APPLY)
|
|
|
|
return NB_OK;
|
|
|
|
|
|
|
|
sn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
static_next_hop_bfd_monitor_disable(sn);
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bfd-monitoring/source
|
|
|
|
*/
|
|
|
|
int route_next_hop_bfd_source_modify(struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *sn;
|
|
|
|
struct ipaddr source;
|
|
|
|
|
|
|
|
if (args->event != NB_EV_APPLY)
|
|
|
|
return NB_OK;
|
|
|
|
|
|
|
|
sn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
yang_dnode_get_ip(&source, args->dnode, NULL);
|
|
|
|
static_next_hop_bfd_source(sn, &source);
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int route_next_hop_bfd_source_destroy(struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *sn;
|
|
|
|
|
|
|
|
if (args->event != NB_EV_APPLY)
|
|
|
|
return NB_OK;
|
|
|
|
|
|
|
|
sn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
static_next_hop_bfd_auto_source(sn);
|
2023-11-30 17:29:20 +01:00
|
|
|
|
|
|
|
/* NHT information are needed by BFD to automatically find the source
|
|
|
|
*
|
|
|
|
* Force zebra to resend the information to BFD by unregistering and
|
|
|
|
* registering again NHT. The (...)/frr-nexthops/nexthop northbound
|
|
|
|
* apply_finish function will trigger a call to static_install_nexthop()
|
|
|
|
* that does a call to static_zebra_nht_register(nh, true);
|
|
|
|
* static_zebra_nht_register(sn, false);
|
|
|
|
*/
|
|
|
|
static_zebra_nht_register(sn, false);
|
|
|
|
|
2021-03-24 13:39:55 +01:00
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bfd-monitoring/multi-hop
|
|
|
|
*/
|
|
|
|
int route_next_hop_bfd_multi_hop_modify(struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *sn;
|
|
|
|
|
|
|
|
if (args->event != NB_EV_APPLY)
|
|
|
|
return NB_OK;
|
|
|
|
|
|
|
|
sn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
static_next_hop_bfd_multi_hop(sn,
|
|
|
|
yang_dnode_get_bool(args->dnode, NULL));
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/path-list/frr-nexthops/nexthop/bfd-monitoring/profile
|
|
|
|
*/
|
|
|
|
int route_next_hop_bfd_profile_modify(struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *sn;
|
|
|
|
|
|
|
|
if (args->event != NB_EV_APPLY)
|
|
|
|
return NB_OK;
|
|
|
|
|
|
|
|
sn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
static_next_hop_bfd_profile(sn,
|
|
|
|
yang_dnode_get_string(args->dnode, NULL));
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int route_next_hop_bfd_profile_destroy(struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct static_nexthop *sn;
|
|
|
|
|
|
|
|
if (args->event != NB_EV_APPLY)
|
|
|
|
return NB_OK;
|
|
|
|
|
|
|
|
sn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
static_next_hop_bfd_profile(sn, NULL);
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
struct static_vrf *s_vrf;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct route_node *src_rn;
|
|
|
|
struct prefix_ipv6 src_prefix = {};
|
|
|
|
struct stable_info *info;
|
|
|
|
afi_t afi;
|
|
|
|
safi_t safi = SAFI_UNICAST;
|
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
rn = nb_running_get_entry(args->dnode, NULL, true);
|
|
|
|
info = route_table_get_info(rn->table);
|
|
|
|
s_vrf = info->svrf;
|
2023-11-29 20:37:23 +01:00
|
|
|
yang_dnode_get_ipv6p(&src_prefix, args->dnode, "src-prefix");
|
2020-04-24 14:38:43 +02:00
|
|
|
afi = family2afi(src_prefix.family);
|
|
|
|
src_rn =
|
|
|
|
static_add_route(afi, safi, &rn->p, &src_prefix, s_vrf);
|
|
|
|
nb_running_set_entry(args->dnode, src_rn);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
struct route_node *src_rn;
|
|
|
|
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
src_rn = nb_running_unset_entry(args->dnode);
|
2021-07-09 21:55:29 +02:00
|
|
|
static_del_route(src_rn);
|
2020-04-24 14:38:43 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
return static_path_list_create(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
2021-07-09 21:55:29 +02:00
|
|
|
return static_path_list_destroy(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/tag
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
2021-07-09 21:55:29 +02:00
|
|
|
return static_path_list_tag_modify(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
2021-07-09 21:55:29 +02:00
|
|
|
return static_nexthop_create(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
2021-07-09 21:55:29 +02:00
|
|
|
return static_nexthop_destroy(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/bh-type
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
2021-01-13 18:02:32 +01:00
|
|
|
return static_nexthop_bh_type_modify(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/onlink
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
2021-01-13 18:02:32 +01:00
|
|
|
return static_nexthop_onlink_modify(args);
|
2020-04-24 14:38:43 +02:00
|
|
|
}
|
|
|
|
|
2020-02-14 15:49:25 +01:00
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/srte-color
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
if (static_nexthop_color_modify(args) != NB_OK)
|
|
|
|
return NB_ERR;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
if (static_nexthop_color_destroy(args) != NB_OK)
|
|
|
|
return NB_ERR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2023-07-26 18:01:20 +02:00
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/srv6-segs-stack/entry
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_srv6_segs_stack_entry_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
return nexthop_srv6_segs_stack_entry_create(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_srv6_segs_stack_entry_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
return nexthop_srv6_segs_stack_entry_destroy(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-staticd:staticd/route-list/src-list/path-list/frr-nexthops/nexthop/srv6-segs-stack/entry/seg
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_srv6_segs_stack_entry_seg_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
if (static_nexthop_srv6_segs_modify(args) != NB_OK)
|
|
|
|
return NB_ERR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_srv6_segs_stack_entry_seg_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* No operation is required in this call back.
|
|
|
|
* nexthop_mpls_seg_stack_entry_destroy() will take care
|
|
|
|
* to reset the seg vaue.
|
|
|
|
*/
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
2020-04-24 14:38:43 +02:00
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /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
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
|
|
|
|
struct nb_cb_create_args *args)
|
|
|
|
{
|
|
|
|
return nexthop_mpls_label_stack_entry_create(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
return nexthop_mpls_label_stack_entry_destroy(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /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
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
break;
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
if (static_nexthop_mpls_label_modify(args) != NB_OK)
|
|
|
|
return NB_ERR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* No operation is required in this call back.
|
|
|
|
* nexthop_mpls_label_stack_entry_destroy() will take care
|
|
|
|
* to reset the label vaue.
|
|
|
|
*/
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /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
|
|
|
|
*/
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /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
|
|
|
|
*/
|
|
|
|
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(
|
|
|
|
struct nb_cb_modify_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
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(
|
|
|
|
struct nb_cb_destroy_args *args)
|
|
|
|
{
|
|
|
|
switch (args->event) {
|
|
|
|
case NB_EV_VALIDATE:
|
|
|
|
case NB_EV_PREPARE:
|
|
|
|
case NB_EV_ABORT:
|
|
|
|
case NB_EV_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NB_OK;
|
|
|
|
}
|