]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: introduce LP_TYPE_NEXTHOP label type
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 28 Feb 2023 13:11:30 +0000 (14:11 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 9 May 2023 19:00:57 +0000 (21:00 +0200)
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>
bgpd/bgp_labelpool.c
bgpd/bgp_labelpool.h

index 9943f57fb37107738f6789d66f65273c12599f84..9f1a07cd23faad3f7b812ce0804ea2b0e82e0216 100644 (file)
@@ -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)
index 9526cba0ce30a738a15938b52fb09064ec68e0c4..649195498361929f4ada5d1e86eab5f411609eff 100644 (file)
@@ -17,6 +17,7 @@
  */
 #define LP_TYPE_VRF    0x00000001
 #define LP_TYPE_BGP_LU 0x00000002
+#define LP_TYPE_NEXTHOP 0x00000003
 
 PREDECL_LIST(lp_fifo);