diff options
Diffstat (limited to 'isisd')
| -rw-r--r-- | isisd/isis_cli.c | 6 | ||||
| -rw-r--r-- | isisd/isis_lsp.c | 17 | ||||
| -rw-r--r-- | isisd/isis_mt.c | 14 | ||||
| -rw-r--r-- | isisd/isis_nb.c | 1 | ||||
| -rw-r--r-- | isisd/isis_nb.h | 2 | ||||
| -rw-r--r-- | isisd/isis_nb_config.c | 176 | ||||
| -rw-r--r-- | isisd/isis_nb_state.c | 2 | ||||
| -rw-r--r-- | isisd/isis_spf.c | 13 | ||||
| -rw-r--r-- | isisd/isis_sr.c | 52 | ||||
| -rw-r--r-- | isisd/isis_srv6.c | 2 | ||||
| -rw-r--r-- | isisd/isis_te.c | 6 | ||||
| -rw-r--r-- | isisd/isis_tlvs.c | 827 | ||||
| -rw-r--r-- | isisd/isis_tlvs.h | 1 | 
13 files changed, 198 insertions, 921 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 2b19cbba84..e6cc794bae 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -2065,6 +2065,12 @@ void cli_show_isis_srv6_locator(struct vty *vty, const struct lyd_node *dnode,  	vty_out(vty, "  locator %s\n", yang_dnode_get_string(dnode, NULL));  } +void cli_show_isis_srv6_locator_end(struct vty *vty, +				    const struct lyd_node *dnode) +{ +	vty_out(vty, " exit\n"); +} +  /*   * XPath: /frr-isisd:isis/instance/segment-routing-srv6/enabled   */ diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 391d42fba1..d588af314c 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -711,10 +711,6 @@ void lsp_print_common(struct isis_lsp *lsp, struct vty *vty, struct json_object  	}  } -#if CONFDATE > 20240916 -CPP_NOTICE("Remove JSON in '-' format") -#endif -  void lsp_print_json(struct isis_lsp *lsp, struct json_object *json,  	       char dynhost, struct isis *isis)  { @@ -728,19 +724,11 @@ void lsp_print_json(struct isis_lsp *lsp, struct json_object *json,  	own_json = json_object_new_object();  	json_object_object_add(json, "lsp", own_json);  	json_object_string_add(own_json, "id", LSPid); -#if CONFDATE > 20240916 -	CPP_NOTICE("remove own key") -#endif  	json_object_string_add(own_json, "own", lsp->own_lsp ? "*" : " ");  	if (lsp->own_lsp)  		json_object_boolean_add(own_json, "ownLSP", true); -	json_object_int_add(json, "pdu-len", lsp->hdr.pdu_len);  	json_object_int_add(json, "pduLen", lsp->hdr.pdu_len);  	snprintfrr(buf, sizeof(buf), "0x%08x", lsp->hdr.seqno); -#if CONFDATE > 20240916 -	CPP_NOTICE("remove seq-number key") -#endif -	json_object_string_add(json, "seq-number", buf);  	json_object_string_add(json, "seqNumber", buf);  	snprintfrr(buf, sizeof(buf), "0x%04hx", lsp->hdr.checksum);  	json_object_string_add(json, "chksum", buf); @@ -751,11 +739,6 @@ void lsp_print_json(struct isis_lsp *lsp, struct json_object *json,  	} else {  		json_object_int_add(json, "holdtime", lsp->hdr.rem_lifetime);  	} -#if CONFDATE > 20240916 -	CPP_NOTICE("remove att-p-ol key") -#endif -	json_object_string_add( -		json, "att-p-ol", lsp_bits2string(lsp->hdr.lsp_bits, b, sizeof(b)));  	json_object_string_add(json, "attPOl",  			       lsp_bits2string(lsp->hdr.lsp_bits, b, sizeof(b)));  } diff --git a/isisd/isis_mt.c b/isisd/isis_mt.c index d04a24dc46..65ba395ffc 100644 --- a/isisd/isis_mt.c +++ b/isisd/isis_mt.c @@ -226,7 +226,8 @@ struct isis_area_mt_setting **area_mt_settings(struct isis_area *area,  		count++;  		if (count > size) { -			rv = XREALLOC(MTYPE_TMP, rv, count * sizeof(*rv)); +			rv = XREALLOC(MTYPE_MT_AREA_SETTING, rv, +				      count * sizeof(*rv));  			size = count;  		}  		rv[count - 1] = setting; @@ -341,7 +342,8 @@ circuit_mt_settings(struct isis_circuit *circuit, unsigned int *mt_count)  		count++;  		if (count > size) { -			rv = XREALLOC(MTYPE_TMP, rv, count * sizeof(*rv)); +			rv = XREALLOC(MTYPE_MT_AREA_SETTING, rv, +				      count * sizeof(*rv));  			size = count;  		}  		rv[count - 1] = setting; @@ -376,8 +378,8 @@ bool tlvs_to_adj_mt_set(struct isis_tlvs *tlvs, bool v4_usable, bool v6_usable,  	old_mt_count = adj->mt_count;  	if (old_mt_count) { -		old_mt_set = -			XCALLOC(MTYPE_TMP, old_mt_count * sizeof(*old_mt_set)); +		old_mt_set = XCALLOC(MTYPE_MT_AREA_SETTING, +				     old_mt_count * sizeof(*old_mt_set));  		memcpy(old_mt_set, adj->mt_set,  		       old_mt_count * sizeof(*old_mt_set));  	} @@ -436,7 +438,7 @@ bool tlvs_to_adj_mt_set(struct isis_tlvs *tlvs, bool v4_usable, bool v6_usable,  		changed = true;  	if (old_mt_count) -		XFREE(MTYPE_TMP, old_mt_set); +		XFREE(MTYPE_MT_AREA_SETTING, old_mt_set);  	return changed;  } @@ -464,7 +466,7 @@ static void mt_set_add(uint16_t **mt_set, unsigned int *size,  	}  	if (*index >= *size) { -		*mt_set = XREALLOC(MTYPE_TMP, *mt_set, +		*mt_set = XREALLOC(MTYPE_MT_AREA_SETTING, *mt_set,  				   sizeof(**mt_set) * ((*index) + 1));  		*size = (*index) + 1;  	} diff --git a/isisd/isis_nb.c b/isisd/isis_nb.c index 16cafa2ff0..8608d2b9bd 100644 --- a/isisd/isis_nb.c +++ b/isisd/isis_nb.c @@ -873,6 +873,7 @@ const struct frr_yang_module_info frr_isisd_info = {  				.modify = isis_instance_segment_routing_srv6_locator_modify,  				.destroy = isis_instance_segment_routing_srv6_locator_destroy,  				.cli_show = cli_show_isis_srv6_locator, +				.cli_show_end = cli_show_isis_srv6_locator_end,  			},  		},  		{ diff --git a/isisd/isis_nb.h b/isisd/isis_nb.h index c04a006a2e..1bf95e3db3 100644 --- a/isisd/isis_nb.h +++ b/isisd/isis_nb.h @@ -332,6 +332,8 @@ int isis_instance_segment_routing_srv6_locator_destroy(  	struct nb_cb_destroy_args *args);  void cli_show_isis_srv6_locator(struct vty *vty, const struct lyd_node *dnode,  				bool show_defaults); +void cli_show_isis_srv6_locator_end(struct vty *vty, +				    const struct lyd_node *dnode);  int isis_instance_segment_routing_srv6_msd_node_msd_max_segs_left_modify(  	struct nb_cb_modify_args *args);  int isis_instance_segment_routing_srv6_msd_node_msd_max_end_pop_modify( diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index 2b47d5cbeb..0f0c900ec2 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -2890,29 +2890,22 @@ int isis_instance_flex_algo_destroy(struct nb_cb_destroy_args *args)  	struct isis_area *area;  	uint32_t algorithm; +	if (args->event != NB_EV_APPLY) +		return NB_OK; +  	algorithm = yang_dnode_get_uint32(args->dnode, "flex-algo");  	area = nb_running_get_entry(args->dnode, NULL, true); -	switch (args->event) { -	case NB_EV_APPLY: -		for (ALL_LIST_ELEMENTS(area->flex_algos->flex_algos, node, -				       nnode, fa)) { -			if (fa->algorithm == algorithm) -				flex_algo_free(area->flex_algos, fa); -		} -		if (list_isempty(area->flex_algos->flex_algos)) { -			for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, -						  circuit)) -				isis_link_params_update_asla(circuit, -							     circuit->interface); -		} -		lsp_regenerate_schedule(area, area->is_type, 0); -		break; -	case NB_EV_VALIDATE: -	case NB_EV_PREPARE: -	case NB_EV_ABORT: -		break; +	for (ALL_LIST_ELEMENTS(area->flex_algos->flex_algos, node, nnode, fa)) { +		if (fa->algorithm == algorithm) +			flex_algo_free(area->flex_algos, fa);  	} +	if (list_isempty(area->flex_algos->flex_algos)) { +		for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) +			isis_link_params_update_asla(circuit, +						     circuit->interface); +	} +	lsp_regenerate_schedule(area, area->is_type, 0);  	return NB_OK;  } @@ -2960,26 +2953,22 @@ int isis_instance_flex_algo_advertise_definition_destroy(  	struct flex_algo *fa;  	uint32_t algorithm; + +	if (args->event != NB_EV_APPLY) +		return NB_OK; +  	area = nb_running_get_entry(args->dnode, NULL, true);  	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo"); -	switch (args->event) { -	case NB_EV_APPLY: -		fa = flex_algo_lookup(area->flex_algos, algorithm); -		if (!fa) { -			snprintf(args->errmsg, args->errmsg_len, -				 "flex-algo object not found"); -			return NB_ERR_RESOURCE; -		} -		fa->advertise_definition = false; -		lsp_regenerate_schedule(area, area->is_type, 0); -		break; -	case NB_EV_VALIDATE: -	case NB_EV_PREPARE: -	case NB_EV_ABORT: -		break; +	fa = flex_algo_lookup(area->flex_algos, algorithm); +	if (!fa) { +		snprintf(args->errmsg, args->errmsg_len, +			 "flex-algo object not found"); +		return NB_ERR_RESOURCE;  	} +	fa->advertise_definition = false; +	lsp_regenerate_schedule(area, area->is_type, 0);  	return NB_OK;  } @@ -2987,27 +2976,23 @@ int isis_instance_flex_algo_advertise_definition_destroy(  static int isis_instance_flex_algo_affinity_set(struct nb_cb_create_args *args,  						int type)  { -	struct affinity_map *map; +	char xpathr[XPATH_MAXLEN]; +	struct lyd_node *dnode;  	struct isis_area *area;  	struct admin_group *ag; +	uint16_t bit_position;  	struct flex_algo *fa;  	uint32_t algorithm;  	const char *val; -	algorithm = yang_dnode_get_uint32(args->dnode, "../../flex-algo"); -	area = nb_running_get_entry(args->dnode, NULL, true);  	val = yang_dnode_get_string(args->dnode, ".");  	switch (args->event) {  	case NB_EV_VALIDATE: -		fa = flex_algo_lookup(area->flex_algos, algorithm); -		if (!fa) { -			snprintf(args->errmsg, args->errmsg_len, -				 "flex-algo object not found"); -			return NB_ERR_RESOURCE; -		} -		map = affinity_map_get(val); -		if (!map) { +		snprintf(xpathr, sizeof(xpathr), +			 "/frr-affinity-map:lib/affinity-maps/affinity-map[name='%s']/value", +			 val); +		if (!yang_dnode_get(args->dnode, xpathr)) {  			snprintf(args->errmsg, args->errmsg_len,  				 "affinity map %s isn't found", val);  			return NB_ERR_VALIDATION; @@ -3017,14 +3002,20 @@ static int isis_instance_flex_algo_affinity_set(struct nb_cb_create_args *args,  	case NB_EV_ABORT:  		break;  	case NB_EV_APPLY: +		algorithm = yang_dnode_get_uint32(args->dnode, +						  "../../flex-algo"); +		area = nb_running_get_entry(args->dnode, NULL, true);  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len,  				 "flex-algo object not found");  			return NB_ERR_RESOURCE;  		} -		map = affinity_map_get(val); -		if (!map) { +		snprintf(xpathr, sizeof(xpathr), +			 "/frr-affinity-map:lib/affinity-maps/affinity-map[name='%s']/value", +			 val); +		dnode = yang_dnode_get(args->dnode, xpathr); +		if (!dnode) {  			snprintf(args->errmsg, args->errmsg_len,  				 "affinity map %s isn't found", val);  			return NB_ERR_RESOURCE; @@ -3038,7 +3029,8 @@ static int isis_instance_flex_algo_affinity_set(struct nb_cb_create_args *args,  		else  			break; -		admin_group_set(ag, map->bit_position); +		bit_position = yang_dnode_get_uint16(dnode, NULL); +		admin_group_set(ag, bit_position);  		lsp_regenerate_schedule(area, area->is_type, 0);  		break;  	} @@ -3057,18 +3049,10 @@ isis_instance_flex_algo_affinity_unset(struct nb_cb_destroy_args *args,  	uint32_t algorithm;  	const char *val; -	algorithm = yang_dnode_get_uint32(args->dnode, "../../flex-algo"); -	area = nb_running_get_entry(args->dnode, NULL, true);  	val = yang_dnode_get_string(args->dnode, ".");  	switch (args->event) {  	case NB_EV_VALIDATE: -		fa = flex_algo_lookup(area->flex_algos, algorithm); -		if (!fa) { -			snprintf(args->errmsg, args->errmsg_len, -				 "flex-algo object not found"); -			return NB_ERR_RESOURCE; -		}  		map = affinity_map_get(val);  		if (!map) {  			snprintf(args->errmsg, args->errmsg_len, @@ -3080,6 +3064,9 @@ isis_instance_flex_algo_affinity_unset(struct nb_cb_destroy_args *args,  	case NB_EV_ABORT:  		break;  	case NB_EV_APPLY: +		algorithm = yang_dnode_get_uint32(args->dnode, +						  "../../flex-algo"); +		area = nb_running_get_entry(args->dnode, NULL, true);  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len, @@ -3169,19 +3156,16 @@ int isis_instance_flex_algo_affinity_exclude_any_destroy(  int isis_instance_flex_algo_prefix_metric_create(struct nb_cb_create_args *args)  {  	struct isis_area *area; -	const char *area_tag;  	struct flex_algo *fa;  	uint32_t algorithm; -	area_tag = yang_dnode_get_string(args->dnode, "../../../area-tag"); -	area = isis_area_lookup(area_tag, VRF_DEFAULT); -	if (!area) -		return NB_ERR_RESOURCE; -  	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: +		area = nb_running_get_entry(args->dnode, NULL, true); +		if (!area) +			return NB_ERR_RESOURCE;  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len, @@ -3204,19 +3188,17 @@ int isis_instance_flex_algo_prefix_metric_destroy(  	struct nb_cb_destroy_args *args)  {  	struct isis_area *area; -	const char *area_tag;  	struct flex_algo *fa;  	uint32_t algorithm; -	area_tag = yang_dnode_get_string(args->dnode, "../../../area-tag"); -	area = isis_area_lookup(area_tag, VRF_DEFAULT); -	if (!area) -		return NB_ERR_RESOURCE; -  	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: +		area = nb_running_get_entry(args->dnode, NULL, true); +		if (!area) +			return NB_ERR_RESOURCE; +  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len, @@ -3239,19 +3221,17 @@ static int isis_instance_flex_algo_dplane_set(struct nb_cb_create_args *args,  					      int type)  {  	struct isis_area *area; -	const char *area_tag;  	struct flex_algo *fa;  	uint32_t algorithm; -	area_tag = yang_dnode_get_string(args->dnode, "../../../area-tag"); -	area = isis_area_lookup(area_tag, VRF_DEFAULT); -	if (!area) -		return NB_ERR_RESOURCE; -  	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: +		area = nb_running_get_entry(args->dnode, NULL, true); +		if (!area) +			return NB_ERR_RESOURCE; +  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len, @@ -3281,19 +3261,17 @@ static int isis_instance_flex_algo_dplane_unset(struct nb_cb_destroy_args *args,  						int type)  {  	struct isis_area *area; -	const char *area_tag;  	struct flex_algo *fa;  	uint32_t algorithm; -	area_tag = yang_dnode_get_string(args->dnode, "../../../area-tag"); -	area = isis_area_lookup(area_tag, VRF_DEFAULT); -	if (!area) -		return NB_ERR_RESOURCE; -  	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: +		area = nb_running_get_entry(args->dnode, NULL, true); +		if (!area) +			return NB_ERR_RESOURCE; +  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len, @@ -3363,21 +3341,19 @@ int isis_instance_flex_algo_dplane_ip_destroy(struct nb_cb_destroy_args *args)  int isis_instance_flex_algo_metric_type_modify(struct nb_cb_modify_args *args)  {  	struct isis_area *area; -	const char *area_tag;  	struct flex_algo *fa;  	uint32_t algorithm;  	enum flex_algo_metric_type metric_type; -	area_tag = yang_dnode_get_string(args->dnode, "../../../area-tag"); -	area = isis_area_lookup(area_tag, VRF_DEFAULT); -	if (!area) -		return NB_ERR_RESOURCE; -  	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	metric_type = yang_dnode_get_enum(args->dnode, NULL);  	switch (args->event) {  	case NB_EV_APPLY: +		area = nb_running_get_entry(args->dnode, NULL, true); +		if (!area) +			return NB_ERR_RESOURCE; +  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len, @@ -3403,21 +3379,19 @@ int isis_instance_flex_algo_metric_type_modify(struct nb_cb_modify_args *args)  int isis_instance_flex_algo_priority_modify(struct nb_cb_modify_args *args)  {  	struct isis_area *area; -	const char *area_tag;  	struct flex_algo *fa;  	uint32_t algorithm;  	uint32_t priority; -	area_tag = yang_dnode_get_string(args->dnode, "../../../area-tag"); -	area = isis_area_lookup(area_tag, VRF_DEFAULT); -	if (!area) -		return NB_ERR_RESOURCE; -  	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	priority = yang_dnode_get_uint32(args->dnode, NULL);  	switch (args->event) {  	case NB_EV_APPLY: +		area = nb_running_get_entry(args->dnode, NULL, true); +		if (!area) +			return NB_ERR_RESOURCE; +  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len, @@ -3439,21 +3413,19 @@ int isis_instance_flex_algo_priority_modify(struct nb_cb_modify_args *args)  int isis_instance_flex_algo_priority_destroy(struct nb_cb_destroy_args *args)  {  	struct isis_area *area; -	const char *area_tag;  	struct flex_algo *fa;  	uint32_t algorithm;  	uint32_t priority = FLEX_ALGO_PRIO_DEFAULT; -	area_tag = yang_dnode_get_string(args->dnode, "../../../area-tag"); -	area = isis_area_lookup(area_tag, VRF_DEFAULT); -	if (!area) -		return NB_ERR_RESOURCE; -  	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	priority = yang_dnode_get_uint32(args->dnode, NULL);  	switch (args->event) {  	case NB_EV_APPLY: +		area = nb_running_get_entry(args->dnode, NULL, true); +		if (!area) +			return NB_ERR_RESOURCE; +  		fa = flex_algo_lookup(area->flex_algos, algorithm);  		if (!fa) {  			snprintf(args->errmsg, args->errmsg_len, @@ -4325,14 +4297,6 @@ static int lib_interface_isis_multi_topology_common(  	switch (event) {  	case NB_EV_VALIDATE: -		circuit = nb_running_get_entry(dnode, NULL, false); -		if (circuit && circuit->area && circuit->area->oldmetric) { -			snprintf( -				errmsg, errmsg_len, -				"Multi topology IS-IS can only be used with wide metrics"); -			return NB_ERR_VALIDATION; -		} -		break;  	case NB_EV_PREPARE:  	case NB_EV_ABORT:  		break; diff --git a/isisd/isis_nb_state.c b/isisd/isis_nb_state.c index b7c33ed27b..da61bcced3 100644 --- a/isisd/isis_nb_state.c +++ b/isisd/isis_nb_state.c @@ -98,6 +98,8 @@ const void *lib_interface_state_isis_adjacencies_adjacency_get_next(  			 * adjacencies list.  			 */  			list = circuit->u.bc.adjdb[ISIS_LEVEL2 - 1]; +			if (!list) +				break;  			adj_next = listnode_head(list);  		}  		break; diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 86302076f8..8fc0f144b2 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1469,14 +1469,13 @@ static void spf_adj_list_parse_tlv(struct isis_spftree *spftree,  		sadj->metric = metric;  	if (oldmetric)  		SET_FLAG(flags, F_ISIS_SPF_ADJ_OLDMETRIC); +	if ((oldmetric && sadj->metric == ISIS_NARROW_METRIC_INFINITY) || +	    (!oldmetric && sadj->metric == ISIS_WIDE_METRIC_INFINITY)) +		SET_FLAG(flags, F_ISIS_SPF_ADJ_METRIC_INFINITY);  	sadj->lsp = lsp;  	sadj->subtlvs = subtlvs;  	sadj->flags = flags; -	if ((oldmetric && metric == ISIS_NARROW_METRIC_INFINITY) -	    || (!oldmetric && metric == ISIS_WIDE_METRIC_INFINITY)) -		SET_FLAG(flags, F_ISIS_SPF_ADJ_METRIC_INFINITY); -  	/* Set real adjacency. */  	if (!CHECK_FLAG(spftree->flags, F_SPFTREE_NO_ADJACENCIES)  	    && !LSP_PSEUDO_ID(id)) { @@ -2337,7 +2336,7 @@ static void isis_print_paths(struct vty *vty, struct isis_vertex_queue *queue,  	if (json == NULL) {  		table = ttable_dump(tt, "\n");  		vty_out(vty, "%s\n", table); -		XFREE(MTYPE_TMP, table); +		XFREE(MTYPE_TMP_TTABLE, table);  	} else  		*json = ttable_json_with_json_text(  			tt, "ssdsss", @@ -3016,7 +3015,7 @@ void isis_print_routes(struct vty *vty, struct isis_spftree *spftree,  		table = ttable_dump(tt, "\n");  		vty_out(vty, "%s\n", table); -		XFREE(MTYPE_TMP, table); +		XFREE(MTYPE_TMP_TTABLE, table);  	} else if (json) {  		*json = ttable_json_with_json_text(  			tt, prefix_sid ? "sdssdsdd" : "sdsss", @@ -3458,7 +3457,7 @@ static void isis_print_frr_summary(struct vty *vty,  	/* Dump the generated table. */  	table = ttable_dump(tt, "\n");  	vty_out(vty, "%s\n", table); -	XFREE(MTYPE_TMP, table); +	XFREE(MTYPE_TMP_TTABLE, table);  	ttable_del(tt);  } diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index f783038006..95ea36c3a8 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -627,6 +627,50 @@ static int sr_local_block_release_label(struct sr_local_block *srlb,  	return 0;  } +static bool sr_adj_same_subnet_ipv4(struct in_addr ipv4, +				    struct isis_circuit *circuit) +{ +	struct listnode *node; +	struct prefix ipv4_adj; +	struct prefix_ipv4 *ipv4_circuit; + +	ipv4_adj.family = AF_INET; +	ipv4_adj.u.prefix4 = ipv4; + +	for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node, ipv4_circuit)) { +		ipv4_adj.prefixlen = ipv4_circuit->prefixlen; +		if (!prefix_cmp(&ipv4_adj, (struct prefix *)ipv4_circuit)) +			return true; +	} + +	return false; +} + +static bool sr_adj_same_subnet_ipv6(struct in6_addr *ipv6, +				    struct isis_circuit *circuit) +{ +	struct listnode *node; +	struct prefix ipv6_adj; +	struct prefix_ipv6 *ipv6_circuit; + +	ipv6_adj.family = AF_INET6; +	IPV6_ADDR_COPY(&ipv6_adj.u.prefix6, ipv6); + +	for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node, ipv6_circuit)) { +		ipv6_adj.prefixlen = ipv6_circuit->prefixlen; +		if (!prefix_cmp(&ipv6_adj, (struct prefix *)ipv6_circuit)) +			return true; +	} + +	for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node, ipv6_circuit)) { +		ipv6_adj.prefixlen = ipv6_circuit->prefixlen; +		if (!prefix_cmp(&ipv6_adj, (struct prefix *)ipv6_circuit)) +			return true; +	} + +	return false; +} +  /* --- Segment Routing Adjacency-SID management functions ------------------- */  /** @@ -658,12 +702,18 @@ void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, bool backup,  		if (!circuit->ip_router || !adj->ipv4_address_count)  			return; +		if (!sr_adj_same_subnet_ipv4(adj->ipv4_addresses[0], circuit)) +			return; +  		nexthop.ipv4 = adj->ipv4_addresses[0];  		break;  	case AF_INET6:  		if (!circuit->ipv6_router || !adj->ll_ipv6_count)  			return; +		if (!sr_adj_same_subnet_ipv6(&adj->ll_ipv6_addrs[0], circuit)) +			return; +  		nexthop.ipv6 = adj->ll_ipv6_addrs[0];  		break;  	default: @@ -1064,7 +1114,7 @@ static void show_node(struct vty *vty, struct isis_area *area, int level,  		table = ttable_dump(tt, "\n");  		vty_out(vty, "%s\n", table); -		XFREE(MTYPE_TMP, table); +		XFREE(MTYPE_TMP_TTABLE, table);  	}  	ttable_del(tt);  } diff --git a/isisd/isis_srv6.c b/isisd/isis_srv6.c index b5974b1a62..2348bd043a 100644 --- a/isisd/isis_srv6.c +++ b/isisd/isis_srv6.c @@ -591,7 +591,7 @@ static void show_node(struct vty *vty, struct isis_area *area, int level)  		table = ttable_dump(tt, "\n");  		vty_out(vty, "%s\n", table); -		XFREE(MTYPE_TMP, table); +		XFREE(MTYPE_TMP_TTABLE, table);  	}  	ttable_del(tt);  } diff --git a/isisd/isis_te.c b/isisd/isis_te.c index b6321dbac3..c9af39ce5a 100644 --- a/isisd/isis_te.c +++ b/isisd/isis_te.c @@ -172,6 +172,10 @@ void isis_link_params_update_asla(struct isis_circuit *circuit,  	struct isis_ext_subtlvs *ext = circuit->ext;  	int i; +	if (!ext) +		/* no extended subTLVs - nothing to update */ +		return; +  	if (!HAS_LINK_PARAMS(ifp)) {  		list_delete_all_node(ext->aslas);  		return; @@ -327,7 +331,7 @@ void isis_link_params_update(struct isis_circuit *circuit,  		return;  	/* Sanity Check */ -	if ((ifp == NULL) || (circuit->state != C_STATE_UP)) +	if (ifp == NULL)  		return;  	te_debug("ISIS-TE(%s): Update circuit parameters for interface %s", diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index c7f45b2469..b5caf396c1 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -565,10 +565,6 @@ static void format_item_asla_subtlvs(struct isis_asla_subtlvs *asla,  			  asla->use_bw);  } -#if CONFDATE > 20240916 -CPP_NOTICE("Remove JSON in '-' format") -#endif -  /* mtid parameter is used to manage multi-topology i.e. IPv4 / IPv6 */  static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  				    struct sbuf *buf, struct json_object *json, @@ -585,10 +581,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			snprintfrr(aux_buf, sizeof(aux_buf), "0x%x",  				   exts->adm_group); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "adm-group", aux_buf);  			json_object_string_add(json, "admGroup", aux_buf);  		} else {  			sbuf_push(buf, indent, "Admin Group: 0x%08x\n", @@ -639,13 +631,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  	}  	if (IS_SUBTLV(exts, EXT_LLRI)) {  		if (json) { -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_int_add(json, "link-local-id", -					    exts->local_llri); -			json_object_int_add(json, "link-remote-id", -					    exts->remote_llri);  			json_object_int_add(json, "linkLocalId",  					    exts->local_llri);  			json_object_int_add(json, "linkRemoteId", @@ -661,10 +646,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			inet_ntop(AF_INET, &exts->local_addr, aux_buf,  				  sizeof(aux_buf)); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "local-iface-ip", aux_buf);  			json_object_string_add(json, "localIfaceIp", aux_buf);  		} else  			sbuf_push(buf, indent, @@ -675,11 +656,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			inet_ntop(AF_INET, &exts->neigh_addr, aux_buf,  				  sizeof(aux_buf)); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "remote-iface-ip", -					       aux_buf);  			json_object_string_add(json, "remoteIfaceIp", aux_buf);  		} else  			sbuf_push(buf, indent, @@ -690,11 +666,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			inet_ntop(AF_INET6, &exts->local_addr6, aux_buf,  				  sizeof(aux_buf)); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "local-iface-ipv6", -					       aux_buf);  			json_object_string_add(json, "localIfaceIpv6", aux_buf);  		} else  			sbuf_push(buf, indent, @@ -705,11 +676,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			inet_ntop(AF_INET6, &exts->neigh_addr6, aux_buf,  				  sizeof(aux_buf)); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "remote-iface-ipv6", -					       aux_buf);  			json_object_string_add(json, "remoteIfaceIpv6", aux_buf);  		} else  			sbuf_push(buf, indent, @@ -720,11 +686,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			snprintfrr(aux_buf, sizeof(aux_buf), "%g",  				   exts->max_bw); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "max-bandwith-bytes-sec", -					       aux_buf);  			json_object_string_add(json, "maxBandwithBytesSec",  					       aux_buf);  		} else @@ -736,11 +697,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			snprintfrr(aux_buf, sizeof(aux_buf), "%g",  				   exts->max_rsv_bw); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add( -				json, "max-res-bandwith-bytes-sec", aux_buf);  			json_object_string_add(json, "maxResBandwithBytesSec",  					       aux_buf);  		} else @@ -763,22 +719,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  				json_object_string_add(unrsv_json, cnt_buf,  						       aux_buf);  			} - -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			/* old deprecated key format */ -			unrsv_json = json_object_new_object(); -			json_object_object_add(json, "unrsv-bandwith-bytes-sec", -					       unrsv_json); -			for (int j = 0; j < MAX_CLASS_TYPE; j += 1) { -				snprintfrr(cnt_buf, sizeof(cnt_buf), "%d", j); -				snprintfrr(aux_buf, sizeof(aux_buf), "%g", -					   exts->unrsv_bw[j]); -				json_object_string_add(unrsv_json, cnt_buf, -						       aux_buf); -			} -			/* end old deprecated key format */  		} else {  			sbuf_push(buf, indent, "Unreserved Bandwidth:\n");  			for (int j = 0; j < MAX_CLASS_TYPE; j += 2) { @@ -791,27 +731,18 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		}  	}  	if (IS_SUBTLV(exts, EXT_TE_METRIC)) { -		if (json) { -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_int_add(json, "te-metric", exts->te_metric); +		if (json)  			json_object_int_add(json, "teMetric", exts->te_metric); -		} else +		else  			sbuf_push(buf, indent,  				  "Traffic Engineering Metric: %u\n",  				  exts->te_metric);  	}  	if (IS_SUBTLV(exts, EXT_RMT_AS)) { -		if (json) { -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_int_add(json, "inter-as-te-remote-as", -					    exts->remote_as); +		if (json)  			json_object_int_add(json, "interAsTeRemoteAs",  					    exts->remote_as); -		} else +		else  			sbuf_push(buf, indent,  				  "Inter-AS TE Remote AS number: %u\n",  				  exts->remote_as); @@ -820,11 +751,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			inet_ntop(AF_INET6, &exts->remote_ip, aux_buf,  				  sizeof(aux_buf)); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add( -				json, "inter-as-te-remote-asbr-ip", aux_buf);  			json_object_string_add(json, "interAsTeRemoteAsbrIp",  					       aux_buf);  		} else @@ -836,16 +762,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  	if (IS_SUBTLV(exts, EXT_DELAY)) {  		if (json) {  			struct json_object *avg_json; -			avg_json = json_object_new_object(); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_object_add(json, "avg-delay", avg_json); -			json_object_string_add(avg_json, "delay", -					       IS_ANORMAL(exts->delay) -						       ? "Anomalous" -						       : "Normal"); -			json_object_int_add(avg_json, "micro-sec", exts->delay);  			avg_json = json_object_new_object();  			json_object_object_add(json, "avgDelay", avg_json); @@ -864,19 +780,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  	if (IS_SUBTLV(exts, EXT_MM_DELAY)) {  		if (json) {  			struct json_object *avg_json; -			avg_json = json_object_new_object(); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_object_add(json, "max-min-delay", avg_json); -			json_object_string_add(avg_json, "delay", -					       IS_ANORMAL(exts->min_delay) -						       ? "Anomalous" -						       : "Normal"); -			snprintfrr(aux_buf, sizeof(aux_buf), "%u / %u", -				   exts->min_delay & TE_EXT_MASK, -				   exts->max_delay & TE_EXT_MASK); -			json_object_string_add(avg_json, "micro-sec", aux_buf);  			avg_json = json_object_new_object();  			json_object_object_add(json, "maxMinDelay", avg_json); @@ -899,15 +802,10 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  				exts->max_delay & TE_EXT_MASK);  	}  	if (IS_SUBTLV(exts, EXT_DELAY_VAR)) { -		if (json) { -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_int_add(json, "delay-variation-micro-sec", -					    exts->delay_var & TE_EXT_MASK); +		if (json)  			json_object_int_add(json, "delayVariationMicroSec",  					    exts->delay_var & TE_EXT_MASK); -		} else +		else  			sbuf_push(buf, indent,  				  "Delay Variation: %u (micro-sec)\n",  				  exts->delay_var & TE_EXT_MASK); @@ -919,20 +817,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  					   LOSS_PRECISION));  			struct json_object *link_json; -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			link_json = json_object_new_object(); -			json_object_object_add(json, "link-packet-loss", -					       link_json); -			json_object_string_add(link_json, "loss", -					       IS_ANORMAL(exts->pkt_loss) -						       ? "Anomalous" -						       : "Normal"); -			/* typo */ -			json_object_string_add(link_json, "percentaje", -					       aux_buf); -  			link_json = json_object_new_object();  			json_object_object_add(json, "linkPacketLoss",  					       link_json); @@ -952,12 +836,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			snprintfrr(aux_buf, sizeof(aux_buf), "%g",  				   (exts->res_bw)); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, -					       "unidir-residual-band-bytes-sec", -					       aux_buf);  			json_object_string_add(json,  					       "unidirResidualBandBytesSec",  					       aux_buf); @@ -971,12 +849,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			snprintfrr(aux_buf, sizeof(aux_buf), "%g",  				   (exts->ava_bw)); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add( -				json, "unidir-available-band-bytes-sec", -				aux_buf);  			json_object_string_add(json,  					       "unidirAvailableBandBytesSec",  					       aux_buf); @@ -991,12 +863,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  			snprintfrr(aux_buf, sizeof(aux_buf), "%g",  				   (exts->use_bw));  			json_object_string_add(json, -					       "unidir-utilized-band-bytes-sec", -					       aux_buf); -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json,  					       "unidirUtilizedBandBytesSec",  					       aux_buf);  		} else @@ -1012,50 +878,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			struct json_object *arr_adj_json, *adj_sid_json; -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			/* old deprecated key format */ -			arr_adj_json = json_object_new_array(); -			json_object_object_add(json, "adj-sid", arr_adj_json); -			for (adj = (struct isis_adj_sid *)exts->adj_sid.head; -			     adj; adj = adj->next) { -				snprintfrr(cnt_buf, sizeof(cnt_buf), "%d", -					   adj->sid); -				adj_sid_json = json_object_new_object(); -				json_object_int_add(adj_sid_json, "sid", -						    adj->sid); -				json_object_int_add(adj_sid_json, "weight", -						    adj->weight); -				json_object_string_add(adj_sid_json, "flag-f", -						       adj->flags & EXT_SUBTLV_LINK_ADJ_SID_FFLG -							       ? "1" -							       : "0"); -				json_object_string_add(adj_sid_json, "flag-b", -						       adj->flags & EXT_SUBTLV_LINK_ADJ_SID_BFLG -							       ? "1" -							       : "0"); -				json_object_string_add(adj_sid_json, "flag-v", -						       adj->flags & EXT_SUBTLV_LINK_ADJ_SID_VFLG -							       ? "1" -							       : "0"); -				json_object_string_add(adj_sid_json, "flag-l", -						       adj->flags & EXT_SUBTLV_LINK_ADJ_SID_LFLG -							       ? "1" -							       : "0"); -				json_object_string_add(adj_sid_json, "flag-s", -						       adj->flags & EXT_SUBTLV_LINK_ADJ_SID_SFLG -							       ? "1" -							       : "0"); -				json_object_string_add(adj_sid_json, "flag-p", -						       adj->flags & EXT_SUBTLV_LINK_ADJ_SID_PFLG -							       ? "1" -							       : "0"); -				json_object_array_add(arr_adj_json, -						      adj_sid_json); -			} -			/* end old deprecated key format */ -  			arr_adj_json = json_object_new_array();  			json_object_object_add(json, "adjSid", arr_adj_json);  			for (adj = (struct isis_adj_sid *)exts->adj_sid.head; @@ -1127,57 +949,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			struct json_object *arr_adj_json, *lan_adj_json; -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			/* old deprecated key format */ -			arr_adj_json = json_object_new_array(); -			json_object_object_add(json, "lan-adj-sid", -					       arr_adj_json); -			for (lan = (struct isis_lan_adj_sid *) -					   exts->adj_sid.head; -			     lan; lan = lan->next) { -				if (((mtid == ISIS_MT_IPV4_UNICAST) && -				     (lan->family != AF_INET)) || -				    ((mtid == ISIS_MT_IPV6_UNICAST) && -				     (lan->family != AF_INET6))) -					continue; -				snprintfrr(cnt_buf, sizeof(cnt_buf), "%d", -					   lan->sid); -				lan_adj_json = json_object_new_object(); -				json_object_int_add(lan_adj_json, "sid", -						    lan->sid); -				json_object_int_add(lan_adj_json, "weight", -						    lan->weight); -				json_object_string_add(lan_adj_json, "flag-f", -						       lan->flags & EXT_SUBTLV_LINK_ADJ_SID_FFLG -							       ? "1" -							       : "0"); -				json_object_string_add(lan_adj_json, "flag-b", -						       lan->flags & EXT_SUBTLV_LINK_ADJ_SID_BFLG -							       ? "1" -							       : "0"); -				json_object_string_add(lan_adj_json, "flag-v", -						       lan->flags & EXT_SUBTLV_LINK_ADJ_SID_VFLG -							       ? "1" -							       : "0"); -				json_object_string_add(lan_adj_json, "flag-l", -						       lan->flags & EXT_SUBTLV_LINK_ADJ_SID_LFLG -							       ? "1" -							       : "0"); -				json_object_string_add(lan_adj_json, "flag-s", -						       lan->flags & EXT_SUBTLV_LINK_ADJ_SID_SFLG -							       ? "1" -							       : "0"); -				json_object_string_add(lan_adj_json, "flag-p", -						       lan->flags & EXT_SUBTLV_LINK_ADJ_SID_PFLG -							       ? "1" -							       : "0"); -				json_object_array_add(arr_adj_json, -						      lan_adj_json); -			} -			/* end old deprecated key format */ -  			arr_adj_json = json_object_new_array();  			json_object_object_add(json, "lanAdjSid", arr_adj_json);  			for (lan = (struct isis_lan_adj_sid *)exts->adj_sid.head; @@ -1264,57 +1035,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  		if (json) {  			struct json_object *arr_adj_json, *srv6_endx_sid_json; -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			/* old deprecated key format */ -			arr_adj_json = json_object_new_array(); -			json_object_object_add(json, "srv6-endx-sid", -					       arr_adj_json); -			for (adj = (struct isis_srv6_endx_sid_subtlv *) -					   exts->srv6_endx_sid.head; -			     adj; adj = adj->next) { -				snprintfrr(cnt_buf, sizeof(cnt_buf), "%pI6", -					   &adj->sid); -				srv6_endx_sid_json = json_object_new_object(); -				json_object_string_addf(srv6_endx_sid_json, -							"sid", "%pI6", -							&adj->sid); -				json_object_string_add(srv6_endx_sid_json, -						       "algorithm", -						       sr_algorithm_string( -							       adj->algorithm)); -				json_object_int_add(srv6_endx_sid_json, -						    "weight", adj->weight); -				json_object_string_add(srv6_endx_sid_json, -						       "behavior", -						       seg6local_action2str( -							       adj->behavior)); -				json_object_string_add(srv6_endx_sid_json, -						       "flag-b", -						       adj->flags & EXT_SUBTLV_LINK_SRV6_ENDX_SID_BFLG -							       ? "1" -							       : "0"); -				json_object_string_add(srv6_endx_sid_json, -						       "flag-s", -						       adj->flags & EXT_SUBTLV_LINK_SRV6_ENDX_SID_SFLG -							       ? "1" -							       : "0"); -				json_object_string_add(srv6_endx_sid_json, -						       "flag-p", -						       adj->flags & EXT_SUBTLV_LINK_SRV6_ENDX_SID_PFLG -							       ? "1" -							       : "0"); -				json_object_array_add(arr_adj_json, -						      srv6_endx_sid_json); -				if (adj->subsubtlvs) -					isis_format_subsubtlvs(adj->subsubtlvs, -							       NULL, -							       srv6_endx_sid_json, -							       indent + 4); -			} -			/* end old deprecated key format */ -  			arr_adj_json = json_object_new_array();  			json_object_object_add(json, "srv6EndXSID",  					       arr_adj_json); @@ -1390,63 +1110,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,  			struct json_object *arr_adj_json,  				*srv6_lan_endx_sid_json; -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			/* old deprecated key format */ -			arr_adj_json = json_object_new_array(); -			json_object_object_add(json, "srv6-lan-endx-sid", -					       arr_adj_json); -			for (lan = (struct isis_srv6_lan_endx_sid_subtlv *) -					   exts->srv6_lan_endx_sid.head; -			     lan; lan = lan->next) { -				snprintfrr(cnt_buf, sizeof(cnt_buf), "%pI6", -					   &lan->sid); -				srv6_lan_endx_sid_json = -					json_object_new_object(); -				json_object_string_addf(srv6_lan_endx_sid_json, -							"sid", "%pI6", -							&lan->sid); -				json_object_int_add(srv6_lan_endx_sid_json, -						    "weight", lan->weight); -				json_object_string_add(srv6_lan_endx_sid_json, -						       "algorithm", -						       sr_algorithm_string( -							       lan->algorithm)); -				json_object_int_add(srv6_lan_endx_sid_json, -						    "weight", lan->weight); -				json_object_string_add(srv6_lan_endx_sid_json, -						       "behavior", -						       seg6local_action2str( -							       lan->behavior)); -				json_object_string_add(srv6_lan_endx_sid_json, -						       "flag-b", -						       lan->flags & EXT_SUBTLV_LINK_SRV6_ENDX_SID_BFLG -							       ? "1" -							       : "0"); -				json_object_string_add(srv6_lan_endx_sid_json, -						       "flag-s", -						       lan->flags & EXT_SUBTLV_LINK_SRV6_ENDX_SID_SFLG -							       ? "1" -							       : "0"); -				json_object_string_add(srv6_lan_endx_sid_json, -						       "flag-p", -						       lan->flags & EXT_SUBTLV_LINK_SRV6_ENDX_SID_PFLG -							       ? "1" -							       : "0"); -				json_object_string_addf(srv6_lan_endx_sid_json, -							"neighbor-id", "%pSY", -							lan->neighbor_id); -				json_object_array_add(arr_adj_json, -						      srv6_lan_endx_sid_json); -				if (lan->subsubtlvs) -					isis_format_subsubtlvs(lan->subsubtlvs, -							       NULL, -							       srv6_lan_endx_sid_json, -							       indent + 4); -			} -			/* end old deprecated key format */ -  			arr_adj_json = json_object_new_array();  			json_object_object_add(json, "srv6LanEndxSID",  					       arr_adj_json); @@ -1914,8 +1577,8 @@ static int unpack_item_ext_subtlv_asla(uint16_t mtid, uint8_t subtlv_len,  	uint8_t sabm_flag_len;  	/* User-defined App Identifier Bit Flags/Length */  	uint8_t uabm_flag_len; -	uint8_t sabm[ASLA_APP_IDENTIFIER_BIT_LENGTH] = {0}; -	uint8_t uabm[ASLA_APP_IDENTIFIER_BIT_LENGTH] = {0}; +	uint8_t sabm[ASLA_APP_IDENTIFIER_BIT_MAX_LENGTH] = { 0 }; +	uint8_t uabm[ASLA_APP_IDENTIFIER_BIT_MAX_LENGTH] = { 0 };  	uint8_t readable = subtlv_len;  	uint8_t subsubtlv_type;  	uint8_t subsubtlv_len; @@ -1946,6 +1609,15 @@ static int unpack_item_ext_subtlv_asla(uint16_t mtid, uint8_t subtlv_len,  		return -1;  	} +	if ((asla->standard_apps_length > ASLA_APP_IDENTIFIER_BIT_MAX_LENGTH) || +	    (asla->user_def_apps_length > ASLA_APP_IDENTIFIER_BIT_MAX_LENGTH)) { +		zlog_err("Standard or User-Defined Application Identifier Bit Mask Length greater than %u bytes. Received respectively a length of %u and %u bytes.", +			 ASLA_APP_IDENTIFIER_BIT_MAX_LENGTH, +			 asla->standard_apps_length, asla->user_def_apps_length); +		stream_forward_getp(s, readable); +		return -1; +	} +  	for (int i = 0; i < asla->standard_apps_length; i++)  		sabm[i] = stream_getc(s);  	for (int i = 0; i < asla->user_def_apps_length; i++) @@ -2604,33 +2276,6 @@ static void format_item_prefix_sid(uint16_t mtid, struct isis_item *i,  		}  		json_object_int_add(sr_json, "alg", sid->algorithm); -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated non boolean json") -#endif -		/* old deprecated keys (no booleans) */ -		json_object_string_add( -			sr_json, "readvertised", -			((sid->flags & ISIS_PREFIX_SID_READVERTISED) ? "yes" -								     : "")); -		json_object_string_add( -			sr_json, "node", -			((sid->flags & ISIS_PREFIX_SID_NODE) ? "yes" : "")); -		json_object_string_add(sr_json, "php", -				       ((sid->flags & ISIS_PREFIX_SID_NO_PHP) -						? "no-php" -						: "php")); -		json_object_string_add( -			sr_json, "explicit-null", -			((sid->flags & ISIS_PREFIX_SID_EXPLICIT_NULL) ? "yes" -								      : "")); -		json_object_string_add( -			sr_json, "value", -			((sid->flags & ISIS_PREFIX_SID_VALUE) ? "yes" : "")); -		json_object_string_add( -			sr_json, "local", -			((sid->flags & ISIS_PREFIX_SID_LOCAL) ? "yes" : "")); -		/* end deprecated keys (no booleans) */ -  		struct json_object *flags_json;  		flags_json = json_object_new_object(); @@ -2779,10 +2424,6 @@ static void format_subtlv_ipv6_source_prefix(struct prefix_ipv6 *p,  	char prefixbuf[PREFIX2STR_BUFFER];  	if (json) {  		prefix2str(p, prefixbuf, sizeof(prefixbuf)); -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		json_object_string_add(json, "ipv6-src-prefix", prefixbuf);  		json_object_string_add(json, "ipv6SrcPrefix", prefixbuf);  	} else {  		sbuf_push(buf, indent, "IPv6 Source Prefix: %s\n", @@ -2886,23 +2527,6 @@ static void format_subsubtlv_srv6_sid_structure(  	if (json) {  		struct json_object *sid_struct_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		sid_struct_json = json_object_new_object(); -		json_object_object_add(json, "srv6-sid-structure", -				       sid_struct_json); -		json_object_int_add(sid_struct_json, "loc-block-len", -				    sid_struct->loc_block_len); -		json_object_int_add(sid_struct_json, "loc-node-len", -				    sid_struct->loc_node_len); -		json_object_int_add(sid_struct_json, "func-len", -				    sid_struct->func_len); -		json_object_int_add(sid_struct_json, "arg-len", -				    sid_struct->arg_len); -		/* end old deprecated key format */ -  		sid_struct_json = json_object_new_object();  		json_object_object_add(json, "srv6SidStructure",  				       sid_struct_json); @@ -3196,26 +2820,6 @@ static void format_item_srv6_end_sid(uint16_t mtid, struct isis_item *i,  	if (json) {  		struct json_object *sid_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		sid_json = json_object_new_object(); -		json_object_object_add(json, "srv6-end-sid", sid_json); -		json_object_string_add(sid_json, "endpoint-behavior", -				       seg6local_action2str(sid->behavior)); -		json_object_string_addf(sid_json, "sid-value", "%pI6", -					&sid->sid); -		if (sid->subsubtlvs) { -			struct json_object *subtlvs_json; -			subtlvs_json = json_object_new_object(); -			json_object_object_add(sid_json, "subsubtlvs", -					       subtlvs_json); -			isis_format_subsubtlvs(sid->subsubtlvs, NULL, -					       subtlvs_json, 0); -		} -		/* end old deprecated key format */ -  		sid_json = json_object_new_object();  		json_object_object_add(json, "srv6EndSid", sid_json);  		json_object_string_add(sid_json, "endpointBehavior", @@ -3376,13 +2980,9 @@ static void format_item_area_address(uint16_t mtid, struct isis_item *i,  	memcpy(iso_addr.area_addr, addr->addr, ISO_ADDR_SIZE);  	iso_addr.addr_len = addr->len; -	if (json) { -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		json_object_string_addf(json, "area-addr", "%pIS", &iso_addr); +	if (json)  		json_object_string_addf(json, "areaAddr", "%pIS", &iso_addr); -	} else +	else  		sbuf_push(buf, indent, "Area Address: %pIS\n", &iso_addr);  } @@ -3470,22 +3070,6 @@ static void format_item_oldstyle_reach(uint16_t mtid, struct isis_item *i,  	if (json) {  		struct json_object *old_json, *array_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		old_json = json_object_new_object(); -		json_object_object_get_ex(json, "old-reach-style", &array_json); -		if (!array_json) { -			array_json = json_object_new_array(); -			json_object_object_add(json, "old-reach-style", -					       array_json); -		} -		json_object_array_add(array_json, old_json); -		json_object_string_add(old_json, "is-reach", sys_id); -		json_object_int_add(old_json, "metric", r->metric); -		/* end old deprecated key format */ -  		old_json = json_object_new_object();  		json_object_object_get_ex(json, "oldReachStyle", &array_json);  		if (!array_json) { @@ -3573,13 +3157,9 @@ static void format_item_lan_neighbor(uint16_t mtid, struct isis_item *i,  	char sys_id[ISO_SYSID_STRLEN];  	snprintfrr(sys_id, ISO_SYSID_STRLEN, "%pSY", n->mac); -	if (json) { -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		json_object_string_add(json, "lan-neighbor", sys_id); +	if (json)  		json_object_string_add(json, "lanNeighbor", sys_id); -	} else +	else  		sbuf_push(buf, indent, "LAN Neighbor: %s\n", sys_id);  } @@ -3651,17 +3231,6 @@ static void format_item_lsp_entry(uint16_t mtid, struct isis_item *i,  	if (json) {  		char buf[255];  		struct json_object *lsp_json; -		lsp_json = json_object_new_object(); -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		json_object_object_add(json, "lsp-entry", lsp_json); -		json_object_string_add(lsp_json, "id", sys_id); -		snprintfrr(buf,sizeof(buf),"0x%08x",e->seqno); -		json_object_string_add(lsp_json, "seq", buf); -		snprintfrr(buf,sizeof(buf),"0x%04hx",e->checksum); -		json_object_string_add(lsp_json, "chksum", buf); -		json_object_int_add(lsp_json, "lifetime", e->checksum);  		lsp_json = json_object_new_object();  		json_object_object_add(json, "lspEntry", lsp_json); @@ -3753,31 +3322,6 @@ static void format_item_extended_reach(uint16_t mtid, struct isis_item *i,  	if (json) {  		struct json_object *reach_json, *array_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		reach_json = json_object_new_object(); -		json_object_object_get_ex(json, "ext-reach", &array_json); -		if (!array_json) { -			array_json = json_object_new_array(); -			json_object_object_add(json, "ext-reach", array_json); -		} -		json_object_array_add(array_json, reach_json); -		json_object_string_add( -			reach_json, "mt-id", -			(mtid == ISIS_MT_IPV4_UNICAST) ? "Extended" : "MT"); -		json_object_string_add(reach_json, "id", sys_id); -		json_object_int_add(reach_json, "metric", r->metric); -		if (mtid != ISIS_MT_IPV4_UNICAST) -			json_object_string_add(reach_json, "mt-name", -					       isis_mtid2str(mtid)); - -		if (r->subtlvs) -			format_item_ext_subtlvs(r->subtlvs, NULL, reach_json, -						indent + 2, mtid); -		/* end old deprecated key format */ -  		reach_json = json_object_new_object();  		json_object_object_get_ex(json, "extReach", &array_json);  		if (!array_json) { @@ -3926,24 +3470,6 @@ static void format_item_oldstyle_ip_reach(uint16_t mtid, struct isis_item *i,  	if (json) {  		struct json_object *old_json, *array_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		old_json = json_object_new_object(); -		json_object_object_get_ex(json, "old-ip-reach-style", -					  &array_json); -		if (!array_json) { -			array_json = json_object_new_array(); -			json_object_object_add(json, "old-ip-reach-style", -					       old_json); -		} -		json_object_array_add(array_json, old_json); -		json_object_string_add(old_json, "prefix", -				       prefix2str(&r->prefix, prefixbuf, sizeof(prefixbuf))); -		json_object_int_add(old_json, "metric", r->metric); -		/* end old deprecated key format */ -  		old_json = json_object_new_object();  		json_object_object_get_ex(json, "oldIpReachStyle", &array_json);  		if (!array_json) { @@ -4049,19 +3575,6 @@ static void format_tlv_protocols_supported(struct isis_protocols_supported *p,  		struct json_object *protocol_json;  		char buf[255]; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		protocol_json = json_object_new_object(); -		json_object_object_add(json, "protocols-supported", -				       protocol_json); -		for (uint8_t i = 0; i < p->count; i++) { -			snprintfrr(buf, sizeof(buf), "%d", i); -			json_object_string_add(protocol_json, buf, -					       nlpid2str(p->protocols[i])); -		} -  		protocol_json = json_object_new_object();  		json_object_object_add(json, "supportedProtocols",  				       protocol_json); @@ -4070,7 +3583,6 @@ static void format_tlv_protocols_supported(struct isis_protocols_supported *p,  			json_object_string_add(protocol_json, buf,  					       nlpid2str(p->protocols[i]));  		} -		/* end old deprecated key format */  	} else {  		sbuf_push(buf, indent, "Protocols Supported: ");  		for (uint8_t i = 0; i < p->count; i++) { @@ -4286,13 +3798,9 @@ static void format_item_global_ipv6_address(uint16_t mtid, struct isis_item *i,  	char addrbuf[INET6_ADDRSTRLEN];  	inet_ntop(AF_INET6, &a->addr, addrbuf, sizeof(addrbuf)); -	if (json) { -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		json_object_string_add(json, "global-ipv6", addrbuf); +	if (json)  		json_object_string_add(json, "globalIpv6", addrbuf); -	} else +	else  		sbuf_push(buf, indent, "Global IPv6 Interface Address: %s\n",  			  addrbuf);  } @@ -4374,12 +3882,6 @@ static void format_item_mt_router_info(uint16_t mtid, struct isis_item *i,  		json_object_string_add(mt_json, "mtDescription",  				       isis_mtid2str(mtid)); -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated non boolean format") -#endif -		json_object_string_add(mt_json, "overload", info->overload?"true":"false"); -		json_object_string_add(mt_json, "attached", info->attached?"true":"false"); -  		json_object_boolean_add(mt_json, "overloadBit",  					!!info->overload);  		json_object_boolean_add(mt_json, "attachedbit", @@ -4466,13 +3968,9 @@ static void format_tlv_te_router_id(const struct in_addr *id, struct sbuf *buf,  	char addrbuf[INET_ADDRSTRLEN];  	inet_ntop(AF_INET, id, addrbuf, sizeof(addrbuf)); -	if (json) { -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		json_object_string_add(json, "te-router-id", addrbuf); +	if (json)  		json_object_string_add(json, "teRouterId", addrbuf); -	} else +	else  		sbuf_push(buf, indent, "TE Router ID: %s\n", addrbuf);  } @@ -4547,37 +4045,6 @@ static void format_item_extended_ip_reach(uint16_t mtid, struct isis_item *i,  	char prefixbuf[PREFIX2STR_BUFFER];  	if (json) { -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		ext_json = json_object_new_object(); -		json_object_object_get_ex(json, "ext-ip-reach", &array_json); -		if (!array_json) { -			array_json = json_object_new_array(); -			json_object_object_add(json, "ext-ip-reach", array_json); -		} -		json_object_array_add(array_json, ext_json); -		json_object_string_add(ext_json, "mt-id", -				       (mtid == ISIS_MT_IPV4_UNICAST) -					       ? "Extended" -					       : "MT"); -		json_object_string_add(ext_json, "ip-reach", -				       prefix2str(&r->prefix, prefixbuf, -						  sizeof(prefixbuf))); -		json_object_int_add(ext_json, "ip-reach-metric", r->metric); -		json_object_string_add(ext_json, "down", r->down ? "yes" : ""); -		if (mtid != ISIS_MT_IPV4_UNICAST) -			json_object_string_add(ext_json, "mt-name", -					       isis_mtid2str(mtid)); -		if (r->subtlvs) { -			struct json_object *subtlv_json; -			subtlv_json = json_object_new_object(); -			json_object_object_add(ext_json, "subtlvs", subtlv_json); -			format_subtlvs(r->subtlvs, NULL, subtlv_json, 0); -		} -		/* end old deprecated key format */ -  		ext_json = json_object_new_object();  		json_object_object_get_ex(json, "extIpReach", &array_json);  		if (!array_json) { @@ -4860,13 +4327,9 @@ static void format_tlv_te_router_id_ipv6(const struct in6_addr *id,  	char addrbuf[INET6_ADDRSTRLEN];  	inet_ntop(AF_INET6, id, addrbuf, sizeof(addrbuf)); -	if (json) { -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		json_object_string_add(json, "ipv6-te-router-id", addrbuf); +	if (json)  		json_object_string_add(json, "ipv6TeRouterId", addrbuf); -	} else +	else  		sbuf_push(buf, indent, "IPv6 TE Router ID: %s\n", addrbuf);  } @@ -4944,30 +4407,6 @@ static void format_tlv_spine_leaf(const struct isis_spine_leaf *spine_leaf,  	if (json) {  		struct json_object *spine_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated format */ -		spine_json = json_object_new_object(); -		json_object_object_add(json, "spine-leaf-extension", -				       spine_json); -		if (spine_leaf->has_tier) { -			snprintfrr(aux_buf, sizeof(aux_buf), "%hhu", -				   spine_leaf->tier); -			json_object_string_add( -				spine_json, "tier", -				(spine_leaf->tier == ISIS_TIER_UNDEFINED) -					? "undefined" -					: aux_buf); -		} -		json_object_string_add(spine_json, "flag-leaf", -				       spine_leaf->is_leaf ? "yes" : ""); -		json_object_string_add(spine_json, "flag-spine", -				       spine_leaf->is_spine ? "yes" : ""); -		json_object_string_add(spine_json, "flag-backup", -				       spine_leaf->is_backup ? "yes" : ""); -		/* end old deprecated format */ -  		spine_json = json_object_new_object();  		json_object_object_add(json, "spineLeafExtension", spine_json);  		if (spine_leaf->has_tier) { @@ -5127,26 +4566,6 @@ format_tlv_threeway_adj(const struct isis_threeway_adj *threeway_adj,  	if (json) {  		struct json_object *three_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		three_json = json_object_new_object(); -		json_object_object_add(json, "p2p-three-way-adj", three_json); -		json_object_string_add( -			three_json, "state-name", -			isis_threeway_state_name(threeway_adj->state)); -		json_object_int_add(three_json, "state", threeway_adj->state); -		json_object_int_add(three_json, "ext-local-circuit-id", -				    threeway_adj->local_circuit_id); -		if (threeway_adj->neighbor_set) { -			json_object_string_add(three_json, "neigh-system-id", -					       sys_id); -			json_object_int_add(three_json, "neigh-ext-circuit-id", -					    threeway_adj->neighbor_circuit_id); -		} -		/* end old deprecated key format */ -  		three_json = json_object_new_object();  		json_object_object_add(json, "p2pThreeWayAdj", three_json);  		json_object_string_add(three_json, "stateName", @@ -5297,40 +4716,6 @@ static void format_item_ipv6_reach(uint16_t mtid, struct isis_item *i,  					       subtlvs_json);  			format_subtlvs(r->subtlvs, NULL, subtlvs_json, 0);  		} - -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated JSON key format */ -		reach_json = json_object_new_object(); -		json_object_object_get_ex(json, "ipv6-reach", &array_json); -		if (!array_json) { -			array_json = json_object_new_array(); -			json_object_object_add(json, "ipv6-reach", array_json); -		} -		json_object_array_add(array_json, reach_json); -		json_object_string_add(reach_json, "mt-id", -				       (mtid == ISIS_MT_IPV4_UNICAST) ? "" -								      : "mt"); -		json_object_string_add( -			reach_json, "prefix", -			prefix2str(&r->prefix, prefixbuf, sizeof(prefixbuf))); -		json_object_int_add(reach_json, "metric", r->metric); -		json_object_string_add(reach_json, "down", -				       r->down ? "yes" : ""); -		json_object_string_add(reach_json, "external", -				       r->external ? "yes" : ""); -		if (mtid != ISIS_MT_IPV4_UNICAST) -			json_object_string_add(reach_json, "mt-name", -					       isis_mtid2str(mtid)); -		if (r->subtlvs) { -			struct json_object *subtlvs_json; -			subtlvs_json = json_object_new_object(); -			json_object_object_add(reach_json, "subtlvs", -					       subtlvs_json); -			format_subtlvs(r->subtlvs, NULL, subtlvs_json, 0); -		} -		/* end deprecated key format */  	} else {  		sbuf_push(buf, indent,  			  "%sIPv6 Reachability: %s (Metric: %u)%s%s", @@ -5543,22 +4928,6 @@ static void format_tlv_router_cap_json(const struct isis_router_cap *router_cap,  	/* Router ID and Flags */  	struct json_object *cap_json; -#if CONFDATE > 20240916 -	CPP_NOTICE("remove deprecated key format with -") -#endif -	/* deprecated JSON key format */ -	cap_json = json_object_new_object(); -	json_object_object_add(json, "router-capability", cap_json); -	inet_ntop(AF_INET, &router_cap->router_id, addrbuf, sizeof(addrbuf)); -	json_object_string_add(cap_json, "id", addrbuf); -	json_object_string_add( -		cap_json, "flag-d", -		router_cap->flags & ISIS_ROUTER_CAP_FLAG_D ? "1" : "0"); -	json_object_string_add( -		cap_json, "flag-s", -		router_cap->flags & ISIS_ROUTER_CAP_FLAG_S ? "1" : "0"); -	/* end deprecated JSON key format */ -  	cap_json = json_object_new_object();  	json_object_object_add(json, "routerCapability", cap_json);  	inet_ntop(AF_INET, &router_cap->router_id, addrbuf, sizeof(addrbuf)); @@ -5573,23 +4942,6 @@ static void format_tlv_router_cap_json(const struct isis_router_cap *router_cap,  	if (router_cap->srgb.range_size != 0) {  		struct json_object *gb_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* deprecated old key format */ -		gb_json = json_object_new_object(); -		json_object_object_add(json, "segment-routing-gb", gb_json); -		json_object_string_add(gb_json, "ipv4", -				       IS_SR_IPV4(&router_cap->srgb) ? "1" -								     : "0"); -		json_object_string_add(gb_json, "ipv6", -				       IS_SR_IPV6(&router_cap->srgb) ? "1" -								     : "0"); -		json_object_int_add(gb_json, "global-block-base", -				    router_cap->srgb.lower_bound); -		json_object_int_add(gb_json, "global-block-range", -				    router_cap->srgb.range_size); -  		gb_json = json_object_new_object();  		json_object_object_add(json, "segmentRoutingGb", gb_json);  		json_object_boolean_add(gb_json, "ipv4", @@ -5606,18 +4958,6 @@ static void format_tlv_router_cap_json(const struct isis_router_cap *router_cap,  	if (router_cap->srlb.range_size != 0) {  		struct json_object *lb_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		lb_json = json_object_new_object(); -		json_object_object_add(json, "segment-routing-lb", lb_json); -		json_object_int_add(lb_json, "global-block-base", -				    router_cap->srlb.lower_bound); -		json_object_int_add(lb_json, "global-block-range", -				    router_cap->srlb.range_size); -		/* end old deprecated key format */ -  		lb_json = json_object_new_object();  		json_object_object_add(json, "segmentRoutingLb", lb_json);  		json_object_int_add(lb_json, "globalBlockBase", @@ -5631,23 +4971,6 @@ static void format_tlv_router_cap_json(const struct isis_router_cap *router_cap,  		char buf[255];  		struct json_object *alg_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		alg_json = json_object_new_object(); -		json_object_object_add(json, "segment-routing-algorithm", -				       alg_json); -		for (int i = 0; i < SR_ALGORITHM_COUNT; i++) -			if (router_cap->algo[i] != SR_ALGORITHM_UNSET) { -				snprintfrr(buf, sizeof(buf), "%d", i); -				json_object_string_add(alg_json, buf, -						       router_cap->algo[i] == 0 -							       ? "SPF" -							       : "Strict SPF"); -			} -		/* end old deprecated key format */ -  		alg_json = json_object_new_object();  		json_object_object_add(json, "segmentRoutingAlgorithm",  				       alg_json); @@ -6138,16 +5461,17 @@ static int unpack_tlv_router_cap(enum isis_tlv_context context,  		return 0;  	} -	if (tlvs->router_cap) -		/* Multiple Router Capability found */ -		rcap = tlvs->router_cap; -	else { -		/* Allocate router cap structure and initialize SR Algorithms */ -		rcap = XCALLOC(MTYPE_ISIS_TLV, sizeof(struct isis_router_cap)); +	if (!tlvs->router_cap) { +		/* First Router Capability TLV. +		 * Allocate router cap structure and initialize SR Algorithms */ +		tlvs->router_cap = XCALLOC(MTYPE_ISIS_TLV, +					   sizeof(struct isis_router_cap));  		for (int i = 0; i < SR_ALGORITHM_COUNT; i++) -			rcap->algo[i] = SR_ALGORITHM_UNSET; +			tlvs->router_cap->algo[i] = SR_ALGORITHM_UNSET;  	} +	rcap = tlvs->router_cap; +  	/* Get Router ID and Flags */  	rcap->router_id.s_addr = stream_get_ipv4(s);  	rcap->flags = stream_getc(s); @@ -6169,7 +5493,6 @@ static int unpack_tlv_router_cap(enum isis_tlv_context context,  				log, indent,  				"WARNING: Router Capability subTLV length too large compared to expected size\n");  			stream_forward_getp(s, STREAM_READABLE(s)); -			XFREE(MTYPE_ISIS_TLV, rcap);  			return 0;  		} @@ -6480,7 +5803,6 @@ static int unpack_tlv_router_cap(enum isis_tlv_context context,  		}  		subtlv_len = subtlv_len - length - 2;  	} -	tlvs->router_cap = rcap;  	return 0;  } @@ -6503,24 +5825,16 @@ static void format_item_auth(uint16_t mtid, struct isis_item *i,  	struct isis_auth *auth = (struct isis_auth *)i;  	char obuf[768]; -	if (json) { -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		json_object_string_add(json, "test-auth", "ok"); +	if (json)  		json_object_string_add(json, "testAuth", "ok"); -	} else +	else  		sbuf_push(buf, indent, "Authentication:\n");  	switch (auth->type) {  	case ISIS_PASSWD_TYPE_CLEARTXT:  		zlog_sanitize(obuf, sizeof(obuf), auth->value, auth->length); -		if (json) { -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "auth-pass", obuf); +		if (json)  			json_object_string_add(json, "authPass", obuf); -		} else +		else  			sbuf_push(buf, indent, "  Password: %s\n", obuf);  		break;  	case ISIS_PASSWD_TYPE_HMAC_MD5: @@ -6528,23 +5842,15 @@ static void format_item_auth(uint16_t mtid, struct isis_item *i,  			snprintf(obuf + 2 * j, sizeof(obuf) - 2 * j, "%02hhx",  				 auth->value[j]);  		} -		if (json) { -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "auth-hmac-md5", obuf); +		if (json)  			json_object_string_add(json, "authHmacMd5", obuf); -		} else +		else  			sbuf_push(buf, indent, "  HMAC-MD5: %s\n", obuf);  		break;  	default: -		if (json) { -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_int_add(json, "auth-unknown", auth->type); +		if (json)  			json_object_int_add(json, "authUnknown", auth->type); -		} else +		else  			sbuf_push(buf, indent, "  Unknown (%hhu)\n",  				  auth->type);  		break; @@ -6660,18 +5966,6 @@ static void format_tlv_purge_originator(struct isis_purge_originator *poi,  	if (json) {  		struct json_object *purge_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old deprecated key format */ -		purge_json = json_object_new_object(); -		json_object_object_add(json, "purge_originator", purge_json); - -		json_object_string_add(purge_json, "id", gen_id); -		if (poi->sender_set) -			json_object_string_add(purge_json, "rec-from", sen_id); -		/* end old deprecated key format */ -  		purge_json = json_object_new_object();  		json_object_object_add(json, "purgeOriginator", purge_json); @@ -7221,33 +6515,6 @@ static void format_item_srv6_locator(uint16_t mtid, struct isis_item *i,  	if (json) {  		struct json_object *loc_json; -#if CONFDATE > 20240916 -		CPP_NOTICE("remove deprecated key format with -") -#endif -		/* old json key format */ -		loc_json = json_object_new_object(); -		json_object_object_add(json, "srv6-locator", loc_json); -		json_object_int_add(loc_json, "mt-id", mtid); -		json_object_string_addf(loc_json, "prefix", "%pFX", -					&loc->prefix); -		json_object_int_add(loc_json, "metric", loc->metric); -		json_object_string_add( -			loc_json, "d-flag", -			CHECK_FLAG(loc->flags, ISIS_TLV_SRV6_LOCATOR_FLAG_D) -				? "yes" -				: ""); -		json_object_int_add(loc_json, "algorithm", loc->algorithm); -		json_object_string_add(loc_json, "mt-name", -				       isis_mtid2str(mtid)); -		if (loc->subtlvs) { -			struct json_object *subtlvs_json; -			subtlvs_json = json_object_new_object(); -			json_object_object_add(loc_json, "subtlvs", -					       subtlvs_json); -			format_subtlvs(loc->subtlvs, NULL, subtlvs_json, 0); -		} -		/* old deprecated key format */ -  		loc_json = json_object_new_object();  		json_object_object_add(json, "srv6Locator", loc_json);  		json_object_int_add(loc_json, "mtId", mtid); @@ -7549,13 +6816,9 @@ static void format_tlvs(struct isis_tlvs *tlvs, struct sbuf *buf, struct json_ob  		     &tlvs->area_addresses, buf, json, indent);  	if (tlvs->mt_router_info_empty) { -		if (json) { -#if CONFDATE > 20240916 -			CPP_NOTICE("remove deprecated key format with -") -#endif -			json_object_string_add(json, "mt-router-info", "none"); +		if (json)  			json_object_object_add(json, "mtRouterInfo", NULL); -		} else +		else  			sbuf_push(buf, indent, "MT Router Info: None\n");  	} else {  		format_items(ISIS_CONTEXT_LSP, ISIS_TLV_MT_ROUTER_INFO, diff --git a/isisd/isis_tlvs.h b/isisd/isis_tlvs.h index 6ecd4c5f6a..c64bbf7f69 100644 --- a/isisd/isis_tlvs.h +++ b/isisd/isis_tlvs.h @@ -717,6 +717,7 @@ struct isis_ext_subtlvs {  #define ISIS_SABM_FLAG_X 0x10 /* Flex-Algorithm - RFC9350 */  #define ASLA_APP_IDENTIFIER_BIT_LENGTH 1 +#define ASLA_APP_IDENTIFIER_BIT_MAX_LENGTH 8  #define ASLA_LEGACY_FLAG 0x80  #define ASLA_APPS_LENGTH_MASK 0x7f  | 
