struct static_nexthop *nh;
uint32_t pos;
uint8_t index;
+ uint old_num_labels;
switch (args->event) {
case NB_EV_VALIDATE:
return NB_ERR;
}
index = pos - 1;
+ old_num_labels = nh->snh_label.num_labels;
nh->snh_label.label[index] = 0;
nh->snh_label.num_labels--;
+
+ if (old_num_labels != nh->snh_label.num_labels)
+ nh->state = STATIC_START;
break;
}
struct static_nexthop *nh;
uint32_t pos;
uint8_t index;
+ mpls_label_t old_label;
nh = nb_running_get_entry(args->dnode, NULL, true);
pos = yang_get_list_pos(lyd_parent(args->dnode));
}
/* Mapping to array = list-index -1 */
index = pos - 1;
+
+ old_label = nh->snh_label.label[index];
nh->snh_label.label[index] = yang_dnode_get_uint32(args->dnode, NULL);
+ if (old_label != nh->snh_label.label[index])
+ nh->state = STATIC_START;
+
return NB_OK;
}
{
struct static_nexthop *nh;
enum static_nh_type nh_type;
+ bool old_onlink;
switch (args->event) {
case NB_EV_VALIDATE:
break;
case NB_EV_APPLY:
nh = nb_running_get_entry(args->dnode, NULL, true);
+ old_onlink = nh->onlink;
nh->onlink = yang_dnode_get_bool(args->dnode, NULL);
+
+ if (old_onlink != nh->onlink)
+ nh->state = STATIC_START;
break;
}
static int static_nexthop_color_modify(struct nb_cb_modify_args *args)
{
struct static_nexthop *nh;
+ uint32_t old_color;
nh = nb_running_get_entry(args->dnode, NULL, true);
+ old_color = nh->color;
nh->color = yang_dnode_get_uint32(args->dnode, NULL);
+ if (old_color != nh->color)
+ nh->state = STATIC_START;
+
return NB_OK;
}
static int static_nexthop_color_destroy(struct nb_cb_destroy_args *args)
{
struct static_nexthop *nh;
+ uint32_t old_color;
nh = nb_running_unset_entry(args->dnode);
+ old_color = nh->color;
nh->color = 0;
+ if (old_color != nh->color)
+ nh->state = STATIC_START;
+
return NB_OK;
}