]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_vty.c
Merge pull request #5717 from pguibert6WIND/flowspec_issue_redistribute
[mirror_frr.git] / bgpd / bgp_vty.c
index eff5b3b7bca6635c5429b407e75281261fceb410..696233e7a0ea5a3114434b21670412c0c0befaf1 100644 (file)
@@ -9454,20 +9454,19 @@ static void bgp_show_peer_afi_orf_cap(struct vty *vty, struct peer *p,
        }
 }
 
-static void bgp_show_neighnor_graceful_restart_rbit(
-                                               struct vty *vty,
-                                               struct peer *p,
-                                               bool use_json,
-                                               json_object *json)
+static void bgp_show_neighnor_graceful_restart_rbit(struct vty *vty,
+                                                   struct peer *p,
+                                                   bool use_json,
+                                                   json_object *json)
 {
        bool rbit_status = 0;
 
        if (!use_json)
                vty_out(vty, "\n    R bit          : ");
 
-       if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_ADV) &&
-               (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV)) &&
-               (p->status == Established)) {
+       if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_ADV)
+           && (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV))
+           && (p->status == Established)) {
 
                if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_BIT_RCV))
                        rbit_status = 1;
@@ -9477,62 +9476,57 @@ static void bgp_show_neighnor_graceful_restart_rbit(
 
        if (rbit_status) {
                if (use_json)
-                       json_object_boolean_true_add(
-                                       json, "rBit");
+                       json_object_boolean_true_add(json, "rBit");
                else
                        vty_out(vty, "True\n");
        } else {
                if (use_json)
-                       json_object_boolean_false_add(
-                                       json, "rBit");
+                       json_object_boolean_false_add(json, "rBit");
                else
                        vty_out(vty, "False\n");
        }
 }
 
-static void bgp_show_neighbor_graceful_restart_remote_mode(
-                                               struct vty *vty,
-                                               struct peer *peer,
-                                               bool use_json,
-                                               json_object *json)
+static void bgp_show_neighbor_graceful_restart_remote_mode(struct vty *vty,
+                                                          struct peer *peer,
+                                                          bool use_json,
+                                                          json_object *json)
 {
        const char *mode = "NotApplicable";
 
        if (!use_json)
                vty_out(vty, "\n    Remote GR Mode : ");
 
-       if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_ADV) &&
-               (peer->status == Established)) {
+       if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_ADV)
+           && (peer->status == Established)) {
 
-               if ((peer->nsf_af_count == 0) &&
-                       !CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) {
+               if ((peer->nsf_af_count == 0)
+                   && !CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) {
 
                        mode = "Disable";
 
-               } else if (peer->nsf_af_count == 0 &&
-                       CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) {
+               } else if (peer->nsf_af_count == 0
+                          && CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) {
 
                        mode = "Helper";
 
-               } else if (peer->nsf_af_count != 0 &&
-                       CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) {
+               } else if (peer->nsf_af_count != 0
+                          && CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) {
 
                        mode = "Restart";
-
                }
        }
 
        if (use_json) {
-               json_object_string_add(json,
-                               "remoteGrMode", mode);
+               json_object_string_add(json, "remoteGrMode", mode);
        } else
                vty_out(vty, mode, "\n");
 }
 
-static void  bgp_show_neighbor_graceful_restart_local_mode(struct vty *vty,
-                                               struct peer *p,
-                                               bool use_json,
-                                               json_object *json)
+static void bgp_show_neighbor_graceful_restart_local_mode(struct vty *vty,
+                                                         struct peer *p,
+                                                         bool use_json,
+                                                         json_object *json)
 {
        const char *mode = "Invalid";
 
@@ -9557,16 +9551,14 @@ static void  bgp_show_neighbor_graceful_restart_local_mode(struct vty *vty,
        }
 
        if (use_json) {
-               json_object_string_add(json,
-                               "localGrMode", mode);
+               json_object_string_add(json, "localGrMode", mode);
        } else {
                vty_out(vty, mode, "\n");
        }
 }
 
