diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2023-02-28 14:11:30 +0100 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-05-09 21:00:57 +0200 | 
| commit | 855dcbf15898ce6b40bdf31902970d65ac801f56 (patch) | |
| tree | 2d186250a85488f17056b40052cedf0afc7af98f /bgpd/bgp_labelpool.c | |
| parent | d4cdcee5bf782b057949f04b712ecd4bf7429f98 (diff) | |
bgpd: introduce LP_TYPE_NEXTHOP label type
A new label type is introduced: LP_TYPE_NEXTHOP. This new
label type will be used in next commits to allocate labels
for a specific nexthop IP address.
The commit changes add vty and json outputs to display
the new label type and the label values associated.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_labelpool.c')
| -rw-r--r-- | bgpd/bgp_labelpool.c | 26 | 
1 files changed, 26 insertions, 0 deletions
diff --git a/bgpd/bgp_labelpool.c b/bgpd/bgp_labelpool.c index 9943f57fb3..9f1a07cd23 100644 --- a/bgpd/bgp_labelpool.c +++ b/bgpd/bgp_labelpool.c @@ -830,6 +830,16 @@ DEFUN(show_bgp_labelpool_ledger, show_bgp_labelpool_ledger_cmd,  					lcb->label);  			break; +		case LP_TYPE_NEXTHOP: +			if (uj) { +				json_object_string_add(json_elem, "prefix", +						       "nexthop"); +				json_object_int_add(json_elem, "label", +						    lcb->label); +			} else +				vty_out(vty, "%-18s         %u\n", "nexthop", +					lcb->label); +			break;  		}  	}  	if (uj) @@ -919,6 +929,15 @@ DEFUN(show_bgp_labelpool_inuse, show_bgp_labelpool_inuse_cmd,  				vty_out(vty, "%-18s         %u\n", "VRF",  					label);  			break; +		case LP_TYPE_NEXTHOP: +			if (uj) { +				json_object_string_add(json_elem, "prefix", +						       "nexthop"); +				json_object_int_add(json_elem, "label", label); +			} else +				vty_out(vty, "%-18s         %u\n", "nexthop", +					label); +			break;  		}  	}  	if (uj) @@ -991,6 +1010,13 @@ DEFUN(show_bgp_labelpool_requests, show_bgp_labelpool_requests_cmd,  			else  				vty_out(vty, "VRF\n");  			break; +		case LP_TYPE_NEXTHOP: +			if (uj) +				json_object_string_add(json_elem, "prefix", +						       "nexthop"); +			else +				vty_out(vty, "Nexthop\n"); +			break;  		}  	}  	if (uj)  | 
