summaryrefslogtreecommitdiffstats
path: root/ripd/ripd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ripd/ripd.c')
-rw-r--r--ripd/ripd.c95
1 files changed, 47 insertions, 48 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 780efcc94..8578dc3d2 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -2847,7 +2847,7 @@ DEFUN (rip_version,
version = atoi (argv[idx_number]->arg);
if (version != RIPv1 && version != RIPv2)
{
- vty_outln (vty, "invalid rip version %d",version);
+ vty_out (vty, "invalid rip version %d\n",version);
return CMD_WARNING_CONFIG_FAILED;
}
rip->version_send = version;
@@ -2885,7 +2885,7 @@ DEFUN (rip_route,
ret = str2prefix_ipv4 (argv[idx_ipv4_prefixlen]->arg, &p);
if (ret < 0)
{
- vty_outln (vty, "Malformed address");
+ vty_out (vty, "Malformed address\n");
return CMD_WARNING_CONFIG_FAILED;
}
apply_mask_ipv4 (&p);
@@ -2895,7 +2895,7 @@ DEFUN (rip_route,
if (node->info)
{
- vty_outln (vty, "There is already same static route.");
+ vty_out (vty, "There is already same static route.\n");
route_unlock_node (node);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2922,7 +2922,7 @@ DEFUN (no_rip_route,
ret = str2prefix_ipv4 (argv[idx_ipv4_prefixlen]->arg, &p);
if (ret < 0)
{
- vty_outln (vty, "Malformed address");
+ vty_out (vty, "Malformed address\n");
return CMD_WARNING_CONFIG_FAILED;
}
apply_mask_ipv4 (&p);
@@ -2931,7 +2931,7 @@ DEFUN (no_rip_route,
node = route_node_lookup (rip->route, (struct prefix *) &p);
if (! node)
{
- vty_outln (vty, "Can't find route %s.",argv[idx_ipv4_prefixlen]->arg);
+ vty_out (vty, "Can't find route %s.\n",argv[idx_ipv4_prefixlen]->arg);
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3014,21 +3014,21 @@ DEFUN (rip_timers,
update = strtoul (argv[idx_number]->arg, &endptr, 10);
if (update > RIP_TIMER_MAX || update < RIP_TIMER_MIN || *endptr != '\0')
{
- vty_outln (vty, "update timer value error");
+ vty_out (vty, "update timer value error\n");
return CMD_WARNING_CONFIG_FAILED;
}
timeout = strtoul (argv[idx_number_2]->arg, &endptr, 10);
if (timeout > RIP_TIMER_MAX || timeout < RIP_TIMER_MIN || *endptr != '\0')
{
- vty_outln (vty, "timeout timer value error");
+ vty_out (vty, "timeout timer value error\n");
return CMD_WARNING_CONFIG_FAILED;
}
garbage = strtoul (argv[idx_number_3]->arg, &endptr, 10);
if (garbage > RIP_TIMER_MAX || garbage < RIP_TIMER_MIN || *endptr != '\0')
{
- vty_outln (vty, "garbage timer value error");
+ vty_out (vty, "garbage timer value error\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3102,7 +3102,7 @@ rip_distance_set (struct vty *vty, const char *distance_str, const char *ip_str,
ret = str2prefix_ipv4 (ip_str, &p);
if (ret == 0)
{
- vty_outln (vty, "Malformed prefix");
+ vty_out (vty, "Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3148,14 +3148,14 @@ rip_distance_unset (struct vty *vty, const char *distance_str,
ret = str2prefix_ipv4 (ip_str, &p);
if (ret == 0)
{
- vty_outln (vty, "Malformed prefix");
+ vty_out (vty, "Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED;
}
rn = route_node_lookup (rip_distance_table, (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;
}
@@ -3241,7 +3241,7 @@ rip_distance_show (struct vty *vty)
int header = 1;
char buf[BUFSIZ];
- vty_outln (vty, " Distance: (default is %d)",
+ vty_out (vty, " Distance: (default is %d)\n",
rip->distance ? rip->distance : ZEBRA_RIP_DISTANCE_DEFAULT);
for (rn = route_top (rip_distance_table); rn; rn = route_next (rn))
@@ -3249,11 +3249,11 @@ rip_distance_show (struct vty *vty)
{
if (header)
{
- vty_outln (vty," Address Distance List");
+ vty_out (vty," Address Distance List\n");
header = 0;
}
sprintf (buf, "%s/%d", inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen);
- vty_outln (vty, " %-20s %4d %s",
+ vty_out (vty, " %-20s %4d %s\n",
buf, rdistance->distance,
rdistance->access_list ? rdistance->access_list : "");
}
@@ -3386,7 +3386,7 @@ DEFUN (rip_allow_ecmp,
{
if (rip->ecmp)
{
- vty_outln (vty, "ECMP is already enabled.");
+ vty_out (vty, "ECMP is already enabled.\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3403,7 +3403,7 @@ DEFUN (no_rip_allow_ecmp,
{
if (!rip->ecmp)
{
- vty_outln (vty, "ECMP is already disabled.");
+ vty_out (vty, "ECMP is already disabled.\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -3474,12 +3474,11 @@ DEFUN (show_ip_rip,
if (! rip)
return CMD_SUCCESS;
- vty_outln (vty, "Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP%s"
- "Sub-codes:%s"
- " (n) - normal, (s) - static, (d) - default, (r) - redistribute,%s"
- " (i) - interface%s%s"
- " Network Next Hop Metric From Tag Time",
- VTYNL, VTYNL, VTYNL, VTYNL, VTYNL);
+ vty_out (vty, "Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP\n"
+ "Sub-codes:\n"
+ " (n) - normal, (s) - static, (d) - default, (r) - redistribute,\n"
+ " (i) - interface\n\n"
+ " Network Next Hop Metric From Tag Time\n");
for (np = route_top (rip->table); np; np = route_next (np))
if ((list = np->info) != NULL)
@@ -3534,7 +3533,7 @@ DEFUN (show_ip_rip,
vty_out (vty, "%3"ROUTE_TAG_PRI, (route_tag_t)rinfo->tag);
}
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
}
return CMD_SUCCESS;
}
@@ -3558,35 +3557,35 @@ DEFUN (show_ip_rip_status,
if (! rip)
return CMD_SUCCESS;
- vty_outln (vty, "Routing Protocol is \"rip\"");
+ vty_out (vty, "Routing Protocol is \"rip\"\n");
vty_out (vty, " Sending updates every %ld seconds with +/-50%%,",
rip->update_time);
- vty_outln (vty, " next due in %lu seconds",
+ vty_out (vty, " next due in %lu seconds\n",
thread_timer_remain_second(rip->t_update));
vty_out (vty, " Timeout after %ld seconds,", rip->timeout_time);
- vty_outln (vty, " garbage collect after %ld seconds",rip->garbage_time);
+ vty_out (vty, " garbage collect after %ld seconds\n",rip->garbage_time);
/* Filtering status show. */
config_show_distribute (vty);
/* Default metric information. */
- vty_outln (vty, " Default redistribution metric is %d",
+ vty_out (vty, " Default redistribution metric is %d\n",
rip->default_metric);
/* Redistribute information. */
vty_out (vty, " Redistributing:");
config_write_rip_redistribute (vty, 0);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
vty_out (vty, " Default version control: send version %s,",
lookup_msg(ri_version_msg,rip->version_send, NULL));
if (rip->version_recv == RI_RIP_VERSION_1_AND_2)
- vty_outln (vty, " receive any version ");
+ vty_out (vty, " receive any version \n");
else
- vty_outln (vty, " receive version %s ",
+ vty_out (vty, " receive version %s \n",
lookup_msg(ri_version_msg,rip->version_recv, NULL));
- vty_outln (vty, " Interface Send Recv Key-chain");
+ vty_out (vty, " Interface Send Recv Key-chain\n");
for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
@@ -3607,14 +3606,14 @@ DEFUN (show_ip_rip_status,
else
receive_version = lookup_msg(ri_version_msg, ri->ri_receive, NULL);
- vty_outln (vty, " %-17s%-3s %-3s %s", ifp->name,
+ vty_out (vty, " %-17s%-3s %-3s %s\n", ifp->name,
send_version,
receive_version,
ri->key_chain ? ri->key_chain : "");
}
}
- vty_outln (vty, " Routing for Networks:");
+ vty_out (vty, " Routing for Networks:\n");
config_write_rip_network (vty, 0);
{
@@ -3627,17 +3626,17 @@ DEFUN (show_ip_rip_status,
{
if (!found_passive)
{
- vty_outln (vty, " Passive Interface(s):");
+ vty_out (vty, " Passive Interface(s):\n");
found_passive = 1;
}
- vty_outln (vty, " %s", ifp->name);
+ vty_out (vty, " %s\n", ifp->name);
}
}
}
- vty_outln (vty, " Routing Information Sources:");
- vty_outln (vty,
- " Gateway BadPackets BadRoutes Distance Last Update");
+ vty_out (vty, " Routing Information Sources:\n");
+ vty_out (vty,
+ " Gateway BadPackets BadRoutes Distance Last Update\n");
rip_peer_display (vty);
rip_distance_show (vty);
@@ -3656,19 +3655,19 @@ config_write_rip (struct vty *vty)
if (rip)
{
/* Router RIP statement. */
- vty_outln (vty, "router rip");
+ vty_out (vty, "router rip\n");
write++;
/* RIP version statement. Default is RIP version 2. */
if (rip->version_send != RI_RIP_VERSION_2
|| rip->version_recv != RI_RIP_VERSION_1_AND_2)
- vty_outln (vty, " version %d",rip->version_send);
+ vty_out (vty, " version %d\n",rip->version_send);
/* RIP timer configuration. */
if (rip->update_time != RIP_UPDATE_TIMER_DEFAULT
|| rip->timeout_time != RIP_TIMEOUT_TIMER_DEFAULT
|| rip->garbage_time != RIP_GARBAGE_TIMER_DEFAULT)
- vty_outln (vty, " timers basic %lu %lu %lu",
+ vty_out (vty, " timers basic %lu %lu %lu\n",
rip->update_time,
rip->timeout_time,
rip->garbage_time);
@@ -3677,10 +3676,10 @@ config_write_rip (struct vty *vty)
if (rip->default_information)
{
if (rip->default_information_route_map)
- vty_outln (vty, " default-information originate route-map %s",
+ vty_out (vty, " default-information originate route-map %s\n",
rip->default_information_route_map);
else
- vty_outln (vty," default-information originate");
+ vty_out (vty," default-information originate\n");
}
/* Redistribute configuration. */
@@ -3694,7 +3693,7 @@ config_write_rip (struct vty *vty)
/* RIP default metric configuration */
if (rip->default_metric != RIP_DEFAULT_METRIC_DEFAULT)
- vty_outln (vty, " default-metric %d",
+ vty_out (vty, " default-metric %d\n",
rip->default_metric);
/* Distribute configuration. */
@@ -3705,23 +3704,23 @@ config_write_rip (struct vty *vty)
/* Distance configuration. */
if (rip->distance)
- vty_outln (vty, " distance %d", rip->distance);
+ vty_out (vty, " distance %d\n", rip->distance);
/* RIP source IP prefix distance configuration. */
for (rn = route_top (rip_distance_table); rn; rn = route_next (rn))
if ((rdistance = rn->info) != NULL)
- vty_outln (vty, " distance %d %s/%d %s", rdistance->distance,
+ vty_out (vty, " distance %d %s/%d %s\n", rdistance->distance,
inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen,
rdistance->access_list ? rdistance->access_list : "");
/* ECMP configuration. */
if (rip->ecmp)
- vty_outln (vty, " allow-ecmp");
+ vty_out (vty, " allow-ecmp\n");
/* RIP static route configuration. */
for (rn = route_top (rip->route); rn; rn = route_next (rn))
if (rn->info)
- vty_outln (vty, " route %s/%d",
+ vty_out (vty, " route %s/%d\n",
inet_ntoa (rn->p.u.prefix4),
rn->p.prefixlen);