summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2023-05-02 16:30:20 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2023-06-16 10:54:58 +0200
commit73e9ce89b909419728825723b60435d92a0e2723 (patch)
treebfc9767ac4cb9582d11cce9d3f9d0f8ec7c0b724 /bgpd
parentcd0e9bfbc43e5cd30c90a4ea16e1e810f94a7477 (diff)
bgpd: add LP_TYPE_BGP_L3VPN_BIND label type
Redistributing mpls vpn prefixes with a new label requires picking up unused MPLS local labels. Today, there is an MPLS label pool which is owned by the zebra daemon. BGP gets a chunk of labels that are shared with the multiple usage of the BGP daemon. A label type attribute is used whenever BGP needs a new label value. The 'LP_TYPE_BGP_L3VPN_BIND' label type will be used to allocate the MPLS labels that will be bound to the original next-hop, and label value of an L3VPN update. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_labelpool.c26
-rw-r--r--bgpd/bgp_labelpool.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/bgpd/bgp_labelpool.c b/bgpd/bgp_labelpool.c
index faddfc995f..91763b85a0 100644
--- a/bgpd/bgp_labelpool.c
+++ b/bgpd/bgp_labelpool.c
@@ -843,6 +843,16 @@ DEFUN(show_bgp_labelpool_ledger, show_bgp_labelpool_ledger_cmd,
vty_out(vty, "%-18s %u\n", "nexthop",
lcb->label);
break;
+ case LP_TYPE_BGP_L3VPN_BIND:
+ if (uj) {
+ json_object_string_add(json_elem, "prefix",
+ "l3vpn-bind");
+ json_object_int_add(json_elem, "label",
+ lcb->label);
+ } else
+ vty_out(vty, "%-18s %u\n", "l3vpn-bind",
+ lcb->label);
+ break;
}
}
if (uj)
@@ -941,6 +951,15 @@ DEFUN(show_bgp_labelpool_inuse, show_bgp_labelpool_inuse_cmd,
vty_out(vty, "%-18s %u\n", "nexthop",
label);
break;
+ case LP_TYPE_BGP_L3VPN_BIND:
+ if (uj) {
+ json_object_string_add(json_elem, "prefix",
+ "l3vpn-bind");
+ json_object_int_add(json_elem, "label", label);
+ } else
+ vty_out(vty, "%-18s %u\n", "l3vpn-bind",
+ label);
+ break;
}
}
if (uj)
@@ -1020,6 +1039,13 @@ DEFUN(show_bgp_labelpool_requests, show_bgp_labelpool_requests_cmd,
else
vty_out(vty, "Nexthop\n");
break;
+ case LP_TYPE_BGP_L3VPN_BIND:
+ if (uj)
+ json_object_string_add(json_elem, "prefix",
+ "l3vpn-bind");
+ else
+ vty_out(vty, "L3VPN-BIND\n");
+ break;
}
}
if (uj)
diff --git a/bgpd/bgp_labelpool.h b/bgpd/bgp_labelpool.h
index b33527186e..9a110e6297 100644
--- a/bgpd/bgp_labelpool.h
+++ b/bgpd/bgp_labelpool.h
@@ -18,6 +18,7 @@
#define LP_TYPE_VRF 0x00000001
#define LP_TYPE_BGP_LU 0x00000002
#define LP_TYPE_NEXTHOP 0x00000003
+#define LP_TYPE_BGP_L3VPN_BIND 0x00000004
PREDECL_LIST(lp_fifo);