summaryrefslogtreecommitdiff
path: root/bgpd/bgp_labelpool.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2023-02-28 14:11:30 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2023-03-22 12:06:29 +0100
commitbb3b811305ffc3c0998438b48a003c815c859293 (patch)
treeb1da79667150d60f2c627cf9f147d67a3aafdf82 /bgpd/bgp_labelpool.c
parentbbae0bb0422ebce9b7704cdaebff616d67d404fe (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.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/bgpd/bgp_labelpool.c b/bgpd/bgp_labelpool.c
index f0f207442e..3e43a41daf 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)