-static void  bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
-                                       struct vty *vty, struct peer *peer,
-                                       bool use_json, json_object *json)
+static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
+       struct vty *vty, struct peer *peer, bool use_json, json_object *json)
 {
        afi_t afi;
        safi_t safi;
@@ -9577,215 +9569,193 @@ static void  bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
 
        for (afi = AFI_IP; afi < AFI_MAX; afi++) {
                for (safi = SAFI_UNICAST; safi <= SAFI_MPLS_VPN; safi++) {
-                       if (peer->afc[afi][safi]
-                               && CHECK_FLAG(peer->cap, PEER_CAP_RESTART_ADV)
-                               && CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)
-                               ) {
-                               if (use_json) {
-                                       json_afi_safi =
-                                               json_object_new_object();
-                                       json_endofrib_status =
-                                               json_object_new_object();
-                                       json_timer =
-                                               json_object_new_object();
-                               }
+                       if (!peer->afc[afi][safi])
+                               continue;
 
-                               if (peer->eor_stime[afi][safi] >=
-                                   peer->pkt_stime[afi][safi])
-                                       eor_flag = true;
-                               else
-                                       eor_flag = false;
+                       if (!CHECK_FLAG(peer->cap, PEER_CAP_RESTART_ADV)
+                           || !CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV))
+                               continue;
 
-                               if (!use_json) {
-                                       vty_out(vty, "    %s :\n",
-                                       get_afi_safi_str(afi, safi, false));
+                       if (use_json) {
+                               json_afi_safi = json_object_new_object();
+                               json_endofrib_status = json_object_new_object();
+                               json_timer = json_object_new_object();
+                       }
 
-                                       vty_out(vty,
-                                       "     F bit                 : ");
-                               } else
-                                       get_afi_safi_str(afi, safi, true);
+                       if (peer->eor_stime[afi][safi]
+                           >= peer->pkt_stime[afi][safi])
+                               eor_flag = true;
+                       else
+                               eor_flag = false;
 
-                               if (peer->nsf[afi][safi]
-                                       && CHECK_FLAG(
-                                       peer->af_cap[afi][safi],
-                                       PEER_CAP_RESTART_AF_PRESERVE_RCV)) {
+                       if (!use_json) {
+                               vty_out(vty, "    %s :\n",
+                                       get_afi_safi_str(afi, safi, false));
 
-                                       if (use_json) {
-                                               json_object_boolean_true_add(
-                                               json_afi_safi, "fBit");
-                                       } else {
-                                               vty_out(vty,
-                                                       "True\n");
-                                       }
+                               vty_out(vty, "     F bit                 : ");
+                       }
 
-                               } else {
+                       if (peer->nsf[afi][safi]
+                           && CHECK_FLAG(peer->af_cap[afi][safi],
+                                         PEER_CAP_RESTART_AF_PRESERVE_RCV)) {
 
-                                       if (use_json) {
-                                               json_object_boolean_false_add(
+                               if (use_json) {
+                                       json_object_boolean_true_add(
                                                json_afi_safi, "fBit");
-                                       } else {
-                                               vty_out(vty,
-                                                       "False\n");
-                                       }
-
-                               }
-
-                               if (!use_json)
-                                       vty_out(vty,
-                                       "     End-of-RIB Received   : ");
+                               } else
+                                       vty_out(vty, "True\n");
+                       } else {
+                               if (use_json)
+                                       json_object_boolean_false_add(
+                                               json_afi_safi, "fBit");
+                               else
+                                       vty_out(vty, "False\n");
+                       }
 
-                               if (CHECK_FLAG(peer->af_sflags[afi][safi],
-                                               PEER_STATUS_EOR_RECEIVED)) {
+                       if (!use_json)
+                               vty_out(vty, "     End-of-RIB Received   : ");
 
-                                       if (use_json) {
-                                               json_object_boolean_true_add(
+                       if (CHECK_FLAG(peer->af_sflags[afi][safi],
+                                      PEER_STATUS_EOR_RECEIVED)) {
+                               if (use_json)
+                                       json_object_boolean_true_add(
                                                json_endofrib_status,
-                                                       "endOfRibRecv");
-                                       } else {
-                                               vty_out(vty, "Yes\n");
-                                       }
-
-                               } else {
-                                       if (use_json) {
-                                               json_object_boolean_false_add(
+                                               "endOfRibRecv");
+                               else
+                                       vty_out(vty, "Yes\n");
+                       } else {
+                               if (use_json)
+                                       json_object_boolean_false_add(
                                                json_endofrib_status,
-                                                       "endOfRibRecv");
-                                       } else {
-                                               vty_out(vty, "No\n");
-                                       }
-                               }
+                                               "endOfRibRecv");
+                               else
+                                       vty_out(vty, "No\n");
+                       }
 
-                               if (!use_json)
-                                       vty_out(vty,
-                                       "     End-of-RIB Send       : ");
+                       if (!use_json)
+                               vty_out(vty, "     End-of-RIB Send       : ");
 
-                               if (CHECK_FLAG(peer->af_sflags[afi][safi],
-                                               PEER_STATUS_EOR_SEND)) {
-                                       if (use_json) {
-                                               json_object_boolean_true_add(
+                       if (CHECK_FLAG(peer->af_sflags[afi][safi],
+                                      PEER_STATUS_EOR_SEND)) {
+                               if (use_json) {
+                                       json_object_boolean_true_add(
                                                json_endofrib_status,
-                                                        "endOfRibSend");
+                                               "endOfRibSend");
 
-                                               PRINT_EOR_JSON(eor_flag);
-                                       } else {
-                                               vty_out(vty, "Yes\n");
-                                               vty_out(vty,
+                                       PRINT_EOR_JSON(eor_flag);
+                               } else {
+                                       vty_out(vty, "Yes\n");
+                                       vty_out(vty,
                                                "     EoRSentAfterUpdate   : ");
 
-                                               PRINT_EOR(eor_flag);
-                                       }
-                               } else {
-                                       if (use_json) {
-                                               json_object_boolean_false_add(
+                                       PRINT_EOR(eor_flag);
+                               }
+                       } else {
+                               if (use_json) {
+                                       json_object_boolean_false_add(
                                                json_endofrib_status,
-                                                       "endOfRibSend");
-                                               json_object_boolean_false_add(
+                                               "endOfRibSend");
+                                       json_object_boolean_false_add(
                                                json_endofrib_status,
-                                                "endOfRibSentAfterUpdate");
-                                       } else {
-                                               vty_out(vty, "No\n");
-                                               vty_out(vty,
+                                               "endOfRibSentAfterUpdate");
+                               } else {
+                                       vty_out(vty, "No\n");
+                                       vty_out(vty,
                                                "     EoRSentAfterUpdate   : ");
-                                               vty_out(vty, "No\n");
-                                       }
+                                       vty_out(vty, "No\n");
                                }
+                       }
 
-                               if (use_json) {
-
-                                       json_object_int_add(json_timer,
-                                               "stalePathTimer",
-                                               peer->bgp->stalepath_time);
-
-                                       if (peer->t_gr_stale != NULL) {
+                       if (use_json) {
+                               json_object_int_add(json_timer,
+                                                   "stalePathTimer",
+                                                   peer->bgp->stalepath_time);
 
-                                               json_object_int_add(
+                               if (peer->t_gr_stale != NULL) {
+                                       json_object_int_add(
                                                json_timer,
                                                "stalePathTimerRemaining",
                                                thread_timer_remain_second(
-                                               peer->t_gr_stale));
-                                       }
-
-                                       /* Display Configured Selection
-                                        * Deferral only when when
-                                        * Gr mode is enabled.
-                                        */
-                                       if (CHECK_FLAG(peer->flags,
-                                               PEER_FLAG_GRACEFUL_RESTART)) {
+                                                       peer->t_gr_stale));
+                               }
 
-                                               json_object_int_add(
+                               /* Display Configured Selection
+                                * Deferral only when when
+                                * Gr mode is enabled.
+                                */
+                               if (CHECK_FLAG(peer->flags,
+                                              PEER_FLAG_GRACEFUL_RESTART)) {
+                                       json_object_int_add(
                                                json_timer,
                                                "selectionDeferralTimer",
                                                peer->bgp->stalepath_time);
-                                       }
+                               }
 
-                                       if (peer->bgp->gr_info[afi][safi]
-                                               .t_select_deferral != NULL) {
+                               if (peer->bgp->gr_info[afi][safi]
+                                           .t_select_deferral
+                                   != NULL) {
 
-                                               json_object_int_add(
+                                       json_object_int_add(
                                                json_timer,
                                                "selectionDeferralTimerRemaining",
                                                thread_timer_remain_second(
-                                               peer->bgp
-                                               ->gr_info[afi][safi]
-                                               .t_select_deferral));
-                                       }
-
-                               } else {
+                                                       peer->bgp
+                                                               ->gr_info[afi]
+                                                                        [safi]
+                                                               .t_select_deferral));
+                               }
+                       } else {
+                               vty_out(vty, "     Timers:\n");
 
-                                       vty_out(vty, "     Timers:\n");
+                               vty_out(vty, "%*s", 6, "");
+                               vty_out(vty,
+                                       "Configured Stale Path Time(sec)%*s: %u\n",
+                                       8, "", peer->bgp->stalepath_time);
 
+                               if (peer->t_gr_stale != NULL) {
                                        vty_out(vty, "%*s", 6, "");
                                        vty_out(vty,
-                                       "Configured Stale Path Time(sec)%*s: %u\n",
-                                               8, "",
-                                       peer->bgp->stalepath_time);
-
-                                       if (peer->t_gr_stale != NULL) {
-                                               vty_out(vty, "%*s", 6, "");
-                                               vty_out(vty,
                                                "Stale Path Remaining(sec)%*s: %ld\n",
                                                14, "",
                                                thread_timer_remain_second(
-                                               peer->t_gr_stale));
-                                       }
-                                       /* Display Configured Selection
-                                        * Deferral only when when
-                                        * Gr mode is enabled.
-                                        */
-                                       if (CHECK_FLAG(peer->flags,
-                                               PEER_FLAG_GRACEFUL_RESTART)) {
-                                               vty_out(vty, "%*s", 6, "");
-                                               vty_out(vty,
+                                                       peer->t_gr_stale));
+                               }
+                               /* Display Configured Selection
+                                * Deferral only when when
+                                * Gr mode is enabled.
+                                */
+                               if (CHECK_FLAG(peer->flags,
+                                              PEER_FLAG_GRACEFUL_RESTART)) {
+                                       vty_out(vty, "%*s", 6, "");
+                                       vty_out(vty,
                                                "Configured Selection Deferral Time(sec): %u\n",
                                                peer->bgp->select_defer_time);
-                                       }
+                               }
 
-                                       if (peer->bgp
-                                               ->gr_info[afi][safi]
-                                               .t_select_deferral != NULL) {
+                               if (peer->bgp->gr_info[afi][safi]
+                                           .t_select_deferral
+                                   != NULL) {
 
-                                               vty_out(vty, "%*s", 6, "");
-                                               vty_out(vty,
+                                       vty_out(vty, "%*s", 6, "");
+                                       vty_out(vty,
                                                "Selection Deferral Time Remaining(sec) : %ld\n",
                                                thread_timer_remain_second(
-                                               peer->bgp
-                                               ->gr_info[afi][safi]
-                                               .t_select_deferral));
-                                       }
-
-                               }
-                               if (use_json) {
-                                       json_object_object_add(json_afi_safi,
-                                                       "endOfRibStatus",
-                                                        json_endofrib_status);
-                                       json_object_object_add(json_afi_safi,
-                                                       "timers",
-                                                        json_timer);
-                                       json_object_object_add(json,
-                                               get_afi_safi_str(afi, safi, true),
-                                                        json_afi_safi);
+                                                       peer->bgp
+                                                               ->gr_info[afi]
+                                                                        [safi]
+                                                               .t_select_deferral));
                                }
                        }
+                       if (use_json) {
+                               json_object_object_add(json_afi_safi,
+                                                      "endOfRibStatus",
+                                                      json_endofrib_status);
+                               json_object_object_add(json_afi_safi, "timers",
+                                                      json_timer);
+                               json_object_object_add(
+                                       json, get_afi_safi_str(afi, safi, true),
+                                       json_afi_safi);
+                       }
                }
        }
 }
@@ -9800,39 +9770,30 @@ static void  bgp_show_neighbor_graceful_restart_time(struct vty *vty,
 
                json_timer = json_object_new_object();
 
-               json_object_int_add(json_timer,
-                                       "configuredRestartTimer",
-                                       p->bgp->restart_time);
+               json_object_int_add(json_timer, "configuredRestartTimer",
+                                   p->bgp->restart_time);
 
-               json_object_int_add(json_timer,
-                                       "receivedRestartTimer",
-                                       p->v_gr_restart);
+               json_object_int_add(json_timer, "receivedRestartTimer",
+                                   p->v_gr_restart);
 
-               if (p->t_gr_restart != NULL) {
-                       json_object_int_add(json_timer,
-                                       "restartTimerRemaining",
-                                       thread_timer_remain_second(
-                                       p->t_gr_restart)
-                                       );
-               }
+               if (p->t_gr_restart != NULL)
+                       json_object_int_add(
+                               json_timer, "restartTimerRemaining",
+                               thread_timer_remain_second(p->t_gr_restart));
 
                json_object_object_add(json, "timers", json_timer);
        } else {
 
                vty_out(vty, "    Timers :\n");
-               vty_out(vty,
-                       "     Configured Restart Time(sec)  : %u\n",
-                               p->bgp->restart_time);
+               vty_out(vty, "     Configured Restart Time(sec)  : %u\n",
+                       p->bgp->restart_time);
 
-               vty_out(vty,
-                       "     Received Restart Time(sec)    : %u\n",
-                                       p->v_gr_restart);
-               if (p->t_gr_restart != NULL) {
+               vty_out(vty, "     Received Restart Time(sec)    : %u\n",
+                       p->v_gr_restart);
+               if (p->t_gr_restart != NULL)
                        vty_out(vty,
-                       "     Restart Time Remaining(sec)   : %ld\n",
-                               thread_timer_remain_second(
-                                       p->t_gr_restart));
-               }
+                               "     Restart Time Remaining(sec)   : %ld\n",
+                               thread_timer_remain_second(p->t_gr_restart));
        }
 }
 
