summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_aspath.c2
-rw-r--r--bgpd/bgp_attr.c2
-rw-r--r--bgpd/bgp_bfd.c6
-rw-r--r--bgpd/bgp_damp.c24
-rw-r--r--bgpd/bgp_debug.c158
-rw-r--r--bgpd/bgp_dump.c14
-rw-r--r--bgpd/bgp_evpn_vty.c82
-rw-r--r--bgpd/bgp_filter.c28
-rw-r--r--bgpd/bgp_mplsvpn.c72
-rw-r--r--bgpd/bgp_mplsvpn.h6
-rw-r--r--bgpd/bgp_nexthop.c27
-rw-r--r--bgpd/bgp_open.c2
-rw-r--r--bgpd/bgp_route.c351
-rw-r--r--bgpd/bgp_route.h8
-rw-r--r--bgpd/bgp_routemap.c22
-rw-r--r--bgpd/bgp_updgrp.c72
-rw-r--r--bgpd/bgp_updgrp_adv.c15
-rw-r--r--bgpd/bgp_updgrp_packet.c4
-rw-r--r--bgpd/bgp_vpn.c17
-rw-r--r--bgpd/bgp_vty.c996
-rw-r--r--bgpd/bgpd.c316
-rw-r--r--bgpd/rfapi/bgp_rfapi_cfg.c408
-rw-r--r--bgpd/rfapi/rfapi.c77
-rw-r--r--bgpd/rfapi/rfapi_rib.c37
-rw-r--r--bgpd/rfapi/rfapi_vty.c179
-rw-r--r--bgpd/rfapi/vnc_debug.c18
-rw-r--r--bgpd/rfp-example/librfp/rfp_example.c2
27 files changed, 1423 insertions, 1522 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index f304b3a1b..95257493b 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -2176,7 +2176,7 @@ aspath_show_all_iterator (struct hash_backet *backet, struct vty *vty)
as = (struct aspath *) backet->data;
vty_out (vty, "[%p:%u] (%ld) ", (void *)backet, backet->key, as->refcnt);
- vty_outln (vty, "%s", as->str);
+ vty_out (vty, "%s\n", as->str);
}
/* Print all aspath and hash information. This function is used from
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 439469d61..0114834c5 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -797,7 +797,7 @@ attr_show_all_iterator (struct hash_backet *backet, struct vty *vty)
{
struct attr *attr = backet->data;
- vty_outln (vty, "attr[%ld] nexthop %s", attr->refcnt,
+ vty_out (vty, "attr[%ld] nexthop %s\n", attr->refcnt,
inet_ntoa(attr->nexthop));
}
diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c
index 1aa2b93a9..bb0a0fc63 100644
--- a/bgpd/bgp_bfd.c
+++ b/bgpd/bgp_bfd.c
@@ -526,17 +526,17 @@ bgp_bfd_peer_config_write(struct vty *vty, struct peer *peer, char *addr)
bfd_info = (struct bfd_info *)peer->bfd_info;
if (CHECK_FLAG (bfd_info->flags, BFD_FLAG_PARAM_CFG))
- vty_outln (vty, " neighbor %s bfd %d %d %d", addr,
+ vty_out (vty, " neighbor %s bfd %d %d %d\n", addr,
bfd_info->detect_mult, bfd_info->required_min_rx,
bfd_info->desired_min_tx);
if (bfd_info->type != BFD_TYPE_NOT_CONFIGURED)
- vty_outln (vty, " neighbor %s bfd %s", addr,
+ vty_out (vty, " neighbor %s bfd %s\n", addr,
(bfd_info->type == BFD_TYPE_MULTIHOP) ? "multihop" : "singlehop");
if (!CHECK_FLAG (bfd_info->flags, BFD_FLAG_PARAM_CFG) &&
(bfd_info->type == BFD_TYPE_NOT_CONFIGURED))
- vty_outln (vty, " neighbor %s bfd", addr);
+ vty_out (vty, " neighbor %s bfd\n", addr);
}
/*
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index d5a89c1ff..d276de6eb 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -525,15 +525,15 @@ bgp_config_write_damp (struct vty *vty)
&& bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
&& bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
&& bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4)
- vty_outln (vty, " bgp dampening");
+ vty_out (vty, " bgp dampening\n");
else if (bgp_damp_cfg.half_life != DEFAULT_HALF_LIFE*60
&& bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
&& bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
&& bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4)
- vty_outln (vty, " bgp dampening %lld",
+ vty_out (vty, " bgp dampening %lld\n",
bgp_damp_cfg.half_life / 60LL);
else
- vty_outln (vty, " bgp dampening %lld %d %d %lld",
+ vty_out (vty, " bgp dampening %lld %d %d %lld\n",
bgp_damp_cfg.half_life/60LL,
bgp_damp_cfg.reuse_limit,
bgp_damp_cfg.suppress_value,
@@ -652,7 +652,7 @@ bgp_damp_info_vty (struct vty *vty, struct bgp_info *binfo,
vty_out (vty, ", reuse in %s",
bgp_get_reuse_time (penalty, timebuf, BGP_UPTIME_LEN, 0, json_path));
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
}
@@ -691,26 +691,26 @@ bgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi)
if (bgp == NULL)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING;
}
if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
{
- vty_outln (vty, "Half-life time: %lld min",
+ vty_out (vty, "Half-life time: %lld min\n",
(long long)damp->half_life / 60);
- vty_outln (vty, "Reuse penalty: %d",
+ vty_out (vty, "Reuse penalty: %d\n",
damp->reuse_limit);
- vty_outln (vty, "Suppress penalty: %d",
+ vty_out (vty, "Suppress penalty: %d\n",
damp->suppress_value);
- vty_outln (vty, "Max suppress time: %lld min",
+ vty_out (vty, "Max suppress time: %lld min\n",
(long long)damp->max_suppress_time / 60);
- vty_outln (vty, "Max supress penalty: %u",
+ vty_out (vty, "Max supress penalty: %u\n",
damp->ceiling);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
else
- vty_outln (vty, "dampening not enabled for %s",
+ vty_out (vty, "dampening not enabled for %s\n",
afi == AFI_IP ? "IPv4" : "IPv6");
return CMD_SUCCESS;
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 78a337bd8..e45b5ab4e 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -254,7 +254,7 @@ bgp_debug_list_print (struct vty *vty, const char *desc, struct list *list)
}
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* Print the command to enable the debug for each peer/prefix this debug is
@@ -274,14 +274,14 @@ bgp_debug_list_conf_print (struct vty *vty, const char *desc, struct list *list)
{
if (filter->host)
{
- vty_outln (vty, "%s %s", desc, filter->host);
+ vty_out (vty, "%s %s\n", desc, filter->host);
write++;
}
if (filter->p)
{
- vty_outln (vty, "%s %s/%d", desc,
+ vty_out (vty, "%s %s/%d\n", desc,
inet_ntop (filter->p->family, &filter->p->u.prefix, buf, INET6_ADDRSTRLEN),
filter->p->prefixlen);
write++;
@@ -291,7 +291,7 @@ bgp_debug_list_conf_print (struct vty *vty, const char *desc, struct list *list)
if (!write)
{
- vty_outln (vty, "%s", desc);
+ vty_out (vty, "%s\n", desc);
write++;
}
@@ -583,7 +583,7 @@ DEFUN (debug_bgp_as4,
else
{
TERM_DEBUG_ON (as4, AS4);
- vty_outln (vty, "BGP as4 debugging is on");
+ vty_out (vty, "BGP as4 debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -601,7 +601,7 @@ DEFUN (no_debug_bgp_as4,
else
{
TERM_DEBUG_OFF (as4, AS4);
- vty_outln (vty, "BGP as4 debugging is off");
+ vty_out (vty, "BGP as4 debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -619,7 +619,7 @@ DEFUN (debug_bgp_as4_segment,
else
{
TERM_DEBUG_ON (as4, AS4_SEGMENT);
- vty_outln (vty, "BGP as4 segment debugging is on");
+ vty_out (vty, "BGP as4 segment debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -638,7 +638,7 @@ DEFUN (no_debug_bgp_as4_segment,
else
{
TERM_DEBUG_OFF (as4, AS4_SEGMENT);
- vty_outln (vty, "BGP as4 segment debugging is off");
+ vty_out (vty, "BGP as4 segment debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -658,7 +658,7 @@ DEFUN (debug_bgp_neighbor_events,
else
{
TERM_DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS);
- vty_outln (vty, "BGP neighbor-events debugging is on");
+ vty_out (vty, "BGP neighbor-events debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -681,7 +681,7 @@ DEFUN (debug_bgp_neighbor_events_peer,
if (bgp_debug_list_has_entry(bgp_debug_neighbor_events_peers, host, NULL))
{
- vty_outln (vty, "BGP neighbor-events debugging is already enabled for %s",
+ vty_out (vty, "BGP neighbor-events debugging is already enabled for %s\n",
host);
return CMD_SUCCESS;
}
@@ -693,7 +693,7 @@ DEFUN (debug_bgp_neighbor_events_peer,
else
{
TERM_DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS);
- vty_outln (vty, "BGP neighbor-events debugging is on for %s", host);
+ vty_out (vty, "BGP neighbor-events debugging is on for %s\n", host);
}
return CMD_SUCCESS;
}
@@ -713,7 +713,7 @@ DEFUN (no_debug_bgp_neighbor_events,
else
{
TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS);
- vty_outln (vty, "BGP neighbor-events debugging is off");
+ vty_out (vty, "BGP neighbor-events debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -747,9 +747,9 @@ DEFUN (no_debug_bgp_neighbor_events_peer,
}
if (found_peer)
- vty_outln (vty, "BGP neighbor-events debugging is off for %s", host);
+ vty_out (vty, "BGP neighbor-events debugging is off for %s\n", host);
else
- vty_outln (vty, "BGP neighbor-events debugging was not enabled for %s",
+ vty_out (vty, "BGP neighbor-events debugging was not enabled for %s\n",
host);
return CMD_SUCCESS;
@@ -768,7 +768,7 @@ DEFUN (debug_bgp_nht,
else
{
TERM_DEBUG_ON (nht, NHT);
- vty_outln (vty, "BGP nexthop tracking debugging is on");
+ vty_out (vty, "BGP nexthop tracking debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -786,7 +786,7 @@ DEFUN (no_debug_bgp_nht,
else
{
TERM_DEBUG_OFF (nht, NHT);
- vty_outln (vty, "BGP nexthop tracking debugging is off");
+ vty_out (vty, "BGP nexthop tracking debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -806,7 +806,7 @@ DEFUN (debug_bgp_keepalive,
else
{
TERM_DEBUG_ON (keepalive, KEEPALIVE);
- vty_outln (vty, "BGP keepalives debugging is on");
+ vty_out (vty, "BGP keepalives debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -829,7 +829,7 @@ DEFUN (debug_bgp_keepalive_peer,
if (bgp_debug_list_has_entry(bgp_debug_keepalive_peers, host, NULL))
{
- vty_outln (vty, "BGP keepalive debugging is already enabled for %s",
+ vty_out (vty, "BGP keepalive debugging is already enabled for %s\n",
host);
return CMD_SUCCESS;
}
@@ -841,7 +841,7 @@ DEFUN (debug_bgp_keepalive_peer,
else
{
TERM_DEBUG_ON (keepalive, KEEPALIVE);
- vty_outln (vty, "BGP keepalives debugging is on for %s", host);
+ vty_out (vty, "BGP keepalives debugging is on for %s\n", host);
}
return CMD_SUCCESS;
}
@@ -861,7 +861,7 @@ DEFUN (no_debug_bgp_keepalive,
else
{
TERM_DEBUG_OFF (keepalive, KEEPALIVE);
- vty_outln (vty, "BGP keepalives debugging is off");
+ vty_out (vty, "BGP keepalives debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -895,9 +895,9 @@ DEFUN (no_debug_bgp_keepalive_peer,
}
if (found_peer)
- vty_outln (vty, "BGP keepalives debugging is off for %s", host);
+ vty_out (vty, "BGP keepalives debugging is off for %s\n", host);
else
- vty_outln (vty, "BGP keepalives debugging was not enabled for %s", host);
+ vty_out (vty, "BGP keepalives debugging was not enabled for %s\n", host);
return CMD_SUCCESS;
}
@@ -922,7 +922,7 @@ DEFPY (debug_bgp_bestpath_prefix,
if (bgp_debug_list_has_entry(bgp_debug_bestpath_prefixes, NULL, bestpath))
{
- vty_outln (vty, "BGP bestpath debugging is already enabled for %s", bestpath_str);
+ vty_out (vty, "BGP bestpath debugging is already enabled for %s\n", bestpath_str);
return CMD_SUCCESS;
}
@@ -935,7 +935,7 @@ DEFPY (debug_bgp_bestpath_prefix,
else
{
TERM_DEBUG_ON (bestpath, BESTPATH);
- vty_outln (vty, "BGP bestpath debugging is on for %s", bestpath_str);
+ vty_out (vty, "BGP bestpath debugging is on for %s\n", bestpath_str);
}
return CMD_SUCCESS;
@@ -962,7 +962,7 @@ DEFUN (no_debug_bgp_bestpath_prefix,
if (!ret)
{
prefix_free(argv_p);
- vty_outln (vty, "%% Malformed Prefix");
+ vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -979,16 +979,16 @@ DEFUN (no_debug_bgp_bestpath_prefix,
else
{
TERM_DEBUG_OFF (bestpath, BESTPATH);
- vty_outln (vty, "BGP bestpath debugging (per prefix) is off");
+ vty_out (vty, "BGP bestpath debugging (per prefix) is off\n");
}
}
}
if (found_prefix)
- vty_outln (vty, "BGP bestpath debugging is off for %s",
+ vty_out (vty, "BGP bestpath debugging is off for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
else
- vty_outln (vty, "BGP bestpath debugging was not enabled for %s",
+ vty_out (vty, "BGP bestpath debugging was not enabled for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS;
@@ -1009,7 +1009,7 @@ DEFUN (no_debug_bgp_bestpath,
else
{
TERM_DEBUG_OFF (bestpath, BESTPATH);
- vty_outln (vty, "BGP bestpath debugging is off");
+ vty_out (vty, "BGP bestpath debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -1035,7 +1035,7 @@ DEFUN (debug_bgp_update,
{
TERM_DEBUG_ON (update, UPDATE_IN);
TERM_DEBUG_ON (update, UPDATE_OUT);
- vty_outln (vty, "BGP updates debugging is on");
+ vty_out (vty, "BGP updates debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -1068,12 +1068,12 @@ DEFUN (debug_bgp_update_direct,
if (strncmp ("i", argv[idx_in_out]->arg, 1) == 0)
{
TERM_DEBUG_ON (update, UPDATE_IN);
- vty_outln (vty, "BGP updates debugging is on (inbound)");
+ vty_out (vty, "BGP updates debugging is on (inbound)\n");
}
else
{
TERM_DEBUG_ON (update, UPDATE_OUT);
- vty_outln (vty, "BGP updates debugging is on (outbound)");
+ vty_out (vty, "BGP updates debugging is on (outbound)\n");
}
}
return CMD_SUCCESS;
@@ -1111,7 +1111,7 @@ DEFUN (debug_bgp_update_direct_peer,
{
if (bgp_debug_list_has_entry(bgp_debug_update_in_peers, host, NULL))
{
- vty_outln (vty, "BGP inbound update debugging is already enabled for %s",
+ vty_out (vty, "BGP inbound update debugging is already enabled for %s\n",
host);
return CMD_SUCCESS;
}
@@ -1121,7 +1121,7 @@ DEFUN (debug_bgp_update_direct_peer,
{
if (bgp_debug_list_has_entry(bgp_debug_update_out_peers, host, NULL))
{
- vty_outln (vty, "BGP outbound update debugging is already enabled for %s",
+ vty_out (vty, "BGP outbound update debugging is already enabled for %s\n",
host);
return CMD_SUCCESS;
}
@@ -1166,13 +1166,13 @@ DEFUN (debug_bgp_update_direct_peer,
if (inbound)
{
TERM_DEBUG_ON (update, UPDATE_IN);
- vty_outln (vty, "BGP updates debugging is on (inbound) for %s",
+ vty_out (vty, "BGP updates debugging is on (inbound) for %s\n",
argv[idx_peer]->arg);
}
else
{
TERM_DEBUG_ON (update, UPDATE_OUT);
- vty_outln (vty, "BGP updates debugging is on (outbound) for %s",
+ vty_out (vty, "BGP updates debugging is on (outbound) for %s\n",
argv[idx_peer]->arg);
}
}
@@ -1201,7 +1201,7 @@ DEFUN (no_debug_bgp_update_direct,
else
{
TERM_DEBUG_OFF (update, UPDATE_IN);
- vty_outln (vty, "BGP updates debugging is off (inbound)");
+ vty_out (vty, "BGP updates debugging is off (inbound)\n");
}
}
else
@@ -1215,7 +1215,7 @@ DEFUN (no_debug_bgp_update_direct,
else
{
TERM_DEBUG_OFF (update, UPDATE_OUT);
- vty_outln (vty, "BGP updates debugging is off (outbound)");
+ vty_out (vty, "BGP updates debugging is off (outbound)\n");
}
}
@@ -1258,7 +1258,7 @@ DEFUN (no_debug_bgp_update_direct_peer,
else
{
TERM_DEBUG_OFF (update, UPDATE_IN);
- vty_outln (vty, "BGP updates debugging (inbound) is off");
+ vty_out (vty, "BGP updates debugging (inbound) is off\n");
}
}
}
@@ -1275,7 +1275,7 @@ DEFUN (no_debug_bgp_update_direct_peer,
else
{
TERM_DEBUG_OFF (update, UPDATE_OUT);
- vty_outln (vty, "BGP updates debugging (outbound) is off");
+ vty_out (vty, "BGP updates debugging (outbound) is off\n");
}
}
@@ -1302,16 +1302,16 @@ DEFUN (no_debug_bgp_update_direct_peer,
if (found_peer)
if (inbound)
- vty_outln (vty, "BGP updates debugging (inbound) is off for %s", host);
+ vty_out (vty, "BGP updates debugging (inbound) is off for %s\n", host);
else
- vty_outln (vty, "BGP updates debugging (outbound) is off for %s",
+ vty_out (vty, "BGP updates debugging (outbound) is off for %s\n",
host);
else
if (inbound)
- vty_outln (vty, "BGP updates debugging (inbound) was not enabled for %s",
+ vty_out (vty, "BGP updates debugging (inbound) was not enabled for %s\n",
host);
else
- vty_outln (vty, "BGP updates debugging (outbound) was not enabled for %s",
+ vty_out (vty, "BGP updates debugging (outbound) was not enabled for %s\n",
host);
return CMD_SUCCESS;
@@ -1337,7 +1337,7 @@ DEFUN (debug_bgp_update_prefix,
if (!ret)
{
prefix_free(argv_p);
- vty_outln (vty, "%% Malformed Prefix");
+ vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1347,7 +1347,7 @@ DEFUN (debug_bgp_update_prefix,
if (bgp_debug_list_has_entry(bgp_debug_update_prefixes, NULL, argv_p))
{
- vty_outln (vty, "BGP updates debugging is already enabled for %s",
+ vty_out (vty, "BGP updates debugging is already enabled for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS;
}
@@ -1361,7 +1361,7 @@ DEFUN (debug_bgp_update_prefix,
else
{
TERM_DEBUG_ON (update, UPDATE_PREFIX);
- vty_outln (vty, "BGP updates debugging is on for %s",
+ vty_out (vty, "BGP updates debugging is on for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
}
@@ -1390,7 +1390,7 @@ DEFUN (no_debug_bgp_update_prefix,
if (!ret)
{
prefix_free(argv_p);
- vty_outln (vty, "%% Malformed Prefix");
+ vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1407,16 +1407,16 @@ DEFUN (no_debug_bgp_update_prefix,
else
{
TERM_DEBUG_OFF (update, UPDATE_PREFIX);
- vty_outln (vty, "BGP updates debugging (per prefix) is off");
+ vty_out (vty, "BGP updates debugging (per prefix) is off\n");
}
}
}
if (found_prefix)
- vty_outln (vty, "BGP updates debugging is off for %s",
+ vty_out (vty, "BGP updates debugging is off for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
else
- vty_outln (vty, "BGP updates debugging was not enabled for %s",
+ vty_out (vty, "BGP updates debugging was not enabled for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS;
@@ -1448,7 +1448,7 @@ DEFUN (no_debug_bgp_update,
TERM_DEBUG_OFF (update, UPDATE_IN);
TERM_DEBUG_OFF (update, UPDATE_OUT);
TERM_DEBUG_OFF (update, UPDATE_PREFIX);
- vty_outln (vty, "BGP updates debugging is off");
+ vty_out (vty, "BGP updates debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -1466,7 +1466,7 @@ DEFUN (debug_bgp_zebra,
else
{
TERM_DEBUG_ON (zebra, ZEBRA);
- vty_outln (vty, "BGP zebra debugging is on");
+ vty_out (vty, "BGP zebra debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -1491,7 +1491,7 @@ DEFUN (debug_bgp_zebra_prefix,
if (!ret)
{
prefix_free(argv_p);
- vty_outln (vty, "%% Malformed Prefix");
+ vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1500,7 +1500,7 @@ DEFUN (debug_bgp_zebra_prefix,
if (bgp_debug_list_has_entry(bgp_debug_zebra_prefixes, NULL, argv_p))
{
- vty_outln (vty, "BGP zebra debugging is already enabled for %s",
+ vty_out (vty, "BGP zebra debugging is already enabled for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS;
}
@@ -1512,7 +1512,7 @@ DEFUN (debug_bgp_zebra_prefix,
else
{
TERM_DEBUG_ON (zebra, ZEBRA);
- vty_outln (vty, "BGP zebra debugging is on for %s",
+ vty_out (vty, "BGP zebra debugging is on for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
}
@@ -1534,7 +1534,7 @@ DEFUN (no_debug_bgp_zebra,
else
{
TERM_DEBUG_OFF (zebra, ZEBRA);
- vty_outln (vty, "BGP zebra debugging is off");
+ vty_out (vty, "BGP zebra debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -1561,7 +1561,7 @@ DEFUN (no_debug_bgp_zebra_prefix,
if (!ret)
{
prefix_free(argv_p);
- vty_outln (vty, "%% Malformed Prefix");
+ vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1576,16 +1576,16 @@ DEFUN (no_debug_bgp_zebra_prefix,
else
{
TERM_DEBUG_OFF (zebra, ZEBRA);
- vty_outln (vty, "BGP zebra debugging is off");
+ vty_out (vty, "BGP zebra debugging is off\n");
}
}
}
if (found_prefix)
- vty_outln (vty, "BGP zebra debugging is off for %s",
+ vty_out (vty, "BGP zebra debugging is off for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
else
- vty_outln (vty, "BGP zebra debugging was not enabled for %s",
+ vty_out (vty, "BGP zebra debugging was not enabled for %s\n",
argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS;
@@ -1603,7 +1603,7 @@ DEFUN (debug_bgp_allow_martians,
else
{
TERM_DEBUG_ON (allow_martians, ALLOW_MARTIANS);
- vty_outln (vty, "BGP allow_martian next hop debugging is on");
+ vty_out (vty, "BGP allow_martian next hop debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -1621,7 +1621,7 @@ DEFUN (no_debug_bgp_allow_martians,
else
{
TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
- vty_outln (vty, "BGP allow martian next hop debugging is off");
+ vty_out (vty, "BGP allow martian next hop debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -1640,7 +1640,7 @@ DEFUN (debug_bgp_update_groups,
else
{
TERM_DEBUG_ON (update_groups, UPDATE_GROUPS);
- vty_outln (vty, "BGP update-groups debugging is on");
+ vty_out (vty, "BGP update-groups debugging is on\n");
}
return CMD_SUCCESS;
}
@@ -1658,7 +1658,7 @@ DEFUN (no_debug_bgp_update_groups,
else
{
TERM_DEBUG_OFF (update_groups, UPDATE_GROUPS);
- vty_outln (vty, "BGP update-groups debugging is off");
+ vty_out (vty, "BGP update-groups debugging is off\n");
}
return CMD_SUCCESS;
}
@@ -1691,7 +1691,7 @@ DEFUN (no_debug_bgp,
TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS);
TERM_DEBUG_OFF (zebra, ZEBRA);
TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
- vty_outln (vty, "All possible debugging has been turned off");
+ vty_out (vty, "All possible debugging has been turned off\n");
return CMD_SUCCESS;
}
@@ -1703,13 +1703,13 @@ DEFUN (show_debugging_bgp,
DEBUG_STR
BGP_STR)
{
- vty_outln (vty, "BGP debugging status:");
+ vty_out (vty, "BGP debugging status:\n");
if (BGP_DEBUG (as4, AS4))
- vty_outln (vty, " BGP as4 debugging is on");
+ vty_out (vty, " BGP as4 debugging is on\n");
if (BGP_DEBUG (as4, AS4_SEGMENT))
- vty_outln (vty, " BGP as4 aspath segment debugging is on");
+ vty_out (vty, " BGP as4 aspath segment debugging is on\n");
if (BGP_DEBUG (bestpath, BESTPATH))
bgp_debug_list_print (vty, " BGP bestpath debugging is on",
@@ -1724,10 +1724,10 @@ DEFUN (show_debugging_bgp,
bgp_debug_neighbor_events_peers);
if (BGP_DEBUG (nht, NHT))
- vty_outln (vty, " BGP next-hop tracking debugging is on");
+ vty_out (vty, " BGP next-hop tracking debugging is on\n");
if (BGP_DEBUG (update_groups, UPDATE_GROUPS))
- vty_outln (vty, " BGP update-groups debugging is on");
+ vty_out (vty, " BGP update-groups debugging is on\n");
if (BGP_DEBUG (update, UPDATE_PREFIX))
bgp_debug_list_print (vty, " BGP updates debugging is on",
@@ -1746,8 +1746,8 @@ DEFUN (show_debugging_bgp,
bgp_debug_zebra_prefixes);
if (BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
- vty_outln (vty, " BGP allow martian next hop debugging is on");
- vty_out (vty, VTYNL);
+ vty_out (vty, " BGP allow martian next hop debugging is on\n");
+ vty_out (vty, "\n");
return CMD_SUCCESS;
}
@@ -1802,13 +1802,13 @@ bgp_config_write_debug (struct vty *vty)
if (CONF_BGP_DEBUG (as4, AS4))
{
- vty_outln (vty, "debug bgp as4");
+ vty_out (vty, "debug bgp as4\n");
write++;
}
if (CONF_BGP_DEBUG (as4, AS4_SEGMENT))
{
- vty_outln (vty, "debug bgp as4 segment");
+ vty_out (vty, "debug bgp as4 segment\n");
write++;
}
@@ -1832,13 +1832,13 @@ bgp_config_write_debug (struct vty *vty)
if (CONF_BGP_DEBUG (nht, NHT))
{
- vty_outln (vty, "debug bgp nht");
+ vty_out (vty, "debug bgp nht\n");
write++;
}
if (CONF_BGP_DEBUG (update_groups, UPDATE_GROUPS))
{
- vty_outln (vty, "debug bgp update-groups");
+ vty_out (vty, "debug bgp update-groups\n");
write++;
}
@@ -1864,7 +1864,7 @@ bgp_config_write_debug (struct vty *vty)
{
if (!bgp_debug_zebra_prefixes || list_isempty(bgp_debug_zebra_prefixes))
{
- vty_outln (vty, "debug bgp zebra");
+ vty_out (vty, "debug bgp zebra\n");
write++;
}
else
@@ -1876,7 +1876,7 @@ bgp_config_write_debug (struct vty *vty)
if (CONF_BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
{
- vty_outln (vty, "debug bgp allow-martians");
+ vty_out (vty, "debug bgp allow-martians\n");
write++;
}
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index d63d8209c..5b6b8e137 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -667,7 +667,7 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump,
interval = bgp_dump_parse_time (interval_str);
if (interval == 0)
{
- vty_outln (vty, "Malformed interval string");
+ vty_out (vty, "Malformed interval string\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -866,10 +866,10 @@ config_write_bgp_dump (struct vty *vty)
type_str = "all-et";
if (bgp_dump_all.interval_str)
- vty_outln (vty, "dump bgp %s %s %s", type_str,
+ vty_out (vty, "dump bgp %s %s %s\n", type_str,
bgp_dump_all.filename,bgp_dump_all.interval_str);
else
- vty_outln (vty, "dump bgp %s %s", type_str,
+ vty_out (vty, "dump bgp %s %s\n", type_str,
bgp_dump_all.filename);
}
if (bgp_dump_updates.filename)
@@ -879,19 +879,19 @@ config_write_bgp_dump (struct vty *vty)
type_str = "updates-et";
if (bgp_dump_updates.interval_str)
- vty_outln (vty, "dump bgp %s %s %s", type_str,
+ vty_out (vty, "dump bgp %s %s %s\n", type_str,
bgp_dump_updates.filename,bgp_dump_updates.interval_str);
else
- vty_outln (vty, "dump bgp %s %s", type_str,
+ vty_out (vty, "dump bgp %s %s\n", type_str,
bgp_dump_updates.filename);
}
if (bgp_dump_routes.filename)
{
if (bgp_dump_routes.interval_str)
- vty_outln (vty, "dump bgp routes-mrt %s %s",
+ vty_out (vty, "dump bgp routes-mrt %s %s\n",
bgp_dump_routes.filename,bgp_dump_routes.interval_str);
else
- vty_outln (vty, "dump bgp routes-mrt %s",
+ vty_out (vty, "dump bgp routes-mrt %s\n",
bgp_dump_routes.filename);
}
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index d22a07ed3..a76e499f8 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -61,7 +61,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
bgp = bgp_get_default();
if (bgp == NULL) {
if (!use_json)
- vty_outln (vty,"No BGP process is configured");
+ vty_out (vty,"No BGP process is configured\n");
return CMD_WARNING;
}
@@ -135,20 +135,19 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
} else {
if (option ==
SHOW_DISPLAY_TAGS)
- vty_outln(vty, V4_HEADER_TAG);
+ vty_out(vty, V4_HEADER_TAG);
else if (option ==
SHOW_DISPLAY_OVERLAY)
- vty_outln(vty, V4_HEADER_OVERLAY);
+ vty_out(vty, V4_HEADER_OVERLAY);
else {
- vty_outln (vty,
- "BGP table version is 0, local router ID is %s",
+ vty_out (vty,
+ "BGP table version is 0, local router ID is %s\n",
inet_ntoa(bgp->router_id));
- vty_outln (vty,
- "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal");
- vty_outln (vty,
- "Origin codes: i - IGP, e - EGP, ? - incomplete%s",
- VTYNL);
- vty_outln(vty, V4_HEADER);
+ vty_out (vty,
+ "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n");
+ vty_out (vty,
+ "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n");
+ vty_out(vty, V4_HEADER);
}
}
header = 0;
@@ -224,7 +223,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
ip),
rd_ip.
val);
- vty_outln (vty, VTYNL);
+ vty_out (vty, "\n\n");
}
rd_header = 0;
}
@@ -253,11 +252,10 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
}
}
if (output_count == 0)
- vty_outln (vty, "No prefixes displayed, %ld exist",
+ vty_out (vty, "No prefixes displayed, %ld exist\n",
total_count);
else
- vty_outln (vty, "%sDisplayed %ld out of %ld total prefixes",
- VTYNL, output_count, total_count);
+ vty_out (vty, "\nDisplayed %ld out of %ld total prefixes\n", output_count, total_count);
return CMD_SUCCESS;
}
@@ -289,7 +287,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd,
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, 0,
@@ -330,7 +328,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_tags,
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, 1,
@@ -365,11 +363,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"Malformed address");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty, "Malformed address: %s",
+ vty_out (vty, "Malformed address: %s\n",
argv[idx_ipv4]->arg);
return CMD_WARNING;
}
@@ -381,12 +379,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"No such neighbor or address family");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty,
- "%% No such neighbor or address family");
+ vty_out (vty,
+ "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -426,11 +424,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"Malformed Route Distinguisher");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty,"%% Malformed Route Distinguisher");
+ vty_out (vty,"%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
@@ -441,11 +439,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"Malformed address");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty, "Malformed address: %s",
+ vty_out (vty, "Malformed address: %s\n",
argv[idx_ext_community]->arg);
return CMD_WARNING;
}
@@ -457,12 +455,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"No such neighbor or address family");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty,
- "%% No such neighbor or address family");
+ vty_out (vty,
+ "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -498,11 +496,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_advertised_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"Malformed address");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty, "Malformed address: %s",
+ vty_out (vty, "Malformed address: %s\n",
argv[idx_ipv4]->arg);
return CMD_WARNING;
}
@@ -513,12 +511,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_advertised_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"No such neighbor or address family");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty,
- "%% No such neighbor or address family");
+ vty_out (vty,
+ "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -557,11 +555,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"Malformed address");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty, "Malformed address: %s",
+ vty_out (vty, "Malformed address: %s\n",
argv[idx_ext_community]->arg);
return CMD_WARNING;
}
@@ -572,12 +570,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"No such neighbor or address family");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty,
- "%% No such neighbor or address family");
+ vty_out (vty,
+ "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -588,11 +586,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes,
json_no = json_object_new_object();
json_object_string_add(json_no, "warning",
"Malformed Route Distinguisher");
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string(json_no));
json_object_free(json_no);
} else
- vty_outln (vty,"%% Malformed Route Distinguisher");
+ vty_out (vty,"%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
@@ -635,7 +633,7 @@ DEFUN(show_ip_bgp_evpn_rd_overlay,
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL,
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index 5fa0372fe..a61321b0e 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -457,7 +457,7 @@ DEFUN (ip_as_path,
regex = bgp_regcomp (regstr);
if (!regex)
{
- vty_outln (vty, "can't compile regexp %s", regstr);
+ vty_out (vty, "can't compile regexp %s\n", regstr);
XFREE (MTYPE_TMP, regstr);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -503,7 +503,7 @@ DEFUN (no_ip_as_path,
aslist = as_list_lookup (aslistname);
if (aslist == NULL)
{
- vty_outln (vty, "ip as-path access-list %s doesn't exist",aslistname);
+ vty_out (vty, "ip as-path access-list %s doesn't exist\n",aslistname);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -514,7 +514,7 @@ DEFUN (no_ip_as_path,
type = AS_FILTER_DENY;
else
{
- vty_outln (vty, "filter type must be [permit|deny]");
+ vty_out (vty, "filter type must be [permit|deny]\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -525,7 +525,7 @@ DEFUN (no_ip_as_path,
regex = bgp_regcomp (regstr);
if (!regex)
{
- vty_outln (vty, "can't compile regexp %s", regstr);
+ vty_out (vty, "can't compile regexp %s\n", regstr);
XFREE (MTYPE_TMP, regstr);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -538,7 +538,7 @@ DEFUN (no_ip_as_path,
if (asfilter == NULL)
{
- vty_outln (vty, "ip as-path access-list doesn't exist");
+ vty_out (vty, "\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -562,7 +562,7 @@ DEFUN (no_ip_as_path_all,
aslist = as_list_lookup (argv[idx_word]->arg);
if (aslist == NULL)
{
- vty_outln (vty, "ip as-path access-list %s doesn't exist",
+ vty_out (vty, "ip as-path access-list %s doesn't exist\n",
argv[idx_word]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -581,11 +581,11 @@ as_list_show (struct vty *vty, struct as_list *aslist)
{
struct as_filter *asfilter;
- vty_outln (vty, "AS path access list %s", aslist->name);
+ vty_out (vty, "AS path access list %s\n", aslist->name);
for (asfilter = aslist->head; asfilter; asfilter = asfilter->next)
{
- vty_outln (vty, " %s %s", filter_type_str (asfilter->type),
+ vty_out (vty, " %s %s\n", filter_type_str (asfilter->type),
asfilter->reg_str);
}
}
@@ -598,22 +598,22 @@ as_list_show_all (struct vty *vty)
for (aslist = as_list_master.num.head; aslist; aslist = aslist->next)
{
- vty_outln (vty, "AS path access list %s", aslist->name);
+ vty_out (vty, "AS path access list %s\n", aslist->name);
for (asfilter = aslist->head; asfilter; asfilter = asfilter->next)
{
- vty_outln (vty, " %s %s", filter_type_str (asfilter->type),
+ vty_out (vty, " %s %s\n", filter_type_str (asfilter->type),
asfilter->reg_str);
}
}
for (aslist = as_list_master.str.head; aslist; aslist = aslist->next)
{
- vty_outln (vty, "AS path access list %s", aslist->name);
+ vty_out (vty, "AS path access list %s\n", aslist->name);
for (asfilter = aslist->head; asfilter; asfilter = asfilter->next)
{
- vty_outln (vty, " %s %s", filter_type_str (asfilter->type),
+ vty_out (vty, " %s %s\n", filter_type_str (asfilter->type),
asfilter->reg_str);
}
}
@@ -658,7 +658,7 @@ config_write_as_list (struct vty *vty)
for (aslist = as_list_master.num.head; aslist; aslist = aslist->next)
for (asfilter = aslist->head; asfilter; asfilter = asfilter->next)
{
- vty_outln (vty, "ip as-path access-list %s %s %s",
+ vty_out (vty, "ip as-path access-list %s %s %s\n",
aslist->name, filter_type_str (asfilter->type),
asfilter->reg_str);
write++;
@@ -667,7 +667,7 @@ config_write_as_list (struct vty *vty)
for (aslist = as_list_master.str.head; aslist; aslist = aslist->next)
for (asfilter = aslist->head; asfilter; asfilter = asfilter->next)
{
- vty_outln (vty, "ip as-path access-list %s %s %s",
+ vty_out (vty, "ip as-path access-list %s %s %s\n",
aslist->name, filter_type_str (asfilter->type),
asfilter->reg_str);
write++;
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index b5fbfd8bb..c1db9fed2 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -563,7 +563,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
if (bgp == NULL)
{
if (!use_json)
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING;
}
@@ -589,7 +589,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
if ((afi != AFI_IP) && (afi != AFI_IP6))
{
- vty_outln (vty, "Afi %d not supported", afi);
+ vty_out (vty, "Afi %d not supported\n", afi);
return CMD_WARNING;
}
@@ -634,16 +634,15 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
else
{
if (tags)
- vty_outln (vty, V4_HEADER_TAG);
+ vty_out (vty, V4_HEADER_TAG);
else
{
- vty_outln (vty, "BGP table version is 0, local router ID is %s",
+ vty_out (vty, "BGP table version is 0, local router ID is %s\n",
inet_ntoa(bgp->router_id));
- vty_outln (vty,
- "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal");
- vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s",
- VTYNL);
- vty_outln (vty, V4_HEADER);
+ vty_out (vty,
+ "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n");
+ vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n");
+ vty_out (vty, V4_HEADER);
}
}
header = 0;
@@ -703,7 +702,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
rd_vnc_eth.macaddr.octet[4],
rd_vnc_eth.macaddr.octet[5]);
#endif
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
rd_header = 0;
}
@@ -740,17 +739,16 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
if (use_json)
{
json_object_object_add(json, "routes", json_nroute);
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
}
else
{
if (output_count == 0)
- vty_outln (vty, "No prefixes displayed, %ld exist", total_count);
+ vty_out (vty, "No prefixes displayed, %ld exist\n", total_count);
else
- vty_outln (vty, "%sDisplayed %ld routes and %ld total paths",
- VTYNL, output_count, total_count);
+ vty_out (vty, "\nDisplayed %ld routes and %ld total paths\n", output_count, total_count);
}
return CMD_SUCCESS;
@@ -781,7 +779,7 @@ DEFUN (show_bgp_ip_vpn_all_rd,
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 0, use_json (argc, argv));
@@ -816,7 +814,7 @@ DEFUN (show_ip_bgp_vpn_rd,
ret = str2prefix_rd (argv[idx_ext_community]->arg, &prd);
if (! ret)
{
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 0, 0);
@@ -881,7 +879,7 @@ DEFUN (show_ip_bgp_vpn_rd_tags,
ret = str2prefix_rd (argv[idx_ext_community]->arg, &prd);
if (! ret)
{
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 1, 0);
@@ -920,11 +918,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed address");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "Malformed address: %s", argv[idx_ipv4]->arg);
+ vty_out (vty, "Malformed address: %s\n", argv[idx_ipv4]->arg);
return CMD_WARNING;
}
@@ -936,11 +934,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "%% No such neighbor or address family");
+ vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -983,11 +981,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed Route Distinguisher");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
@@ -999,11 +997,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed address");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "Malformed address: %s",
+ vty_out (vty, "Malformed address: %s\n",
argv[idx_ext_community]->arg);
return CMD_WARNING;
}
@@ -1016,11 +1014,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "%% No such neighbor or address family");
+ vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -1060,11 +1058,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed address");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "Malformed address: %s", argv[idx_ipv4]->arg);
+ vty_out (vty, "Malformed address: %s\n", argv[idx_ipv4]->arg);
return CMD_WARNING;
}
peer = peer_lookup (NULL, &su);
@@ -1075,11 +1073,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "%% No such neighbor or address family");
+ vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING;
}
return show_adj_route_vpn (vty, peer, NULL, AFI_IP, SAFI_MPLS_VPN, uj);
@@ -1121,11 +1119,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed address");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "Malformed address: %s",
+ vty_out (vty, "Malformed address: %s\n",
argv[idx_ext_community]->arg);
return CMD_WARNING;
}
@@ -1137,11 +1135,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "%% No such neighbor or address family");
+ vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -1153,11 +1151,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed Route Distinguisher");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h
index 4ba4597d0..98806abc3 100644
--- a/bgpd/bgp_mplsvpn.h
+++ b/bgpd/bgp_mplsvpn.h
@@ -68,11 +68,11 @@ typedef enum {
"Address Family\n"
#define V4_HEADER \
- " Network Next Hop Metric LocPrf Weight Path"
+ " Network Next Hop Metric LocPrf Weight Path\n"
#define V4_HEADER_TAG \
- " Network Next Hop In tag/Out tag"
+ " Network Next Hop In tag/Out tag\n"
#define V4_HEADER_OVERLAY \
- " Network Next Hop EthTag Overlay Index RouterMac"
+ " Network Next Hop EthTag Overlay Index RouterMac\n"
struct rd_as
{
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index d0c4d2c94..45ccb3743 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -387,7 +387,7 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail)
time_t tbuf;
afi_t afi;
- vty_outln (vty, "Current BGP nexthop cache:");
+ vty_out (vty, "Current BGP nexthop cache:\n");
for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
{
if (!bgp->nexthop_cache_table[afi])
@@ -399,7 +399,7 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail)
{
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID))
{
- vty_outln (vty, " %s valid [IGP metric %d], #paths %d",
+ vty_out (vty, " %s valid [IGP metric %d], #paths %d\n",
inet_ntop (rn->p.family, &rn->p.u.prefix, buf, sizeof (buf)),
bnc->metric, bnc->path_count);
if (detail)
@@ -407,44 +407,44 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail)
switch (nexthop->type)
{
case NEXTHOP_TYPE_IPV6:
- vty_outln (vty, " gate %s",
+ vty_out (vty, " gate %s\n",
inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, sizeof(buf)));
break;
case NEXTHOP_TYPE_IPV6_IFINDEX:
- vty_outln (vty, " gate %s, if %s",
+ vty_out (vty, " gate %s, if %s\n",
inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf,
sizeof (buf)),
ifindex2ifname(nexthop->ifindex, bgp->vrf_id));
break;
case NEXTHOP_TYPE_IPV4:
- vty_outln (vty, " gate %s",
+ vty_out (vty, " gate %s\n",
inet_ntop(AF_INET, &nexthop->gate.ipv4, buf, sizeof(buf)));
break;
case NEXTHOP_TYPE_IFINDEX:
- vty_outln (vty, " if %s",
+ vty_out (vty, " if %s\n",
ifindex2ifname(nexthop->ifindex, bgp->vrf_id));
break;
case NEXTHOP_TYPE_IPV4_IFINDEX:
- vty_outln (vty, " gate %s, if %s",
+ vty_out (vty, " gate %s, if %s\n",
inet_ntop(AF_INET, &nexthop->gate.ipv4, buf,
sizeof (buf)),
ifindex2ifname(nexthop->ifindex, bgp->vrf_id));
break;
default:
- vty_outln (vty, " invalid nexthop type %u",
+ vty_out (vty, " invalid nexthop type %u\n",
nexthop->type);
}
}
else
{
- vty_outln (vty, " %s invalid",
+ vty_out (vty, " %s invalid\n",
inet_ntop(rn->p.family, &rn->p.u.prefix, buf, sizeof(buf)));
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED))
- vty_outln (vty, " Must be Connected");
+ vty_out (vty, " Must be Connected\n");
}
tbuf = time(NULL) - (bgp_clock() - bnc->last_update);
vty_out (vty, " Last update: %s", ctime(&tbuf));
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -461,7 +461,7 @@ show_ip_bgp_nexthop_table (struct vty *vty, const char *name, int detail)
bgp = bgp_get_default ();
if (!bgp)
{
- vty_outln (vty, "%% No such BGP instance exist");
+ vty_out (vty, "%% No such BGP instance exist\n");
return CMD_WARNING;
}
@@ -478,8 +478,7 @@ bgp_show_all_instances_nexthops_vty (struct vty *vty)
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
- vty_outln (vty, "%sInstance %s:",
- VTYNL,
+ vty_out (vty, "\nInstance %s:\n",
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name);
bgp_show_nexthops (vty, bgp, 0);
}
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index 86befd3e8..d6ed441df 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -167,7 +167,7 @@ bgp_capability_vty_out (struct vty *vty, struct peer *peer, u_char use_json, jso
vty_out (vty, "SAFI Unknown %d ", mpc.safi);
break;
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
}
else if (hdr->code >= 128)
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 6b38ba685..c2694b82b 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4273,12 +4273,12 @@ bgp_static_set (struct vty *vty, const char *ip_str,
ret = str2prefix (ip_str, &p);
if (! ret)
{
- vty_outln (vty, "%% Malformed prefix");
+ vty_out (vty, "%% Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6))
{
- vty_outln (vty,"%% Malformed prefix (link-local address)");
+ vty_out (vty,"%% Malformed prefix (link-local address)\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4295,7 +4295,7 @@ bgp_static_set (struct vty *vty, const char *ip_str,
/* Label index cannot be changed. */
if (bgp_static->label_index != label_index)
{
- vty_outln (vty, "%% Label index cannot be changed");
+ vty_out (vty, "%% Label index cannot be changed\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4367,12 +4367,12 @@ bgp_static_unset (struct vty *vty, const char *ip_str,
ret = str2prefix (ip_str, &p);
if (! ret)
{
- vty_outln (vty, "%% Malformed prefix");
+ vty_out (vty, "%% Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6))
{
- vty_outln (vty,"%% Malformed prefix (link-local address)");
+ vty_out (vty,"%% Malformed prefix (link-local address)\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4381,7 +4381,7 @@ bgp_static_unset (struct vty *vty, const char *ip_str,
rn = bgp_node_lookup (bgp->route[afi][safi], &p);
if (! rn)
{
- vty_outln (vty,"%% Can't find specified static route configuration.");
+ vty_out (vty,"%% Can't find specified static route configuration.\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4579,21 +4579,21 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str
ret = str2prefix (ip_str, &p);
if (! ret)
{
- vty_outln (vty, "%% Malformed prefix");
+ vty_out (vty, "%% Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
apply_mask (&p);
if ( (afi == AFI_L2VPN) &&
(bgp_build_evpn_prefix ( evpn_type, ethtag!=NULL?atol(ethtag):0, &p)))
{
- vty_outln (vty, "%% L2VPN prefix could not be forged");
+ vty_out (vty, "%% L2VPN prefix could not be forged\n");
return CMD_WARNING_CONFIG_FAILED;
}
ret = str2prefix_rd (rd_str, &prd);
if (! ret)
{
- vty_outln (vty, "%% Malformed rd");
+ vty_out (vty, "%% Malformed rd\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4608,12 +4608,12 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str
{
if( esi && str2esi (esi, NULL) == 0)
{
- vty_outln (vty, "%% Malformed ESI");
+ vty_out (vty, "%% Malformed ESI\n");
return CMD_WARNING_CONFIG_FAILED;
}
if( routermac && prefix_str2mac (routermac, NULL) == 0)
{
- vty_outln (vty, "%% Malformed Router MAC");
+ vty_out (vty, "%% Malformed Router MAC\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (gwip)
@@ -4622,7 +4622,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str
ret = str2prefix (gwip, &gw_ip);
if (! ret)
{
- vty_outln (vty, "%% Malformed GatewayIp");
+ vty_out (vty, "%% Malformed GatewayIp\n");
return CMD_WARNING_CONFIG_FAILED;
}
if((gw_ip.family == AF_INET &&
@@ -4630,7 +4630,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str
(gw_ip.family == AF_INET6 &&
IS_EVPN_PREFIX_IPADDR_V4((struct prefix_evpn *)&p)))
{
- vty_outln (vty, "%% GatewayIp family differs with IP prefix");
+ vty_out (vty, "%% GatewayIp family differs with IP prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -4647,7 +4647,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str
if (rn->info)
{
- vty_outln (vty, "%% Same network configuration exists");
+ vty_out (vty, "%% Same network configuration exists\n");
bgp_unlock_node (rn);
}
else
@@ -4713,20 +4713,20 @@ bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *vty, const char *ip_st
ret = str2prefix (ip_str, &p);
if (! ret)
{
- vty_outln (vty, "%% Malformed prefix");
+ vty_out (vty, "%% Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
apply_mask (&p);
if ( (afi == AFI_L2VPN) &&
(bgp_build_evpn_prefix ( evpn_type, ethtag!=NULL?atol(ethtag):0, &p)))
{
- vty_outln (vty, "%% L2VPN prefix could not be forged");
+ vty_out (vty, "%% L2VPN prefix could not be forged\n");
return CMD_WARNING_CONFIG_FAILED;
}
ret = str2prefix_rd (rd_str, &prd);
if (! ret)
{
- vty_outln (vty, "%% Malformed rd");
+ vty_out (vty, "%% Malformed rd\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4758,7 +4758,7 @@ bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *vty, const char *ip_st
bgp_unlock_node (rn);
}
else
- vty_outln (vty, "%% Can't find the route");
+ vty_out (vty, "%% Can't find the route\n");
return CMD_SUCCESS;
}
@@ -4816,7 +4816,7 @@ bgp_config_write_table_map (struct vty *vty, struct bgp *bgp, afi_t afi,
if (bgp->table_map[afi][safi].name)
{
bgp_config_write_family_header (vty, afi, safi, write);
- vty_outln (vty, " table-map %s",
+ vty_out (vty, " table-map %s\n",
bgp->table_map[afi][safi].name);
}
@@ -4900,7 +4900,7 @@ DEFUN (bgp_network_mask,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4927,7 +4927,7 @@ DEFUN (bgp_network_mask_route_map,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4952,7 +4952,7 @@ DEFUN (bgp_network_mask_backdoor,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4974,7 +4974,7 @@ DEFUN (bgp_network_mask_natural,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, NULL, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4999,7 +4999,7 @@ DEFUN (bgp_network_mask_natural_route_map,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, NULL, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5022,7 +5022,7 @@ DEFUN (bgp_network_mask_natural_backdoor,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, NULL, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5097,7 +5097,7 @@ DEFUN (no_bgp_network_mask,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5122,7 +5122,7 @@ DEFUN (no_bgp_network_mask_natural,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, NULL, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5756,7 +5756,7 @@ bgp_aggregate_unset (struct vty *vty, const char *prefix_str,
ret = str2prefix (prefix_str, &p);
if (!ret)
{
- vty_outln (vty, "Malformed prefix");
+ vty_out (vty, "Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
apply_mask (&p);
@@ -5765,7 +5765,7 @@ bgp_aggregate_unset (struct vty *vty, const char *prefix_str,
rn = bgp_node_lookup (bgp->aggregate[afi][safi], &p);
if (! rn)
{
- vty_outln (vty,"%% There is no aggregate-address configuration.");
+ vty_out (vty,"%% There is no aggregate-address configuration.\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5801,7 +5801,7 @@ bgp_aggregate_set (struct vty *vty, const char *prefix_str,
ret = str2prefix (prefix_str, &p);
if (!ret)
{
- vty_outln (vty, "Malformed prefix");
+ vty_out (vty, "Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
apply_mask (&p);
@@ -5811,12 +5811,12 @@ bgp_aggregate_set (struct vty *vty, const char *prefix_str,
if (rn->info)
{
- vty_outln (vty, "There is already same aggregate network.");
+ vty_out (vty, "There is already same aggregate network.\n");
/* try to remove the old entry */
ret = bgp_aggregate_unset (vty, prefix_str, afi, safi);
if (ret)
{
- vty_outln (vty, "Error deleting aggregate.");
+ vty_out (vty, "Error deleting aggregate.\n");
bgp_unlock_node (rn);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5884,7 +5884,7 @@ DEFUN (aggregate_address_mask,
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5930,7 +5930,7 @@ DEFUN (no_aggregate_address_mask,
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -6191,7 +6191,7 @@ route_vty_out_route (struct prefix *p, struct vty *vty)
len = 17 - len;
if (len < 1)
- vty_out (vty, "%s%*s", VTYNL, 20, " ");
+ vty_out (vty, "\n%*s", 20, " ");
else
vty_out (vty, "%*s", len, " ");
}
@@ -6415,7 +6415,7 @@ route_vty_out (struct vty *vty, struct prefix *p,
len = 7 - len; /* len of IPv6 addr + max len of def ifname */
if (len < 1)
- vty_out (vty, "%s%*s", VTYNL, 45, " ");
+ vty_out (vty, "\n%*s", 45, " ");
else
vty_out (vty, "%*s", len, " ");
}
@@ -6428,7 +6428,7 @@ route_vty_out (struct vty *vty, struct prefix *p,
len = 16 - len;
if (len < 1)
- vty_out (vty, "%s%*s", VTYNL, 36, " ");
+ vty_out (vty, "\n%*s", 36, " ");
else
vty_out (vty, "%*s", len, " ");
}
@@ -6442,7 +6442,7 @@ route_vty_out (struct vty *vty, struct prefix *p,
len = 16 - len;
if (len < 1)
- vty_out (vty, "%s%*s", VTYNL, 36, " ");
+ vty_out (vty, "\n%*s", 36, " ");
else
vty_out (vty, "%*s", len, " ");
}
@@ -6504,7 +6504,7 @@ route_vty_out (struct vty *vty, struct prefix *p,
if (json_paths)
json_object_string_add(json_path, "alert", "No attributes");
else
- vty_outln (vty, "No attributes to print");
+ vty_out (vty, "No attributes to print\n");
}
if (json_paths)
@@ -6526,7 +6526,7 @@ route_vty_out (struct vty *vty, struct prefix *p,
}
else
{
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
#if ENABLE_BGP_VNC
/* prints an additional line, indented, with VNC info, if present */
if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP))
@@ -6630,7 +6630,7 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p, struct attr *attr, safi_t
buf, BUFSIZ));
len = 16 - len;
if (len < 1)
- vty_out (vty, "%s%*s", VTYNL, 36, " ");
+ vty_out (vty, "\n%*s", 36, " ");
else
vty_out (vty, "%*s", len, " ");
}
@@ -6663,7 +6663,7 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p, struct attr *attr, safi_t
json_object_object_add(json_ar, inet_ntop (p->family, &p->u.prefix, buf_cut, BUFSIZ), json_net);
}
else
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
void
@@ -6767,7 +6767,7 @@ route_vty_out_tag (struct vty *vty, struct prefix *p,
else
{
vty_out (vty, "notag/%d", label);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -6855,7 +6855,7 @@ route_vty_out_overlay (struct vty *vty, struct prefix *p,
}
}
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* dampening route */
@@ -6884,7 +6884,7 @@ damp_route_vty_out (struct vty *vty, struct prefix *p, struct bgp_info *binfo,
if (len < 1)
{
if (!use_json)
- vty_out (vty, "%s%*s", VTYNL, 34, " ");
+ vty_out (vty, "\n%*s", 34, " ");
}
else
{
@@ -6919,7 +6919,7 @@ damp_route_vty_out (struct vty *vty, struct prefix *p, struct bgp_info *binfo,
vty_out (vty, "%s", bgp_origin_str[attr->origin]);
}
if (!use_json)
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* flap route */
@@ -6954,7 +6954,7 @@ flap_route_vty_out (struct vty *vty, struct prefix *p, struct bgp_info *binfo,
if (len < 1)
{
if (!use_json)
- vty_out (vty, "%s%*s", VTYNL, 33, " ");
+ vty_out (vty, "\n%*s", 33, " ");
}
else
{
@@ -7019,7 +7019,7 @@ flap_route_vty_out (struct vty *vty, struct prefix *p, struct bgp_info *binfo,
vty_out (vty, "%s", bgp_origin_str[attr->origin]);
}
if (!use_json)
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
static void
@@ -7193,7 +7193,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
}
if (!json_paths)
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
/* Line2 display Next-hop, Neighbor, Router-id */
/* Display the nexthop */
@@ -7343,7 +7343,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
}
if (!json_paths)
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
/* display the link-local nexthop */
if (attr->extra && attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL)
@@ -7366,7 +7366,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
}
else
{
- vty_outln (vty, " (%s) %s",
+ vty_out (vty, " (%s) %s\n",
inet_ntop (AF_INET6, &attr->extra->mp_nexthop_local,
buf, INET6_ADDRSTRLEN),
attr->extra->mp_nexthop_prefer_global ? "(prefer-global)" : "(used)");
@@ -7562,7 +7562,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
json_object_object_add(json_path, "bestpath", json_bestpath);
if (!json_paths)
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
/* Line 4 display Community */
if (attr->community)
@@ -7574,7 +7574,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
}
else
{
- vty_outln (vty, " Community: %s",attr->community->str);
+ vty_out (vty, " Community: %s\n",attr->community->str);
}
}
@@ -7589,14 +7589,14 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
}
else
{
- vty_outln (vty, " Extended Community: %s",
+ vty_out (vty, " Extended Community: %s\n",
attr->extra->ecommunity->str);
}
}
/* Line 6 display Large community */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES))
- vty_outln (vty, " Large Community: %s",
+ vty_out (vty, " Large Community: %s\n",
attr->extra->lcommunity->str);
/* Line 7 display Originator, Cluster-id */
@@ -7649,7 +7649,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
}
if (!json_paths)
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
if (binfo->extra && binfo->extra->damp_info)
@@ -7662,7 +7662,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
if (json_paths)
json_object_int_add(json_path, "remoteLabel", label);
else
- vty_outln (vty, " Remote label: %d", label);
+ vty_out (vty, " Remote label: %d\n", label);
}
/* Label Index */
@@ -7671,7 +7671,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
if (json_paths)
json_object_int_add(json_path, "labelIndex", attr->extra->label_index);
else
- vty_outln (vty, " Label Index: %d",
+ vty_out (vty, " Label Index: %d\n",
attr->extra->label_index);
}
@@ -7685,7 +7685,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
}
else
{
- vty_outln (vty, " AddPath ID: RX %u, TX %u",
+ vty_out (vty, " AddPath ID: RX %u, TX %u\n",
binfo->addpath_rx_id,binfo->addpath_tx_id);
}
}
@@ -7724,7 +7724,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
{
if (!first)
{
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -7764,12 +7764,12 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
json_object_array_add(json_paths, json_path);
}
else
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
#define BGP_SHOW_HEADER_CSV "Flags, Network, Next Hop, Metric, LocPrf, Weight, Path"
-#define BGP_SHOW_DAMP_HEADER " Network From Reuse Path"
-#define BGP_SHOW_FLAP_HEADER " Network From Flaps Duration Reuse Path"
+#define BGP_SHOW_DAMP_HEADER " Network From Reuse Path\n"
+#define BGP_SHOW_FLAP_HEADER " Network From Flaps Duration Reuse Path\n"
static int
bgp_show_prefix_list (struct vty *vty, struct bgp *bgp,
@@ -7986,18 +7986,18 @@ bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table,
if (!use_json && header)
{
- vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version,
+ vty_out (vty, "BGP table version is %" PRIu64 ", local router ID is %s\n", table->version,
inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
+ vty_out (vty, BGP_SHOW_SCODE_HEADER);
+ vty_out (vty, BGP_SHOW_OCODE_HEADER);
if (type == bgp_show_type_dampend_paths
|| type == bgp_show_type_damp_neighbor)
- vty_outln (vty, BGP_SHOW_DAMP_HEADER);
+ vty_out (vty, BGP_SHOW_DAMP_HEADER);
else if (type == bgp_show_type_flap_statistics
|| type == bgp_show_type_flap_neighbor)
- vty_outln (vty, BGP_SHOW_FLAP_HEADER);
+ vty_out (vty, BGP_SHOW_FLAP_HEADER);
else
- vty_outln (vty, BGP_SHOW_HEADER);
+ vty_out (vty, BGP_SHOW_HEADER);
header = 0;
}
@@ -8031,7 +8031,7 @@ bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table,
if (use_json)
{
json_object_free (json_paths);
- vty_outln (vty, " } }");
+ vty_out (vty, " } }\n");
}
else
{
@@ -8039,12 +8039,11 @@ bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table,
if (output_count == 0)
{
if (type == bgp_show_type_normal)
- vty_outln (vty, "No BGP prefixes displayed, %ld exist",
+ vty_out (vty, "No BGP prefixes displayed, %ld exist\n",
total_count);
}
else
- vty_outln (vty, "%sDisplayed %ld routes and %ld total paths",
- VTYNL, output_count, total_count);
+ vty_out (vty, "\nDisplayed %ld routes and %ld total paths\n", output_count, total_count);
}
return CMD_SUCCESS;
@@ -8064,7 +8063,7 @@ bgp_show (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
if (bgp == NULL)
{
if (!use_json)
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING;
}
@@ -8093,14 +8092,14 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi,
int is_first = 1;
if (use_json)
- vty_outln (vty, "{");
+ vty_out (vty, "{\n");
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
if (use_json)
{
if (! is_first)
- vty_outln (vty, ",");
+ vty_out (vty, ",\n");
else
is_first = 0;
@@ -8109,8 +8108,7 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi,
}
else
{
- vty_outln (vty, "%sInstance %s:",
- VTYNL,
+ vty_out (vty, "\nInstance %s:\n",
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name);
}
bgp_show (vty, bgp, afi, safi, bgp_show_type_normal, NULL, use_json);
@@ -8118,7 +8116,7 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi,
}
if (use_json)
- vty_outln (vty, "}");
+ vty_out (vty, "}\n");
}
/* Header of detailed BGP route information */
@@ -8165,7 +8163,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
prefix2str (p, buf2, INET6_ADDRSTRLEN);
else
inet_ntop (p->family, &p->u.prefix, buf2, INET6_ADDRSTRLEN);
- vty_outln (vty, "BGP routing table entry for %s%s%s/%d",
+ vty_out (vty, "BGP routing table entry for %s%s%s/%d\n",
((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP || safi == SAFI_EVPN) ?
prefix_rd2str (prd, buf1, RD_ADDRSTRLEN) : ""),
((safi == SAFI_MPLS_VPN) || (safi == SAFI_EVPN)) ? ":" : "",
@@ -8173,9 +8171,9 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
p->prefixlen);
if (has_valid_label)
- vty_outln (vty, "Local label: %d", label);
+ vty_out (vty, "Local label: %d\n", label);
else if (bgp_labeled_safi(safi))
- vty_outln (vty, "Local label: not allocated");
+ vty_out (vty, "Local label: not allocated\n");
}
for (ri = rn->info; ri; ri = ri->next)
@@ -8221,7 +8219,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
if (suppress)
vty_out (vty, ", Advertisements suppressed by an aggregate.");
- vty_outln (vty, ")");
+ vty_out (vty, ")\n");
}
/* If we are not using addpath then we can display Advertised to and that will
@@ -8253,7 +8251,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
{
if (first)
vty_out (vty, " Not advertised to any peer");
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -8281,7 +8279,7 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp,
ret = str2prefix (ip_str, &match);
if (! ret)
{
- vty_outln (vty, "address is malformed");
+ vty_out (vty, "address is malformed\n");
return CMD_WARNING;
}
@@ -8368,7 +8366,7 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp,
if (display)
json_object_object_add(json, "paths", json_paths);
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
}
@@ -8376,7 +8374,7 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp,
{
if (!display)
{
- vty_outln (vty, "%% Network not in table");
+ vty_out (vty, "%% Network not in table\n");
return CMD_WARNING;
}
}
@@ -8436,7 +8434,7 @@ bgp_show_lcommunity (struct vty *vty, struct bgp *bgp, int argc,
XFREE (MTYPE_TMP, str);
if (! lcom)
{
- vty_outln (vty, "%% Large-community malformed");
+ vty_out (vty, "%% Large-community malformed\n");
return CMD_WARNING;
}
@@ -8452,7 +8450,7 @@ bgp_show_lcommunity_list (struct vty *vty, struct bgp *bgp, const char *lcom,
list = community_list_lookup (bgp_clist, lcom, LARGE_COMMUNITY_LIST_MASTER);
if (list == NULL)
{
- vty_outln (vty, "%% %s is not a valid large-community-list name",lcom);
+ vty_out (vty, "%% %s is not a valid large-community-list name\n",lcom);
return CMD_WARNING;
}
@@ -8494,7 +8492,7 @@ DEFUN (show_ip_bgp_large_community_list,
struct bgp *bgp = bgp_lookup_by_name (vrf);
if (bgp == NULL)
{
- vty_outln (vty, "Can't find BGP instance %s", vrf);
+ vty_out (vty, "Can't find BGP instance %s\n", vrf);
return CMD_WARNING;
}
@@ -8535,7 +8533,7 @@ DEFUN (show_ip_bgp_large_community,
struct bgp *bgp = bgp_lookup_by_name (vrf);
if (bgp == NULL)
{
- vty_outln (vty, "Can't find BGP instance %s", vrf);
+ vty_out (vty, "Can't find BGP instance %s\n", vrf);
return CMD_WARNING;
}
@@ -8704,8 +8702,8 @@ DEFUN (show_ip_bgp_route,
if (!bgp)
{
- vty_outln (vty,
- "Specified 'all' vrf's but this command currently only works per view/vrf");
+ vty_out (vty,
+ "Specified 'all' vrf's but this command currently only works per view/vrf\n");
return CMD_WARNING;
}
@@ -8717,14 +8715,14 @@ DEFUN (show_ip_bgp_route,
if ((argv[idx]->type == IPV6_TKN || argv[idx]->type == IPV6_PREFIX_TKN) && afi != AFI_IP6)
{
- vty_outln (vty,
- "%% Cannot specify IPv6 address or prefix with IPv4 AFI");
+ vty_out (vty,
+ "%% Cannot specify IPv6 address or prefix with IPv4 AFI\n");
return CMD_WARNING;
}
if ((argv[idx]->type == IPV4_TKN || argv[idx]->type == IPV4_PREFIX_TKN) && afi != AFI_IP)
{
- vty_outln (vty,
- "%% Cannot specify IPv4 address or prefix with IPv6 AFI");
+ vty_out (vty,
+ "%% Cannot specify IPv4 address or prefix with IPv6 AFI\n");
return CMD_WARNING;
}
@@ -8809,7 +8807,7 @@ bgp_show_regexp (struct vty *vty, const char *regstr, afi_t afi,
regex = bgp_regcomp (regstr);
if (! regex)
{
- vty_outln (vty, "Can't compile regexp %s", regstr);
+ vty_out (vty, "Can't compile regexp %s\n", regstr);
return CMD_WARNING;
}
@@ -8828,7 +8826,7 @@ bgp_show_prefix_list (struct vty *vty, struct bgp *bgp,
plist = prefix_list_lookup (afi, prefix_list_str);
if (plist == NULL)
{
- vty_outln (vty, "%% %s is not a valid prefix-list name",
+ vty_out (vty, "%% %s is not a valid prefix-list name\n",
prefix_list_str);
return CMD_WARNING;
}
@@ -8846,7 +8844,7 @@ bgp_show_filter_list (struct vty *vty, struct bgp *bgp,
as_list = as_list_lookup (filter);
if (as_list == NULL)
{
- vty_outln (vty, "%% %s is not a valid AS-path access-list name",
+ vty_out (vty, "%% %s is not a valid AS-path access-list name\n",
filter);
return CMD_WARNING;
}
@@ -8864,7 +8862,7 @@ bgp_show_route_map (struct vty *vty, struct bgp *bgp,
rmap = route_map_lookup_by_name (rmap_str);
if (! rmap)
{
- vty_outln (vty, "%% %s is not a valid route-map name",
+ vty_out (vty, "%% %s is not a valid route-map name\n",
rmap_str);
return CMD_WARNING;
}
@@ -8906,7 +8904,7 @@ bgp_show_community (struct vty *vty, struct bgp *bgp, int argc,
XFREE (MTYPE_TMP, str);
if (! com)
{
- vty_outln (vty, "%% Community malformed: ");
+ vty_out (vty, "%% Community malformed: \n");
return CMD_WARNING;
}
@@ -8928,7 +8926,7 @@ bgp_show_community_list (struct vty *vty, struct bgp *bgp,
list = community_list_lookup (bgp_clist, com, COMMUNITY_LIST_MASTER);
if (list == NULL)
{
- vty_outln (vty, "%% %s is not a valid community-list name",com);
+ vty_out (vty, "%% %s is not a valid community-list name\n",com);
return CMD_WARNING;
}
@@ -8950,7 +8948,7 @@ bgp_show_prefix_longer (struct vty *vty, struct bgp *bgp,
ret = str2prefix (prefix, p);
if (! ret)
{
- vty_outln (vty, "%% Malformed Prefix");
+ vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING;
}
@@ -8983,11 +8981,11 @@ peer_lookup_in_view (struct vty *vty, struct bgp *bgp,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "malformedAddressOrName", ip_str);
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "%% Malformed address or name: %s", ip_str);
+ vty_out (vty, "%% Malformed address or name: %s\n", ip_str);
return NULL;
}
}
@@ -9003,11 +9001,11 @@ peer_lookup_in_view (struct vty *vty, struct bgp *bgp,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning","No such neighbor");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "No such neighbor");
+ vty_out (vty, "No such neighbor\n");
return NULL;
}
@@ -9185,13 +9183,13 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi)
if (!bgp->rib[afi][safi])
{
- vty_outln (vty, "%% No RIB exist's for the AFI(%d)/SAFI(%d)",
+ vty_out (vty, "%% No RIB exist's for the AFI(%d)/SAFI(%d)\n",
afi, safi);
return CMD_WARNING;
}
- vty_outln (vty, "BGP %s RIB statistics%s",
- afi_safi_print (afi, safi), VTYNL);
+ vty_out (vty, "BGP %s RIB statistics\n",
+ afi_safi_print (afi, safi));
/* labeled-unicast routes live in the unicast table */
if (safi == SAFI_LABELED_UNICAST)
@@ -9236,14 +9234,14 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi)
break;
case BGP_STATS_SPACE:
vty_out (vty, "%-30s: ", table_stats_strs[i]);
- vty_outln (vty, "%12llu", ts.counts[i]);
+ vty_out (vty, "%12llu\n", ts.counts[i]);
if (ts.counts[BGP_STATS_MAXBITLEN] < 9)
break;
vty_out (vty, "%30s: ", "%% announced ");
- vty_outln (vty, "%12.2f",
+ vty_out (vty, "%12.2f\n",
100 * (float)ts.counts[BGP_STATS_SPACE] / (float)((uint64_t)1UL << ts.counts[BGP_STATS_MAXBITLEN]));
vty_out (vty, "%30s: ", "/8 equivalent ");
- vty_outln (vty, "%12.2f",
+ vty_out (vty, "%12.2f\n",
(float)ts.counts[BGP_STATS_SPACE] / (float)(1UL << (ts.counts[BGP_STATS_MAXBITLEN] - 8)));
if (ts.counts[BGP_STATS_MAXBITLEN] < 25)
break;
@@ -9257,7 +9255,7 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi)
vty_out (vty, "%12llu", ts.counts[i]);
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
return CMD_SUCCESS;
}
@@ -9381,11 +9379,11 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c
if (use_json)
{
json_object_string_add(json, "warning", "No such neighbor or address family");
- vty_outln (vty, "%s", json_object_to_json_string(json));
+ vty_out (vty, "%s\n", json_object_to_json_string(json));
json_object_free(json);
}
else
- vty_outln (vty, "%% No such neighbor or address family");
+ vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -9416,7 +9414,7 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c
json_object_string_add(json, "pfxctDriftFor", peer->host);
json_object_string_add(json, "recommended", "Please report this bug, with the above command output");
}
- vty_outln (vty, "%s", json_object_to_json_string(json));
+ vty_out (vty, "%s\n", json_object_to_json_string(json));
json_object_free(json);
}
else
@@ -9424,28 +9422,27 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c
if (peer->hostname && bgp_flag_check(peer->bgp, BGP_FLAG_SHOW_HOSTNAME))
{
- vty_outln (vty, "Prefix counts for %s/%s, %s",
+ vty_out (vty, "Prefix counts for %s/%s, %s\n",
peer->hostname, peer->host,afi_safi_print(afi, safi));
}
else
{
- vty_outln (vty, "Prefix counts for %s, %s",
+ vty_out (vty, "Prefix counts for %s, %s\n",
peer->host, afi_safi_print(afi, safi));
}
- vty_outln (vty, "PfxCt: %ld", peer->pcount[afi][safi]);
- vty_outln (vty, "%sCounts from RIB table walk:%s",
- VTYNL, VTYNL);
+ vty_out (vty, "PfxCt: %ld\n", peer->pcount[afi][safi]);
+ vty_out (vty, "\nCounts from RIB table walk:\n\n");
for (i = 0; i < PCOUNT_MAX; i++)
- vty_outln (vty, "%20s: %-10d", pcount_strs[i], pcounts.count[i]);
+ vty_out (vty, "%20s: %-10d\n", pcount_strs[i], pcounts.count[i]);
if (pcounts.count[PCOUNT_PFCNT] != peer->pcount[afi][safi])
{
- vty_outln (vty, "%s [pcount] PfxCt drift!",
+ vty_out (vty, "%s [pcount] PfxCt drift!\n",
peer->host);
- vty_outln (vty,
- "Please report this bug, with the above command output");
+ vty_out (vty,
+ "Please report this bug, with the above command output\n");
}
}
@@ -9534,7 +9531,7 @@ DEFUN (show_ip_bgp_vpn_all_route_prefix,
struct bgp *bgp = bgp_get_default();
if (!bgp)
{
- vty_outln (vty, "Can't find default instance");
+ vty_out (vty, "Can't find default instance\n");
return CMD_WARNING;
}
@@ -9544,7 +9541,7 @@ DEFUN (show_ip_bgp_vpn_all_route_prefix,
network = argv[idx]->arg;
else
{
- vty_outln (vty, "Unable to figure out Network");
+ vty_out (vty, "Unable to figure out Network\n");
return CMD_WARNING;
}
@@ -9574,7 +9571,7 @@ DEFUN (show_ip_bgp_l2vpn_evpn_all_route_prefix,
network = argv[idx]->arg;
else
{
- vty_outln (vty, "Unable to figure out Network");
+ vty_out (vty, "Unable to figure out Network\n");
return CMD_WARNING;
}
return bgp_show_route (vty, NULL, network, AFI_L2VPN, SAFI_EVPN, NULL, 0, BGP_PATH_ALL, use_json(argc, argv));
@@ -9631,11 +9628,11 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
if (use_json)
{
json_object_string_add(json, "alert", "no BGP");
- vty_outln (vty, "%s", json_object_to_json_string(json));
+ vty_out (vty, "%s\n", json_object_to_json_string(json));
json_object_free(json);
}
else
- vty_outln (vty, "%% No bgp");
+ vty_out (vty, "%% No bgp\n");
return;
}
@@ -9656,13 +9653,12 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
}
else
{
- vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version,
+ vty_out (vty, "BGP table version is %" PRIu64 ", local router ID is %s\n", table->version,
inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
+ vty_out (vty, BGP_SHOW_SCODE_HEADER);
+ vty_out (vty, BGP_SHOW_OCODE_HEADER);
- vty_outln (vty, "Originating default network 0.0.0.0%s",
- VTYNL);
+ vty_out (vty, "Originating default network 0.0.0.0\n\n");
}
header1 = 0;
}
@@ -9687,17 +9683,17 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
}
else
{
- vty_outln (vty, "BGP table version is 0, local router ID is %s",
+ vty_out (vty, "BGP table version is 0, local router ID is %s\n",
inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
+ vty_out (vty, BGP_SHOW_SCODE_HEADER);
+ vty_out (vty, BGP_SHOW_OCODE_HEADER);
}
header1 = 0;
}
if (header2)
{
if (!use_json)
- vty_outln (vty, BGP_SHOW_HEADER);
+ vty_out (vty, BGP_SHOW_HEADER);
header2 = 0;
}
if (ain->attr)
@@ -9731,10 +9727,10 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
}
else
{
- vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version,
+ vty_out (vty, "BGP table version is %" PRIu64 ", local router ID is %s\n", table->version,
inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
+ vty_out (vty, BGP_SHOW_SCODE_HEADER);
+ vty_out (vty, BGP_SHOW_OCODE_HEADER);
}
header1 = 0;
}
@@ -9742,7 +9738,7 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
if (header2)
{
if (!use_json)
- vty_outln (vty, BGP_SHOW_HEADER);
+ vty_out (vty, BGP_SHOW_HEADER);
header2 = 0;
}
@@ -9769,12 +9765,11 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
if (use_json)
json_object_int_add(json, "totalPrefixCounter", output_count);
else
- vty_outln (vty, "%sTotal number of prefixes %ld",
- VTYNL, output_count);
+ vty_out (vty, "\nTotal number of prefixes %ld\n", output_count);
}
if (use_json)
{
- vty_outln (vty, "%s", json_object_to_json_string(json));
+ vty_out (vty, "%s\n", json_object_to_json_string(json));
json_object_free(json);
}
@@ -9798,11 +9793,11 @@ peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
if (use_json)
{
json_object_string_add(json, "warning", "No such neighbor or address family");
- vty_outln (vty, "%s", json_object_to_json_string(json));
+ vty_out (vty, "%s\n", json_object_to_json_string(json));
json_object_free(json);
}
else
- vty_outln (vty, "%% No such neighbor or address family");
+ vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -9812,11 +9807,11 @@ peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
if (use_json)
{
json_object_string_add(json, "warning", "Inbound soft reconfiguration not enabled");
- vty_outln (vty, "%s", json_object_to_json_string(json));
+ vty_out (vty, "%s\n", json_object_to_json_string(json));
json_object_free(json);
}
else
- vty_outln (vty, "%% Inbound soft reconfiguration not enabled");
+ vty_out (vty, "%% Inbound soft reconfiguration not enabled\n");
return CMD_WARNING;
}
@@ -9930,9 +9925,9 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter,
if (! peer)
{
if (uj)
- vty_outln (vty, "{}");
+ vty_out (vty, "{}\n");
else
- vty_outln (vty, "%% Malformed address or name: %s", peerstr);
+ vty_out (vty, "%% Malformed address or name: %s\n", peerstr);
return CMD_WARNING;
}
}
@@ -9942,9 +9937,9 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter,
if (! peer)
{
if (uj)
- vty_outln (vty, "{}");
+ vty_out (vty, "{}\n");
else
- vty_outln (vty, "No peer");
+ vty_out (vty, "No peer\n");
return CMD_WARNING;
}
}
@@ -9954,15 +9949,15 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter,
if (count)
{
if (!uj)
- vty_outln (vty, "Address Family: %s", afi_safi_print(afi, safi));
+ vty_out (vty, "Address Family: %s\n", afi_safi_print(afi, safi));
prefix_bgp_show_prefix_list (vty, afi, name, uj);
}
else
{
if (uj)
- vty_outln (vty, "{}");
+ vty_out (vty, "{}\n");
else
- vty_outln (vty, "No functional output");
+ vty_out (vty, "No functional output\n");
}
return CMD_SUCCESS;
@@ -9979,11 +9974,11 @@ bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
json_object *json_no = NULL;
json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family");
- vty_outln (vty, "%s", json_object_to_json_string(json_no));
+ vty_out (vty, "%s\n", json_object_to_json_string(json_no));
json_object_free(json_no);
}
else
- vty_outln (vty, "%% No such neighbor or address family");
+ vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING;
}
@@ -10036,7 +10031,7 @@ DEFUN (show_ip_bgp_neighbor_routes,
peer = peer_lookup_in_view (vty, bgp, peerstr, uj);
if (! peer)
{
- vty_outln (vty, "No such neighbor");
+ vty_out (vty, "No such neighbor\n");
return CMD_WARNING;
}
@@ -10083,7 +10078,7 @@ DEFUN (show_bgp_afi_vpn_rd_route,
ret = str2prefix_rd (argv[5]->arg, &prd);
if (! ret)
{
- vty_outln (vty, "%% Malformed Route Distinguisher");
+ vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
return bgp_show_route (vty, NULL, argv[6]->arg, afi, SAFI_MPLS_VPN, &prd, 0, BGP_PATH_ALL, use_json (argc, argv));
@@ -10119,7 +10114,7 @@ bgp_distance_set (struct vty *vty, const char *distance_str,
ret = str2prefix (ip_str, &p);
if (ret == 0)
{
- vty_outln (vty, "Malformed prefix");
+ vty_out (vty, "Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -10171,14 +10166,14 @@ bgp_distance_unset (struct vty *vty, const char *distance_str,
ret = str2prefix (ip_str, &p);
if (ret == 0)
{
- vty_outln (vty, "Malformed prefix");
+ vty_out (vty, "Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
rn = bgp_node_lookup (bgp_distance_table[afi][safi], (struct prefix *)&p);
if (! rn)
{
- vty_outln (vty, "Can't find specified prefix");
+ vty_out (vty, "Can't find specified prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -10187,7 +10182,7 @@ bgp_distance_unset (struct vty *vty, const char *distance_str,
if (bdistance->distance != distance)
{
- vty_outln (vty, "Distance does not match configured");
+ vty_out (vty, "Distance does not match configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -10457,7 +10452,7 @@ DEFUN (bgp_damp_set,
if (suppress < reuse)
{
- vty_outln (vty,"Suppress value cannot be less than reuse value ");
+ vty_out (vty,"Suppress value cannot be less than reuse value \n");
return 0;
}
@@ -10501,7 +10496,7 @@ bgp_clear_damp_route (struct vty *vty, const char *view_name,
bgp = bgp_lookup_by_name (view_name);
if (bgp == NULL)
{
- vty_outln (vty, "%% Can't find BGP instance %s", view_name);
+ vty_out (vty, "%% Can't find BGP instance %s\n", view_name);
return CMD_WARNING;
}
}
@@ -10510,7 +10505,7 @@ bgp_clear_damp_route (struct vty *vty, const char *view_name,
bgp = bgp_get_default ();
if (bgp == NULL)
{
- vty_outln (vty, "%% No BGP process is configured");
+ vty_out (vty, "%% No BGP process is configured\n");
return CMD_WARNING;
}
}
@@ -10519,7 +10514,7 @@ bgp_clear_damp_route (struct vty *vty, const char *view_name,
ret = str2prefix (ip_str, &match);
if (! ret)
{
- vty_outln (vty, "%% address is malformed");
+ vty_out (vty, "%% address is malformed\n");
return CMD_WARNING;
}
@@ -10640,7 +10635,7 @@ DEFUN (clear_ip_bgp_dampening_address_mask,
ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str);
if (! ret)
{
- vty_outln (vty, "%% Inconsistent address and mask");
+ vty_out (vty, "%% Inconsistent address and mask\n");
return CMD_WARNING;
}
@@ -10692,7 +10687,7 @@ bgp_config_write_network_vpn (struct vty *vty, struct bgp *bgp,
if (bgp_static->backdoor)
vty_out (vty, " backdoor");
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
return 0;
}
@@ -10739,7 +10734,7 @@ bgp_config_write_network_evpn (struct vty *vty, struct bgp *bgp,
vty_out (vty, " network %s rd %s ethtag %u tag %u esi %s gwip %s routermac %s",
buf, rdbuf, p->u.prefix_evpn.eth_tag,
decode_label (&bgp_static->label), esi, buf2 , macrouter);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
if (macrouter)
XFREE (MTYPE_TMP, macrouter);
if (esi)
@@ -10814,7 +10809,7 @@ bgp_config_write_network (struct vty *vty, struct bgp *bgp,
vty_out (vty, " backdoor");
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* Aggregate-address configuration. */
@@ -10848,7 +10843,7 @@ bgp_config_write_network (struct vty *vty, struct bgp *bgp,
if (bgp_aggregate->summary_only)
vty_out (vty, " summary-only");
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
return 0;
@@ -10870,7 +10865,7 @@ bgp_config_write_distance (struct vty *vty, struct bgp *bgp, afi_t afi,
|| bgp->distance_local[afi][safi] != ZEBRA_IBGP_DISTANCE_DEFAULT))
{
bgp_config_write_family_header (vty, afi, safi, write);
- vty_outln (vty, " distance bgp %d %d %d",
+ vty_out (vty, " distance bgp %d %d %d\n",
bgp->distance_ebgp[afi][safi], bgp->distance_ibgp[afi][safi],
bgp->distance_local[afi][safi]);
}
@@ -10882,7 +10877,7 @@ bgp_config_write_distance (struct vty *vty, struct bgp *bgp, afi_t afi,
char buf[PREFIX_STRLEN];
bgp_config_write_family_header (vty, afi, safi, write);
- vty_outln (vty, " distance %d %s %s", bdistance->distance,
+ vty_out (vty, " distance %d %s %s\n", bdistance->distance,
prefix2str (&rn->p, buf, sizeof (buf)),
bdistance->access_list ? bdistance->access_list : "");
}
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 0c77cc1ee..54a56456d 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -53,10 +53,10 @@ enum bgp_show_type
#define BGP_SHOW_SCODE_HEADER "Status codes: s suppressed, d damped, "\
- "h history, * valid, > best, = multipath,%s"\
- " i internal, r RIB-failure, S Stale, R Removed"
-#define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete%s"
-#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path"
+ "h history, * valid, > best, = multipath,\n"\
+ " i internal, r RIB-failure, S Stale, R Removed\n"
+#define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n"
+#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path\n"
/* Ancillary information to struct bgp_info,
* used for uncommonly used data (aggregation, MPLS, etc.)
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index dcc58dc54..140c58f37 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2851,10 +2851,10 @@ bgp_route_match_add (struct vty *vty,
switch (ret)
{
case RMAP_RULE_MISSING:
- vty_outln (vty, "%% BGP Can't find rule.");
+ vty_out (vty, "%% BGP Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR:
- vty_outln (vty, "%% BGP Argument is malformed.");
+ vty_out (vty, "%% BGP Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -2900,10 +2900,10 @@ bgp_route_match_delete (struct vty *vty,
switch (ret)
{
case RMAP_RULE_MISSING:
- vty_outln (vty, "%% BGP Can't find rule.");
+ vty_out (vty, "%% BGP Can't find rule.\n");
break;
case RMAP_COMPILE_ERROR:
- vty_outln (vty, "%% BGP Argument is malformed.");
+ vty_out (vty, "%% BGP Argument is malformed.\n");
break;
}
if (dep_name)
@@ -3592,7 +3592,7 @@ DEFUN (match_origin,
return bgp_route_match_add (vty, "origin", "incomplete",
RMAP_EVENT_MATCH_ADDED);
- vty_outln (vty, "%% Invalid match origin type");
+ vty_out (vty, "%% Invalid match origin type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3887,7 +3887,7 @@ DEFUN (set_community,
/* Can't compile user input into communities attribute. */
if (! com)
{
- vty_outln (vty, "%% Malformed communities attribute");
+ vty_out (vty, "%% Malformed communities attribute\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4153,7 +4153,7 @@ DEFUN (set_origin,
return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "origin",
"incomplete");
- vty_outln (vty, "%% Invalid set origin type");
+ vty_out (vty, "%% Invalid set origin type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4212,7 +4212,7 @@ DEFUN (set_aggregator_as,
ret = inet_aton (argv[idx_ipv4]->arg, &address);
if (ret == 0)
{
- vty_outln (vty, "Aggregator IP address is invalid");
+ vty_out (vty, "Aggregator IP address is invalid\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4253,7 +4253,7 @@ DEFUN (no_set_aggregator_as,
ret = inet_aton (argv[idx_ip]->arg, &address);
if (ret == 0)
{
- vty_outln (vty, "Aggregator IP address is invalid");
+ vty_out (vty, "Aggregator IP address is invalid\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4364,7 +4364,7 @@ DEFUN (set_ipv6_nexthop_global,
ret = inet_pton (AF_INET6, argv[idx_ipv6]->arg, &addr);
if (!ret)
{
- vty_outln (vty, "%% Malformed nexthop address");
+ vty_out (vty, "%% Malformed nexthop address\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (IN6_IS_ADDR_UNSPECIFIED(&addr) ||
@@ -4372,7 +4372,7 @@ DEFUN (set_ipv6_nexthop_global,
IN6_IS_ADDR_MULTICAST(&addr) ||
IN6_IS_ADDR_LINKLOCAL(&addr))
{
- vty_outln (vty, "%% Invalid global nexthop address");
+ vty_out (vty, "%% Invalid global nexthop address\n");
return CMD_WARNING_CONFIG_FAILED;
}
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index 722eed91c..b8971dcd6 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -564,17 +564,17 @@ update_group_show_walkcb (struct update_group *updgrp, void *arg)
vty = ctx->vty;
- vty_outln (vty, "Update-group %" PRIu64 ":", updgrp->id);
+ vty_out (vty, "Update-group %" PRIu64 ":\n", updgrp->id);
vty_out (vty, " Created: %s", timestamp_string (updgrp->uptime));
filter = &updgrp->conf->filter[updgrp->afi][updgrp->safi];
if (filter->map[RMAP_OUT].name)
- vty_outln (vty, " Outgoing route map: %s%s",
+ vty_out (vty, " Outgoing route map: %s%s\n",
filter->map[RMAP_OUT].map ? "X" : "",
filter->map[RMAP_OUT].name);
- vty_outln (vty, " MRAI value (seconds): %d",
+ vty_out (vty, " MRAI value (seconds): %d\n",
updgrp->conf->v_routeadv);
if (updgrp->conf->change_local_as)
- vty_outln (vty, " Local AS %u%s%s",
+ vty_out (vty, " Local AS %u%s%s\n",
updgrp->conf->change_local_as,
CHECK_FLAG (updgrp->conf->flags,
PEER_FLAG_LOCAL_AS_NO_PREPEND) ? " no-prepend" : "",
@@ -584,49 +584,49 @@ update_group_show_walkcb (struct update_group *updgrp, void *arg)
{
if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue;
- vty_out (vty, VTYNL);
- vty_outln (vty, " Update-subgroup %" PRIu64 ":", subgrp->id);
+ vty_out (vty, "\n");
+ vty_out (vty, " Update-subgroup %" PRIu64 ":\n", subgrp->id);
vty_out (vty, " Created: %s", timestamp_string (subgrp->uptime));
if (subgrp->split_from.update_group_id || subgrp->split_from.subgroup_id)
{
- vty_outln (vty, " Split from group id: %" PRIu64 "",
+ vty_out (vty, " Split from group id: %" PRIu64 "\n",
subgrp->split_from.update_group_id);
- vty_outln (vty, " Split from subgroup id: %" PRIu64 "",
+ vty_out (vty, " Split from subgroup id: %" PRIu64 "\n",
subgrp->split_from.subgroup_id);
}
- vty_outln (vty, " Join events: %u", subgrp->join_events);
- vty_outln (vty, " Prune events: %u",
+ vty_out (vty, " Join events: %u\n", subgrp->join_events);
+ vty_out (vty, " Prune events: %u\n",
subgrp->prune_events);
- vty_outln (vty, " Merge events: %u",
+ vty_out (vty, " Merge events: %u\n",
subgrp->merge_events);
- vty_outln (vty, " Split events: %u",
+ vty_out (vty, " Split events: %u\n",
subgrp->split_events);
- vty_outln (vty, " Update group switch events: %u",
+ vty_out (vty, " Update group switch events: %u\n",
subgrp->updgrp_switch_events);
- vty_outln (vty, " Peer refreshes combined: %u",
+ vty_out (vty, " Peer refreshes combined: %u\n",
subgrp->peer_refreshes_combined);
- vty_outln (vty, " Merge checks triggered: %u",
+ vty_out (vty, " Merge checks triggered: %u\n",
subgrp->merge_checks_triggered);
- vty_outln (vty, " Version: %" PRIu64 "", subgrp->version);
- vty_outln (vty, " Packet queue length: %d",
+ vty_out (vty, " Version: %" PRIu64 "\n", subgrp->version);
+ vty_out (vty, " Packet queue length: %d\n",
bpacket_queue_length(SUBGRP_PKTQ(subgrp)));
- vty_outln (vty, " Total packets enqueued: %u",
+ vty_out (vty, " Total packets enqueued: %u\n",
subgroup_total_packets_enqueued(subgrp));
- vty_outln (vty, " Packet queue high watermark: %d",
+ vty_out (vty, " Packet queue high watermark: %d\n",
bpacket_queue_hwm_length(SUBGRP_PKTQ(subgrp)));
- vty_outln (vty, " Adj-out list count: %u",
+ vty_out (vty, " Adj-out list count: %u\n",
subgrp->adj_count);
- vty_outln (vty, " Advertise list: %s",
+ vty_out (vty, " Advertise list: %s\n",
advertise_list_is_empty(subgrp) ? "empty" : "not empty");
- vty_outln (vty, " Flags: %s",
+ vty_out (vty, " Flags: %s\n",
CHECK_FLAG(subgrp->flags, SUBGRP_FLAG_NEEDS_REFRESH) ? "R" : "");
if (subgrp->peer_count > 0)
{
- vty_outln (vty, " Peers:");
+ vty_out (vty, " Peers:\n");
SUBGRP_FOREACH_PEER (subgrp, paf)
- vty_outln (vty, " - %s", paf->peer->host);
+ vty_out (vty, " - %s\n", paf->peer->host);
}
}
return UPDWALK_CONTINUE;
@@ -648,7 +648,7 @@ updgrp_show_packet_queue_walkcb (struct update_group *updgrp, void *arg)
{
if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue;
- vty_outln (vty, "update group %" PRIu64 ", subgroup %" PRIu64 "", updgrp->id,
+ vty_out (vty, "update group %" PRIu64 ", subgroup %" PRIu64 "\n", updgrp->id,
subgrp->id);
bpacket_queue_show_vty (SUBGRP_PKTQ (subgrp), vty);
}
@@ -1597,27 +1597,27 @@ update_group_show (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty,
void
update_group_show_stats (struct bgp *bgp, struct vty *vty)
{
- vty_outln (vty, "Update groups created: %u",
+ vty_out (vty, "Update groups created: %u\n",
bgp->update_group_stats.updgrps_created);
- vty_outln (vty, "Update groups deleted: %u",
+ vty_out (vty, "Update groups deleted: %u\n",
bgp->update_group_stats.updgrps_deleted);
- vty_outln (vty, "Update subgroups created: %u",
+ vty_out (vty, "Update subgroups created: %u\n",
bgp->update_group_stats.subgrps_created);
- vty_outln (vty, "Update subgroups deleted: %u",
+ vty_out (vty, "Update subgroups deleted: %u\n",
bgp->update_group_stats.subgrps_deleted);
- vty_outln (vty, "Join events: %u",
+ vty_out (vty, "Join events: %u\n",
bgp->update_group_stats.join_events);
- vty_outln (vty, "Prune events: %u",
+ vty_out (vty, "Prune events: %u\n",
bgp->update_group_stats.prune_events);
- vty_outln (vty, "Merge events: %u",
+ vty_out (vty, "Merge events: %u\n",
bgp->update_group_stats.merge_events);
- vty_outln (vty, "Split events: %u",
+ vty_out (vty, "Split events: %u\n",
bgp->update_group_stats.split_events);
- vty_outln (vty, "Update group switch events: %u",
+ vty_out (vty, "Update group switch events: %u\n",
bgp->update_group_stats.updgrp_switch_events);
- vty_outln (vty, "Peer route refreshes combined: %u",
+ vty_out (vty, "Peer route refreshes combined: %u\n",
bgp->update_group_stats.peer_refreshes_combined);
- vty_outln (vty, "Merge checks triggered: %u",
+ vty_out (vty, "Merge checks triggered: %u\n",
bgp->update_group_stats.merge_checks_triggered);
}
diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c
index c4cb8ae1b..6524e8435 100644
--- a/bgpd/bgp_updgrp_adv.c
+++ b/bgpd/bgp_updgrp_adv.c
@@ -226,16 +226,16 @@ subgrp_show_adjq_vty (struct update_subgroup *subgrp, struct vty *vty,
{
if (header1)
{
- vty_outln (vty,
- "BGP table version is %" PRIu64 ", local router ID is %s",
+ vty_out (vty,
+ "BGP table version is %" PRIu64 ", local router ID is %s\n",
table->version,inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
+ vty_out (vty, BGP_SHOW_SCODE_HEADER);
+ vty_out (vty, BGP_SHOW_OCODE_HEADER);
header1 = 0;
}
if (header2)
{
- vty_outln (vty, BGP_SHOW_HEADER);
+ vty_out (vty, BGP_SHOW_HEADER);
header2 = 0;
}
if ((flags & UPDWALK_FLAGS_ADVQUEUE) && adj->adv && adj->adv->baa)
@@ -250,8 +250,7 @@ subgrp_show_adjq_vty (struct update_subgroup *subgrp, struct vty *vty,
}
}
if (output_count != 0)
- vty_outln (vty, "%sTotal number of prefixes %ld",
- VTYNL, output_count);
+ vty_out (vty, "\nTotal number of prefixes %ld\n", output_count);
}
static int
@@ -266,7 +265,7 @@ updgrp_show_adj_walkcb (struct update_group *updgrp, void *arg)
{
if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue;
- vty_outln (vty, "update group %" PRIu64 ", subgroup %" PRIu64 "", updgrp->id,
+ vty_out (vty, "update group %" PRIu64 ", subgroup %" PRIu64 "\n", updgrp->id,
subgrp->id);
subgrp_show_adjq_vty (subgrp, vty, ctx->flags);
}
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c
index dff46a946..69debf7a4 100644
--- a/bgpd/bgp_updgrp_packet.c
+++ b/bgpd/bgp_updgrp_packet.c
@@ -392,12 +392,12 @@ bpacket_queue_show_vty (struct bpacket_queue *q, struct vty *vty)
pkt = bpacket_queue_first (q);
while (pkt)
{
- vty_outln (vty, " Packet %p ver %u buffer %p", pkt, pkt->ver,
+ vty_out (vty, " Packet %p ver %u buffer %p\n", pkt, pkt->ver,
pkt->buffer);
LIST_FOREACH (paf, &(pkt->peers), pkt_train)
{
- vty_outln (vty, " - %s", paf->peer->host);
+ vty_out (vty, " - %s\n", paf->peer->host);
}
pkt = bpacket_next (pkt);
}
diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c
index 3e6224395..c7f8ae3c0 100644
--- a/bgpd/bgp_vpn.c
+++ b/bgpd/bgp_vpn.c
@@ -51,7 +51,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd,
if (bgp == NULL)
{
if (!use_json)
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING;
}
@@ -104,13 +104,12 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd,
}
else
{
- vty_outln (vty, "BGP table version is 0, local router ID is %s",
+ vty_out (vty, "BGP table version is 0, local router ID is %s\n",
inet_ntoa(bgp->router_id));
- vty_outln (vty,
- "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal");
- vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s",
- VTYNL);
- vty_outln (vty, V4_HEADER);
+ vty_out (vty,
+ "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n");
+ vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n");
+ vty_out (vty, V4_HEADER);
}
header = 0;
}
@@ -170,7 +169,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd,
rd_vnc_eth.macaddr.octet[5]);
#endif
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
rd_header = 0;
}
@@ -191,7 +190,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd,
if (use_json)
{
json_object_object_add(json, "routes", json_routes);
- vty_outln (vty, "%s",
+ vty_out (vty, "%s\n",
json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
}
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 42db38f40..903793624 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -308,7 +308,7 @@ bgp_vty_find_and_parse_afi_safi_bgp (struct vty *vty, struct cmd_token **argv, i
*bgp = bgp_lookup_by_name (vrf_name);
if (!*bgp)
{
- vty_out (vty, "View/Vrf specified is unknown: %s%s", vrf_name, VTYNL);
+ vty_out (vty, "View/Vrf specified is unknown: %s\n", vrf_name);
*idx = 0;
return 0;
}
@@ -319,7 +319,7 @@ bgp_vty_find_and_parse_afi_safi_bgp (struct vty *vty, struct cmd_token **argv, i
*bgp = bgp_get_default ();
if (!*bgp)
{
- vty_out (vty, "Unable to find default BGP instance%s", VTYNL);
+ vty_out (vty, "Unable to find default BGP instance\n");
*idx = 0;
return 0;
}
@@ -373,7 +373,7 @@ peer_lookup_vty (struct vty *vty, const char *ip_str)
{
if ((peer = peer_lookup_by_hostname(bgp, ip_str)) == NULL)
{
- vty_out (vty, "%% Malformed address or name: %s%s", ip_str, VTYNL);
+ vty_out (vty, "%% Malformed address or name: %s\n", ip_str);
return NULL;
}
}
@@ -383,14 +383,12 @@ peer_lookup_vty (struct vty *vty, const char *ip_str)
peer = peer_lookup (bgp, &su);
if (! peer)
{
- vty_out (vty, "%% Specify remote-as or peer-group commands first%s",
- VTYNL);
+ vty_out (vty, "%% Specify remote-as or peer-group commands first\n");
return NULL;
}
if (peer_dynamic_neighbor (peer))
{
- vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s",
- VTYNL);
+ vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n");
return NULL;
}
@@ -433,8 +431,7 @@ peer_and_group_lookup_vty (struct vty *vty, const char *peer_str)
{
if (peer_dynamic_neighbor (peer))
{
- vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s",
- VTYNL);
+ vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n");
return NULL;
}
@@ -444,8 +441,7 @@ peer_and_group_lookup_vty (struct vty *vty, const char *peer_str)
if (group)
return group->conf;
- vty_out (vty, "%% Specify remote-as or peer-group commands first%s",
- VTYNL);
+ vty_out (vty, "%% Specify remote-as or peer-group commands first\n");
return NULL;
}
@@ -523,7 +519,7 @@ bgp_vty_return (struct vty *vty, int ret)
}
if (str)
{
- vty_out (vty, "%% %s%s", str, VTYNL);
+ vty_out (vty, "%% %s\n", str);
return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -547,11 +543,11 @@ bgp_clear_vty_error (struct vty *vty, struct peer *peer, afi_t afi,
{
case BGP_ERR_AF_UNCONFIGURED:
vty_out (vty,
- "%%BGP: Enable %s address family for the neighbor %s%s",
- afi_safi_print(afi, safi), peer->host, VTYNL);
+ "%%BGP: Enable %s address family for the neighbor %s\n",
+ afi_safi_print(afi, safi), peer->host);
break;
case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED:
- vty_out (vty, "%%BGP: Inbound soft reconfig for %s not possible as it%s has neither refresh capability, nor inbound soft reconfig%s", peer->host, VTYNL, VTYNL);
+ vty_out (vty, "%%BGP: Inbound soft reconfig for %s not possible as it\n has neither refresh capability, nor inbound soft reconfig\n", peer->host);
break;
default:
break;
@@ -610,7 +606,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
peer = peer_lookup_by_hostname(bgp, arg);
if (!peer)
{
- vty_out (vty, "Malformed address or name: %s%s", arg, VTYNL);
+ vty_out (vty, "Malformed address or name: %s\n", arg);
return CMD_WARNING;
}
}
@@ -620,7 +616,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
peer = peer_lookup (bgp, &su);
if (! peer)
{
- vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"%s", arg, VTYNL);
+ vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"\n", arg);
return CMD_WARNING;
}
}
@@ -644,7 +640,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
group = peer_group_lookup (bgp, arg);
if (! group)
{
- vty_out (vty, "%%BGP: No such peer-group %s%s", arg, VTYNL);
+ vty_out (vty, "%%BGP: No such peer-group %s\n", arg);
return CMD_WARNING;
}
@@ -707,8 +703,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
bgp_clear_vty_error (vty, peer, afi, safi, ret);
}
if (! find)
- vty_out (vty, "%%BGP: No peer is configured with AS %s%s", arg,
- VTYNL);
+ vty_out (vty, "%%BGP: No peer is configured with AS %s\n", arg);
return CMD_SUCCESS;
}
@@ -728,7 +723,7 @@ bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi,
bgp = bgp_lookup_by_name (name);
if (bgp == NULL)
{
- vty_out (vty, "Can't find BGP instance %s%s", name, VTYNL);
+ vty_out (vty, "Can't find BGP instance %s\n", name);
return CMD_WARNING;
}
}
@@ -737,7 +732,7 @@ bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi,
bgp = bgp_get_default ();
if (bgp == NULL)
{
- vty_out (vty, "No BGP process is configured%s", VTYNL);
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING;
}
}
@@ -794,7 +789,7 @@ DEFUN (no_bgp_multiple_instance,
ret = bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE);
if (ret < 0)
{
- vty_out (vty, "%% There are more than two BGP instances%s", VTYNL);
+ vty_out (vty, "%% There are more than two BGP instances\n");
return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -875,13 +870,13 @@ DEFUN_NOSH (router_bgp,
if (bgp == NULL)
{
- vty_out (vty, "%% No BGP process is configured%s", VTYNL);
+ vty_out (vty, "%% No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (listcount(bm->bgp) > 1)
{
- vty_out (vty, "%% Multiple BGP processes are configured%s", VTYNL);
+ vty_out (vty, "%% Multiple BGP processes are configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -906,16 +901,15 @@ DEFUN_NOSH (router_bgp,
switch (ret)
{
case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET:
- vty_out (vty, "Please specify 'bgp multiple-instance' first%s",
- VTYNL);
+ vty_out (vty, "Please specify 'bgp multiple-instance' first\n");
return CMD_WARNING_CONFIG_FAILED;
case BGP_ERR_AS_MISMATCH:
- vty_out (vty, "BGP is already running; AS is %u%s", as, VTYNL);
+ vty_out (vty, "BGP is already running; AS is %u\n", as);
return CMD_WARNING_CONFIG_FAILED;
case BGP_ERR_INSTANCE_MISMATCH:
- vty_out (vty, "BGP instance name and AS number mismatch%s", VTYNL);
- vty_out (vty, "BGP instance is already running; AS is %u%s",
- as, VTYNL);
+ vty_out (vty, "BGP instance name and AS number mismatch\n");
+ vty_out (vty, "BGP instance is already running; AS is %u\n",
+ as);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -951,13 +945,13 @@ DEFUN (no_router_bgp,
if (bgp == NULL)
{
- vty_out (vty, "%% No BGP process is configured%s", VTYNL);
+ vty_out (vty, "%% No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (listcount(bm->bgp) > 1)
{
- vty_out (vty, "%% Multiple BGP processes are configured%s", VTYNL);
+ vty_out (vty, "%% Multiple BGP processes are configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -972,7 +966,7 @@ DEFUN (no_router_bgp,
bgp = bgp_lookup (as, name);
if (! bgp)
{
- vty_out (vty, "%% Can't find BGP instance%s", VTYNL);
+ vty_out (vty, "%% Can't find BGP instance\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -1012,7 +1006,7 @@ DEFPY (no_bgp_router_id,
{
if (! IPV4_ADDR_SAME (&bgp->router_id_static, &router_id))
{
- vty_outln (vty, "%% BGP router-id doesn't match");
+ vty_out (vty, "%% BGP router-id doesn't match\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -1041,7 +1035,7 @@ DEFUN (bgp_cluster_id,
ret = inet_aton (argv[idx_ipv4]->arg, &cluster);
if (! ret)
{
- vty_out (vty, "%% Malformed bgp cluster identifier%s", VTYNL);
+ vty_out (vty, "%% Malformed bgp cluster identifier\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1120,8 +1114,7 @@ DEFUN (bgp_confederation_peers,
if (bgp->as == as)
{
- vty_out (vty, "%% Local member-AS not allowed in confed peer list%s",
- VTYNL);
+ vty_out (vty, "%% Local member-AS not allowed in confed peer list\n");
continue;
}
@@ -1189,10 +1182,10 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths,
if (ret < 0)
{
vty_out (vty,
- "%% Failed to %sset maximum-paths %s %u for afi %u, safi %u%s",
+ "%% Failed to %sset maximum-paths %s %u for afi %u, safi %u\n",
(set == 1) ? "" : "un",
(peer_type == BGP_PEER_EBGP) ? "ebgp" : "ibgp",
- maxpaths, afi, safi, VTYNL);
+ maxpaths, afi, safi);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1326,8 +1319,7 @@ bgp_update_delay_config_vty (struct vty *vty, const char *delay,
establish_wait = atoi (wait);
if (update_delay < establish_wait)
{
- vty_out (vty, "%%Failed: update-delay less than the establish-wait!%s",
- VTYNL);
+ vty_out (vty, "%%Failed: update-delay less than the establish-wait!\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1356,7 +1348,7 @@ bgp_config_write_update_delay (struct vty *vty, struct bgp *bgp)
vty_out (vty, " update-delay %d", bgp->v_update_delay);
if (bgp->v_update_delay != bgp->v_establish_wait)
vty_out (vty, " %d", bgp->v_establish_wait);
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
return 0;
@@ -1416,8 +1408,8 @@ int
bgp_config_write_wpkt_quanta (struct vty *vty, struct bgp *bgp)
{
if (bgp->wpkt_quanta != BGP_WRITE_PACKET_MAX)
- vty_out (vty, " write-quanta %d%s",
- bgp->wpkt_quanta, VTYNL);
+ vty_out (vty, " write-quanta %d\n",
+ bgp->wpkt_quanta);
return 0;
}
@@ -1450,8 +1442,8 @@ int
bgp_config_write_coalesce_time (struct vty *vty, struct bgp *bgp)
{
if (bgp->coalesce_time != BGP_DEFAULT_SUBGROUP_COALESCE_TIME)
- vty_out (vty, " coalesce-time %u%s",
- bgp->coalesce_time, VTYNL);
+ vty_out (vty, " coalesce-time %u\n",
+ bgp->coalesce_time);
return 0;
}
@@ -1585,8 +1577,8 @@ bgp_config_write_maxpaths (struct vty *vty, struct bgp *bgp, afi_t afi,
if (bgp->maxpaths[afi][safi].maxpaths_ebgp != MULTIPATH_NUM)
{
bgp_config_write_family_header (vty, afi, safi, write);
- vty_out (vty, " maximum-paths %d%s",
- bgp->maxpaths[afi][safi].maxpaths_ebgp, VTYNL);
+ vty_out (vty, " maximum-paths %d\n",
+ bgp->maxpaths[afi][safi].maxpaths_ebgp);
}
if (bgp->maxpaths[afi][safi].maxpaths_ibgp != MULTIPATH_NUM)
@@ -1597,7 +1589,7 @@ bgp_config_write_maxpaths (struct vty *vty, struct bgp *bgp, afi_t afi,
if (CHECK_FLAG (bgp->maxpaths[afi][safi].ibgp_flags,
BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN))
vty_out (vty, " equal-cluster-length");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
return 0;
@@ -1625,8 +1617,7 @@ DEFUN (bgp_timers,
/* Holdtime value check. */
if (holdtime < 3 && holdtime != 0)
{
- vty_out (vty, "%% hold time value must be either 0 or greater than 3%s",
- VTYNL);
+ vty_out (vty, "%% hold time value must be either 0 or greater than 3\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1760,8 +1751,7 @@ DEFUN (no_bgp_deterministic_med,
if (bestpath_per_as_used)
{
- vty_out (vty, "bgp deterministic-med cannot be disabled while addpath-tx-bestpath-per-AS is in use%s",
- VTYNL);
+ vty_out (vty, "bgp deterministic-med cannot be disabled while addpath-tx-bestpath-per-AS is in use\n");
return CMD_WARNING_CONFIG_FAILED;
}
else
@@ -2454,7 +2444,7 @@ DEFUN (bgp_listen_range,
ret = str2prefix (prefix, &range);
if (! ret)
{
- vty_out (vty, "%% Malformed listen range%s", VTYNL);
+ vty_out (vty, "%% Malformed listen range\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2462,8 +2452,7 @@ DEFUN (bgp_listen_range,
if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6))
{
- vty_out (vty, "%% Malformed listen range (link-local address)%s",
- VTYNL);
+ vty_out (vty, "%% Malformed listen range (link-local address)\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2477,8 +2466,8 @@ DEFUN (bgp_listen_range,
return CMD_SUCCESS;
else
{
- vty_out (vty, "%% Same listen range is attached to peer-group %s%s",
- existing_group->name, VTYNL);
+ vty_out (vty, "%% Same listen range is attached to peer-group %s\n",
+ existing_group->name);
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -2486,15 +2475,14 @@ DEFUN (bgp_listen_range,
/* Check if an overlapping listen range exists. */
if (listen_range_exists (bgp, &range, 0))
{
- vty_out (vty, "%% Listen range overlaps with existing listen range%s",
- VTYNL);
+ vty_out (vty, "%% Listen range overlaps with existing listen range\n");
return CMD_WARNING_CONFIG_FAILED;
}
group = peer_group_lookup (bgp, peergroup);
if (! group)
{
- vty_out (vty, "%% Configure the peer-group first%s", VTYNL);
+ vty_out (vty, "%% Configure the peer-group first\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2530,7 +2518,7 @@ DEFUN (no_bgp_listen_range,
ret = str2prefix (prefix, &range);
if (! ret)
{
- vty_out (vty, "%% Malformed listen range%s", VTYNL);
+ vty_out (vty, "%% Malformed listen range\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2538,8 +2526,7 @@ DEFUN (no_bgp_listen_range,
if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6))
{
- vty_out (vty, "%% Malformed listen range (link-local address)%s",
- VTYNL);
+ vty_out (vty, "%% Malformed listen range (link-local address)\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2548,7 +2535,7 @@ DEFUN (no_bgp_listen_range,
group = peer_group_lookup (bgp, peergroup);
if (! group)
{
- vty_out (vty, "%% Peer-group does not exist%s", VTYNL);
+ vty_out (vty, "%% Peer-group does not exist\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2566,8 +2553,8 @@ bgp_config_write_listen (struct vty *vty, struct bgp *bgp)
char buf[PREFIX2STR_BUFFER];
if (bgp->dynamic_neighbors_limit != BGP_DYNAMIC_NEIGHBORS_LIMIT_DEFAULT)
- vty_out (vty, " bgp listen limit %d%s",
- bgp->dynamic_neighbors_limit, VTYNL);
+ vty_out (vty, " bgp listen limit %d\n",
+ bgp->dynamic_neighbors_limit);
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
@@ -2576,8 +2563,8 @@ bgp_config_write_listen (struct vty *vty, struct bgp *bgp)
for (ALL_LIST_ELEMENTS (group->listen_range[afi], rnode, nrnode, range))
{
prefix2str(range, buf, sizeof(buf));
- vty_out(vty, " bgp listen range %s peer-group %s%s",
- buf, group->name, VTYNL);
+ vty_out(vty, " bgp listen range %s peer-group %s\n",
+ buf, group->name);
}
}
}
@@ -2651,8 +2638,7 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str,
ret = peer_group_remote_as (bgp, peer_str, &as, as_type);
if (ret < 0)
{
- vty_out (vty, "%% Create the peer-group or interface first%s",
- VTYNL);
+ vty_out (vty, "%% Create the peer-group or interface first\n");
return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -2662,8 +2648,7 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str,
{
if (peer_address_self_check (bgp, &su))
{
- vty_out (vty, "%% Can not configure the local system as neighbor%s",
- VTYNL);
+ vty_out (vty, "%% Can not configure the local system as neighbor\n");
return CMD_WARNING_CONFIG_FAILED;
}
ret = peer_remote_as (bgp, &su, NULL, &as, as_type, afi, safi);
@@ -2673,10 +2658,10 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str,
switch (ret)
{
case BGP_ERR_PEER_GROUP_MEMBER:
- vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as, VTYNL);
+ vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member\n", as);
return CMD_WARNING_CONFIG_FAILED;
case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT:
- vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external%s", as, as_str, VTYNL);
+ vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external\n", as, as_str);
return CMD_WARNING_CONFIG_FAILED;
}
return bgp_vty_return (vty, ret);
@@ -2714,7 +2699,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi,
if (group)
{
- vty_out (vty, "%% Name conflict with peer-group %s", VTYNL);
+ vty_out (vty, "%% Name conflict with peer-group \n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2754,7 +2739,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi,
if (!peer)
{
- vty_outln (vty, "%% BGP failed to create peer");
+ vty_out (vty, "%% BGP failed to create peer\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2797,7 +2782,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi,
group = peer_group_lookup (bgp, peer_group_name);
if (! group)
{
- vty_out (vty, "%% Configure the peer-group first%s", VTYNL);
+ vty_out (vty, "%% Configure the peer-group first\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2899,14 +2884,14 @@ DEFUN (neighbor_peer_group,
peer = peer_lookup_by_conf_if (bgp, argv[idx_word]->arg);
if (peer)
{
- vty_out (vty, "%% Name conflict with interface: %s", VTYNL);
+ vty_out (vty, "%% Name conflict with interface: \n");
return CMD_WARNING_CONFIG_FAILED;
}
group = peer_group_get (bgp, argv[idx_word]->arg);
if (! group)
{
- vty_outln (vty, "%% BGP failed to find or create peer-group");
+ vty_out (vty, "%% BGP failed to find or create peer-group\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2951,7 +2936,7 @@ DEFUN (no_neighbor,
peer_group_delete (group);
else
{
- vty_out (vty, "%% Create the peer-group first%s", VTYNL);
+ vty_out (vty, "%% Create the peer-group first\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -2962,8 +2947,7 @@ DEFUN (no_neighbor,
{
if (peer_dynamic_neighbor (peer))
{
- vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s",
- VTYNL);
+ vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3007,7 +2991,7 @@ DEFUN (no_neighbor_interface_config,
}
else
{
- vty_out (vty, "%% Create the bgp interface first%s", VTYNL);
+ vty_out (vty, "%% Create the bgp interface first\n");
return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -3030,7 +3014,7 @@ DEFUN (no_neighbor_peer_group,
peer_group_delete (group);
else
{
- vty_out (vty, "%% Create the peer-group first%s", VTYNL);
+ vty_out (vty, "%% Create the peer-group first\n");
return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -3065,7 +3049,7 @@ DEFUN (no_neighbor_interface_peer_group_remote_as,
peer_group_remote_as_delete (group);
else
{
- vty_out (vty, "%% Create the peer-group or interface first%s", VTYNL);
+ vty_out (vty, "%% Create the peer-group or interface first\n");
return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -3331,7 +3315,7 @@ DEFUN (neighbor_set_peer_group,
peer = peer_lookup_by_conf_if (bgp, argv[idx_peer]->arg);
if (!peer)
{
- vty_out (vty, "%% Malformed address or name: %s%s", argv[idx_peer]->arg, VTYNL);
+ vty_out (vty, "%% Malformed address or name: %s\n", argv[idx_peer]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -3339,8 +3323,7 @@ DEFUN (neighbor_set_peer_group,
{
if (peer_address_self_check (bgp, &su))
{
- vty_out (vty, "%% Can not configure the local system as neighbor%s",
- VTYNL);
+ vty_out (vty, "%% Can not configure the local system as neighbor\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3348,8 +3331,7 @@ DEFUN (neighbor_set_peer_group,
peer = peer_lookup (bgp, &su);
if (peer && peer_dynamic_neighbor (peer))
{
- vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s",
- VTYNL);
+ vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -3357,7 +3339,7 @@ DEFUN (neighbor_set_peer_group,
group = peer_group_lookup (bgp, argv[idx_word]->arg);
if (! group)
{
- vty_out (vty, "%% Configure the peer-group first%s", VTYNL);
+ vty_out (vty, "%% Configure the peer-group first\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3365,7 +3347,7 @@ DEFUN (neighbor_set_peer_group,
if (ret == BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT)
{
- vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external%s", as, VTYNL);
+ vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external\n", as);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3403,7 +3385,7 @@ DEFUN (no_neighbor_set_peer_group,
group = peer_group_lookup (bgp, argv[idx_word]->arg);
if (! group)
{
- vty_out (vty, "%% Configure the peer-group first%s", VTYNL);
+ vty_out (vty, "%% Configure the peer-group first\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3438,7 +3420,7 @@ peer_flag_modify_vty (struct vty *vty, const char *ip_str,
*/
if (peer->conf_if && (flag == PEER_FLAG_DISABLE_CONNECTED_CHECK)) {
vty_out (vty, "%s is directly connected peer, cannot accept disable-"
- "connected-check%s", ip_str, VTYNL);
+ "connected-check\n", ip_str);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3680,7 +3662,7 @@ DEFUN (neighbor_capability_orf_prefix,
flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM;
else
{
- vty_outln (vty, "%% BGP invalid orf prefix-list option");
+ vty_out (vty, "%% BGP invalid orf prefix-list option\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3725,7 +3707,7 @@ DEFUN (no_neighbor_capability_orf_prefix,
flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM;
else
{
- vty_outln (vty, "%% BGP invalid orf prefix-list option");
+ vty_out (vty, "%% BGP invalid orf prefix-list option\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4649,8 +4631,7 @@ peer_update_source_vty (struct vty *vty, const char *peer_str,
{
if (str2prefix (source_str, &p))
{
- vty_out (vty, "%% Invalid update-source, remove prefix length %s",
- VTYNL);
+ vty_out (vty, "%% Invalid update-source, remove prefix length \n");
return CMD_WARNING_CONFIG_FAILED;
}
else
@@ -5178,7 +5159,7 @@ DEFUN (bgp_set_route_map_delay_timer,
}
else
{
- vty_outln (vty, "%% BGP invalid route-map delay-timer");
+ vty_out (vty, "%% BGP invalid route-map delay-timer\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -5208,7 +5189,7 @@ peer_interface_vty (struct vty *vty, const char *ip_str, const char *str)
peer = peer_lookup_vty (vty, ip_str);
if (! peer || peer->conf_if)
{
- vty_outln (vty, "%% BGP invalid peer %s", ip_str);
+ vty_out (vty, "%% BGP invalid peer %s\n", ip_str);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -6067,8 +6048,8 @@ DEFUN (neighbor_ttl_security,
* we should not accept a ttl-security hops value greater than 1.
*/
if (peer->conf_if && (gtsm_hops > 1)) {
- vty_out (vty, "%s is directly connected peer, hops cannot exceed 1%s",
- argv[idx_peer]->arg, VTYNL);
+ vty_out (vty, "%s is directly connected peer, hops cannot exceed 1\n",
+ argv[idx_peer]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -6300,7 +6281,7 @@ bgp_clear_prefix (struct vty *vty, const char *view_name, const char *ip_str,
bgp = bgp_lookup_by_name (view_name);
if (bgp == NULL)
{
- vty_out (vty, "%% Can't find BGP instance %s%s", view_name, VTYNL);
+ vty_out (vty, "%% Can't find BGP instance %s\n", view_name);
return CMD_WARNING;
}
}
@@ -6309,7 +6290,7 @@ bgp_clear_prefix (struct vty *vty, const char *view_name, const char *ip_str,
bgp = bgp_get_default ();
if (bgp == NULL)
{
- vty_out (vty, "%% No BGP process is configured%s", VTYNL);
+ vty_out (vty, "%% No BGP process is configured\n");
return CMD_WARNING;
}
}
@@ -6318,7 +6299,7 @@ bgp_clear_prefix (struct vty *vty, const char *view_name, const char *ip_str,
ret = str2prefix (ip_str, &match);
if (! ret)
{
- vty_out (vty, "%% address is malformed%s", VTYNL);
+ vty_out (vty, "%% address is malformed\n");
return CMD_WARNING;
}
@@ -6544,19 +6525,19 @@ DEFUN (show_bgp_views,
if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE))
{
- vty_out (vty, "BGP Multiple Instance is not enabled%s", VTYNL);
+ vty_out (vty, "BGP Multiple Instance is not enabled\n");
return CMD_WARNING;
}
- vty_out (vty, "Defined BGP views:%s", VTYNL);
+ vty_out (vty, "Defined BGP views:\n");
for (ALL_LIST_ELEMENTS_RO(inst, node, bgp))
{
/* Skip VRFs. */
if (bgp->inst_type == BGP_INSTANCE_TYPE_VRF)
continue;
- vty_out (vty, "\t%s (AS%u)%s",
+ vty_out (vty, "\t%s (AS%u)\n",
bgp->name ? bgp->name : "(null)",
- bgp->as, VTYNL);
+ bgp->as);
}
return CMD_SUCCESS;
@@ -6582,7 +6563,7 @@ DEFUN (show_bgp_vrfs,
if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE))
{
- vty_out (vty, "BGP Multiple Instance is not enabled%s", VTYNL);
+ vty_out (vty, "BGP Multiple Instance is not enabled\n");
return CMD_WARNING;
}
@@ -6607,7 +6588,7 @@ DEFUN (show_bgp_vrfs,
count++;
if (!uj && count == 1)
- vty_out (vty, "%s%s", header, VTYNL);
+ vty_out (vty, "%s\n", header);
peers_cfg = peers_estb = 0;
if (uj)
@@ -6646,10 +6627,9 @@ DEFUN (show_bgp_vrfs,
json_object_object_add(json_vrfs, name, json_vrf);
}
else
- vty_out (vty, "%4s %-5d %-16s %9u %10u %s%s",
+ vty_out (vty, "%4s %-5d %-16s %9u %10u %s\n",
type, vrf_id_ui, inet_ntoa (bgp->router_id),
- peers_cfg, peers_estb, name,
- VTYNL);
+ peers_cfg, peers_estb, name);
}
if (uj)
@@ -6658,14 +6638,13 @@ DEFUN (show_bgp_vrfs,
json_object_int_add(json, "totalVrfs", count);
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
+ vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
}
else
{
if (count)
- vty_out (vty, "%sTotal number of VRFs (including default): %d%s",
- VTYNL, count, VTYNL);
+ vty_out (vty, "\nTotal number of VRFs (including default): %d\n", count);
}
return CMD_SUCCESS;
@@ -6684,139 +6663,117 @@ DEFUN (show_bgp_memory,
/* RIB related usage stats */
count = mtype_stats_alloc (MTYPE_BGP_NODE);
- vty_out (vty, "%ld RIB nodes, using %s of memory%s", count,
+ vty_out (vty, "%ld RIB nodes, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bgp_node)),
- VTYNL);
+ count * sizeof (struct bgp_node)));
count = mtype_stats_alloc (MTYPE_BGP_ROUTE);
- vty_out (vty, "%ld BGP routes, using %s of memory%s", count,
+ vty_out (vty, "%ld BGP routes, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bgp_info)),
- VTYNL);
+ count * sizeof (struct bgp_info)));
if ((count = mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA)))
- vty_out (vty, "%ld BGP route ancillaries, using %s of memory%s", count,
+ vty_out (vty, "%ld BGP route ancillaries, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bgp_info_extra)),
- VTYNL);
+ count * sizeof (struct bgp_info_extra)));
if ((count = mtype_stats_alloc (MTYPE_BGP_STATIC)))
- vty_out (vty, "%ld Static routes, using %s of memory%s", count,
+ vty_out (vty, "%ld Static routes, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bgp_static)),
- VTYNL);
+ count * sizeof (struct bgp_static)));
if ((count = mtype_stats_alloc (MTYPE_BGP_PACKET)))
- vty_out (vty, "%ld Packets, using %s of memory%s", count,
+ vty_out (vty, "%ld Packets, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bpacket)),
- VTYNL);
+ count * sizeof (struct bpacket)));
/* Adj-In/Out */
if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_IN)))
- vty_out (vty, "%ld Adj-In entries, using %s of memory%s", count,
+ vty_out (vty, "%ld Adj-In entries, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bgp_adj_in)),
- VTYNL);
+ count * sizeof (struct bgp_adj_in)));
if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_OUT)))
- vty_out (vty, "%ld Adj-Out entries, using %s of memory%s", count,
+ vty_out (vty, "%ld Adj-Out entries, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bgp_adj_out)),
- VTYNL);
+ count * sizeof (struct bgp_adj_out)));
if ((count = mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE)))
- vty_out (vty, "%ld Nexthop cache entries, using %s of memory%s", count,
+ vty_out (vty, "%ld Nexthop cache entries, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bgp_nexthop_cache)),
- VTYNL);
+ count * sizeof (struct bgp_nexthop_cache)));
if ((count = mtype_stats_alloc (MTYPE_BGP_DAMP_INFO)))
- vty_out (vty, "%ld Dampening entries, using %s of memory%s", count,
+ vty_out (vty, "%ld Dampening entries, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct bgp_damp_info)),
- VTYNL);
+ count * sizeof (struct bgp_damp_info)));
/* Attributes */
count = attr_count();
- vty_out (vty, "%ld BGP attributes, using %s of memory%s", count,
+ vty_out (vty, "%ld BGP attributes, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof(struct attr)),
- VTYNL);
+ count * sizeof(struct attr)));
if ((count = mtype_stats_alloc (MTYPE_ATTR_EXTRA)))
- vty_out (vty, "%ld BGP extra attributes, using %s of memory%s", count,
+ vty_out (vty, "%ld BGP extra attributes, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof(struct attr_extra)),
- VTYNL);
+ count * sizeof(struct attr_extra)));
if ((count = attr_unknown_count()))
- vty_out (vty, "%ld unknown attributes%s", count, VTYNL);
+ vty_out (vty, "%ld unknown attributes\n", count);
/* AS_PATH attributes */
count = aspath_count ();
- vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory%s", count,
+ vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct aspath)),
- VTYNL);
+ count * sizeof (struct aspath)));
count = mtype_stats_alloc (MTYPE_AS_SEG);
- vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory%s", count,
+ vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct assegment)),
- VTYNL);
+ count * sizeof (struct assegment)));
/* Other attributes */
if ((count = community_count ()))
- vty_out (vty, "%ld BGP community entries, using %s of memory%s", count,
+ vty_out (vty, "%ld BGP community entries, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct community)),
- VTYNL);
+ count * sizeof (struct community)));
if ((count = mtype_stats_alloc (MTYPE_ECOMMUNITY)))
- vty_out (vty, "%ld BGP community entries, using %s of memory%s", count,
+ vty_out (vty, "%ld BGP community entries, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct ecommunity)),
- VTYNL);
+ count * sizeof (struct ecommunity)));
if ((count = mtype_stats_alloc (MTYPE_LCOMMUNITY)))
- vty_out (vty, "%ld BGP large-community entries, using %s of memory%s",
+ vty_out (vty, "%ld BGP large-community entries, using %s of memory\n",
count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct lcommunity)),
- VTYNL);
+ count * sizeof (struct lcommunity)));
if ((count = mtype_stats_alloc (MTYPE_CLUSTER)))
- vty_out (vty, "%ld Cluster lists, using %s of memory%s", count,
+ vty_out (vty, "%ld Cluster lists, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct cluster_list)),
- VTYNL);
+ count * sizeof (struct cluster_list)));
/* Peer related usage */
count = mtype_stats_alloc (MTYPE_BGP_PEER);
- vty_out (vty, "%ld peers, using %s of memory%s", count,
+ vty_out (vty, "%ld peers, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct peer)),
- VTYNL);
+ count * sizeof (struct peer)));
if ((count = mtype_stats_alloc (MTYPE_PEER_GROUP)))
- vty_out (vty, "%ld peer groups, using %s of memory%s", count,
+ vty_out (vty, "%ld peer groups, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct peer_group)),
- VTYNL);
+ count * sizeof (struct peer_group)));
/* Other */
if ((count = mtype_stats_alloc (MTYPE_HASH)))
- vty_out (vty, "%ld hash tables, using %s of memory%s", count,
+ vty_out (vty, "%ld hash tables, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct hash)),
- VTYNL);
+ count * sizeof (struct hash)));
if ((count = mtype_stats_alloc (MTYPE_HASH_BACKET)))
- vty_out (vty, "%ld hash buckets, using %s of memory%s", count,
+ vty_out (vty, "%ld hash buckets, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (struct hash_backet)),
- VTYNL);
+ count * sizeof (struct hash_backet)));
if ((count = mtype_stats_alloc (MTYPE_BGP_REGEXP)))
- vty_out (vty, "%ld compiled regexes, using %s of memory%s", count,
+ vty_out (vty, "%ld compiled regexes, using %s of memory\n", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- count * sizeof (regex_t)),
- VTYNL);
+ count * sizeof (regex_t)));
return CMD_SUCCESS;
}
@@ -6917,7 +6874,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
vty_out (vty,
"BGP router identifier %s, local AS number %u vrf-id %d",
inet_ntoa (bgp->router_id), bgp->as, vrf_id_ui);
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
if (bgp_update_delay_configured(bgp))
@@ -6951,30 +6908,30 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
}
else
{
- vty_out (vty, "Read-only mode update-delay limit: %d seconds%s",
- bgp->v_update_delay, VTYNL);
+ vty_out (vty, "Read-only mode update-delay limit: %d seconds\n",
+ bgp->v_update_delay);
if (bgp->v_update_delay != bgp->v_establish_wait)
- vty_out (vty, " Establish wait: %d seconds%s",
- bgp->v_establish_wait, VTYNL);
+ vty_out (vty, " Establish wait: %d seconds\n",
+ bgp->v_establish_wait);
if (bgp_update_delay_active(bgp))
{
- vty_out (vty, " First neighbor established: %s%s",
- bgp->update_delay_begin_time, VTYNL);
- vty_out (vty, " Delay in progress%s", VTYNL);
+ vty_out (vty, " First neighbor established: %s\n",
+ bgp->update_delay_begin_time);
+ vty_out (vty, " Delay in progress\n");
}
else
{
if (bgp->update_delay_over)
{
- vty_out (vty, " First neighbor established: %s%s",
- bgp->update_delay_begin_time, VTYNL);
- vty_out (vty, " Best-paths resumed: %s%s",
- bgp->update_delay_end_time, VTYNL);
- vty_out (vty, " zebra update resumed: %s%s",
- bgp->update_delay_zebra_resume_time, VTYNL);
- vty_out (vty, " peers update resumed: %s%s",
- bgp->update_delay_peers_resume_time, VTYNL);
+ vty_out (vty, " First neighbor established: %s\n",
+ bgp->update_delay_begin_time);
+ vty_out (vty, " Best-paths resumed: %s\n",
+ bgp->update_delay_end_time);
+ vty_out (vty, " zebra update resumed: %s\n",
+ bgp->update_delay_zebra_resume_time);
+ vty_out (vty, " peers update resumed: %s\n",
+ bgp->update_delay_peers_resume_time);
}
}
}
@@ -7009,41 +6966,38 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
else
{
if (bgp_maxmed_onstartup_configured(bgp) && bgp->maxmed_active)
- vty_out (vty, "Max-med on-startup active%s", VTYNL);
+ vty_out (vty, "Max-med on-startup active\n");
if (bgp->v_maxmed_admin)
- vty_out (vty, "Max-med administrative active%s", VTYNL);
+ vty_out (vty, "Max-med administrative active\n");
- vty_out(vty, "BGP table version %" PRIu64 "%s",
- bgp_table_version(bgp->rib[afi][safi]), VTYNL);
+ vty_out(vty, "BGP table version %" PRIu64 "\n",
+ bgp_table_version(bgp->rib[afi][safi]));
ents = bgp_table_count (bgp->rib[afi][safi]);
- vty_out (vty, "RIB entries %ld, using %s of memory%s", ents,
+ vty_out (vty, "RIB entries %ld, using %s of memory\n", ents,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- ents * sizeof (struct bgp_node)),
- VTYNL);
+ ents * sizeof (struct bgp_node)));
/* Peer related usage */
ents = listcount (bgp->peer);
- vty_out (vty, "Peers %ld, using %s of memory%s",
+ vty_out (vty, "Peers %ld, using %s of memory\n",
ents,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- ents * sizeof (struct peer)),
- VTYNL);
+ ents * sizeof (struct peer)));
if ((ents = listcount (bgp->group)))
- vty_out (vty, "Peer groups %ld, using %s of memory%s", ents,
+ vty_out (vty, "Peer groups %ld, using %s of memory\n", ents,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
- ents * sizeof (struct peer_group)),
- VTYNL);
+ ents * sizeof (struct peer_group)));
if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
- vty_out (vty, "Dampening enabled.%s", VTYNL);
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "Dampening enabled.\n");
+ vty_out (vty, "\n");
/* Subtract 8 here because 'Neighbor' is 8 characters */
vty_out (vty, "Neighbor");
vty_out (vty, "%*s", max_neighbor_width - 8, " ");
- vty_out (vty, "V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd%s", VTYNL);
+ vty_out (vty, "V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd\n");
}
}
@@ -7138,7 +7092,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
else
vty_out (vty, " %12s", lookup_msg(bgp_status_msg, peer->status, NULL));
}
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -7150,30 +7104,30 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
json_object_int_add(json, "totalPeers", count);
json_object_int_add(json, "dynamicPeers", dn_count);
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
+ vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
}
else
{
if (count)
- vty_out (vty, "%sTotal number of neighbors %d%s", VTYNL,
- count, VTYNL);
+ vty_out (vty, "\nTotal number of neighbors %d\n",
+ count);
else
{
if (use_json)
- vty_out(vty, "{\"error\": {\"message\": \"No %s neighbor configured\"}}%s",
- afi_safi_print(afi, safi), VTYNL);
+ vty_out(vty, "{\"error\": {\"message\": \"No %s neighbor configured\"}}\n",
+ afi_safi_print(afi, safi));
else
- vty_out (vty, "No %s neighbor is configured%s",
- afi_safi_print(afi, safi), VTYNL);
+ vty_out (vty, "No %s neighbor is configured\n",
+ afi_safi_print(afi, safi));
}
if (dn_count && ! use_json)
{
- vty_out(vty, "* - dynamic neighbor%s", VTYNL);
+ vty_out(vty, "* - dynamic neighbor\n");
vty_out(vty,
- "%d dynamic neighbor(s), limit %d%s",
- dn_count, bgp->dynamic_neighbors_limit, VTYNL);
+ "%d dynamic neighbor(s), limit %d\n",
+ dn_count, bgp->dynamic_neighbors_limit);
}
}
@@ -7212,7 +7166,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi,
bool json_output = false;
if (use_json && is_wildcard)
- vty_out (vty, "{%s", VTYNL);
+ vty_out (vty, "{\n");
if (afi_wildcard)
afi = 1; /* AFI_IP */
while (afi < AFI_MAX)
@@ -7235,7 +7189,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi,
json = json_object_new_object();
if (! is_first)
- vty_out (vty, ",%s", VTYNL);
+ vty_out (vty, ",\n");
else
is_first = 0;
@@ -7243,8 +7197,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi,
}
else
{
- vty_out (vty, "%s%s Summary:%s",
- VTYNL, afi_safi_print(afi, safi), VTYNL);
+ vty_out (vty, "\n%s Summary:\n", afi_safi_print(afi, safi));
}
}
bgp_show_summary (vty, bgp, afi, safi, use_json, json);
@@ -7263,9 +7216,9 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi,
}
if (use_json && is_wildcard)
- vty_out (vty, "}%s", VTYNL);
+ vty_out (vty, "}\n");
else if (use_json && !json_output)
- vty_out (vty, "{}%s", VTYNL);
+ vty_out (vty, "{}\n");
}
static void
@@ -7278,7 +7231,7 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi,
int is_first = 1;
if (use_json)
- vty_out (vty, "{%s", VTYNL);
+ vty_out (vty, "{\n");
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
@@ -7287,7 +7240,7 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi,
json = json_object_new_object();
if (! is_first)
- vty_out (vty, ",%s", VTYNL);
+ vty_out (vty, ",\n");
else
is_first = 0;
@@ -7296,16 +7249,15 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi,
}
else
{
- vty_out (vty, "%sInstance %s:%s",
- VTYNL,
+ vty_out (vty, "\nInstance %s:\n",
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
- ? "Default" : bgp->name, VTYNL);
+ ? "Default" : bgp->name);
}
bgp_show_summary_afi_safi (vty, bgp, afi, safi, use_json, json);
}
if (use_json)
- vty_out (vty, "}%s", VTYNL);
+ vty_out (vty, "}\n");
}
@@ -7329,9 +7281,9 @@ bgp_show_summary_vty (struct vty *vty, const char *name,
if (! bgp)
{
if (use_json)
- vty_out (vty, "{}%s", VTYNL);
+ vty_out (vty, "{}\n");
else
- vty_out (vty, "%% No such BGP instance exist%s", VTYNL);
+ vty_out (vty, "%% No such BGP instance exist\n");
return CMD_WARNING;
}
@@ -7482,7 +7434,7 @@ bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p, afi_t afi, safi_t sa
vty_out (vty, "%sreceived",
CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) ?
", " : "");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
}
@@ -7508,7 +7460,7 @@ bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p, afi_t afi, safi_t sa
vty_out (vty, "%sreceived",
CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) ?
", " : "");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -7713,23 +7665,22 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi,
{
filter = &p->filter[afi][safi];
- vty_out (vty, " For address family: %s%s", afi_safi_print (afi, safi),
- VTYNL);
+ vty_out (vty, " For address family: %s\n", afi_safi_print (afi, safi));
if (peer_group_active(p))
- vty_out (vty, " %s peer-group member%s", p->group->name, VTYNL);
+ vty_out (vty, " %s peer-group member\n", p->group->name);
paf = peer_af_find(p, afi, safi);
if (paf && PAF_SUBGRP(paf))
{
- vty_out (vty, " Update group %" PRIu64 ", subgroup %" PRIu64 "%s",
- PAF_UPDGRP(paf)->id, PAF_SUBGRP(paf)->id, VTYNL);
- vty_out (vty, " Packet Queue length %d%s",
- bpacket_queue_virtual_length(paf), VTYNL);
+ vty_out (vty, " Update group %" PRIu64 ", subgroup %" PRIu64 "\n",
+ PAF_UPDGRP(paf)->id, PAF_SUBGRP(paf)->id);
+ vty_out (vty, " Packet Queue length %d\n",
+ bpacket_queue_virtual_length(paf));
}
else
{
- vty_out(vty, " Not part of any update group%s", VTYNL);
+ vty_out(vty, " Not part of any update group\n");
}
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV)
@@ -7737,15 +7688,15 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi,
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))
- vty_out (vty, " AF-dependant capabilities:%s", VTYNL);
+ vty_out (vty, " AF-dependant capabilities:\n");
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV))
{
- vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
- ORF_TYPE_PREFIX, VTYNL);
+ vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:\n",
+ ORF_TYPE_PREFIX);
bgp_show_peer_afi_orf_cap (vty, p, afi, safi,
PEER_CAP_ORF_PREFIX_SM_ADV,
PEER_CAP_ORF_PREFIX_RM_ADV,
@@ -7757,8 +7708,8 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi,
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))
{
- vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
- ORF_TYPE_PREFIX_OLD, VTYNL);
+ vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:\n",
+ ORF_TYPE_PREFIX_OLD);
bgp_show_peer_afi_orf_cap (vty, p, afi, safi,
PEER_CAP_ORF_PREFIX_SM_ADV,
PEER_CAP_ORF_PREFIX_RM_ADV,
@@ -7777,45 +7728,45 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi,
vty_out (vty, " sent;");
if (orf_pfx_count)
vty_out (vty, " received (%d entries)", orf_pfx_count);
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH))
- vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTYNL);
+ vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT))
- vty_out (vty, " Route-Reflector Client%s", VTYNL);
+ vty_out (vty, " Route-Reflector Client\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))
- vty_out (vty, " Route-Server Client%s", VTYNL);
+ vty_out (vty, " Route-Server Client\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG))
- vty_out (vty, " Inbound soft reconfiguration allowed%s", VTYNL);
+ vty_out (vty, " Inbound soft reconfiguration allowed\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE))
- vty_out (vty, " Private AS numbers (all) replaced in updates to this neighbor%s", VTYNL);
+ vty_out (vty, " Private AS numbers (all) replaced in updates to this neighbor\n");
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE))
- vty_out (vty, " Private AS numbers replaced in updates to this neighbor%s", VTYNL);
+ vty_out (vty, " Private AS numbers replaced in updates to this neighbor\n");
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_ALL))
- vty_out (vty, " Private AS numbers (all) removed in updates to this neighbor%s", VTYNL);
+ vty_out (vty, " Private AS numbers (all) removed in updates to this neighbor\n");
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS))
- vty_out (vty, " Private AS numbers removed in updates to this neighbor%s", VTYNL);
+ vty_out (vty, " Private AS numbers removed in updates to this neighbor\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_ADDPATH_TX_ALL_PATHS))
- vty_out (vty, " Advertise all paths via addpath%s", VTYNL);
+ vty_out (vty, " Advertise all paths via addpath\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS))
- vty_out (vty, " Advertise bestpath per AS via addpath%s", VTYNL);
+ vty_out (vty, " Advertise bestpath per AS via addpath\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_OVERRIDE))
- vty_out (vty, " Override ASNs in outbound updates if aspath equals remote-as%s", VTYNL);
+ vty_out (vty, " Override ASNs in outbound updates if aspath equals remote-as\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF) ||
CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_FORCE_NEXTHOP_SELF))
- vty_out (vty, " NEXT_HOP is always this router%s", VTYNL);
+ vty_out (vty, " NEXT_HOP is always this router\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED))
- vty_out (vty, " AS_PATH is propagated unchanged to this neighbor%s", VTYNL);
+ vty_out (vty, " AS_PATH is propagated unchanged to this neighbor\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED))
- vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor%s", VTYNL);
+ vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MED_UNCHANGED))
- vty_out (vty, " MED is propagated unchanged to this neighbor%s", VTYNL);
+ vty_out (vty, " MED is propagated unchanged to this neighbor\n");
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
|| CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
|| CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
@@ -7824,13 +7775,13 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi,
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
&& CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
&& CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
- vty_out (vty, "(all)%s", VTYNL);
+ vty_out (vty, "(all)\n");
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
- vty_out (vty, "(large)%s", VTYNL);
+ vty_out (vty, "(large)\n");
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY))
- vty_out (vty, "(extended)%s", VTYNL);
+ vty_out (vty, "(extended)\n");
else
- vty_out (vty, "(standard)%s", VTYNL);
+ vty_out (vty, "(standard)\n");
}
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_DEFAULT_ORIGINATE))
{
@@ -7841,94 +7792,86 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi,
p->default_rmap[afi][safi].map ? "*" : "",
p->default_rmap[afi][safi].name);
if (paf && PAF_SUBGRP(paf) && CHECK_FLAG(PAF_SUBGRP(paf)->sflags, SUBGRP_STATUS_DEFAULT_ORIGINATE))
- vty_out (vty, " default sent%s", VTYNL);
+ vty_out (vty, " default sent\n");
else
- vty_out (vty, " default not sent%s", VTYNL);
+ vty_out (vty, " default not sent\n");
}
if (filter->plist[FILTER_IN].name
|| filter->dlist[FILTER_IN].name
|| filter->aslist[FILTER_IN].name
|| filter->map[RMAP_IN].name)
- vty_out (vty, " Inbound path policy configured%s", VTYNL);
+ vty_out (vty, " Inbound path policy configured\n");
if (filter->plist[FILTER_OUT].name
|| filter->dlist[FILTER_OUT].name
|| filter->aslist[FILTER_OUT].name
|| filter->map[RMAP_OUT].name
|| filter->usmap.name)
- vty_out (vty, " Outbound path policy configured%s", VTYNL);
+ vty_out (vty, " Outbound path policy configured\n");
/* prefix-list */
if (filter->plist[FILTER_IN].name)
- vty_out (vty, " Incoming update prefix filter list is %s%s%s",
+ vty_out (vty, " Incoming update prefix filter list is %s%s\n",
filter->plist[FILTER_IN].plist ? "*" : "",
- filter->plist[FILTER_IN].name,
- VTYNL);
+ filter->plist[FILTER_IN].name);
if (filter->plist[FILTER_OUT].name)
- vty_out (vty, " Outgoing update prefix filter list is %s%s%s",
+ vty_out (vty, " Outgoing update prefix filter list is %s%s\n",
filter->plist[FILTER_OUT].plist ? "*" : "",
- filter->plist[FILTER_OUT].name,
- VTYNL);
+ filter->plist[FILTER_OUT].name);
/* distribute-list */
if (filter->dlist[FILTER_IN].name)
- vty_out (vty, " Incoming update network filter list is %s%s%s",
+ vty_out (vty, " Incoming update network filter list is %s%s\n",
filter->dlist[FILTER_IN].alist ? "*" : "",
- filter->dlist[FILTER_IN].name,
- VTYNL);
+ filter->dlist[FILTER_IN].name);
if (filter->dlist[FILTER_OUT].name)
- vty_out (vty, " Outgoing update network filter list is %s%s%s",
+ vty_out (vty, " Outgoing update network filter list is %s%s\n",
filter->dlist[FILTER_OUT].alist ? "*" : "",
- filter->dlist[FILTER_OUT].name,
- VTYNL);
+ filter->dlist[FILTER_OUT].name);
/* filter-list. */
if (filter->aslist[FILTER_IN].name)
- vty_out (vty, " Incoming update AS path filter list is %s%s%s",
+ vty_out (vty, " Incoming update AS path filter list is %s%s\n",
filter->aslist[FILTER_IN].aslist ? "*" : "",
- filter->aslist[FILTER_IN].name,
- VTYNL);
+ filter->aslist[FILTER_IN].name);
if (filter->aslist[FILTER_OUT].name)
- vty_out (vty, " Outgoing update AS path filter list is %s%s%s",
+ vty_out (vty, " Outgoing update AS path filter list is %s%s\n",
filter->aslist[FILTER_OUT].aslist ? "*" : "",
- filter->aslist[FILTER_OUT].name,
- VTYNL);
+ filter->aslist[FILTER_OUT].name);
/* route-map. */
if (filter->map[RMAP_IN].name)
- vty_out (vty, " Route map for incoming advertisements is %s%s%s",
+ vty_out (vty, " Route map for incoming advertisements is %s%s\n",
filter->map[RMAP_IN].map ? "*" : "",
- filter->map[RMAP_IN].name,
- VTYNL);
+ filter->map[RMAP_IN].name);
if (filter->map[RMAP_OUT].name)
- vty_out (vty, " Route map for outgoing advertisements is %s%s%s",
+ vty_out (vty, " Route map for outgoing advertisements is %s%s\n",
filter->map[RMAP_OUT].map ? "*" : "",
- filter->map[RMAP_OUT].name,
- VTYNL);
+ filter->map[RMAP_OUT].name);
/* unsuppress-map */
if (filter->usmap.name)
- vty_out (vty, " Route map for selective unsuppress is %s%s%s",
+ vty_out (vty, " Route map for selective unsuppress is %s%s\n",
filter->usmap.map ? "*" : "",
- filter->usmap.name, VTYNL);
+ filter->usmap.name);
/* Receive prefix count */
- vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTYNL);
+ vty_out (vty, " %ld accepted prefixes\n", p->pcount[afi][safi]);
/* Maximum prefix */
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX))
{
- vty_out (vty, " Maximum prefixes allowed %ld%s%s", p->pmax[afi][safi],
+ vty_out (vty, " Maximum prefixes allowed %ld%s\n", p->pmax[afi][safi],
CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING)
- ? " (warning-only)" : "", VTYNL);
+ ? " (warning-only)" : "");
vty_out (vty, " Threshold for warning message %d%%",
p->pmax_threshold[afi][safi]);
if (p->pmax_restart[afi][safi])
vty_out (vty, ", restart interval %d min", p->pmax_restart[afi][safi]);
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
}
@@ -8015,9 +7958,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
else
{
if (CHECK_FLAG(bgp->config, BGP_CONFIG_CONFEDERATION))
- vty_out (vty, "confed-internal link%s", VTYNL);
+ vty_out (vty, "confed-internal link\n");
else
- vty_out (vty, "internal link%s", VTYNL);
+ vty_out (vty, "internal link\n");
}
}
else
@@ -8032,9 +7975,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
else
{
if (bgp_confederation_peers_check(bgp, p->as))
- vty_out (vty, "confed-external link%s", VTYNL);
+ vty_out (vty, "confed-external link\n");
else
- vty_out (vty, "external link%s", VTYNL);
+ vty_out (vty, "external link\n");
}
}
@@ -8044,7 +7987,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (use_json)
json_object_string_add(json_neigh, "nbrDesc", p->desc);
else
- vty_out (vty, " Description: %s%s", p->desc, VTYNL);
+ vty_out (vty, " Description: %s\n", p->desc);
}
if (p->hostname)
@@ -8060,10 +8003,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
else
{
if (p->domainname && (p->domainname[0] != '\0'))
- vty_out(vty, "Hostname: %s.%s%s", p->hostname, p->domainname,
- VTYNL);
+ vty_out(vty, "Hostname: %s.%s\n", p->hostname, p->domainname);
else
- vty_out(vty, "Hostname: %s%s", p->hostname, VTYNL);
+ vty_out(vty, "Hostname: %s\n", p->hostname);
}
}
@@ -8091,8 +8033,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
else
{
- vty_out (vty, " Member of peer-group %s for session parameters%s",
- p->group->name, VTYNL);
+ vty_out (vty, " Member of peer-group %s for session parameters\n",
+ p->group->name);
if (dn_flag[0])
{
@@ -8104,7 +8046,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (range)
{
prefix2str(range, buf1, sizeof(buf1));
- vty_out (vty, " Belongs to the subnet range group: %s%s", buf1, VTYNL);
+ vty_out (vty, " Belongs to the subnet range group: %s\n", buf1);
}
}
}
@@ -8185,18 +8127,17 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
{
/* Administrative shutdown. */
if (CHECK_FLAG (p->flags, PEER_FLAG_SHUTDOWN))
- vty_out (vty, " Administratively shut down%s", VTYNL);
+ vty_out (vty, " Administratively shut down\n");
/* BGP Version. */
vty_out (vty, " BGP version 4");
- vty_out (vty, ", remote router ID %s%s",
- inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1)),
- VTYNL);
+ vty_out (vty, ", remote router ID %s\n",
+ inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1)));
/* Confederation */
if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION)
&& bgp_confederation_peers_check (bgp, p->as))
- vty_out (vty, " Neighbor under common administration%s", VTYNL);
+ vty_out (vty, " Neighbor under common administration\n");
/* Status. */
vty_out (vty, " BGP state = %s", lookup_msg(bgp_status_msg, p->status, NULL));
@@ -8211,21 +8152,21 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
else if (CHECK_FLAG (p->sflags, PEER_STATUS_NSF_WAIT))
vty_out (vty, " (NSF passive)");
}
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
/* read timer */
vty_out (vty, " Last read %s", peer_uptime (p->readtime, timebuf, BGP_UPTIME_LEN, 0, NULL));
- vty_out (vty, ", Last write %s%s",
- peer_uptime (p->last_write, timebuf, BGP_UPTIME_LEN, 0, NULL), VTYNL);
+ vty_out (vty, ", Last write %s\n",
+ peer_uptime (p->last_write, timebuf, BGP_UPTIME_LEN, 0, NULL));
/* Configured timer values. */
- vty_out (vty, " Hold time is %d, keepalive interval is %d seconds%s",
- p->v_holdtime, p->v_keepalive, VTYNL);
+ vty_out (vty, " Hold time is %d, keepalive interval is %d seconds\n",
+ p->v_holdtime, p->v_keepalive);
if (CHECK_FLAG (p->config, PEER_CONFIG_TIMER))
{
vty_out (vty, " Configured hold time is %d", p->holdtime);
- vty_out (vty, ", keepalive interval is %d seconds%s",
- p->keepalive, VTYNL);
+ vty_out (vty, ", keepalive interval is %d seconds\n",
+ p->keepalive);
}
}
/* Capability. */
@@ -8457,7 +8398,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
else
{
- vty_out (vty, " Neighbor capabilities:%s", VTYNL);
+ vty_out (vty, " Neighbor capabilities:\n");
/* AS4 */
if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV)
@@ -8469,14 +8410,14 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV) ? "and " : "");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
/* AddPath */
if (CHECK_FLAG (p->cap, PEER_CAP_ADDPATH_RCV)
|| CHECK_FLAG (p->cap, PEER_CAP_ADDPATH_ADV))
{
- vty_out (vty, " AddPath:%s", VTYNL);
+ vty_out (vty, " AddPath:\n");
for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
@@ -8492,7 +8433,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_TX_RCV))
vty_out (vty, "%sreceived", CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_TX_ADV) ? " and " : "" );
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_ADV) ||
@@ -8506,7 +8447,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_RCV))
vty_out (vty, "%sreceived", CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_ADV) ? " and " : "" );
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -8521,7 +8462,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV) ? "and " : "");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
/* Extended nexthop */
@@ -8534,15 +8475,15 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (CHECK_FLAG (p->cap, PEER_CAP_ENHE_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_ENHE_ADV) ? "and " : "");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
if (CHECK_FLAG (p->cap, PEER_CAP_ENHE_RCV))
{
- vty_out (vty, " Address families by peer:%s ", VTYNL);
+ vty_out (vty, " Address families by peer:\n ");
for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
if (CHECK_FLAG (p->af_cap[AFI_IP][safi], PEER_CAP_ENHE_AF_RCV))
- vty_out (vty, " %s%s",
- afi_safi_print (AFI_IP, safi), VTYNL);
+ vty_out (vty, " %s\n",
+ afi_safi_print (AFI_IP, safi));
}
}
@@ -8562,7 +8503,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
&& CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)) ?
"old & new" : CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) ? "old" : "new");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
/* Multiprotocol Extensions */
@@ -8575,7 +8516,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
vty_out (vty, " advertised");
if (p->afc_recv[afi][safi])
vty_out (vty, " %sreceived", p->afc_adv[afi][safi] ? "and " : "");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
/* Hostname capability */
@@ -8588,7 +8529,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (CHECK_FLAG (p->cap, PEER_CAP_HOSTNAME_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_HOSTNAME_ADV) ? "and " : "");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
/* Gracefull Restart */
@@ -8601,15 +8542,15 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV) ? "and " : "");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV))
{
int restart_af_count = 0;
- vty_out (vty, " Remote Restart timer is %d seconds%s",
- p->v_gr_restart, VTYNL);
- vty_out (vty, " Address families by peer:%s ", VTYNL);
+ vty_out (vty, " Remote Restart timer is %d seconds\n",
+ p->v_gr_restart);
+ vty_out (vty, " Address families by peer:\n ");
for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
@@ -8623,7 +8564,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
if (! restart_af_count)
vty_out (vty, "none");
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -8686,7 +8627,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
else
{
- vty_out (vty, " Graceful restart informations:%s", VTYNL);
+ vty_out (vty, " Graceful restart informations:\n");
if (p->status == Established)
{
vty_out (vty, " End-of-RIB send: ");
@@ -8702,7 +8643,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
}
}
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
vty_out (vty, " End-of-RIB received: ");
for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
{
@@ -8716,16 +8657,16 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
}
}
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
if (p->t_gr_restart)
- vty_out (vty, " The remaining time of restart timer is %ld%s",
- thread_timer_remain_second (p->t_gr_restart), VTYNL);
+ vty_out (vty, " The remaining time of restart timer is %ld\n",
+ thread_timer_remain_second (p->t_gr_restart));
if (p->t_gr_stale)
- vty_out (vty, " The remaining time of stalepath timer is %ld%s",
- thread_timer_remain_second (p->t_gr_stale), VTYNL);
+ vty_out (vty, " The remaining time of stalepath timer is %ld\n",
+ thread_timer_remain_second (p->t_gr_stale));
}
}
if (use_json)
@@ -8754,20 +8695,20 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
else
{
/* Packet counts. */
- vty_out (vty, " Message statistics:%s", VTYNL);
- vty_out (vty, " Inq depth is 0%s", VTYNL);
- vty_out (vty, " Outq depth is %lu%s", (unsigned long) p->obuf->count, VTYNL);
- vty_out (vty, " Sent Rcvd%s", VTYNL);
- vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTYNL);
- vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTYNL);
- vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTYNL);
- vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTYNL);
- vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTYNL);
- vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTYNL);
- vty_out (vty, " Total: %10d %10d%s", p->open_out + p->notify_out +
+ vty_out (vty, " Message statistics:\n");
+ vty_out (vty, " Inq depth is 0\n");
+ vty_out (vty, " Outq depth is %lu\n", (unsigned long) p->obuf->count);
+ vty_out (vty, " Sent Rcvd\n");
+ vty_out (vty, " Opens: %10d %10d\n", p->open_out, p->open_in);
+ vty_out (vty, " Notifications: %10d %10d\n", p->notify_out, p->notify_in);
+ vty_out (vty, " Updates: %10d %10d\n", p->update_out, p->update_in);
+ vty_out (vty, " Keepalives: %10d %10d\n", p->keepalive_out, p->keepalive_in);
+ vty_out (vty, " Route Refresh: %10d %10d\n", p->refresh_out, p->refresh_in);
+ vty_out (vty, " Capability: %10d %10d\n", p->dynamic_cap_out, p->dynamic_cap_in);
+ vty_out (vty, " Total: %10d %10d\n", p->open_out + p->notify_out +
p->update_out + p->keepalive_out + p->refresh_out + p->dynamic_cap_out,
p->open_in + p->notify_in + p->update_in + p->keepalive_in + p->refresh_in +
- p->dynamic_cap_in, VTYNL);
+ p->dynamic_cap_in);
}
if (use_json)
@@ -8787,8 +8728,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
else
{
/* advertisement-interval */
- vty_out (vty, " Minimum time between advertisement runs is %d seconds%s",
- p->v_routeadv, VTYNL);
+ vty_out (vty, " Minimum time between advertisement runs is %d seconds\n",
+ p->v_routeadv);
/* Update-source. */
if (p->update_if || p->update_source)
@@ -8798,10 +8739,10 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
vty_out (vty, "%s", p->update_if);
else if (p->update_source)
vty_out (vty, "%s", sockunion2str (p->update_source, buf1, SU_ADDRSTRLEN));
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
/* Address Family Information */
@@ -8822,15 +8763,14 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
json_object_int_add(json_neigh, "connectionsDropped", p->dropped);
}
else
- vty_out (vty, " Connections established %d; dropped %d%s", p->established, p->dropped,
- VTYNL);
+ vty_out (vty, " Connections established %d; dropped %d\n", p->established, p->dropped);
if (! p->last_reset)
{
if (use_json)
json_object_string_add(json_neigh, "lastReset", "never");
else
- vty_out (vty, " Last reset never%s", VTYNL);
+ vty_out (vty, " Last reset never\n");
}
else
{
@@ -8883,9 +8823,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
{
code_str = bgp_notify_code_str(p->notify.code);
subcode_str = bgp_notify_subcode_str(p->notify.code, p->notify.subcode);
- vty_out (vty, "due to NOTIFICATION %s (%s%s)%s",
+ vty_out (vty, "due to NOTIFICATION %s (%s%s)\n",
p->last_reset == PEER_DOWN_NOTIFY_SEND ? "sent" : "received",
- code_str, subcode_str, VTYNL);
+ code_str, subcode_str);
if (p->last_reset == PEER_DOWN_NOTIFY_RECEIVED
&& p->notify.code == BGP_NOTIFY_CEASE
&& (p->notify.subcode == BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN
@@ -8898,19 +8838,19 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
msg_str = bgp_notify_admin_message(msgbuf, sizeof(msgbuf),
(u_char*)p->notify.data, p->notify.length);
if (msg_str)
- vty_out (vty, " Message: \"%s\"%s", msg_str, VTYNL);
+ vty_out (vty, " Message: \"%s\"\n", msg_str);
}
}
else
{
- vty_out (vty, "due to %s%s",
- peer_down_str[(int) p->last_reset], VTYNL);
+ vty_out (vty, "due to %s\n",
+ peer_down_str[(int) p->last_reset]);
}
if (p->last_reset_cause_size)
{
msg = p->last_reset_cause;
- vty_out(vty, " Message received that caused BGP to send a NOTIFICATION:%s ", VTYNL);
+ vty_out(vty, " Message received that caused BGP to send a NOTIFICATION:\n ");
for (i = 1; i <= p->last_reset_cause_size; i++)
{
vty_out(vty, "%02X", *msg++);
@@ -8919,7 +8859,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
{
if (i % 16 == 0)
{
- vty_out(vty, "%s ", VTYNL);
+ vty_out(vty, "\n ");
}
else if (i % 4 == 0)
{
@@ -8927,7 +8867,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
}
}
- vty_out(vty, "%s", VTYNL);
+ vty_out(vty, "\n");
}
}
}
@@ -8937,7 +8877,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (use_json)
json_object_boolean_true_add(json_neigh, "prefixesConfigExceedMax");
else
- vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTYNL);
+ vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.\n");
if (p->t_pmax_restart)
{
@@ -8947,17 +8887,16 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
json_object_int_add(json_neigh, "restartInTimerMsec", thread_timer_remain_second (p->t_pmax_restart) * 1000);
}
else
- vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
- p->host, thread_timer_remain_second (p->t_pmax_restart),
- VTYNL);
+ vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds\n",
+ p->host, thread_timer_remain_second (p->t_pmax_restart));
}
else
{
if (use_json)
json_object_boolean_true_add(json_neigh, "reducePrefixNumAndClearIpBgp");
else
- vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
- p->host, VTYNL);
+ vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering\n",
+ p->host);
}
}
@@ -8974,11 +8913,11 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
else
{
if (p->gtsm_hops > 0)
- vty_out (vty, " External BGP neighbor may be up to %d hops away.%s",
- p->gtsm_hops, VTYNL);
+ vty_out (vty, " External BGP neighbor may be up to %d hops away.\n",
+ p->gtsm_hops);
else if (p->ttl > 1)
- vty_out (vty, " External BGP neighbor may be up to %d hops away.%s",
- p->ttl, VTYNL);
+ vty_out (vty, " External BGP neighbor may be up to %d hops away.\n",
+ p->ttl);
}
}
else
@@ -8988,8 +8927,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (use_json)
json_object_int_add(json_neigh, "internalBgpNbrMaxHopsAway", p->gtsm_hops);
else
- vty_out (vty, " Internal BGP neighbor may be up to %d hops away.%s",
- p->gtsm_hops, VTYNL);
+ vty_out (vty, " Internal BGP neighbor may be up to %d hops away.\n",
+ p->gtsm_hops);
}
}
@@ -9002,10 +8941,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
json_object_int_add(json_neigh, "portLocal", ntohs (p->su_local->sin.sin_port));
}
else
- vty_out (vty, "Local host: %s, Local port: %d%s",
+ vty_out (vty, "Local host: %s, Local port: %d\n",
sockunion2str (p->su_local, buf1, SU_ADDRSTRLEN),
- ntohs (p->su_local->sin.sin_port),
- VTYNL);
+ ntohs (p->su_local->sin.sin_port));
}
/* Remote address. */
@@ -9017,10 +8955,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
json_object_int_add(json_neigh, "portForeign", ntohs (p->su_remote->sin.sin_port));
}
else
- vty_out (vty, "Foreign host: %s, Foreign port: %d%s",
+ vty_out (vty, "Foreign host: %s, Foreign port: %d\n",
sockunion2str (p->su_remote, buf1, SU_ADDRSTRLEN),
- ntohs (p->su_remote->sin.sin_port),
- VTYNL);
+ ntohs (p->su_remote->sin.sin_port));
}
/* Nexthop display. */
@@ -9041,18 +8978,14 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
else
{
- vty_out (vty, "Nexthop: %s%s",
- inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1)),
- VTYNL);
- vty_out (vty, "Nexthop global: %s%s",
- inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1)),
- VTYNL);
- vty_out (vty, "Nexthop local: %s%s",
- inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1)),
- VTYNL);
- vty_out (vty, "BGP connection: %s%s",
- p->shared_network ? "shared network" : "non shared network",
- VTYNL);
+ vty_out (vty, "Nexthop: %s\n",
+ inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1)));
+ vty_out (vty, "Nexthop global: %s\n",
+ inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1)));
+ vty_out (vty, "Nexthop local: %s\n",
+ inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1)));
+ vty_out (vty, "BGP connection: %s\n",
+ p->shared_network ? "shared network" : "non shared network");
}
}
@@ -9085,28 +9018,26 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
}
else
{
- vty_out (vty, "BGP Connect Retry Timer in Seconds: %d%s",
- p->v_connect, VTYNL);
+ vty_out (vty, "BGP Connect Retry Timer in Seconds: %d\n",
+ p->v_connect);
if (p->status == Established && p->rtt)
- vty_out (vty, "Estimated round trip time: %d ms%s",
- p->rtt, VTYNL);
+ vty_out (vty, "Estimated round trip time: %d ms\n",
+ p->rtt);
if (p->t_start)
- vty_out (vty, "Next start timer due in %ld seconds%s",
- thread_timer_remain_second (p->t_start), VTYNL);
+ vty_out (vty, "Next start timer due in %ld seconds\n",
+ thread_timer_remain_second (p->t_start));
if (p->t_connect)
- vty_out (vty, "Next connect timer due in %ld seconds%s",
- thread_timer_remain_second (p->t_connect), VTYNL);
+ vty_out (vty, "Next connect timer due in %ld seconds\n",
+ thread_timer_remain_second (p->t_connect));
if (p->t_routeadv)
- vty_out (vty, "MRAI (interval %u) timer expires in %ld seconds%s",
- p->v_routeadv, thread_timer_remain_second (p->t_routeadv),
- VTYNL);
+ vty_out (vty, "MRAI (interval %u) timer expires in %ld seconds\n",
+ p->v_routeadv, thread_timer_remain_second (p->t_routeadv));
if (p->password)
- vty_out (vty, "Peer Authentication Enabled%s", VTYNL);
+ vty_out (vty, "Peer Authentication Enabled\n");
- vty_out (vty, "Read thread: %s Write thread: %s%s",
+ vty_out (vty, "Read thread: %s Write thread: %s\n",
p->t_read ? "on" : "off",
- p->t_write ? "on" : "off",
- VTYNL);
+ p->t_write ? "on" : "off");
}
if (p->notify.code == BGP_NOTIFY_OPEN_ERR
@@ -9114,7 +9045,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
bgp_capability_vty_out (vty, p, use_json, json_neigh);
if (!use_json)
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
/* BFD information. */
bgp_bfd_show_info(vty, p, use_json, json_neigh);
@@ -9173,17 +9104,17 @@ bgp_show_neighbor (struct vty *vty, struct bgp *bgp, enum show_type type,
if (use_json)
json_object_boolean_true_add(json, "bgpNoSuchNeighbor");
else
- vty_out (vty, "%% No such neighbor%s", VTYNL);
+ vty_out (vty, "%% No such neighbor\n");
}
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
+ vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
}
else
{
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
return CMD_SUCCESS;
@@ -9198,7 +9129,7 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json)
int is_first = 1;
if (use_json)
- vty_out (vty, "{%s", VTYNL);
+ vty_out (vty, "{\n");
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
@@ -9208,8 +9139,7 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json)
{
zlog_err("Unable to allocate memory for JSON object");
vty_out (vty,
- "{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}%s",
- VTYNL);
+ "{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}\n");
return;
}
@@ -9221,7 +9151,7 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json)
? "Default" : bgp->name);
if (! is_first)
- vty_out (vty, ",%s", VTYNL);
+ vty_out (vty, ",\n");
else
is_first = 0;
@@ -9230,17 +9160,15 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json)
}
else
{
- vty_out (vty, "%sInstance %s:%s",
- VTYNL,
+ vty_out (vty, "\nInstance %s:\n",
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
- ? "Default" : bgp->name,
- VTYNL);
+ ? "Default" : bgp->name);
}
bgp_show_neighbor (vty, bgp, show_all, NULL, NULL, use_json, json);
}
if (use_json)
- vty_out (vty, "}%s", VTYNL);
+ vty_out (vty, "}\n");
}
static int
@@ -9268,11 +9196,11 @@ bgp_show_neighbor_vty (struct vty *vty, const char *name,
{
json = json_object_new_object();
json_object_boolean_true_add(json, "bgpNoSuchInstance");
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
+ vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
}
else
- vty_out (vty, "%% No such BGP instance exist%s", VTYNL);
+ vty_out (vty, "%% No such BGP instance exist\n");
return CMD_WARNING;
}
@@ -9362,7 +9290,7 @@ DEFUN (show_ip_bgp_paths,
BGP_SAFI_HELP_STR
"Path information\n")
{
- vty_out (vty, "Address Refcnt Path%s", VTYNL);
+ vty_out (vty, "Address Refcnt Path\n");
aspath_print_all_vty (vty);
return CMD_SUCCESS;
}
@@ -9375,8 +9303,8 @@ community_show_all_iterator (struct hash_backet *backet, struct vty *vty)
struct community *com;
com = (struct community *) backet->data;
- vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt,
- community_str (com), VTYNL);
+ vty_out (vty, "[%p] (%ld) %s\n", (void *)backet, com->refcnt,
+ community_str (com));
}
/* Show BGP's community internal data. */
@@ -9388,7 +9316,7 @@ DEFUN (show_ip_bgp_community_info,
BGP_STR
"List all bgp community information\n")
{
- vty_out (vty, "Address Refcnt Community%s", VTYNL);
+ vty_out (vty, "Address Refcnt Community\n");
hash_iterate (community_hash (),
(void (*) (struct hash_backet *, void *))
@@ -9404,8 +9332,8 @@ lcommunity_show_all_iterator (struct hash_backet *backet, struct vty *vty)
struct lcommunity *lcom;
lcom = (struct lcommunity *) backet->data;
- vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, lcom->refcnt,
- lcommunity_str (lcom), VTYNL);
+ vty_out (vty, "[%p] (%ld) %s\n", (void *)backet, lcom->refcnt,
+ lcommunity_str (lcom));
}
/* Show BGP's community internal data. */
@@ -9417,7 +9345,7 @@ DEFUN (show_ip_bgp_lcommunity_info,
BGP_STR
"List all bgp large-community information\n")
{
- vty_out (vty, "Address Refcnt Large-community%s", VTYNL);
+ vty_out (vty, "Address Refcnt Large-community\n");
hash_iterate (lcommunity_hash (),
(void (*) (struct hash_backet *, void *))
@@ -9448,10 +9376,8 @@ bgp_show_all_instances_updgrps_vty (struct vty *vty, afi_t afi, safi_t safi)
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
- vty_out (vty, "%sInstance %s:%s",
- VTYNL,
- (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name,
- VTYNL);
+ vty_out (vty, "\nInstance %s:\n",
+ (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name);
update_group_show(bgp, afi, safi, vty, 0);
}
}
@@ -9834,20 +9760,17 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group)
if (conf->as_type == AS_SPECIFIED ||
conf->as_type == AS_EXTERNAL) {
- vty_out (vty, "%sBGP peer-group %s, remote AS %d%s",
- VTYNL, group->name, conf->as, VTYNL);
+ vty_out (vty, "\nBGP peer-group %s, remote AS %d\n", group->name, conf->as);
} else if (conf->as_type == AS_INTERNAL) {
- vty_out (vty, "%sBGP peer-group %s, remote AS %d%s",
- VTYNL, group->name, group->bgp->as, VTYNL);
+ vty_out (vty, "\nBGP peer-group %s, remote AS %d\n", group->name, group->bgp->as);
} else {
- vty_out (vty, "%sBGP peer-group %s%s",
- VTYNL, group->name, VTYNL);
+ vty_out (vty, "\nBGP peer-group %s\n", group->name);
}
if ((group->bgp->as == conf->as) || (conf->as_type == AS_INTERNAL))
- vty_out (vty, " Peer-group type is internal%s", VTYNL);
+ vty_out (vty, " Peer-group type is internal\n");
else
- vty_out (vty, " Peer-group type is external%s", VTYNL);
+ vty_out (vty, " Peer-group type is external\n");
/* Display AFs configured. */
vty_out (vty, " Configured address-families:");
@@ -9861,9 +9784,9 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group)
}
}
if (!af_cfgd)
- vty_out (vty, " none%s", VTYNL);
+ vty_out (vty, " none\n");
else
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
/* Display listen ranges (for dynamic neighbors), if any */
for (afi = AFI_IP; afi < AFI_MAX; afi++)
@@ -9878,15 +9801,15 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group)
if (lr_count)
{
vty_out(vty,
- " %d %s listen range(s)%s",
- lr_count, af_str, VTYNL);
+ " %d %s listen range(s)\n",
+ lr_count, af_str);
for (ALL_LIST_ELEMENTS (group->listen_range[afi], node,
nnode, range))
{
prefix2str(range, buf, sizeof(buf));
- vty_out(vty, " %s%s", buf, VTYNL);
+ vty_out(vty, " %s\n", buf);
}
}
}
@@ -9894,7 +9817,7 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group)
/* Display group members and their status */
if (listcount(group->peer))
{
- vty_out (vty, " Peer-group members:%s", VTYNL);
+ vty_out (vty, " Peer-group members:\n");
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
@@ -9905,9 +9828,9 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group)
peer_status = lookup_msg(bgp_status_msg, peer->status, NULL);
dynamic = peer_dynamic_neighbor(peer);
- vty_out (vty, " %s %s %s %s",
+ vty_out (vty, " %s %s %s \n",
peer->host, dynamic ? "(dynamic)" : "",
- peer_status, VTYNL);
+ peer_status);
}
}
@@ -9947,7 +9870,7 @@ bgp_show_peer_group (struct vty *vty, struct bgp *bgp,
}
if (type == show_peer_group && ! find)
- vty_out (vty, "%% No such peer-group%s", VTYNL);
+ vty_out (vty, "%% No such peer-group\n");
return CMD_SUCCESS;
}
@@ -9966,7 +9889,7 @@ bgp_show_peer_group_vty (struct vty *vty, const char *name,
if (! bgp)
{
- vty_out (vty, "%% No such BGP instance exist%s", VTYNL);
+ vty_out (vty, "%% No such BGP instance exist\n");
return CMD_WARNING;
}
@@ -10011,7 +9934,7 @@ DEFUN (bgp_redistribute_ipv4,
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
bgp_redist_add(bgp, AFI_IP, type, 0);
@@ -10041,7 +9964,7 @@ DEFUN (bgp_redistribute_ipv4_rmap,
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -10076,7 +9999,7 @@ DEFUN (bgp_redistribute_ipv4_metric,
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
@@ -10115,7 +10038,7 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric,
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
@@ -10157,7 +10080,7 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap,
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
@@ -10447,7 +10370,7 @@ DEFUN (no_bgp_redistribute_ipv4,
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
return bgp_redistribute_unset (bgp, AFI_IP, type, 0);
@@ -10477,7 +10400,7 @@ DEFUN (bgp_redistribute_ipv6,
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -10502,7 +10425,7 @@ DEFUN (bgp_redistribute_ipv6_rmap,
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -10529,7 +10452,7 @@ DEFUN (bgp_redistribute_ipv6_metric,
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
@@ -10560,7 +10483,7 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric,
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
@@ -10592,7 +10515,7 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap,
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
@@ -10621,7 +10544,7 @@ DEFUN (no_bgp_redistribute_ipv6,
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTYNL);
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -10664,7 +10587,7 @@ bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi,
vty_out (vty, " metric %u", red->redist_metric);
if (red->rmap.name)
vty_out (vty, " route-map %s", red->rmap.name);
- vty_out (vty, "%s", VTYNL);
+ vty_out (vty, "\n");
}
}
}
@@ -11828,16 +11751,16 @@ community_list_perror (struct vty *vty, int ret)
switch (ret)
{
case COMMUNITY_LIST_ERR_CANT_FIND_LIST:
- vty_out (vty, "%% Can't find community-list%s", VTYNL);
+ vty_out (vty, "%% Can't find community-list\n");
break;
case COMMUNITY_LIST_ERR_MALFORMED_VAL:
- vty_out (vty, "%% Malformed community-list value%s", VTYNL);
+ vty_out (vty, "%% Malformed community-list value\n");
break;
case COMMUNITY_LIST_ERR_STANDARD_CONFLICT:
- vty_out (vty, "%% Community name conflict, previously defined as standard community%s", VTYNL);
+ vty_out (vty, "%% Community name conflict, previously defined as standard community\n");
break;
case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT:
- vty_out (vty, "%% Community name conflict, previously defined as expanded community%s", VTYNL);
+ vty_out (vty, "%% Community name conflict, previously defined as expanded community\n");
break;
}
}
@@ -12014,25 +11937,24 @@ community_list_show (struct vty *vty, struct community_list *list)
if (entry == list->head)
{
if (all_digit (list->name))
- vty_out (vty, "Community %s list %s%s",
+ vty_out (vty, "Community %s list %s\n",
entry->style == COMMUNITY_LIST_STANDARD ?
"standard" : "(expanded) access",
- list->name, VTYNL);
+ list->name);
else
- vty_out (vty, "Named Community %s list %s%s",
+ vty_out (vty, "Named Community %s list %s\n",
entry->style == COMMUNITY_LIST_STANDARD ?
"standard" : "expanded",
- list->name, VTYNL);
+ list->name);
}
if (entry->any)
- vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTYNL);
+ vty_out (vty, " %s\n",
+ community_direct_str (entry->direct));
else
- vty_out (vty, " %s %s%s",
+ vty_out (vty, " %s %s\n",
community_direct_str (entry->direct),
entry->style == COMMUNITY_LIST_STANDARD
- ? community_str (entry->u.com) : entry->config,
- VTYNL);
+ ? community_str (entry->u.com) : entry->config);
}
}
@@ -12074,7 +11996,7 @@ DEFUN (show_ip_community_list_arg,
list = community_list_lookup (bgp_clist, argv[idx_comm_list]->arg, COMMUNITY_LIST_MASTER);
if (! list)
{
- vty_out (vty, "%% Can't find community-list%s", VTYNL);
+ vty_out (vty, "%% Can't find community-list\n");
return CMD_WARNING;
}
@@ -12106,7 +12028,7 @@ lcommunity_list_set_vty (struct vty *vty, int argc, struct cmd_token **argv,
cl_name = argv[idx]->arg;
if (reject_all_digit_name && all_digit (cl_name))
{
- vty_out (vty, "%% Community name cannot have all digits%s", VTYNL);
+ vty_out (vty, "%% Community name cannot have all digits\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -12359,25 +12281,24 @@ lcommunity_list_show (struct vty *vty, struct community_list *list)
if (entry == list->head)
{
if (all_digit (list->name))
- vty_out (vty, "Large community %s list %s%s",
+ vty_out (vty, "Large community %s list %s\n",
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
"standard" : "(expanded) access",
- list->name, VTYNL);
+ list->name);
else
- vty_out (vty, "Named large community %s list %s%s",
+ vty_out (vty, "Named large community %s list %s\n",
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
"standard" : "expanded",
- list->name, VTYNL);
+ list->name);
}
if (entry->any)
- vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTYNL);
+ vty_out (vty, " %s\n",
+ community_direct_str (entry->direct));
else
- vty_out (vty, " %s %s%s",
+ vty_out (vty, " %s %s\n",
community_direct_str (entry->direct),
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
- entry->u.ecom->str : entry->config,
- VTYNL);
+ entry->u.ecom->str : entry->config);
}
}
@@ -12418,7 +12339,7 @@ DEFUN (show_ip_lcommunity_list_arg,
list = community_list_lookup (bgp_clist, argv[3]->arg, LARGE_COMMUNITY_LIST_MASTER);
if (! list)
{
- vty_out (vty, "%% Can't find extcommunity-list%s", VTYNL);
+ vty_out (vty, "%% Can't find extcommunity-list\n");
return CMD_WARNING;
}
@@ -12595,25 +12516,24 @@ extcommunity_list_show (struct vty *vty, struct community_list *list)
if (entry == list->head)
{
if (all_digit (list->name))
- vty_out (vty, "Extended community %s list %s%s",
+ vty_out (vty, "Extended community %s list %s\n",
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
"standard" : "(expanded) access",
- list->name, VTYNL);
+ list->name);
else
- vty_out (vty, "Named extended community %s list %s%s",
+ vty_out (vty, "Named extended community %s list %s\n",
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
"standard" : "expanded",
- list->name, VTYNL);
+ list->name);
}
if (entry->any)
- vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTYNL);
+ vty_out (vty, " %s\n",
+ community_direct_str (entry->direct));
else
- vty_out (vty, " %s %s%s",
+ vty_out (vty, " %s %s\n",
community_direct_str (entry->direct),
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
- entry->u.ecom->str : entry->config,
- VTYNL);
+ entry->u.ecom->str : entry->config);
}
}
@@ -12655,7 +12575,7 @@ DEFUN (show_ip_extcommunity_list_arg,
list = community_list_lookup (bgp_clist, argv[idx_comm_list]->arg, EXTCOMMUNITY_LIST_MASTER);
if (! list)
{
- vty_out (vty, "%% Can't find extcommunity-list%s", VTYNL);
+ vty_out (vty, "%% Can't find extcommunity-list\n");
return CMD_WARNING;
}
@@ -12697,21 +12617,19 @@ 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, "ip community-list %s %s %s%s",
+ vty_out (vty, "ip community-list %s %s %s\n",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry),
- VTYNL);
+ 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, "ip community-list %s %s %s %s%s",
+ vty_out (vty, "ip community-list %s %s %s %s\n",
entry->style == COMMUNITY_LIST_STANDARD
? "standard" : "expanded",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry),
- VTYNL);
+ community_list_config_str (entry));
write++;
}
@@ -12721,19 +12639,19 @@ 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, "ip extcommunity-list %s %s %s%s",
+ vty_out (vty, "ip extcommunity-list %s %s %s\n",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTYNL);
+ 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, "ip extcommunity-list %s %s %s %s%s",
+ vty_out (vty, "ip extcommunity-list %s %s %s %s\n",
entry->style == EXTCOMMUNITY_LIST_STANDARD
? "standard" : "expanded",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTYNL);
+ community_list_config_str (entry));
write++;
}
@@ -12744,19 +12662,19 @@ 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, "ip large-community-list %s %s %s%s",
+ vty_out (vty, "ip large-community-list %s %s %s\n",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTYNL);
+ 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, "ip large-community-list %s %s %s %s%s",
+ vty_out (vty, "ip large-community-list %s %s %s %s\n",
entry->style == LARGE_COMMUNITY_LIST_STANDARD
? "standard" : "expanded",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTYNL);
+ community_list_config_str (entry));
write++;
}
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 0bde8ca11..a0a86136f 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -6502,15 +6502,15 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer,
|| strcmp (filter->dlist[in].name, gfilter->dlist[in].name) != 0)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s distribute-list %s in%s",
- addr, filter->dlist[in].name, VTYNL);
+ " neighbor %s distribute-list %s in\n",
+ addr, filter->dlist[in].name);
}
if (filter->dlist[out].name && ! gfilter)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s distribute-list %s out%s",
- addr, filter->dlist[out].name, VTYNL);
+ " neighbor %s distribute-list %s out\n",
+ addr, filter->dlist[out].name);
}
/* prefix-list. */
@@ -6519,15 +6519,15 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer,
|| strcmp (filter->plist[in].name, gfilter->plist[in].name) != 0)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s prefix-list %s in%s",
- addr, filter->plist[in].name, VTYNL);
+ " neighbor %s prefix-list %s in\n",
+ addr, filter->plist[in].name);
}
if (filter->plist[out].name && ! gfilter)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s prefix-list %s out%s",
- addr, filter->plist[out].name, VTYNL);
+ " neighbor %s prefix-list %s out\n",
+ addr, filter->plist[out].name);
}
/* route-map. */
@@ -6536,8 +6536,8 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer,
|| strcmp (filter->map[RMAP_IN].name, gfilter->map[RMAP_IN].name) != 0)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s route-map %s in%s",
- addr, filter->map[RMAP_IN].name, VTYNL);
+ " neighbor %s route-map %s in\n",
+ addr, filter->map[RMAP_IN].name);
}
if (filter->map[RMAP_OUT].name)
@@ -6545,16 +6545,16 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer,
|| strcmp (filter->map[RMAP_OUT].name, gfilter->map[RMAP_OUT].name) != 0)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s route-map %s out%s",
- addr, filter->map[RMAP_OUT].name, VTYNL);
+ " neighbor %s route-map %s out\n",
+ addr, filter->map[RMAP_OUT].name);
}
/* unsuppress-map */
if (filter->usmap.name && ! gfilter)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s unsuppress-map %s%s",
- addr, filter->usmap.name, VTYNL);
+ " neighbor %s unsuppress-map %s\n",
+ addr, filter->usmap.name);
}
/* filter-list. */
@@ -6563,15 +6563,15 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer,
|| strcmp (filter->aslist[in].name, gfilter->aslist[in].name) != 0)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s filter-list %s in%s",
- addr, filter->aslist[in].name, VTYNL);
+ " neighbor %s filter-list %s in\n",
+ addr, filter->aslist[in].name);
}
if (filter->aslist[out].name && ! gfilter)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s filter-list %s out%s",
- addr, filter->aslist[out].name, VTYNL);
+ " neighbor %s filter-list %s out\n",
+ addr, filter->aslist[out].name);
}
}
@@ -6626,7 +6626,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if_ras_printed = TRUE;
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* remote-as and peer-group */
@@ -6639,22 +6639,22 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
{
if (peer->as_type == AS_SPECIFIED)
{
- vty_outln (vty, " neighbor %s remote-as %u", addr,peer->as);
+ vty_out (vty, " neighbor %s remote-as %u\n", addr,peer->as);
}
else if (peer->as_type == AS_INTERNAL)
{
- vty_outln (vty, " neighbor %s remote-as internal", addr);
+ vty_out (vty, " neighbor %s remote-as internal\n", addr);
}
else if (peer->as_type == AS_EXTERNAL)
{
- vty_outln (vty, " neighbor %s remote-as external", addr);
+ vty_out (vty, " neighbor %s remote-as external\n", addr);
}
}
/* For swpX peers we displayed the peer-group
* via 'neighbor swpX interface peer-group WORD' */
if (!if_pg_printed)
- vty_outln (vty, " neighbor %s peer-group %s", addr,
+ vty_out (vty, " neighbor %s peer-group %s\n", addr,
peer->group->name);
}
@@ -6664,22 +6664,22 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
/* peer is a peer-group, declare the peer-group */
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
- vty_outln (vty, " neighbor %s peer-group",addr);
+ vty_out (vty, " neighbor %s peer-group\n",addr);
}
if (!if_ras_printed)
{
if (peer->as_type == AS_SPECIFIED)
{
- vty_outln (vty, " neighbor %s remote-as %u", addr,peer->as);
+ vty_out (vty, " neighbor %s remote-as %u\n", addr,peer->as);
}
else if (peer->as_type == AS_INTERNAL)
{
- vty_outln (vty, " neighbor %s remote-as internal", addr);
+ vty_out (vty, " neighbor %s remote-as internal\n", addr);
}
else if (peer->as_type == AS_EXTERNAL)
{
- vty_outln (vty, " neighbor %s remote-as external", addr);
+ vty_out (vty, " neighbor %s remote-as external\n", addr);
}
}
}
@@ -6694,7 +6694,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
|| (CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS) !=
CHECK_FLAG (g_peer->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS)))
{
- vty_outln (vty, " neighbor %s local-as %u%s%s", addr,
+ vty_out (vty, " neighbor %s local-as %u%s%s\n", addr,
peer->change_local_as,
CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ?
" no-prepend" : "",
@@ -6705,7 +6705,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
/* description */
if (peer->desc)
{
- vty_outln (vty, " neighbor %s description %s", addr,peer->desc);
+ vty_out (vty, " neighbor %s description %s\n", addr,peer->desc);
}
/* shutdown */
@@ -6716,10 +6716,10 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
peer->tx_shutdown_message)
{
if (peer->tx_shutdown_message)
- vty_outln (vty, " neighbor %s shutdown message %s", addr,
+ vty_out (vty, " neighbor %s shutdown message %s\n", addr,
peer->tx_shutdown_message);
else
- vty_outln (vty, " neighbor %s shutdown", addr);
+ vty_out (vty, " neighbor %s shutdown\n", addr);
}
}
@@ -6739,7 +6739,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
|| ! g_peer->password
|| strcmp (peer->password, g_peer->password) != 0)
{
- vty_outln (vty, " neighbor %s password %s", addr,peer->password);
+ vty_out (vty, " neighbor %s password %s\n", addr,peer->password);
}
}
@@ -6748,20 +6748,20 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
{
if (!peer_group_active (peer))
{
- vty_outln (vty, " neighbor %s solo", addr);
+ vty_out (vty, " neighbor %s solo\n", addr);
}
}
/* BGP port */
if (peer->port != BGP_PORT_DEFAULT)
{
- vty_outln (vty, " neighbor %s port %d", addr,peer->port);
+ vty_out (vty, " neighbor %s port %d\n", addr,peer->port);
}
/* Local interface name */
if (peer->ifname)
{
- vty_outln (vty, " neighbor %s interface %s", addr,peer->ifname);
+ vty_out (vty, " neighbor %s interface %s\n", addr,peer->ifname);
}
/* passive */
@@ -6770,7 +6770,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_PASSIVE))
{
- vty_outln (vty, " neighbor %s passive", addr);
+ vty_out (vty, " neighbor %s passive\n", addr);
}
}
@@ -6780,7 +6780,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
{
if (! peer_group_active (peer) || g_peer->ttl != peer->ttl)
{
- vty_outln (vty, " neighbor %s ebgp-multihop %d", addr,peer->ttl);
+ vty_out (vty, " neighbor %s ebgp-multihop %d\n", addr,peer->ttl);
}
}
@@ -6789,7 +6789,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
{
if (! peer_group_active (peer) || g_peer->gtsm_hops != peer->gtsm_hops)
{
- vty_outln (vty, " neighbor %s ttl-security hops %d", addr,
+ vty_out (vty, " neighbor %s ttl-security hops %d\n", addr,
peer->gtsm_hops);
}
}
@@ -6800,7 +6800,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK))
{
- vty_outln (vty, " neighbor %s disable-connected-check", addr);
+ vty_out (vty, " neighbor %s disable-connected-check\n", addr);
}
}
@@ -6810,7 +6810,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) || ! g_peer->update_if
|| strcmp (g_peer->update_if, peer->update_if) != 0)
{
- vty_outln (vty, " neighbor %s update-source %s", addr,
+ vty_out (vty, " neighbor %s update-source %s\n", addr,
peer->update_if);
}
}
@@ -6820,7 +6820,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
|| sockunion_cmp (g_peer->update_source,
peer->update_source) != 0)
{
- vty_outln (vty, " neighbor %s update-source %s", addr,
+ vty_out (vty, " neighbor %s update-source %s\n", addr,
sockunion2str(peer->update_source, buf, SU_ADDRSTRLEN));
}
}
@@ -6830,7 +6830,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
((! peer_group_active (peer) && peer->v_routeadv != BGP_DEFAULT_EBGP_ROUTEADV) ||
(peer_group_active (peer) && peer->v_routeadv != g_peer->v_routeadv)))
{
- vty_outln (vty, " neighbor %s advertisement-interval %u",
+ vty_out (vty, " neighbor %s advertisement-interval %u\n",
addr, peer->v_routeadv);
}
@@ -6839,7 +6839,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
((! peer_group_active (peer) && (peer->keepalive != BGP_DEFAULT_KEEPALIVE || peer->holdtime != BGP_DEFAULT_HOLDTIME)) ||
(peer_group_active (peer) && (peer->keepalive != g_peer->keepalive || peer->holdtime != g_peer->holdtime))))
{
- vty_outln (vty, " neighbor %s timers %u %u", addr,
+ vty_out (vty, " neighbor %s timers %u %u\n", addr,
peer->keepalive, peer->holdtime);
}
@@ -6848,7 +6848,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
(peer_group_active (peer) && peer->connect != g_peer->connect)))
{
- vty_outln (vty, " neighbor %s timers connect %u", addr,
+ vty_out (vty, " neighbor %s timers connect %u\n", addr,
peer->connect);
}
@@ -6858,7 +6858,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DYNAMIC_CAPABILITY))
{
- vty_outln (vty, " neighbor %s capability dynamic",addr);
+ vty_out (vty, " neighbor %s capability dynamic\n",addr);
}
}
@@ -6868,7 +6868,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_CAPABILITY_ENHE))
{
- vty_outln (vty, " no neighbor %s capability extended-nexthop",
+ vty_out (vty, " no neighbor %s capability extended-nexthop\n",
addr);
}
}
@@ -6878,7 +6878,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_CAPABILITY_ENHE))
{
- vty_outln (vty, " neighbor %s capability extended-nexthop",addr);
+ vty_out (vty, " neighbor %s capability extended-nexthop\n",addr);
}
}
@@ -6888,7 +6888,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DONT_CAPABILITY))
{
- vty_outln (vty, " neighbor %s dont-capability-negotiate",addr);
+ vty_out (vty, " neighbor %s dont-capability-negotiate\n",addr);
}
}
@@ -6898,7 +6898,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))
{
- vty_outln (vty, " neighbor %s override-capability",addr);
+ vty_out (vty, " neighbor %s override-capability\n",addr);
}
}
@@ -6908,7 +6908,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_STRICT_CAP_MATCH))
{
- vty_outln (vty, " neighbor %s strict-capability-match",addr);
+ vty_out (vty, " neighbor %s strict-capability-match\n",addr);
}
}
}
@@ -6942,16 +6942,16 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
if (g_peer->afc[afi][safi] && !peer->afc[afi][safi])
{
afi_header_vty_out (vty, afi, safi, write,
- " no neighbor %s activate%s",
- addr, VTYNL);
+ " no neighbor %s activate\n",
+ addr);
}
/* If the peer-group is not active but peer is, print an 'activate' */
else if (!g_peer->afc[afi][safi] && peer->afc[afi][safi])
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s activate%s",
- addr, VTYNL);
+ " neighbor %s activate\n",
+ addr);
}
}
else
@@ -6963,14 +6963,14 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4))
{
afi_header_vty_out(vty, afi, safi, write,
- " neighbor %s activate%s",
- addr, VTYNL);
+ " neighbor %s activate\n",
+ addr);
}
}
else
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s activate%s",
- addr, VTYNL);
+ " neighbor %s activate\n",
+ addr);
}
else
{
@@ -6979,8 +6979,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
if (!bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4))
{
afi_header_vty_out (vty, afi, safi, write,
- " no neighbor %s activate%s",
- addr, VTYNL);
+ " no neighbor %s activate\n",
+ addr);
}
}
}
@@ -6990,15 +6990,15 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_ADDPATH_TX_ALL_PATHS))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s addpath-tx-all-paths%s",
- addr, VTYNL);
+ " neighbor %s addpath-tx-all-paths\n",
+ addr);
}
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s addpath-tx-bestpath-per-AS%s",
- addr, VTYNL);
+ " neighbor %s addpath-tx-bestpath-per-AS\n",
+ addr);
}
/* ORF capability. */
@@ -7016,68 +7016,68 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
vty_out (vty, " send");
else
vty_out (vty, " receive");
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* Route reflector client. */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REFLECTOR_CLIENT))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s route-reflector-client%s",
- addr, VTYNL);
+ " neighbor %s route-reflector-client\n",
+ addr);
}
/* next-hop-self force */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_FORCE_NEXTHOP_SELF))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s next-hop-self force%s",
- addr, VTYNL);
+ " neighbor %s next-hop-self force\n",
+ addr);
}
/* next-hop-self */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_SELF))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s next-hop-self%s",
- addr, VTYNL);
+ " neighbor %s next-hop-self\n",
+ addr);
}
/* remove-private-AS */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s remove-private-AS all replace-AS%s",
- addr, VTYNL);
+ " neighbor %s remove-private-AS all replace-AS\n",
+ addr);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s remove-private-AS replace-AS%s",
- addr, VTYNL);
+ " neighbor %s remove-private-AS replace-AS\n",
+ addr);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s remove-private-AS all%s",
- addr, VTYNL);
+ " neighbor %s remove-private-AS all\n",
+ addr);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s remove-private-AS%s",
- addr, VTYNL);
+ " neighbor %s remove-private-AS\n",
+ addr);
}
/* as-override */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_AS_OVERRIDE))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s as-override%s",
- addr, VTYNL);
+ " neighbor %s as-override\n",
+ addr);
}
/* send-community print. */
@@ -7088,26 +7088,26 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
&& peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s send-community all%s",
- addr, VTYNL);
+ " neighbor %s send-community all\n",
+ addr);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s send-community large%s",
- addr, VTYNL);
+ " neighbor %s send-community large\n",
+ addr);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s send-community extended%s",
- addr, VTYNL);
+ " neighbor %s send-community extended\n",
+ addr);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s send-community%s",
- addr, VTYNL);
+ " neighbor %s send-community\n",
+ addr);
}
}
else
@@ -7120,8 +7120,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
(!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY)))
{
afi_header_vty_out (vty, afi, safi, write,
- " no neighbor %s send-community all%s",
- addr, VTYNL);
+ " no neighbor %s send-community all\n",
+ addr);
}
else
{
@@ -7129,24 +7129,24 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
(!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY)))
{
afi_header_vty_out (vty, afi, safi, write,
- " no neighbor %s send-community large%s",
- addr, VTYNL);
+ " no neighbor %s send-community large\n",
+ addr);
}
if (!peer_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY) &&
(!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY)))
{
afi_header_vty_out (vty, afi, safi, write,
- " no neighbor %s send-community extended%s",
- addr, VTYNL);
+ " no neighbor %s send-community extended\n",
+ addr);
}
if (!peer_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY) &&
(!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_COMMUNITY)))
{
afi_header_vty_out (vty, afi, safi, write,
- " no neighbor %s send-community%s",
- addr, VTYNL);
+ " no neighbor %s send-community\n",
+ addr);
}
}
}
@@ -7163,15 +7163,15 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
" neighbor %s default-originate", addr);
if (peer->default_rmap[afi][safi].name)
vty_out (vty, " route-map %s", peer->default_rmap[afi][safi].name);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* Soft reconfiguration inbound. */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SOFT_RECONFIG))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s soft-reconfiguration inbound%s",
- addr, VTYNL);
+ " neighbor %s soft-reconfiguration inbound\n",
+ addr);
}
/* maximum-prefix. */
@@ -7191,23 +7191,23 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
vty_out (vty, " warning-only");
if (peer->pmax_restart[afi][safi])
vty_out (vty, " restart %u", peer->pmax_restart[afi][safi]);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* Route server client. */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s route-server-client%s",
- addr, VTYNL);
+ " neighbor %s route-server-client\n",
+ addr);
}
/* Nexthop-local unchanged. */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s nexthop-local unchanged%s",
- addr, VTYNL);
+ " neighbor %s nexthop-local unchanged\n",
+ addr);
}
/* allowas-in <1-10> */
@@ -7220,14 +7220,14 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
if (peer->allowas_in[afi][safi] == 3)
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s allowas-in%s",
- addr, VTYNL);
+ " neighbor %s allowas-in\n",
+ addr);
}
else
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s allowas-in %d%s",
- addr, peer->allowas_in[afi][safi], VTYNL);
+ " neighbor %s allowas-in %d\n",
+ addr, peer->allowas_in[afi][safi]);
}
}
}
@@ -7239,8 +7239,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
|| ! peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_ALLOWAS_IN_ORIGIN))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s allowas-in origin%s",
- addr, VTYNL);
+ " neighbor %s allowas-in origin\n",
+ addr);
}
}
@@ -7253,8 +7253,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
if (peer->weight[afi][safi])
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s weight %lu%s",
- addr, peer->weight[afi][safi], VTYNL);
+ " neighbor %s weight %lu\n",
+ addr, peer->weight[afi][safi]);
}
}
@@ -7271,19 +7271,19 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
&& peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_MED_UNCHANGED))
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s attribute-unchanged%s",
- addr, VTYNL);
+ " neighbor %s attribute-unchanged\n",
+ addr);
}
else
{
afi_header_vty_out (vty, afi, safi, write,
- " neighbor %s attribute-unchanged%s%s%s%s", addr,
+ " neighbor %s attribute-unchanged%s%s%s\n", addr,
peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_AS_PATH_UNCHANGED) ?
" as-path" : "",
peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED) ?
" next-hop" : "",
peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_MED_UNCHANGED) ?
- " med" : "", VTYNL);
+ " med" : "");
}
}
}
@@ -7296,7 +7296,7 @@ bgp_config_write_family_header (struct vty *vty, afi_t afi, safi_t safi,
if (*write)
return;
- vty_out (vty, " !%s address-family ", VTYNL);
+ vty_out (vty, " !\n address-family ");
if (afi == AFI_IP)
{
@@ -7329,7 +7329,7 @@ bgp_config_write_family_header (struct vty *vty, afi_t afi, safi_t safi,
if (safi == SAFI_EVPN)
vty_out (vty, "l2vpn evpn");
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
*write = 1;
}
@@ -7368,7 +7368,7 @@ bgp_config_write_family (struct vty *vty, struct bgp *bgp, afi_t afi,
bgp_config_write_table_map (vty, bgp, afi, safi, &write);
if (write)
- vty_outln (vty, " exit-address-family");
+ vty_out (vty, " exit-address-family\n");
return write;
}
@@ -7386,25 +7386,25 @@ bgp_config_write (struct vty *vty)
/* BGP Multiple instance. */
if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE))
{
- vty_outln (vty, "no bgp multiple-instance");
+ vty_out (vty, "no bgp multiple-instance\n");
write++;
}
/* BGP Config type. */
if (bgp_option_check (BGP_OPT_CONFIG_CISCO))
{
- vty_outln (vty, "bgp config-type cisco");
+ vty_out (vty, "bgp config-type cisco\n");
write++;
}
if (bm->rmap_update_timer != RMAP_DEFAULT_UPDATE_TIMER)
- vty_outln (vty, "bgp route-map delay-timer %u",bm->rmap_update_timer);
+ vty_out (vty, "bgp route-map delay-timer %u\n",bm->rmap_update_timer);
/* BGP configuration. */
for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
if (write)
- vty_outln (vty, "!");
+ vty_out (vty, "!\n");
/* Router bgp ASN */
vty_out (vty, "router bgp %u", bgp->as);
@@ -7416,66 +7416,66 @@ bgp_config_write (struct vty *vty)
(bgp->inst_type == BGP_INSTANCE_TYPE_VIEW) ?
"view" : "vrf", bgp->name);
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
/* No Synchronization */
if (bgp_option_check (BGP_OPT_CONFIG_CISCO))
- vty_outln (vty, " no synchronization");
+ vty_out (vty, " no synchronization\n");
/* BGP fast-external-failover. */
if (CHECK_FLAG (bgp->flags, BGP_FLAG_NO_FAST_EXT_FAILOVER))
- vty_outln (vty, " no bgp fast-external-failover");
+ vty_out (vty, " no bgp fast-external-failover\n");
/* BGP router ID. */
if (bgp->router_id_static.s_addr != 0)
- vty_outln (vty, " bgp router-id %s",
+ vty_out (vty, " bgp router-id %s\n",
inet_ntoa(bgp->router_id_static));
/* BGP log-neighbor-changes. */
if (!!bgp_flag_check (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES)
!= DFLT_BGP_LOG_NEIGHBOR_CHANGES)
- vty_outln (vty, " %sbgp log-neighbor-changes",
+ vty_out (vty, " %sbgp log-neighbor-changes\n",
bgp_flag_check(bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES) ? "" : "no ");
/* BGP configuration. */
if (bgp_flag_check (bgp, BGP_FLAG_ALWAYS_COMPARE_MED))
- vty_outln (vty, " bgp always-compare-med");
+ vty_out (vty, " bgp always-compare-med\n");
/* BGP default ipv4-unicast. */
if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4))
- vty_outln (vty, " no bgp default ipv4-unicast");
+ vty_out (vty, " no bgp default ipv4-unicast\n");
/* BGP default local-preference. */
if (bgp->default_local_pref != BGP_DEFAULT_LOCAL_PREF)
- vty_outln (vty, " bgp default local-preference %u",
+ vty_out (vty, " bgp default local-preference %u\n",
bgp->default_local_pref);
/* BGP default show-hostname */
if (!!bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME)
!= DFLT_BGP_SHOW_HOSTNAME)
- vty_outln (vty, " %sbgp default show-hostname",
+ vty_out (vty, " %sbgp default show-hostname\n",
bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME) ? "" : "no ");
/* BGP default subgroup-pkt-queue-max. */
if (bgp->default_subgroup_pkt_queue_max != BGP_DEFAULT_SUBGROUP_PKT_QUEUE_MAX)
- vty_outln (vty, " bgp default subgroup-pkt-queue-max %u",
+ vty_out (vty, " bgp default subgroup-pkt-queue-max %u\n",
bgp->default_subgroup_pkt_queue_max);
/* BGP client-to-client reflection. */
if (bgp_flag_check (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT))
- vty_outln (vty, " no bgp client-to-client reflection");
+ vty_out (vty, " no bgp client-to-client reflection\n");
/* BGP cluster ID. */
if (CHECK_FLAG (bgp->config, BGP_CONFIG_CLUSTER_ID))
- vty_outln (vty, " bgp cluster-id %s",inet_ntoa(bgp->cluster_id));
+ vty_out (vty, " bgp cluster-id %s\n",inet_ntoa(bgp->cluster_id));
/* Disable ebgp connected nexthop check */
if (bgp_flag_check (bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK))
- vty_outln (vty, " bgp disable-ebgp-connected-route-check");
+ vty_out (vty, " bgp disable-ebgp-connected-route-check\n");
/* Confederation identifier*/
if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION))
- vty_outln (vty, " bgp confederation identifier %i",bgp->confed_id);
+ vty_out (vty, " bgp confederation identifier %i\n",bgp->confed_id);
/* Confederation peer */
if (bgp->confed_peers_cnt > 0)
@@ -7487,17 +7487,17 @@ bgp_config_write (struct vty *vty)
for (i = 0; i < bgp->confed_peers_cnt; i++)
vty_out(vty, " %u", bgp->confed_peers[i]);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* BGP enforce-first-as. */
if (bgp_flag_check (bgp, BGP_FLAG_ENFORCE_FIRST_AS))
- vty_outln (vty, " bgp enforce-first-as");
+ vty_out (vty, " bgp enforce-first-as\n");
/* BGP deterministic-med. */
if (!!bgp_flag_check (bgp, BGP_FLAG_DETERMINISTIC_MED)
!= DFLT_BGP_DETERMINISTIC_MED)
- vty_outln (vty, " %sbgp deterministic-med",
+ vty_out (vty, " %sbgp deterministic-med\n",
bgp_flag_check(bgp, BGP_FLAG_DETERMINISTIC_MED) ? "" : "no ");
/* BGP update-delay. */
@@ -7508,14 +7508,14 @@ bgp_config_write (struct vty *vty)
vty_out (vty, " bgp max-med on-startup %u", bgp->v_maxmed_onstartup);
if (bgp->maxmed_onstartup_value != BGP_MAXMED_VALUE_DEFAULT)
vty_out (vty, " %u", bgp->maxmed_onstartup_value);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
if (bgp->v_maxmed_admin != BGP_MAXMED_ADMIN_UNCONFIGURED)
{
vty_out (vty, " bgp max-med administrative");
if (bgp->maxmed_admin_value != BGP_MAXMED_VALUE_DEFAULT)
vty_out (vty, " %u", bgp->maxmed_admin_value);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* write quanta */
@@ -7526,42 +7526,42 @@ bgp_config_write (struct vty *vty)
/* BGP graceful-restart. */
if (bgp->stalepath_time != BGP_DEFAULT_STALEPATH_TIME)
- vty_outln (vty, " bgp graceful-restart stalepath-time %u",
+ vty_out (vty, " bgp graceful-restart stalepath-time %u\n",
bgp->stalepath_time);
if (bgp->restart_time != BGP_DEFAULT_RESTART_TIME)
- vty_outln (vty, " bgp graceful-restart restart-time %u",
+ vty_out (vty, " bgp graceful-restart restart-time %u\n",
bgp->restart_time);
if (bgp_flag_check (bgp, BGP_FLAG_GRACEFUL_RESTART))
- vty_outln (vty, " bgp graceful-restart");
+ vty_out (vty, " bgp graceful-restart\n");
/* BGP graceful-restart Preserve State F bit. */
if (bgp_flag_check (bgp, BGP_FLAG_GR_PRESERVE_FWD))
- vty_outln (vty, " bgp graceful-restart preserve-fw-state");
+ vty_out (vty, " bgp graceful-restart preserve-fw-state\n");
/* BGP bestpath method. */
if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_IGNORE))
- vty_outln (vty, " bgp bestpath as-path ignore");
+ vty_out (vty, " bgp bestpath as-path ignore\n");
if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_CONFED))
- vty_outln (vty, " bgp bestpath as-path confed");
+ vty_out (vty, " bgp bestpath as-path confed\n");
if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX))
{
if (bgp_flag_check (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET))
{
- vty_outln (vty,
- " bgp bestpath as-path multipath-relax as-set");
+ vty_out (vty,
+ " bgp bestpath as-path multipath-relax as-set\n");
}
else
{
- vty_outln (vty, " bgp bestpath as-path multipath-relax");
+ vty_out (vty, " bgp bestpath as-path multipath-relax\n");
}
}
if (bgp_flag_check (bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY)) {
- vty_outln (vty," bgp route-reflector allow-outbound-policy");
+ vty_out (vty," bgp route-reflector allow-outbound-policy\n");
}
if (bgp_flag_check (bgp, BGP_FLAG_COMPARE_ROUTER_ID))
- vty_outln (vty, " bgp bestpath compare-routerid");
+ vty_out (vty, " bgp bestpath compare-routerid\n");
if (bgp_flag_check (bgp, BGP_FLAG_MED_CONFED)
|| bgp_flag_check (bgp, BGP_FLAG_MED_MISSING_AS_WORST))
{
@@ -7570,13 +7570,13 @@ bgp_config_write (struct vty *vty)
vty_out (vty, " confed");
if (bgp_flag_check (bgp, BGP_FLAG_MED_MISSING_AS_WORST))
vty_out (vty, " missing-as-worst");
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
/* BGP network import check. */
if (!!bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK)
!= DFLT_BGP_IMPORT_CHECK)
- vty_outln (vty, " %sbgp network import-check",
+ vty_out (vty, " %sbgp network import-check\n",
bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK) ? "" : "no ");
/* BGP flag dampening. */
@@ -7587,7 +7587,7 @@ bgp_config_write (struct vty *vty)
/* BGP timers configuration. */
if (bgp->default_keepalive != BGP_DEFAULT_KEEPALIVE
&& bgp->default_holdtime != BGP_DEFAULT_HOLDTIME)
- vty_outln (vty, " timers bgp %u %u", bgp->default_keepalive,
+ vty_out (vty, " timers bgp %u %u\n", bgp->default_keepalive,
bgp->default_holdtime);
/* peer-group */
@@ -7608,7 +7608,7 @@ bgp_config_write (struct vty *vty)
/* No auto-summary */
if (bgp_option_check (BGP_OPT_CONFIG_CISCO))
- vty_outln (vty, " no auto-summary");
+ vty_out (vty, " no auto-summary\n");
/* IPv4 unicast configuration. */
write += bgp_config_write_family (vty, bgp, AFI_IP, SAFI_UNICAST);
diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c
index 4a2cea480..d04b186df 100644
--- a/bgpd/rfapi/bgp_rfapi_cfg.c
+++ b/bgpd/rfapi/bgp_rfapi_cfg.c
@@ -299,7 +299,7 @@ DEFUN (vnc_advertise_un_method,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "VNC not configured");
+ vty_out (vty, "VNC not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -345,7 +345,7 @@ set_ecom_list (
ecomadd = ecommunity_str2com (argv[0]->arg, ECOMMUNITY_ROUTE_TARGET, 0);
if (!ecomadd)
{
- vty_outln (vty, "Malformed community-list value");
+ vty_out (vty, "Malformed community-list value\n");
if (ecom)
ecommunity_free (&ecom);
return CMD_WARNING_CONFIG_FAILED;
@@ -435,12 +435,12 @@ DEFUN (vnc_defaults_rd,
if (!argv[1]->arg[8] || *end)
{
- vty_outln (vty, "%% Malformed rd");
+ vty_out (vty, "%% Malformed rd\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (value32 > 0xffff)
{
- vty_outln (vty, "%% Malformed rd (must be less than %u",
+ vty_out (vty, "%% Malformed rd (must be less than %u\n",
0x0ffff);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -460,7 +460,7 @@ DEFUN (vnc_defaults_rd,
ret = str2prefix_rd (argv[1]->arg, &prd);
if (!ret)
{
- vty_outln (vty, "%% Malformed rd");
+ vty_out (vty, "%% Malformed rd\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -491,13 +491,13 @@ DEFUN (vnc_defaults_l2rd,
value = value_l & 0xff;
if (!argv[1]->arg[0] || *end)
{
- vty_outln (vty, "%% Malformed l2 nve ID \"%s\"",argv[1]->arg);
+ vty_out (vty, "%% Malformed l2 nve ID \"%s\"\n",argv[1]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
if ((value_l < 1) || (value_l > 0xff))
{
- vty_outln (vty,
- "%% Malformed l2 nve id (must be greater than 0 and less than %u",
+ vty_out (vty,
+ "%% Malformed l2 nve id (must be greater than 0 and less than %u\n",
0x100);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -800,20 +800,20 @@ DEFUN (vnc_redistribute_rh_roo_localadmin,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "RFAPI not configured");
+ vty_out (vty, "RFAPI not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
localadmin = strtoul (argv[4]->arg, &endptr, 0);
if (!argv[4]->arg[0] || *endptr)
{
- vty_outln (vty, "%% Malformed value");
+ vty_out (vty, "%% Malformed value\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (localadmin > 0xffff)
{
- vty_outln (vty, "%% Value out of range (0-%d)", 0xffff);
+ vty_out (vty, "%% Value out of range (0-%d)\n", 0xffff);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -856,7 +856,7 @@ DEFUN (vnc_redistribute_mode,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "RFAPI not configured");
+ vty_out (vty, "RFAPI not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -876,7 +876,7 @@ DEFUN (vnc_redistribute_mode,
break;
default:
- vty_outln (vty, "unknown redistribute mode");
+ vty_out (vty, "unknown redistribute mode\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -911,13 +911,13 @@ DEFUN (vnc_redistribute_protocol,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "RFAPI not configured");
+ vty_out (vty, "RFAPI not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (rfapi_str2route_type (argv[2]->arg, argv[3]->arg, &afi, &type))
{
- vty_outln (vty, "%% Invalid route type");
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -959,13 +959,13 @@ DEFUN (vnc_no_redistribute_protocol,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "RFAPI not configured");
+ vty_out (vty, "RFAPI not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (rfapi_str2route_type (argv[3]->arg, argv[4]->arg, &afi, &type))
{
- vty_outln (vty, "%% Invalid route type");
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1000,13 +1000,13 @@ DEFUN (vnc_redistribute_bgp_exterior,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "RFAPI not configured");
+ vty_out (vty, "RFAPI not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (rfapi_str2route_type (argv[2]->arg, "bgp-direct-to-nve-groups", &afi, &type))
{
- vty_outln (vty, "%% Invalid route type");
+ vty_out (vty, "%% Invalid route type\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1032,7 +1032,7 @@ DEFUN (vnc_redistribute_nvegroup,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1065,7 +1065,7 @@ DEFUN (vnc_redistribute_no_nvegroup,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1095,7 +1095,7 @@ DEFUN (vnc_redistribute_lifetime,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1135,7 +1135,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist,
if (!(hc = bgp->rfapi_cfg))
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1188,7 +1188,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist,
if (!(hc = bgp->rfapi_cfg))
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1238,7 +1238,7 @@ DEFUN (vnc_redist_bgpdirect_no_routemap,
if (!(hc = bgp->rfapi_cfg))
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1278,7 +1278,7 @@ DEFUN (vnc_redist_bgpdirect_routemap,
if (!(hc = bgp->rfapi_cfg))
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1323,7 +1323,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1331,7 +1331,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1372,7 +1372,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1380,7 +1380,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1419,7 +1419,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1427,7 +1427,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1455,7 +1455,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1463,7 +1463,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1504,7 +1504,7 @@ DEFUN (vnc_export_mode,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "VNC not configured");
+ vty_out (vty, "VNC not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1526,13 +1526,13 @@ DEFUN (vnc_export_mode,
newmode = BGP_VNC_CONFIG_EXPORT_BGP_MODE_RH;
break;
default:
- vty_outln (vty, "Invalid mode specified");
+ vty_out (vty, "Invalid mode specified\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (newmode == oldmode)
{
- vty_outln (vty, "Mode unchanged");
+ vty_out (vty, "Mode unchanged\n");
return CMD_SUCCESS;
}
@@ -1550,7 +1550,7 @@ DEFUN (vnc_export_mode,
/*
* export to zebra with RH mode is not yet implemented
*/
- vty_outln (vty,"Changing modes for zebra export not implemented yet");
+ vty_out (vty,"Changing modes for zebra export not implemented yet\n");
return CMD_WARNING_CONFIG_FAILED;
oldmode = bgp->rfapi_cfg->flags & BGP_VNC_CONFIG_EXPORT_ZEBRA_MODE_BITS;
@@ -1590,7 +1590,7 @@ DEFUN (vnc_export_mode,
}
break;
default:
- vty_outln (vty, "Invalid mode");
+ vty_out (vty, "Invalid mode\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -1625,7 +1625,7 @@ DEFUN (vnc_export_nvegroup,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1727,7 +1727,7 @@ DEFUN (vnc_no_export_nvegroup,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1788,7 +1788,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1796,7 +1796,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1857,7 +1857,7 @@ DEFUN (vnc_nve_group_export_prefixlist,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1865,7 +1865,7 @@ DEFUN (vnc_nve_group_export_prefixlist,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1914,7 +1914,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1922,7 +1922,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1973,7 +1973,7 @@ DEFUN (vnc_nve_group_export_routemap,
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1981,7 +1981,7 @@ DEFUN (vnc_nve_group_export_routemap,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2024,7 +2024,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
if (!(hc = bgp->rfapi_cfg))
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2085,7 +2085,7 @@ DEFUN (vnc_nve_export_prefixlist,
if (!(hc = bgp->rfapi_cfg))
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2132,7 +2132,7 @@ DEFUN (vnc_nve_export_no_routemap,
if (!(hc = bgp->rfapi_cfg))
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2183,7 +2183,7 @@ DEFUN (vnc_nve_export_routemap,
if (!(hc = bgp->rfapi_cfg))
{
- vty_outln (vty, "rfapi not configured");
+ vty_out (vty, "rfapi not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2430,7 +2430,7 @@ DEFUN_NOSH (vnc_nve_group,
if (!rfg)
{
/* Error out of memory */
- vty_out (vty, "Can't allocate memory for NVE group%s", VTYNL);
+ vty_out (vty, "Can't allocate memory for NVE group\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2606,7 +2606,7 @@ bgp_rfapi_delete_nve_group (
vty_out (vty, " un=");
rfapiPrintRfapiIpAddr (vty, &rfd->un_addr);
if (vty)
- vty_outln (vty, " to new group \"%s\"",rfd->rfg->name);
+ vty_out (vty, " to new group \"%s\"\n",rfd->rfg->name);
}
}
@@ -2620,7 +2620,7 @@ bgp_rfapi_delete_nve_group (
vty_out (vty, " un=");
rfapiPrintRfapiIpAddr (vty, &rfd->un_addr);
if (vty)
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
list_delete (orphaned_nves);
}
@@ -2644,7 +2644,7 @@ bgp_rfapi_delete_named_nve_group (
if (!rfg)
{
if (vty)
- vty_outln (vty, "No NVE group named \"%s\"",rfg_name);
+ vty_out (vty, "No NVE group named \"%s\"\n",rfg_name);
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -2734,20 +2734,20 @@ DEFUN (vnc_nve_group_prefix,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (!str2prefix (argv[2]->arg, &p))
{
- vty_outln (vty, "Malformed prefix \"%s\"", argv[2]->arg);
+ vty_out (vty, "Malformed prefix \"%s\"\n", argv[2]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
afi = family2afi (p.family);
if (!afi)
{
- vty_outln (vty, "Unsupported address family");
+ vty_out (vty, "Unsupported address family\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2773,7 +2773,7 @@ DEFUN (vnc_nve_group_prefix,
/*
* different group name: fail
*/
- vty_outln (vty, "nve group \"%s\" already has \"%s\" prefix %s",
+ vty_out (vty, "nve group \"%s\" already has \"%s\" prefix %s\n",
((struct rfapi_nve_group_cfg *) (rn->info))->name,
argv[1]->arg, argv[2]->arg);
return CMD_WARNING_CONFIG_FAILED;
@@ -2853,7 +2853,7 @@ DEFUN (vnc_nve_group_rt_import,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2919,7 +2919,7 @@ DEFUN (vnc_nve_group_rt_export,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2957,7 +2957,7 @@ DEFUN (vnc_nve_group_rt_both,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3038,7 +3038,7 @@ DEFUN (vnc_nve_group_l2rd,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3054,13 +3054,13 @@ DEFUN (vnc_nve_group_l2rd,
if (!argv[1]->arg[0] || *end)
{
- vty_outln (vty, "%% Malformed l2 nve ID \"%s\"",argv[1]->arg);
+ vty_out (vty, "%% Malformed l2 nve ID \"%s\"\n",argv[1]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
if ((value_l < 1) || (value_l > 0xff))
{
- vty_outln (vty,
- "%% Malformed l2 nve id (must be greater than 0 and less than %u",
+ vty_out (vty,
+ "%% Malformed l2 nve id (must be greater than 0 and less than %u\n",
0x100);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3085,7 +3085,7 @@ DEFUN (vnc_nve_group_no_l2rd,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3110,7 +3110,7 @@ DEFUN (vnc_nve_group_rd,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3126,12 +3126,12 @@ DEFUN (vnc_nve_group_rd,
if (!argv[1]->arg[8] || *end)
{
- vty_outln (vty, "%% Malformed rd");
+ vty_out (vty, "%% Malformed rd\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (value32 > 0xffff)
{
- vty_outln (vty, "%% Malformed rd (must be less than %u",
+ vty_out (vty, "%% Malformed rd (must be less than %u\n",
0x0ffff);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3151,7 +3151,7 @@ DEFUN (vnc_nve_group_rd,
ret = str2prefix_rd (argv[1]->arg, &prd);
if (!ret)
{
- vty_outln (vty, "%% Malformed rd");
+ vty_out (vty, "%% Malformed rd\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -3186,7 +3186,7 @@ DEFUN (vnc_nve_group_responselifetime,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3255,7 +3255,7 @@ DEFUN_NOSH (vnc_vrf_policy,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTYNL);
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3268,7 +3268,7 @@ DEFUN_NOSH (vnc_vrf_policy,
if (!rfg)
{
/* Error out of memory */
- vty_out (vty, "Can't allocate memory for NVE group%s", VTYNL);
+ vty_out (vty, "Can't allocate memory for NVE group\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -3292,7 +3292,7 @@ DEFUN (vnc_no_vrf_policy,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
return bgp_rfapi_delete_named_nve_group (vty, bgp, argv[2]->arg, RFAPI_GROUP_CFG_VRF);
@@ -3311,7 +3311,7 @@ DEFUN (vnc_vrf_policy_label,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3319,7 +3319,7 @@ DEFUN (vnc_vrf_policy_label,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3352,7 +3352,7 @@ DEFUN (vnc_vrf_policy_no_label,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current VRF group no longer exists");
+ vty_out (vty, "Current VRF group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3387,7 +3387,7 @@ DEFUN (vnc_vrf_policy_nexthop,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current VRF no longer exists");
+ vty_out (vty, "Current VRF no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3398,7 +3398,7 @@ DEFUN (vnc_vrf_policy_nexthop,
if (!str2prefix (argv[1]->arg, &p) && p.family)
{
- //vty_out (vty, "Nexthop set to self%s", VTYNL);
+ //vty_out (vty, "Nexthop set to self\n");
SET_FLAG (rfg->flags, RFAPI_RFG_VPN_NH_SELF);
memset(&rfg->vn_prefix, 0, sizeof(struct prefix));
}
@@ -3437,7 +3437,7 @@ DEFUN (vnc_vrf_policy_rt_import,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3445,7 +3445,7 @@ DEFUN (vnc_vrf_policy_rt_import,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3509,7 +3509,7 @@ DEFUN (vnc_vrf_policy_rt_export,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3517,7 +3517,7 @@ DEFUN (vnc_vrf_policy_rt_export,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3553,7 +3553,7 @@ DEFUN (vnc_vrf_policy_rt_both,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3561,7 +3561,7 @@ DEFUN (vnc_vrf_policy_rt_both,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3641,7 +3641,7 @@ DEFUN (vnc_vrf_policy_rd,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3649,7 +3649,7 @@ DEFUN (vnc_vrf_policy_rd,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3665,12 +3665,12 @@ DEFUN (vnc_vrf_policy_rd,
if (!*(argv[1]->arg + 5) || *end)
{
- vty_outln (vty, "%% Malformed rd");
+ vty_out (vty, "%% Malformed rd\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (value32 > 0xffff)
{
- vty_outln (vty, "%% Malformed rd (must be less than %u",
+ vty_out (vty, "%% Malformed rd (must be less than %u\n",
0x0ffff);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3690,7 +3690,7 @@ DEFUN (vnc_vrf_policy_rd,
ret = str2prefix_rd (argv[1]->arg, &prd);
if (!ret)
{
- vty_outln (vty, "%% Malformed rd");
+ vty_out (vty, "%% Malformed rd\n");
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -3742,7 +3742,7 @@ DEFUN_NOSH (vnc_l2_group,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTYNL);
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3755,7 +3755,7 @@ DEFUN_NOSH (vnc_l2_group,
if (!rfg)
{
/* Error out of memory */
- vty_out (vty, "Can't allocate memory for L2 group%s", VTYNL);
+ vty_out (vty, "Can't allocate memory for L2 group\n");
return CMD_WARNING_CONFIG_FAILED;
}
rfg->name = strdup (argv[1]->arg);
@@ -3808,7 +3808,7 @@ bgp_rfapi_delete_named_l2_group (
if (!rfg)
{
if (vty)
- vty_outln (vty, "No L2 group named \"%s\"",rfg_name);
+ vty_out (vty, "No L2 group named \"%s\"\n",rfg_name);
return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -3833,7 +3833,7 @@ DEFUN (vnc_no_l2_group,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
return bgp_rfapi_delete_named_l2_group (vty, bgp, argv[3]->arg);
@@ -3851,7 +3851,7 @@ DEFUN (vnc_l2_group_lni,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3859,7 +3859,7 @@ DEFUN (vnc_l2_group_lni,
if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current L2 group no longer exists");
+ vty_out (vty, "Current L2 group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3880,7 +3880,7 @@ DEFUN (vnc_l2_group_labels,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3888,7 +3888,7 @@ DEFUN (vnc_l2_group_labels,
if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current L2 group no longer exists");
+ vty_out (vty, "Current L2 group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3924,7 +3924,7 @@ DEFUN (vnc_l2_group_no_labels,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3932,14 +3932,14 @@ DEFUN (vnc_l2_group_no_labels,
if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current L2 group no longer exists");
+ vty_out (vty, "Current L2 group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
ll = rfg->labels;
if (ll == NULL)
{
- vty_outln (vty, "Label no longer associated with group");
+ vty_out (vty, "Label no longer associated with group\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3981,13 +3981,13 @@ DEFUN (vnc_l2_group_rt,
do_export = 1;
break;
default:
- vty_outln (vty, "Unknown option, %s", argv[1]->arg);
+ vty_out (vty, "Unknown option, %s\n", argv[1]->arg);
return CMD_ERR_NO_MATCH;
}
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3995,7 +3995,7 @@ DEFUN (vnc_l2_group_rt,
if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current L2 group no longer exists");
+ vty_out (vty, "Current L2 group no longer exists\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4271,20 +4271,20 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (bgp->rfapi == NULL || hc == NULL)
return write;
- vty_outln (vty, "!");
+ vty_out (vty, "!\n");
for (ALL_LIST_ELEMENTS (hc->nve_groups_sequential, node, nnode, rfg))
if (rfg->type == RFAPI_GROUP_CFG_VRF)
{
++write;
- vty_outln (vty, " vrf-policy %s", rfg->name);
+ vty_out (vty, " vrf-policy %s\n", rfg->name);
if (rfg->label <= MPLS_LABEL_MAX)
{
- vty_outln (vty, " label %u", rfg->label);
+ vty_out (vty, " label %u\n", rfg->label);
}
if (CHECK_FLAG (rfg->flags, RFAPI_RFG_VPN_NH_SELF))
{
- vty_outln (vty, " nexthop self");
+ vty_out (vty, " nexthop self\n");
}
else
@@ -4296,11 +4296,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
inet_ntop(rfg->vn_prefix.family, &rfg->vn_prefix.u.prefix, buf, sizeof(buf));
if (!buf[0] || buf[BUFSIZ - 1])
{
- //vty_out (vty, "nexthop self%s", VTYNL);
+ //vty_out (vty, "nexthop self\n");
}
else
{
- vty_outln (vty, " nexthop %s", buf);
+ vty_out (vty, " nexthop %s\n", buf);
}
}
}
@@ -4318,7 +4318,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
value = ((rfg->rd.val[6] << 8) & 0x0ff00) |
(rfg->rd.val[7] & 0x0ff);
- vty_outln (vty, " rd auto:nh:%d", value);
+ vty_out (vty, " rd auto:nh:%d\n", value);
}
else
@@ -4328,11 +4328,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
!buf[0] || buf[BUFSIZ - 1])
{
- vty_outln (vty, "!Error: Can't convert rd");
+ vty_out (vty, "!Error: Can't convert rd\n");
}
else
{
- vty_outln (vty, " rd %s", buf);
+ vty_out (vty, " rd %s\n", buf);
}
}
}
@@ -4342,7 +4342,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
{
char *b = ecommunity_ecom2str (rfg->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt both %s", b);
+ vty_out (vty, " rt both %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
else
@@ -4351,14 +4351,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
{
char *b = ecommunity_ecom2str (rfg->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt import %s", b);
+ vty_out (vty, " rt import %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
if (rfg->rt_export_list)
{
char *b = ecommunity_ecom2str (rfg->rt_export_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt export %s", b);
+ vty_out (vty, " rt export %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
}
@@ -4373,12 +4373,12 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (rfg->plist_export_bgp_name[afi])
{
- vty_outln (vty, " export bgp %s prefix-list %s",
+ vty_out (vty, " export bgp %s prefix-list %s\n",
afistr,rfg->plist_export_bgp_name[afi]);
}
if (rfg->plist_export_zebra_name[afi])
{
- vty_outln (vty, " export zebra %s prefix-list %s",
+ vty_out (vty, " export zebra %s prefix-list %s\n",
afistr,rfg->plist_export_zebra_name[afi]);
}
/*
@@ -4388,14 +4388,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
*/
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi])
{
- vty_outln (vty, " redistribute bgp-direct %s prefix-list %s",
+ vty_out (vty, " redistribute bgp-direct %s prefix-list %s\n",
afistr,
rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]);
}
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi])
{
- vty_outln (vty,
- " redistribute bgp-direct-to-nve-groups %s prefix-list %s",
+ vty_out (vty,
+ " redistribute bgp-direct-to-nve-groups %s prefix-list %s\n",
afistr,
rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi]);
}
@@ -4403,31 +4403,31 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (rfg->routemap_export_bgp_name)
{
- vty_outln (vty, " export bgp route-map %s",
+ vty_out (vty, " export bgp route-map %s\n",
rfg->routemap_export_bgp_name);
}
if (rfg->routemap_export_zebra_name)
{
- vty_outln (vty, " export zebra route-map %s",
+ vty_out (vty, " export zebra route-map %s\n",
rfg->routemap_export_zebra_name);
}
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT])
{
- vty_outln (vty, " redistribute bgp-direct route-map %s",
+ vty_out (vty, " redistribute bgp-direct route-map %s\n",
rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]);
}
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT])
{
- vty_outln (vty,
- " redistribute bgp-direct-to-nve-groups route-map %s",
+ vty_out (vty,
+ " redistribute bgp-direct-to-nve-groups route-map %s\n",
rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]);
}
- vty_outln (vty, " exit-vrf-policy");
- vty_outln (vty, "!");
+ vty_out (vty, " exit-vrf-policy\n");
+ vty_out (vty, "!\n");
}
if (hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP)
{
- vty_outln (vty, " vnc advertise-un-method encap-safi");
+ vty_out (vty, " vnc advertise-un-method encap-safi\n");
write++;
}
@@ -4437,7 +4437,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
write += (bgp->rfapi->rfp_methods.cfg_cb) (vty, bgp->rfapi->rfp);
if (write)
- vty_outln (vty, "!");
+ vty_out (vty, "!\n");
if (hc->l2_groups)
{
@@ -4448,9 +4448,9 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
struct listnode *lnode;
void *data;
++write;
- vty_outln (vty, " vnc l2-group %s", rfg->name);
+ vty_out (vty, " vnc l2-group %s\n", rfg->name);
if (rfg->logical_net_id != 0)
- vty_outln (vty, " logical-network-id %u",
+ vty_out (vty, " logical-network-id %u\n",
rfg->logical_net_id);
if (rfg->labels != NULL && listhead (rfg->labels) != NULL)
{
@@ -4459,7 +4459,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
{
vty_out (vty, "%hu ", (uint16_t) ((uintptr_t) data));
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
if (rfg->rt_import_list && rfg->rt_export_list &&
@@ -4467,7 +4467,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
{
char *b = ecommunity_ecom2str (rfg->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt both %s", b);
+ vty_out (vty, " rt both %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
else
@@ -4476,14 +4476,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
{
char *b = ecommunity_ecom2str (rfg->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt import %s", b);
+ vty_out (vty, " rt import %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
if (rfg->rt_export_list)
{
char *b = ecommunity_ecom2str (rfg->rt_export_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt export %s", b);
+ vty_out (vty, " rt export %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
}
@@ -4494,8 +4494,8 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
RFAPI_RFP_CFG_GROUP_L2,
rfg->name,
rfg->rfp_cfg);
- vty_outln (vty, " exit-vnc");
- vty_outln (vty, "!");
+ vty_out (vty, " exit-vnc\n");
+ vty_out (vty, "!\n");
}
}
@@ -4507,7 +4507,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
++write;
- vty_outln (vty, " vnc defaults");
+ vty_out (vty, " vnc defaults\n");
if (hc->default_rd.prefixlen)
{
@@ -4521,7 +4521,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
value = ((hc->default_rd.val[6] << 8) & 0x0ff00) |
(hc->default_rd.val[7] & 0x0ff);
- vty_outln (vty, " rd auto:vn:%d", value);
+ vty_out (vty, " rd auto:vn:%d\n", value);
}
else
@@ -4531,11 +4531,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
!buf[0] || buf[BUFSIZ - 1])
{
- vty_outln (vty, "!Error: Can't convert rd");
+ vty_out (vty, "!Error: Can't convert rd\n");
}
else
{
- vty_outln (vty, " rd %s", buf);
+ vty_out (vty, " rd %s\n", buf);
}
}
}
@@ -4546,7 +4546,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
vty_out (vty, "%d", hc->default_response_lifetime);
else
vty_out (vty, "infinite");
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
if (hc->default_rt_import_list && hc->default_rt_export_list &&
ecommunity_cmp (hc->default_rt_import_list,
@@ -4554,7 +4554,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
{
char *b = ecommunity_ecom2str (hc->default_rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt both %s", b);
+ vty_out (vty, " rt both %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
else
@@ -4563,14 +4563,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
{
char *b = ecommunity_ecom2str (hc->default_rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt import %s", b);
+ vty_out (vty, " rt import %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
if (hc->default_rt_export_list)
{
char *b = ecommunity_ecom2str (hc->default_rt_export_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt export %s", b);
+ vty_out (vty, " rt export %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
}
@@ -4581,15 +4581,15 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
RFAPI_RFP_CFG_GROUP_DEFAULT,
NULL,
bgp->rfapi_cfg->default_rfp_cfg);
- vty_outln (vty, " exit-vnc");
- vty_outln (vty, "!");
+ vty_out (vty, " exit-vnc\n");
+ vty_out (vty, "!\n");
}
for (ALL_LIST_ELEMENTS (hc->nve_groups_sequential, node, nnode, rfg))
if (rfg->type == RFAPI_GROUP_CFG_NVE)
{
++write;
- vty_outln (vty, " vnc nve-group %s", rfg->name);
+ vty_out (vty, " vnc nve-group %s\n", rfg->name);
if (rfg->vn_prefix.family && rfg->vn_node)
{
@@ -4599,11 +4599,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
prefix2str (&rfg->vn_prefix, buf, BUFSIZ);
if (!buf[0] || buf[BUFSIZ - 1])
{
- vty_outln (vty, "!Error: Can't convert prefix");
+ vty_out (vty, "!Error: Can't convert prefix\n");
}
else
{
- vty_outln (vty, " prefix %s %s", "vn", buf);
+ vty_out (vty, " prefix %s %s\n", "vn", buf);
}
}
@@ -4614,11 +4614,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
prefix2str (&rfg->un_prefix, buf, BUFSIZ);
if (!buf[0] || buf[BUFSIZ - 1])
{
- vty_outln (vty, "!Error: Can't convert prefix");
+ vty_out (vty, "!Error: Can't convert prefix\n");
}
else
{
- vty_outln (vty, " prefix %s %s", "un", buf);
+ vty_out (vty, " prefix %s %s\n", "un", buf);
}
}
@@ -4636,7 +4636,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
value = ((rfg->rd.val[6] << 8) & 0x0ff00) |
(rfg->rd.val[7] & 0x0ff);
- vty_outln (vty, " rd auto:vn:%d", value);
+ vty_out (vty, " rd auto:vn:%d\n", value);
}
else
@@ -4646,11 +4646,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
!buf[0] || buf[BUFSIZ - 1])
{
- vty_outln (vty, "!Error: Can't convert rd");
+ vty_out (vty, "!Error: Can't convert rd\n");
}
else
{
- vty_outln (vty, " rd %s", buf);
+ vty_out (vty, " rd %s\n", buf);
}
}
}
@@ -4661,7 +4661,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
vty_out (vty, "%d", rfg->response_lifetime);
else
vty_out (vty, "infinite");
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
if (rfg->rt_import_list && rfg->rt_export_list &&
@@ -4670,7 +4670,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
char *b = ecommunity_ecom2str (rfg->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP,
ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt both %s", b);
+ vty_out (vty, " rt both %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
else
@@ -4680,14 +4680,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
char *b = ecommunity_ecom2str (rfg->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP,
ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt import %s", b);
+ vty_out (vty, " rt import %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
if (rfg->rt_export_list)
{
char *b = ecommunity_ecom2str (rfg->rt_export_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET);
- vty_outln (vty, " rt export %s", b);
+ vty_out (vty, " rt export %s\n", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
}
@@ -4702,12 +4702,12 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (rfg->plist_export_bgp_name[afi])
{
- vty_outln (vty, " export bgp %s prefix-list %s",
+ vty_out (vty, " export bgp %s prefix-list %s\n",
afistr,rfg->plist_export_bgp_name[afi]);
}
if (rfg->plist_export_zebra_name[afi])
{
- vty_outln (vty, " export zebra %s prefix-list %s",
+ vty_out (vty, " export zebra %s prefix-list %s\n",
afistr,rfg->plist_export_zebra_name[afi]);
}
/*
@@ -4717,14 +4717,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
*/
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi])
{
- vty_outln (vty, " redistribute bgp-direct %s prefix-list %s",
+ vty_out (vty, " redistribute bgp-direct %s prefix-list %s\n",
afistr,
rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]);
}
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi])
{
- vty_outln (vty,
- " redistribute bgp-direct-to-nve-groups %s prefix-list %s",
+ vty_out (vty,
+ " redistribute bgp-direct-to-nve-groups %s prefix-list %s\n",
afistr,
rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi]);
}
@@ -4732,23 +4732,23 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (rfg->routemap_export_bgp_name)
{
- vty_outln (vty, " export bgp route-map %s",
+ vty_out (vty, " export bgp route-map %s\n",
rfg->routemap_export_bgp_name);
}
if (rfg->routemap_export_zebra_name)
{
- vty_outln (vty, " export zebra route-map %s",
+ vty_out (vty, " export zebra route-map %s\n",
rfg->routemap_export_zebra_name);
}
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT])
{
- vty_outln (vty, " redistribute bgp-direct route-map %s",
+ vty_out (vty, " redistribute bgp-direct route-map %s\n",
rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]);
}
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT])
{
- vty_outln (vty,
- " redistribute bgp-direct-to-nve-groups route-map %s",
+ vty_out (vty,
+ " redistribute bgp-direct-to-nve-groups route-map %s\n",
rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]);
}
if (bgp->rfapi->rfp_methods.cfg_group_cb)
@@ -4757,8 +4757,8 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
bgp->rfapi->rfp,
RFAPI_RFP_CFG_GROUP_NVE,
rfg->name, rfg->rfp_cfg);
- vty_outln (vty, " exit-vnc");
- vty_outln (vty, "!");
+ vty_out (vty, " exit-vnc\n");
+ vty_out (vty, "!\n");
}
} /* have listen ports */
@@ -4767,24 +4767,24 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
*/
if (VNC_EXPORT_BGP_GRP_ENABLED (hc))
{
- vty_outln (vty, " vnc export bgp mode group-nve");
+ vty_out (vty, " vnc export bgp mode group-nve\n");
}
else if (VNC_EXPORT_BGP_RH_ENABLED (hc))
{
- vty_outln (vty, " vnc export bgp mode registering-nve");
+ vty_out (vty, " vnc export bgp mode registering-nve\n");
}
else if (VNC_EXPORT_BGP_CE_ENABLED (hc))
{
- vty_outln (vty, " vnc export bgp mode ce");
+ vty_out (vty, " vnc export bgp mode ce\n");
}
if (VNC_EXPORT_ZEBRA_GRP_ENABLED (hc))
{
- vty_outln (vty, " vnc export zebra mode group-nve");
+ vty_out (vty, " vnc export zebra mode group-nve\n");
}
else if (VNC_EXPORT_ZEBRA_RH_ENABLED (hc))
{
- vty_outln (vty, " vnc export zebra mode registering-nve");
+ vty_out (vty, " vnc export zebra mode registering-nve\n");
}
if (hc->rfg_export_direct_bgp_l)
@@ -4792,7 +4792,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
for (ALL_LIST_ELEMENTS (hc->rfg_export_direct_bgp_l, node, nnode, rfgn))
{
- vty_outln (vty, " vnc export bgp group-nve group %s",
+ vty_out (vty, " vnc export bgp group-nve group %s\n",
rfgn->name);
}
}
@@ -4802,7 +4802,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
for (ALL_LIST_ELEMENTS (hc->rfg_export_zebra_l, node, nnode, rfgn))
{
- vty_outln (vty, " vnc export zebra group-nve group %s",
+ vty_out (vty, " vnc export zebra group-nve group %s\n",
rfgn->name);
}
}
@@ -4810,19 +4810,19 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (hc->rfg_redist_name)
{
- vty_outln (vty, " vnc redistribute nve-group %s",
+ vty_out (vty, " vnc redistribute nve-group %s\n",
hc->rfg_redist_name);
}
if (hc->redist_lifetime)
{
- vty_outln (vty, " vnc redistribute lifetime %d",
+ vty_out (vty, " vnc redistribute lifetime %d\n",
hc->redist_lifetime);
}
if (hc->resolve_nve_roo_local_admin !=
BGP_VNC_CONFIG_RESOLVE_NVE_ROO_LOCAL_ADMIN_DEFAULT)
{
- vty_outln (vty, " vnc redistribute resolve-nve roo-ec-local-admin %d",
+ vty_out (vty, " vnc redistribute resolve-nve roo-ec-local-admin %d\n",
hc->resolve_nve_roo_local_admin);
}
@@ -4844,7 +4844,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
}
if (s)
{
- vty_outln (vty, " vnc redistribute mode %s", s);
+ vty_out (vty, " vnc redistribute mode %s\n", s);
}
}
@@ -4858,34 +4858,34 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (hc->plist_export_bgp_name[afi])
{
- vty_outln (vty, " vnc export bgp %s prefix-list %s",
+ vty_out (vty, " vnc export bgp %s prefix-list %s\n",
afistr, hc->plist_export_bgp_name[afi]);
}
if (hc->plist_export_zebra_name[afi])
{
- vty_outln (vty, " vnc export zebra %s prefix-list %s",
+ vty_out (vty, " vnc export zebra %s prefix-list %s\n",
afistr, hc->plist_export_zebra_name[afi]);
}
if (hc->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi])
{
- vty_outln (vty, " vnc redistribute bgp-direct %s prefix-list %s",
+ vty_out (vty, " vnc redistribute bgp-direct %s prefix-list %s\n",
afistr,hc->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]);
}
}
if (hc->routemap_export_bgp_name)
{
- vty_outln (vty, " vnc export bgp route-map %s",
+ vty_out (vty, " vnc export bgp route-map %s\n",
hc->routemap_export_bgp_name);
}
if (hc->routemap_export_zebra_name)
{
- vty_outln (vty, " vnc export zebra route-map %s",
+ vty_out (vty, " vnc export zebra route-map %s\n",
hc->routemap_export_zebra_name);
}
if (hc->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT])
{
- vty_outln (vty, " vnc redistribute bgp-direct route-map %s",
+ vty_out (vty, " vnc redistribute bgp-direct route-map %s\n",
hc->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]);
}
@@ -4898,14 +4898,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (type == ZEBRA_ROUTE_BGP_DIRECT_EXT &&
hc->redist_bgp_exterior_view_name)
{
- vty_outln (vty, " vnc redistribute %s %s view %s",
+ vty_out (vty, " vnc redistribute %s %s view %s\n",
((afi == AFI_IP) ? "ipv4" : "ipv6"),
zebra_route_string (type),
hc->redist_bgp_exterior_view_name);
}
else
{
- vty_outln (vty, " vnc redistribute %s %s",
+ vty_out (vty, " vnc redistribute %s %s\n",
((afi == AFI_IP) ? "ipv4" : "ipv6"),
zebra_route_string(type));
}
@@ -4924,7 +4924,7 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty)
if (hc == NULL)
return;
- vty_outln (vty, "%-39s %-19s %s", "VNC Advertise method:",
+ vty_out (vty, "%-39s %-19s %s\n", "VNC Advertise method:",
(hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP
? "Encapsulation SAFI" : "Tunnel Encap attribute"),
((hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP) == (BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP & BGP_VNC_CONFIG_FLAGS_DEFAULT) ? "(default)" : ""));
@@ -4991,7 +4991,7 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty)
vty_out (vty, "%sToZebra {Registering NVE}", (redist == 1 ? "" : " "));
/* note filters, route-maps not shown */
}
- vty_outln (vty, "%-19s %s", (redist ? "" : "Off"),
+ vty_out (vty, "%-19s %s\n", (redist ? "" : "Off"),
(redist ? "" : "(default)"));
/* Redistribution */
@@ -5010,28 +5010,28 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty)
}
}
}
- vty_outln (vty, "%-19s %s", (redist ? "" : "Off"),
+ vty_out (vty, "%-19s %s\n", (redist ? "" : "Off"),
(redist ? "" : "(default)"));
- vty_outln (vty, "%-39s %3u%-16s %s", "RFP Registration Hold-Down Factor:",
+ vty_out (vty, "%-39s %3u%-16s %s\n", "RFP Registration Hold-Down Factor:",
hc->rfp_cfg.holddown_factor, "%",
(hc->rfp_cfg.holddown_factor == RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR ? "(default)" : ""));
- vty_outln (vty, "%-39s %-19s %s", "RFP Updated responses:",
+ vty_out (vty, "%-39s %-19s %s\n", "RFP Updated responses:",
(hc->rfp_cfg.use_updated_response == 0 ? "Off" : "On"),
(hc->rfp_cfg.use_updated_response == 0 ? "(default)" : ""));
- vty_outln (vty, "%-39s %-19s %s", "RFP Removal responses:",
+ vty_out (vty, "%-39s %-19s %s\n", "RFP Removal responses:",
(hc->rfp_cfg.use_removes == 0 ? "Off" : "On"),
(hc->rfp_cfg.use_removes == 0 ? "(default)" : ""));
- vty_outln (vty, "%-39s %-19s %s", "RFP Full table download:",
+ vty_out (vty, "%-39s %-19s %s\n", "RFP Full table download:",
(hc->rfp_cfg.download_type ==
RFAPI_RFP_DOWNLOAD_FULL ? "On" : "Off"),
(hc->rfp_cfg.download_type == RFAPI_RFP_DOWNLOAD_PARTIAL ? "(default)" : ""));
sprintf (tmp, "%u seconds", hc->rfp_cfg.ftd_advertisement_interval);
- vty_outln (vty, "%-39s %-19s %s", " Advertisement Interval:", tmp,
+ vty_out (vty, "%-39s %-19s %s\n", " Advertisement Interval:", tmp,
(hc->rfp_cfg.ftd_advertisement_interval == RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL ? "(default)" : ""));
- vty_outln (vty, "%-39s %d seconds", "Default RFP response lifetime:",
+ vty_out (vty, "%-39s %d seconds\n", "Default RFP response lifetime:",
hc->default_response_lifetime);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
return;
}
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c
index 1ea8004e2..89f69637f 100644
--- a/bgpd/rfapi/rfapi.c
+++ b/bgpd/rfapi/rfapi.c
@@ -3101,12 +3101,12 @@ DEFUN (
if (!str2prefix (argv[5]->arg, &pfx))
{
- vty_outln (vty, "Malformed address \"%s\"", argv[5]->arg);
+ vty_out (vty, "Malformed address \"%s\"\n", argv[5]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
if (pfx.family != AF_INET && pfx.family != AF_INET6)
{
- vty_outln (vty, "Invalid address \"%s\"", argv[5]->arg);
+ vty_out (vty, "Invalid address \"%s\"\n", argv[5]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3144,7 +3144,7 @@ test_nexthops_callback (
fp (out, "Nexthops Callback, Target=(");
//rfapiPrintRfapiIpAddr(stream, target);
- fp (out, ")%s", VTYNL);
+ fp (out, ")\n");
rfapiPrintNhl (stream, next_hops);
@@ -3185,12 +3185,12 @@ DEFUN (debug_rfapi_open,
rc = rfapi_open (rfapi_get_rfp_start_val_by_bgp (bgp_get_default ()),
&vn, &un, /*&uo */ NULL, &lifetime, NULL, &handle);
- vty_outln (vty, "rfapi_open: status %d, handle %p, lifetime %d",
+ vty_out (vty, "rfapi_open: status %d, handle %p, lifetime %d\n",
rc, handle, lifetime);
rc = rfapi_set_response_cb (handle, test_nexthops_callback);
- vty_outln (vty, "rfapi_set_response_cb: status %d", rc);
+ vty_out (vty, "rfapi_set_response_cb: status %d\n", rc);
return CMD_SUCCESS;
}
@@ -3230,14 +3230,14 @@ DEFUN (debug_rfapi_close_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle))
{
- vty_outln (vty, "can't locate handle matching vn=%s, un=%s",
+ vty_out (vty, "can't locate handle matching vn=%s, un=%s\n",
argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
rc = rfapi_close (handle);
- vty_outln (vty, "rfapi_close(handle=%p): status %d", handle,rc);
+ vty_out (vty, "rfapi_close(handle=%p): status %d\n", handle,rc);
return CMD_SUCCESS;
}
@@ -3258,13 +3258,13 @@ DEFUN (debug_rfapi_close_rfd,
if (*endptr != '\0' || (uintptr_t) handle == UINTPTR_MAX)
{
- vty_outln (vty, "Invalid value: %s", argv[4]->arg);
+ vty_out (vty, "Invalid value: %s\n", argv[4]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
rc = rfapi_close (handle);
- vty_outln (vty, "rfapi_close(handle=%p): status %d", handle,rc);
+ vty_out (vty, "rfapi_close(handle=%p): status %d\n", handle,rc);
return CMD_SUCCESS;
}
@@ -3311,7 +3311,7 @@ DEFUN (debug_rfapi_register_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle))
{
- vty_outln (vty, "can't locate handle matching vn=%s, un=%s",
+ vty_out (vty, "can't locate handle matching vn=%s, un=%s\n",
argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3321,12 +3321,12 @@ DEFUN (debug_rfapi_register_vn_un,
*/
if (!str2prefix (argv[8]->arg, &pfx))
{
- vty_outln (vty, "Malformed prefix \"%s\"", argv[8]->arg);
+ vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
if (pfx.family != AF_INET && pfx.family != AF_INET6)
{
- vty_outln (vty, "Bad family for prefix \"%s\"", argv[8]->arg);
+ vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
rfapiQprefix2Rprefix (&pfx, &hpfx);
@@ -3344,7 +3344,7 @@ DEFUN (debug_rfapi_register_vn_un,
rc = rfapi_register (handle, &hpfx, lifetime, NULL, NULL, 0);
if (rc)
{
- vty_outln (vty, "rfapi_register failed with rc=%d (%s)", rc,
+ vty_out (vty, "rfapi_register failed with rc=%d (%s)\n", rc,
strerror(rc));
}
@@ -3400,7 +3400,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle))
{
- vty_outln (vty, "can't locate handle matching vn=%s, un=%s",
+ vty_out (vty, "can't locate handle matching vn=%s, un=%s\n",
argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3410,12 +3410,12 @@ DEFUN (debug_rfapi_register_vn_un_l2o,
*/
if (!str2prefix (argv[8]->arg, &pfx))
{
- vty_outln (vty, "Malformed prefix \"%s\"", argv[8]->arg);
+ vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
if (pfx.family != AF_INET && pfx.family != AF_INET6)
{
- vty_outln (vty, "Bad family for prefix \"%s\"", argv[8]->arg);
+ vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
rfapiQprefix2Rprefix (&pfx, &hpfx);
@@ -3434,7 +3434,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o,
optary[opt_next].v.l2addr.logical_net_id = strtoul(argv[14]->arg, NULL, 10);
if ((rc = rfapiStr2EthAddr (argv[12]->arg, &optary[opt_next].v.l2addr.macaddr)))
{
- vty_outln (vty, "Bad mac address \"%s\"", argv[12]->arg);
+ vty_out (vty, "Bad mac address \"%s\"\n", argv[12]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
optary[opt_next].type = RFAPI_VN_OPTION_TYPE_L2ADDR;
@@ -3453,7 +3453,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o,
rc = rfapi_register (handle, &hpfx, lifetime, NULL /* &uo */ , opt, 0);
if (rc)
{
- vty_outln (vty, "rfapi_register failed with rc=%d (%s)", rc,
+ vty_out (vty, "rfapi_register failed with rc=%d (%s)\n", rc,
strerror(rc));
}
@@ -3496,7 +3496,7 @@ DEFUN (debug_rfapi_unregister_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle))
{
- vty_outln (vty, "can't locate handle matching vn=%s, un=%s",
+ vty_out (vty, "can't locate handle matching vn=%s, un=%s\n",
argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3506,12 +3506,12 @@ DEFUN (debug_rfapi_unregister_vn_un,
*/
if (!str2prefix (argv[8]->arg, &pfx))
{
- vty_outln (vty, "Malformed prefix \"%s\"", argv[8]->arg);
+ vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
if (pfx.family != AF_INET && pfx.family != AF_INET6)
{
- vty_outln (vty, "Bad family for prefix \"%s\"", argv[8]->arg);
+ vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
rfapiQprefix2Rprefix (&pfx, &hpfx);
@@ -3567,7 +3567,7 @@ DEFUN (debug_rfapi_query_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle))
{
- vty_outln (vty, "can't locate handle matching vn=%s, un=%s",
+ vty_out (vty, "can't locate handle matching vn=%s, un=%s\n",
argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3579,7 +3579,7 @@ DEFUN (debug_rfapi_query_vn_un,
if (rc)
{
- vty_outln (vty, "rfapi_query failed with rc=%d (%s)", rc,
+ vty_out (vty, "rfapi_query failed with rc=%d (%s)\n", rc,
strerror(rc));
}
else
@@ -3642,13 +3642,13 @@ DEFUN (debug_rfapi_query_vn_un_l2o,
if ((rc = rfapiCliGetRfapiIpAddr (vty, argv[2], &target)))
return rc;
#else
- vty_outln (vty, "%% This command is broken.");
+ vty_out (vty, "%% This command is broken.\n");
return CMD_WARNING_CONFIG_FAILED;
#endif
if (rfapi_find_handle_vty (vty, &vn, &un, &handle))
{
- vty_outln (vty, "can't locate handle matching vn=%s, un=%s",
+ vty_out (vty, "can't locate handle matching vn=%s, un=%s\n",
argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3659,7 +3659,7 @@ DEFUN (debug_rfapi_query_vn_un_l2o,
memset (&l2o_buf, 0, sizeof (l2o_buf));
if (rfapiStr2EthAddr (argv[10]->arg, &l2o_buf.macaddr))
{
- vty_outln (vty, "Bad mac address \"%s\"", argv[10]->arg);
+ vty_out (vty, "Bad mac address \"%s\"\n", argv[10]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3688,7 +3688,7 @@ DEFUN (debug_rfapi_query_vn_un_l2o,
if (rc)
{
- vty_outln (vty, "rfapi_query failed with rc=%d (%s)", rc,
+ vty_out (vty, "rfapi_query failed with rc=%d (%s)\n", rc,
strerror(rc));
}
else
@@ -3750,7 +3750,7 @@ DEFUN (debug_rfapi_query_done_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle))
{
- vty_outln (vty, "can't locate handle matching vn=%s, un=%s",
+ vty_out (vty, "can't locate handle matching vn=%s, un=%s\n",
argv[5]->arg, argv[7]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3760,7 +3760,7 @@ DEFUN (debug_rfapi_query_done_vn_un,
*/
rc = rfapi_query_done (handle, &target);
- vty_outln (vty, "rfapi_query_done returned %d", rc);
+ vty_out (vty, "rfapi_query_done returned %d\n", rc);
return CMD_SUCCESS;
}
@@ -3786,14 +3786,14 @@ DEFUN (debug_rfapi_show_import,
bgp = bgp_get_default (); /* assume 1 instance for now */
if (!bgp)
{
- vty_outln (vty, "No BGP instance");
+ vty_out (vty, "No BGP instance\n");
return CMD_WARNING_CONFIG_FAILED;
}
h = bgp->rfapi;
if (!h)
{
- vty_outln (vty, "No RFAPI instance");
+ vty_out (vty, "No RFAPI instance\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3807,7 +3807,7 @@ DEFUN (debug_rfapi_show_import,
{
s = ecommunity_ecom2str (it->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
- vty_outln (vty, "Import Table %p, RTs: %s", it, s);
+ vty_out (vty, "Import Table %p, RTs: %s\n", it, s);
XFREE (MTYPE_ECOMMUNITY_STR, s);
rfapiShowImportTable (vty, "IP VPN", it->imported_vpn[AFI_IP], 1);
@@ -3837,8 +3837,7 @@ DEFUN (debug_rfapi_show_import,
lni = lni_as_ptr;
if (first_l2)
{
- vty_outln (vty, "%sLNI-based Ethernet Tables:",
- VTYNL);
+ vty_out (vty, "\nLNI-based Ethernet Tables:\n");
first_l2 = 0;
}
snprintf (buf, BUFSIZ, "L2VPN LNI=%u", lni);
@@ -3889,7 +3888,7 @@ DEFUN (debug_rfapi_show_import_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle))
{
- vty_outln (vty, "can't locate handle matching vn=%s, un=%s",
+ vty_out (vty, "can't locate handle matching vn=%s, un=%s\n",
argv[5]->arg, argv[7]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3920,12 +3919,12 @@ DEFUN (debug_rfapi_response_omit_self,
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (!bgp->rfapi_cfg)
{
- vty_outln (vty, "VNC not configured");
+ vty_out (vty, "VNC not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -4191,7 +4190,7 @@ rfapi_rfp_get_or_init_group_config_nve (
if (!rfg || !listnode_lookup (rfc->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current NVE group no longer exists");
+ vty_out (vty, "Current NVE group no longer exists\n");
return NULL;
}
@@ -4216,7 +4215,7 @@ rfapi_rfp_get_or_init_group_config_l2 (
if (!rfg || !listnode_lookup (rfc->l2_groups, rfg))
{
/* Not in list anymore */
- vty_outln (vty, "Current L2 group no longer exists");
+ vty_out (vty, "Current L2 group no longer exists\n");
return NULL;
}
if (rfg->rfp_cfg == NULL && size > 0)
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
index 5c3976a0c..380b04757 100644
--- a/bgpd/rfapi/rfapi_rib.c
+++ b/bgpd/rfapi/rfapi_rib.c
@@ -2294,7 +2294,7 @@ rfapiRibShowResponsesSummary (void *stream)
fp (out, "%-24s ", "Responses: (Prefixes)");
fp (out, "%-8s %-8u ", "Active:", bgp->rfapi->rib_prefix_count_total);
fp (out, "%-8s %-8u", "Maximum:", bgp->rfapi->rib_prefix_count_total_max);
- fp (out, "%s", VTYNL);
+ fp (out, "\n");
fp (out, "%-24s ", " (Updated)");
fp (out, "%-8s %-8u ", "Update:",
@@ -2304,7 +2304,7 @@ rfapiRibShowResponsesSummary (void *stream)
fp (out, "%-8s %-8u", "Total:",
bgp->rfapi->stat.count_updated_response_updates +
bgp->rfapi->stat.count_updated_response_deletes);
- fp (out, "%s", VTYNL);
+ fp (out, "\n");
fp (out, "%-24s ", " (NVEs)");
for (ALL_LIST_ELEMENTS_RO (&bgp->rfapi->descriptors, node, rfd))
@@ -2315,7 +2315,7 @@ rfapiRibShowResponsesSummary (void *stream)
}
fp (out, "%-8s %-8u ", "Active:", nves_with_nonempty_ribs);
fp (out, "%-8s %-8u", "Total:", nves);
- fp (out, "%s", VTYNL);
+ fp (out, "\n");
}
@@ -2385,10 +2385,10 @@ print_rib_sl (
prefix_rd2str(&ri->rk.rd, str_rd+1, BUFSIZ-1);
#endif
- fp (out, " %c %-20s %-15s %-15s %-4u %-8s %-8s%s%s",
+ fp (out, " %c %-20s %-15s %-15s %-4u %-8s %-8s%s\n",
deleted ? 'r' : ' ',
*printedprefix ? "" : str_pfx,
- str_vn, str_un, ri->cost, str_lifetime, str_age, str_rd, VTYNL);
+ str_vn, str_un, ri->cost, str_lifetime, str_age, str_rd);
if (!*printedprefix)
*printedprefix = 1;
@@ -2500,20 +2500,18 @@ rfapiRibShowResponses (
{
++printedheader;
- fp (out, "%s[%s]%s",
- VTYNL,
- show_removed ? "Removed" : "Active", VTYNL);
- fp (out, "%-15s %-15s%s", "Querying VN", "Querying UN",
- VTYNL);
- fp (out, " %-20s %-15s %-15s %4s %-8s %-8s%s",
+ fp (out, "\n[%s]\n",
+ show_removed ? "Removed" : "Active");
+ fp (out, "%-15s %-15s\n", "Querying VN", "Querying UN");
+ fp (out, " %-20s %-15s %-15s %4s %-8s %-8s\n",
"Prefix", "Registered VN", "Registered UN", "Cost",
"Lifetime",
#if RFAPI_REGISTRATIONS_REPORT_AGE
- "Age",
+ "Age"
#else
- "Remaining",
+ "Remaining"
#endif
- VTYNL);
+ );
}
if (!printednve)
{
@@ -2523,14 +2521,13 @@ rfapiRibShowResponses (
++printednve;
++nves_displayed;
- fp (out, "%-15s %-15s%s",
+ fp (out, "%-15s %-15s\n",
rfapiRfapiIpAddr2Str (&rfd->vn_addr, str_vn, BUFSIZ),
- rfapiRfapiIpAddr2Str (&rfd->un_addr, str_un, BUFSIZ),
- VTYNL);
+ rfapiRfapiIpAddr2Str (&rfd->un_addr, str_un, BUFSIZ));
}
prefix2str (&rn->p, str_pfx, BUFSIZ);
- //fp(out, " %s%s", buf, VTYNL); /* prefix */
+ //fp(out, " %s\n", buf); /* prefix */
routes_displayed++;
nhs_displayed += print_rib_sl (fp, vty, out, sl,
@@ -2542,12 +2539,12 @@ rfapiRibShowResponses (
if (routes_total)
{
- fp (out, "%s", VTYNL);
+ fp (out, "\n");
fp (out, "Displayed %u NVEs, and %u out of %u %s prefixes",
nves_displayed, routes_displayed,
routes_total, show_removed ? "removed" : "active");
if (nhs_displayed != routes_displayed || nhs_total != routes_total)
fp (out, " with %u out of %u next hops", nhs_displayed, nhs_total);
- fp (out, "%s", VTYNL);
+ fp (out, "\n");
}
}
diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c
index ef08699f7..3b7d08f91 100644
--- a/bgpd/rfapi/rfapi_vty.c
+++ b/bgpd/rfapi/rfapi_vty.c
@@ -385,14 +385,14 @@ rfapiStdioPrintf (void *stream, const char *format, ...)
/* Fake out for debug logging */
static struct vty vty_dummy_zlog;
static struct vty vty_dummy_stdio;
-#define HVTYNL ((vty == &vty_dummy_zlog)? "": VTYNL)
+#define HVTYNL ((vty == &vty_dummy_zlog)? "": "\n")
static const char *
str_vty_newline (struct vty *vty)
{
if (vty == &vty_dummy_zlog)
return "";
- return VTYNL;
+ return "\n";
}
int
@@ -939,14 +939,14 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
bgp = bgp_get_default (); /* assume 1 instance for now */
if (!bgp)
{
- vty_outln (vty, "No BGP instance");
+ vty_out (vty, "No BGP instance\n");
return CMD_WARNING;
}
h = bgp->rfapi;
if (!h)
{
- vty_outln (vty, "No RFAPI instance");
+ vty_out (vty, "No RFAPI instance\n");
return CMD_WARNING;
}
@@ -995,10 +995,10 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
if (!printedheader)
{
++printedheader;
- fp (out, "%s", VTYNL);
- fp (out, "%-15s %-15s %-15s %-10s%s",
+ fp (out, "\n");
+ fp (out, "%-15s %-15s %-15s %-10s\n",
"VN Address", "UN Address",
- "Target", "Remaining", VTYNL);
+ "Target", "Remaining");
}
if (!printedquerier)
@@ -1022,9 +1022,9 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
rfapiFormatSeconds (thread_timer_remain_second (m->timer),
buf_remain, BUFSIZ);
}
- fp (out, " %-15s %-10s%s",
+ fp (out, " %-15s %-10s\n",
inet_ntop (m->p.family, &m->p.u.prefix, buf_pfx, BUFSIZ),
- buf_remain, VTYNL);
+ buf_remain);
}
}
@@ -1070,10 +1070,10 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
if (!printedheader)
{
++printedheader;
- fp (out, "%s", VTYNL);
- fp (out, "%-15s %-15s %-17s %10s %-10s%s",
+ fp (out, "\n");
+ fp (out, "%-15s %-15s %-17s %10s %-10s\n",
"VN Address", "UN Address",
- "Target", "LNI", "Remaining", VTYNL);
+ "Target", "LNI", "Remaining");
}
if (!printedquerier)
@@ -1097,19 +1097,18 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
rfapiFormatSeconds (thread_timer_remain_second
(mon_eth->timer), buf_remain, BUFSIZ);
}
- fp (out, " %-17s %10d %-10s%s",
+ fp (out, " %-17s %10d %-10s\n",
rfapi_ntop (pfx_mac.family, &pfx_mac.u.prefix, buf_pfx,
- BUFSIZ), mon_eth->logical_net_id, buf_remain,
- VTYNL);
+ BUFSIZ), mon_eth->logical_net_id, buf_remain);
}
}
}
if (queries_total)
{
- fp (out, "%s", VTYNL);
- fp (out, "Displayed %d out of %d total queries%s",
- queries_displayed, queries_total, VTYNL);
+ fp (out, "\n");
+ fp (out, "Displayed %d out of %d total queries\n",
+ queries_displayed, queries_total);
}
return CMD_SUCCESS;
}
@@ -2221,7 +2220,7 @@ register_add (
if (!bgp)
{
if (vty)
- vty_outln (vty, "BGP not configured");
+ vty_out (vty, "BGP not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2230,7 +2229,7 @@ register_add (
if (!h || !rfapi_cfg)
{
if (vty)
- vty_outln (vty, "RFAPI not configured");
+ vty_out (vty, "RFAPI not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2240,12 +2239,12 @@ register_add (
{
if (arg_lnh)
{
- vty_outln (vty,"local-next-hop specified more than once");
+ vty_out (vty,"local-next-hop specified more than once\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (argc <= 1)
{
- vty_outln (vty,"Missing parameter for local-next-hop");
+ vty_out (vty,"Missing parameter for local-next-hop\n");
return CMD_WARNING_CONFIG_FAILED;
}
++argv, --argc;
@@ -2255,12 +2254,12 @@ register_add (
{
if (arg_lnh_cost)
{
- vty_outln (vty,"local-cost specified more than once");
+ vty_out (vty,"local-cost specified more than once\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (argc <= 1)
{
- vty_outln (vty,"Missing parameter for local-cost");
+ vty_out (vty,"Missing parameter for local-cost\n");
return CMD_WARNING_CONFIG_FAILED;
}
++argv, --argc;
@@ -2288,7 +2287,7 @@ register_add (
arg_prefix = "0::0/128";
break;
default:
- vty_outln (vty,"Internal error, unknown VN address family");
+ vty_out (vty,"Internal error, unknown VN address family\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2296,13 +2295,13 @@ register_add (
if (!str2prefix (arg_prefix, &pfx))
{
- vty_outln (vty, "Malformed prefix \"%s\"",arg_prefix);
+ vty_out (vty, "Malformed prefix \"%s\"\n",arg_prefix);
goto fail;
}
if (pfx.family != AF_INET
&& pfx.family != AF_INET6)
{
- vty_outln (vty, "prefix \"%s\" has invalid address family",
+ vty_out (vty, "prefix \"%s\" has invalid address family\n",
arg_prefix);
goto fail;
}
@@ -2316,7 +2315,7 @@ register_add (
cost = strtoul (arg_cost, &endptr, 10);
if (*endptr != '\0' || cost > 255)
{
- vty_outln (vty, "%% Invalid %s value", "cost");
+ vty_out (vty, "%% Invalid %s value\n", "cost");
goto fail;
}
}
@@ -2337,7 +2336,7 @@ register_add (
lifetime = strtoul (arg_lifetime, &endptr, 10);
if (*endptr != '\0')
{
- vty_outln (vty, "%% Invalid %s value","lifetime");
+ vty_out (vty, "%% Invalid %s value\n","lifetime");
goto fail;
}
}
@@ -2351,8 +2350,8 @@ register_add (
{
if (!arg_lnh)
{
- vty_outln (vty,
- "%% %s may only be specified with local-next-hop",
+ vty_out (vty,
+ "%% %s may only be specified with local-next-hop\n",
"local-cost");
goto fail;
}
@@ -2360,7 +2359,7 @@ register_add (
lnh_cost = strtoul (arg_lnh_cost, &endptr, 10);
if (*endptr != '\0' || lnh_cost > 255)
{
- vty_outln (vty, "%% Invalid %s value","local-cost");
+ vty_out (vty, "%% Invalid %s value\n","local-cost");
goto fail;
}
}
@@ -2373,7 +2372,7 @@ register_add (
{
if (!arg_prefix)
{
- vty_outln (vty, "%% %s may only be specified with prefix",
+ vty_out (vty, "%% %s may only be specified with prefix\n",
"local-next-hop");
goto fail;
}
@@ -2401,7 +2400,7 @@ register_add (
if (arg_vni && !arg_macaddr)
{
- vty_outln (vty, "%% %s may only be specified with mac address",
+ vty_out (vty, "%% %s may only be specified with mac address\n",
"virtual-network-identifier");
goto fail;
}
@@ -2410,8 +2409,8 @@ register_add (
{
if (!arg_vni)
{
- vty_outln (vty,
- "Missing \"vni\" parameter (mandatory with mac)");
+ vty_out (vty,
+ "Missing \"vni\" parameter (mandatory with mac)\n");
return CMD_WARNING_CONFIG_FAILED;
}
optary[opt_next].v.l2addr.logical_net_id = strtoul(arg_vni, NULL,
@@ -2420,7 +2419,7 @@ register_add (
if ((rc = rfapiStr2EthAddr (arg_macaddr,
&optary[opt_next].v.l2addr.macaddr)))
{
- vty_outln (vty, "Invalid %s value","mac address");
+ vty_out (vty, "Invalid %s value\n","mac address");
goto fail;
}
/* TBD label, NVE ID */
@@ -2472,7 +2471,7 @@ register_add (
&rfd);
if (rc)
{
- vty_outln (vty, "Can't open session for this NVE: %s",
+ vty_out (vty, "Can't open session for this NVE: %s\n",
rfapi_error_str(rc));
rc = CMD_WARNING_CONFIG_FAILED;
goto fail;
@@ -2480,7 +2479,7 @@ register_add (
}
else
{
- vty_outln (vty, "Can't find session for this NVE: %s",
+ vty_out (vty, "Can't find session for this NVE: %s\n",
rfapi_error_str(rc));
goto fail;
}
@@ -2516,10 +2515,10 @@ register_add (
}
vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__);
- vty_out (vty, VTYNL);
- vty_outln (vty, "Registration failed.");
- vty_outln (vty,
- "Confirm that either the VN or UN address matches a configured NVE group.");
+ vty_out (vty, "\n");
+ vty_out (vty, "Registration failed.\n");
+ vty_out (vty,
+ "Confirm that either the VN or UN address matches a configured NVE group.\n");
return CMD_WARNING_CONFIG_FAILED;
fail:
@@ -3129,7 +3128,7 @@ parse_deleter_args (
if (!str2prefix (arg_prefix, &rcdarg->prefix))
{
- vty_outln (vty, "Malformed prefix \"%s\"", arg_prefix);
+ vty_out (vty, "Malformed prefix \"%s\"\n", arg_prefix);
return rc;
}
}
@@ -3138,14 +3137,14 @@ parse_deleter_args (
{
if (!arg_vni)
{
- vty_outln (vty, "Missing VNI");
+ vty_out (vty, "Missing VNI\n");
return rc;
}
if (strcmp (arg_l2addr, "*"))
{
if ((rc = rfapiStr2EthAddr (arg_l2addr, &rcdarg->l2o.o.macaddr)))
{
- vty_outln (vty, "Malformed L2 Address \"%s\"",
+ vty_out (vty, "Malformed L2 Address \"%s\"\n",
arg_l2addr);
return rc;
}
@@ -3161,7 +3160,7 @@ parse_deleter_args (
{
if (!str2prefix_rd (arg_rd, &rcdarg->rd))
{
- vty_outln (vty, "Malformed RD \"%s\"",
+ vty_out (vty, "Malformed RD \"%s\"\n",
arg_rd);
return rc;
}
@@ -3705,12 +3704,12 @@ print_cleared_stats (struct rfapi_local_reg_delete_arg *cda)
cda->nves = NULL;
}
if (cda->failed_pfx_count)
- vty_outln (vty, "Failed to delete %d prefixes",
+ vty_out (vty, "Failed to delete %d prefixes\n",
cda->failed_pfx_count);
/* left as "prefixes" even in single case for ease of machine parsing */
- vty_outln (vty,
- "[Local] Cleared %u registrations, %u prefixes, %u responses from %d NVEs",
+ vty_out (vty,
+ "[Local] Cleared %u registrations, %u prefixes, %u responses from %d NVEs\n",
cda->reg_count, cda->pfx_count, cda->query_count,cda->nve_count);
/*
@@ -3718,7 +3717,7 @@ print_cleared_stats (struct rfapi_local_reg_delete_arg *cda)
* the command line
*/
- vty_outln (vty, "[Holddown] Cleared %u prefixes from %u NVEs",
+ vty_out (vty, "[Holddown] Cleared %u prefixes from %u NVEs\n",
cda->remote_holddown_pfx_count,cda->remote_holddown_nve_count);
}
@@ -4395,8 +4394,8 @@ check_and_display_is_vnc_running (struct vty *vty)
if (vty)
{
- vty_outln (vty,
- "VNC is not configured. (There are no configured BGP VPN SAFI peers.)");
+ vty_out (vty,
+ "VNC is not configured. (There are no configured BGP VPN SAFI peers.)\n");
}
return 0; /* not running */
}
@@ -4459,10 +4458,10 @@ rfapi_vty_show_nve_summary (struct vty *vty, show_nve_summary_t show_type)
h->stat.count_registrations_failed);
vty_out (vty, "%-8s %-8u", "Total:",
h->stat.count_registrations);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
vty_out (vty, "%-24s ", "Prefixes registered:");
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
rfapiCountAllItRoutes (&active_local_routes,
&active_remote_routes,
@@ -4474,16 +4473,16 @@ rfapi_vty_show_nve_summary (struct vty *vty, show_nve_summary_t show_type)
{
vty_out (vty, " %-20s ", "Locally:");
vty_out (vty, "%-8s %-8u ", "Active:", active_local_routes);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
vty_out (vty, " %-20s ", "Remotely:");
vty_out (vty, "%-8s %-8u", "Active:", active_remote_routes);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
vty_out (vty, " %-20s ", "In Holddown:");
vty_out (vty, "%-8s %-8u", "Active:", holddown_remote_routes);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
vty_out (vty, " %-20s ", "Imported:");
vty_out (vty, "%-8s %-8u", "Active:", imported_remote_routes);
break;
@@ -4502,12 +4501,12 @@ rfapi_vty_show_nve_summary (struct vty *vty, show_nve_summary_t show_type)
default:
break;
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
return 0;
notcfg:
- vty_outln (vty, "VNC is not configured.");
+ vty_out (vty, "VNC is not configured.\n");
return CMD_WARNING;
}
@@ -4574,9 +4573,9 @@ rfapi_show_nves (
if (!printed)
{
/* print out a header */
- vty_outln (vty,
- " " "Active Next Hops");
- vty_outln (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s",
+ vty_out (vty,
+ " Active Next Hops\n");
+ vty_out (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s\n",
"VN Address",
"UN Address",
"Regis", "Resps", "Reach", "Remove", "Age");
@@ -4584,7 +4583,7 @@ rfapi_show_nves (
++printed;
- vty_outln (vty, "%-15s %-15s %-5u %-5u %-6u %-6u %s",
+ vty_out (vty, "%-15s %-15s %-5u %-5u %-6u %-6u %s\n",
vn_addr_buf,
un_addr_buf,
rfapiApCount (rfd),
@@ -4595,13 +4594,13 @@ rfapi_show_nves (
}
if (printed > 0 || vn_prefix || un_prefix)
- vty_outln (vty, "Displayed %d out of %d active NVEs",
+ vty_out (vty, "Displayed %d out of %d active NVEs\n",
printed, total);
return 0;
notcfg:
- vty_outln (vty, "VNC is not configured.");
+ vty_out (vty, "VNC is not configured.\n");
return CMD_WARNING;
}
@@ -4616,7 +4615,7 @@ DEFUN (vnc_show_summary,
if (!check_and_display_is_vnc_running (vty))
return CMD_SUCCESS;
bgp_rfapi_show_summary (bgp_get_default (), vty);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_ACTIVE_NVES);
rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_QUERIES);
rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_RESPONSES);
@@ -4653,12 +4652,12 @@ DEFUN (vnc_show_nves_ptct,
if (!str2prefix (argv[4]->arg, &pfx))
{
- vty_outln (vty, "Malformed address \"%s\"", argv[4]->arg);
+ vty_out (vty, "Malformed address \"%s\"\n", argv[4]->arg);
return CMD_WARNING;
}
if (pfx.family != AF_INET && pfx.family != AF_INET6)
{
- vty_outln (vty, "Invalid address \"%s\"", argv[4]->arg);
+ vty_out (vty, "Invalid address \"%s\"\n", argv[4]->arg);
return CMD_WARNING;
}
@@ -4713,7 +4712,7 @@ rfapi_show_registrations (
}
if (!printed)
{
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
}
@@ -4734,7 +4733,7 @@ DEFUN (vnc_show_registrations_pfx,
{
if (!str2prefix (argv[3]->arg, &p))
{
- vty_outln (vty, "Invalid prefix: %s", argv[3]->arg);
+ vty_out (vty, "Invalid prefix: %s\n", argv[3]->arg);
return CMD_SUCCESS;
}
else
@@ -4774,7 +4773,7 @@ DEFUN (vnc_show_registrations_some_pfx,
{
if (!str2prefix (argv[4]->arg, &p))
{
- vty_outln (vty, "Invalid prefix: %s", argv[4]->arg);
+ vty_out (vty, "Invalid prefix: %s\n", argv[4]->arg);
return CMD_SUCCESS;
}
else
@@ -4831,7 +4830,7 @@ DEFUN (vnc_show_responses_pfx,
{
if (!str2prefix (argv[3]->arg, &p))
{
- vty_outln (vty, "Invalid prefix: %s", argv[3]->arg);
+ vty_out (vty, "Invalid prefix: %s\n", argv[3]->arg);
return CMD_SUCCESS;
}
else
@@ -4874,7 +4873,7 @@ DEFUN (vnc_show_responses_some_pfx,
{
if (!str2prefix (argv[4]->arg, &p))
{
- vty_outln (vty, "Invalid prefix: %s", argv[4]->arg);
+ vty_out (vty, "Invalid prefix: %s\n", argv[4]->arg);
return CMD_SUCCESS;
}
else
@@ -4923,7 +4922,7 @@ DEFUN (show_vnc_queries_pfx,
{
if (!str2prefix (argv[3]->arg, &pfx))
{
- vty_outln (vty, "Invalid prefix: %s", argv[3]->arg);
+ vty_out (vty, "Invalid prefix: %s\n", argv[3]->arg);
return CMD_WARNING;
}
p = &pfx;
@@ -4976,7 +4975,7 @@ DEFUN (vnc_clear_counters,
return CMD_SUCCESS;
notcfg:
- vty_outln (vty, "VNC is not configured.");
+ vty_out (vty, "VNC is not configured.\n");
return CMD_WARNING;
}
@@ -5006,12 +5005,12 @@ vnc_add_vrf_prefix (struct vty *vty,
bgp = bgp_get_default (); /* assume main instance for now */
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
if (!bgp->rfapi || !bgp->rfapi_cfg)
{
- vty_outln (vty, "VRF support not configured");
+ vty_out (vty, "VRF support not configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5019,31 +5018,31 @@ vnc_add_vrf_prefix (struct vty *vty,
/* arg checks */
if (!rfg)
{
- vty_outln (vty, "VRF \"%s\" appears not to be configured.",
+ vty_out (vty, "VRF \"%s\" appears not to be configured.\n",
arg_vrf);
return CMD_WARNING_CONFIG_FAILED;
}
if (!rfg->rt_export_list || !rfg->rfapi_import_table)
{
- vty_outln (vty, "VRF \"%s\" is missing RT import/export RT configuration.",
+ vty_out (vty, "VRF \"%s\" is missing RT import/export RT configuration.\n",
arg_vrf);
return CMD_WARNING_CONFIG_FAILED;
}
if (!rfg->rd.family && !arg_rd)
{
- vty_outln (vty, "VRF \"%s\" isn't configured with an RD, so RD must be provided.",
+ vty_out (vty, "VRF \"%s\" isn't configured with an RD, so RD must be provided.\n",
arg_vrf);
return CMD_WARNING_CONFIG_FAILED;
}
if (rfg->label > MPLS_LABEL_MAX && !arg_label)
{
- vty_outln (vty, "VRF \"%s\" isn't configured with a default labels, so a label must be provided.",
+ vty_out (vty, "VRF \"%s\" isn't configured with a default labels, so a label must be provided.\n",
arg_vrf);
return CMD_WARNING_CONFIG_FAILED;
}
if (!str2prefix (arg_prefix, &pfx))
{
- vty_outln (vty, "Malformed prefix \"%s\"",
+ vty_out (vty, "Malformed prefix \"%s\"\n",
arg_prefix);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5057,7 +5056,7 @@ vnc_add_vrf_prefix (struct vty *vty,
opt->type = RFAPI_VN_OPTION_TYPE_INTERNAL_RD;
if (!str2prefix_rd (arg_rd, &opt->v.internal_rd))
{
- vty_outln (vty, "Malformed RD \"%s\"",
+ vty_out (vty, "Malformed RD \"%s\"\n",
arg_rd);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5085,7 +5084,7 @@ vnc_add_vrf_prefix (struct vty *vty,
pref = strtoul (arg_pref, &endptr, 10);
if (*endptr != '\0')
{
- vty_outln (vty, "%% Invalid local-preference value \"%s\"",
+ vty_out (vty, "%% Invalid local-preference value \"%s\"\n",
arg_pref);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5150,7 +5149,7 @@ vnc_add_vrf_prefix (struct vty *vty,
}
vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__);
- vty_outln (vty, "Add failed.");
+ vty_out (vty, "Add failed.\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -5260,19 +5259,19 @@ vnc_clear_vrf (struct vty *vty,
bgp = bgp_get_default (); /* assume main instance for now */
if (!bgp)
{
- vty_outln (vty, "No BGP process is configured");
+ vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING;
}
if (!bgp->rfapi || !bgp->rfapi_cfg)
{
- vty_outln (vty, "VRF support not configured");
+ vty_out (vty, "VRF support not configured\n");
return CMD_WARNING;
}
rfg = bgp_rfapi_cfg_match_byname (bgp, arg_vrf, RFAPI_GROUP_CFG_VRF);
/* arg checks */
if (!rfg)
{
- vty_outln (vty, "VRF \"%s\" appears not to be configured.",
+ vty_out (vty, "VRF \"%s\" appears not to be configured.\n",
arg_vrf);
return CMD_WARNING;
}
@@ -5284,7 +5283,7 @@ vnc_clear_vrf (struct vty *vty,
start_count = rfapi_cfg_group_it_count(rfg);
clear_vnc_prefix (&cda);
clear_vnc_vrf_closer (rfg);
- vty_outln (vty, "Cleared %u out of %d prefixes.",
+ vty_out (vty, "Cleared %u out of %d prefixes.\n",
cda.pfx_count, start_count);
return CMD_SUCCESS;
}
diff --git a/bgpd/rfapi/vnc_debug.c b/bgpd/rfapi/vnc_debug.c
index 53669ce3b..1f9e1b10f 100644
--- a/bgpd/rfapi/vnc_debug.c
+++ b/bgpd/rfapi/vnc_debug.c
@@ -79,13 +79,13 @@ DEFUN (debug_bgp_vnc,
else
{
term_vnc_debug |= vncdebug[i].bit;
- vty_outln (vty, "BGP vnc %s debugging is on",
+ vty_out (vty, "BGP vnc %s debugging is on\n",
vncdebug[i].name);
}
return CMD_SUCCESS;
}
}
- vty_outln (vty, "Unknown debug flag: %s", argv[3]->arg);
+ vty_out (vty, "Unknown debug flag: %s\n", argv[3]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -118,13 +118,13 @@ DEFUN (no_debug_bgp_vnc,
else
{
term_vnc_debug &= ~vncdebug[i].bit;
- vty_outln (vty, "BGP vnc %s debugging is off",
+ vty_out (vty, "BGP vnc %s debugging is off\n",
vncdebug[i].name);
}
return CMD_SUCCESS;
}
}
- vty_outln (vty, "Unknown debug flag: %s", argv[3]->arg);
+ vty_out (vty, "Unknown debug flag: %s\n", argv[3]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -144,7 +144,7 @@ DEFUN (no_debug_bgp_vnc_all,
VNC_STR)
{
term_vnc_debug = 0;
- vty_outln (vty, "All possible VNC debugging has been turned off");
+ vty_out (vty, "All possible VNC debugging has been turned off\n");
return CMD_SUCCESS;
}
@@ -163,17 +163,17 @@ DEFUN (show_debugging_bgp_vnc,
{
size_t i;
- vty_outln (vty, "BGP VNC debugging status:");
+ vty_out (vty, "BGP VNC debugging status:\n");
for (i = 0; i < (sizeof(vncdebug) / sizeof(struct vnc_debug)); ++i)
{
if (term_vnc_debug & vncdebug[i].bit)
{
- vty_outln (vty, " BGP VNC %s debugging is on",
+ vty_out (vty, " BGP VNC %s debugging is on\n",
vncdebug[i].name);
}
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
return CMD_SUCCESS;
}
@@ -187,7 +187,7 @@ bgp_vnc_config_write_debug (struct vty *vty)
{
if (conf_vnc_debug & vncdebug[i].bit)
{
- vty_outln (vty, "debug bgp vnc %s", vncdebug[i].name);
+ vty_out (vty, "debug bgp vnc %s\n", vncdebug[i].name);
write++;
}
}
diff --git a/bgpd/rfp-example/librfp/rfp_example.c b/bgpd/rfp-example/librfp/rfp_example.c
index a0ba82908..451be7770 100644
--- a/bgpd/rfp-example/librfp/rfp_example.c
+++ b/bgpd/rfp-example/librfp/rfp_example.c
@@ -197,7 +197,7 @@ rfp_cfg_write_cb (struct vty *vty, void *rfp_start_val)
if (rfi->config_var != 0)
{
vty_out (vty, " rfp example-config-value %u", rfi->config_var);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
write++;
}