summaryrefslogtreecommitdiff
path: root/bgpd/bgpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r--bgpd/bgpd.c270
1 files changed, 197 insertions, 73 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index e9d81de1..510e2960 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -173,8 +173,11 @@ bgp_router_id_set (struct bgp *bgp, struct in_addr *id)
IPV4_ADDR_COPY (&peer->local_id, id);
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_RID_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
}
return 0;
}
@@ -205,8 +208,11 @@ bgp_router_id_unset (struct bgp *bgp)
LIST_LOOP (bgp->peer, peer, nn)
{
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_RID_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
}
return 0;
@@ -233,8 +239,11 @@ bgp_cluster_id_set (struct bgp *bgp, struct in_addr *cluster_id)
continue;
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_CLID_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
}
return 0;
}
@@ -258,8 +267,11 @@ bgp_cluster_id_unset (struct bgp *bgp)
continue;
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_CLID_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
}
return 0;
}
@@ -313,8 +325,12 @@ bgp_confederation_id_set (struct bgp *bgp, as_t as)
{
peer->local_as = as;
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_CONFED_ID_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
+
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -329,8 +345,11 @@ bgp_confederation_id_set (struct bgp *bgp, as_t as)
if (peer_sort (peer) == BGP_PEER_EBGP)
peer->local_as = as;
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_CONFED_ID_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -355,8 +374,12 @@ bgp_confederation_id_unset (struct bgp *bgp)
{
peer->local_as = bgp->as;
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_CONFED_ID_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
+
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -415,8 +438,11 @@ bgp_confederation_peers_add (struct bgp *bgp, as_t as)
{
peer->local_as = bgp->as;
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_CONFED_PEER_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -468,8 +494,11 @@ bgp_confederation_peers_remove (struct bgp *bgp, as_t as)
{
peer->local_as = bgp->confed_id;
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_CONFED_PEER_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -587,6 +616,7 @@ peer_af_flag_reset (struct peer *peer, afi_t afi, safi_t safi)
/* Clear neighbor maximum-prefix */
peer->pmax[afi][safi] = 0;
+ peer->pmax_threshold[afi][safi] = MAXIMUM_PREFIX_THRESHOLD_DEFAULT;
}
/* peer global config reset */
@@ -792,8 +822,11 @@ peer_as_change (struct peer *peer, as_t as)
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_REMOTE_AS_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -948,8 +981,11 @@ peer_activate (struct peer *peer, afi_t afi, safi_t safi)
}
}
else
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_AF_ACTIVATE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
}
}
}
@@ -1004,12 +1040,18 @@ peer_deactivate (struct peer *peer, afi_t afi, safi_t safi)
peer->pcount[afi][safi] = 0;
}
else
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_NEIGHBOR_DELETE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
}
else
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_NEIGHBOR_DELETE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
}
}
return 0;
@@ -1038,6 +1080,7 @@ peer_delete (struct peer *peer)
/* Withdraw all information from routing table. We can not use
BGP_EVENT_ADD (peer, BGP_Stop) at here. Because the event is
executed after peer structure is deleted. */
+ peer->last_reset = PEER_DOWN_NEIGHBOR_DELETE;
bgp_stop (peer);
bgp_fsm_change_status (peer, Idle);
@@ -1254,6 +1297,7 @@ peer_group2peer_config_copy (struct peer_group *group, struct peer *peer,
/* maximum-prefix */
peer->pmax[afi][safi] = conf->pmax[afi][safi];
+ peer->pmax_threshold[afi][safi] = conf->pmax_threshold[afi][safi];
/* allowas-in */
peer->allowas_in[afi][safi] = conf->allowas_in[afi][safi];
@@ -1562,8 +1606,11 @@ peer_group_bind (struct bgp *bgp, union sockunion *su,
peer_group2peer_config_copy (group, peer, afi, safi);
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_RMAP_BIND;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
@@ -1597,8 +1644,11 @@ peer_group_unbind (struct bgp *bgp, struct peer *peer,
}
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_RMAP_UNBIND;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
@@ -1924,6 +1974,9 @@ struct peer_flag_action
/* Action when the flag is changed. */
enum peer_change_type type;
+
+ /* Peer down cause */
+ u_char peer_down;
};
struct peer_flag_action peer_flag_action_list[] =
@@ -2042,8 +2095,19 @@ peer_flag_modify_action (struct peer *peer, u_int32_t flag)
CAPABILITY_ACTION_UNSET : CAPABILITY_ACTION_SET);
}
else
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ if (flag == PEER_FLAG_NO_ROUTE_REFRESH_CAP)
+ peer->last_reset = PEER_DOWN_CAPABILITY_CHANGE;
+ else if (flag == PEER_FLAG_DYNAMIC_CAPABILITY)
+ peer->last_reset = PEER_DOWN_CAPABILITY_CHANGE;
+ else if (flag == PEER_FLAG_PASSIVE)
+ peer->last_reset = PEER_DOWN_PASSIVE_CHANGE;
+ else if (flag == PEER_FLAG_ENFORCE_MULTIHOP)
+ peer->last_reset = PEER_DOWN_MULTIHOP_CHANGE;
+
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
@@ -2216,7 +2280,19 @@ peer_af_flag_modify (struct peer *peer, afi_t afi, safi_t safi, u_int32_t flag,
if (! set && flag == PEER_FLAG_SOFT_RECONFIG)
bgp_clear_adj_in (peer, afi, safi);
else
- peer_change_action (peer, afi, safi, action.type);
+ {
+ if (flag == PEER_FLAG_REFLECTOR_CLIENT)
+ peer->last_reset = PEER_DOWN_RR_CLIENT_CHANGE;
+ else if (flag == PEER_FLAG_RSERVER_CLIENT)
+ peer->last_reset = PEER_DOWN_RS_CLIENT_CHANGE;
+ else if (flag == PEER_FLAG_ORF_PREFIX_SM)
+ peer->last_reset = PEER_DOWN_CAPABILITY_CHANGE;
+ else if (flag == PEER_FLAG_ORF_PREFIX_RM)
+ peer->last_reset = PEER_DOWN_CAPABILITY_CHANGE;
+
+ peer_change_action (peer, afi, safi, action.type);
+ }
+
}
/* Peer group member updates. */
@@ -2245,7 +2321,18 @@ peer_af_flag_modify (struct peer *peer, afi_t afi, safi_t safi, u_int32_t flag,
if (! set && flag == PEER_FLAG_SOFT_RECONFIG)
bgp_clear_adj_in (peer, afi, safi);
else
- peer_change_action (peer, afi, safi, action.type);
+ {
+ if (flag == PEER_FLAG_REFLECTOR_CLIENT)
+ peer->last_reset = PEER_DOWN_RR_CLIENT_CHANGE;
+ else if (flag == PEER_FLAG_RSERVER_CLIENT)
+ peer->last_reset = PEER_DOWN_RS_CLIENT_CHANGE;
+ else if (flag == PEER_FLAG_ORF_PREFIX_SM)
+ peer->last_reset = PEER_DOWN_CAPABILITY_CHANGE;
+ else if (flag == PEER_FLAG_ORF_PREFIX_RM)
+ peer->last_reset = PEER_DOWN_CAPABILITY_CHANGE;
+
+ peer_change_action (peer, afi, safi, action.type);
+ }
}
}
}
@@ -2385,8 +2472,11 @@ peer_update_source_if_set (struct peer *peer, char *ifname)
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_UPDATE_SOURCE_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
@@ -2414,8 +2504,11 @@ peer_update_source_if_set (struct peer *peer, char *ifname)
peer->update_if = XSTRDUP (MTYPE_PEER_UPDATE_SOURCE, ifname);
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_UPDATE_SOURCE_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -2448,8 +2541,11 @@ peer_update_source_addr_set (struct peer *peer, union sockunion *su)
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_UPDATE_SOURCE_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
@@ -2476,8 +2572,11 @@ peer_update_source_addr_set (struct peer *peer, union sockunion *su)
peer->update_source = sockunion_dup (su);
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_UPDATE_SOURCE_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -2524,8 +2623,11 @@ peer_update_source_unset (struct peer *peer)
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_UPDATE_SOURCE_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
@@ -2551,8 +2653,11 @@ peer_update_source_unset (struct peer *peer)
}
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_UPDATE_SOURCE_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -2995,8 +3100,11 @@ peer_local_as_set (struct peer *peer, as_t as, int no_prepend)
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_LOCAL_AS_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
@@ -3013,8 +3121,11 @@ peer_local_as_set (struct peer *peer, as_t as, int no_prepend)
UNSET_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND);
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_LOCAL_AS_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -3040,8 +3151,11 @@ peer_local_as_unset (struct peer *peer)
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_LOCAL_AS_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
@@ -3055,8 +3169,11 @@ peer_local_as_unset (struct peer *peer)
UNSET_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND);
if (peer->status == Established)
- bgp_notify_send (peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ {
+ peer->last_reset = PEER_DOWN_LOCAL_AS_CHANGE;
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_CONFIG_CHANGE);
+ }
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
@@ -3720,7 +3837,7 @@ peer_unsuppress_map_unset (struct peer *peer, afi_t afi, safi_t safi)
int
peer_maximum_prefix_set (struct peer *peer, afi_t afi, safi_t safi,
- u_int32_t max, int warning)
+ u_int32_t max, u_char threshold, int warning)
{
struct peer_group *group;
struct listnode *nn;
@@ -3730,6 +3847,7 @@ peer_maximum_prefix_set (struct peer *peer, afi_t afi, safi_t safi,
SET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX);
peer->pmax[afi][safi] = max;
+ peer->pmax_threshold[afi][safi] = threshold;
if (warning)
SET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING);
else
@@ -3746,6 +3864,7 @@ peer_maximum_prefix_set (struct peer *peer, afi_t afi, safi_t safi,
SET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX);
peer->pmax[afi][safi] = max;
+ peer->pmax_threshold[afi][safi] = threshold;
if (warning)
SET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING);
else
@@ -3779,12 +3898,14 @@ peer_maximum_prefix_unset (struct peer *peer, afi_t afi, safi_t safi)
UNSET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING);
peer->pmax[afi][safi] = peer->group->conf->pmax[afi][safi];
+ peer->pmax_threshold[afi][safi] = peer->group->conf->pmax_threshold[afi][safi];
return 0;
}
UNSET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX);
UNSET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING);
peer->pmax[afi][safi] = 0;
+ peer->pmax_threshold[afi][safi] = MAXIMUM_PREFIX_THRESHOLD_DEFAULT;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
@@ -3798,6 +3919,7 @@ peer_maximum_prefix_unset (struct peer *peer, afi_t afi, safi_t safi)
UNSET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX);
UNSET_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING);
peer->pmax[afi][safi] = 0;
+ peer->pmax_threshold[afi][safi] = MAXIMUM_PREFIX_THRESHOLD_DEFAULT;
}
return 0;
}
@@ -4266,12 +4388,17 @@ bgp_config_write_peer (struct vty *vty, struct bgp *bgp,
if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX))
if (! peer->af_group[afi][safi]
|| g_peer->pmax[afi][safi] != peer->pmax[afi][safi]
+ || g_peer->pmax_threshold[afi][safi] != peer->pmax_threshold[afi][safi]
|| CHECK_FLAG (g_peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING)
!= CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING))
- vty_out (vty, " neighbor %s maximum-prefix %ld%s%s",
- addr, peer->pmax[afi][safi],
- CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING)
- ? " warning-only" : "", VTY_NEWLINE);
+ {
+ vty_out (vty, " neighbor %s maximum-prefix %ld", addr, peer->pmax[afi][safi]);
+ if (peer->pmax_threshold[afi][safi] != MAXIMUM_PREFIX_THRESHOLD_DEFAULT)
+ vty_out (vty, " %d", peer->pmax_threshold[afi][safi]);
+ if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING))
+ vty_out (vty, " warning-only");
+ vty_out (vty, "%s", VTY_NEWLINE);
+ }
/* Route server client. */
if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)
@@ -4460,25 +4587,22 @@ bgp_config_write (struct vty *vty)
vty_out (vty, " bgp cluster-id %s%s", inet_ntoa (bgp->cluster_id),
VTY_NEWLINE);
- /* Confederation Information */
+ /* Confederation identifier*/
if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION))
+ vty_out (vty, " bgp confederation identifier %i%s", bgp->confed_id,
+ VTY_NEWLINE);
+
+ /* Confederation peer */
+ if (bgp->confed_peers_cnt > 0)
{
- vty_out (vty, " bgp confederation identifier %i%s", bgp->confed_id,
- VTY_NEWLINE);
- if (bgp->confed_peers_cnt > 0)
- {
- int i;
+ int i;
- vty_out (vty, " bgp confederation peers");
+ vty_out (vty, " bgp confederation peers");
- for (i = 0; i < bgp->confed_peers_cnt; i++)
- {
- vty_out(vty, " ");
- vty_out(vty, "%d", bgp->confed_peers[i]);
- }
+ for (i = 0; i < bgp->confed_peers_cnt; i++)
+ vty_out(vty, " %d", bgp->confed_peers[i]);
- vty_out (vty, "%s", VTY_NEWLINE);
- }
+ vty_out (vty, "%s", VTY_NEWLINE);
}
/* BGP enforce-first-as. */