summaryrefslogtreecommitdiff
path: root/zebra/zserv.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c146
1 files changed, 69 insertions, 77 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index ba42c67be3..7eead965b7 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -2674,64 +2674,57 @@ zebra_show_client_detail (struct vty *vty, struct zserv *client)
vty_out (vty, "Client: %s", zebra_route_string(client->proto));
if (client->instance)
vty_out (vty, " Instance: %d", client->instance);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_outln (vty, "");
- vty_out (vty, "------------------------ %s", VTY_NEWLINE);
- vty_out (vty, "FD: %d %s", client->sock, VTY_NEWLINE);
- vty_out (vty, "Route Table ID: %d %s", client->rtm_table, VTY_NEWLINE);
+ vty_outln (vty, "------------------------ ");
+ vty_outln (vty, "FD: %d ", client->sock);
+ vty_outln (vty, "Route Table ID: %d ", client->rtm_table);
- vty_out (vty, "Connect Time: %s %s",
- zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF),
- VTY_NEWLINE);
+ vty_outln (vty, "Connect Time: %s ",
+ zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF));
if (client->nh_reg_time)
{
- vty_out (vty, "Nexthop Registry Time: %s %s",
- zserv_time_buf(&client->nh_reg_time, nhbuf, ZEBRA_TIME_BUF),
- VTY_NEWLINE);
+ vty_outln (vty, "Nexthop Registry Time: %s ",
+ zserv_time_buf(&client->nh_reg_time, nhbuf, ZEBRA_TIME_BUF));
if (client->nh_last_upd_time)
- vty_out (vty, "Nexthop Last Update Time: %s %s",
- zserv_time_buf(&client->nh_last_upd_time, mbuf, ZEBRA_TIME_BUF),
- VTY_NEWLINE);
- else
- vty_out (vty, "No Nexthop Update sent%s", VTY_NEWLINE);
+ vty_outln (vty, "Nexthop Last Update Time: %s ",
+ zserv_time_buf(&client->nh_last_upd_time, mbuf, ZEBRA_TIME_BUF));
+ else
+ vty_outln (vty, "No Nexthop Update sent");
}
else
- vty_out (vty, "Not registered for Nexthop Updates%s", VTY_NEWLINE);
+ vty_outln (vty, "Not registered for Nexthop Updates");
- vty_out (vty, "Last Msg Rx Time: %s %s",
- zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF),
- VTY_NEWLINE);
- vty_out (vty, "Last Msg Tx Time: %s %s",
- zserv_time_buf(&client->last_write_time, wbuf, ZEBRA_TIME_BUF),
- VTY_NEWLINE);
+ vty_outln (vty, "Last Msg Rx Time: %s ",
+ zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF));
+ vty_outln (vty, "Last Msg Tx Time: %s ",
+ zserv_time_buf(&client->last_write_time, wbuf, ZEBRA_TIME_BUF));
if (client->last_read_time)
- vty_out (vty, "Last Rcvd Cmd: %s %s",
- zserv_command_string(client->last_read_cmd), VTY_NEWLINE);
+ vty_outln (vty, "Last Rcvd Cmd: %s ",
+ zserv_command_string(client->last_read_cmd));
if (client->last_write_time)
- vty_out (vty, "Last Sent Cmd: %s %s",
- zserv_command_string(client->last_write_cmd), VTY_NEWLINE);
- vty_out (vty, "%s", VTY_NEWLINE);
-
- vty_out (vty, "Type Add Update Del %s", VTY_NEWLINE);
- vty_out (vty, "================================================== %s", VTY_NEWLINE);
- vty_out (vty, "IPv4 %-12d%-12d%-12d%s", client->v4_route_add_cnt,
- client->v4_route_upd8_cnt, client->v4_route_del_cnt, VTY_NEWLINE);
- vty_out (vty, "IPv6 %-12d%-12d%-12d%s", client->v6_route_add_cnt,
- client->v6_route_upd8_cnt, client->v6_route_del_cnt, VTY_NEWLINE);
- vty_out (vty, "Redist:v4 %-12d%-12d%-12d%s", client->redist_v4_add_cnt, 0,
- client->redist_v4_del_cnt, VTY_NEWLINE);
- vty_out (vty, "Redist:v6 %-12d%-12d%-12d%s", client->redist_v6_add_cnt, 0,
- client->redist_v6_del_cnt, VTY_NEWLINE);
- vty_out (vty, "Connected %-12d%-12d%-12d%s", client->ifadd_cnt, 0,
- client->ifdel_cnt, VTY_NEWLINE);
- vty_out (vty, "BFD peer %-12d%-12d%-12d%s", client->bfd_peer_add_cnt,
- client->bfd_peer_upd8_cnt, client->bfd_peer_del_cnt, VTY_NEWLINE);
- vty_out (vty, "Interface Up Notifications: %d%s", client->ifup_cnt,
- VTY_NEWLINE);
- vty_out (vty, "Interface Down Notifications: %d%s", client->ifdown_cnt,
- VTY_NEWLINE);
-
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_outln (vty, "Last Sent Cmd: %s ",
+ zserv_command_string(client->last_write_cmd));
+ vty_outln (vty, "");
+
+ vty_outln (vty, "Type Add Update Del ");
+ vty_outln (vty, "================================================== ");
+ vty_outln (vty, "IPv4 %-12d%-12d%-12d", client->v4_route_add_cnt,
+ client->v4_route_upd8_cnt, client->v4_route_del_cnt);
+ vty_outln (vty, "IPv6 %-12d%-12d%-12d", client->v6_route_add_cnt,
+ client->v6_route_upd8_cnt, client->v6_route_del_cnt);
+ vty_outln (vty, "Redist:v4 %-12d%-12d%-12d", client->redist_v4_add_cnt, 0,
+ client->redist_v4_del_cnt);
+ vty_outln (vty, "Redist:v6 %-12d%-12d%-12d", client->redist_v6_add_cnt, 0,
+ client->redist_v6_del_cnt);
+ vty_outln (vty, "Connected %-12d%-12d%-12d", client->ifadd_cnt, 0,
+ client->ifdel_cnt);
+ vty_outln (vty, "BFD peer %-12d%-12d%-12d", client->bfd_peer_add_cnt,
+ client->bfd_peer_upd8_cnt, client->bfd_peer_del_cnt);
+ vty_outln (vty, "Interface Up Notifications: %d",client->ifup_cnt);
+ vty_outln (vty, "Interface Down Notifications: %d",client->ifdown_cnt);
+
+ vty_outln (vty, "");
return;
}
@@ -2741,7 +2734,7 @@ zebra_show_client_brief (struct vty *vty, struct zserv *client)
char cbuf[ZEBRA_TIME_BUF], rbuf[ZEBRA_TIME_BUF];
char wbuf[ZEBRA_TIME_BUF];
- vty_out (vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d%s",
+ vty_outln (vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d",
zebra_route_string(client->proto),
zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF),
zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF),
@@ -2749,7 +2742,7 @@ zebra_show_client_brief (struct vty *vty, struct zserv *client)
client->v4_route_add_cnt+client->v4_route_upd8_cnt,
client->v4_route_del_cnt,
client->v6_route_add_cnt+client->v6_route_upd8_cnt,
- client->v6_route_del_cnt, VTY_NEWLINE);
+ client->v6_route_del_cnt);
}
@@ -2776,8 +2769,7 @@ DEFUN (show_table,
SHOW_STR
"default routing table to use for all clients\n")
{
- vty_out (vty, "table %d%s", zebrad.rtm_table_default,
- VTY_NEWLINE);
+ vty_outln (vty, "table %d",zebrad.rtm_table_default);
return CMD_SUCCESS;
}
@@ -2817,7 +2809,7 @@ DEFUN (ip_forwarding,
if (ret == 0)
{
- vty_out (vty, "Can't turn on IP forwarding%s", VTY_NEWLINE);
+ vty_outln (vty, "Can't turn on IP forwarding");
return CMD_WARNING;
}
@@ -2839,7 +2831,7 @@ DEFUN (no_ip_forwarding,
if (ret != 0)
{
- vty_out (vty, "Can't turn off IP forwarding%s", VTY_NEWLINE);
+ vty_outln (vty, "Can't turn off IP forwarding");
return CMD_WARNING;
}
@@ -2854,15 +2846,16 @@ DEFUN (show_zebra,
{
struct vrf *vrf;
- vty_out (vty, " Route Route Neighbor LSP LSP%s", VTY_NEWLINE);
- vty_out (vty, "VRF Installs Removals Updates Installs Removals%s", VTY_NEWLINE);
+ vty_outln (vty,
+ " Route Route Neighbor LSP LSP");
+ vty_outln (vty,
+ "VRF Installs Removals Updates Installs Removals");
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
{
struct zebra_vrf *zvrf = vrf->info;
- vty_out (vty,"%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 "%s",
+ vty_outln (vty,"%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 "",
vrf->name, zvrf->installs, zvrf->removals,
- zvrf->neigh_updates, zvrf->lsp_installs, zvrf->lsp_removals,
- VTY_NEWLINE);
+ zvrf->neigh_updates, zvrf->lsp_installs,zvrf->lsp_removals);
}
return CMD_SUCCESS;
@@ -2897,15 +2890,15 @@ DEFUN (show_zebra_client_summary,
struct listnode *node;
struct zserv *client;
- vty_out (vty, "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes %s",
- VTY_NEWLINE);
- vty_out (vty,"--------------------------------------------------------------------------------%s",
- VTY_NEWLINE);
+ vty_outln (vty,
+ "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes ");
+ vty_outln (vty,
+ "--------------------------------------------------------------------------------");
for (ALL_LIST_ELEMENTS_RO (zebrad.client_list, node, client))
zebra_show_client_brief(vty, client);
- vty_out (vty, "Routes column shows (added+updated)/deleted%s", VTY_NEWLINE);
+ vty_outln (vty, "Routes column shows (added+updated)/deleted");
return CMD_SUCCESS;
}
@@ -2914,8 +2907,7 @@ static int
config_write_table (struct vty *vty)
{
if (zebrad.rtm_table_default)
- vty_out (vty, "table %d%s", zebrad.rtm_table_default,
- VTY_NEWLINE);
+ vty_outln (vty, "table %d",zebrad.rtm_table_default);
return 0;
}
@@ -2940,9 +2932,9 @@ DEFUN (show_ip_forwarding,
ret = ipforward ();
if (ret == 0)
- vty_out (vty, "IP forwarding is off%s", VTY_NEWLINE);
+ vty_outln (vty, "IP forwarding is off");
else
- vty_out (vty, "IP forwarding is on%s", VTY_NEWLINE);
+ vty_outln (vty, "IP forwarding is on");
return CMD_SUCCESS;
}
@@ -2961,16 +2953,16 @@ DEFUN (show_ipv6_forwarding,
switch (ret)
{
case -1:
- vty_out (vty, "ipv6 forwarding is unknown%s", VTY_NEWLINE);
+ vty_outln (vty, "ipv6 forwarding is unknown");
break;
case 0:
- vty_out (vty, "ipv6 forwarding is %s%s", "off", VTY_NEWLINE);
+ vty_outln (vty, "ipv6 forwarding is %s", "off");
break;
case 1:
- vty_out (vty, "ipv6 forwarding is %s%s", "on", VTY_NEWLINE);
+ vty_outln (vty, "ipv6 forwarding is %s", "on");
break;
default:
- vty_out (vty, "ipv6 forwarding is %s%s", "off", VTY_NEWLINE);
+ vty_outln (vty, "ipv6 forwarding is %s", "off");
break;
}
return CMD_SUCCESS;
@@ -2990,7 +2982,7 @@ DEFUN (ipv6_forwarding,
if (ret == 0)
{
- vty_out (vty, "Can't turn on IPv6 forwarding%s", VTY_NEWLINE);
+ vty_outln (vty, "Can't turn on IPv6 forwarding");
return CMD_WARNING;
}
@@ -3012,7 +3004,7 @@ DEFUN (no_ipv6_forwarding,
if (ret != 0)
{
- vty_out (vty, "Can't turn off IPv6 forwarding%s", VTY_NEWLINE);
+ vty_outln (vty, "Can't turn off IPv6 forwarding");
return CMD_WARNING;
}
@@ -3027,10 +3019,10 @@ config_write_forwarding (struct vty *vty)
router_id_write (vty);
if (!ipforward ())
- vty_out (vty, "no ip forwarding%s", VTY_NEWLINE);
+ vty_outln (vty, "no ip forwarding");
if (!ipforward_ipv6 ())
- vty_out (vty, "no ipv6 forwarding%s", VTY_NEWLINE);
- vty_out (vty, "!%s", VTY_NEWLINE);
+ vty_outln (vty, "no ipv6 forwarding");
+ vty_outln (vty, "!");
return 0;
}