]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Add `neighbor ... extended-link-bandwidth` command
authorDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 8 Apr 2024 06:07:01 +0000 (09:07 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 22 Apr 2024 14:50:07 +0000 (17:50 +0300)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h

index 05d3c097b7956df08ca936eb2ce0e47bfd2eb966..0388fae107ab4397f4507cd1a101920e201cb303 100644 (file)
@@ -7115,6 +7115,26 @@ DEFUN (no_neighbor_disable_connected_check,
                                   PEER_FLAG_DISABLE_CONNECTED_CHECK);
 }
 
+DEFPY(neighbor_extended_link_bw,
+      neighbor_extended_link_bw_cmd,
+      "[no] neighbor <A.B.C.D|X:X::X:X|WORD>$neighbor extended-link-bandwidth",
+      NO_STR
+      NEIGHBOR_STR
+      NEIGHBOR_ADDR_STR2
+      "Send Extended (64-bit) version of encoding for Link-Bandwidth\n")
+{
+       int ret;
+
+       if (no)
+               ret = peer_flag_unset_vty(vty, neighbor,
+                                         PEER_FLAG_EXTENDED_LINK_BANDWIDTH);
+       else
+               ret = peer_flag_set_vty(vty, neighbor,
+                                       PEER_FLAG_EXTENDED_LINK_BANDWIDTH);
+
+       return ret;
+}
+
 /* disable-link-bw-encoding-ieee */
 DEFUN(neighbor_disable_link_bw_encoding_ieee,
       neighbor_disable_link_bw_encoding_ieee_cmd,
@@ -18441,6 +18461,9 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
                vty_out(vty, " neighbor %s disable-link-bw-encoding-ieee\n",
                        addr);
 
+       if (peergroup_flag_check(peer, PEER_FLAG_EXTENDED_LINK_BANDWIDTH))
+               vty_out(vty, " neighbor %s extended-link-bandwidth\n", addr);
+
        /* extended-optional-parameters */
        if (peergroup_flag_check(peer, PEER_FLAG_EXTENDED_OPT_PARAMS))
                vty_out(vty, " neighbor %s extended-optional-parameters\n",
@@ -20953,6 +20976,9 @@ void bgp_vty_init(void)
        install_element(BGP_NODE,
                        &no_neighbor_disable_link_bw_encoding_ieee_cmd);
 
+
+       install_element(BGP_NODE, &neighbor_extended_link_bw_cmd);
+
        /* "neighbor extended-optional-parameters" commands.  */
        install_element(BGP_NODE, &neighbor_extended_optional_parameters_cmd);
        install_element(BGP_NODE,
index 5fd4ebe8cc044ac15af1e96e9c771e76c8b1a2e9..db1ed4943d58115297195463669eea7eaa87236c 100644 (file)
@@ -4623,6 +4623,7 @@ static const struct peer_flag_action peer_flag_action_list[] = {
        {PEER_FLAG_CAPABILITY_SOFT_VERSION, 0, peer_change_none},
        {PEER_FLAG_CAPABILITY_FQDN, 0, peer_change_none},
        {PEER_FLAG_AS_LOOP_DETECTION, 0, peer_change_none},
+       {PEER_FLAG_EXTENDED_LINK_BANDWIDTH, 0, peer_change_none},
        {0, 0, 0}};
 
 static const struct peer_flag_action peer_af_flag_action_list[] = {
index e882a181b50ceac91eae152d98be9ac347974dd2..642453d90d360922ea241116f698d73040854547 100644 (file)
@@ -1480,6 +1480,7 @@ struct peer {
 #define PEER_FLAG_CAPABILITY_SOFT_VERSION (1ULL << 36)
 #define PEER_FLAG_CAPABILITY_FQDN (1ULL << 37)  /* fqdn capability */
 #define PEER_FLAG_AS_LOOP_DETECTION (1ULL << 38) /* as path loop detection */
+#define PEER_FLAG_EXTENDED_LINK_BANDWIDTH (1ULL << 39)
 
        /*
         *GR-Disabled mode means unset PEER_FLAG_GRACEFUL_RESTART