address_family_ipv4_safi_cmd,
"address-family ipv4 [<unicast|multicast|vpn|labeled-unicast|flowspec>]",
"Enter Address Family command mode\n"
- "Address Family\n"
+ BGP_AF_STR
BGP_SAFI_WITH_LABEL_HELP_STR)
{
address_family_ipv6_safi_cmd,
"address-family ipv6 [<unicast|multicast|vpn|labeled-unicast|flowspec>]",
"Enter Address Family command mode\n"
- "Address Family\n"
+ BGP_AF_STR
BGP_SAFI_WITH_LABEL_HELP_STR)
{
if (argc == 3) {
address_family_vpnv4_cmd,
"address-family vpnv4 [unicast]",
"Enter Address Family command mode\n"
- "Address Family\n"
- "Address Family modifier\n")
+ BGP_AF_STR
+ BGP_AF_MODIFIER_STR)
{
vty->node = BGP_VPNV4_NODE;
return CMD_SUCCESS;
address_family_vpnv6_cmd,
"address-family vpnv6 [unicast]",
"Enter Address Family command mode\n"
- "Address Family\n"
- "Address Family modifier\n")
+ BGP_AF_STR
+ BGP_AF_MODIFIER_STR)
{
vty->node = BGP_VPNV6_NODE;
return CMD_SUCCESS;
address_family_evpn_cmd,
"address-family l2vpn evpn",
"Enter Address Family command mode\n"
- "Address Family\n"
- "Address Family modifier\n")
+ BGP_AF_STR
+ BGP_AF_MODIFIER_STR)
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
vty->node = BGP_EVPN_NODE;
BGP_STR
BGP_INSTANCE_HELP_STR
BGP_AFI_HELP_STR
- "Address Family\n"
+ BGP_AF_STR
BGP_SAFI_WITH_LABEL_HELP_STR
- "Address Family modifier\n"
+ BGP_AF_MODIFIER_STR
"Clear all peers\n"
"BGP IPv4 neighbor to clear\n"
"BGP IPv6 neighbor to clear\n"
CLEAR_STR
IP_STR
BGP_STR
- "Address Family\n"
+ BGP_AF_STR
BGP_SAFI_HELP_STR
"Clear bestpath and re-advertise\n"
"IPv6 prefix\n")
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
- "Address Family\n"
+ BGP_AF_STR
BGP_SAFI_HELP_STR
"Clear bestpath and re-advertise\n"
"IPv6 prefix\n")
static char *bgp_peer_description_stripped(char *desc, uint32_t size)
{
static char stripped[BUFSIZ];
- uint32_t len = size > strlen(desc) ? strlen(desc) : size;
+ uint32_t i = 0;
+ uint32_t last_space = 0;
- strlcpy(stripped, desc, len + 1);
+ while (i < size) {
+ if (*(desc + i) == 0) {
+ stripped[i] = '\0';
+ return stripped;
+ }
+ if (i != 0 && *(desc + i) == ' ' && last_space != i - 1)
+ last_space = i;
+ stripped[i] = *(desc + i);
+ i++;
+ }
+
+ if (last_space > size)
+ stripped[size + 1] = '\0';
+ else
+ stripped[last_space] = '\0';
return stripped;
}
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
- "Address Family\n"
- "Address Family\n"
+ BGP_AF_STR
+ BGP_AF_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"