summaryrefslogtreecommitdiffstats
path: root/ripngd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-07-13 17:49:13 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-07-13 20:29:22 +0200
commit5c7571d43f57317b0827ac82fbebc4cdc6865be0 (patch)
tree2bc63ccbd805abc9689e9f3345e34871558d5c26 /ripngd
parentlib: move \n vs. \r\n handling into vty code (diff)
downloadfrr-5c7571d43f57317b0827ac82fbebc4cdc6865be0.tar.xz
frr-5c7571d43f57317b0827ac82fbebc4cdc6865be0.zip
*: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ripng_debug.c22
-rw-r--r--ripngd/ripng_interface.c22
-rw-r--r--ripngd/ripng_offset.c18
-rw-r--r--ripngd/ripng_peer.c2
-rw-r--r--ripngd/ripng_zebra.c24
-rw-r--r--ripngd/ripngd.c54
6 files changed, 71 insertions, 71 deletions
diff --git a/ripngd/ripng_debug.c b/ripngd/ripng_debug.c
index 9ba0e10e4..f08265600 100644
--- a/ripngd/ripng_debug.c
+++ b/ripngd/ripng_debug.c
@@ -35,28 +35,28 @@ DEFUN (show_debugging_ripng,
DEBUG_STR
"RIPng configuration\n")
{
- vty_outln (vty, "RIPng debugging status:");
+ vty_out (vty, "RIPng debugging status:\n");
if (IS_RIPNG_DEBUG_EVENT)
- vty_outln (vty, " RIPng event debugging is on");
+ vty_out (vty, " RIPng event debugging is on\n");
if (IS_RIPNG_DEBUG_PACKET)
{
if (IS_RIPNG_DEBUG_SEND && IS_RIPNG_DEBUG_RECV)
{
- vty_outln (vty," RIPng packet debugging is on");
+ vty_out (vty," RIPng packet debugging is on\n");
}
else
{
if (IS_RIPNG_DEBUG_SEND)
- vty_outln (vty," RIPng packet send debugging is on");
+ vty_out (vty," RIPng packet send debugging is on\n");
else
- vty_outln (vty," RIPng packet receive debugging is on");
+ vty_out (vty," RIPng packet receive debugging is on\n");
}
}
if (IS_RIPNG_DEBUG_ZEBRA)
- vty_outln (vty, " RIPng zebra debugging is on");
+ vty_out (vty, " RIPng zebra debugging is on\n");
return CMD_SUCCESS;
}
@@ -194,28 +194,28 @@ config_write_debug (struct vty *vty)
if (IS_RIPNG_DEBUG_EVENT)
{
- vty_outln (vty, "debug ripng events");
+ vty_out (vty, "debug ripng events\n");
write++;
}
if (IS_RIPNG_DEBUG_PACKET)
{
if (IS_RIPNG_DEBUG_SEND && IS_RIPNG_DEBUG_RECV)
{
- vty_outln (vty,"debug ripng packet");
+ vty_out (vty,"debug ripng packet\n");
write++;
}
else
{
if (IS_RIPNG_DEBUG_SEND)
- vty_outln (vty,"debug ripng packet send");
+ vty_out (vty,"debug ripng packet send\n");
else
- vty_outln (vty,"debug ripng packet recv");
+ vty_out (vty,"debug ripng packet recv\n");
write++;
}
}
if (IS_RIPNG_DEBUG_ZEBRA)
{
- vty_outln (vty, "debug ripng zebra");
+ vty_out (vty, "debug ripng zebra\n");
write++;
}
return write;
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index d739540c2..2abf2f9a9 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -916,7 +916,7 @@ ripng_network_write (struct vty *vty, int config_mode)
if (node->info)
{
struct prefix *p = &node->p;
- vty_outln (vty, "%s%s/%d",
+ vty_out (vty, "%s%s/%d\n",
config_mode ? " network " : " ",
inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
p->prefixlen);
@@ -926,7 +926,7 @@ ripng_network_write (struct vty *vty, int config_mode)
/* Write enable interface. */
for (i = 0; i < vector_active (ripng_enable_if); i++)
if ((ifname = vector_slot (ripng_enable_if, i)) != NULL)
- vty_outln (vty, "%s%s",
+ vty_out (vty, "%s%s\n",
config_mode ? " network " : " ",
ifname);
@@ -934,7 +934,7 @@ ripng_network_write (struct vty *vty, int config_mode)
if (config_mode)
for (i = 0; i < vector_active (Vripng_passive_interface); i++)
if ((ifname = vector_slot (Vripng_passive_interface, i)) != NULL)
- vty_outln (vty, " passive-interface %s", ifname);
+ vty_out (vty, " passive-interface %s\n", ifname);
return 0;
}
@@ -960,7 +960,7 @@ DEFUN (ripng_network,
if (ret < 0)
{
- vty_outln (vty, "There is same network configuration %s",
+ vty_out (vty, "There is same network configuration %s\n",
argv[idx_if_or_addr]->arg);
return CMD_WARNING;
}
@@ -990,7 +990,7 @@ DEFUN (no_ripng_network,
if (ret < 0)
{
- vty_outln (vty, "can't find network %s",argv[idx_if_or_addr]->arg);
+ vty_out (vty, "can't find network %s\n",argv[idx_if_or_addr]->arg);
return CMD_WARNING;
}
@@ -1121,28 +1121,28 @@ interface_config_write (struct vty *vty)
(ri->split_horizon == ri->split_horizon_default))
continue;
- vty_outln (vty, "interface %s",ifp->name);
+ vty_out (vty, "interface %s\n",ifp->name);
if (ifp->desc)
- vty_outln (vty, " description %s",ifp->desc);
+ vty_out (vty, " description %s\n",ifp->desc);
/* Split horizon. */
if (ri->split_horizon != ri->split_horizon_default)
{
switch (ri->split_horizon) {
case RIPNG_SPLIT_HORIZON:
- vty_outln (vty, " ipv6 ripng split-horizon");
+ vty_out (vty, " ipv6 ripng split-horizon\n");
break;
case RIPNG_SPLIT_HORIZON_POISONED_REVERSE:
- vty_outln (vty," ipv6 ripng split-horizon poisoned-reverse");
+ vty_out (vty," ipv6 ripng split-horizon poisoned-reverse\n");
break;
case RIPNG_NO_SPLIT_HORIZON:
default:
- vty_outln (vty, " no ipv6 ripng split-horizon");
+ vty_out (vty, " no ipv6 ripng split-horizon\n");
break;
}
}
- vty_outln (vty, "!");
+ vty_out (vty, "!\n");
write++;
}
diff --git a/ripngd/ripng_offset.c b/ripngd/ripng_offset.c
index 51385dd93..e0ca0666b 100644
--- a/ripngd/ripng_offset.c
+++ b/ripngd/ripng_offset.c
@@ -125,7 +125,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist,
direct = RIPNG_OFFSET_LIST_OUT;
else
{
- vty_outln (vty, "Invalid direction: %s", direct_str);
+ vty_out (vty, "Invalid direction: %s\n", direct_str);
return CMD_WARNING;
}
@@ -133,7 +133,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist,
metric = atoi (metric_str);
if (metric < 0 || metric > 16)
{
- vty_outln (vty, "Invalid metric: %s", metric_str);
+ vty_out (vty, "Invalid metric: %s\n", metric_str);
return CMD_WARNING;
}
@@ -164,7 +164,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist,
direct = RIPNG_OFFSET_LIST_OUT;
else
{
- vty_outln (vty, "Invalid direction: %s", direct_str);
+ vty_out (vty, "Invalid direction: %s\n", direct_str);
return CMD_WARNING;
}
@@ -172,7 +172,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist,
metric = atoi (metric_str);
if (metric < 0 || metric > 16)
{
- vty_outln (vty, "Invalid metric: %s", metric_str);
+ vty_out (vty, "Invalid metric: %s\n", metric_str);
return CMD_WARNING;
}
@@ -196,7 +196,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist,
}
else
{
- vty_outln (vty, "Can't find offset-list");
+ vty_out (vty, "Can't find offset-list\n");
return CMD_WARNING;
}
return CMD_SUCCESS;
@@ -405,23 +405,23 @@ config_write_ripng_offset_list (struct vty *vty)
if (! offset->ifname)
{
if (offset->direct[RIPNG_OFFSET_LIST_IN].alist_name)
- vty_outln (vty, " offset-list %s in %d",
+ vty_out (vty, " offset-list %s in %d\n",
offset->direct[RIPNG_OFFSET_LIST_IN].alist_name,
offset->direct[RIPNG_OFFSET_LIST_IN].metric);
if (offset->direct[RIPNG_OFFSET_LIST_OUT].alist_name)
- vty_outln (vty, " offset-list %s out %d",
+ vty_out (vty, " offset-list %s out %d\n",
offset->direct[RIPNG_OFFSET_LIST_OUT].alist_name,
offset->direct[RIPNG_OFFSET_LIST_OUT].metric);
}
else
{
if (offset->direct[RIPNG_OFFSET_LIST_IN].alist_name)
- vty_outln (vty, " offset-list %s in %d %s",
+ vty_out (vty, " offset-list %s in %d %s\n",
offset->direct[RIPNG_OFFSET_LIST_IN].alist_name,
offset->direct[RIPNG_OFFSET_LIST_IN].metric,
offset->ifname);
if (offset->direct[RIPNG_OFFSET_LIST_OUT].alist_name)
- vty_outln (vty, " offset-list %s out %d %s",
+ vty_out (vty, " offset-list %s out %d %s\n",
offset->direct[RIPNG_OFFSET_LIST_OUT].alist_name,
offset->direct[RIPNG_OFFSET_LIST_OUT].metric,
offset->ifname);
diff --git a/ripngd/ripng_peer.c b/ripngd/ripng_peer.c
index 51f1a4009..03f3b4e05 100644
--- a/ripngd/ripng_peer.c
+++ b/ripngd/ripng_peer.c
@@ -193,7 +193,7 @@ ripng_peer_display (struct vty *vty)
for (ALL_LIST_ELEMENTS (peer_list, node, nnode, peer))
{
- vty_outln (vty, " %s %s%14s %10d %10d %10d %s", inet6_ntoa (peer->addr),
+ vty_out (vty, " %s %s%14s %10d %10d %10d %s\n", inet6_ntoa (peer->addr),
VTYNL, " ",
peer->recv_badpackets, peer->recv_badroutes,
ZEBRA_RIPNG_DISTANCE_DEFAULT,
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index 465d33992..725336aff 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -337,7 +337,7 @@ DEFUN (ripng_redistribute_type,
if (type < 0)
{
- vty_outln (vty, "Invalid type %s", proto);
+ vty_out (vty, "Invalid type %s\n", proto);
return CMD_WARNING;
}
@@ -363,7 +363,7 @@ DEFUN (no_ripng_redistribute_type,
if (type < 0)
{
- vty_outln (vty, "Invalid type %s", proto);
+ vty_out (vty, "Invalid type %s\n", proto);
return CMD_WARNING;
}
@@ -391,7 +391,7 @@ DEFUN (ripng_redistribute_type_metric,
if (type < 0)
{
- vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text);
+ vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text);
return CMD_WARNING;
}
@@ -417,7 +417,7 @@ DEFUN (ripng_redistribute_type_routemap,
if (type < 0)
{
- vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text);
+ vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text);
return CMD_WARNING;
}
@@ -448,7 +448,7 @@ DEFUN (ripng_redistribute_type_metric_routemap,
if (type < 0)
{
- vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text);
+ vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text);
return CMD_WARNING;
}
@@ -472,20 +472,20 @@ ripng_redistribute_write (struct vty *vty, int config_mode)
if (ripng->route_map[i].metric_config)
{
if (ripng->route_map[i].name)
- vty_outln (vty, " redistribute %s metric %d route-map %s",
+ vty_out (vty, " redistribute %s metric %d route-map %s\n",
zebra_route_string(i), ripng->route_map[i].metric,
ripng->route_map[i].name);
else
- vty_outln (vty, " redistribute %s metric %d",
+ vty_out (vty, " redistribute %s metric %d\n",
zebra_route_string(i),ripng->route_map[i].metric);
}
else
{
if (ripng->route_map[i].name)
- vty_outln (vty, " redistribute %s route-map %s",
+ vty_out (vty, " redistribute %s route-map %s\n",
zebra_route_string(i),ripng->route_map[i].name);
else
- vty_outln (vty, " redistribute %s",zebra_route_string(i));
+ vty_out (vty, " redistribute %s\n",zebra_route_string(i));
}
}
else
@@ -499,13 +499,13 @@ zebra_config_write (struct vty *vty)
{
if (! zclient->enable)
{
- vty_outln (vty, "no router zebra");
+ vty_out (vty, "no router zebra\n");
return 1;
}
else if (! vrf_bitmap_check (zclient->redist[AFI_IP6][ZEBRA_ROUTE_RIPNG], VRF_DEFAULT))
{
- vty_outln (vty, "router zebra");
- vty_outln (vty, " no redistribute ripng");
+ vty_out (vty, "router zebra\n");
+ vty_out (vty, " no redistribute ripng\n");
return 1;
}
return 0;
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index bfec173ef..affb12b8a 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -2113,16 +2113,16 @@ DEFUN (show_ipv6_ripng_status,
vty_outln (vty, "Routing Protocol is \"RIPng\"");
vty_out (vty, " Sending updates every %ld seconds with +/-50%%,",
ripng->update_time);
- vty_outln (vty, " next due in %lu seconds",
+ vty_out (vty, " next due in %lu seconds\n",
thread_timer_remain_second(ripng->t_update));
vty_out (vty, " Timeout after %ld seconds,", ripng->timeout_time);
- vty_outln (vty, " garbage collect after %ld seconds",ripng->garbage_time);
+ vty_out (vty, " garbage collect after %ld seconds\n",ripng->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",
ripng->default_metric);
/* Redistribute information. */
@@ -2131,9 +2131,9 @@ DEFUN (show_ipv6_ripng_status,
vty_out (vty, VTYNL);
vty_out (vty, " Default version control: send version %d,", ripng->version);
- vty_outln (vty, " receive version %d ",ripng->version);
+ vty_out (vty, " receive version %d \n",ripng->version);
- vty_outln (vty, " Interface Send Recv");
+ vty_out (vty, " Interface Send Recv\n");
for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
@@ -2144,18 +2144,18 @@ DEFUN (show_ipv6_ripng_status,
if (ri->enable_network || ri->enable_interface)
{
- vty_outln (vty, " %-17s%-3d %-3d", ifp->name,
+ vty_out (vty, " %-17s%-3d %-3d\n", ifp->name,
ripng->version,
ripng->version);
}
}
- vty_outln (vty, " Routing for Networks:");
+ vty_out (vty, " Routing for Networks:\n");
ripng_network_write (vty, 0);
- 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");
ripng_peer_display (vty);
return CMD_SUCCESS;
@@ -2260,7 +2260,7 @@ DEFUN (ripng_route,
ret = str2prefix_ipv6 (argv[idx_ipv6addr]->arg, (struct prefix_ipv6 *)&p);
if (ret <= 0)
{
- vty_outln (vty, "Malformed address");
+ vty_out (vty, "Malformed address\n");
return CMD_WARNING;
}
apply_mask_ipv6 (&p);
@@ -2268,7 +2268,7 @@ DEFUN (ripng_route,
rp = route_node_get (ripng->route, (struct prefix *) &p);
if (rp->info)
{
- vty_outln (vty, "There is already same static route.");
+ vty_out (vty, "There is already same static route.\n");
route_unlock_node (rp);
return CMD_WARNING;
}
@@ -2294,7 +2294,7 @@ DEFUN (no_ripng_route,
ret = str2prefix_ipv6 (argv[idx_ipv6addr]->arg, (struct prefix_ipv6 *)&p);
if (ret <= 0)
{
- vty_outln (vty, "Malformed address");
+ vty_out (vty, "Malformed address\n");
return CMD_WARNING;
}
apply_mask_ipv6 (&p);
@@ -2302,7 +2302,7 @@ DEFUN (no_ripng_route,
rp = route_node_lookup (ripng->route, (struct prefix *) &p);
if (! rp)
{
- vty_outln (vty, "Can't find static route.");
+ vty_out (vty, "Can't find static route.\n");
return CMD_WARNING;
}
@@ -2329,7 +2329,7 @@ DEFUN (ripng_aggregate_address,
ret = str2prefix_ipv6 (argv[idx_ipv6_prefixlen]->arg, (struct prefix_ipv6 *)&p);
if (ret <= 0)
{
- vty_outln (vty, "Malformed address");
+ vty_out (vty, "Malformed address\n");
return CMD_WARNING;
}
@@ -2337,7 +2337,7 @@ DEFUN (ripng_aggregate_address,
node = route_node_get (ripng->aggregate, &p);
if (node->info)
{
- vty_outln (vty, "There is already same aggregate route.");
+ vty_out (vty, "There is already same aggregate route.\n");
route_unlock_node (node);
return CMD_WARNING;
}
@@ -2363,14 +2363,14 @@ DEFUN (no_ripng_aggregate_address,
ret = str2prefix_ipv6 (argv[idx_ipv6_prefixlen]->arg, (struct prefix_ipv6 *) &p);
if (ret <= 0)
{
- vty_outln (vty, "Malformed address");
+ vty_out (vty, "Malformed address\n");
return CMD_WARNING;
}
rn = route_node_lookup (ripng->aggregate, &p);
if (! rn)
{
- vty_outln (vty, "Can't find aggregate route.");
+ vty_out (vty, "Can't find aggregate route.\n");
return CMD_WARNING;
}
route_unlock_node (rn);
@@ -2680,7 +2680,7 @@ DEFUN (ripng_allow_ecmp,
{
if (ripng->ecmp)
{
- vty_outln (vty, "ECMP is already enabled.");
+ vty_out (vty, "ECMP is already enabled.\n");
return CMD_WARNING;
}
@@ -2697,7 +2697,7 @@ DEFUN (no_ripng_allow_ecmp,
{
if (!ripng->ecmp)
{
- vty_outln (vty, "ECMP is already disabled.");
+ vty_out (vty, "ECMP is already disabled.\n");
return CMD_WARNING;
}
@@ -2720,16 +2720,16 @@ ripng_config_write (struct vty *vty)
{
/* RIPng router. */
- vty_outln (vty, "router ripng");
+ vty_out (vty, "router ripng\n");
if (ripng->default_information)
- vty_outln (vty, " default-information originate");
+ vty_out (vty, " default-information originate\n");
ripng_network_write (vty, 1);
/* RIPng default metric configuration */
if (ripng->default_metric != RIPNG_DEFAULT_METRIC_DEFAULT)
- vty_outln (vty, " default-metric %d",
+ vty_out (vty, " default-metric %d\n",
ripng->default_metric);
ripng_redistribute_write (vty, 1);
@@ -2740,18 +2740,18 @@ ripng_config_write (struct vty *vty)
/* RIPng aggregate routes. */
for (rp = route_top (ripng->aggregate); rp; rp = route_next (rp))
if (rp->info != NULL)
- vty_outln (vty, " aggregate-address %s/%d",
+ vty_out (vty, " aggregate-address %s/%d\n",
inet6_ntoa (rp->p.u.prefix6),
rp->p.prefixlen);
/* ECMP configuration. */
if (ripng->ecmp)
- vty_outln (vty, " allow-ecmp");
+ vty_out (vty, " allow-ecmp\n");
/* RIPng static routes. */
for (rp = route_top (ripng->route); rp; rp = route_next (rp))
if (rp->info != NULL)
- vty_outln (vty, " route %s/%d", inet6_ntoa (rp->p.u.prefix6),
+ vty_out (vty, " route %s/%d\n", inet6_ntoa (rp->p.u.prefix6),
rp->p.prefixlen);
/* RIPng timers configuration. */
@@ -2759,7 +2759,7 @@ ripng_config_write (struct vty *vty)
ripng->timeout_time != RIPNG_TIMEOUT_TIMER_DEFAULT ||
ripng->garbage_time != RIPNG_GARBAGE_TIMER_DEFAULT)
{
- vty_outln (vty, " timers basic %ld %ld %ld",
+ vty_out (vty, " timers basic %ld %ld %ld\n",
ripng->update_time,
ripng->timeout_time,
ripng->garbage_time);