@@ -9849,14 +9810,14 @@ static void bgp_show_peer_gr_status(struct vty *vty, struct peer *p,
 
        if (p->conf_if) {
                if (use_json)
-                       json_object_string_add(json, "neighborAddr",
+                       json_object_string_add(
+                               json, "neighborAddr",
                                BGP_PEER_SU_UNSPEC(p)
-                               ? "none"
-                               : sockunion2str(&p->su, buf,
-                                       SU_ADDRSTRLEN));
+                                       ? "none"
+                                       : sockunion2str(&p->su, buf,
+                                                       SU_ADDRSTRLEN));
                else
-                       vty_out(vty, "BGP neighbor on %s: %s\n",
-                               p->conf_if,
+                       vty_out(vty, "BGP neighbor on %s: %s\n", p->conf_if,
                                BGP_PEER_SU_UNSPEC(p)
                                        ? "none"
                                        : sockunion2str(&p->su, buf,
@@ -12194,35 +12155,34 @@ static int bgp_show_neighbor_graceful_restart(struct vty *vty,
 
                if (type == show_all) {
                        bgp_show_peer_gr_status(vty, peer, use_json,
-                                                       json_neighbor);
+                                               json_neighbor);
 
                        if (use_json)
-                               json_object_object_add(json,
-                                               peer->host, json_neighbor);
+                               json_object_object_add(json, peer->host,
+                                                      json_neighbor);
 
                } else if (type == show_peer) {
                        if (conf_if) {
                                if ((peer->conf_if
-                                       && !strcmp(peer->conf_if, conf_if))
-                                       || (peer->hostname
+                                    && !strcmp(peer->conf_if, conf_if))
+                                   || (peer->hostname
                                        && !strcmp(peer->hostname, conf_if))) {
                                        find = 1;
-                                       bgp_show_peer_gr_status(vty,
-                                               peer, use_json,
-                                               json_neighbor);
+                                       bgp_show_peer_gr_status(vty, peer,
+                                                               use_json,
+                                                               json_neighbor);
                                }
                        } else {
                                if (sockunion_same(&peer->su, su)) {
                                        find = 1;
-                                       bgp_show_peer_gr_status(vty,
-                                               peer, use_json,
-                                               json_neighbor);
+                                       bgp_show_peer_gr_status(vty, peer,
+                                                               use_json,
+                                                               json_neighbor);
                                }
                        }
-                       if (use_json && find) {
-                               json_object_object_add(json,
-                                               peer->host, json_neighbor);
-                       }
+                       if (use_json && find)
+                               json_object_object_add(json, peer->host,
+                                                      json_neighbor);
                }
 
                if (find)
@@ -12231,14 +12191,14 @@ static int bgp_show_neighbor_graceful_restart(struct vty *vty,
 
        if (type == show_peer && !find) {
                if (use_json)
-                       json_object_boolean_true_add(json,
-                                                       "bgpNoSuchNeighbor");
+                       json_object_boolean_true_add(json, "bgpNoSuchNeighbor");
                else
                        vty_out(vty, "%% No such neighbor\n");
        }
        if (use_json) {
-               vty_out(vty, "%s\n", json_object_to_json_string_ext(
-                                            json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n",
+                       json_object_to_json_string_ext(
+                               json, JSON_C_TO_STRING_PRETTY));
        } else {
                vty_out(vty, "\n");
        }
@@ -12363,32 +12323,27 @@ static void  bgp_show_neighbor_graceful_restart_vty(struct vty *vty,
 
        bgp = bgp_get_default();
 
-       if (bgp) {
-
-               if (!use_json) {
-                       bgp_show_global_graceful_restart_mode_vty(vty, bgp,
-                                               use_json, NULL);
-               }
+       if (!bgp)
+               return;
 
-               json = json_object_new_object();
-               if (ip_str) {
-                       ret = str2sockunion(ip_str, &su);
-                       if (ret < 0)
-                               bgp_show_neighbor_graceful_restart(vty,
-                                       bgp, type, NULL, ip_str,
-                                       afi, use_json, json);
-                       else
-                               bgp_show_neighbor_graceful_restart(vty,
-                                       bgp, type, &su, NULL,
-                                       afi, use_json, json);
-               } else {
-                       bgp_show_neighbor_graceful_restart(vty, bgp,
-                                       type, NULL, NULL, afi,
-                                       use_json, json);
-               }
-               json_object_free(json);
-       }
+       if (!use_json)
+               bgp_show_global_graceful_restart_mode_vty(vty, bgp, use_json,
+                                                         NULL);
 
+       json = json_object_new_object();
+       if (ip_str) {
+               ret = str2sockunion(ip_str, &su);
+               if (ret < 0)
+                       bgp_show_neighbor_graceful_restart(vty, bgp, type, NULL,
+                                                          ip_str, afi,
+                                                          use_json, json);
+               else
+                       bgp_show_neighbor_graceful_restart(
+                               vty, bgp, type, &su, NULL, afi, use_json, json);
+       } else
+               bgp_show_neighbor_graceful_restart(vty, bgp, type, NULL, NULL,
+                                                  afi, use_json, json);
+       json_object_free(json);
 }
 
 static void bgp_show_all_instances_neighbors_vty(struct vty *vty,
@@ -12722,27 +12677,23 @@ static void bgp_show_global_graceful_restart_mode_vty(struct vty *vty,
 
        vty_out(vty, "\n%s", SHOW_GR_HEADER);
 
-       int bgp_global_gr_mode = bgp_global_gr_mode_get(bgp);
+       enum global_mode bgp_global_gr_mode = bgp_global_gr_mode_get(bgp);
 
        switch (bgp_global_gr_mode) {
 
        case GLOBAL_HELPER:
-               vty_out(vty,
-                               "Global BGP GR Mode :  Helper\n");
+               vty_out(vty, "Global BGP GR Mode :  Helper\n");
                break;
 
        case GLOBAL_GR:
-               vty_out(vty,
-                       "Global BGP GR Mode :  Restart\n");
+               vty_out(vty, "Global BGP GR Mode :  Restart\n");
                break;
 
        case GLOBAL_DISABLE:
-               vty_out(vty,
-                               "Global BGP GR Mode :  Disable\n");
+               vty_out(vty, "Global BGP GR Mode :  Disable\n");
                break;
 
        case GLOBAL_INVALID:
-       default:
                vty_out(vty,
                        "Global BGP GR Mode  Invalid\n");
                break;
@@ -14606,23 +14557,25 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
                        addr);
 
        if (!CHECK_FLAG(peer->peer_gr_new_status_flag,
-               PEER_GRACEFUL_RESTART_NEW_STATE_INHERIT)) {
+                       PEER_GRACEFUL_RESTART_NEW_STATE_INHERIT)) {
 
                if (CHECK_FLAG(peer->peer_gr_new_status_flag,
-                               PEER_GRACEFUL_RESTART_NEW_STATE_HELPER)) {
+                              PEER_GRACEFUL_RESTART_NEW_STATE_HELPER)) {
                        vty_out(vty,
                                " neighbor %s graceful-restart-helper\n", addr);
-               } else if (CHECK_FLAG(peer->peer_gr_new_status_flag,
-                               PEER_GRACEFUL_RESTART_NEW_STATE_RESTART)) {
+               } else if (CHECK_FLAG(
+                                  peer->peer_gr_new_status_flag,
+                                  PEER_GRACEFUL_RESTART_NEW_STATE_RESTART)) {
                        vty_out(vty,
                                " neighbor %s graceful-restart\n", addr);
-               } else if ((!(CHECK_FLAG(peer->peer_gr_new_status_flag,
-                               PEER_GRACEFUL_RESTART_NEW_STATE_HELPER))
-                               && !(CHECK_FLAG(peer->peer_gr_new_status_flag,
-                               PEER_GRACEFUL_RESTART_NEW_STATE_RESTART)))) {
-                       vty_out(vty,
-                               " neighbor %s graceful-restart-disable\n",
-                                       addr);
+               } else if (
+                       (!(CHECK_FLAG(peer->peer_gr_new_status_flag,
+                                     PEER_GRACEFUL_RESTART_NEW_STATE_HELPER))
+                        && !(CHECK_FLAG(
+                                peer->peer_gr_new_status_flag,
+                                PEER_GRACEFUL_RESTART_NEW_STATE_RESTART)))) {
+                       vty_out(vty, " neighbor %s graceful-restart-disable\n",
+                               addr);
                }
        }
 }
@@ -16753,21 +16706,29 @@ static void community_list_perror(struct vty *vty, int ret)
 /*community-list standard */
 DEFUN (community_list_standard,
        bgp_community_list_standard_cmd,
-       "bgp community-list <(1-99)|standard WORD> <deny|permit> AA:NN...",
+       "bgp community-list <(1-99)|standard WORD> [seq (1-4294967295)] <deny|permit> AA:NN...",
        BGP_STR
        COMMUNITY_LIST_STR
        "Community list number (standard)\n"
        "Add an standard community-list entry\n"
        "Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify community to reject\n"
        "Specify community to accept\n"
        COMMUNITY_VAL_STR)
 {
        char *cl_name_or_number = NULL;
+       char *seq = NULL;
        int direct = 0;
        int style = COMMUNITY_LIST_STANDARD;
        int idx = 0;
 
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
+       idx = 0;
        argv_find(argv, argc, "(1-99)", &idx);
        argv_find(argv, argc, "WORD", &idx);
        cl_name_or_number = argv[idx]->arg;
@@ -16776,8 +16737,8 @@ DEFUN (community_list_standard,
        argv_find(argv, argc, "AA:NN", &idx);
        char *str = argv_concat(argv, argc, idx);
 
-       int ret = community_list_set(bgp_clist, cl_name_or_number, str, direct,
-                                    style);
+       int ret = community_list_set(bgp_clist, cl_name_or_number, str, seq,
+                                    direct, style);
 
        XFREE(MTYPE_TMP, str);
 
@@ -16792,13 +16753,15 @@ DEFUN (community_list_standard,
 
 DEFUN (no_community_list_standard_all,
        no_bgp_community_list_standard_all_cmd,
-       "no bgp community-list <(1-99)|standard WORD> <deny|permit> AA:NN...",
+       "no bgp community-list <(1-99)|standard WORD> [seq (1-4294967295)] <deny|permit> AA:NN...",
        NO_STR
        BGP_STR
        COMMUNITY_LIST_STR
        "Community list number (standard)\n"
        "Add an standard community-list entry\n"
        "Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify community to reject\n"
        "Specify community to accept\n"
        COMMUNITY_VAL_STR)
@@ -16807,9 +16770,14 @@ DEFUN (no_community_list_standard_all,
        char *str = NULL;
        int direct = 0;
        int style = COMMUNITY_LIST_STANDARD;
-
+       char *seq = NULL;
        int idx = 0;
 
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
+       idx = 0;
        argv_find(argv, argc, "permit", &idx);
        argv_find(argv, argc, "deny", &idx);
 
@@ -16828,7 +16796,7 @@ DEFUN (no_community_list_standard_all,
        argv_find(argv, argc, "WORD", &idx);
        cl_name_or_number = argv[idx]->arg;
 
-       int ret = community_list_unset(bgp_clist, cl_name_or_number, str,
+       int ret = community_list_unset(bgp_clist, cl_name_or_number, str, seq,
                                       direct, style);
 
        XFREE(MTYPE_TMP, str);
@@ -16851,22 +16819,30 @@ ALIAS(no_community_list_standard_all, no_bgp_community_list_standard_all_list_cm
 /*community-list expanded */
 DEFUN (community_list_expanded_all,
        bgp_community_list_expanded_all_cmd,
-       "bgp community-list <(100-500)|expanded WORD> <deny|permit> AA:NN...",
+       "bgp community-list <(100-500)|expanded WORD> [seq (1-4294967295)] <deny|permit> AA:NN...",
        BGP_STR
        COMMUNITY_LIST_STR
        "Community list number (expanded)\n"
        "Add an expanded community-list entry\n"
        "Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify community to reject\n"
        "Specify community to accept\n"
        COMMUNITY_VAL_STR)
 {
        char *cl_name_or_number = NULL;
+       char *seq = NULL;
        int direct = 0;
        int style = COMMUNITY_LIST_EXPANDED;
-
        int idx = 0;
 
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
+       idx = 0;
+
        argv_find(argv, argc, "(100-500)", &idx);
        argv_find(argv, argc, "WORD", &idx);
        cl_name_or_number = argv[idx]->arg;
@@ -16875,8 +16851,8 @@ DEFUN (community_list_expanded_all,
        argv_find(argv, argc, "AA:NN", &idx);
        char *str = argv_concat(argv, argc, idx);
 
-       int ret = community_list_set(bgp_clist, cl_name_or_number, str, direct,
-                                    style);
+       int ret = community_list_set(bgp_clist, cl_name_or_number, str, seq,
+                                    direct, style);
 
        XFREE(MTYPE_TMP, str);
 
@@ -16891,24 +16867,31 @@ DEFUN (community_list_expanded_all,
 
 DEFUN (no_community_list_expanded_all,
        no_bgp_community_list_expanded_all_cmd,
-       "no bgp community-list <(100-500)|expanded WORD> <deny|permit> AA:NN...",
+       "no bgp community-list <(100-500)|expanded WORD> [seq (1-4294967295)] <deny|permit> AA:NN...",
        NO_STR
        BGP_STR
        COMMUNITY_LIST_STR
        "Community list number (expanded)\n"
        "Add an expanded community-list entry\n"
        "Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify community to reject\n"
        "Specify community to accept\n"
        COMMUNITY_VAL_STR)
 {
        char *cl_name_or_number = NULL;
+       char *seq = NULL;
        char *str = NULL;
        int direct = 0;
        int style = COMMUNITY_LIST_EXPANDED;
-
        int idx = 0;
 
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
+       idx = 0;
        argv_find(argv, argc, "permit", &idx);
        argv_find(argv, argc, "deny", &idx);
 
@@ -16927,7 +16910,7 @@ DEFUN (no_community_list_expanded_all,
        argv_find(argv, argc, "WORD", &idx);
        cl_name_or_number = argv[idx]->arg;
 
-       int ret = community_list_unset(bgp_clist, cl_name_or_number, str,
+       int ret = community_list_unset(bgp_clist, cl_name_or_number, str, seq,
                                       direct, style);
 
        XFREE(MTYPE_TMP, str);
@@ -17054,7 +17037,13 @@ static int lcommunity_list_set_vty(struct vty *vty, int argc,
        char *str;
        int idx = 0;
        char *cl_name;
+       char *seq = NULL;
+
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
 
+       idx = 0;
        direct = argv_find(argv, argc, "permit", &idx) ? COMMUNITY_PERMIT
                                                       : COMMUNITY_DENY;
 
@@ -17078,7 +17067,7 @@ static int lcommunity_list_set_vty(struct vty *vty, int argc,
        else
                str = NULL;
 
-       ret = lcommunity_list_set(bgp_clist, cl_name, str, direct, style);
+       ret = lcommunity_list_set(bgp_clist, cl_name, str, seq, direct, style);
 
        /* Free temporary community list string allocated by
           argv_concat().  */
@@ -17098,7 +17087,13 @@ static int lcommunity_list_unset_vty(struct vty *vty, int argc,
        int direct = 0;
        char *str = NULL;
        int idx = 0;
+       char *seq = NULL;
 
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
+       idx = 0;
        argv_find(argv, argc, "permit", &idx);
        argv_find(argv, argc, "deny", &idx);
 
@@ -17122,7 +17117,7 @@ static int lcommunity_list_unset_vty(struct vty *vty, int argc,
        argv_find(argv, argc, "WORD", &idx);
 
        /* Unset community list.  */
-       ret = lcommunity_list_unset(bgp_clist, argv[idx]->arg, str, direct,
+       ret = lcommunity_list_unset(bgp_clist, argv[idx]->arg, str, seq, direct,
                                    style);
 
        /* Free temporary community list string allocated by
@@ -17143,10 +17138,12 @@ static int lcommunity_list_unset_vty(struct vty *vty, int argc,
 
 DEFUN (lcommunity_list_standard,
        bgp_lcommunity_list_standard_cmd,
-       "bgp large-community-list (1-99) <deny|permit> AA:BB:CC...",
+       "bgp large-community-list (1-99) [seq (1-4294967295)] <deny|permit> AA:BB:CC...",
        BGP_STR
        LCOMMUNITY_LIST_STR
        "Large Community list number (standard)\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify large community to reject\n"
        "Specify large community to accept\n"
        LCOMMUNITY_VAL_STR)
@@ -17157,10 +17154,12 @@ DEFUN (lcommunity_list_standard,
 
 DEFUN (lcommunity_list_expanded,
        bgp_lcommunity_list_expanded_cmd,
-       "bgp large-community-list (100-500) <deny|permit> LINE...",
+       "bgp large-community-list (100-500) [seq (1-4294967295)] <deny|permit> LINE...",
        BGP_STR
        LCOMMUNITY_LIST_STR
        "Large Community list number (expanded)\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify large community to reject\n"
        "Specify large community to accept\n"
        "An ordered list as a regular-expression\n")
@@ -17171,11 +17170,13 @@ DEFUN (lcommunity_list_expanded,
 
 DEFUN (lcommunity_list_name_standard,
        bgp_lcommunity_list_name_standard_cmd,
-       "bgp large-community-list standard WORD <deny|permit> AA:BB:CC...",
+       "bgp large-community-list standard WORD [seq (1-4294967295)] <deny|permit> AA:BB:CC...",
        BGP_STR
        LCOMMUNITY_LIST_STR
        "Specify standard large-community-list\n"
        "Large Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify large community to reject\n"
        "Specify large community to accept\n"
        LCOMMUNITY_VAL_STR)
@@ -17186,11 +17187,13 @@ DEFUN (lcommunity_list_name_standard,
 
 DEFUN (lcommunity_list_name_expanded,
        bgp_lcommunity_list_name_expanded_cmd,
-       "bgp large-community-list expanded WORD <deny|permit> LINE...",
+       "bgp large-community-list expanded WORD [seq (1-4294967295)] <deny|permit> LINE...",
        BGP_STR
        LCOMMUNITY_LIST_STR
        "Specify expanded large-community-list\n"
        "Large Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify large community to reject\n"
        "Specify large community to accept\n"
        "An ordered list as a regular-expression\n")
@@ -17199,8 +17202,8 @@ DEFUN (lcommunity_list_name_expanded,
                                       LARGE_COMMUNITY_LIST_EXPANDED, 1);
 }
 
-DEFUN (no_lcommunity_list_standard_all,
-       no_bgp_lcommunity_list_standard_all_cmd,
+DEFUN (no_lcommunity_list_all,
+       no_bgp_lcommunity_list_all_cmd,
        "no bgp large-community-list <(1-99)|(100-500)|WORD>",
        NO_STR
        BGP_STR
@@ -17213,6 +17216,19 @@ DEFUN (no_lcommunity_list_standard_all,
                                         LARGE_COMMUNITY_LIST_STANDARD);
 }
 
+DEFUN (no_lcommunity_list_name_standard_all,
+       no_bgp_lcommunity_list_name_standard_all_cmd,
+       "no bgp large-community-list standard WORD",
+       NO_STR
+       BGP_STR
+       LCOMMUNITY_LIST_STR
+       "Specify standard large-community-list\n"
+       "Large Community list name\n")
+{
+       return lcommunity_list_unset_vty(vty, argc, argv,
+                                        LARGE_COMMUNITY_LIST_STANDARD);
+}
+
 DEFUN (no_lcommunity_list_name_expanded_all,
        no_bgp_lcommunity_list_name_expanded_all_cmd,
        "no bgp large-community-list expanded WORD",
@@ -17228,11 +17244,13 @@ DEFUN (no_lcommunity_list_name_expanded_all,
 
 DEFUN (no_lcommunity_list_standard,
        no_bgp_lcommunity_list_standard_cmd,
-       "no bgp large-community-list (1-99) <deny|permit> AA:AA:NN...",
+       "no bgp large-community-list (1-99) [seq (1-4294967295)] <deny|permit> AA:AA:NN...",
        NO_STR
        BGP_STR
        LCOMMUNITY_LIST_STR
        "Large Community list number (standard)\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify large community to reject\n"
        "Specify large community to accept\n"
        LCOMMUNITY_VAL_STR)
@@ -17243,11 +17261,13 @@ DEFUN (no_lcommunity_list_standard,
 
 DEFUN (no_lcommunity_list_expanded,
        no_bgp_lcommunity_list_expanded_cmd,
-       "no bgp large-community-list (100-500) <deny|permit> LINE...",
+       "no bgp large-community-list (100-500) [seq (1-4294967295)] <deny|permit> LINE...",
        NO_STR
        BGP_STR
        LCOMMUNITY_LIST_STR
        "Large Community list number (expanded)\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify large community to reject\n"
        "Specify large community to accept\n"
        "An ordered list as a regular-expression\n")
@@ -17258,12 +17278,14 @@ DEFUN (no_lcommunity_list_expanded,
 
 DEFUN (no_lcommunity_list_name_standard,
        no_bgp_lcommunity_list_name_standard_cmd,
-       "no bgp large-community-list standard WORD <deny|permit> AA:AA:NN...",
+       "no bgp large-community-list standard WORD [seq (1-4294967295)] <deny|permit> AA:AA:NN...",
        NO_STR
        BGP_STR
        LCOMMUNITY_LIST_STR
        "Specify standard large-community-list\n"
        "Large Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify large community to reject\n"
        "Specify large community to accept\n"
        LCOMMUNITY_VAL_STR)
@@ -17274,12 +17296,14 @@ DEFUN (no_lcommunity_list_name_standard,
 
 DEFUN (no_lcommunity_list_name_expanded,
        no_bgp_lcommunity_list_name_expanded_cmd,
-       "no bgp large-community-list expanded WORD <deny|permit> LINE...",
+       "no bgp large-community-list expanded WORD [seq (1-4294967295)] <deny|permit> LINE...",
        NO_STR
        BGP_STR
        LCOMMUNITY_LIST_STR
        "Specify expanded large-community-list\n"
        "Large community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify large community to reject\n"
        "Specify large community to accept\n"
        "An ordered list as a regular-expression\n")
@@ -17374,12 +17398,14 @@ DEFUN (show_lcommunity_list_arg,
 
 DEFUN (extcommunity_list_standard,
        bgp_extcommunity_list_standard_cmd,
-       "bgp extcommunity-list <(1-99)|standard WORD> <deny|permit> AA:NN...",
+       "bgp extcommunity-list <(1-99)|standard WORD> [seq (1-4294967295)] <deny|permit> AA:NN...",
        BGP_STR
        EXTCOMMUNITY_LIST_STR
        "Extended Community list number (standard)\n"
        "Specify standard extcommunity-list\n"
        "Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify community to reject\n"
        "Specify community to accept\n"
        EXTCOMMUNITY_VAL_STR)
@@ -17387,18 +17413,24 @@ DEFUN (extcommunity_list_standard,
        int style = EXTCOMMUNITY_LIST_STANDARD;
        int direct = 0;
        char *cl_number_or_name = NULL;
+       char *seq = NULL;
 
        int idx = 0;
 
        argv_find(argv, argc, "(1-99)", &idx);
        argv_find(argv, argc, "WORD", &idx);
        cl_number_or_name = argv[idx]->arg;
+
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
        direct = argv_find(argv, argc, "permit", &idx) ? COMMUNITY_PERMIT
                                                       : COMMUNITY_DENY;
        argv_find(argv, argc, "AA:NN", &idx);
        char *str = argv_concat(argv, argc, idx);
 
-       int ret = extcommunity_list_set(bgp_clist, cl_number_or_name, str,
+       int ret = extcommunity_list_set(bgp_clist, cl_number_or_name, str, seq,
                                        direct, style);
 
        XFREE(MTYPE_TMP, str);
@@ -17413,12 +17445,14 @@ DEFUN (extcommunity_list_standard,
 
 DEFUN (extcommunity_list_name_expanded,
        bgp_extcommunity_list_name_expanded_cmd,
-       "bgp extcommunity-list <(100-500)|expanded WORD> <deny|permit> LINE...",
+       "bgp extcommunity-list <(100-500)|expanded WORD> [seq (1-4294967295)] <deny|permit> LINE...",
        BGP_STR
        EXTCOMMUNITY_LIST_STR
        "Extended Community list number (expanded)\n"
        "Specify expanded extcommunity-list\n"
        "Extended Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify community to reject\n"
        "Specify community to accept\n"
        "An ordered list as a regular-expression\n")
@@ -17426,17 +17460,23 @@ DEFUN (extcommunity_list_name_expanded,
        int style = EXTCOMMUNITY_LIST_EXPANDED;
        int direct = 0;
        char *cl_number_or_name = NULL;
+       char *seq = NULL;
        int idx = 0;
 
        argv_find(argv, argc, "(100-500)", &idx);
        argv_find(argv, argc, "WORD", &idx);
        cl_number_or_name = argv[idx]->arg;
+
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
        direct = argv_find(argv, argc, "permit", &idx) ? COMMUNITY_PERMIT
                                                       : COMMUNITY_DENY;
        argv_find(argv, argc, "LINE", &idx);
        char *str = argv_concat(argv, argc, idx);
 
-       int ret = extcommunity_list_set(bgp_clist, cl_number_or_name, str,
+       int ret = extcommunity_list_set(bgp_clist, cl_number_or_name, str, seq,
                                        direct, style);
 
        XFREE(MTYPE_TMP, str);
@@ -17451,13 +17491,15 @@ DEFUN (extcommunity_list_name_expanded,
 
 DEFUN (no_extcommunity_list_standard_all,
        no_bgp_extcommunity_list_standard_all_cmd,
-       "no bgp extcommunity-list <(1-99)|standard WORD> <deny|permit> AA:NN...",
+       "no bgp extcommunity-list <(1-99)|standard WORD> [seq (1-4294967295)] <deny|permit> AA:NN...",
        NO_STR
        BGP_STR
        EXTCOMMUNITY_LIST_STR
        "Extended Community list number (standard)\n"
        "Specify standard extcommunity-list\n"
        "Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify community to reject\n"
        "Specify community to accept\n"
        EXTCOMMUNITY_VAL_STR)
@@ -17466,11 +17508,16 @@ DEFUN (no_extcommunity_list_standard_all,
        int direct = 0;
        char *cl_number_or_name = NULL;
        char *str = NULL;
+       char *seq = NULL;
        int idx = 0;
 
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
+       idx = 0;
        argv_find(argv, argc, "permit", &idx);
        argv_find(argv, argc, "deny", &idx);
-
        if (idx) {
                direct = argv_find(argv, argc, "permit", &idx)
                                 ? COMMUNITY_PERMIT
@@ -17487,7 +17534,7 @@ DEFUN (no_extcommunity_list_standard_all,
        cl_number_or_name = argv[idx]->arg;
 
        int ret = extcommunity_list_unset(bgp_clist, cl_number_or_name, str,
-                                         direct, style);
+                                         seq, direct, style);
 
        XFREE(MTYPE_TMP, str);
 
@@ -17509,13 +17556,15 @@ ALIAS(no_extcommunity_list_standard_all,
 
 DEFUN (no_extcommunity_list_expanded_all,
        no_bgp_extcommunity_list_expanded_all_cmd,
-       "no bgp extcommunity-list <(100-500)|expanded WORD> <deny|permit> LINE...",
+       "no bgp extcommunity-list <(100-500)|expanded WORD> [seq (1-4294967295)] <deny|permit> LINE...",
        NO_STR
        BGP_STR
        EXTCOMMUNITY_LIST_STR
        "Extended Community list number (expanded)\n"
        "Specify expanded extcommunity-list\n"
        "Extended Community list name\n"
+       "Sequence number of an entry\n"
+       "Sequence number\n"
        "Specify community to reject\n"
        "Specify community to accept\n"
        "An ordered list as a regular-expression\n")
@@ -17524,8 +17573,14 @@ DEFUN (no_extcommunity_list_expanded_all,
        int direct = 0;
        char *cl_number_or_name = NULL;
        char *str = NULL;
+       char *seq = NULL;
        int idx = 0;
 
+       argv_find(argv, argc, "(1-4294967295)", &idx);
+       if (idx)
+               seq = argv[idx]->arg;
+
+       idx = 0;
        argv_find(argv, argc, "permit", &idx);
        argv_find(argv, argc, "deny", &idx);
 
@@ -17545,7 +17600,7 @@ DEFUN (no_extcommunity_list_expanded_all,
        cl_number_or_name = argv[idx]->arg;
 
        int ret = extcommunity_list_unset(bgp_clist, cl_number_or_name, str,
-                                         direct, style);
+                                         seq, direct, style);
 
        XFREE(MTYPE_TMP, str);
 
@@ -17656,18 +17711,22 @@ static int community_list_config_write(struct vty *vty)
 
        for (list = cm->num.head; list; list = list->next)
                for (entry = list->head; entry; entry = entry->next) {
-                       vty_out(vty, "bgp community-list %s %s %s\n", list->name,
+                       vty_out(vty,
+                               "bgp community-list %s seq %" PRId64 " %s %s\n",
+                               list->name, entry->seq,
                                community_direct_str(entry->direct),
                                community_list_config_str(entry));
                        write++;
                }
        for (list = cm->str.head; list; list = list->next)
                for (entry = list->head; entry; entry = entry->next) {
-                       vty_out(vty, "bgp community-list %s %s %s %s\n",
+                       vty_out(vty,
+                               "bgp community-list %s %s seq %" PRId64 " %s %s\n",
                                entry->style == COMMUNITY_LIST_STANDARD
                                        ? "standard"
                                        : "expanded",
-                               list->name, community_direct_str(entry->direct),
+                               list->name, entry->seq,
+                               community_direct_str(entry->direct),
                                community_list_config_str(entry));
                        write++;
                }
@@ -17677,18 +17736,23 @@ static int community_list_config_write(struct vty *vty)
 
        for (list = cm->num.head; list; list = list->next)
                for (entry = list->head; entry; entry = entry->next) {
-                       vty_out(vty, "bgp extcommunity-list %s %s %s\n",
-                               list->name, community_direct_str(entry->direct),
+                       vty_out(vty,
+                               "bgp extcommunity-list %s seq %" PRId64 " %s %s\n",
+                               list->name, entry->seq,
+                               community_direct_str(entry->direct),
                                community_list_config_str(entry));
                        write++;
                }
        for (list = cm->str.head; list; list = list->next)
                for (entry = list->head; entry; entry = entry->next) {
-                       vty_out(vty, "bgp extcommunity-list %s %s %s %s\n",
+                       vty_out(vty,
+                               "bgp extcommunity-list %s %s seq %" PRId64
+                               " %s %s\n",
                                entry->style == EXTCOMMUNITY_LIST_STANDARD
                                        ? "standard"
                                        : "expanded",
-                               list->name, community_direct_str(entry->direct),
+                               list->name, entry->seq,
+                               community_direct_str(entry->direct),
                                community_list_config_str(entry));
                        write++;
                }
@@ -17700,18 +17764,24 @@ static int community_list_config_write(struct vty *vty)
 
        for (list = cm->num.head; list; list = list->next)
                for (entry = list->head; entry; entry = entry->next) {
-                       vty_out(vty, "bgp large-community-list %s %s %s\n",
-                               list->name, community_direct_str(entry->direct),
+                       vty_out(vty,
+                               "bgp large-community-list %s seq %" PRId64
+                               " %s %s\n",
+                               list->name, entry->seq,
+                               community_direct_str(entry->direct),
                                community_list_config_str(entry));
                        write++;
                }
        for (list = cm->str.head; list; list = list->next)
                for (entry = list->head; entry; entry = entry->next) {
-                       vty_out(vty, "bgp large-community-list %s %s %s %s\n",
+                       vty_out(vty,
+                               "bgp large-community-list %s %s seq %" PRId64
+                               " %s %s\n",
+
                                entry->style == LARGE_COMMUNITY_LIST_STANDARD
                                        ? "standard"
                                        : "expanded",
-                               list->name, community_direct_str(entry->direct),
+                               list->name, entry->seq, community_direct_str(entry->direct),
                                community_list_config_str(entry));
                        write++;
                }
@@ -17754,7 +17824,9 @@ static void community_list_vty(void)
        install_element(CONFIG_NODE, &bgp_lcommunity_list_expanded_cmd);
        install_element(CONFIG_NODE, &bgp_lcommunity_list_name_standard_cmd);
        install_element(CONFIG_NODE, &bgp_lcommunity_list_name_expanded_cmd);
-       install_element(CONFIG_NODE, &no_bgp_lcommunity_list_standard_all_cmd);
+       install_element(CONFIG_NODE, &no_bgp_lcommunity_list_all_cmd);
+       install_element(CONFIG_NODE,
+                       &no_bgp_lcommunity_list_name_standard_all_cmd);
        install_element(CONFIG_NODE,
                        &no_bgp_lcommunity_list_name_expanded_all_cmd);
        install_element(CONFIG_NODE, &no_bgp_lcommunity_list_standard_cmd);