Merge pull request #813 from opensourcerouting/newline-redux

newline redux
This commit is contained in:
Russ White 2017-07-14 08:00:43 -04:00 committed by GitHub
commit 28bd1c1158
146 changed files with 4944 additions and 5175 deletions

View File

@ -401,3 +401,15 @@ maintenance overhead/cost. It is also important to keep in mind,
existing code includes code that may reside in private repositories (and existing code includes code that may reside in private repositories (and
is yet to be submitted) or code that has yet to be migrated from Quagga is yet to be submitted) or code that has yet to be migrated from Quagga
to FRR. to FRR.
That said, compatibility measures can (and should) be removed when either:
* they become a significant burden, e.g. when data structures change and
the compatibility measure would need a complex adaptation layer or becomes
flat-out impossible
* some measure of time (dependent on the specific case) has passed, so that
the compatibility grace period is considered expired.
In all cases, compatibility pieces should be marked with compiler/preprocessor
annotations to print warnings at compile time, pointing to the appropriate
update path. A `-Werror` build should fail if compatibility bits are used.

View File

@ -290,7 +290,7 @@ DEFUN (babel_network,
ret = babel_enable_if_add (argv[1]->arg); ret = babel_enable_if_add (argv[1]->arg);
if (ret < 0) { if (ret < 0) {
vty_outln (vty, "There is same network configuration %s", vty_out (vty, "There is same network configuration %s\n",
argv[1]->arg); argv[1]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -318,7 +318,7 @@ DEFUN (no_babel_network,
ret = babel_enable_if_delete (argv[2]->arg); ret = babel_enable_if_delete (argv[2]->arg);
if (ret < 0) { if (ret < 0) {
vty_outln (vty, "can't find network %s",argv[2]->arg); vty_out (vty, "can't find network %s\n",argv[2]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -861,31 +861,31 @@ show_babel_interface_sub (struct vty *vty, struct interface *ifp)
int is_up; int is_up;
babel_interface_nfo *babel_ifp; babel_interface_nfo *babel_ifp;
vty_outln (vty, "%s is %s", ifp->name, vty_out (vty, "%s is %s\n", ifp->name,
((is_up = if_is_operative(ifp)) ? "up" : "down")); ((is_up = if_is_operative(ifp)) ? "up" : "down"));
vty_outln (vty, " ifindex %u, MTU %u bytes %s", vty_out (vty, " ifindex %u, MTU %u bytes %s\n",
ifp->ifindex, MIN(ifp->mtu, ifp->mtu6), if_flag_dump(ifp->flags)); ifp->ifindex, MIN(ifp->mtu, ifp->mtu6), if_flag_dump(ifp->flags));
if (!IS_ENABLE(ifp)) if (!IS_ENABLE(ifp))
{ {
vty_outln (vty, " Babel protocol is not enabled on this interface"); vty_out (vty, " Babel protocol is not enabled on this interface\n");
return; return;
} }
if (!is_up) if (!is_up)
{ {
vty_outln (vty, vty_out (vty,
" Babel protocol is enabled, but not running on this interface"); " Babel protocol is enabled, but not running on this interface\n");
return; return;
} }
babel_ifp = babel_get_if_nfo (ifp); babel_ifp = babel_get_if_nfo (ifp);
vty_outln (vty, " Babel protocol is running on this interface"); vty_out (vty, " Babel protocol is running on this interface\n");
vty_outln (vty, " Operating mode is \"%s\"", vty_out (vty, " Operating mode is \"%s\"\n",
CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? "wired" : "wireless"); CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? "wired" : "wireless");
vty_outln (vty, " Split horizon mode is %s", vty_out (vty, " Split horizon mode is %s\n",
CHECK_FLAG(babel_ifp->flags, BABEL_IF_SPLIT_HORIZON) ? "On" : "Off"); CHECK_FLAG(babel_ifp->flags, BABEL_IF_SPLIT_HORIZON) ? "On" : "Off");
vty_outln (vty, " Hello interval is %u ms", babel_ifp->hello_interval); vty_out (vty, " Hello interval is %u ms\n", babel_ifp->hello_interval);
vty_outln (vty, " Update interval is %u ms", babel_ifp->update_interval); vty_out (vty, " Update interval is %u ms\n", babel_ifp->update_interval);
vty_outln (vty, " Rxcost multiplier is %u", babel_ifp->cost); vty_out (vty, " Rxcost multiplier is %u\n", babel_ifp->cost);
} }
DEFUN (show_babel_interface, DEFUN (show_babel_interface,
@ -907,7 +907,7 @@ DEFUN (show_babel_interface,
} }
if ((ifp = if_lookup_by_name (argv[3]->arg, VRF_DEFAULT)) == NULL) if ((ifp = if_lookup_by_name (argv[3]->arg, VRF_DEFAULT)) == NULL)
{ {
vty_outln (vty, "No such interface name"); vty_out (vty, "No such interface name\n");
return CMD_WARNING; return CMD_WARNING;
} }
show_babel_interface_sub (vty, ifp); show_babel_interface_sub (vty, ifp);
@ -917,9 +917,9 @@ DEFUN (show_babel_interface,
static void static void
show_babel_neighbour_sub (struct vty *vty, struct neighbour *neigh) show_babel_neighbour_sub (struct vty *vty, struct neighbour *neigh)
{ {
vty_outln (vty, vty_out (vty,
"Neighbour %s dev %s reach %04x rxcost %d txcost %d " "Neighbour %s dev %s reach %04x rxcost %d txcost %d "
"rtt %s rttcost %d%s.", "rtt %s rttcost %d%s.\n",
format_address(neigh->address), format_address(neigh->address),
neigh->ifp->name, neigh->ifp->name,
neigh->reach, neigh->reach,
@ -949,7 +949,7 @@ DEFUN (show_babel_neighbour,
} }
if ((ifp = if_lookup_by_name (argv[3]->arg, VRF_DEFAULT)) == NULL) if ((ifp = if_lookup_by_name (argv[3]->arg, VRF_DEFAULT)) == NULL)
{ {
vty_outln (vty, "No such interface name"); vty_out (vty, "No such interface name\n");
return CMD_WARNING; return CMD_WARNING;
} }
FOR_ALL_NEIGHBOURS(neigh) { FOR_ALL_NEIGHBOURS(neigh) {
@ -1009,9 +1009,9 @@ show_babel_routes_sub(struct babel_route *route, struct vty *vty,
channels[0] = '\0'; channels[0] = '\0';
} }
vty_outln (vty, vty_out (vty,
"%s metric %d refmetric %d id %s seqno %d%s age %d " "%s metric %d refmetric %d id %s seqno %d%s age %d "
"via %s neigh %s%s%s%s", "via %s neigh %s%s%s%s\n",
format_prefix(route->src->prefix, route->src->plen), format_prefix(route->src->prefix, route->src->plen),
route_metric(route), route->refmetric, route_metric(route), route->refmetric,
format_eui64(route->src->id), format_eui64(route->src->id),
@ -1032,7 +1032,7 @@ show_babel_xroutes_sub (struct xroute *xroute, struct vty *vty,
if(prefix && !babel_prefix_eq(prefix, xroute->prefix, xroute->plen)) if(prefix && !babel_prefix_eq(prefix, xroute->prefix, xroute->plen))
return; return;
vty_outln (vty, "%s metric %d (exported)", vty_out (vty, "%s metric %d (exported)\n",
format_prefix(xroute->prefix, xroute->plen), format_prefix(xroute->prefix, xroute->plen),
xroute->metric); xroute->metric);
} }
@ -1089,7 +1089,7 @@ DEFUN (show_babel_route_prefix,
ret = str2prefix(argv[3]->arg, &prefix); ret = str2prefix(argv[3]->arg, &prefix);
if(ret == 0) { if(ret == 0) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1138,7 +1138,7 @@ DEFUN (show_babel_route_addr,
ret = inet_aton (argv[3]->arg, &addr); ret = inet_aton (argv[3]->arg, &addr);
if (ret <= 0) { if (ret <= 0) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1147,7 +1147,7 @@ DEFUN (show_babel_route_addr,
ret = str2prefix(buf, &prefix); ret = str2prefix(buf, &prefix);
if (ret == 0) { if (ret == 0) {
vty_outln (vty, "%% Parse error -- this shouldn't happen"); vty_out (vty, "%% Parse error -- this shouldn't happen\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1196,7 +1196,7 @@ DEFUN (show_babel_route_addr6,
ret = inet_pton (AF_INET6, argv[3]->arg, &addr); ret = inet_pton (AF_INET6, argv[3]->arg, &addr);
if (ret <= 0) { if (ret <= 0) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1206,7 +1206,7 @@ DEFUN (show_babel_route_addr6,
ret = str2prefix(buf, &prefix); ret = str2prefix(buf, &prefix);
if (ret == 0) { if (ret == 0) {
vty_outln (vty, "%% Parse error -- this shouldn't happen"); vty_out (vty, "%% Parse error -- this shouldn't happen\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1244,9 +1244,9 @@ DEFUN (show_babel_parameters,
"Babel information\n" "Babel information\n"
"Configuration information\n") "Configuration information\n")
{ {
vty_outln (vty, " -- Babel running configuration --"); vty_out (vty, " -- Babel running configuration --\n");
show_babel_main_configuration(vty); show_babel_main_configuration(vty);
vty_outln (vty, " -- distribution lists --"); vty_out (vty, " -- distribution lists --\n");
config_show_distribute(vty); config_show_distribute(vty);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1321,63 +1321,63 @@ interface_config_write (struct vty *vty)
int write = 0; int write = 0;
for (ALL_LIST_ELEMENTS_RO (vrf_iflist(VRF_DEFAULT), node, ifp)) { for (ALL_LIST_ELEMENTS_RO (vrf_iflist(VRF_DEFAULT), node, ifp)) {
vty_outln (vty, "interface %s",ifp->name); vty_out (vty, "interface %s\n",ifp->name);
if (ifp->desc) if (ifp->desc)
vty_outln (vty, " description %s",ifp->desc); vty_out (vty, " description %s\n",ifp->desc);
babel_interface_nfo *babel_ifp = babel_get_if_nfo (ifp); babel_interface_nfo *babel_ifp = babel_get_if_nfo (ifp);
/* wireless is the default*/ /* wireless is the default*/
if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED)) if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED))
{ {
vty_outln (vty, " babel wired"); vty_out (vty, " babel wired\n");
write++; write++;
} }
if (babel_ifp->hello_interval != BABEL_DEFAULT_HELLO_INTERVAL) if (babel_ifp->hello_interval != BABEL_DEFAULT_HELLO_INTERVAL)
{ {
vty_outln (vty, " babel hello-interval %u", vty_out (vty, " babel hello-interval %u\n",
babel_ifp->hello_interval); babel_ifp->hello_interval);
write++; write++;
} }
if (babel_ifp->update_interval != BABEL_DEFAULT_UPDATE_INTERVAL) if (babel_ifp->update_interval != BABEL_DEFAULT_UPDATE_INTERVAL)
{ {
vty_outln (vty, " babel update-interval %u", vty_out (vty, " babel update-interval %u\n",
babel_ifp->update_interval); babel_ifp->update_interval);
write++; write++;
} }
/* Some parameters have different defaults for wired/wireless. */ /* Some parameters have different defaults for wired/wireless. */
if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED)) { if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED)) {
if (!CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON)) { if (!CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON)) {
vty_outln (vty, " no babel split-horizon"); vty_out (vty, " no babel split-horizon\n");
write++; write++;
} }
if (babel_ifp->cost != BABEL_DEFAULT_RXCOST_WIRED) { if (babel_ifp->cost != BABEL_DEFAULT_RXCOST_WIRED) {
vty_outln (vty, " babel rxcost %u", babel_ifp->cost); vty_out (vty, " babel rxcost %u\n", babel_ifp->cost);
write++; write++;
} }
if (babel_ifp->channel == BABEL_IF_CHANNEL_INTERFERING) { if (babel_ifp->channel == BABEL_IF_CHANNEL_INTERFERING) {
vty_outln (vty, " babel channel interfering"); vty_out (vty, " babel channel interfering\n");
write++; write++;
} else if(babel_ifp->channel != BABEL_IF_CHANNEL_NONINTERFERING) { } else if(babel_ifp->channel != BABEL_IF_CHANNEL_NONINTERFERING) {
vty_outln (vty, " babel channel %d",babel_ifp->channel); vty_out (vty, " babel channel %d\n",babel_ifp->channel);
write++; write++;
} }
} else { } else {
if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON)) { if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON)) {
vty_outln (vty, " babel split-horizon"); vty_out (vty, " babel split-horizon\n");
write++; write++;
} }
if (babel_ifp->cost != BABEL_DEFAULT_RXCOST_WIRELESS) { if (babel_ifp->cost != BABEL_DEFAULT_RXCOST_WIRELESS) {
vty_outln (vty, " babel rxcost %u", babel_ifp->cost); vty_out (vty, " babel rxcost %u\n", babel_ifp->cost);
write++; write++;
} }
if (babel_ifp->channel == BABEL_IF_CHANNEL_NONINTERFERING) { if (babel_ifp->channel == BABEL_IF_CHANNEL_NONINTERFERING) {
vty_outln (vty, " babel channel noninterfering"); vty_out (vty, " babel channel noninterfering\n");
write++; write++;
} else if(babel_ifp->channel != BABEL_IF_CHANNEL_INTERFERING) { } else if(babel_ifp->channel != BABEL_IF_CHANNEL_INTERFERING) {
vty_outln (vty, " babel channel %d",babel_ifp->channel); vty_out (vty, " babel channel %d\n",babel_ifp->channel);
write++; write++;
} }
} }
vty_outln (vty, "!"); vty_out (vty, "!\n");
write++; write++;
} }
return write; return write;
@ -1393,7 +1393,7 @@ babel_enable_if_config_write (struct vty * vty)
for (i = 0; i < vector_active (babel_enable_if); i++) for (i = 0; i < vector_active (babel_enable_if); i++)
if ((str = vector_slot (babel_enable_if, i)) != NULL) if ((str = vector_slot (babel_enable_if, i)) != NULL)
{ {
vty_outln (vty, " network %s", str); vty_out (vty, " network %s\n", str);
lines++; lines++;
} }
return lines; return lines;

View File

@ -377,25 +377,22 @@ babel_save_state_file(void)
void void
show_babel_main_configuration (struct vty *vty) show_babel_main_configuration (struct vty *vty)
{ {
vty_outln (vty, vty_out (vty,
"state file = %s%s" "state file = %s\n"
"configuration file = %s%s" "configuration file = %s\n"
"protocol informations:%s" "protocol informations:\n"
" multicast address = %s%s" " multicast address = %s\n"
" port = %d%s" " port = %d\n"
"vty address = %s%s" "vty address = %s\n"
"vty port = %d%s" "vty port = %d\n"
"id = %s%s" "id = %s\n"
"kernel_metric = %d", "kernel_metric = %d\n",
state_file, VTYNL, state_file,
babel_config_file ? babel_config_file : babel_config_default, babel_config_file ? babel_config_file : babel_config_default,
VTYNL, format_address(protocol_group),
VTYNL, protocol_port,
format_address(protocol_group), VTYNL,
protocol_port, VTYNL,
babel_vty_addr ? babel_vty_addr : "None", babel_vty_addr ? babel_vty_addr : "None",
VTYNL, babel_vty_port,
babel_vty_port, VTYNL, format_eui64(myid),
format_eui64(myid), VTYNL,
kernel_metric); kernel_metric);
} }

View File

@ -222,7 +222,7 @@ DEFUN (babel_redistribute_type,
type = babel_proto_redistnum(argv[1]->arg); type = babel_proto_redistnum(argv[1]->arg);
if (type < 0) { if (type < 0) {
vty_outln (vty, "Invalid type %s", argv[1]->arg); vty_out (vty, "Invalid type %s\n", argv[1]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -244,7 +244,7 @@ DEFUN (no_babel_redistribute_type,
type = babel_proto_redistnum(argv[2]->arg); type = babel_proto_redistnum(argv[2]->arg);
if (type < 0) { if (type < 0) {
vty_outln (vty, "Invalid type %s", argv[2]->arg); vty_out (vty, "Invalid type %s\n", argv[2]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -279,7 +279,7 @@ DEFUN (debug_babel,
} }
} }
vty_outln (vty, "Invalid type %s", argv[2]->arg); vty_out (vty, "Invalid type %s\n", argv[2]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -309,7 +309,7 @@ DEFUN (no_debug_babel,
} }
} }
vty_outln (vty, "Invalid type %s", argv[3]->arg); vty_out (vty, "Invalid type %s\n", argv[3]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -326,7 +326,7 @@ debug_babel_config_write (struct vty * vty)
if (debug == BABEL_DEBUG_ALL) if (debug == BABEL_DEBUG_ALL)
{ {
vty_outln (vty, "debug babel all"); vty_out (vty, "debug babel all\n");
lines++; lines++;
} }
else else
@ -337,12 +337,12 @@ debug_babel_config_write (struct vty * vty)
&& CHECK_FLAG (debug, debug_type[i].type) && CHECK_FLAG (debug, debug_type[i].type)
) )
{ {
vty_outln (vty, "debug babel %s", debug_type[i].str); vty_out (vty, "debug babel %s\n", debug_type[i].str);
lines++; lines++;
} }
if (lines) if (lines)
{ {
vty_outln (vty, "!"); vty_out (vty, "!\n");
lines++; lines++;
} }
return lines; return lines;
@ -386,13 +386,13 @@ zebra_config_write (struct vty *vty)
{ {
if (! zclient->enable) if (! zclient->enable)
{ {
vty_outln (vty, "no router zebra"); vty_out (vty, "no router zebra\n");
return 1; return 1;
} }
else if (! vrf_bitmap_check (zclient->redist[AFI_IP][ZEBRA_ROUTE_BABEL], VRF_DEFAULT)) else if (! vrf_bitmap_check (zclient->redist[AFI_IP][ZEBRA_ROUTE_BABEL], VRF_DEFAULT))
{ {
vty_outln (vty, "router zebra"); vty_out (vty, "router zebra\n");
vty_outln (vty, " no redistribute babel"); vty_out (vty, " no redistribute babel\n");
return 1; return 1;
} }
return 0; return 0;

View File

@ -83,25 +83,25 @@ babel_config_write (struct vty *vty)
if (!babel_routing_process) if (!babel_routing_process)
return lines; return lines;
vty_outln (vty, "router babel"); vty_out (vty, "router babel\n");
if (diversity_kind != DIVERSITY_NONE) if (diversity_kind != DIVERSITY_NONE)
{ {
vty_outln (vty, " babel diversity"); vty_out (vty, " babel diversity\n");
lines++; lines++;
} }
if (diversity_factor != BABEL_DEFAULT_DIVERSITY_FACTOR) if (diversity_factor != BABEL_DEFAULT_DIVERSITY_FACTOR)
{ {
vty_outln (vty, " babel diversity-factor %d",diversity_factor); vty_out (vty, " babel diversity-factor %d\n",diversity_factor);
lines++; lines++;
} }
if (resend_delay != BABEL_DEFAULT_RESEND_DELAY) if (resend_delay != BABEL_DEFAULT_RESEND_DELAY)
{ {
vty_outln (vty, " babel resend-delay %u", resend_delay); vty_out (vty, " babel resend-delay %u\n", resend_delay);
lines++; lines++;
} }
if (smoothing_half_life != BABEL_DEFAULT_SMOOTHING_HALF_LIFE) if (smoothing_half_life != BABEL_DEFAULT_SMOOTHING_HALF_LIFE)
{ {
vty_outln (vty, " babel smoothing-half-life %u", vty_out (vty, " babel smoothing-half-life %u\n",
smoothing_half_life); smoothing_half_life);
lines++; lines++;
} }
@ -112,7 +112,7 @@ babel_config_write (struct vty *vty)
if (i != zclient->redist_default && if (i != zclient->redist_default &&
vrf_bitmap_check (zclient->redist[AFI_IP][i], VRF_DEFAULT)) vrf_bitmap_check (zclient->redist[AFI_IP][i], VRF_DEFAULT))
{ {
vty_outln (vty, " redistribute %s", zebra_route_string(i)); vty_out (vty, " redistribute %s\n", zebra_route_string(i));
lines++; lines++;
} }

View File

@ -2176,7 +2176,7 @@ aspath_show_all_iterator (struct hash_backet *backet, struct vty *vty)
as = (struct aspath *) backet->data; as = (struct aspath *) backet->data;
vty_out (vty, "[%p:%u] (%ld) ", (void *)backet, backet->key, as->refcnt); 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 /* Print all aspath and hash information. This function is used from

View File

@ -797,7 +797,7 @@ attr_show_all_iterator (struct hash_backet *backet, struct vty *vty)
{ {
struct attr *attr = backet->data; 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)); inet_ntoa(attr->nexthop));
} }

View File

@ -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; bfd_info = (struct bfd_info *)peer->bfd_info;
if (CHECK_FLAG (bfd_info->flags, BFD_FLAG_PARAM_CFG)) 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->detect_mult, bfd_info->required_min_rx,
bfd_info->desired_min_tx); bfd_info->desired_min_tx);
if (bfd_info->type != BFD_TYPE_NOT_CONFIGURED) 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"); (bfd_info->type == BFD_TYPE_MULTIHOP) ? "multihop" : "singlehop");
if (!CHECK_FLAG (bfd_info->flags, BFD_FLAG_PARAM_CFG) && if (!CHECK_FLAG (bfd_info->flags, BFD_FLAG_PARAM_CFG) &&
(bfd_info->type == BFD_TYPE_NOT_CONFIGURED)) (bfd_info->type == BFD_TYPE_NOT_CONFIGURED))
vty_outln (vty, " neighbor %s bfd", addr); vty_out (vty, " neighbor %s bfd\n", addr);
} }
/* /*

View File

@ -525,15 +525,15 @@ bgp_config_write_damp (struct vty *vty)
&& bgp_damp_cfg.reuse_limit == DEFAULT_REUSE && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
&& bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
&& bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4) && 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 else if (bgp_damp_cfg.half_life != DEFAULT_HALF_LIFE*60
&& bgp_damp_cfg.reuse_limit == DEFAULT_REUSE && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
&& bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
&& bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4) && 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); bgp_damp_cfg.half_life / 60LL);
else 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.half_life/60LL,
bgp_damp_cfg.reuse_limit, bgp_damp_cfg.reuse_limit,
bgp_damp_cfg.suppress_value, 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", vty_out (vty, ", reuse in %s",
bgp_get_reuse_time (penalty, timebuf, BGP_UPTIME_LEN, 0, json_path)); 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) if (bgp == NULL)
{ {
vty_outln (vty, "No BGP process is configured"); vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING; return CMD_WARNING;
} }
if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) 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); (long long)damp->half_life / 60);
vty_outln (vty, "Reuse penalty: %d", vty_out (vty, "Reuse penalty: %d\n",
damp->reuse_limit); damp->reuse_limit);
vty_outln (vty, "Suppress penalty: %d", vty_out (vty, "Suppress penalty: %d\n",
damp->suppress_value); 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); (long long)damp->max_suppress_time / 60);
vty_outln (vty, "Max supress penalty: %u", vty_out (vty, "Max supress penalty: %u\n",
damp->ceiling); damp->ceiling);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
else else
vty_outln (vty, "dampening not enabled for %s", vty_out (vty, "dampening not enabled for %s\n",
afi == AFI_IP ? "IPv4" : "IPv6"); afi == AFI_IP ? "IPv4" : "IPv6");
return CMD_SUCCESS; return CMD_SUCCESS;

View File

@ -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 /* 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) if (filter->host)
{ {
vty_outln (vty, "%s %s", desc, filter->host); vty_out (vty, "%s %s\n", desc, filter->host);
write++; write++;
} }
if (filter->p) 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), inet_ntop (filter->p->family, &filter->p->u.prefix, buf, INET6_ADDRSTRLEN),
filter->p->prefixlen); filter->p->prefixlen);
write++; write++;
@ -291,7 +291,7 @@ bgp_debug_list_conf_print (struct vty *vty, const char *desc, struct list *list)
if (!write) if (!write)
{ {
vty_outln (vty, "%s", desc); vty_out (vty, "%s\n", desc);
write++; write++;
} }
@ -583,7 +583,7 @@ DEFUN (debug_bgp_as4,
else else
{ {
TERM_DEBUG_ON (as4, AS4); 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; return CMD_SUCCESS;
} }
@ -601,7 +601,7 @@ DEFUN (no_debug_bgp_as4,
else else
{ {
TERM_DEBUG_OFF (as4, AS4); 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; return CMD_SUCCESS;
} }
@ -619,7 +619,7 @@ DEFUN (debug_bgp_as4_segment,
else else
{ {
TERM_DEBUG_ON (as4, AS4_SEGMENT); 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; return CMD_SUCCESS;
} }
@ -638,7 +638,7 @@ DEFUN (no_debug_bgp_as4_segment,
else else
{ {
TERM_DEBUG_OFF (as4, AS4_SEGMENT); 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; return CMD_SUCCESS;
} }
@ -658,7 +658,7 @@ DEFUN (debug_bgp_neighbor_events,
else else
{ {
TERM_DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS); 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; 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)) 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); host);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -693,7 +693,7 @@ DEFUN (debug_bgp_neighbor_events_peer,
else else
{ {
TERM_DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS); 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; return CMD_SUCCESS;
} }
@ -713,7 +713,7 @@ DEFUN (no_debug_bgp_neighbor_events,
else else
{ {
TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS); 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; return CMD_SUCCESS;
} }
@ -747,9 +747,9 @@ DEFUN (no_debug_bgp_neighbor_events_peer,
} }
if (found_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 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); host);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -768,7 +768,7 @@ DEFUN (debug_bgp_nht,
else else
{ {
TERM_DEBUG_ON (nht, NHT); 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; return CMD_SUCCESS;
} }
@ -786,7 +786,7 @@ DEFUN (no_debug_bgp_nht,
else else
{ {
TERM_DEBUG_OFF (nht, NHT); 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; return CMD_SUCCESS;
} }
@ -806,7 +806,7 @@ DEFUN (debug_bgp_keepalive,
else else
{ {
TERM_DEBUG_ON (keepalive, KEEPALIVE); 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; return CMD_SUCCESS;
} }
@ -829,7 +829,7 @@ DEFUN (debug_bgp_keepalive_peer,
if (bgp_debug_list_has_entry(bgp_debug_keepalive_peers, host, NULL)) 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); host);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -841,7 +841,7 @@ DEFUN (debug_bgp_keepalive_peer,
else else
{ {
TERM_DEBUG_ON (keepalive, KEEPALIVE); 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; return CMD_SUCCESS;
} }
@ -861,7 +861,7 @@ DEFUN (no_debug_bgp_keepalive,
else else
{ {
TERM_DEBUG_OFF (keepalive, KEEPALIVE); 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; return CMD_SUCCESS;
} }
@ -895,9 +895,9 @@ DEFUN (no_debug_bgp_keepalive_peer,
} }
if (found_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 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; return CMD_SUCCESS;
} }
@ -922,7 +922,7 @@ DEFPY (debug_bgp_bestpath_prefix,
if (bgp_debug_list_has_entry(bgp_debug_bestpath_prefixes, NULL, bestpath)) 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; return CMD_SUCCESS;
} }
@ -935,7 +935,7 @@ DEFPY (debug_bgp_bestpath_prefix,
else else
{ {
TERM_DEBUG_ON (bestpath, BESTPATH); 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; return CMD_SUCCESS;
@ -962,7 +962,7 @@ DEFUN (no_debug_bgp_bestpath_prefix,
if (!ret) if (!ret)
{ {
prefix_free(argv_p); prefix_free(argv_p);
vty_outln (vty, "%% Malformed Prefix"); vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -979,16 +979,16 @@ DEFUN (no_debug_bgp_bestpath_prefix,
else else
{ {
TERM_DEBUG_OFF (bestpath, BESTPATH); 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) 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
else 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1009,7 +1009,7 @@ DEFUN (no_debug_bgp_bestpath,
else else
{ {
TERM_DEBUG_OFF (bestpath, BESTPATH); 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; return CMD_SUCCESS;
} }
@ -1035,7 +1035,7 @@ DEFUN (debug_bgp_update,
{ {
TERM_DEBUG_ON (update, UPDATE_IN); TERM_DEBUG_ON (update, UPDATE_IN);
TERM_DEBUG_ON (update, UPDATE_OUT); 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; return CMD_SUCCESS;
} }
@ -1068,12 +1068,12 @@ DEFUN (debug_bgp_update_direct,
if (strncmp ("i", argv[idx_in_out]->arg, 1) == 0) if (strncmp ("i", argv[idx_in_out]->arg, 1) == 0)
{ {
TERM_DEBUG_ON (update, UPDATE_IN); 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 else
{ {
TERM_DEBUG_ON (update, UPDATE_OUT); 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; 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)) 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); host);
return CMD_SUCCESS; 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)) 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); host);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1166,13 +1166,13 @@ DEFUN (debug_bgp_update_direct_peer,
if (inbound) if (inbound)
{ {
TERM_DEBUG_ON (update, UPDATE_IN); 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); argv[idx_peer]->arg);
} }
else else
{ {
TERM_DEBUG_ON (update, UPDATE_OUT); 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); argv[idx_peer]->arg);
} }
} }
@ -1201,7 +1201,7 @@ DEFUN (no_debug_bgp_update_direct,
else else
{ {
TERM_DEBUG_OFF (update, UPDATE_IN); 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 else
@ -1215,7 +1215,7 @@ DEFUN (no_debug_bgp_update_direct,
else else
{ {
TERM_DEBUG_OFF (update, UPDATE_OUT); 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 else
{ {
TERM_DEBUG_OFF (update, UPDATE_IN); 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 else
{ {
TERM_DEBUG_OFF (update, UPDATE_OUT); 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 (found_peer)
if (inbound) 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 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); host);
else else
if (inbound) 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); host);
else 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); host);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1337,7 +1337,7 @@ DEFUN (debug_bgp_update_prefix,
if (!ret) if (!ret)
{ {
prefix_free(argv_p); prefix_free(argv_p);
vty_outln (vty, "%% Malformed Prefix"); vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED; 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)) 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1361,7 +1361,7 @@ DEFUN (debug_bgp_update_prefix,
else else
{ {
TERM_DEBUG_ON (update, UPDATE_PREFIX); 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
} }
@ -1390,7 +1390,7 @@ DEFUN (no_debug_bgp_update_prefix,
if (!ret) if (!ret)
{ {
prefix_free(argv_p); prefix_free(argv_p);
vty_outln (vty, "%% Malformed Prefix"); vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1407,16 +1407,16 @@ DEFUN (no_debug_bgp_update_prefix,
else else
{ {
TERM_DEBUG_OFF (update, UPDATE_PREFIX); 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) 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
else 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1448,7 +1448,7 @@ DEFUN (no_debug_bgp_update,
TERM_DEBUG_OFF (update, UPDATE_IN); TERM_DEBUG_OFF (update, UPDATE_IN);
TERM_DEBUG_OFF (update, UPDATE_OUT); TERM_DEBUG_OFF (update, UPDATE_OUT);
TERM_DEBUG_OFF (update, UPDATE_PREFIX); 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; return CMD_SUCCESS;
} }
@ -1466,7 +1466,7 @@ DEFUN (debug_bgp_zebra,
else else
{ {
TERM_DEBUG_ON (zebra, ZEBRA); 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; return CMD_SUCCESS;
} }
@ -1491,7 +1491,7 @@ DEFUN (debug_bgp_zebra_prefix,
if (!ret) if (!ret)
{ {
prefix_free(argv_p); prefix_free(argv_p);
vty_outln (vty, "%% Malformed Prefix"); vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED; 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)) 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1512,7 +1512,7 @@ DEFUN (debug_bgp_zebra_prefix,
else else
{ {
TERM_DEBUG_ON (zebra, ZEBRA); 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
} }
@ -1534,7 +1534,7 @@ DEFUN (no_debug_bgp_zebra,
else else
{ {
TERM_DEBUG_OFF (zebra, ZEBRA); 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; return CMD_SUCCESS;
} }
@ -1561,7 +1561,7 @@ DEFUN (no_debug_bgp_zebra_prefix,
if (!ret) if (!ret)
{ {
prefix_free(argv_p); prefix_free(argv_p);
vty_outln (vty, "%% Malformed Prefix"); vty_out (vty, "%% Malformed Prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1576,16 +1576,16 @@ DEFUN (no_debug_bgp_zebra_prefix,
else else
{ {
TERM_DEBUG_OFF (zebra, ZEBRA); 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) 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
else 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); argv[idx_ipv4_ipv6_prefixlen]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1603,7 +1603,7 @@ DEFUN (debug_bgp_allow_martians,
else else
{ {
TERM_DEBUG_ON (allow_martians, ALLOW_MARTIANS); 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; return CMD_SUCCESS;
} }
@ -1621,7 +1621,7 @@ DEFUN (no_debug_bgp_allow_martians,
else else
{ {
TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS); 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; return CMD_SUCCESS;
} }
@ -1640,7 +1640,7 @@ DEFUN (debug_bgp_update_groups,
else else
{ {
TERM_DEBUG_ON (update_groups, UPDATE_GROUPS); 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; return CMD_SUCCESS;
} }
@ -1658,7 +1658,7 @@ DEFUN (no_debug_bgp_update_groups,
else else
{ {
TERM_DEBUG_OFF (update_groups, UPDATE_GROUPS); 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; return CMD_SUCCESS;
} }
@ -1691,7 +1691,7 @@ DEFUN (no_debug_bgp,
TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS); TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS);
TERM_DEBUG_OFF (zebra, ZEBRA); TERM_DEBUG_OFF (zebra, ZEBRA);
TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS); 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; return CMD_SUCCESS;
} }
@ -1703,13 +1703,13 @@ DEFUN (show_debugging_bgp,
DEBUG_STR DEBUG_STR
BGP_STR) BGP_STR)
{ {
vty_outln (vty, "BGP debugging status:"); vty_out (vty, "BGP debugging status:\n");
if (BGP_DEBUG (as4, AS4)) 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)) 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)) if (BGP_DEBUG (bestpath, BESTPATH))
bgp_debug_list_print (vty, " BGP bestpath debugging is on", bgp_debug_list_print (vty, " BGP bestpath debugging is on",
@ -1724,10 +1724,10 @@ DEFUN (show_debugging_bgp,
bgp_debug_neighbor_events_peers); bgp_debug_neighbor_events_peers);
if (BGP_DEBUG (nht, NHT)) 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)) 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)) if (BGP_DEBUG (update, UPDATE_PREFIX))
bgp_debug_list_print (vty, " BGP updates debugging is on", bgp_debug_list_print (vty, " BGP updates debugging is on",
@ -1746,8 +1746,8 @@ DEFUN (show_debugging_bgp,
bgp_debug_zebra_prefixes); bgp_debug_zebra_prefixes);
if (BGP_DEBUG (allow_martians, ALLOW_MARTIANS)) if (BGP_DEBUG (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");
vty_out (vty, VTYNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1802,13 +1802,13 @@ bgp_config_write_debug (struct vty *vty)
if (CONF_BGP_DEBUG (as4, AS4)) if (CONF_BGP_DEBUG (as4, AS4))
{ {
vty_outln (vty, "debug bgp as4"); vty_out (vty, "debug bgp as4\n");
write++; write++;
} }
if (CONF_BGP_DEBUG (as4, AS4_SEGMENT)) if (CONF_BGP_DEBUG (as4, AS4_SEGMENT))
{ {
vty_outln (vty, "debug bgp as4 segment"); vty_out (vty, "debug bgp as4 segment\n");
write++; write++;
} }
@ -1832,13 +1832,13 @@ bgp_config_write_debug (struct vty *vty)
if (CONF_BGP_DEBUG (nht, NHT)) if (CONF_BGP_DEBUG (nht, NHT))
{ {
vty_outln (vty, "debug bgp nht"); vty_out (vty, "debug bgp nht\n");
write++; write++;
} }
if (CONF_BGP_DEBUG (update_groups, UPDATE_GROUPS)) if (CONF_BGP_DEBUG (update_groups, UPDATE_GROUPS))
{ {
vty_outln (vty, "debug bgp update-groups"); vty_out (vty, "debug bgp update-groups\n");
write++; write++;
} }
@ -1864,7 +1864,7 @@ bgp_config_write_debug (struct vty *vty)
{ {
if (!bgp_debug_zebra_prefixes || list_isempty(bgp_debug_zebra_prefixes)) 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++; write++;
} }
else else
@ -1876,7 +1876,7 @@ bgp_config_write_debug (struct vty *vty)
if (CONF_BGP_DEBUG (allow_martians, ALLOW_MARTIANS)) if (CONF_BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
{ {
vty_outln (vty, "debug bgp allow-martians"); vty_out (vty, "debug bgp allow-martians\n");
write++; write++;
} }

View File

@ -667,7 +667,7 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump,
interval = bgp_dump_parse_time (interval_str); interval = bgp_dump_parse_time (interval_str);
if (interval == 0) if (interval == 0)
{ {
vty_outln (vty, "Malformed interval string"); vty_out (vty, "Malformed interval string\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -866,10 +866,10 @@ config_write_bgp_dump (struct vty *vty)
type_str = "all-et"; type_str = "all-et";
if (bgp_dump_all.interval_str) 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); bgp_dump_all.filename,bgp_dump_all.interval_str);
else else
vty_outln (vty, "dump bgp %s %s", type_str, vty_out (vty, "dump bgp %s %s\n", type_str,
bgp_dump_all.filename); bgp_dump_all.filename);
} }
if (bgp_dump_updates.filename) if (bgp_dump_updates.filename)
@ -879,19 +879,19 @@ config_write_bgp_dump (struct vty *vty)
type_str = "updates-et"; type_str = "updates-et";
if (bgp_dump_updates.interval_str) 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); bgp_dump_updates.filename,bgp_dump_updates.interval_str);
else else
vty_outln (vty, "dump bgp %s %s", type_str, vty_out (vty, "dump bgp %s %s\n", type_str,
bgp_dump_updates.filename); bgp_dump_updates.filename);
} }
if (bgp_dump_routes.filename) if (bgp_dump_routes.filename)
{ {
if (bgp_dump_routes.interval_str) 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); bgp_dump_routes.filename,bgp_dump_routes.interval_str);
else else
vty_outln (vty, "dump bgp routes-mrt %s", vty_out (vty, "dump bgp routes-mrt %s\n",
bgp_dump_routes.filename); bgp_dump_routes.filename);
} }

View File

@ -61,7 +61,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
bgp = bgp_get_default(); bgp = bgp_get_default();
if (bgp == NULL) { if (bgp == NULL) {
if (!use_json) if (!use_json)
vty_outln (vty,"No BGP process is configured"); vty_out (vty,"No BGP process is configured\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -135,20 +135,19 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
} else { } else {
if (option == if (option ==
SHOW_DISPLAY_TAGS) SHOW_DISPLAY_TAGS)
vty_outln(vty, V4_HEADER_TAG); vty_out(vty, V4_HEADER_TAG);
else if (option == else if (option ==
SHOW_DISPLAY_OVERLAY) SHOW_DISPLAY_OVERLAY)
vty_outln(vty, V4_HEADER_OVERLAY); vty_out(vty, V4_HEADER_OVERLAY);
else { else {
vty_outln (vty, vty_out (vty,
"BGP table version is 0, local router ID is %s", "BGP table version is 0, local router ID is %s\n",
inet_ntoa(bgp->router_id)); inet_ntoa(bgp->router_id));
vty_outln (vty, vty_out (vty,
"Status codes: s suppressed, d damped, h history, * valid, > best, i - internal"); "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n");
vty_outln (vty, vty_out (vty,
"Origin codes: i - IGP, e - EGP, ? - incomplete%s", "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n");
VTYNL); vty_out(vty, V4_HEADER);
vty_outln(vty, V4_HEADER);
} }
} }
header = 0; header = 0;
@ -224,7 +223,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
ip), ip),
rd_ip. rd_ip.
val); val);
vty_outln (vty, VTYNL); vty_out (vty, "\n\n");
} }
rd_header = 0; rd_header = 0;
} }
@ -253,11 +252,10 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
} }
} }
if (output_count == 0) if (output_count == 0)
vty_outln (vty, "No prefixes displayed, %ld exist", vty_out (vty, "No prefixes displayed, %ld exist\n",
total_count); total_count);
else else
vty_outln (vty, "%sDisplayed %ld out of %ld total prefixes", vty_out (vty, "\nDisplayed %ld out of %ld total prefixes\n", output_count, total_count);
VTYNL, output_count, total_count);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -289,7 +287,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd,
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd); ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) { if (!ret) {
vty_outln (vty, "%% Malformed Route Distinguisher"); vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, 0, 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); ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) { if (!ret) {
vty_outln (vty, "%% Malformed Route Distinguisher"); vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, 1, 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_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"Malformed address"); "Malformed address");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty, "Malformed address: %s", vty_out (vty, "Malformed address: %s\n",
argv[idx_ipv4]->arg); argv[idx_ipv4]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -381,12 +379,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"No such neighbor or address family"); "No such neighbor or address family");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty, vty_out (vty,
"%% No such neighbor or address family"); "%% No such neighbor or address family\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -426,11 +424,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"Malformed Route Distinguisher"); "Malformed Route Distinguisher");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty,"%% Malformed Route Distinguisher"); vty_out (vty,"%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -441,11 +439,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"Malformed address"); "Malformed address");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty, "Malformed address: %s", vty_out (vty, "Malformed address: %s\n",
argv[idx_ext_community]->arg); argv[idx_ext_community]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -457,12 +455,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"No such neighbor or address family"); "No such neighbor or address family");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty, vty_out (vty,
"%% No such neighbor or address family"); "%% No such neighbor or address family\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -498,11 +496,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_advertised_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"Malformed address"); "Malformed address");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty, "Malformed address: %s", vty_out (vty, "Malformed address: %s\n",
argv[idx_ipv4]->arg); argv[idx_ipv4]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -513,12 +511,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_advertised_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"No such neighbor or address family"); "No such neighbor or address family");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty, vty_out (vty,
"%% No such neighbor or address family"); "%% No such neighbor or address family\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -557,11 +555,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"Malformed address"); "Malformed address");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty, "Malformed address: %s", vty_out (vty, "Malformed address: %s\n",
argv[idx_ext_community]->arg); argv[idx_ext_community]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -572,12 +570,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"No such neighbor or address family"); "No such neighbor or address family");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty, vty_out (vty,
"%% No such neighbor or address family"); "%% No such neighbor or address family\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -588,11 +586,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes,
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", json_object_string_add(json_no, "warning",
"Malformed Route Distinguisher"); "Malformed Route Distinguisher");
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string(json_no)); json_object_to_json_string(json_no));
json_object_free(json_no); json_object_free(json_no);
} else } else
vty_outln (vty,"%% Malformed Route Distinguisher"); vty_out (vty,"%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -635,7 +633,7 @@ DEFUN(show_ip_bgp_evpn_rd_overlay,
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd); ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) { if (!ret) {
vty_outln (vty, "%% Malformed Route Distinguisher"); vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL,

View File

@ -457,7 +457,7 @@ DEFUN (ip_as_path,
regex = bgp_regcomp (regstr); regex = bgp_regcomp (regstr);
if (!regex) 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); XFREE (MTYPE_TMP, regstr);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -503,7 +503,7 @@ DEFUN (no_ip_as_path,
aslist = as_list_lookup (aslistname); aslist = as_list_lookup (aslistname);
if (aslist == NULL) 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -514,7 +514,7 @@ DEFUN (no_ip_as_path,
type = AS_FILTER_DENY; type = AS_FILTER_DENY;
else 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -525,7 +525,7 @@ DEFUN (no_ip_as_path,
regex = bgp_regcomp (regstr); regex = bgp_regcomp (regstr);
if (!regex) 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); XFREE (MTYPE_TMP, regstr);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -538,7 +538,7 @@ DEFUN (no_ip_as_path,
if (asfilter == NULL) if (asfilter == NULL)
{ {
vty_outln (vty, "ip as-path access-list doesn't exist"); vty_out (vty, "\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -562,7 +562,7 @@ DEFUN (no_ip_as_path_all,
aslist = as_list_lookup (argv[idx_word]->arg); aslist = as_list_lookup (argv[idx_word]->arg);
if (aslist == NULL) 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); argv[idx_word]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -581,11 +581,11 @@ as_list_show (struct vty *vty, struct as_list *aslist)
{ {
struct as_filter *asfilter; 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) 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); 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) 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) 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); asfilter->reg_str);
} }
} }
for (aslist = as_list_master.str.head; aslist; aslist = aslist->next) 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) 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); 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 (aslist = as_list_master.num.head; aslist; aslist = aslist->next)
for (asfilter = aslist->head; asfilter; asfilter = asfilter->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), aslist->name, filter_type_str (asfilter->type),
asfilter->reg_str); asfilter->reg_str);
write++; write++;
@ -667,7 +667,7 @@ config_write_as_list (struct vty *vty)
for (aslist = as_list_master.str.head; aslist; aslist = aslist->next) for (aslist = as_list_master.str.head; aslist; aslist = aslist->next)
for (asfilter = aslist->head; asfilter; asfilter = asfilter->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), aslist->name, filter_type_str (asfilter->type),
asfilter->reg_str); asfilter->reg_str);
write++; write++;

View File

@ -563,7 +563,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
if (bgp == NULL) if (bgp == NULL)
{ {
if (!use_json) if (!use_json)
vty_outln (vty, "No BGP process is configured"); vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING; 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)) 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; return CMD_WARNING;
} }
@ -634,16 +634,15 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
else else
{ {
if (tags) if (tags)
vty_outln (vty, V4_HEADER_TAG); vty_out (vty, V4_HEADER_TAG);
else 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)); inet_ntoa(bgp->router_id));
vty_outln (vty, vty_out (vty,
"Status codes: s suppressed, d damped, h history, * valid, > best, i - internal"); "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n");
vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s", vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n");
VTYNL); vty_out (vty, V4_HEADER);
vty_outln (vty, V4_HEADER);
} }
} }
header = 0; 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[4],
rd_vnc_eth.macaddr.octet[5]); rd_vnc_eth.macaddr.octet[5]);
#endif #endif
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
rd_header = 0; rd_header = 0;
} }
@ -740,17 +739,16 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
if (use_json) if (use_json)
{ {
json_object_object_add(json, "routes", json_nroute); 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_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json); json_object_free(json);
} }
else else
{ {
if (output_count == 0) 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 else
vty_outln (vty, "%sDisplayed %ld routes and %ld total paths", vty_out (vty, "\nDisplayed %ld routes and %ld total paths\n", output_count, total_count);
VTYNL, output_count, total_count);
} }
return CMD_SUCCESS; return CMD_SUCCESS;
@ -781,7 +779,7 @@ DEFUN (show_bgp_ip_vpn_all_rd,
ret = str2prefix_rd (argv[idx_rd]->arg, &prd); ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret) if (! ret)
{ {
vty_outln (vty, "%% Malformed Route Distinguisher"); vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 0, use_json (argc, argv)); 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); ret = str2prefix_rd (argv[idx_ext_community]->arg, &prd);
if (! ret) if (! ret)
{ {
vty_outln (vty, "%% Malformed Route Distinguisher"); vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 0, 0); 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); ret = str2prefix_rd (argv[idx_ext_community]->arg, &prd);
if (! ret) if (! ret)
{ {
vty_outln (vty, "%% Malformed Route Distinguisher"); vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 1, 0); 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_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed address"); 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); json_object_free(json_no);
} }
else 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; return CMD_WARNING;
} }
@ -936,11 +934,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_routes,
json_object *json_no = NULL; json_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family"); 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); json_object_free(json_no);
} }
else else
vty_outln (vty, "%% No such neighbor or address family"); vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -983,11 +981,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes,
json_object *json_no = NULL; json_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed Route Distinguisher"); 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); json_object_free(json_no);
} }
else else
vty_outln (vty, "%% Malformed Route Distinguisher"); vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -999,11 +997,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes,
json_object *json_no = NULL; json_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed address"); 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); json_object_free(json_no);
} }
else else
vty_outln (vty, "Malformed address: %s", vty_out (vty, "Malformed address: %s\n",
argv[idx_ext_community]->arg); argv[idx_ext_community]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -1016,11 +1014,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes,
json_object *json_no = NULL; json_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family"); 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); json_object_free(json_no);
} }
else else
vty_outln (vty, "%% No such neighbor or address family"); vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1060,11 +1058,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes,
json_object *json_no = NULL; json_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed address"); 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); json_object_free(json_no);
} }
else 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; return CMD_WARNING;
} }
peer = peer_lookup (NULL, &su); peer = peer_lookup (NULL, &su);
@ -1075,11 +1073,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes,
json_object *json_no = NULL; json_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family"); 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); json_object_free(json_no);
} }
else else
vty_outln (vty, "%% No such neighbor or address family"); vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING; return CMD_WARNING;
} }
return show_adj_route_vpn (vty, peer, NULL, AFI_IP, SAFI_MPLS_VPN, uj); 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_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed address"); 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); json_object_free(json_no);
} }
else else
vty_outln (vty, "Malformed address: %s", vty_out (vty, "Malformed address: %s\n",
argv[idx_ext_community]->arg); argv[idx_ext_community]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -1137,11 +1135,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
json_object *json_no = NULL; json_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "No such neighbor or address family"); 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); json_object_free(json_no);
} }
else else
vty_outln (vty, "%% No such neighbor or address family"); vty_out (vty, "%% No such neighbor or address family\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1153,11 +1151,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
json_object *json_no = NULL; json_object *json_no = NULL;
json_no = json_object_new_object(); json_no = json_object_new_object();
json_object_string_add(json_no, "warning", "Malformed Route Distinguisher"); 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); json_object_free(json_no);
} }
else else
vty_outln (vty, "%% Malformed Route Distinguisher"); vty_out (vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING; return CMD_WARNING;
} }

View File

@ -68,11 +68,11 @@ typedef enum {
"Address Family\n" "Address Family\n"
#define V4_HEADER \ #define V4_HEADER \
" Network Next Hop Metric LocPrf Weight Path" " Network Next Hop Metric LocPrf Weight Path\n"
#define V4_HEADER_TAG \ #define V4_HEADER_TAG \
" Network Next Hop In tag/Out tag" " Network Next Hop In tag/Out tag\n"
#define V4_HEADER_OVERLAY \ #define V4_HEADER_OVERLAY \
" Network Next Hop EthTag Overlay Index RouterMac" " Network Next Hop EthTag Overlay Index RouterMac\n"
struct rd_as struct rd_as
{ {

View File

@ -387,7 +387,7 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail)
time_t tbuf; time_t tbuf;
afi_t afi; 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++) for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
{ {
if (!bgp->nexthop_cache_table[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)) 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)), inet_ntop (rn->p.family, &rn->p.u.prefix, buf, sizeof (buf)),
bnc->metric, bnc->path_count); bnc->metric, bnc->path_count);
if (detail) if (detail)
@ -407,44 +407,44 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail)
switch (nexthop->type) switch (nexthop->type)
{ {
case NEXTHOP_TYPE_IPV6: 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))); inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, sizeof(buf)));
break; break;
case NEXTHOP_TYPE_IPV6_IFINDEX: 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, inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf,
sizeof (buf)), sizeof (buf)),
ifindex2ifname(nexthop->ifindex, bgp->vrf_id)); ifindex2ifname(nexthop->ifindex, bgp->vrf_id));
break; break;
case NEXTHOP_TYPE_IPV4: 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))); inet_ntop(AF_INET, &nexthop->gate.ipv4, buf, sizeof(buf)));
break; break;
case NEXTHOP_TYPE_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
vty_outln (vty, " if %s", vty_out (vty, " if %s\n",
ifindex2ifname(nexthop->ifindex, bgp->vrf_id)); ifindex2ifname(nexthop->ifindex, bgp->vrf_id));
break; break;
case NEXTHOP_TYPE_IPV4_IFINDEX: 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, inet_ntop(AF_INET, &nexthop->gate.ipv4, buf,
sizeof (buf)), sizeof (buf)),
ifindex2ifname(nexthop->ifindex, bgp->vrf_id)); ifindex2ifname(nexthop->ifindex, bgp->vrf_id));
break; break;
default: default:
vty_outln (vty, " invalid nexthop type %u", vty_out (vty, " invalid nexthop type %u\n",
nexthop->type); nexthop->type);
} }
} }
else else
{ {
vty_outln (vty, " %s invalid", vty_out (vty, " %s invalid\n",
inet_ntop(rn->p.family, &rn->p.u.prefix, buf, sizeof(buf))); inet_ntop(rn->p.family, &rn->p.u.prefix, buf, sizeof(buf)));
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED)) 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); tbuf = time(NULL) - (bgp_clock() - bnc->last_update);
vty_out (vty, " Last update: %s", ctime(&tbuf)); 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 (); bgp = bgp_get_default ();
if (!bgp) if (!bgp)
{ {
vty_outln (vty, "%% No such BGP instance exist"); vty_out (vty, "%% No such BGP instance exist\n");
return CMD_WARNING; 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)) for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{ {
vty_outln (vty, "%sInstance %s:", vty_out (vty, "\nInstance %s:\n",
VTYNL,
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name); (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name);
bgp_show_nexthops (vty, bgp, 0); bgp_show_nexthops (vty, bgp, 0);
} }

View File

@ -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); vty_out (vty, "SAFI Unknown %d ", mpc.safi);
break; break;
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
else if (hdr->code >= 128) else if (hdr->code >= 128)

File diff suppressed because it is too large Load Diff

View File

@ -53,10 +53,10 @@ enum bgp_show_type
#define BGP_SHOW_SCODE_HEADER "Status codes: s suppressed, d damped, "\ #define BGP_SHOW_SCODE_HEADER "Status codes: s suppressed, d damped, "\
"h history, * valid, > best, = multipath,%s"\ "h history, * valid, > best, = multipath,\n"\
" i internal, r RIB-failure, S Stale, R Removed" " i internal, r RIB-failure, S Stale, R Removed\n"
#define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete%s" #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" #define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path\n"
/* Ancillary information to struct bgp_info, /* Ancillary information to struct bgp_info,
* used for uncommonly used data (aggregation, MPLS, etc.) * used for uncommonly used data (aggregation, MPLS, etc.)

View File

@ -2851,10 +2851,10 @@ bgp_route_match_add (struct vty *vty,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: 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; return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% BGP Argument is malformed."); vty_out (vty, "%% BGP Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -2900,10 +2900,10 @@ bgp_route_match_delete (struct vty *vty,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% BGP Can't find rule."); vty_out (vty, "%% BGP Can't find rule.\n");
break; break;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% BGP Argument is malformed."); vty_out (vty, "%% BGP Argument is malformed.\n");
break; break;
} }
if (dep_name) if (dep_name)
@ -3592,7 +3592,7 @@ DEFUN (match_origin,
return bgp_route_match_add (vty, "origin", "incomplete", return bgp_route_match_add (vty, "origin", "incomplete",
RMAP_EVENT_MATCH_ADDED); RMAP_EVENT_MATCH_ADDED);
vty_outln (vty, "%% Invalid match origin type"); vty_out (vty, "%% Invalid match origin type\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3887,7 +3887,7 @@ DEFUN (set_community,
/* Can't compile user input into communities attribute. */ /* Can't compile user input into communities attribute. */
if (! com) if (! com)
{ {
vty_outln (vty, "%% Malformed communities attribute"); vty_out (vty, "%% Malformed communities attribute\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -4153,7 +4153,7 @@ DEFUN (set_origin,
return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "origin", return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "origin",
"incomplete"); "incomplete");
vty_outln (vty, "%% Invalid set origin type"); vty_out (vty, "%% Invalid set origin type\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -4212,7 +4212,7 @@ DEFUN (set_aggregator_as,
ret = inet_aton (argv[idx_ipv4]->arg, &address); ret = inet_aton (argv[idx_ipv4]->arg, &address);
if (ret == 0) 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -4253,7 +4253,7 @@ DEFUN (no_set_aggregator_as,
ret = inet_aton (argv[idx_ip]->arg, &address); ret = inet_aton (argv[idx_ip]->arg, &address);
if (ret == 0) 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -4364,7 +4364,7 @@ DEFUN (set_ipv6_nexthop_global,
ret = inet_pton (AF_INET6, argv[idx_ipv6]->arg, &addr); ret = inet_pton (AF_INET6, argv[idx_ipv6]->arg, &addr);
if (!ret) if (!ret)
{ {
vty_outln (vty, "%% Malformed nexthop address"); vty_out (vty, "%% Malformed nexthop address\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (IN6_IS_ADDR_UNSPECIFIED(&addr) || if (IN6_IS_ADDR_UNSPECIFIED(&addr) ||
@ -4372,7 +4372,7 @@ DEFUN (set_ipv6_nexthop_global,
IN6_IS_ADDR_MULTICAST(&addr) || IN6_IS_ADDR_MULTICAST(&addr) ||
IN6_IS_ADDR_LINKLOCAL(&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; return CMD_WARNING_CONFIG_FAILED;
} }

View File

@ -564,17 +564,17 @@ update_group_show_walkcb (struct update_group *updgrp, void *arg)
vty = ctx->vty; 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)); vty_out (vty, " Created: %s", timestamp_string (updgrp->uptime));
filter = &updgrp->conf->filter[updgrp->afi][updgrp->safi]; filter = &updgrp->conf->filter[updgrp->afi][updgrp->safi];
if (filter->map[RMAP_OUT].name) 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].map ? "X" : "",
filter->map[RMAP_OUT].name); filter->map[RMAP_OUT].name);
vty_outln (vty, " MRAI value (seconds): %d", vty_out (vty, " MRAI value (seconds): %d\n",
updgrp->conf->v_routeadv); updgrp->conf->v_routeadv);
if (updgrp->conf->change_local_as) 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, updgrp->conf->change_local_as,
CHECK_FLAG (updgrp->conf->flags, CHECK_FLAG (updgrp->conf->flags,
PEER_FLAG_LOCAL_AS_NO_PREPEND) ? " no-prepend" : "", 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)) if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue; continue;
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_outln (vty, " Update-subgroup %" PRIu64 ":", subgrp->id); vty_out (vty, " Update-subgroup %" PRIu64 ":\n", subgrp->id);
vty_out (vty, " Created: %s", timestamp_string (subgrp->uptime)); vty_out (vty, " Created: %s", timestamp_string (subgrp->uptime));
if (subgrp->split_from.update_group_id || subgrp->split_from.subgroup_id) 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); 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); subgrp->split_from.subgroup_id);
} }
vty_outln (vty, " Join events: %u", subgrp->join_events); vty_out (vty, " Join events: %u\n", subgrp->join_events);
vty_outln (vty, " Prune events: %u", vty_out (vty, " Prune events: %u\n",
subgrp->prune_events); subgrp->prune_events);
vty_outln (vty, " Merge events: %u", vty_out (vty, " Merge events: %u\n",
subgrp->merge_events); subgrp->merge_events);
vty_outln (vty, " Split events: %u", vty_out (vty, " Split events: %u\n",
subgrp->split_events); subgrp->split_events);
vty_outln (vty, " Update group switch events: %u", vty_out (vty, " Update group switch events: %u\n",
subgrp->updgrp_switch_events); subgrp->updgrp_switch_events);
vty_outln (vty, " Peer refreshes combined: %u", vty_out (vty, " Peer refreshes combined: %u\n",
subgrp->peer_refreshes_combined); subgrp->peer_refreshes_combined);
vty_outln (vty, " Merge checks triggered: %u", vty_out (vty, " Merge checks triggered: %u\n",
subgrp->merge_checks_triggered); subgrp->merge_checks_triggered);
vty_outln (vty, " Version: %" PRIu64 "", subgrp->version); vty_out (vty, " Version: %" PRIu64 "\n", subgrp->version);
vty_outln (vty, " Packet queue length: %d", vty_out (vty, " Packet queue length: %d\n",
bpacket_queue_length(SUBGRP_PKTQ(subgrp))); 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)); 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))); 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); subgrp->adj_count);
vty_outln (vty, " Advertise list: %s", vty_out (vty, " Advertise list: %s\n",
advertise_list_is_empty(subgrp) ? "empty" : "not empty"); 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" : ""); CHECK_FLAG(subgrp->flags, SUBGRP_FLAG_NEEDS_REFRESH) ? "R" : "");
if (subgrp->peer_count > 0) if (subgrp->peer_count > 0)
{ {
vty_outln (vty, " Peers:"); vty_out (vty, " Peers:\n");
SUBGRP_FOREACH_PEER (subgrp, paf) SUBGRP_FOREACH_PEER (subgrp, paf)
vty_outln (vty, " - %s", paf->peer->host); vty_out (vty, " - %s\n", paf->peer->host);
} }
} }
return UPDWALK_CONTINUE; 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)) if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue; 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->id);
bpacket_queue_show_vty (SUBGRP_PKTQ (subgrp), vty); 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 void
update_group_show_stats (struct bgp *bgp, struct vty *vty) 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); bgp->update_group_stats.merge_checks_triggered);
} }

View File

@ -226,16 +226,16 @@ subgrp_show_adjq_vty (struct update_subgroup *subgrp, struct vty *vty,
{ {
if (header1) if (header1)
{ {
vty_outln (vty, vty_out (vty,
"BGP table version is %" PRIu64 ", local router ID is %s", "BGP table version is %" PRIu64 ", local router ID is %s\n",
table->version,inet_ntoa(bgp->router_id)); table->version,inet_ntoa(bgp->router_id));
vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL); vty_out (vty, BGP_SHOW_SCODE_HEADER);
vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL); vty_out (vty, BGP_SHOW_OCODE_HEADER);
header1 = 0; header1 = 0;
} }
if (header2) if (header2)
{ {
vty_outln (vty, BGP_SHOW_HEADER); vty_out (vty, BGP_SHOW_HEADER);
header2 = 0; header2 = 0;
} }
if ((flags & UPDWALK_FLAGS_ADVQUEUE) && adj->adv && adj->adv->baa) 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) if (output_count != 0)
vty_outln (vty, "%sTotal number of prefixes %ld", vty_out (vty, "\nTotal number of prefixes %ld\n", output_count);
VTYNL, output_count);
} }
static int 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)) if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue; 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->id);
subgrp_show_adjq_vty (subgrp, vty, ctx->flags); subgrp_show_adjq_vty (subgrp, vty, ctx->flags);
} }

View File

@ -392,12 +392,12 @@ bpacket_queue_show_vty (struct bpacket_queue *q, struct vty *vty)
pkt = bpacket_queue_first (q); pkt = bpacket_queue_first (q);
while (pkt) 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); pkt->buffer);
LIST_FOREACH (paf, &(pkt->peers), pkt_train) 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); pkt = bpacket_next (pkt);
} }

View File

@ -51,7 +51,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd,
if (bgp == NULL) if (bgp == NULL)
{ {
if (!use_json) if (!use_json)
vty_outln (vty, "No BGP process is configured"); vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -104,13 +104,12 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd,
} }
else 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)); inet_ntoa(bgp->router_id));
vty_outln (vty, vty_out (vty,
"Status codes: s suppressed, d damped, h history, * valid, > best, i - internal"); "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n");
vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s", vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n");
VTYNL); vty_out (vty, V4_HEADER);
vty_outln (vty, V4_HEADER);
} }
header = 0; 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]); rd_vnc_eth.macaddr.octet[5]);
#endif #endif
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
rd_header = 0; rd_header = 0;
} }
@ -191,7 +190,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd,
if (use_json) if (use_json)
{ {
json_object_object_add(json, "routes", json_routes); 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_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json); json_object_free(json);
} }

File diff suppressed because it is too large Load Diff

View File

@ -6502,15 +6502,15 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer,
|| strcmp (filter->dlist[in].name, gfilter->dlist[in].name) != 0) || strcmp (filter->dlist[in].name, gfilter->dlist[in].name) != 0)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s distribute-list %s in%s", " neighbor %s distribute-list %s in\n",
addr, filter->dlist[in].name, VTYNL); addr, filter->dlist[in].name);
} }
if (filter->dlist[out].name && ! gfilter) if (filter->dlist[out].name && ! gfilter)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s distribute-list %s out%s", " neighbor %s distribute-list %s out\n",
addr, filter->dlist[out].name, VTYNL); addr, filter->dlist[out].name);
} }
/* prefix-list. */ /* 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) || strcmp (filter->plist[in].name, gfilter->plist[in].name) != 0)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s prefix-list %s in%s", " neighbor %s prefix-list %s in\n",
addr, filter->plist[in].name, VTYNL); addr, filter->plist[in].name);
} }
if (filter->plist[out].name && ! gfilter) if (filter->plist[out].name && ! gfilter)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s prefix-list %s out%s", " neighbor %s prefix-list %s out\n",
addr, filter->plist[out].name, VTYNL); addr, filter->plist[out].name);
} }
/* route-map. */ /* 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) || strcmp (filter->map[RMAP_IN].name, gfilter->map[RMAP_IN].name) != 0)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s route-map %s in%s", " neighbor %s route-map %s in\n",
addr, filter->map[RMAP_IN].name, VTYNL); addr, filter->map[RMAP_IN].name);
} }
if (filter->map[RMAP_OUT].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) || strcmp (filter->map[RMAP_OUT].name, gfilter->map[RMAP_OUT].name) != 0)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s route-map %s out%s", " neighbor %s route-map %s out\n",
addr, filter->map[RMAP_OUT].name, VTYNL); addr, filter->map[RMAP_OUT].name);
} }
/* unsuppress-map */ /* unsuppress-map */
if (filter->usmap.name && ! gfilter) if (filter->usmap.name && ! gfilter)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s unsuppress-map %s%s", " neighbor %s unsuppress-map %s\n",
addr, filter->usmap.name, VTYNL); addr, filter->usmap.name);
} }
/* filter-list. */ /* 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) || strcmp (filter->aslist[in].name, gfilter->aslist[in].name) != 0)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s filter-list %s in%s", " neighbor %s filter-list %s in\n",
addr, filter->aslist[in].name, VTYNL); addr, filter->aslist[in].name);
} }
if (filter->aslist[out].name && ! gfilter) if (filter->aslist[out].name && ! gfilter)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s filter-list %s out%s", " neighbor %s filter-list %s out\n",
addr, filter->aslist[out].name, VTYNL); addr, filter->aslist[out].name);
} }
} }
@ -6626,7 +6626,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if_ras_printed = TRUE; if_ras_printed = TRUE;
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
/* remote-as and peer-group */ /* 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) 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) 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) 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 /* For swpX peers we displayed the peer-group
* via 'neighbor swpX interface peer-group WORD' */ * via 'neighbor swpX interface peer-group WORD' */
if (!if_pg_printed) 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); 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 */ /* peer is a peer-group, declare the peer-group */
if (CHECK_FLAG (peer->sflags, PEER_STATUS_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 (!if_ras_printed)
{ {
if (peer->as_type == AS_SPECIFIED) 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) 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) 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 (peer->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS) !=
CHECK_FLAG (g_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, peer->change_local_as,
CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ? CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ?
" no-prepend" : "", " no-prepend" : "",
@ -6705,7 +6705,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
/* description */ /* description */
if (peer->desc) 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 */ /* shutdown */
@ -6716,10 +6716,10 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
peer->tx_shutdown_message) peer->tx_shutdown_message)
{ {
if (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); peer->tx_shutdown_message);
else 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 || ! g_peer->password
|| strcmp (peer->password, g_peer->password) != 0) || 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)) if (!peer_group_active (peer))
{ {
vty_outln (vty, " neighbor %s solo", addr); vty_out (vty, " neighbor %s solo\n", addr);
} }
} }
/* BGP port */ /* BGP port */
if (peer->port != BGP_PORT_DEFAULT) 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 */ /* Local interface name */
if (peer->ifname) 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 */ /* passive */
@ -6770,7 +6770,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) || if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_PASSIVE)) ! 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) 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) 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); peer->gtsm_hops);
} }
} }
@ -6800,7 +6800,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) || if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK)) ! 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 if (! peer_group_active (peer) || ! g_peer->update_if
|| strcmp (g_peer->update_if, peer->update_if) != 0) || 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); peer->update_if);
} }
} }
@ -6820,7 +6820,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
|| sockunion_cmp (g_peer->update_source, || sockunion_cmp (g_peer->update_source,
peer->update_source) != 0) 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)); 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 != BGP_DEFAULT_EBGP_ROUTEADV) ||
(peer_group_active (peer) && peer->v_routeadv != g_peer->v_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); 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 != BGP_DEFAULT_KEEPALIVE || peer->holdtime != BGP_DEFAULT_HOLDTIME)) ||
(peer_group_active (peer) && (peer->keepalive != g_peer->keepalive || peer->holdtime != g_peer->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); 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))) (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); peer->connect);
} }
@ -6858,7 +6858,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) || if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DYNAMIC_CAPABILITY)) ! 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) || if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_CAPABILITY_ENHE)) ! 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); addr);
} }
} }
@ -6878,7 +6878,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
if (! peer_group_active (peer) || if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_CAPABILITY_ENHE)) ! 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) || if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DONT_CAPABILITY)) ! 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) || if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY)) ! 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) || if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_STRICT_CAP_MATCH)) ! 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]) if (g_peer->afc[afi][safi] && !peer->afc[afi][safi])
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s activate%s", " no neighbor %s activate\n",
addr, VTYNL); addr);
} }
/* If the peer-group is not active but peer is, print an 'activate' */ /* If the peer-group is not active but peer is, print an 'activate' */
else if (!g_peer->afc[afi][safi] && peer->afc[afi][safi]) else if (!g_peer->afc[afi][safi] && peer->afc[afi][safi])
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s activate%s", " neighbor %s activate\n",
addr, VTYNL); addr);
} }
} }
else 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)) if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4))
{ {
afi_header_vty_out(vty, afi, safi, write, afi_header_vty_out(vty, afi, safi, write,
" neighbor %s activate%s", " neighbor %s activate\n",
addr, VTYNL); addr);
} }
} }
else else
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s activate%s", " neighbor %s activate\n",
addr, VTYNL); addr);
} }
else 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)) if (!bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s activate%s", " no neighbor %s activate\n",
addr, VTYNL); 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)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_ADDPATH_TX_ALL_PATHS))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s addpath-tx-all-paths%s", " neighbor %s addpath-tx-all-paths\n",
addr, VTYNL); addr);
} }
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s addpath-tx-bestpath-per-AS%s", " neighbor %s addpath-tx-bestpath-per-AS\n",
addr, VTYNL); addr);
} }
/* ORF capability. */ /* ORF capability. */
@ -7016,68 +7016,68 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
vty_out (vty, " send"); vty_out (vty, " send");
else else
vty_out (vty, " receive"); vty_out (vty, " receive");
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
/* Route reflector client. */ /* Route reflector client. */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REFLECTOR_CLIENT)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REFLECTOR_CLIENT))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s route-reflector-client%s", " neighbor %s route-reflector-client\n",
addr, VTYNL); addr);
} }
/* next-hop-self force */ /* next-hop-self force */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_FORCE_NEXTHOP_SELF)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_FORCE_NEXTHOP_SELF))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s next-hop-self force%s", " neighbor %s next-hop-self force\n",
addr, VTYNL); addr);
} }
/* next-hop-self */ /* next-hop-self */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_SELF)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_SELF))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s next-hop-self%s", " neighbor %s next-hop-self\n",
addr, VTYNL); addr);
} }
/* remove-private-AS */ /* remove-private-AS */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s remove-private-AS all replace-AS%s", " neighbor %s remove-private-AS all replace-AS\n",
addr, VTYNL); addr);
} }
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE)) else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s remove-private-AS replace-AS%s", " neighbor %s remove-private-AS replace-AS\n",
addr, VTYNL); addr);
} }
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL)) else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s remove-private-AS all%s", " neighbor %s remove-private-AS all\n",
addr, VTYNL); addr);
} }
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS)) else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s remove-private-AS%s", " neighbor %s remove-private-AS\n",
addr, VTYNL); addr);
} }
/* as-override */ /* as-override */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_AS_OVERRIDE)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_AS_OVERRIDE))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s as-override%s", " neighbor %s as-override\n",
addr, VTYNL); addr);
} }
/* send-community print. */ /* 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)) && peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s send-community all%s", " neighbor %s send-community all\n",
addr, VTYNL); addr);
} }
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY)) else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s send-community large%s", " neighbor %s send-community large\n",
addr, VTYNL); addr);
} }
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY)) else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s send-community extended%s", " neighbor %s send-community extended\n",
addr, VTYNL); addr);
} }
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY)) else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s send-community%s", " neighbor %s send-community\n",
addr, VTYNL); addr);
} }
} }
else 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))) (!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY)))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s send-community all%s", " no neighbor %s send-community all\n",
addr, VTYNL); addr);
} }
else 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))) (!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY)))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s send-community large%s", " no neighbor %s send-community large\n",
addr, VTYNL); addr);
} }
if (!peer_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY) && 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))) (!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY)))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s send-community extended%s", " no neighbor %s send-community extended\n",
addr, VTYNL); addr);
} }
if (!peer_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY) && 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))) (!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_COMMUNITY)))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s send-community%s", " no neighbor %s send-community\n",
addr, VTYNL); addr);
} }
} }
} }
@ -7163,15 +7163,15 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
" neighbor %s default-originate", addr); " neighbor %s default-originate", addr);
if (peer->default_rmap[afi][safi].name) if (peer->default_rmap[afi][safi].name)
vty_out (vty, " route-map %s", 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. */ /* Soft reconfiguration inbound. */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SOFT_RECONFIG)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SOFT_RECONFIG))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s soft-reconfiguration inbound%s", " neighbor %s soft-reconfiguration inbound\n",
addr, VTYNL); addr);
} }
/* maximum-prefix. */ /* maximum-prefix. */
@ -7191,23 +7191,23 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
vty_out (vty, " warning-only"); vty_out (vty, " warning-only");
if (peer->pmax_restart[afi][safi]) if (peer->pmax_restart[afi][safi])
vty_out (vty, " restart %u", 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. */ /* Route server client. */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s route-server-client%s", " neighbor %s route-server-client\n",
addr, VTYNL); addr);
} }
/* Nexthop-local unchanged. */ /* Nexthop-local unchanged. */
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)) if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s nexthop-local unchanged%s", " neighbor %s nexthop-local unchanged\n",
addr, VTYNL); addr);
} }
/* allowas-in <1-10> */ /* 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) if (peer->allowas_in[afi][safi] == 3)
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s allowas-in%s", " neighbor %s allowas-in\n",
addr, VTYNL); addr);
} }
else else
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s allowas-in %d%s", " neighbor %s allowas-in %d\n",
addr, peer->allowas_in[afi][safi], VTYNL); 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)) || ! peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_ALLOWAS_IN_ORIGIN))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s allowas-in origin%s", " neighbor %s allowas-in origin\n",
addr, VTYNL); addr);
} }
} }
@ -7253,8 +7253,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
if (peer->weight[afi][safi]) if (peer->weight[afi][safi])
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s weight %lu%s", " neighbor %s weight %lu\n",
addr, peer->weight[afi][safi], VTYNL); 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)) && peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_MED_UNCHANGED))
{ {
afi_header_vty_out (vty, afi, safi, write, afi_header_vty_out (vty, afi, safi, write,
" neighbor %s attribute-unchanged%s", " neighbor %s attribute-unchanged\n",
addr, VTYNL); addr);
} }
else else
{ {
afi_header_vty_out (vty, afi, safi, write, 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) ? peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_AS_PATH_UNCHANGED) ?
" as-path" : "", " as-path" : "",
peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED) ? peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED) ?
" next-hop" : "", " next-hop" : "",
peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_MED_UNCHANGED) ? 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) if (*write)
return; return;
vty_out (vty, " !%s address-family ", VTYNL); vty_out (vty, " !\n address-family ");
if (afi == AFI_IP) 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) if (safi == SAFI_EVPN)
vty_out (vty, "l2vpn evpn"); vty_out (vty, "l2vpn evpn");
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
*write = 1; *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); bgp_config_write_table_map (vty, bgp, afi, safi, &write);
if (write) if (write)
vty_outln (vty, " exit-address-family"); vty_out (vty, " exit-address-family\n");
return write; return write;
} }
@ -7386,25 +7386,25 @@ bgp_config_write (struct vty *vty)
/* BGP Multiple instance. */ /* BGP Multiple instance. */
if (!bgp_option_check (BGP_OPT_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++; write++;
} }
/* BGP Config type. */ /* BGP Config type. */
if (bgp_option_check (BGP_OPT_CONFIG_CISCO)) if (bgp_option_check (BGP_OPT_CONFIG_CISCO))
{ {
vty_outln (vty, "bgp config-type cisco"); vty_out (vty, "bgp config-type cisco\n");
write++; write++;
} }
if (bm->rmap_update_timer != RMAP_DEFAULT_UPDATE_TIMER) 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. */ /* BGP configuration. */
for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp)) for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{ {
if (write) if (write)
vty_outln (vty, "!"); vty_out (vty, "!\n");
/* Router bgp ASN */ /* Router bgp ASN */
vty_out (vty, "router bgp %u", bgp->as); 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) ? (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW) ?
"view" : "vrf", bgp->name); "view" : "vrf", bgp->name);
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
/* No Synchronization */ /* No Synchronization */
if (bgp_option_check (BGP_OPT_CONFIG_CISCO)) if (bgp_option_check (BGP_OPT_CONFIG_CISCO))
vty_outln (vty, " no synchronization"); vty_out (vty, " no synchronization\n");
/* BGP fast-external-failover. */ /* BGP fast-external-failover. */
if (CHECK_FLAG (bgp->flags, BGP_FLAG_NO_FAST_EXT_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. */ /* BGP router ID. */
if (bgp->router_id_static.s_addr != 0) 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)); inet_ntoa(bgp->router_id_static));
/* BGP log-neighbor-changes. */ /* BGP log-neighbor-changes. */
if (!!bgp_flag_check (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES) if (!!bgp_flag_check (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES)
!= DFLT_BGP_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_flag_check(bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES) ? "" : "no ");
/* BGP configuration. */ /* BGP configuration. */
if (bgp_flag_check (bgp, BGP_FLAG_ALWAYS_COMPARE_MED)) 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. */ /* BGP default ipv4-unicast. */
if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4)) 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. */ /* BGP default local-preference. */
if (bgp->default_local_pref != BGP_DEFAULT_LOCAL_PREF) 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_local_pref);
/* BGP default show-hostname */ /* BGP default show-hostname */
if (!!bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME) if (!!bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME)
!= DFLT_BGP_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_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME) ? "" : "no ");
/* BGP default subgroup-pkt-queue-max. */ /* BGP default subgroup-pkt-queue-max. */
if (bgp->default_subgroup_pkt_queue_max != 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->default_subgroup_pkt_queue_max);
/* BGP client-to-client reflection. */ /* BGP client-to-client reflection. */
if (bgp_flag_check (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT)) 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. */ /* BGP cluster ID. */
if (CHECK_FLAG (bgp->config, BGP_CONFIG_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 */ /* Disable ebgp connected nexthop check */
if (bgp_flag_check (bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK)) 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*/ /* Confederation identifier*/
if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION)) 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 */ /* Confederation peer */
if (bgp->confed_peers_cnt > 0) 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++) for (i = 0; i < bgp->confed_peers_cnt; i++)
vty_out(vty, " %u", bgp->confed_peers[i]); vty_out(vty, " %u", bgp->confed_peers[i]);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
/* BGP enforce-first-as. */ /* BGP enforce-first-as. */
if (bgp_flag_check (bgp, BGP_FLAG_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. */ /* BGP deterministic-med. */
if (!!bgp_flag_check (bgp, BGP_FLAG_DETERMINISTIC_MED) if (!!bgp_flag_check (bgp, BGP_FLAG_DETERMINISTIC_MED)
!= DFLT_BGP_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_flag_check(bgp, BGP_FLAG_DETERMINISTIC_MED) ? "" : "no ");
/* BGP update-delay. */ /* 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); vty_out (vty, " bgp max-med on-startup %u", bgp->v_maxmed_onstartup);
if (bgp->maxmed_onstartup_value != BGP_MAXMED_VALUE_DEFAULT) if (bgp->maxmed_onstartup_value != BGP_MAXMED_VALUE_DEFAULT)
vty_out (vty, " %u", bgp->maxmed_onstartup_value); 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) if (bgp->v_maxmed_admin != BGP_MAXMED_ADMIN_UNCONFIGURED)
{ {
vty_out (vty, " bgp max-med administrative"); vty_out (vty, " bgp max-med administrative");
if (bgp->maxmed_admin_value != BGP_MAXMED_VALUE_DEFAULT) if (bgp->maxmed_admin_value != BGP_MAXMED_VALUE_DEFAULT)
vty_out (vty, " %u", bgp->maxmed_admin_value); vty_out (vty, " %u", bgp->maxmed_admin_value);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
/* write quanta */ /* write quanta */
@ -7526,42 +7526,42 @@ bgp_config_write (struct vty *vty)
/* BGP graceful-restart. */ /* BGP graceful-restart. */
if (bgp->stalepath_time != BGP_DEFAULT_STALEPATH_TIME) 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); bgp->stalepath_time);
if (bgp->restart_time != BGP_DEFAULT_RESTART_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); bgp->restart_time);
if (bgp_flag_check (bgp, BGP_FLAG_GRACEFUL_RESTART)) 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. */ /* BGP graceful-restart Preserve State F bit. */
if (bgp_flag_check (bgp, BGP_FLAG_GR_PRESERVE_FWD)) 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. */ /* BGP bestpath method. */
if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_IGNORE)) 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)) 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_ASPATH_MULTIPATH_RELAX))
{ {
if (bgp_flag_check (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET)) if (bgp_flag_check (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET))
{ {
vty_outln (vty, vty_out (vty,
" bgp bestpath as-path multipath-relax as-set"); " bgp bestpath as-path multipath-relax as-set\n");
} }
else 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)) { 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)) 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) if (bgp_flag_check (bgp, BGP_FLAG_MED_CONFED)
|| bgp_flag_check (bgp, BGP_FLAG_MED_MISSING_AS_WORST)) || bgp_flag_check (bgp, BGP_FLAG_MED_MISSING_AS_WORST))
{ {
@ -7570,13 +7570,13 @@ bgp_config_write (struct vty *vty)
vty_out (vty, " confed"); vty_out (vty, " confed");
if (bgp_flag_check (bgp, BGP_FLAG_MED_MISSING_AS_WORST)) if (bgp_flag_check (bgp, BGP_FLAG_MED_MISSING_AS_WORST))
vty_out (vty, " missing-as-worst"); vty_out (vty, " missing-as-worst");
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
/* BGP network import check. */ /* BGP network import check. */
if (!!bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK) if (!!bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK)
!= DFLT_BGP_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_check(bgp, BGP_FLAG_IMPORT_CHECK) ? "" : "no ");
/* BGP flag dampening. */ /* BGP flag dampening. */
@ -7587,7 +7587,7 @@ bgp_config_write (struct vty *vty)
/* BGP timers configuration. */ /* BGP timers configuration. */
if (bgp->default_keepalive != BGP_DEFAULT_KEEPALIVE if (bgp->default_keepalive != BGP_DEFAULT_KEEPALIVE
&& bgp->default_holdtime != BGP_DEFAULT_HOLDTIME) && 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); bgp->default_holdtime);
/* peer-group */ /* peer-group */
@ -7608,7 +7608,7 @@ bgp_config_write (struct vty *vty)
/* No auto-summary */ /* No auto-summary */
if (bgp_option_check (BGP_OPT_CONFIG_CISCO)) if (bgp_option_check (BGP_OPT_CONFIG_CISCO))
vty_outln (vty, " no auto-summary"); vty_out (vty, " no auto-summary\n");
/* IPv4 unicast configuration. */ /* IPv4 unicast configuration. */
write += bgp_config_write_family (vty, bgp, AFI_IP, SAFI_UNICAST); write += bgp_config_write_family (vty, bgp, AFI_IP, SAFI_UNICAST);

File diff suppressed because it is too large Load Diff

View File

@ -3101,12 +3101,12 @@ DEFUN (
if (!str2prefix (argv[5]->arg, &pfx)) 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; return CMD_WARNING_CONFIG_FAILED;
} }
if (pfx.family != AF_INET && pfx.family != AF_INET6) 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3144,7 +3144,7 @@ test_nexthops_callback (
fp (out, "Nexthops Callback, Target=("); fp (out, "Nexthops Callback, Target=(");
//rfapiPrintRfapiIpAddr(stream, target); //rfapiPrintRfapiIpAddr(stream, target);
fp (out, ")%s", VTYNL); fp (out, ")\n");
rfapiPrintNhl (stream, next_hops); 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 ()), rc = rfapi_open (rfapi_get_rfp_start_val_by_bgp (bgp_get_default ()),
&vn, &un, /*&uo */ NULL, &lifetime, NULL, &handle); &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, handle, lifetime);
rc = rfapi_set_response_cb (handle, test_nexthops_callback); 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; return CMD_SUCCESS;
} }
@ -3230,14 +3230,14 @@ DEFUN (debug_rfapi_close_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) 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); argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
rc = rfapi_close (handle); 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; return CMD_SUCCESS;
} }
@ -3258,13 +3258,13 @@ DEFUN (debug_rfapi_close_rfd,
if (*endptr != '\0' || (uintptr_t) handle == UINTPTR_MAX) 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; return CMD_WARNING_CONFIG_FAILED;
} }
rc = rfapi_close (handle); 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; return CMD_SUCCESS;
} }
@ -3311,7 +3311,7 @@ DEFUN (debug_rfapi_register_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) 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); argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3321,12 +3321,12 @@ DEFUN (debug_rfapi_register_vn_un,
*/ */
if (!str2prefix (argv[8]->arg, &pfx)) 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; return CMD_WARNING_CONFIG_FAILED;
} }
if (pfx.family != AF_INET && pfx.family != AF_INET6) 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; return CMD_WARNING_CONFIG_FAILED;
} }
rfapiQprefix2Rprefix (&pfx, &hpfx); rfapiQprefix2Rprefix (&pfx, &hpfx);
@ -3344,7 +3344,7 @@ DEFUN (debug_rfapi_register_vn_un,
rc = rfapi_register (handle, &hpfx, lifetime, NULL, NULL, 0); rc = rfapi_register (handle, &hpfx, lifetime, NULL, NULL, 0);
if (rc) 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)); strerror(rc));
} }
@ -3400,7 +3400,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) 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); argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3410,12 +3410,12 @@ DEFUN (debug_rfapi_register_vn_un_l2o,
*/ */
if (!str2prefix (argv[8]->arg, &pfx)) 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; return CMD_WARNING_CONFIG_FAILED;
} }
if (pfx.family != AF_INET && pfx.family != AF_INET6) 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; return CMD_WARNING_CONFIG_FAILED;
} }
rfapiQprefix2Rprefix (&pfx, &hpfx); 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); 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))) 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; return CMD_WARNING_CONFIG_FAILED;
} }
optary[opt_next].type = RFAPI_VN_OPTION_TYPE_L2ADDR; 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); rc = rfapi_register (handle, &hpfx, lifetime, NULL /* &uo */ , opt, 0);
if (rc) 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)); strerror(rc));
} }
@ -3496,7 +3496,7 @@ DEFUN (debug_rfapi_unregister_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) 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); argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3506,12 +3506,12 @@ DEFUN (debug_rfapi_unregister_vn_un,
*/ */
if (!str2prefix (argv[8]->arg, &pfx)) 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; return CMD_WARNING_CONFIG_FAILED;
} }
if (pfx.family != AF_INET && pfx.family != AF_INET6) 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; return CMD_WARNING_CONFIG_FAILED;
} }
rfapiQprefix2Rprefix (&pfx, &hpfx); rfapiQprefix2Rprefix (&pfx, &hpfx);
@ -3567,7 +3567,7 @@ DEFUN (debug_rfapi_query_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) 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); argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3579,7 +3579,7 @@ DEFUN (debug_rfapi_query_vn_un,
if (rc) 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)); strerror(rc));
} }
else else
@ -3642,13 +3642,13 @@ DEFUN (debug_rfapi_query_vn_un_l2o,
if ((rc = rfapiCliGetRfapiIpAddr (vty, argv[2], &target))) if ((rc = rfapiCliGetRfapiIpAddr (vty, argv[2], &target)))
return rc; return rc;
#else #else
vty_outln (vty, "%% This command is broken."); vty_out (vty, "%% This command is broken.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
#endif #endif
if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) 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); argv[4]->arg, argv[6]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3659,7 +3659,7 @@ DEFUN (debug_rfapi_query_vn_un_l2o,
memset (&l2o_buf, 0, sizeof (l2o_buf)); memset (&l2o_buf, 0, sizeof (l2o_buf));
if (rfapiStr2EthAddr (argv[10]->arg, &l2o_buf.macaddr)) 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3688,7 +3688,7 @@ DEFUN (debug_rfapi_query_vn_un_l2o,
if (rc) 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)); strerror(rc));
} }
else else
@ -3750,7 +3750,7 @@ DEFUN (debug_rfapi_query_done_vn_un,
if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) 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); argv[5]->arg, argv[7]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3760,7 +3760,7 @@ DEFUN (debug_rfapi_query_done_vn_un,
*/ */
rc = rfapi_query_done (handle, &target); 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; return CMD_SUCCESS;
} }
@ -3786,14 +3786,14 @@ DEFUN (debug_rfapi_show_import,
bgp = bgp_get_default (); /* assume 1 instance for now */ bgp = bgp_get_default (); /* assume 1 instance for now */
if (!bgp) if (!bgp)
{ {
vty_outln (vty, "No BGP instance"); vty_out (vty, "No BGP instance\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
h = bgp->rfapi; h = bgp->rfapi;
if (!h) if (!h)
{ {
vty_outln (vty, "No RFAPI instance"); vty_out (vty, "No RFAPI instance\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3807,7 +3807,7 @@ DEFUN (debug_rfapi_show_import,
{ {
s = ecommunity_ecom2str (it->rt_import_list, s = ecommunity_ecom2str (it->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, 0); 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); XFREE (MTYPE_ECOMMUNITY_STR, s);
rfapiShowImportTable (vty, "IP VPN", it->imported_vpn[AFI_IP], 1); rfapiShowImportTable (vty, "IP VPN", it->imported_vpn[AFI_IP], 1);
@ -3837,8 +3837,7 @@ DEFUN (debug_rfapi_show_import,
lni = lni_as_ptr; lni = lni_as_ptr;
if (first_l2) if (first_l2)
{ {
vty_outln (vty, "%sLNI-based Ethernet Tables:", vty_out (vty, "\nLNI-based Ethernet Tables:\n");
VTYNL);
first_l2 = 0; first_l2 = 0;
} }
snprintf (buf, BUFSIZ, "L2VPN LNI=%u", lni); 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)) 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); argv[5]->arg, argv[7]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -3920,12 +3919,12 @@ DEFUN (debug_rfapi_response_omit_self,
if (!bgp) 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 CMD_WARNING_CONFIG_FAILED;
} }
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
vty_outln (vty, "VNC not configured"); vty_out (vty, "VNC not configured\n");
return CMD_WARNING_CONFIG_FAILED; 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)) if (!rfg || !listnode_lookup (rfc->nve_groups_sequential, rfg))
{ {
/* Not in list anymore */ /* 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; return NULL;
} }
@ -4216,7 +4215,7 @@ rfapi_rfp_get_or_init_group_config_l2 (
if (!rfg || !listnode_lookup (rfc->l2_groups, rfg)) if (!rfg || !listnode_lookup (rfc->l2_groups, rfg))
{ {
/* Not in list anymore */ /* 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; return NULL;
} }
if (rfg->rfp_cfg == NULL && size > 0) if (rfg->rfp_cfg == NULL && size > 0)

View File

@ -2294,7 +2294,7 @@ rfapiRibShowResponsesSummary (void *stream)
fp (out, "%-24s ", "Responses: (Prefixes)"); fp (out, "%-24s ", "Responses: (Prefixes)");
fp (out, "%-8s %-8u ", "Active:", bgp->rfapi->rib_prefix_count_total); 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, "%-8s %-8u", "Maximum:", bgp->rfapi->rib_prefix_count_total_max);
fp (out, "%s", VTYNL); fp (out, "\n");
fp (out, "%-24s ", " (Updated)"); fp (out, "%-24s ", " (Updated)");
fp (out, "%-8s %-8u ", "Update:", fp (out, "%-8s %-8u ", "Update:",
@ -2304,7 +2304,7 @@ rfapiRibShowResponsesSummary (void *stream)
fp (out, "%-8s %-8u", "Total:", fp (out, "%-8s %-8u", "Total:",
bgp->rfapi->stat.count_updated_response_updates + bgp->rfapi->stat.count_updated_response_updates +
bgp->rfapi->stat.count_updated_response_deletes); bgp->rfapi->stat.count_updated_response_deletes);
fp (out, "%s", VTYNL); fp (out, "\n");
fp (out, "%-24s ", " (NVEs)"); fp (out, "%-24s ", " (NVEs)");
for (ALL_LIST_ELEMENTS_RO (&bgp->rfapi->descriptors, node, rfd)) 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 ", "Active:", nves_with_nonempty_ribs);
fp (out, "%-8s %-8u", "Total:", nves); 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); prefix_rd2str(&ri->rk.rd, str_rd+1, BUFSIZ-1);
#endif #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' : ' ', deleted ? 'r' : ' ',
*printedprefix ? "" : str_pfx, *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) if (!*printedprefix)
*printedprefix = 1; *printedprefix = 1;
@ -2500,20 +2500,18 @@ rfapiRibShowResponses (
{ {
++printedheader; ++printedheader;
fp (out, "%s[%s]%s", fp (out, "\n[%s]\n",
VTYNL, show_removed ? "Removed" : "Active");
show_removed ? "Removed" : "Active", VTYNL); fp (out, "%-15s %-15s\n", "Querying VN", "Querying UN");
fp (out, "%-15s %-15s%s", "Querying VN", "Querying UN", fp (out, " %-20s %-15s %-15s %4s %-8s %-8s\n",
VTYNL);
fp (out, " %-20s %-15s %-15s %4s %-8s %-8s%s",
"Prefix", "Registered VN", "Registered UN", "Cost", "Prefix", "Registered VN", "Registered UN", "Cost",
"Lifetime", "Lifetime",
#if RFAPI_REGISTRATIONS_REPORT_AGE #if RFAPI_REGISTRATIONS_REPORT_AGE
"Age", "Age"
#else #else
"Remaining", "Remaining"
#endif #endif
VTYNL); );
} }
if (!printednve) if (!printednve)
{ {
@ -2523,14 +2521,13 @@ rfapiRibShowResponses (
++printednve; ++printednve;
++nves_displayed; ++nves_displayed;
fp (out, "%-15s %-15s%s", fp (out, "%-15s %-15s\n",
rfapiRfapiIpAddr2Str (&rfd->vn_addr, str_vn, BUFSIZ), rfapiRfapiIpAddr2Str (&rfd->vn_addr, str_vn, BUFSIZ),
rfapiRfapiIpAddr2Str (&rfd->un_addr, str_un, BUFSIZ), rfapiRfapiIpAddr2Str (&rfd->un_addr, str_un, BUFSIZ));
VTYNL);
} }
prefix2str (&rn->p, str_pfx, BUFSIZ); prefix2str (&rn->p, str_pfx, BUFSIZ);
//fp(out, " %s%s", buf, VTYNL); /* prefix */ //fp(out, " %s\n", buf); /* prefix */
routes_displayed++; routes_displayed++;
nhs_displayed += print_rib_sl (fp, vty, out, sl, nhs_displayed += print_rib_sl (fp, vty, out, sl,
@ -2542,12 +2539,12 @@ rfapiRibShowResponses (
if (routes_total) if (routes_total)
{ {
fp (out, "%s", VTYNL); fp (out, "\n");
fp (out, "Displayed %u NVEs, and %u out of %u %s prefixes", fp (out, "Displayed %u NVEs, and %u out of %u %s prefixes",
nves_displayed, routes_displayed, nves_displayed, routes_displayed,
routes_total, show_removed ? "removed" : "active"); routes_total, show_removed ? "removed" : "active");
if (nhs_displayed != routes_displayed || nhs_total != routes_total) if (nhs_displayed != routes_displayed || nhs_total != routes_total)
fp (out, " with %u out of %u next hops", nhs_displayed, nhs_total); fp (out, " with %u out of %u next hops", nhs_displayed, nhs_total);
fp (out, "%s", VTYNL); fp (out, "\n");
} }
} }

View File

@ -385,14 +385,14 @@ rfapiStdioPrintf (void *stream, const char *format, ...)
/* Fake out for debug logging */ /* Fake out for debug logging */
static struct vty vty_dummy_zlog; static struct vty vty_dummy_zlog;
static struct vty vty_dummy_stdio; static struct vty vty_dummy_stdio;
#define HVTYNL ((vty == &vty_dummy_zlog)? "": VTYNL) #define HVTYNL ((vty == &vty_dummy_zlog)? "": "\n")
static const char * static const char *
str_vty_newline (struct vty *vty) str_vty_newline (struct vty *vty)
{ {
if (vty == &vty_dummy_zlog) if (vty == &vty_dummy_zlog)
return ""; return "";
return VTYNL; return "\n";
} }
int int
@ -939,14 +939,14 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
bgp = bgp_get_default (); /* assume 1 instance for now */ bgp = bgp_get_default (); /* assume 1 instance for now */
if (!bgp) if (!bgp)
{ {
vty_outln (vty, "No BGP instance"); vty_out (vty, "No BGP instance\n");
return CMD_WARNING; return CMD_WARNING;
} }
h = bgp->rfapi; h = bgp->rfapi;
if (!h) if (!h)
{ {
vty_outln (vty, "No RFAPI instance"); vty_out (vty, "No RFAPI instance\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -995,10 +995,10 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
if (!printedheader) if (!printedheader)
{ {
++printedheader; ++printedheader;
fp (out, "%s", VTYNL); fp (out, "\n");
fp (out, "%-15s %-15s %-15s %-10s%s", fp (out, "%-15s %-15s %-15s %-10s\n",
"VN Address", "UN Address", "VN Address", "UN Address",
"Target", "Remaining", VTYNL); "Target", "Remaining");
} }
if (!printedquerier) if (!printedquerier)
@ -1022,9 +1022,9 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
rfapiFormatSeconds (thread_timer_remain_second (m->timer), rfapiFormatSeconds (thread_timer_remain_second (m->timer),
buf_remain, BUFSIZ); 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), 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) if (!printedheader)
{ {
++printedheader; ++printedheader;
fp (out, "%s", VTYNL); fp (out, "\n");
fp (out, "%-15s %-15s %-17s %10s %-10s%s", fp (out, "%-15s %-15s %-17s %10s %-10s\n",
"VN Address", "UN Address", "VN Address", "UN Address",
"Target", "LNI", "Remaining", VTYNL); "Target", "LNI", "Remaining");
} }
if (!printedquerier) if (!printedquerier)
@ -1097,19 +1097,18 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
rfapiFormatSeconds (thread_timer_remain_second rfapiFormatSeconds (thread_timer_remain_second
(mon_eth->timer), buf_remain, BUFSIZ); (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, rfapi_ntop (pfx_mac.family, &pfx_mac.u.prefix, buf_pfx,
BUFSIZ), mon_eth->logical_net_id, buf_remain, BUFSIZ), mon_eth->logical_net_id, buf_remain);
VTYNL);
} }
} }
} }
if (queries_total) if (queries_total)
{ {
fp (out, "%s", VTYNL); fp (out, "\n");
fp (out, "Displayed %d out of %d total queries%s", fp (out, "Displayed %d out of %d total queries\n",
queries_displayed, queries_total, VTYNL); queries_displayed, queries_total);
} }
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -2221,7 +2220,7 @@ register_add (
if (!bgp) if (!bgp)
{ {
if (vty) if (vty)
vty_outln (vty, "BGP not configured"); vty_out (vty, "BGP not configured\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2230,7 +2229,7 @@ register_add (
if (!h || !rfapi_cfg) if (!h || !rfapi_cfg)
{ {
if (vty) if (vty)
vty_outln (vty, "RFAPI not configured"); vty_out (vty, "RFAPI not configured\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2240,12 +2239,12 @@ register_add (
{ {
if (arg_lnh) 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; return CMD_WARNING_CONFIG_FAILED;
} }
if (argc <= 1) 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; return CMD_WARNING_CONFIG_FAILED;
} }
++argv, --argc; ++argv, --argc;
@ -2255,12 +2254,12 @@ register_add (
{ {
if (arg_lnh_cost) 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; return CMD_WARNING_CONFIG_FAILED;
} }
if (argc <= 1) 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; return CMD_WARNING_CONFIG_FAILED;
} }
++argv, --argc; ++argv, --argc;
@ -2288,7 +2287,7 @@ register_add (
arg_prefix = "0::0/128"; arg_prefix = "0::0/128";
break; break;
default: 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2296,13 +2295,13 @@ register_add (
if (!str2prefix (arg_prefix, &pfx)) if (!str2prefix (arg_prefix, &pfx))
{ {
vty_outln (vty, "Malformed prefix \"%s\"",arg_prefix); vty_out (vty, "Malformed prefix \"%s\"\n",arg_prefix);
goto fail; goto fail;
} }
if (pfx.family != AF_INET if (pfx.family != AF_INET
&& pfx.family != AF_INET6) && 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); arg_prefix);
goto fail; goto fail;
} }
@ -2316,7 +2315,7 @@ register_add (
cost = strtoul (arg_cost, &endptr, 10); cost = strtoul (arg_cost, &endptr, 10);
if (*endptr != '\0' || cost > 255) if (*endptr != '\0' || cost > 255)
{ {
vty_outln (vty, "%% Invalid %s value", "cost"); vty_out (vty, "%% Invalid %s value\n", "cost");
goto fail; goto fail;
} }
} }
@ -2337,7 +2336,7 @@ register_add (
lifetime = strtoul (arg_lifetime, &endptr, 10); lifetime = strtoul (arg_lifetime, &endptr, 10);
if (*endptr != '\0') if (*endptr != '\0')
{ {
vty_outln (vty, "%% Invalid %s value","lifetime"); vty_out (vty, "%% Invalid %s value\n","lifetime");
goto fail; goto fail;
} }
} }
@ -2351,8 +2350,8 @@ register_add (
{ {
if (!arg_lnh) if (!arg_lnh)
{ {
vty_outln (vty, vty_out (vty,
"%% %s may only be specified with local-next-hop", "%% %s may only be specified with local-next-hop\n",
"local-cost"); "local-cost");
goto fail; goto fail;
} }
@ -2360,7 +2359,7 @@ register_add (
lnh_cost = strtoul (arg_lnh_cost, &endptr, 10); lnh_cost = strtoul (arg_lnh_cost, &endptr, 10);
if (*endptr != '\0' || lnh_cost > 255) 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; goto fail;
} }
} }
@ -2373,7 +2372,7 @@ register_add (
{ {
if (!arg_prefix) 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"); "local-next-hop");
goto fail; goto fail;
} }
@ -2401,7 +2400,7 @@ register_add (
if (arg_vni && !arg_macaddr) 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"); "virtual-network-identifier");
goto fail; goto fail;
} }
@ -2410,8 +2409,8 @@ register_add (
{ {
if (!arg_vni) if (!arg_vni)
{ {
vty_outln (vty, vty_out (vty,
"Missing \"vni\" parameter (mandatory with mac)"); "Missing \"vni\" parameter (mandatory with mac)\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
optary[opt_next].v.l2addr.logical_net_id = strtoul(arg_vni, NULL, optary[opt_next].v.l2addr.logical_net_id = strtoul(arg_vni, NULL,
@ -2420,7 +2419,7 @@ register_add (
if ((rc = rfapiStr2EthAddr (arg_macaddr, if ((rc = rfapiStr2EthAddr (arg_macaddr,
&optary[opt_next].v.l2addr.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; goto fail;
} }
/* TBD label, NVE ID */ /* TBD label, NVE ID */
@ -2472,7 +2471,7 @@ register_add (
&rfd); &rfd);
if (rc) 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)); rfapi_error_str(rc));
rc = CMD_WARNING_CONFIG_FAILED; rc = CMD_WARNING_CONFIG_FAILED;
goto fail; goto fail;
@ -2480,7 +2479,7 @@ register_add (
} }
else 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)); rfapi_error_str(rc));
goto fail; goto fail;
} }
@ -2516,10 +2515,10 @@ register_add (
} }
vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__); vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_outln (vty, "Registration failed."); vty_out (vty, "Registration failed.\n");
vty_outln (vty, vty_out (vty,
"Confirm that either the VN or UN address matches a configured NVE group."); "Confirm that either the VN or UN address matches a configured NVE group.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
fail: fail:
@ -3129,7 +3128,7 @@ parse_deleter_args (
if (!str2prefix (arg_prefix, &rcdarg->prefix)) 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; return rc;
} }
} }
@ -3138,14 +3137,14 @@ parse_deleter_args (
{ {
if (!arg_vni) if (!arg_vni)
{ {
vty_outln (vty, "Missing VNI"); vty_out (vty, "Missing VNI\n");
return rc; return rc;
} }
if (strcmp (arg_l2addr, "*")) if (strcmp (arg_l2addr, "*"))
{ {
if ((rc = rfapiStr2EthAddr (arg_l2addr, &rcdarg->l2o.o.macaddr))) 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); arg_l2addr);
return rc; return rc;
} }
@ -3161,7 +3160,7 @@ parse_deleter_args (
{ {
if (!str2prefix_rd (arg_rd, &rcdarg->rd)) if (!str2prefix_rd (arg_rd, &rcdarg->rd))
{ {
vty_outln (vty, "Malformed RD \"%s\"", vty_out (vty, "Malformed RD \"%s\"\n",
arg_rd); arg_rd);
return rc; return rc;
} }
@ -3705,12 +3704,12 @@ print_cleared_stats (struct rfapi_local_reg_delete_arg *cda)
cda->nves = NULL; cda->nves = NULL;
} }
if (cda->failed_pfx_count) 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); cda->failed_pfx_count);
/* left as "prefixes" even in single case for ease of machine parsing */ /* left as "prefixes" even in single case for ease of machine parsing */
vty_outln (vty, vty_out (vty,
"[Local] Cleared %u registrations, %u prefixes, %u responses from %d NVEs", "[Local] Cleared %u registrations, %u prefixes, %u responses from %d NVEs\n",
cda->reg_count, cda->pfx_count, cda->query_count,cda->nve_count); 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 * 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); 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) if (vty)
{ {
vty_outln (vty, vty_out (vty,
"VNC is not configured. (There are no configured BGP VPN SAFI peers.)"); "VNC is not configured. (There are no configured BGP VPN SAFI peers.)\n");
} }
return 0; /* not running */ 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); h->stat.count_registrations_failed);
vty_out (vty, "%-8s %-8u", "Total:", vty_out (vty, "%-8s %-8u", "Total:",
h->stat.count_registrations); h->stat.count_registrations);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
vty_out (vty, "%-24s ", "Prefixes registered:"); vty_out (vty, "%-24s ", "Prefixes registered:");
vty_out (vty, VTYNL); vty_out (vty, "\n");
rfapiCountAllItRoutes (&active_local_routes, rfapiCountAllItRoutes (&active_local_routes,
&active_remote_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, " %-20s ", "Locally:");
vty_out (vty, "%-8s %-8u ", "Active:", active_local_routes); 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, " %-20s ", "Remotely:");
vty_out (vty, "%-8s %-8u", "Active:", active_remote_routes); 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, " %-20s ", "In Holddown:");
vty_out (vty, "%-8s %-8u", "Active:", holddown_remote_routes); 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, " %-20s ", "Imported:");
vty_out (vty, "%-8s %-8u", "Active:", imported_remote_routes); vty_out (vty, "%-8s %-8u", "Active:", imported_remote_routes);
break; break;
@ -4502,12 +4501,12 @@ rfapi_vty_show_nve_summary (struct vty *vty, show_nve_summary_t show_type)
default: default:
break; break;
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
return 0; return 0;
notcfg: notcfg:
vty_outln (vty, "VNC is not configured."); vty_out (vty, "VNC is not configured.\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -4574,9 +4573,9 @@ rfapi_show_nves (
if (!printed) if (!printed)
{ {
/* print out a header */ /* print out a header */
vty_outln (vty, vty_out (vty,
" " "Active Next Hops"); " Active Next Hops\n");
vty_outln (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s", vty_out (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s\n",
"VN Address", "VN Address",
"UN Address", "UN Address",
"Regis", "Resps", "Reach", "Remove", "Age"); "Regis", "Resps", "Reach", "Remove", "Age");
@ -4584,7 +4583,7 @@ rfapi_show_nves (
++printed; ++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, vn_addr_buf,
un_addr_buf, un_addr_buf,
rfapiApCount (rfd), rfapiApCount (rfd),
@ -4595,13 +4594,13 @@ rfapi_show_nves (
} }
if (printed > 0 || vn_prefix || un_prefix) 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); printed, total);
return 0; return 0;
notcfg: notcfg:
vty_outln (vty, "VNC is not configured."); vty_out (vty, "VNC is not configured.\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -4616,7 +4615,7 @@ DEFUN (vnc_show_summary,
if (!check_and_display_is_vnc_running (vty)) if (!check_and_display_is_vnc_running (vty))
return CMD_SUCCESS; return CMD_SUCCESS;
bgp_rfapi_show_summary (bgp_get_default (), vty); 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_ACTIVE_NVES);
rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_QUERIES); rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_QUERIES);
rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_RESPONSES); 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)) 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; return CMD_WARNING;
} }
if (pfx.family != AF_INET && pfx.family != AF_INET6) 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; return CMD_WARNING;
} }
@ -4713,7 +4712,7 @@ rfapi_show_registrations (
} }
if (!printed) 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)) 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; return CMD_SUCCESS;
} }
else else
@ -4774,7 +4773,7 @@ DEFUN (vnc_show_registrations_some_pfx,
{ {
if (!str2prefix (argv[4]->arg, &p)) 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; return CMD_SUCCESS;
} }
else else
@ -4831,7 +4830,7 @@ DEFUN (vnc_show_responses_pfx,
{ {
if (!str2prefix (argv[3]->arg, &p)) 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; return CMD_SUCCESS;
} }
else else
@ -4874,7 +4873,7 @@ DEFUN (vnc_show_responses_some_pfx,
{ {
if (!str2prefix (argv[4]->arg, &p)) 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; return CMD_SUCCESS;
} }
else else
@ -4923,7 +4922,7 @@ DEFUN (show_vnc_queries_pfx,
{ {
if (!str2prefix (argv[3]->arg, &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; return CMD_WARNING;
} }
p = &pfx; p = &pfx;
@ -4976,7 +4975,7 @@ DEFUN (vnc_clear_counters,
return CMD_SUCCESS; return CMD_SUCCESS;
notcfg: notcfg:
vty_outln (vty, "VNC is not configured."); vty_out (vty, "VNC is not configured.\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -5006,12 +5005,12 @@ vnc_add_vrf_prefix (struct vty *vty,
bgp = bgp_get_default (); /* assume main instance for now */ bgp = bgp_get_default (); /* assume main instance for now */
if (!bgp) 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 CMD_WARNING_CONFIG_FAILED;
} }
if (!bgp->rfapi || !bgp->rfapi_cfg) 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -5019,31 +5018,31 @@ vnc_add_vrf_prefix (struct vty *vty,
/* arg checks */ /* arg checks */
if (!rfg) 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); arg_vrf);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (!rfg->rt_export_list || !rfg->rfapi_import_table) 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); arg_vrf);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (!rfg->rd.family && !arg_rd) 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); arg_vrf);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (rfg->label > MPLS_LABEL_MAX && !arg_label) 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); arg_vrf);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (!str2prefix (arg_prefix, &pfx)) if (!str2prefix (arg_prefix, &pfx))
{ {
vty_outln (vty, "Malformed prefix \"%s\"", vty_out (vty, "Malformed prefix \"%s\"\n",
arg_prefix); arg_prefix);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -5057,7 +5056,7 @@ vnc_add_vrf_prefix (struct vty *vty,
opt->type = RFAPI_VN_OPTION_TYPE_INTERNAL_RD; opt->type = RFAPI_VN_OPTION_TYPE_INTERNAL_RD;
if (!str2prefix_rd (arg_rd, &opt->v.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); arg_rd);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -5085,7 +5084,7 @@ vnc_add_vrf_prefix (struct vty *vty,
pref = strtoul (arg_pref, &endptr, 10); pref = strtoul (arg_pref, &endptr, 10);
if (*endptr != '\0') if (*endptr != '\0')
{ {
vty_outln (vty, "%% Invalid local-preference value \"%s\"", vty_out (vty, "%% Invalid local-preference value \"%s\"\n",
arg_pref); arg_pref);
return CMD_WARNING_CONFIG_FAILED; 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__); 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -5260,19 +5259,19 @@ vnc_clear_vrf (struct vty *vty,
bgp = bgp_get_default (); /* assume main instance for now */ bgp = bgp_get_default (); /* assume main instance for now */
if (!bgp) if (!bgp)
{ {
vty_outln (vty, "No BGP process is configured"); vty_out (vty, "No BGP process is configured\n");
return CMD_WARNING; return CMD_WARNING;
} }
if (!bgp->rfapi || !bgp->rfapi_cfg) if (!bgp->rfapi || !bgp->rfapi_cfg)
{ {
vty_outln (vty, "VRF support not configured"); vty_out (vty, "VRF support not configured\n");
return CMD_WARNING; return CMD_WARNING;
} }
rfg = bgp_rfapi_cfg_match_byname (bgp, arg_vrf, RFAPI_GROUP_CFG_VRF); rfg = bgp_rfapi_cfg_match_byname (bgp, arg_vrf, RFAPI_GROUP_CFG_VRF);
/* arg checks */ /* arg checks */
if (!rfg) 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); arg_vrf);
return CMD_WARNING; return CMD_WARNING;
} }
@ -5284,7 +5283,7 @@ vnc_clear_vrf (struct vty *vty,
start_count = rfapi_cfg_group_it_count(rfg); start_count = rfapi_cfg_group_it_count(rfg);
clear_vnc_prefix (&cda); clear_vnc_prefix (&cda);
clear_vnc_vrf_closer (rfg); 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); cda.pfx_count, start_count);
return CMD_SUCCESS; return CMD_SUCCESS;
} }

View File

@ -79,13 +79,13 @@ DEFUN (debug_bgp_vnc,
else else
{ {
term_vnc_debug |= vncdebug[i].bit; 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); vncdebug[i].name);
} }
return CMD_SUCCESS; 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -118,13 +118,13 @@ DEFUN (no_debug_bgp_vnc,
else else
{ {
term_vnc_debug &= ~vncdebug[i].bit; 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); vncdebug[i].name);
} }
return CMD_SUCCESS; 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -144,7 +144,7 @@ DEFUN (no_debug_bgp_vnc_all,
VNC_STR) VNC_STR)
{ {
term_vnc_debug = 0; 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; return CMD_SUCCESS;
} }
@ -163,17 +163,17 @@ DEFUN (show_debugging_bgp_vnc,
{ {
size_t i; 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) for (i = 0; i < (sizeof(vncdebug) / sizeof(struct vnc_debug)); ++i)
{ {
if (term_vnc_debug & vncdebug[i].bit) 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); vncdebug[i].name);
} }
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -187,7 +187,7 @@ bgp_vnc_config_write_debug (struct vty *vty)
{ {
if (conf_vnc_debug & vncdebug[i].bit) 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++; write++;
} }
} }

View File

@ -197,7 +197,7 @@ rfp_cfg_write_cb (struct vty *vty, void *rfp_start_val)
if (rfi->config_var != 0) if (rfi->config_var != 0)
{ {
vty_out (vty, " rfp example-config-value %u", rfi->config_var); vty_out (vty, " rfp example-config-value %u", rfi->config_var);
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }

View File

@ -84,7 +84,7 @@ config_write_debug (struct vty *vty)
if (conf_debug_eigrp_packet[i] == 0 && term_debug_eigrp_packet[i] == 0 ) if (conf_debug_eigrp_packet[i] == 0 && term_debug_eigrp_packet[i] == 0 )
continue; continue;
vty_outln (vty, "debug eigrp packet %s%s", vty_out (vty, "debug eigrp packet %s%s\n",
type_str[i],detail_str[conf_debug_eigrp_packet[i]]); type_str[i],detail_str[conf_debug_eigrp_packet[i]]);
write = 1; write = 1;
} }
@ -210,12 +210,11 @@ void
show_ip_eigrp_interface_header (struct vty *vty, struct eigrp *eigrp) show_ip_eigrp_interface_header (struct vty *vty, struct eigrp *eigrp)
{ {
vty_outln (vty, "%s%s%d%s%s%s %-10s %-10s %-10s %-6s %-12s %-7s %-14s %-12s %-8s %-8s %-8s%s %-39s %-12s %-7s %-14s %-12s %-8s", vty_out (vty, "\nEIGRP interfaces for AS(%d)\n\n %-10s %-10s %-10s %-6s %-12s %-7s %-14s %-12s %-8s %-8s %-8s\n %-39s %-12s %-7s %-14s %-12s %-8s\n",
VTYNL, eigrp->AS,
"EIGRP interfaces for AS(",eigrp->AS,")",VTYNL,VTYNL,
"Interface", "Bandwidth", "Delay", "Peers", "Xmit Queue", "Mean", "Interface", "Bandwidth", "Delay", "Peers", "Xmit Queue", "Mean",
"Pacing Time", "Multicast", "Pending", "Hello", "Holdtime", "Pacing Time", "Multicast", "Pending", "Hello", "Holdtime",
VTYNL,"","Un/Reliable","SRTT","Un/Reliable","Flow Timer", "","Un/Reliable","SRTT","Un/Reliable","Flow Timer",
"Routes"); "Routes");
} }
@ -229,7 +228,7 @@ show_ip_eigrp_interface_sub (struct vty *vty, struct eigrp *eigrp,
vty_out (vty, "%-7u", ei->nbrs->count); vty_out (vty, "%-7u", ei->nbrs->count);
vty_out (vty, "%u %c %-10u",0,'/', eigrp_neighbor_packet_queue_sum (ei)); vty_out (vty, "%u %c %-10u",0,'/', eigrp_neighbor_packet_queue_sum (ei));
vty_out (vty, "%-7u %-14u %-12u %-8u", 0, 0, 0, 0); vty_out (vty, "%-7u %-14u %-12u %-8u", 0, 0, 0, 0);
vty_outln (vty, "%-8u %-8u ", vty_out (vty, "%-8u %-8u \n",
IF_DEF_PARAMS (ei->ifp)->v_hello, IF_DEF_PARAMS (ei->ifp)->v_hello,
IF_DEF_PARAMS(ei->ifp)->v_wait); IF_DEF_PARAMS(ei->ifp)->v_wait);
} }
@ -238,31 +237,30 @@ void
show_ip_eigrp_interface_detail (struct vty *vty, struct eigrp *eigrp, show_ip_eigrp_interface_detail (struct vty *vty, struct eigrp *eigrp,
struct eigrp_interface *ei) struct eigrp_interface *ei)
{ {
vty_outln (vty, "%-2s %s %d %-3s ","","Hello interval is ", 0, " sec"); vty_out (vty, "%-2s %s %d %-3s \n","","Hello interval is ", 0, " sec");
vty_outln (vty, "%-2s %s %s ","", "Next xmit serial","<none>"); vty_out (vty, "%-2s %s %s \n","", "Next xmit serial","<none>");
vty_outln (vty, "%-2s %s %d %s %d %s %d %s %d ", vty_out (vty, "%-2s %s %d %s %d %s %d %s %d \n",
"", "Un/reliable mcasts: ", 0, "/", 0, "Un/reliable ucasts: ", "", "Un/reliable mcasts: ", 0, "/", 0, "Un/reliable ucasts: ",
0, "/", 0); 0, "/", 0);
vty_outln (vty, "%-2s %s %d %s %d %s %d ", vty_out (vty, "%-2s %s %d %s %d %s %d \n",
"", "Mcast exceptions: ", 0, " CR packets: ", "", "Mcast exceptions: ", 0, " CR packets: ",
0, " ACKs supressed: ", 0); 0, " ACKs supressed: ", 0);
vty_outln (vty, "%-2s %s %d %s %d ", vty_out (vty, "%-2s %s %d %s %d \n",
"", "Retransmissions sent: ", 0, "Out-of-sequence rcvd: ", "", "Retransmissions sent: ", 0, "Out-of-sequence rcvd: ",
0); 0);
vty_outln (vty, "%-2s %s %s %s ", vty_out (vty, "%-2s %s %s %s \n",
"", "Authentication mode is ", "not","set"); "", "Authentication mode is ", "not","set");
vty_outln (vty, "%-2s %s ", "", "Use multicast"); vty_out (vty, "%-2s %s \n", "", "Use multicast");
} }
void void
show_ip_eigrp_neighbor_header (struct vty *vty, struct eigrp *eigrp) show_ip_eigrp_neighbor_header (struct vty *vty, struct eigrp *eigrp)
{ {
vty_outln (vty, "%s%s%d%s%s%s%-3s %-17s %-20s %-6s %-8s %-6s %-5s %-5s %-5s%s %-41s %-6s %-8s %-6s %-4s %-6s %-5s ", vty_out (vty, "\nEIGRP neighbors for AS(%d)\n\n%-3s %-17s %-20s %-6s %-8s %-6s %-5s %-5s %-5s\n %-41s %-6s %-8s %-6s %-4s %-6s %-5s \n",
VTYNL, eigrp->AS,
"EIGRP neighbors for AS(",eigrp->AS,")",VTYNL,VTYNL,
"H", "Address", "Interface", "Hold", "Uptime", "H", "Address", "Interface", "Hold", "Uptime",
"SRTT", "RTO", "Q", "Seq", VTYNL "SRTT", "RTO", "Q", "Seq",
,"","(sec)","","(ms)","","Cnt","Num"); "","(sec)","","(ms)","","Cnt","Num");
} }
void void
@ -275,7 +273,7 @@ show_ip_eigrp_neighbor_sub (struct vty *vty, struct eigrp_neighbor *nbr,
vty_out (vty,"%-7lu", thread_timer_remain_second (nbr->t_holddown)); vty_out (vty,"%-7lu", thread_timer_remain_second (nbr->t_holddown));
vty_out (vty,"%-8u %-6u %-5u", 0, 0, EIGRP_PACKET_RETRANS_TIME); vty_out (vty,"%-8u %-6u %-5u", 0, 0, EIGRP_PACKET_RETRANS_TIME);
vty_out (vty,"%-7lu", nbr->retrans_queue->count); vty_out (vty,"%-7lu", nbr->retrans_queue->count);
vty_outln (vty,"%u", nbr->recv_sequence_number); vty_out (vty,"%u\n", nbr->recv_sequence_number);
if (detail) if (detail)
@ -285,7 +283,7 @@ show_ip_eigrp_neighbor_sub (struct vty *vty, struct eigrp_neighbor *nbr,
nbr->tlv_rel_major, nbr->tlv_rel_minor); nbr->tlv_rel_major, nbr->tlv_rel_minor);
vty_out(vty,", Retrans: %lu, Retries: %lu", vty_out(vty,", Retrans: %lu, Retries: %lu",
nbr->retrans_queue->count, 0UL); nbr->retrans_queue->count, 0UL);
vty_outln (vty,", %s", eigrp_nbr_state_str(nbr)); vty_out (vty,", %s\n", eigrp_nbr_state_str(nbr));
} }
} }
@ -298,11 +296,9 @@ show_ip_eigrp_topology_header (struct vty *vty, struct eigrp *eigrp)
struct in_addr router_id; struct in_addr router_id;
router_id.s_addr = eigrp->router_id; router_id.s_addr = eigrp->router_id;
vty_outln (vty, "%sEIGRP Topology Table for AS(%d)/ID(%s)%s", vty_out (vty, "\nEIGRP Topology Table for AS(%d)/ID(%s)\n\n", eigrp->AS, inet_ntoa(router_id));
VTYNL, eigrp->AS, inet_ntoa(router_id), VTYNL); vty_out (vty, "Codes: P - Passive, A - Active, U - Update, Q - Query, "
vty_outln (vty, "Codes: P - Passive, A - Active, U - Update, Q - Query, " "R - Reply\n r - reply Status, s - sia Status\n\n");
"R - Reply%s r - reply Status, s - sia Status%s",
VTYNL, VTYNL);
} }
void void
@ -315,7 +311,7 @@ show_ip_eigrp_prefix_entry (struct vty *vty, struct eigrp_prefix_entry *tn)
vty_out (vty, "%s/%u, ", vty_out (vty, "%s/%u, ",
inet_ntoa (tn->destination_ipv4->prefix), tn->destination_ipv4->prefixlen); inet_ntoa (tn->destination_ipv4->prefix), tn->destination_ipv4->prefixlen);
vty_out (vty, "%u successors, ", successors->count); vty_out (vty, "%u successors, ", successors->count);
vty_outln (vty, "FD is %u, serno: %" PRIu64 " ", tn->fdistance, tn->serno); vty_out (vty, "FD is %u, serno: %" PRIu64 " \n", tn->fdistance, tn->serno);
list_delete(successors); list_delete(successors);
} }
@ -334,11 +330,11 @@ show_ip_eigrp_neighbor_entry (struct vty *vty, struct eigrp *eigrp,
} }
if (te->adv_router == eigrp->neighbor_self) if (te->adv_router == eigrp->neighbor_self)
vty_outln (vty, "%-7s%s, %s", " ", "via Connected", vty_out (vty, "%-7s%s, %s\n", " ", "via Connected",
eigrp_if_name_string(te->ei)); eigrp_if_name_string(te->ei));
else else
{ {
vty_outln (vty, "%-7s%s%s (%u/%u), %s", vty_out (vty, "%-7s%s%s (%u/%u), %s\n",
" ", "via ", inet_ntoa (te->adv_router->src), " ", "via ", inet_ntoa (te->adv_router->src),
te->distance, te->reported_distance, te->distance, te->reported_distance,
eigrp_if_name_string(te->ei)); eigrp_if_name_string(te->ei));
@ -355,11 +351,11 @@ DEFUN (show_debugging_eigrp,
{ {
int i; int i;
vty_outln (vty, "EIGRP debugging status:"); vty_out (vty, "EIGRP debugging status:\n");
/* Show debug status for events. */ /* Show debug status for events. */
if (IS_DEBUG_EIGRP(event,EVENT)) if (IS_DEBUG_EIGRP(event,EVENT))
vty_outln (vty, " EIGRP event debugging is on"); vty_out (vty, " EIGRP event debugging is on\n");
/* Show debug status for EIGRP Packets. */ /* Show debug status for EIGRP Packets. */
for (i = 0; i < 11 ; i++) for (i = 0; i < 11 ; i++)
@ -369,18 +365,18 @@ DEFUN (show_debugging_eigrp,
if (IS_DEBUG_EIGRP_PACKET (i, SEND) && IS_DEBUG_EIGRP_PACKET (i, RECV)) if (IS_DEBUG_EIGRP_PACKET (i, SEND) && IS_DEBUG_EIGRP_PACKET (i, RECV))
{ {
vty_outln (vty, " EIGRP packet %s%s debugging is on", vty_out (vty, " EIGRP packet %s%s debugging is on\n",
lookup_msg(eigrp_packet_type_str, i + 1, NULL), lookup_msg(eigrp_packet_type_str, i + 1, NULL),
IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : ""); IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : "");
} }
else else
{ {
if (IS_DEBUG_EIGRP_PACKET (i, SEND)) if (IS_DEBUG_EIGRP_PACKET (i, SEND))
vty_outln (vty, " EIGRP packet %s send%s debugging is on", vty_out (vty, " EIGRP packet %s send%s debugging is on\n",
lookup_msg(eigrp_packet_type_str, i + 1, NULL), lookup_msg(eigrp_packet_type_str, i + 1, NULL),
IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : ""); IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : "");
if (IS_DEBUG_EIGRP_PACKET (i, RECV)) if (IS_DEBUG_EIGRP_PACKET (i, RECV))
vty_outln (vty, " EIGRP packet %s receive%s debugging is on", vty_out (vty, " EIGRP packet %s receive%s debugging is on\n",
lookup_msg(eigrp_packet_type_str, i + 1, NULL), lookup_msg(eigrp_packet_type_str, i + 1, NULL),
IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : ""); IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : "");
} }

View File

@ -366,7 +366,7 @@ void eigrp_nbr_hard_restart(struct eigrp_neighbor *nbr, struct vty *vty)
if(vty != NULL) if(vty != NULL)
{ {
vty_time_print (vty, 0); vty_time_print (vty, 0);
vty_outln (vty, "Neighbor %s (%s) is down: manually cleared", vty_out (vty, "Neighbor %s (%s) is down: manually cleared\n",
inet_ntoa (nbr->src), inet_ntoa (nbr->src),
ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT));
} }

View File

@ -154,10 +154,10 @@ eigrp_route_match_add (struct vty *vty, struct route_map_index *index,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% Can't find rule."); vty_out (vty, "%% Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% Argument is malformed."); vty_out (vty, "%% Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -176,10 +176,10 @@ eigrp_route_match_delete (struct vty *vty, struct route_map_index *index,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% Can't find rule."); vty_out (vty, "%% Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% Argument is malformed."); vty_out (vty, "%% Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -199,7 +199,7 @@ eigrp_route_set_add (struct vty *vty, struct route_map_index *index,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% Can't find rule."); vty_out (vty, "%% Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
/* rip, ripng and other protocols share the set metric command /* rip, ripng and other protocols share the set metric command
@ -207,7 +207,7 @@ eigrp_route_set_add (struct vty *vty, struct route_map_index *index,
if metric is out of range for rip and ripng, it is not for if metric is out of range for rip and ripng, it is not for
other protocols. Do not return an error */ other protocols. Do not return an error */
if (strcmp(command, "metric")) { if (strcmp(command, "metric")) {
vty_outln (vty, "%% Argument is malformed."); vty_out (vty, "%% Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -228,10 +228,10 @@ eigrp_route_set_delete (struct vty *vty, struct route_map_index *index,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% Can't find rule."); vty_out (vty, "%% Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% Argument is malformed."); vty_out (vty, "%% Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -1124,7 +1124,7 @@ DEFUN (set_ip_nexthop,
ret = str2sockunion (argv[0], &su); ret = str2sockunion (argv[0], &su);
if (ret < 0) if (ret < 0)
{ {
vty_outln (vty, "%% Malformed next-hop address"); vty_out (vty, "%% Malformed next-hop address\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }

View File

@ -1047,7 +1047,7 @@ eigrp_update_send_GR (struct eigrp_neighbor *nbr, enum GR_type gr_type, struct v
if(vty != NULL) if(vty != NULL)
{ {
vty_time_print (vty, 0); vty_time_print (vty, 0);
vty_outln (vty, "Neighbor %s (%s) is resync: manually cleared", vty_out (vty, "Neighbor %s (%s) is resync: manually cleared\n",
inet_ntoa (nbr->src), inet_ntoa (nbr->src),
ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT));
} }

View File

@ -65,18 +65,18 @@ config_write_network (struct vty *vty, struct eigrp *eigrp)
if (rn->info) if (rn->info)
{ {
/* Network print. */ /* Network print. */
vty_outln (vty, " network %s/%d ", vty_out (vty, " network %s/%d \n",
inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen); inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen);
} }
if (eigrp->max_paths != EIGRP_MAX_PATHS_DEFAULT) if (eigrp->max_paths != EIGRP_MAX_PATHS_DEFAULT)
vty_outln (vty, " maximum-paths %d", eigrp->max_paths); vty_out (vty, " maximum-paths %d\n", eigrp->max_paths);
if (eigrp->variance != EIGRP_VARIANCE_DEFAULT) if (eigrp->variance != EIGRP_VARIANCE_DEFAULT)
vty_outln (vty, " variance %d", eigrp->variance); vty_out (vty, " variance %d\n", eigrp->variance);
/*Separate EIGRP configuration from the rest of the config*/ /*Separate EIGRP configuration from the rest of the config*/
vty_outln (vty, "!"); vty_out (vty, "!\n");
return 0; return 0;
} }
@ -89,39 +89,39 @@ config_write_interfaces (struct vty *vty, struct eigrp *eigrp)
for (ALL_LIST_ELEMENTS_RO (eigrp->eiflist, node, ei)) for (ALL_LIST_ELEMENTS_RO (eigrp->eiflist, node, ei))
{ {
vty_outln (vty, "interface %s", ei->ifp->name); vty_out (vty, "interface %s\n", ei->ifp->name);
if ((IF_DEF_PARAMS (ei->ifp)->auth_type) == EIGRP_AUTH_TYPE_MD5) if ((IF_DEF_PARAMS (ei->ifp)->auth_type) == EIGRP_AUTH_TYPE_MD5)
{ {
vty_outln (vty, " ip authentication mode eigrp %d md5", eigrp->AS); vty_out (vty, " ip authentication mode eigrp %d md5\n", eigrp->AS);
} }
if ((IF_DEF_PARAMS (ei->ifp)->auth_type) == EIGRP_AUTH_TYPE_SHA256) if ((IF_DEF_PARAMS (ei->ifp)->auth_type) == EIGRP_AUTH_TYPE_SHA256)
{ {
vty_outln (vty, " ip authentication mode eigrp %d hmac-sha-256", vty_out (vty, " ip authentication mode eigrp %d hmac-sha-256\n",
eigrp->AS); eigrp->AS);
} }
if(IF_DEF_PARAMS (ei->ifp)->auth_keychain) if(IF_DEF_PARAMS (ei->ifp)->auth_keychain)
{ {
vty_outln (vty, " ip authentication key-chain eigrp %d %s",eigrp->AS, vty_out (vty, " ip authentication key-chain eigrp %d %s\n",eigrp->AS,
IF_DEF_PARAMS(ei->ifp)->auth_keychain); IF_DEF_PARAMS(ei->ifp)->auth_keychain);
} }
if ((IF_DEF_PARAMS (ei->ifp)->v_hello) != EIGRP_HELLO_INTERVAL_DEFAULT) if ((IF_DEF_PARAMS (ei->ifp)->v_hello) != EIGRP_HELLO_INTERVAL_DEFAULT)
{ {
vty_outln (vty, " ip hello-interval eigrp %d", vty_out (vty, " ip hello-interval eigrp %d\n",
IF_DEF_PARAMS(ei->ifp)->v_hello); IF_DEF_PARAMS(ei->ifp)->v_hello);
} }
if ((IF_DEF_PARAMS (ei->ifp)->v_wait) != EIGRP_HOLD_INTERVAL_DEFAULT) if ((IF_DEF_PARAMS (ei->ifp)->v_wait) != EIGRP_HOLD_INTERVAL_DEFAULT)
{ {
vty_outln (vty, " ip hold-time eigrp %d", vty_out (vty, " ip hold-time eigrp %d\n",
IF_DEF_PARAMS(ei->ifp)->v_wait); IF_DEF_PARAMS(ei->ifp)->v_wait);
} }
/*Separate this EIGRP interface configuration from the others*/ /*Separate this EIGRP interface configuration from the others*/
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
return 0; return 0;
@ -134,23 +134,23 @@ eigrp_write_interface (struct vty *vty)
struct interface *ifp; struct interface *ifp;
for (ALL_LIST_ELEMENTS_RO (vrf_iflist(VRF_DEFAULT), node, ifp)) { for (ALL_LIST_ELEMENTS_RO (vrf_iflist(VRF_DEFAULT), node, ifp)) {
vty_outln (vty, "interface %s",ifp->name); vty_out (vty, "interface %s\n",ifp->name);
if (ifp->desc) if (ifp->desc)
vty_outln (vty, " description %s",ifp->desc); vty_out (vty, " description %s\n",ifp->desc);
if (IF_DEF_PARAMS (ifp)->bandwidth != EIGRP_BANDWIDTH_DEFAULT) if (IF_DEF_PARAMS (ifp)->bandwidth != EIGRP_BANDWIDTH_DEFAULT)
vty_outln (vty, " bandwidth %u",IF_DEF_PARAMS(ifp)->bandwidth); vty_out (vty, " bandwidth %u\n",IF_DEF_PARAMS(ifp)->bandwidth);
if (IF_DEF_PARAMS (ifp)->delay != EIGRP_DELAY_DEFAULT) if (IF_DEF_PARAMS (ifp)->delay != EIGRP_DELAY_DEFAULT)
vty_outln (vty, " delay %u", IF_DEF_PARAMS(ifp)->delay); vty_out (vty, " delay %u\n", IF_DEF_PARAMS(ifp)->delay);
if (IF_DEF_PARAMS (ifp)->v_hello != EIGRP_HELLO_INTERVAL_DEFAULT) if (IF_DEF_PARAMS (ifp)->v_hello != EIGRP_HELLO_INTERVAL_DEFAULT)
vty_outln (vty, " ip hello-interval eigrp %u", vty_out (vty, " ip hello-interval eigrp %u\n",
IF_DEF_PARAMS(ifp)->v_hello); IF_DEF_PARAMS(ifp)->v_hello);
if (IF_DEF_PARAMS (ifp)->v_wait != EIGRP_HOLD_INTERVAL_DEFAULT) if (IF_DEF_PARAMS (ifp)->v_wait != EIGRP_HOLD_INTERVAL_DEFAULT)
vty_outln (vty, " ip hold-time eigrp %u", vty_out (vty, " ip hold-time eigrp %u\n",
IF_DEF_PARAMS(ifp)->v_wait); IF_DEF_PARAMS(ifp)->v_wait);
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
return 0; return 0;
@ -179,7 +179,7 @@ config_write_eigrp_router (struct vty *vty, struct eigrp *eigrp)
int write=0; int write=0;
/* `router eigrp' print. */ /* `router eigrp' print. */
vty_outln (vty, "router eigrp %d", eigrp->AS); vty_out (vty, "router eigrp %d\n", eigrp->AS);
write++; write++;
@ -191,7 +191,7 @@ config_write_eigrp_router (struct vty *vty, struct eigrp *eigrp)
{ {
struct in_addr router_id_static; struct in_addr router_id_static;
router_id_static.s_addr = htonl(eigrp->router_id_static); router_id_static.s_addr = htonl(eigrp->router_id_static);
vty_outln (vty, " eigrp router-id %s", vty_out (vty, " eigrp router-id %s\n",
inet_ntoa(router_id_static)); inet_ntoa(router_id_static));
} }
@ -202,7 +202,7 @@ config_write_eigrp_router (struct vty *vty, struct eigrp *eigrp)
config_write_eigrp_distribute (vty, eigrp); config_write_eigrp_distribute (vty, eigrp);
/*Separate EIGRP configuration from the rest of the config*/ /*Separate EIGRP configuration from the rest of the config*/
vty_outln (vty, "!"); vty_out (vty, "!\n");
return write; return write;
} }
@ -235,7 +235,7 @@ DEFUN (no_router_eigrp,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp->AS != atoi (argv[3]->arg)) if (eigrp->AS != atoi (argv[3]->arg))
{ {
vty_outln (vty,"%% Attempting to deconfigure non-existent AS"); vty_out (vty,"%% Attempting to deconfigure non-existent AS\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -393,7 +393,7 @@ DEFUN (eigrp_network,
if (ret == 0) if (ret == 0)
{ {
vty_outln (vty, "There is already same network statement."); vty_out (vty, "There is already same network statement.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -417,7 +417,7 @@ DEFUN (no_eigrp_network,
if (ret == 0) if (ret == 0)
{ {
vty_outln (vty,"Can't find specified network configuration."); vty_out (vty,"Can't find specified network configuration.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -465,7 +465,7 @@ DEFUN (show_ip_eigrp_topology,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -521,7 +521,7 @@ DEFUN (show_ip_eigrp_interfaces,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, "EIGRP Routing Process not enabled"); vty_out (vty, "EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -568,7 +568,7 @@ DEFUN (show_ip_eigrp_neighbors,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -607,7 +607,7 @@ DEFUN (eigrp_if_delay,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -633,7 +633,7 @@ DEFUN (no_eigrp_if_delay,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -658,7 +658,7 @@ DEFUN (eigrp_if_bandwidth,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -684,7 +684,7 @@ DEFUN (no_eigrp_if_bandwidth,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -709,7 +709,7 @@ DEFUN (eigrp_if_ip_hellointerval,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -737,7 +737,7 @@ DEFUN (no_eigrp_if_ip_hellointerval,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -771,7 +771,7 @@ DEFUN (eigrp_if_ip_holdinterval,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -798,7 +798,7 @@ DEFUN (eigrp_ip_summary_address,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -826,7 +826,7 @@ DEFUN (no_eigrp_ip_summary_address,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -852,7 +852,7 @@ DEFUN (no_eigrp_if_ip_holdinterval,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -899,7 +899,7 @@ DEFUN (eigrp_authentication_mode,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -929,7 +929,7 @@ DEFUN (no_eigrp_authentication_mode,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -955,7 +955,7 @@ DEFUN (eigrp_authentication_keychain,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, "EIGRP Routing Process not enabled"); vty_out (vty, "EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -971,7 +971,7 @@ DEFUN (eigrp_authentication_keychain,
IF_DEF_PARAMS (ifp)->auth_keychain = strdup(keychain->name); IF_DEF_PARAMS (ifp)->auth_keychain = strdup(keychain->name);
} }
else else
vty_outln (vty,"Key chain with specified name not found"); vty_out (vty,"Key chain with specified name not found\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -993,7 +993,7 @@ DEFUN (no_eigrp_authentication_keychain,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, "EIGRP Routing Process not enabled"); vty_out (vty, "EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1004,8 +1004,8 @@ DEFUN (no_eigrp_authentication_keychain,
IF_DEF_PARAMS (ifp)->auth_keychain = NULL; IF_DEF_PARAMS (ifp)->auth_keychain = NULL;
} }
else else
vty_outln (vty, vty_out (vty,
"Key chain with specified name not configured on interface"); "Key chain with specified name not configured on interface\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1080,7 +1080,7 @@ DEFUN (eigrp_variance,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, "EIGRP Routing Process not enabled"); vty_out (vty, "EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
variance = atoi(argv[1]->arg); variance = atoi(argv[1]->arg);
@ -1103,7 +1103,7 @@ DEFUN (no_eigrp_variance,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, "EIGRP Routing Process not enabled"); vty_out (vty, "EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1126,7 +1126,7 @@ DEFUN (eigrp_maximum_paths,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, "EIGRP Routing Process not enabled"); vty_out (vty, "EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1151,7 +1151,7 @@ DEFUN (no_eigrp_maximum_paths,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, "EIGRP Routing Process not enabled"); vty_out (vty, "EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1182,7 +1182,7 @@ DEFUN (clear_ip_eigrp_neighbors,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1201,7 +1201,7 @@ DEFUN (clear_ip_eigrp_neighbors,
inet_ntoa (nbr->src), inet_ntoa (nbr->src),
ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT)); ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT));
vty_time_print (vty, 0); vty_time_print (vty, 0);
vty_outln (vty, "Neighbor %s (%s) is down: manually cleared", vty_out (vty, "Neighbor %s (%s) is down: manually cleared\n",
inet_ntoa (nbr->src), inet_ntoa (nbr->src),
ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT));
@ -1238,7 +1238,7 @@ DEFUN (clear_ip_eigrp_neighbors_int,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1247,7 +1247,7 @@ DEFUN (clear_ip_eigrp_neighbors_int,
ei = eigrp_if_lookup_by_name(eigrp, argv[idx]->arg); ei = eigrp_if_lookup_by_name(eigrp, argv[idx]->arg);
if(ei == NULL) if(ei == NULL)
{ {
vty_outln (vty, " Interface (%s) doesn't exist", argv[idx]->arg); vty_out (vty, " Interface (%s) doesn't exist\n", argv[idx]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -1263,7 +1263,7 @@ DEFUN (clear_ip_eigrp_neighbors_int,
inet_ntoa (nbr->src), inet_ntoa (nbr->src),
ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT)); ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT));
vty_time_print (vty, 0); vty_time_print (vty, 0);
vty_outln (vty, "Neighbor %s (%s) is down: manually cleared", vty_out (vty, "Neighbor %s (%s) is down: manually cleared\n",
inet_ntoa (nbr->src), inet_ntoa (nbr->src),
ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT));
@ -1299,7 +1299,7 @@ DEFUN (clear_ip_eigrp_neighbors_IP,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1309,7 +1309,7 @@ DEFUN (clear_ip_eigrp_neighbors_IP,
/* if neighbor doesn't exists, notify user and exit */ /* if neighbor doesn't exists, notify user and exit */
if(nbr == NULL) if(nbr == NULL)
{ {
vty_outln (vty, "Neighbor with entered address doesn't exists."); vty_out (vty, "Neighbor with entered address doesn't exists.\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1337,7 +1337,7 @@ DEFUN (clear_ip_eigrp_neighbors_soft,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1367,7 +1367,7 @@ DEFUN (clear_ip_eigrp_neighbors_int_soft,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1375,7 +1375,7 @@ DEFUN (clear_ip_eigrp_neighbors_int_soft,
ei = eigrp_if_lookup_by_name(eigrp, argv[4]->arg); ei = eigrp_if_lookup_by_name(eigrp, argv[4]->arg);
if(ei == NULL) if(ei == NULL)
{ {
vty_outln (vty, " Interface (%s) doesn't exist", argv[4]->arg); vty_out (vty, " Interface (%s) doesn't exist\n", argv[4]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -1407,7 +1407,7 @@ DEFUN (clear_ip_eigrp_neighbors_IP_soft,
eigrp = eigrp_lookup (); eigrp = eigrp_lookup ();
if (eigrp == NULL) if (eigrp == NULL)
{ {
vty_outln (vty, " EIGRP Routing Process not enabled"); vty_out (vty, " EIGRP Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1417,7 +1417,7 @@ DEFUN (clear_ip_eigrp_neighbors_IP_soft,
/* if neighbor doesn't exists, notify user and exit */ /* if neighbor doesn't exists, notify user and exit */
if(nbr == NULL) if(nbr == NULL)
{ {
vty_outln (vty, "Neighbor with entered address doesn't exists."); vty_out (vty, "Neighbor with entered address doesn't exists.\n");
return CMD_WARNING; return CMD_WARNING;
} }

View File

@ -402,13 +402,13 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail)
else else
vty_out (vty, "- "); vty_out (vty, "- ");
vty_out (vty, "%-10s", snpa_print (adj->snpa)); vty_out (vty, "%-10s", snpa_print (adj->snpa));
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (detail == ISIS_UI_LEVEL_DETAIL) if (detail == ISIS_UI_LEVEL_DETAIL)
{ {
level = adj->level; level = adj->level;
vty_out (vty, VTYNL); vty_out (vty, "\n");
if (adj->circuit) if (adj->circuit)
vty_out (vty, " Interface: %s", adj->circuit->interface->name); vty_out (vty, " Interface: %s", adj->circuit->interface->name);
else else
@ -421,18 +421,18 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail)
time2string (adj->last_upd + adj->hold_time - now)); time2string (adj->last_upd + adj->hold_time - now));
else else
vty_out (vty, ", Expires in %s", time2string (adj->hold_time)); vty_out (vty, ", Expires in %s", time2string (adj->hold_time));
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, " Adjacency flaps: %u", adj->flaps); vty_out (vty, " Adjacency flaps: %u", adj->flaps);
vty_out (vty, ", Last: %s ago", time2string (now - adj->last_flap)); vty_out (vty, ", Last: %s ago", time2string (now - adj->last_flap));
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, " Circuit type: %s", circuit_t2string (adj->circuit_t)); vty_out (vty, " Circuit type: %s", circuit_t2string (adj->circuit_t));
vty_out (vty, ", Speaks: %s", nlpid2string (&adj->nlpids)); vty_out (vty, ", Speaks: %s", nlpid2string (&adj->nlpids));
vty_out (vty, VTYNL); vty_out (vty, "\n");
if (adj->mt_count != 1 || adj->mt_set[0] != ISIS_MT_IPV4_UNICAST) if (adj->mt_count != 1 || adj->mt_set[0] != ISIS_MT_IPV4_UNICAST)
{ {
vty_outln (vty, " Topologies:"); vty_out (vty, " Topologies:\n");
for (unsigned int i = 0; i < adj->mt_count; i++) for (unsigned int i = 0; i < adj->mt_count; i++)
vty_outln (vty, " %s", isis_mtid2str(adj->mt_set[i])); vty_out (vty, " %s\n", isis_mtid2str(adj->mt_set[i]));
} }
vty_out (vty, " SNPA: %s", snpa_print (adj->snpa)); vty_out (vty, " SNPA: %s", snpa_print (adj->snpa));
if (adj->circuit && (adj->circuit->circ_type == CIRCUIT_T_BROADCAST)) if (adj->circuit && (adj->circuit->circ_type == CIRCUIT_T_BROADCAST))
@ -445,7 +445,7 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail)
vty_out (vty, ", LAN id: %s.%02x", vty_out (vty, ", LAN id: %s.%02x",
sysid_print (adj->lanid), adj->lanid[ISIS_SYS_ID_LEN]); sysid_print (adj->lanid), adj->lanid[ISIS_SYS_ID_LEN]);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, " LAN Priority: %u", adj->prio[adj->level - 1]); vty_out (vty, " LAN Priority: %u", adj->prio[adj->level - 1]);
vty_out (vty, ", %s, DIS flaps: %u, Last: %s ago", vty_out (vty, ", %s, DIS flaps: %u, Last: %s ago",
@ -455,32 +455,32 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail)
(adj->dis_record[ISIS_LEVELS + level - 1]. (adj->dis_record[ISIS_LEVELS + level - 1].
last_dis_change))); last_dis_change)));
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
if (adj->area_addrs && listcount (adj->area_addrs) > 0) if (adj->area_addrs && listcount (adj->area_addrs) > 0)
{ {
struct area_addr *area_addr; struct area_addr *area_addr;
vty_outln (vty, " Area Address(es):"); vty_out (vty, " Area Address(es):\n");
for (ALL_LIST_ELEMENTS_RO (adj->area_addrs, node, area_addr)) for (ALL_LIST_ELEMENTS_RO (adj->area_addrs, node, area_addr))
vty_outln (vty, " %s", vty_out (vty, " %s\n",
isonet_print(area_addr->area_addr, area_addr->addr_len)); isonet_print(area_addr->area_addr, area_addr->addr_len));
} }
if (adj->ipv4_addrs && listcount (adj->ipv4_addrs) > 0) if (adj->ipv4_addrs && listcount (adj->ipv4_addrs) > 0)
{ {
vty_outln (vty, " IPv4 Address(es):"); vty_out (vty, " IPv4 Address(es):\n");
for (ALL_LIST_ELEMENTS_RO (adj->ipv4_addrs, node, ip_addr)) for (ALL_LIST_ELEMENTS_RO (adj->ipv4_addrs, node, ip_addr))
vty_outln (vty, " %s", inet_ntoa(*ip_addr)); vty_out (vty, " %s\n", inet_ntoa(*ip_addr));
} }
if (adj->ipv6_addrs && listcount (adj->ipv6_addrs) > 0) if (adj->ipv6_addrs && listcount (adj->ipv6_addrs) > 0)
{ {
vty_outln (vty, " IPv6 Address(es):"); vty_out (vty, " IPv6 Address(es):\n");
for (ALL_LIST_ELEMENTS_RO (adj->ipv6_addrs, node, ipv6_addr)) for (ALL_LIST_ELEMENTS_RO (adj->ipv6_addrs, node, ipv6_addr))
{ {
inet_ntop (AF_INET6, ipv6_addr, (char *)ip6, INET6_ADDRSTRLEN); inet_ntop (AF_INET6, ipv6_addr, (char *)ip6, INET6_ADDRSTRLEN);
vty_outln (vty, " %s", ip6); vty_out (vty, " %s\n", ip6);
} }
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
return; return;
} }

View File

@ -878,7 +878,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty,
vty_out (vty, "%-9s", circuit_state2string (circuit->state)); vty_out (vty, "%-9s", circuit_state2string (circuit->state));
vty_out (vty, "%-9s", circuit_type2string (circuit->circ_type)); vty_out (vty, "%-9s", circuit_type2string (circuit->circ_type));
vty_out (vty, "%-9s", circuit_t2string (circuit->is_type)); vty_out (vty, "%-9s", circuit_t2string (circuit->is_type));
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (detail == ISIS_UI_LEVEL_DETAIL) if (detail == ISIS_UI_LEVEL_DETAIL)
@ -894,15 +894,15 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty,
else else
vty_out (vty, ", Active"); vty_out (vty, ", Active");
vty_out (vty, ", Circuit Id: 0x%x", circuit->circuit_id); vty_out (vty, ", Circuit Id: 0x%x", circuit->circuit_id);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, " Type: %s", circuit_type2string (circuit->circ_type)); vty_out (vty, " Type: %s", circuit_type2string (circuit->circ_type));
vty_out (vty, ", Level: %s", circuit_t2string (circuit->is_type)); vty_out (vty, ", Level: %s", circuit_t2string (circuit->is_type));
if (circuit->circ_type == CIRCUIT_T_BROADCAST) if (circuit->circ_type == CIRCUIT_T_BROADCAST)
vty_out (vty, ", SNPA: %-10s", snpa_print (circuit->u.bc.snpa)); vty_out (vty, ", SNPA: %-10s", snpa_print (circuit->u.bc.snpa));
vty_out (vty, VTYNL); vty_out (vty, "\n");
if (circuit->is_type & IS_LEVEL_1) if (circuit->is_type & IS_LEVEL_1)
{ {
vty_outln (vty, " Level-1 Information:"); vty_out (vty, " Level-1 Information:\n");
if (circuit->area->newmetric) if (circuit->area->newmetric)
vty_out (vty, " Metric: %d", circuit->te_metric[0]); vty_out (vty, " Metric: %d", circuit->te_metric[0]);
else else
@ -910,30 +910,30 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty,
circuit->metric[0]); circuit->metric[0]);
if (!circuit->is_passive) if (!circuit->is_passive)
{ {
vty_outln (vty, ", Active neighbors: %u", vty_out (vty, ", Active neighbors: %u\n",
circuit->upadjcount[0]); circuit->upadjcount[0]);
vty_outln (vty, " Hello interval: %u, " vty_out (vty, " Hello interval: %u, "
"Holddown count: %u %s", "Holddown count: %u %s\n",
circuit->hello_interval[0], circuit->hello_interval[0],
circuit->hello_multiplier[0], circuit->hello_multiplier[0],
(circuit->pad_hellos ? "(pad)" : "(no-pad)")); (circuit->pad_hellos ? "(pad)" : "(no-pad)"));
vty_outln (vty, " CNSP interval: %u, " vty_out (vty, " CNSP interval: %u, "
"PSNP interval: %u", "PSNP interval: %u\n",
circuit->csnp_interval[0], circuit->csnp_interval[0],
circuit->psnp_interval[0]); circuit->psnp_interval[0]);
if (circuit->circ_type == CIRCUIT_T_BROADCAST) if (circuit->circ_type == CIRCUIT_T_BROADCAST)
vty_outln (vty, " LAN Priority: %u, %s", vty_out (vty, " LAN Priority: %u, %s\n",
circuit->priority[0], circuit->priority[0],
(circuit->u.bc.is_dr[0] ? "is DIS" : "is not DIS")); (circuit->u.bc.is_dr[0] ? "is DIS" : "is not DIS"));
} }
else else
{ {
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
if (circuit->is_type & IS_LEVEL_2) if (circuit->is_type & IS_LEVEL_2)
{ {
vty_outln (vty, " Level-2 Information:"); vty_out (vty, " Level-2 Information:\n");
if (circuit->area->newmetric) if (circuit->area->newmetric)
vty_out (vty, " Metric: %d", circuit->te_metric[1]); vty_out (vty, " Metric: %d", circuit->te_metric[1]);
else else
@ -941,56 +941,56 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty,
circuit->metric[1]); circuit->metric[1]);
if (!circuit->is_passive) if (!circuit->is_passive)
{ {
vty_outln (vty, ", Active neighbors: %u", vty_out (vty, ", Active neighbors: %u\n",
circuit->upadjcount[1]); circuit->upadjcount[1]);
vty_outln (vty, " Hello interval: %u, " vty_out (vty, " Hello interval: %u, "
"Holddown count: %u %s", "Holddown count: %u %s\n",
circuit->hello_interval[1], circuit->hello_interval[1],
circuit->hello_multiplier[1], circuit->hello_multiplier[1],
(circuit->pad_hellos ? "(pad)" : "(no-pad)")); (circuit->pad_hellos ? "(pad)" : "(no-pad)"));
vty_outln (vty, " CNSP interval: %u, " vty_out (vty, " CNSP interval: %u, "
"PSNP interval: %u", "PSNP interval: %u\n",
circuit->csnp_interval[1], circuit->csnp_interval[1],
circuit->psnp_interval[1]); circuit->psnp_interval[1]);
if (circuit->circ_type == CIRCUIT_T_BROADCAST) if (circuit->circ_type == CIRCUIT_T_BROADCAST)
vty_outln (vty, " LAN Priority: %u, %s", vty_out (vty, " LAN Priority: %u, %s\n",
circuit->priority[1], circuit->priority[1],
(circuit->u.bc.is_dr[1] ? "is DIS" : "is not DIS")); (circuit->u.bc.is_dr[1] ? "is DIS" : "is not DIS"));
} }
else else
{ {
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
if (circuit->ip_addrs && listcount (circuit->ip_addrs) > 0) if (circuit->ip_addrs && listcount (circuit->ip_addrs) > 0)
{ {
vty_outln (vty, " IP Prefix(es):"); vty_out (vty, " IP Prefix(es):\n");
for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip_addr)) for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip_addr))
{ {
prefix2str (ip_addr, buf, sizeof (buf)), prefix2str (ip_addr, buf, sizeof (buf)),
vty_outln (vty, " %s", buf); vty_out (vty, " %s\n", buf);
} }
} }
if (circuit->ipv6_link && listcount(circuit->ipv6_link) > 0) if (circuit->ipv6_link && listcount(circuit->ipv6_link) > 0)
{ {
vty_outln (vty, " IPv6 Link-Locals:"); vty_out (vty, " IPv6 Link-Locals:\n");
for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node, ip_addr)) for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node, ip_addr))
{ {
prefix2str(ip_addr, (char*)buf, BUFSIZ), prefix2str(ip_addr, (char*)buf, BUFSIZ),
vty_outln (vty, " %s", buf); vty_out (vty, " %s\n", buf);
} }
} }
if (circuit->ipv6_non_link && listcount(circuit->ipv6_non_link) > 0) if (circuit->ipv6_non_link && listcount(circuit->ipv6_non_link) > 0)
{ {
vty_outln (vty, " IPv6 Prefixes:"); vty_out (vty, " IPv6 Prefixes:\n");
for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node, ip_addr)) for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node, ip_addr))
{ {
prefix2str(ip_addr, (char*)buf, BUFSIZ), prefix2str(ip_addr, (char*)buf, BUFSIZ),
vty_outln (vty, " %s", buf); vty_out (vty, " %s\n", buf);
} }
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
return; return;
} }
@ -1011,12 +1011,12 @@ isis_interface_config_write (struct vty *vty)
continue; continue;
/* IF name */ /* IF name */
vty_outln (vty, "interface %s", ifp->name); vty_out (vty, "interface %s\n", ifp->name);
write++; write++;
/* IF desc */ /* IF desc */
if (ifp->desc) if (ifp->desc)
{ {
vty_outln (vty, " description %s", ifp->desc); vty_out (vty, " description %s\n", ifp->desc);
write++; write++;
} }
/* ISIS Circuit */ /* ISIS Circuit */
@ -1027,36 +1027,36 @@ isis_interface_config_write (struct vty *vty)
continue; continue;
if (circuit->ip_router) if (circuit->ip_router)
{ {
vty_outln (vty, " ip router isis %s",area->area_tag); vty_out (vty, " ip router isis %s\n",area->area_tag);
write++; write++;
} }
if (circuit->is_passive) if (circuit->is_passive)
{ {
vty_outln (vty, " isis passive"); vty_out (vty, " isis passive\n");
write++; write++;
} }
if (circuit->circ_type_config == CIRCUIT_T_P2P) if (circuit->circ_type_config == CIRCUIT_T_P2P)
{ {
vty_outln (vty, " isis network point-to-point"); vty_out (vty, " isis network point-to-point\n");
write++; write++;
} }
if (circuit->ipv6_router) if (circuit->ipv6_router)
{ {
vty_outln (vty, " ipv6 router isis %s",area->area_tag); vty_out (vty, " ipv6 router isis %s\n",area->area_tag);
write++; write++;
} }
/* ISIS - circuit type */ /* ISIS - circuit type */
if (circuit->is_type == IS_LEVEL_1) if (circuit->is_type == IS_LEVEL_1)
{ {
vty_outln (vty, " isis circuit-type level-1"); vty_out (vty, " isis circuit-type level-1\n");
write++; write++;
} }
else else
{ {
if (circuit->is_type == IS_LEVEL_2) if (circuit->is_type == IS_LEVEL_2)
{ {
vty_outln (vty," isis circuit-type level-2-only"); vty_out (vty," isis circuit-type level-2-only\n");
write++; write++;
} }
} }
@ -1066,7 +1066,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->csnp_interval[0] != DEFAULT_CSNP_INTERVAL) if (circuit->csnp_interval[0] != DEFAULT_CSNP_INTERVAL)
{ {
vty_outln (vty, " isis csnp-interval %d", vty_out (vty, " isis csnp-interval %d\n",
circuit->csnp_interval[0]); circuit->csnp_interval[0]);
write++; write++;
} }
@ -1077,7 +1077,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->csnp_interval[i] != DEFAULT_CSNP_INTERVAL) if (circuit->csnp_interval[i] != DEFAULT_CSNP_INTERVAL)
{ {
vty_outln (vty, " isis csnp-interval %d level-%d", vty_out (vty, " isis csnp-interval %d level-%d\n",
circuit->csnp_interval[i], i + 1); circuit->csnp_interval[i], i + 1);
write++; write++;
} }
@ -1089,7 +1089,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->psnp_interval[0] != DEFAULT_PSNP_INTERVAL) if (circuit->psnp_interval[0] != DEFAULT_PSNP_INTERVAL)
{ {
vty_outln (vty, " isis psnp-interval %d", vty_out (vty, " isis psnp-interval %d\n",
circuit->psnp_interval[0]); circuit->psnp_interval[0]);
write++; write++;
} }
@ -1100,7 +1100,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->psnp_interval[i] != DEFAULT_PSNP_INTERVAL) if (circuit->psnp_interval[i] != DEFAULT_PSNP_INTERVAL)
{ {
vty_outln (vty, " isis psnp-interval %d level-%d", vty_out (vty, " isis psnp-interval %d level-%d\n",
circuit->psnp_interval[i], i + 1); circuit->psnp_interval[i], i + 1);
write++; write++;
} }
@ -1110,7 +1110,7 @@ isis_interface_config_write (struct vty *vty)
/* ISIS - Hello padding - Defaults to true so only display if false */ /* ISIS - Hello padding - Defaults to true so only display if false */
if (circuit->pad_hellos == 0) if (circuit->pad_hellos == 0)
{ {
vty_outln (vty, " no isis hello padding"); vty_out (vty, " no isis hello padding\n");
write++; write++;
} }
@ -1119,7 +1119,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->hello_interval[0] != DEFAULT_HELLO_INTERVAL) if (circuit->hello_interval[0] != DEFAULT_HELLO_INTERVAL)
{ {
vty_outln (vty, " isis hello-interval %d", vty_out (vty, " isis hello-interval %d\n",
circuit->hello_interval[0]); circuit->hello_interval[0]);
write++; write++;
} }
@ -1130,7 +1130,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->hello_interval[i] != DEFAULT_HELLO_INTERVAL) if (circuit->hello_interval[i] != DEFAULT_HELLO_INTERVAL)
{ {
vty_outln (vty, " isis hello-interval %d level-%d", vty_out (vty, " isis hello-interval %d level-%d\n",
circuit->hello_interval[i], i + 1); circuit->hello_interval[i], i + 1);
write++; write++;
} }
@ -1142,7 +1142,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->hello_multiplier[0] != DEFAULT_HELLO_MULTIPLIER) if (circuit->hello_multiplier[0] != DEFAULT_HELLO_MULTIPLIER)
{ {
vty_outln (vty, " isis hello-multiplier %d", vty_out (vty, " isis hello-multiplier %d\n",
circuit->hello_multiplier[0]); circuit->hello_multiplier[0]);
write++; write++;
} }
@ -1153,7 +1153,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->hello_multiplier[i] != DEFAULT_HELLO_MULTIPLIER) if (circuit->hello_multiplier[i] != DEFAULT_HELLO_MULTIPLIER)
{ {
vty_outln (vty, " isis hello-multiplier %d level-%d", vty_out (vty, " isis hello-multiplier %d level-%d\n",
circuit->hello_multiplier[i],i + 1); circuit->hello_multiplier[i],i + 1);
write++; write++;
} }
@ -1165,7 +1165,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->priority[0] != DEFAULT_PRIORITY) if (circuit->priority[0] != DEFAULT_PRIORITY)
{ {
vty_outln (vty, " isis priority %d", vty_out (vty, " isis priority %d\n",
circuit->priority[0]); circuit->priority[0]);
write++; write++;
} }
@ -1176,7 +1176,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->priority[i] != DEFAULT_PRIORITY) if (circuit->priority[i] != DEFAULT_PRIORITY)
{ {
vty_outln (vty, " isis priority %d level-%d", vty_out (vty, " isis priority %d level-%d\n",
circuit->priority[i], i + 1); circuit->priority[i], i + 1);
write++; write++;
} }
@ -1188,7 +1188,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->te_metric[0] != DEFAULT_CIRCUIT_METRIC) if (circuit->te_metric[0] != DEFAULT_CIRCUIT_METRIC)
{ {
vty_outln (vty, " isis metric %d",circuit->te_metric[0]); vty_out (vty, " isis metric %d\n",circuit->te_metric[0]);
write++; write++;
} }
} }
@ -1198,7 +1198,7 @@ isis_interface_config_write (struct vty *vty)
{ {
if (circuit->te_metric[i] != DEFAULT_CIRCUIT_METRIC) if (circuit->te_metric[i] != DEFAULT_CIRCUIT_METRIC)
{ {
vty_outln (vty, " isis metric %d level-%d", vty_out (vty, " isis metric %d level-%d\n",
circuit->te_metric[i], i + 1); circuit->te_metric[i], i + 1);
write++; write++;
} }
@ -1206,19 +1206,19 @@ isis_interface_config_write (struct vty *vty)
} }
if (circuit->passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5) if (circuit->passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5)
{ {
vty_outln (vty, " isis password md5 %s", vty_out (vty, " isis password md5 %s\n",
circuit->passwd.passwd); circuit->passwd.passwd);
write++; write++;
} }
else if (circuit->passwd.type == ISIS_PASSWD_TYPE_CLEARTXT) else if (circuit->passwd.type == ISIS_PASSWD_TYPE_CLEARTXT)
{ {
vty_outln (vty, " isis password clear %s", vty_out (vty, " isis password clear %s\n",
circuit->passwd.passwd); circuit->passwd.passwd);
write++; write++;
} }
write += circuit_write_mt_settings(circuit, vty); write += circuit_write_mt_settings(circuit, vty);
} }
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
return write; return write;

View File

@ -159,13 +159,13 @@ dynhn_print_all (struct vty *vty)
struct listnode *node; struct listnode *node;
struct isis_dynhn *dyn; struct isis_dynhn *dyn;
vty_outln (vty, "Level System ID Dynamic Hostname"); vty_out (vty, "Level System ID Dynamic Hostname\n");
for (ALL_LIST_ELEMENTS_RO (dyn_cache, node, dyn)) for (ALL_LIST_ELEMENTS_RO (dyn_cache, node, dyn))
{ {
vty_out (vty, "%-7d", dyn->level); vty_out (vty, "%-7d", dyn->level);
vty_outln (vty, "%-15s%-15s", sysid_print (dyn->id),dyn->name.name); vty_out (vty, "%-15s%-15s\n", sysid_print (dyn->id),dyn->name.name);
} }
vty_outln (vty, " * %s %s", sysid_print (isis->sysid),unix_hostname()); vty_out (vty, " * %s %s\n", sysid_print (isis->sysid),unix_hostname());
return; return;
} }

View File

@ -824,7 +824,7 @@ lsp_print (struct isis_lsp *lsp, struct vty *vty, char dynhost)
} }
else else
vty_out (vty, " %5u ", ntohs (lsp->lsp_header->rem_lifetime)); vty_out (vty, " %5u ", ntohs (lsp->lsp_header->rem_lifetime));
vty_outln (vty, "%s", vty_out (vty, "%s\n",
lsp_bits2string(&lsp->lsp_header->lsp_bits)); lsp_bits2string(&lsp->lsp_header->lsp_bits));
} }
@ -842,12 +842,12 @@ lsp_print_mt_reach(struct list *list, struct vty *vty,
lspid_print(neigh->neigh_id, lspid, dynhost, 0); lspid_print(neigh->neigh_id, lspid, dynhost, 0);
if (mtid == ISIS_MT_IPV4_UNICAST) if (mtid == ISIS_MT_IPV4_UNICAST)
{ {
vty_outln(vty, " Metric : %-8u IS-Extended : %s", vty_out(vty, " Metric : %-8u IS-Extended : %s\n",
GET_TE_METRIC(neigh), lspid); GET_TE_METRIC(neigh), lspid);
} }
else else
{ {
vty_outln(vty, " Metric : %-8u MT-Reach : %s %s", vty_out(vty, " Metric : %-8u MT-Reach : %s %s\n",
GET_TE_METRIC(neigh), lspid, GET_TE_METRIC(neigh), lspid,
isis_mtid2str(mtid)); isis_mtid2str(mtid));
} }
@ -874,11 +874,11 @@ lsp_print_mt_ipv6_reach(struct list *list, struct vty *vty, uint16_t mtid)
{ {
if ((ipv6_reach->control_info & if ((ipv6_reach->control_info &
CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL) CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL)
vty_outln (vty, " Metric : %-8" PRIu32 " IPv6-Internal : %s/%d", vty_out (vty, " Metric : %-8" PRIu32 " IPv6-Internal : %s/%d\n",
ntohl (ipv6_reach->metric), ntohl (ipv6_reach->metric),
buff, ipv6_reach->prefix_len); buff, ipv6_reach->prefix_len);
else else
vty_outln (vty, " Metric : %-8" PRIu32 " IPv6-External : %s/%d", vty_out (vty, " Metric : %-8" PRIu32 " IPv6-External : %s/%d\n",
ntohl (ipv6_reach->metric), ntohl (ipv6_reach->metric),
buff, ipv6_reach->prefix_len); buff, ipv6_reach->prefix_len);
} }
@ -886,12 +886,12 @@ lsp_print_mt_ipv6_reach(struct list *list, struct vty *vty, uint16_t mtid)
{ {
if ((ipv6_reach->control_info & if ((ipv6_reach->control_info &
CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL) CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL)
vty_outln (vty, " Metric : %-8" PRIu32 " IPv6-MT-Int : %s/%d %s", vty_out (vty, " Metric : %-8" PRIu32 " IPv6-MT-Int : %s/%d %s\n",
ntohl (ipv6_reach->metric), ntohl (ipv6_reach->metric),
buff, ipv6_reach->prefix_len, buff, ipv6_reach->prefix_len,
isis_mtid2str(mtid)); isis_mtid2str(mtid));
else else
vty_outln (vty, " Metric : %-8" PRIu32 " IPv6-MT-Ext : %s/%d %s", vty_out (vty, " Metric : %-8" PRIu32 " IPv6-MT-Ext : %s/%d %s\n",
ntohl (ipv6_reach->metric), ntohl (ipv6_reach->metric),
buff, ipv6_reach->prefix_len, buff, ipv6_reach->prefix_len,
isis_mtid2str(mtid)); isis_mtid2str(mtid));
@ -910,7 +910,7 @@ lsp_print_mt_ipv4_reach(struct list *list, struct vty *vty, uint16_t mtid)
if (mtid == ISIS_MT_IPV4_UNICAST) if (mtid == ISIS_MT_IPV4_UNICAST)
{ {
/* FIXME: There should be better way to output this stuff. */ /* FIXME: There should be better way to output this stuff. */
vty_outln (vty, " Metric : %-8" PRIu32 " IPv4-Extended : %s/%d", vty_out (vty, " Metric : %-8" PRIu32 " IPv4-Extended : %s/%d\n",
ntohl (te_ipv4_reach->te_metric), ntohl (te_ipv4_reach->te_metric),
inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start, inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start,
te_ipv4_reach->control)), te_ipv4_reach->control)),
@ -919,7 +919,7 @@ lsp_print_mt_ipv4_reach(struct list *list, struct vty *vty, uint16_t mtid)
else else
{ {
/* FIXME: There should be better way to output this stuff. */ /* FIXME: There should be better way to output this stuff. */
vty_outln (vty, " Metric : %-8" PRIu32 " IPv4-MT : %s/%d %s", vty_out (vty, " Metric : %-8" PRIu32 " IPv4-MT : %s/%d %s\n",
ntohl (te_ipv4_reach->te_metric), ntohl (te_ipv4_reach->te_metric),
inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start, inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start,
te_ipv4_reach->control)), te_ipv4_reach->control)),
@ -955,7 +955,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
if (lsp->tlv_data.area_addrs) if (lsp->tlv_data.area_addrs)
for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.area_addrs, lnode, area_addr)) for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.area_addrs, lnode, area_addr))
{ {
vty_outln (vty, " Area Address: %s", vty_out (vty, " Area Address: %s\n",
isonet_print(area_addr->area_addr, area_addr->addr_len)); isonet_print(area_addr->area_addr, area_addr->addr_len));
} }
@ -968,11 +968,11 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
{ {
case NLPID_IP: case NLPID_IP:
case NLPID_IPV6: case NLPID_IPV6:
vty_outln (vty, " NLPID : 0x%X", vty_out (vty, " NLPID : 0x%X\n",
lsp->tlv_data.nlpids->nlpids[i]); lsp->tlv_data.nlpids->nlpids[i]);
break; break;
default: default:
vty_outln (vty, " NLPID : %s", "unknown"); vty_out (vty, " NLPID : %s\n", "unknown");
break; break;
} }
} }
@ -980,7 +980,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
for (ALL_LIST_ELEMENTS_RO(lsp->tlv_data.mt_router_info, lnode, mt_router_info)) for (ALL_LIST_ELEMENTS_RO(lsp->tlv_data.mt_router_info, lnode, mt_router_info))
{ {
vty_outln (vty, " MT : %s%s", vty_out (vty, " MT : %s%s\n",
isis_mtid2str(mt_router_info->mtid), isis_mtid2str(mt_router_info->mtid),
mt_router_info->overload ? " (overload)" : ""); mt_router_info->overload ? " (overload)" : "");
} }
@ -991,16 +991,16 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
bzero (hostname, sizeof (hostname)); bzero (hostname, sizeof (hostname));
memcpy (hostname, lsp->tlv_data.hostname->name, memcpy (hostname, lsp->tlv_data.hostname->name,
lsp->tlv_data.hostname->namelen); lsp->tlv_data.hostname->namelen);
vty_outln (vty, " Hostname : %s", hostname); vty_out (vty, " Hostname : %s\n", hostname);
} }
/* authentication tlv */ /* authentication tlv */
if (lsp->tlv_data.auth_info.type != ISIS_PASSWD_TYPE_UNUSED) if (lsp->tlv_data.auth_info.type != ISIS_PASSWD_TYPE_UNUSED)
{ {
if (lsp->tlv_data.auth_info.type == ISIS_PASSWD_TYPE_HMAC_MD5) if (lsp->tlv_data.auth_info.type == ISIS_PASSWD_TYPE_HMAC_MD5)
vty_outln (vty, " Auth type : md5"); vty_out (vty, " Auth type : md5\n");
else if (lsp->tlv_data.auth_info.type == ISIS_PASSWD_TYPE_CLEARTXT) else if (lsp->tlv_data.auth_info.type == ISIS_PASSWD_TYPE_CLEARTXT)
vty_outln (vty, " Auth type : clear text"); vty_out (vty, " Auth type : clear text\n");
} }
/* TE router id */ /* TE router id */
@ -1008,14 +1008,14 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
{ {
memcpy (ipv4_address, inet_ntoa (lsp->tlv_data.router_id->id), memcpy (ipv4_address, inet_ntoa (lsp->tlv_data.router_id->id),
sizeof (ipv4_address)); sizeof (ipv4_address));
vty_outln (vty, " Router ID : %s", ipv4_address); vty_out (vty, " Router ID : %s\n", ipv4_address);
} }
if (lsp->tlv_data.ipv4_addrs) if (lsp->tlv_data.ipv4_addrs)
for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.ipv4_addrs, lnode, ipv4_addr)) for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.ipv4_addrs, lnode, ipv4_addr))
{ {
memcpy (ipv4_address, inet_ntoa (*ipv4_addr), sizeof (ipv4_address)); memcpy (ipv4_address, inet_ntoa (*ipv4_addr), sizeof (ipv4_address));
vty_outln (vty, " IPv4 Address: %s", ipv4_address); vty_out (vty, " IPv4 Address: %s\n", ipv4_address);
} }
/* for the IS neighbor tlv */ /* for the IS neighbor tlv */
@ -1023,7 +1023,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.is_neighs, lnode, is_neigh)) for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.is_neighs, lnode, is_neigh))
{ {
lspid_print (is_neigh->neigh_id, LSPid, dynhost, 0); lspid_print (is_neigh->neigh_id, LSPid, dynhost, 0);
vty_outln (vty, " Metric : %-8" PRIu8 " IS : %s", vty_out (vty, " Metric : %-8" PRIu8 " IS : %s\n",
is_neigh->metrics.metric_default, LSPid); is_neigh->metrics.metric_default, LSPid);
} }
@ -1036,7 +1036,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
sizeof (ipv4_reach_prefix)); sizeof (ipv4_reach_prefix));
memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask), memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask),
sizeof (ipv4_reach_mask)); sizeof (ipv4_reach_mask));
vty_outln (vty, " Metric : %-8" PRIu8 " IPv4-Internal : %s %s", vty_out (vty, " Metric : %-8" PRIu8 " IPv4-Internal : %s %s\n",
ipv4_reach->metrics.metric_default, ipv4_reach_prefix, ipv4_reach->metrics.metric_default, ipv4_reach_prefix,
ipv4_reach_mask); ipv4_reach_mask);
} }
@ -1050,7 +1050,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
sizeof (ipv4_reach_prefix)); sizeof (ipv4_reach_prefix));
memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask), memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask),
sizeof (ipv4_reach_mask)); sizeof (ipv4_reach_mask));
vty_outln (vty, " Metric : %-8" PRIu8 " IPv4-External : %s %s", vty_out (vty, " Metric : %-8" PRIu8 " IPv4-External : %s %s\n",
ipv4_reach->metrics.metric_default, ipv4_reach_prefix, ipv4_reach->metrics.metric_default, ipv4_reach_prefix,
ipv4_reach_mask); ipv4_reach_mask);
} }
@ -1079,7 +1079,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost)
for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.mt_ipv4_reachs, lnode, mt_ipv4_reachs)) for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.mt_ipv4_reachs, lnode, mt_ipv4_reachs))
lsp_print_mt_ipv4_reach(mt_ipv4_reachs->list, vty, mt_ipv4_reachs->mtid); lsp_print_mt_ipv4_reach(mt_ipv4_reachs->list, vty, mt_ipv4_reachs->mtid);
vty_out (vty, VTYNL); vty_out (vty, "\n");
return; return;
} }

View File

@ -193,7 +193,7 @@ area_write_mt_settings(struct isis_area *area, struct vty *vty)
{ {
if (setting->mtid == ISIS_MT_IPV4_UNICAST) if (setting->mtid == ISIS_MT_IPV4_UNICAST)
continue; /* always enabled, no need to write out config */ continue; /* always enabled, no need to write out config */
vty_outln (vty, " topology %s%s", name, vty_out (vty, " topology %s%s\n", name,
setting->overload ? " overload" : ""); setting->overload ? " overload" : "");
written++; written++;
} }
@ -325,7 +325,7 @@ circuit_write_mt_settings(struct isis_circuit *circuit, struct vty *vty)
const char *name = isis_mtid2str(setting->mtid); const char *name = isis_mtid2str(setting->mtid);
if (name && !setting->enabled) if (name && !setting->enabled)
{ {
vty_outln (vty, " no isis topology %s", name); vty_out (vty, " no isis topology %s\n", name);
written++; written++;
} }
} }

View File

@ -600,7 +600,7 @@ DEFUN (isis_redistribute,
if ((area->is_type & level) != level) if ((area->is_type & level) != level)
{ {
vty_outln (vty, "Node is not a level-%d IS", level); vty_out (vty, "Node is not a level-%d IS\n", level);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -702,7 +702,7 @@ DEFUN (isis_default_originate,
if ((area->is_type & level) != level) if ((area->is_type & level) != level)
{ {
vty_outln (vty, "Node is not a level-%d IS", level); vty_out (vty, "Node is not a level-%d IS\n", level);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -722,9 +722,9 @@ DEFUN (isis_default_originate,
if (family == AF_INET6 && originate_type != DEFAULT_ORIGINATE_ALWAYS) if (family == AF_INET6 && originate_type != DEFAULT_ORIGINATE_ALWAYS)
{ {
vty_outln (vty, vty_out (vty,
"Zebra doesn't implement default-originate for IPv6 yet"); "Zebra doesn't implement default-originate for IPv6 yet\n");
vty_outln (vty, "so use with care or use default-originate always."); vty_out (vty, "so use with care or use default-originate always.\n");
} }
isis_redist_set(area, level, family, DEFAULT_ROUTE, metric, routemap, originate_type); isis_redist_set(area, level, family, DEFAULT_ROUTE, metric, routemap, originate_type);
@ -796,7 +796,7 @@ isis_redist_config_write(struct vty *vty, struct isis_area *area,
vty_out(vty, " metric %u", redist->metric); vty_out(vty, " metric %u", redist->metric);
if (redist->map_name) if (redist->map_name)
vty_out(vty, " route-map %s", redist->map_name); vty_out(vty, " route-map %s", redist->map_name);
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }
} }
@ -814,7 +814,7 @@ isis_redist_config_write(struct vty *vty, struct isis_area *area,
vty_out(vty, " metric %u", redist->metric); vty_out(vty, " metric %u", redist->metric);
if (redist->map_name) if (redist->map_name)
vty_out(vty, " route-map %s", redist->map_name); vty_out(vty, " route-map %s", redist->map_name);
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }

View File

@ -1321,8 +1321,8 @@ isis_print_paths (struct vty *vty, struct list *paths, u_char *root_sysid)
struct isis_adjacency *adj; struct isis_adjacency *adj;
char buff[PREFIX2STR_BUFFER]; char buff[PREFIX2STR_BUFFER];
vty_outln (vty, vty_out (vty,
"Vertex Type Metric " "Next-Hop Interface Parent"); "Vertex Type Metric Next-Hop Interface Parent\n");
for (ALL_LIST_ELEMENTS_RO (paths, node, vertex)) { for (ALL_LIST_ELEMENTS_RO (paths, node, vertex)) {
if (memcmp (vertex->N.id, root_sysid, ISIS_SYS_ID_LEN) == 0) { if (memcmp (vertex->N.id, root_sysid, ISIS_SYS_ID_LEN) == 0) {
@ -1336,7 +1336,7 @@ isis_print_paths (struct vty *vty, struct list *paths, u_char *root_sysid)
for (ALL_LIST_ELEMENTS_RO (vertex->Adj_N, anode, adj)) { for (ALL_LIST_ELEMENTS_RO (vertex->Adj_N, anode, adj)) {
if (adj) { if (adj) {
if (rows) { if (rows) {
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, "%-20s %-12s %-6s ", "", "", ""); vty_out (vty, "%-20s %-12s %-6s ", "", "", "");
} }
vty_out (vty, "%-20s %-9s ", vty_out (vty, "%-20s %-9s ",
@ -1356,7 +1356,7 @@ isis_print_paths (struct vty *vty, struct list *paths, u_char *root_sysid)
int rows = 0; int rows = 0;
for (ALL_LIST_ELEMENTS_RO (vertex->parents, pnode, pvertex)) { for (ALL_LIST_ELEMENTS_RO (vertex->parents, pnode, pvertex)) {
if (rows) { if (rows) {
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, "%-72s", ""); vty_out (vty, "%-72s", "");
} }
vty_out (vty, "%s(%d)", vty_out (vty, "%s(%d)",
@ -1367,7 +1367,7 @@ isis_print_paths (struct vty *vty, struct list *paths, u_char *root_sysid)
vty_out (vty, " NULL "); vty_out (vty, " NULL ");
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
@ -1396,7 +1396,7 @@ DEFUN (show_isis_topology,
for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
{ {
vty_outln (vty, "Area %s:",area->area_tag ? area->area_tag : "null"); vty_out (vty, "Area %s:\n",area->area_tag ? area->area_tag : "null");
for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++)
{ {
@ -1406,23 +1406,23 @@ DEFUN (show_isis_topology,
if (area->ip_circuits > 0 && area->spftree[level-1] if (area->ip_circuits > 0 && area->spftree[level-1]
&& area->spftree[level-1]->paths->count > 0) && area->spftree[level-1]->paths->count > 0)
{ {
vty_outln (vty, "IS-IS paths to level-%d routers that speak IP", vty_out (vty, "IS-IS paths to level-%d routers that speak IP\n",
level); level);
isis_print_paths (vty, area->spftree[level-1]->paths, isis->sysid); isis_print_paths (vty, area->spftree[level-1]->paths, isis->sysid);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (area->ipv6_circuits > 0 && area->spftree6[level-1] if (area->ipv6_circuits > 0 && area->spftree6[level-1]
&& area->spftree6[level-1]->paths->count > 0) && area->spftree6[level-1]->paths->count > 0)
{ {
vty_outln (vty, vty_out (vty,
"IS-IS paths to level-%d routers that speak IPv6", "IS-IS paths to level-%d routers that speak IPv6\n",
level); level);
isis_print_paths (vty, area->spftree6[level-1]->paths, isis->sysid); isis_print_paths (vty, area->spftree6[level-1]->paths, isis->sysid);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
return CMD_SUCCESS; return CMD_SUCCESS;

View File

@ -685,7 +685,7 @@ show_vty_subtlv_admin_grp (struct vty *vty, struct te_subtlv_admin_grp *tlv)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Administrative Group: 0x%x", vty_out (vty, " Administrative Group: 0x%x\n",
(u_int32_t)ntohl(tlv->value)); (u_int32_t)ntohl(tlv->value));
else else
zlog_debug (" Administrative Group: 0x%x", zlog_debug (" Administrative Group: 0x%x",
@ -699,8 +699,8 @@ show_vty_subtlv_llri (struct vty *vty, struct te_subtlv_llri *tlv)
{ {
if (vty != NULL) if (vty != NULL)
{ {
vty_outln (vty, " Link Local ID: %d",(u_int32_t)ntohl(tlv->local)); vty_out (vty, " Link Local ID: %d\n",(u_int32_t)ntohl(tlv->local));
vty_outln (vty, " Link Remote ID: %d", vty_out (vty, " Link Remote ID: %d\n",
(u_int32_t)ntohl(tlv->remote)); (u_int32_t)ntohl(tlv->remote));
} }
else else
@ -716,7 +716,7 @@ static u_char
show_vty_subtlv_local_ipaddr (struct vty *vty, struct te_subtlv_local_ipaddr *tlv) show_vty_subtlv_local_ipaddr (struct vty *vty, struct te_subtlv_local_ipaddr *tlv)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Local Interface IP Address(es): %s", vty_out (vty, " Local Interface IP Address(es): %s\n",
inet_ntoa(tlv->value)); inet_ntoa(tlv->value));
else else
zlog_debug (" Local Interface IP Address(es): %s", inet_ntoa (tlv->value)); zlog_debug (" Local Interface IP Address(es): %s", inet_ntoa (tlv->value));
@ -728,7 +728,7 @@ static u_char
show_vty_subtlv_rmt_ipaddr (struct vty *vty, struct te_subtlv_rmt_ipaddr *tlv) show_vty_subtlv_rmt_ipaddr (struct vty *vty, struct te_subtlv_rmt_ipaddr *tlv)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Remote Interface IP Address(es): %s", vty_out (vty, " Remote Interface IP Address(es): %s\n",
inet_ntoa(tlv->value)); inet_ntoa(tlv->value));
else else
zlog_debug (" Remote Interface IP Address(es): %s", inet_ntoa (tlv->value)); zlog_debug (" Remote Interface IP Address(es): %s", inet_ntoa (tlv->value));
@ -744,7 +744,7 @@ show_vty_subtlv_max_bw (struct vty *vty, struct te_subtlv_max_bw *tlv)
fval = ntohf (tlv->value); fval = ntohf (tlv->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Maximum Bandwidth: %g (Bytes/sec)", fval); vty_out (vty, " Maximum Bandwidth: %g (Bytes/sec)\n", fval);
else else
zlog_debug (" Maximum Bandwidth: %g (Bytes/sec)", fval); zlog_debug (" Maximum Bandwidth: %g (Bytes/sec)", fval);
@ -759,7 +759,7 @@ show_vty_subtlv_max_rsv_bw (struct vty *vty, struct te_subtlv_max_rsv_bw *tlv)
fval = ntohf (tlv->value); fval = ntohf (tlv->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Maximum Reservable Bandwidth: %g (Bytes/sec)",fval); vty_out (vty, " Maximum Reservable Bandwidth: %g (Bytes/sec)\n",fval);
else else
zlog_debug (" Maximum Reservable Bandwidth: %g (Bytes/sec)", fval); zlog_debug (" Maximum Reservable Bandwidth: %g (Bytes/sec)", fval);
@ -773,7 +773,7 @@ show_vty_subtlv_unrsv_bw (struct vty *vty, struct te_subtlv_unrsv_bw *tlv)
int i; int i;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unreserved Bandwidth:"); vty_out (vty, " Unreserved Bandwidth:\n");
else else
zlog_debug (" Unreserved Bandwidth:"); zlog_debug (" Unreserved Bandwidth:");
@ -782,7 +782,7 @@ show_vty_subtlv_unrsv_bw (struct vty *vty, struct te_subtlv_unrsv_bw *tlv)
fval1 = ntohf (tlv->value[i]); fval1 = ntohf (tlv->value[i]);
fval2 = ntohf (tlv->value[i+1]); fval2 = ntohf (tlv->value[i+1]);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", i, fval1, i+1, vty_out (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)\n", i, fval1, i+1,
fval2); fval2);
else else
zlog_debug (" [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", i, fval1, i+1, fval2); zlog_debug (" [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", i, fval1, i+1, fval2);
@ -798,7 +798,7 @@ show_vty_subtlv_te_metric (struct vty *vty, struct te_subtlv_te_metric *tlv)
te_metric = tlv->value[2] | tlv->value[1] << 8 | tlv->value[0] << 16; te_metric = tlv->value[2] | tlv->value[1] << 8 | tlv->value[0] << 16;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Traffic Engineering Metric: %u", te_metric); vty_out (vty, " Traffic Engineering Metric: %u\n", te_metric);
else else
zlog_debug (" Traffic Engineering Metric: %u", te_metric); zlog_debug (" Traffic Engineering Metric: %u", te_metric);
@ -809,7 +809,7 @@ static u_char
show_vty_subtlv_ras (struct vty *vty, struct te_subtlv_ras *tlv) show_vty_subtlv_ras (struct vty *vty, struct te_subtlv_ras *tlv)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Inter-AS TE Remote AS number: %u", vty_out (vty, " Inter-AS TE Remote AS number: %u\n",
ntohl(tlv->value)); ntohl(tlv->value));
else else
zlog_debug (" Inter-AS TE Remote AS number: %u", ntohl (tlv->value)); zlog_debug (" Inter-AS TE Remote AS number: %u", ntohl (tlv->value));
@ -821,7 +821,7 @@ static u_char
show_vty_subtlv_rip (struct vty *vty, struct te_subtlv_rip *tlv) show_vty_subtlv_rip (struct vty *vty, struct te_subtlv_rip *tlv)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Inter-AS TE Remote ASBR IP address: %s", vty_out (vty, " Inter-AS TE Remote ASBR IP address: %s\n",
inet_ntoa(tlv->value)); inet_ntoa(tlv->value));
else else
zlog_debug (" Inter-AS TE Remote ASBR IP address: %s", inet_ntoa (tlv->value)); zlog_debug (" Inter-AS TE Remote ASBR IP address: %s", inet_ntoa (tlv->value));
@ -839,7 +839,7 @@ show_vty_subtlv_av_delay (struct vty *vty, struct te_subtlv_av_delay *tlv)
A = (u_int32_t) ntohl (tlv->value) & TE_EXT_ANORMAL; A = (u_int32_t) ntohl (tlv->value) & TE_EXT_ANORMAL;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " %s Average Link Delay: %d (micro-sec)", A ? "Anomalous" : "Normal", vty_out (vty, " %s Average Link Delay: %d (micro-sec)\n", A ? "Anomalous" : "Normal",
delay); delay);
else else
zlog_debug (" %s Average Link Delay: %d (micro-sec)", A ? "Anomalous" : "Normal", delay); zlog_debug (" %s Average Link Delay: %d (micro-sec)", A ? "Anomalous" : "Normal", delay);
@ -858,7 +858,7 @@ show_vty_subtlv_mm_delay (struct vty *vty, struct te_subtlv_mm_delay *tlv)
high = (u_int32_t) ntohl (tlv->high) & TE_EXT_MASK; high = (u_int32_t) ntohl (tlv->high) & TE_EXT_MASK;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " %s Min/Max Link Delay: %d / %d (micro-sec)", A ? "Anomalous" : "Normal", low, vty_out (vty, " %s Min/Max Link Delay: %d / %d (micro-sec)\n", A ? "Anomalous" : "Normal", low,
high); high);
else else
zlog_debug (" %s Min/Max Link Delay: %d / %d (micro-sec)", A ? "Anomalous" : "Normal", low, high); zlog_debug (" %s Min/Max Link Delay: %d / %d (micro-sec)", A ? "Anomalous" : "Normal", low, high);
@ -874,7 +874,7 @@ show_vty_subtlv_delay_var (struct vty *vty, struct te_subtlv_delay_var *tlv)
jitter = (u_int32_t) ntohl (tlv->value) & TE_EXT_MASK; jitter = (u_int32_t) ntohl (tlv->value) & TE_EXT_MASK;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Delay Variation: %d (micro-sec)", jitter); vty_out (vty, " Delay Variation: %d (micro-sec)\n", jitter);
else else
zlog_debug (" Delay Variation: %d (micro-sec)", jitter); zlog_debug (" Delay Variation: %d (micro-sec)", jitter);
@ -893,7 +893,7 @@ show_vty_subtlv_pkt_loss (struct vty *vty, struct te_subtlv_pkt_loss *tlv)
A = (u_int32_t) ntohl (tlv->value) & TE_EXT_ANORMAL; A = (u_int32_t) ntohl (tlv->value) & TE_EXT_ANORMAL;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " %s Link Packet Loss: %g (%%)", A ? "Anomalous" : "Normal", vty_out (vty, " %s Link Packet Loss: %g (%%)\n", A ? "Anomalous" : "Normal",
fval); fval);
else else
zlog_debug (" %s Link Packet Loss: %g (%%)", A ? "Anomalous" : "Normal", fval); zlog_debug (" %s Link Packet Loss: %g (%%)", A ? "Anomalous" : "Normal", fval);
@ -909,7 +909,7 @@ show_vty_subtlv_res_bw (struct vty *vty, struct te_subtlv_res_bw *tlv)
fval = ntohf(tlv->value); fval = ntohf(tlv->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unidirectional Residual Bandwidth: %g (Bytes/sec)", vty_out (vty, " Unidirectional Residual Bandwidth: %g (Bytes/sec)\n",
fval); fval);
else else
zlog_debug (" Unidirectional Residual Bandwidth: %g (Bytes/sec)", fval); zlog_debug (" Unidirectional Residual Bandwidth: %g (Bytes/sec)", fval);
@ -925,7 +925,7 @@ show_vty_subtlv_ava_bw (struct vty *vty, struct te_subtlv_ava_bw *tlv)
fval = ntohf (tlv->value); fval = ntohf (tlv->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unidirectional Available Bandwidth: %g (Bytes/sec)", vty_out (vty, " Unidirectional Available Bandwidth: %g (Bytes/sec)\n",
fval); fval);
else else
zlog_debug (" Unidirectional Available Bandwidth: %g (Bytes/sec)", fval); zlog_debug (" Unidirectional Available Bandwidth: %g (Bytes/sec)", fval);
@ -941,7 +941,7 @@ show_vty_subtlv_use_bw (struct vty *vty, struct te_subtlv_use_bw *tlv)
fval = ntohf (tlv->value); fval = ntohf (tlv->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)", vty_out (vty, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)\n",
fval); fval);
else else
zlog_debug (" Unidirectional Utilized Bandwidth: %g (Bytes/sec)", fval); zlog_debug (" Unidirectional Utilized Bandwidth: %g (Bytes/sec)", fval);
@ -959,7 +959,7 @@ show_vty_unknown_tlv (struct vty *vty, struct subtlv_header *tlvh)
{ {
if (tlvh->length != 0) if (tlvh->length != 0)
{ {
vty_outln (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]", vty_out (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]\n",
tlvh->type, tlvh->length); tlvh->type, tlvh->length);
vty_out(vty, " Dump: [00]"); vty_out(vty, " Dump: [00]");
rtn = 1; /* initialize end of line counter */ rtn = 1; /* initialize end of line counter */
@ -968,16 +968,16 @@ show_vty_unknown_tlv (struct vty *vty, struct subtlv_header *tlvh)
vty_out (vty, " %#.2x", v[i]); vty_out (vty, " %#.2x", v[i]);
if (rtn == 8) if (rtn == 8)
{ {
vty_out (vty, "%s [%.2x]", VTYNL, i + 1); vty_out (vty, "\n [%.2x]", i + 1);
rtn = 1; rtn = 1;
} }
else else
rtn++; rtn++;
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
else else
vty_outln (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]", vty_out (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]\n",
tlvh->type, tlvh->length); tlvh->type, tlvh->length);
} }
else else
@ -1069,8 +1069,8 @@ isis_mpls_te_config_write_router (struct vty *vty)
{ {
if (IS_MPLS_TE(isisMplsTE)) if (IS_MPLS_TE(isisMplsTE))
{ {
vty_outln (vty, " mpls-te on"); vty_out (vty, " mpls-te on\n");
vty_outln (vty, " mpls-te router-address %s", vty_out (vty, " mpls-te router-address %s\n",
inet_ntoa(isisMplsTE.router_id)); inet_ntoa(isisMplsTE.router_id));
} }
@ -1173,7 +1173,7 @@ DEFUN (isis_mpls_te_router_addr,
if (! inet_aton (argv[idx_ipv4]->arg, &value)) if (! inet_aton (argv[idx_ipv4]->arg, &value))
{ {
vty_outln (vty, "Please specify Router-Addr by A.B.C.D"); vty_out (vty, "Please specify Router-Addr by A.B.C.D\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1201,7 +1201,7 @@ DEFUN (isis_mpls_te_inter_as,
"AREA native mode self originate INTER-AS LSP with L1 and L2 flooding scope)\n" "AREA native mode self originate INTER-AS LSP with L1 and L2 flooding scope)\n"
"AS native mode self originate INTER-AS LSP with L2 only flooding scope\n") "AS native mode self originate INTER-AS LSP with L2 only flooding scope\n")
{ {
vty_outln (vty, "Not yet supported"); vty_out (vty, "Not yet supported\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1213,7 +1213,7 @@ DEFUN (no_isis_mpls_te_inter_as,
"Disable MPLS-TE Inter-AS support\n") "Disable MPLS-TE Inter-AS support\n")
{ {
vty_outln (vty, "Not yet supported"); vty_out (vty, "Not yet supported\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1227,16 +1227,16 @@ DEFUN (show_isis_mpls_te_router,
{ {
if (IS_MPLS_TE(isisMplsTE)) if (IS_MPLS_TE(isisMplsTE))
{ {
vty_outln (vty, "--- MPLS-TE router parameters ---"); vty_out (vty, "--- MPLS-TE router parameters ---\n");
if (ntohs (isisMplsTE.router_id.s_addr) != 0) if (ntohs (isisMplsTE.router_id.s_addr) != 0)
vty_outln (vty, " Router-Address: %s", vty_out (vty, " Router-Address: %s\n",
inet_ntoa(isisMplsTE.router_id)); inet_ntoa(isisMplsTE.router_id));
else else
vty_outln (vty, " N/A"); vty_out (vty, " N/A\n");
} }
else else
vty_outln (vty, " MPLS-TE is disable on this router"); vty_out (vty, " MPLS-TE is disable on this router\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1254,21 +1254,21 @@ show_mpls_te_sub (struct vty *vty, struct interface *ifp)
{ {
if (IS_INTER_AS(mtc->type)) if (IS_INTER_AS(mtc->type))
{ {
vty_outln (vty, "-- Inter-AS TEv2 link parameters for %s --", vty_out (vty, "-- Inter-AS TEv2 link parameters for %s --\n",
ifp->name); ifp->name);
} }
else else
{ {
/* MPLS-TE is not activate on this interface */ /* MPLS-TE is not activate on this interface */
/* or this interface is passive and Inter-AS TEv2 is not activate */ /* or this interface is passive and Inter-AS TEv2 is not activate */
vty_outln (vty, " %s: MPLS-TE is disabled on this interface", vty_out (vty, " %s: MPLS-TE is disabled on this interface\n",
ifp->name); ifp->name);
return; return;
} }
} }
else else
{ {
vty_outln (vty, "-- MPLS-TE link parameters for %s --", vty_out (vty, "-- MPLS-TE link parameters for %s --\n",
ifp->name); ifp->name);
} }
@ -1299,11 +1299,11 @@ show_mpls_te_sub (struct vty *vty, struct interface *ifp)
show_vty_subtlv_res_bw (vty, &mtc->res_bw); show_vty_subtlv_res_bw (vty, &mtc->res_bw);
show_vty_subtlv_ava_bw (vty, &mtc->ava_bw); show_vty_subtlv_ava_bw (vty, &mtc->ava_bw);
show_vty_subtlv_use_bw (vty, &mtc->use_bw); show_vty_subtlv_use_bw (vty, &mtc->use_bw);
vty_outln (vty, "---------------%s", VTYNL); vty_out (vty, "---------------\n\n");
} }
else else
{ {
vty_outln (vty, " %s: MPLS-TE is disabled on this interface", vty_out (vty, " %s: MPLS-TE is disabled on this interface\n",
ifp->name); ifp->name);
} }
@ -1333,7 +1333,7 @@ DEFUN (show_isis_mpls_te_interface,
else else
{ {
if ((ifp = if_lookup_by_name (argv[idx_interface]->arg, VRF_DEFAULT)) == NULL) if ((ifp = if_lookup_by_name (argv[idx_interface]->arg, VRF_DEFAULT)) == NULL)
vty_outln (vty, "No such interface name"); vty_out (vty, "No such interface name\n");
else else
show_mpls_te_sub (vty, ifp); show_mpls_te_sub (vty, ifp);
} }

View File

@ -40,14 +40,14 @@ isis_circuit_lookup (struct vty *vty)
if (!ifp) if (!ifp)
{ {
vty_outln (vty, "Invalid interface "); vty_out (vty, "Invalid interface \n");
return NULL; return NULL;
} }
circuit = circuit_scan_by_ifp (ifp); circuit = circuit_scan_by_ifp (ifp);
if (!circuit) if (!circuit)
{ {
vty_outln (vty, "ISIS is not enabled on circuit %s", vty_out (vty, "ISIS is not enabled on circuit %s\n",
ifp->name); ifp->name);
return NULL; return NULL;
} }
@ -77,7 +77,7 @@ DEFUN (ip_router_isis,
{ {
if (strcmp (circuit->area->area_tag, area_tag)) if (strcmp (circuit->area->area_tag, area_tag))
{ {
vty_outln (vty, "ISIS circuit is already defined on %s", vty_out (vty, "ISIS circuit is already defined on %s\n",
circuit->area->area_tag); circuit->area->area_tag);
return CMD_ERR_NOTHING_TODO; return CMD_ERR_NOTHING_TODO;
} }
@ -92,7 +92,7 @@ DEFUN (ip_router_isis,
if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP) if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP)
{ {
vty_outln (vty, "Couldn't bring up interface, please check log."); vty_out (vty, "Couldn't bring up interface, please check log.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -139,7 +139,7 @@ DEFUN (no_ip_router_isis,
area = isis_area_lookup (area_tag); area = isis_area_lookup (area_tag);
if (!area) if (!area)
{ {
vty_outln (vty, "Can't find ISIS instance %s", vty_out (vty, "Can't find ISIS instance %s\n",
argv[idx_afi]->arg); argv[idx_afi]->arg);
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
} }
@ -147,7 +147,7 @@ DEFUN (no_ip_router_isis,
circuit = circuit_lookup_by_ifp (ifp, area->circuit_list); circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
if (!circuit) if (!circuit)
{ {
vty_outln (vty, "ISIS is not enabled on circuit %s", vty_out (vty, "ISIS is not enabled on circuit %s\n",
ifp->name); ifp->name);
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
} }
@ -189,7 +189,7 @@ DEFUN (no_isis_passive,
if (if_is_loopback (circuit->interface)) if (if_is_loopback (circuit->interface))
{ {
vty_outln (vty,"Can't set no passive for loopback interface"); vty_out (vty,"Can't set no passive for loopback interface\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -215,7 +215,7 @@ DEFUN (isis_circuit_type,
is_type = string2circuit_t (argv[idx_level]->arg); is_type = string2circuit_t (argv[idx_level]->arg);
if (!is_type) if (!is_type)
{ {
vty_outln (vty, "Unknown circuit-type "); vty_out (vty, "Unknown circuit-type \n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -223,7 +223,7 @@ DEFUN (isis_circuit_type,
circuit->area->is_type != IS_LEVEL_1_AND_2 && circuit->area->is_type != IS_LEVEL_1_AND_2 &&
circuit->area->is_type != is_type) circuit->area->is_type != is_type)
{ {
vty_outln (vty, "Invalid circuit level for area %s.", vty_out (vty, "Invalid circuit level for area %s.\n",
circuit->area->area_tag); circuit->area->area_tag);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -272,8 +272,8 @@ DEFUN (isis_network,
if (isis_circuit_circ_type_set(circuit, CIRCUIT_T_P2P)) if (isis_circuit_circ_type_set(circuit, CIRCUIT_T_P2P))
{ {
vty_outln (vty, vty_out (vty,
"isis network point-to-point " "is valid only on broadcast interfaces"); "isis network point-to-point is valid only on broadcast interfaces\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -294,8 +294,8 @@ DEFUN (no_isis_network,
if (isis_circuit_circ_type_set(circuit, CIRCUIT_T_BROADCAST)) if (isis_circuit_circ_type_set(circuit, CIRCUIT_T_BROADCAST))
{ {
vty_outln (vty, vty_out (vty,
"isis network point-to-point " "is valid only on broadcast interfaces"); "isis network point-to-point is valid only on broadcast interfaces\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -324,7 +324,7 @@ DEFUN (isis_passwd,
rv = isis_circuit_passwd_cleartext_set(circuit, argv[idx_word]->arg); rv = isis_circuit_passwd_cleartext_set(circuit, argv[idx_word]->arg);
if (rv) if (rv)
{ {
vty_outln (vty, "Too long circuit password (>254)"); vty_out (vty, "Too long circuit password (>254)\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -367,7 +367,7 @@ DEFUN (isis_priority,
prio = atoi (argv[idx_number]->arg); prio = atoi (argv[idx_number]->arg);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{ {
vty_outln (vty, "Invalid priority %d - should be <0-127>", vty_out (vty, "Invalid priority %d - should be <0-127>\n",
prio); prio);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -414,7 +414,7 @@ DEFUN (isis_priority_l1,
prio = atoi (argv[idx_number]->arg); prio = atoi (argv[idx_number]->arg);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{ {
vty_outln (vty, "Invalid priority %d - should be <0-127>", vty_out (vty, "Invalid priority %d - should be <0-127>\n",
prio); prio);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -460,7 +460,7 @@ DEFUN (isis_priority_l2,
prio = atoi (argv[idx_number]->arg); prio = atoi (argv[idx_number]->arg);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{ {
vty_outln (vty, "Invalid priority %d - should be <0-127>", vty_out (vty, "Invalid priority %d - should be <0-127>\n",
prio); prio);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -509,8 +509,8 @@ DEFUN (isis_metric,
if (circuit->area && circuit->area->oldmetric == 1 && if (circuit->area && circuit->area->oldmetric == 1 &&
met > MAX_NARROW_LINK_METRIC) met > MAX_NARROW_LINK_METRIC)
{ {
vty_outln (vty, "Invalid metric %d - should be <0-63> " vty_out (vty, "Invalid metric %d - should be <0-63> "
"when narrow metric type enabled", "when narrow metric type enabled\n",
met); met);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -519,8 +519,8 @@ DEFUN (isis_metric,
if (circuit->area && circuit->area->newmetric == 1 && if (circuit->area && circuit->area->newmetric == 1 &&
met > MAX_WIDE_LINK_METRIC) met > MAX_WIDE_LINK_METRIC)
{ {
vty_outln (vty, "Invalid metric %d - should be <0-16777215> " vty_out (vty, "Invalid metric %d - should be <0-16777215> "
"when wide metric type enabled", "when wide metric type enabled\n",
met); met);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -569,8 +569,8 @@ DEFUN (isis_metric_l1,
if (circuit->area && circuit->area->oldmetric == 1 && if (circuit->area && circuit->area->oldmetric == 1 &&
met > MAX_NARROW_LINK_METRIC) met > MAX_NARROW_LINK_METRIC)
{ {
vty_outln (vty, "Invalid metric %d - should be <0-63> " vty_out (vty, "Invalid metric %d - should be <0-63> "
"when narrow metric type enabled", "when narrow metric type enabled\n",
met); met);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -579,8 +579,8 @@ DEFUN (isis_metric_l1,
if (circuit->area && circuit->area->newmetric == 1 && if (circuit->area && circuit->area->newmetric == 1 &&
met > MAX_WIDE_LINK_METRIC) met > MAX_WIDE_LINK_METRIC)
{ {
vty_outln (vty, "Invalid metric %d - should be <0-16777215> " vty_out (vty, "Invalid metric %d - should be <0-16777215> "
"when wide metric type enabled", "when wide metric type enabled\n",
met); met);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -628,8 +628,8 @@ DEFUN (isis_metric_l2,
if (circuit->area && circuit->area->oldmetric == 1 && if (circuit->area && circuit->area->oldmetric == 1 &&
met > MAX_NARROW_LINK_METRIC) met > MAX_NARROW_LINK_METRIC)
{ {
vty_outln (vty, "Invalid metric %d - should be <0-63> " vty_out (vty, "Invalid metric %d - should be <0-63> "
"when narrow metric type enabled", "when narrow metric type enabled\n",
met); met);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -638,8 +638,8 @@ DEFUN (isis_metric_l2,
if (circuit->area && circuit->area->newmetric == 1 && if (circuit->area && circuit->area->newmetric == 1 &&
met > MAX_WIDE_LINK_METRIC) met > MAX_WIDE_LINK_METRIC)
{ {
vty_outln (vty, "Invalid metric %d - should be <0-16777215> " vty_out (vty, "Invalid metric %d - should be <0-16777215> "
"when wide metric type enabled", "when wide metric type enabled\n",
met); met);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -684,7 +684,7 @@ DEFUN (isis_hello_interval,
interval = atoi (argv[idx_number]->arg); interval = atoi (argv[idx_number]->arg);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{ {
vty_outln (vty, "Invalid hello-interval %d - should be <1-600>", vty_out (vty, "Invalid hello-interval %d - should be <1-600>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -732,7 +732,7 @@ DEFUN (isis_hello_interval_l1,
interval = atoi (argv[idx_number]->arg); interval = atoi (argv[idx_number]->arg);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{ {
vty_outln (vty, "Invalid hello-interval %ld - should be <1-600>", vty_out (vty, "Invalid hello-interval %ld - should be <1-600>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -779,7 +779,7 @@ DEFUN (isis_hello_interval_l2,
interval = atoi (argv[idx_number]->arg); interval = atoi (argv[idx_number]->arg);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{ {
vty_outln (vty, "Invalid hello-interval %ld - should be <1-600>", vty_out (vty, "Invalid hello-interval %ld - should be <1-600>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -825,7 +825,7 @@ DEFUN (isis_hello_multiplier,
mult = atoi (argv[idx_number]->arg); mult = atoi (argv[idx_number]->arg);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{ {
vty_outln (vty, "Invalid hello-multiplier %d - should be <2-100>", vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>\n",
mult); mult);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -873,7 +873,7 @@ DEFUN (isis_hello_multiplier_l1,
mult = atoi (argv[idx_number]->arg); mult = atoi (argv[idx_number]->arg);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{ {
vty_outln (vty, "Invalid hello-multiplier %d - should be <2-100>", vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>\n",
mult); mult);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -920,7 +920,7 @@ DEFUN (isis_hello_multiplier_l2,
mult = atoi (argv[idx_number]->arg); mult = atoi (argv[idx_number]->arg);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{ {
vty_outln (vty, "Invalid hello-multiplier %d - should be <2-100>", vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>\n",
mult); mult);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -999,7 +999,7 @@ DEFUN (csnp_interval,
interval = atol (argv[idx_number]->arg); interval = atol (argv[idx_number]->arg);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{ {
vty_outln (vty, "Invalid csnp-interval %lu - should be <1-600>", vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1047,7 +1047,7 @@ DEFUN (csnp_interval_l1,
interval = atol (argv[idx_number]->arg); interval = atol (argv[idx_number]->arg);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{ {
vty_outln (vty, "Invalid csnp-interval %lu - should be <1-600>", vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1094,7 +1094,7 @@ DEFUN (csnp_interval_l2,
interval = atol (argv[idx_number]->arg); interval = atol (argv[idx_number]->arg);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{ {
vty_outln (vty, "Invalid csnp-interval %lu - should be <1-600>", vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1140,7 +1140,7 @@ DEFUN (psnp_interval,
interval = atol (argv[idx_number]->arg); interval = atol (argv[idx_number]->arg);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{ {
vty_outln (vty, "Invalid psnp-interval %lu - should be <1-120>", vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1188,7 +1188,7 @@ DEFUN (psnp_interval_l1,
interval = atol (argv[idx_number]->arg); interval = atol (argv[idx_number]->arg);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{ {
vty_outln (vty, "Invalid psnp-interval %lu - should be <1-120>", vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1235,7 +1235,7 @@ DEFUN (psnp_interval_l2,
interval = atol (argv[idx_number]->arg); interval = atol (argv[idx_number]->arg);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{ {
vty_outln (vty, "Invalid psnp-interval %lu - should be <1-120>", vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>\n",
interval); interval);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1279,14 +1279,14 @@ DEFUN (circuit_topology,
if (circuit->area && circuit->area->oldmetric) if (circuit->area && circuit->area->oldmetric)
{ {
vty_outln (vty, vty_out (vty,
"Multi topology IS-IS can only be used with wide metrics"); "Multi topology IS-IS can only be used with wide metrics\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
if (mtid == (uint16_t)-1) if (mtid == (uint16_t)-1)
{ {
vty_outln (vty, "Don't know topology '%s'", arg); vty_out (vty, "Don't know topology '%s'\n", arg);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1309,14 +1309,14 @@ DEFUN (no_circuit_topology,
if (circuit->area && circuit->area->oldmetric) if (circuit->area && circuit->area->oldmetric)
{ {
vty_outln (vty, vty_out (vty,
"Multi topology IS-IS can only be used with wide metrics"); "Multi topology IS-IS can only be used with wide metrics\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
if (mtid == (uint16_t)-1) if (mtid == (uint16_t)-1)
{ {
vty_outln (vty, "Don't know topology '%s'", arg); vty_out (vty, "Don't know topology '%s'\n", arg);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1334,7 +1334,7 @@ validate_metric_style_narrow (struct vty *vty, struct isis_area *area)
if (! area) if (! area)
{ {
vty_outln (vty, "ISIS area is invalid"); vty_out (vty, "ISIS area is invalid\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1344,7 +1344,7 @@ validate_metric_style_narrow (struct vty *vty, struct isis_area *area)
(circuit->is_type & IS_LEVEL_1) && (circuit->is_type & IS_LEVEL_1) &&
(circuit->te_metric[0] > MAX_NARROW_LINK_METRIC)) (circuit->te_metric[0] > MAX_NARROW_LINK_METRIC))
{ {
vty_outln (vty, "ISIS circuit %s metric is invalid", vty_out (vty, "ISIS circuit %s metric is invalid\n",
circuit->interface->name); circuit->interface->name);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1352,7 +1352,7 @@ validate_metric_style_narrow (struct vty *vty, struct isis_area *area)
(circuit->is_type & IS_LEVEL_2) && (circuit->is_type & IS_LEVEL_2) &&
(circuit->te_metric[1] > MAX_NARROW_LINK_METRIC)) (circuit->te_metric[1] > MAX_NARROW_LINK_METRIC))
{ {
vty_outln (vty, "ISIS circuit %s metric is invalid", vty_out (vty, "ISIS circuit %s metric is invalid\n",
circuit->interface->name); circuit->interface->name);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1381,8 +1381,8 @@ DEFUN (metric_style,
if (area_is_mt(area)) if (area_is_mt(area))
{ {
vty_outln (vty, vty_out (vty,
"Narrow metrics cannot be used while multi topology IS-IS is active"); "Narrow metrics cannot be used while multi topology IS-IS is active\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1410,8 +1410,8 @@ DEFUN (no_metric_style,
if (area_is_mt(area)) if (area_is_mt(area))
{ {
vty_outln (vty, vty_out (vty,
"Narrow metrics cannot be used while multi topology IS-IS is active"); "Narrow metrics cannot be used while multi topology IS-IS is active\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1506,7 +1506,7 @@ static int area_lsp_mtu_set(struct vty *vty, unsigned int lsp_mtu)
continue; continue;
if(lsp_mtu > isis_circuit_pdu_size(circuit)) if(lsp_mtu > isis_circuit_pdu_size(circuit))
{ {
vty_outln (vty, "ISIS area contains circuit %s, which has a maximum PDU size of %zu.", vty_out (vty, "ISIS area contains circuit %s, which has a maximum PDU size of %zu.\n",
circuit->interface->name,isis_circuit_pdu_size(circuit)); circuit->interface->name,isis_circuit_pdu_size(circuit));
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1557,7 +1557,7 @@ DEFUN (is_type,
type = string2circuit_t (argv[idx_level]->arg); type = string2circuit_t (argv[idx_level]->arg);
if (!type) if (!type)
{ {
vty_outln (vty, "Unknown IS level "); vty_out (vty, "Unknown IS level \n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1606,8 +1606,8 @@ set_lsp_gen_interval (struct vty *vty, struct isis_area *area,
if (interval >= area->lsp_refresh[lvl-1]) if (interval >= area->lsp_refresh[lvl-1])
{ {
vty_outln (vty, "LSP gen interval %us must be less than " vty_out (vty, "LSP gen interval %us must be less than "
"the LSP refresh interval %us", "the LSP refresh interval %us\n",
interval, area->lsp_refresh[lvl - 1]); interval, area->lsp_refresh[lvl - 1]);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1845,17 +1845,17 @@ area_max_lsp_lifetime_set(struct vty *vty, int level,
if (refresh_interval < area->lsp_refresh[lvl-1]) if (refresh_interval < area->lsp_refresh[lvl-1])
{ {
vty_outln (vty, "Level %d Max LSP lifetime %us must be 300s greater than " vty_out (vty, "Level %d Max LSP lifetime %us must be 300s greater than "
"the configured LSP refresh interval %us", "the configured LSP refresh interval %us\n",
lvl, interval, area->lsp_refresh[lvl - 1]); lvl, interval, area->lsp_refresh[lvl - 1]);
vty_outln (vty, "Automatically reducing level %d LSP refresh interval " vty_out (vty, "Automatically reducing level %d LSP refresh interval "
"to %us", lvl, refresh_interval); "to %us\n", lvl, refresh_interval);
set_refresh_interval[lvl-1] = 1; set_refresh_interval[lvl-1] = 1;
if (refresh_interval <= area->lsp_gen_interval[lvl-1]) if (refresh_interval <= area->lsp_gen_interval[lvl-1])
{ {
vty_outln (vty, "LSP refresh interval %us must be greater than " vty_out (vty, "LSP refresh interval %us must be greater than "
"the configured LSP gen interval %us", "the configured LSP gen interval %us\n",
refresh_interval,area->lsp_gen_interval[lvl - 1]); refresh_interval,area->lsp_gen_interval[lvl - 1]);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1929,15 +1929,15 @@ area_lsp_refresh_interval_set(struct vty *vty, int level, uint16_t interval)
continue; continue;
if (interval <= area->lsp_gen_interval[lvl-1]) if (interval <= area->lsp_gen_interval[lvl-1])
{ {
vty_outln (vty, "LSP refresh interval %us must be greater than " vty_out (vty, "LSP refresh interval %us must be greater than "
"the configured LSP gen interval %us", "the configured LSP gen interval %us\n",
interval,area->lsp_gen_interval[lvl - 1]); interval,area->lsp_gen_interval[lvl - 1]);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
if (interval > (area->max_lsp_lifetime[lvl-1] - 300)) if (interval > (area->max_lsp_lifetime[lvl-1] - 300))
{ {
vty_outln (vty, "LSP refresh interval %us must be less than " vty_out (vty, "LSP refresh interval %us must be less than "
"the configured LSP lifetime %us less 300", "the configured LSP lifetime %us less 300\n",
interval,area->max_lsp_lifetime[lvl - 1]); interval,area->max_lsp_lifetime[lvl - 1]);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -2004,7 +2004,7 @@ area_passwd_set(struct vty *vty, int level,
if (passwd && strlen(passwd) > 254) if (passwd && strlen(passwd) > 254)
{ {
vty_outln (vty, "Too long area password (>254)"); vty_out (vty, "Too long area password (>254)\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }

View File

@ -218,7 +218,7 @@ isis_area_destroy (struct vty *vty, const char *area_tag)
if (area == NULL) if (area == NULL)
{ {
vty_outln (vty, "Can't find ISIS instance "); vty_out (vty, "Can't find ISIS instance \n");
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
} }
@ -352,7 +352,7 @@ area_net_title (struct vty *vty, const char *net_title)
/* We check that we are not over the maximal number of addresses */ /* We check that we are not over the maximal number of addresses */
if (listcount (area->area_addrs) >= isis->max_area_addrs) if (listcount (area->area_addrs) >= isis->max_area_addrs)
{ {
vty_outln (vty, "Maximum of area addresses (%d) already reached ", vty_out (vty, "Maximum of area addresses (%d) already reached \n",
isis->max_area_addrs); isis->max_area_addrs);
return CMD_ERR_NOTHING_TODO; return CMD_ERR_NOTHING_TODO;
} }
@ -366,7 +366,7 @@ area_net_title (struct vty *vty, const char *net_title)
#endif /* EXTREME_DEBUG */ #endif /* EXTREME_DEBUG */
if (addr->addr_len < 8 || addr->addr_len > 20) if (addr->addr_len < 8 || addr->addr_len > 20)
{ {
vty_outln (vty, "area address must be at least 8..20 octets long (%d)", vty_out (vty, "area address must be at least 8..20 octets long (%d)\n",
addr->addr_len); addr->addr_len);
XFREE (MTYPE_ISIS_AREA_ADDR, addr); XFREE (MTYPE_ISIS_AREA_ADDR, addr);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
@ -374,7 +374,7 @@ area_net_title (struct vty *vty, const char *net_title)
if (addr->area_addr[addr->addr_len-1] != 0) if (addr->area_addr[addr->addr_len-1] != 0)
{ {
vty_outln (vty,"nsel byte (last byte) in area address must be 0"); vty_out (vty,"nsel byte (last byte) in area address must be 0\n");
XFREE (MTYPE_ISIS_AREA_ADDR, addr); XFREE (MTYPE_ISIS_AREA_ADDR, addr);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -396,8 +396,8 @@ area_net_title (struct vty *vty, const char *net_title)
*/ */
if (memcmp (isis->sysid, GETSYSID (addr), ISIS_SYS_ID_LEN)) if (memcmp (isis->sysid, GETSYSID (addr), ISIS_SYS_ID_LEN))
{ {
vty_outln (vty, vty_out (vty,
"System ID must not change when defining additional area" " addresses"); "System ID must not change when defining additional area addresses\n");
XFREE (MTYPE_ISIS_AREA_ADDR, addr); XFREE (MTYPE_ISIS_AREA_ADDR, addr);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -444,7 +444,7 @@ area_clear_net_title (struct vty *vty, const char *net_title)
addr.addr_len = dotformat2buff (buff, net_title); addr.addr_len = dotformat2buff (buff, net_title);
if (addr.addr_len < 8 || addr.addr_len > 20) if (addr.addr_len < 8 || addr.addr_len > 20)
{ {
vty_outln (vty, "Unsupported area address length %d, should be 8...20 ", vty_out (vty, "Unsupported area address length %d, should be 8...20 \n",
addr.addr_len); addr.addr_len);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -458,7 +458,7 @@ area_clear_net_title (struct vty *vty, const char *net_title)
if (!addrp) if (!addrp)
{ {
vty_outln (vty, "No area address %s for area %s ", net_title, vty_out (vty, "No area address %s for area %s \n", net_title,
area->area_tag); area->area_tag);
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
} }
@ -493,16 +493,16 @@ show_isis_interface_common (struct vty *vty, const char *ifname, char detail)
if (!isis) if (!isis)
{ {
vty_outln (vty, "IS-IS Routing Process not enabled"); vty_out (vty, "IS-IS Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area)) for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area))
{ {
vty_outln (vty, "Area %s:", area->area_tag); vty_out (vty, "Area %s:\n", area->area_tag);
if (detail == ISIS_UI_LEVEL_BRIEF) if (detail == ISIS_UI_LEVEL_BRIEF)
vty_outln (vty," Interface CircId State Type Level"); vty_out (vty," Interface CircId State Type Level\n");
for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit)) for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit))
if (!ifname) if (!ifname)
@ -565,7 +565,7 @@ show_isis_neighbor_common (struct vty *vty, const char *id, char detail)
if (!isis) if (!isis)
{ {
vty_outln (vty, "IS-IS Routing Process not enabled"); vty_out (vty, "IS-IS Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -577,7 +577,7 @@ show_isis_neighbor_common (struct vty *vty, const char *id, char detail)
dynhn = dynhn_find_by_name (id); dynhn = dynhn_find_by_name (id);
if (dynhn == NULL) if (dynhn == NULL)
{ {
vty_outln (vty, "Invalid system id %s", id); vty_out (vty, "Invalid system id %s\n", id);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
memcpy (sysid, dynhn->id, ISIS_SYS_ID_LEN); memcpy (sysid, dynhn->id, ISIS_SYS_ID_LEN);
@ -586,11 +586,11 @@ show_isis_neighbor_common (struct vty *vty, const char *id, char detail)
for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area)) for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area))
{ {
vty_outln (vty, "Area %s:", area->area_tag); vty_out (vty, "Area %s:\n", area->area_tag);
if (detail == ISIS_UI_LEVEL_BRIEF) if (detail == ISIS_UI_LEVEL_BRIEF)
vty_outln (vty, vty_out (vty,
" System Id Interface L State" " Holdtime SNPA"); " System Id Interface L State Holdtime SNPA\n");
for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit)) for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit))
{ {
@ -638,7 +638,7 @@ clear_isis_neighbor_common (struct vty *vty, const char *id)
if (!isis) if (!isis)
{ {
vty_outln (vty, "IS-IS Routing Process not enabled"); vty_out (vty, "IS-IS Routing Process not enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -650,7 +650,7 @@ clear_isis_neighbor_common (struct vty *vty, const char *id)
dynhn = dynhn_find_by_name (id); dynhn = dynhn_find_by_name (id);
if (dynhn == NULL) if (dynhn == NULL)
{ {
vty_outln (vty, "Invalid system id %s", id); vty_out (vty, "Invalid system id %s\n", id);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
memcpy (sysid, dynhn->id, ISIS_SYS_ID_LEN); memcpy (sysid, dynhn->id, ISIS_SYS_ID_LEN);
@ -757,35 +757,35 @@ print_debug (struct vty *vty, int flags, int onoff)
strcpy (onoffs, "off"); strcpy (onoffs, "off");
if (flags & DEBUG_ADJ_PACKETS) if (flags & DEBUG_ADJ_PACKETS)
vty_outln (vty, "IS-IS Adjacency related packets debugging is %s", vty_out (vty, "IS-IS Adjacency related packets debugging is %s\n",
onoffs); onoffs);
if (flags & DEBUG_CHECKSUM_ERRORS) if (flags & DEBUG_CHECKSUM_ERRORS)
vty_outln (vty, "IS-IS checksum errors debugging is %s",onoffs); vty_out (vty, "IS-IS checksum errors debugging is %s\n",onoffs);
if (flags & DEBUG_LOCAL_UPDATES) if (flags & DEBUG_LOCAL_UPDATES)
vty_outln (vty, "IS-IS local updates debugging is %s",onoffs); vty_out (vty, "IS-IS local updates debugging is %s\n",onoffs);
if (flags & DEBUG_PROTOCOL_ERRORS) if (flags & DEBUG_PROTOCOL_ERRORS)
vty_outln (vty, "IS-IS protocol errors debugging is %s",onoffs); vty_out (vty, "IS-IS protocol errors debugging is %s\n",onoffs);
if (flags & DEBUG_SNP_PACKETS) if (flags & DEBUG_SNP_PACKETS)
vty_outln (vty, "IS-IS CSNP/PSNP packets debugging is %s",onoffs); vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s\n",onoffs);
if (flags & DEBUG_SPF_EVENTS) if (flags & DEBUG_SPF_EVENTS)
vty_outln (vty, "IS-IS SPF events debugging is %s", onoffs); vty_out (vty, "IS-IS SPF events debugging is %s\n", onoffs);
if (flags & DEBUG_SPF_STATS) if (flags & DEBUG_SPF_STATS)
vty_outln (vty, "IS-IS SPF Timing and Statistics Data debugging is %s", vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s\n",
onoffs); onoffs);
if (flags & DEBUG_SPF_TRIGGERS) if (flags & DEBUG_SPF_TRIGGERS)
vty_outln (vty, "IS-IS SPF triggering events debugging is %s",onoffs); vty_out (vty, "IS-IS SPF triggering events debugging is %s\n",onoffs);
if (flags & DEBUG_UPDATE_PACKETS) if (flags & DEBUG_UPDATE_PACKETS)
vty_outln (vty, "IS-IS Update related packet debugging is %s",onoffs); vty_out (vty, "IS-IS Update related packet debugging is %s\n",onoffs);
if (flags & DEBUG_RTE_EVENTS) if (flags & DEBUG_RTE_EVENTS)
vty_outln (vty, "IS-IS Route related debuggin is %s",onoffs); vty_out (vty, "IS-IS Route related debuggin is %s\n",onoffs);
if (flags & DEBUG_EVENTS) if (flags & DEBUG_EVENTS)
vty_outln (vty, "IS-IS Event debugging is %s", onoffs); vty_out (vty, "IS-IS Event debugging is %s\n", onoffs);
if (flags & DEBUG_PACKET_DUMP) if (flags & DEBUG_PACKET_DUMP)
vty_outln (vty, "IS-IS Packet dump debugging is %s", onoffs); vty_out (vty, "IS-IS Packet dump debugging is %s\n", onoffs);
if (flags & DEBUG_LSP_GEN) if (flags & DEBUG_LSP_GEN)
vty_outln (vty, "IS-IS LSP generation debugging is %s", onoffs); vty_out (vty, "IS-IS LSP generation debugging is %s\n", onoffs);
if (flags & DEBUG_LSP_SCHED) if (flags & DEBUG_LSP_SCHED)
vty_outln (vty, "IS-IS LSP scheduling debugging is %s", onoffs); vty_out (vty, "IS-IS LSP scheduling debugging is %s\n", onoffs);
} }
DEFUN (show_debugging, DEFUN (show_debugging,
@ -796,7 +796,7 @@ DEFUN (show_debugging,
ISIS_STR) ISIS_STR)
{ {
if (isis->debugs) { if (isis->debugs) {
vty_outln (vty, "IS-IS:"); vty_out (vty, "IS-IS:\n");
print_debug (vty, isis->debugs, 1); print_debug (vty, isis->debugs, 1);
} }
return CMD_SUCCESS; return CMD_SUCCESS;
@ -817,72 +817,72 @@ config_write_debug (struct vty *vty)
if (flags & DEBUG_ADJ_PACKETS) if (flags & DEBUG_ADJ_PACKETS)
{ {
vty_outln (vty, "debug isis adj-packets"); vty_out (vty, "debug isis adj-packets\n");
write++; write++;
} }
if (flags & DEBUG_CHECKSUM_ERRORS) if (flags & DEBUG_CHECKSUM_ERRORS)
{ {
vty_outln (vty, "debug isis checksum-errors"); vty_out (vty, "debug isis checksum-errors\n");
write++; write++;
} }
if (flags & DEBUG_LOCAL_UPDATES) if (flags & DEBUG_LOCAL_UPDATES)
{ {
vty_outln (vty, "debug isis local-updates"); vty_out (vty, "debug isis local-updates\n");
write++; write++;
} }
if (flags & DEBUG_PROTOCOL_ERRORS) if (flags & DEBUG_PROTOCOL_ERRORS)
{ {
vty_outln (vty, "debug isis protocol-errors"); vty_out (vty, "debug isis protocol-errors\n");
write++; write++;
} }
if (flags & DEBUG_SNP_PACKETS) if (flags & DEBUG_SNP_PACKETS)
{ {
vty_outln (vty, "debug isis snp-packets"); vty_out (vty, "debug isis snp-packets\n");
write++; write++;
} }
if (flags & DEBUG_SPF_EVENTS) if (flags & DEBUG_SPF_EVENTS)
{ {
vty_outln (vty, "debug isis spf-events"); vty_out (vty, "debug isis spf-events\n");
write++; write++;
} }
if (flags & DEBUG_SPF_STATS) if (flags & DEBUG_SPF_STATS)
{ {
vty_outln (vty, "debug isis spf-statistics"); vty_out (vty, "debug isis spf-statistics\n");
write++; write++;
} }
if (flags & DEBUG_SPF_TRIGGERS) if (flags & DEBUG_SPF_TRIGGERS)
{ {
vty_outln (vty, "debug isis spf-triggers"); vty_out (vty, "debug isis spf-triggers\n");
write++; write++;
} }
if (flags & DEBUG_UPDATE_PACKETS) if (flags & DEBUG_UPDATE_PACKETS)
{ {
vty_outln (vty, "debug isis update-packets"); vty_out (vty, "debug isis update-packets\n");
write++; write++;
} }
if (flags & DEBUG_RTE_EVENTS) if (flags & DEBUG_RTE_EVENTS)
{ {
vty_outln (vty, "debug isis route-events"); vty_out (vty, "debug isis route-events\n");
write++; write++;
} }
if (flags & DEBUG_EVENTS) if (flags & DEBUG_EVENTS)
{ {
vty_outln (vty, "debug isis events"); vty_out (vty, "debug isis events\n");
write++; write++;
} }
if (flags & DEBUG_PACKET_DUMP) if (flags & DEBUG_PACKET_DUMP)
{ {
vty_outln (vty, "debug isis packet-dump"); vty_out (vty, "debug isis packet-dump\n");
write++; write++;
} }
if (flags & DEBUG_LSP_GEN) if (flags & DEBUG_LSP_GEN)
{ {
vty_outln (vty, "debug isis lsp-gen"); vty_out (vty, "debug isis lsp-gen\n");
write++; write++;
} }
if (flags & DEBUG_LSP_SCHED) if (flags & DEBUG_LSP_SCHED)
{ {
vty_outln (vty, "debug isis lsp-sched"); vty_out (vty, "debug isis lsp-sched\n");
write++; write++;
} }
write += spf_backoff_write_config(vty); write += spf_backoff_write_config(vty);
@ -1312,7 +1312,7 @@ DEFUN (show_isis_spf_ietf,
{ {
if (!isis) if (!isis)
{ {
vty_outln (vty, "ISIS is not running"); vty_out (vty, "ISIS is not running\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1321,31 +1321,31 @@ DEFUN (show_isis_spf_ietf,
for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
{ {
vty_outln (vty, "Area %s:",area->area_tag ? area->area_tag : "null"); vty_out (vty, "Area %s:\n",area->area_tag ? area->area_tag : "null");
for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++)
{ {
if ((area->is_type & level) == 0) if ((area->is_type & level) == 0)
continue; continue;
vty_outln (vty, " Level-%d:", level); vty_out (vty, " Level-%d:\n", level);
vty_out (vty, " SPF delay status: "); vty_out (vty, " SPF delay status: ");
if (area->spf_timer[level -1]) if (area->spf_timer[level -1])
{ {
struct timeval remain = thread_timer_remain(area->spf_timer[level - 1]); struct timeval remain = thread_timer_remain(area->spf_timer[level - 1]);
vty_outln (vty, "Pending, due in %ld msec", vty_out (vty, "Pending, due in %ld msec\n",
remain.tv_sec * 1000 + remain.tv_usec / 1000); remain.tv_sec * 1000 + remain.tv_usec / 1000);
} }
else else
{ {
vty_outln (vty, "Not scheduled"); vty_out (vty, "Not scheduled\n");
} }
if (area->spf_delay_ietf[level - 1]) { if (area->spf_delay_ietf[level - 1]) {
vty_outln (vty, " Using draft-ietf-rtgwg-backoff-algo-04"); vty_out (vty, " Using draft-ietf-rtgwg-backoff-algo-04\n");
spf_backoff_show(area->spf_delay_ietf[level - 1], vty, " "); spf_backoff_show(area->spf_delay_ietf[level - 1], vty, " ");
} else { } else {
vty_outln (vty, " Using legacy backoff algo"); vty_out (vty, " Using legacy backoff algo\n");
} }
} }
} }
@ -1364,31 +1364,31 @@ DEFUN (show_isis_summary,
if (isis == NULL) if (isis == NULL)
{ {
vty_outln (vty, "ISIS is not running"); vty_out (vty, "ISIS is not running\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
vty_outln (vty, "Process Id : %ld",isis->process_id); vty_out (vty, "Process Id : %ld\n",isis->process_id);
if (isis->sysid_set) if (isis->sysid_set)
vty_outln (vty, "System Id : %s",sysid_print(isis->sysid)); vty_out (vty, "System Id : %s\n",sysid_print(isis->sysid));
vty_out (vty, "Up time : "); vty_out (vty, "Up time : ");
vty_out_timestr(vty, isis->uptime); vty_out_timestr(vty, isis->uptime);
vty_out (vty, VTYNL); vty_out (vty, "\n");
if (isis->area_list) if (isis->area_list)
vty_outln (vty, "Number of areas : %d",isis->area_list->count); vty_out (vty, "Number of areas : %d\n",isis->area_list->count);
for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
{ {
vty_outln (vty, "Area %s:",area->area_tag ? area->area_tag : "null"); vty_out (vty, "Area %s:\n",area->area_tag ? area->area_tag : "null");
if (listcount (area->area_addrs) > 0) if (listcount (area->area_addrs) > 0)
{ {
struct area_addr *area_addr; struct area_addr *area_addr;
for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr)) for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr))
{ {
vty_outln (vty, " Net: %s", vty_out (vty, " Net: %s\n",
isonet_print(area_addr->area_addr, area_addr->addr_len + ISIS_SYS_ID_LEN + 1)); isonet_print(area_addr->area_addr, area_addr->addr_len + ISIS_SYS_ID_LEN + 1));
} }
} }
@ -1398,45 +1398,45 @@ DEFUN (show_isis_summary,
if ((area->is_type & level) == 0) if ((area->is_type & level) == 0)
continue; continue;
vty_outln (vty, " Level-%d:", level); vty_out (vty, " Level-%d:\n", level);
spftree = area->spftree[level - 1]; spftree = area->spftree[level - 1];
if (area->spf_timer[level - 1]) if (area->spf_timer[level - 1])
vty_outln (vty, " SPF: (pending)"); vty_out (vty, " SPF: (pending)\n");
else else
vty_outln (vty, " SPF:"); vty_out (vty, " SPF:\n");
vty_out (vty, " minimum interval : %d", vty_out (vty, " minimum interval : %d",
area->min_spf_interval[level - 1]); area->min_spf_interval[level - 1]);
if (area->spf_delay_ietf[level - 1]) if (area->spf_delay_ietf[level - 1])
vty_out (vty, " (not used, IETF SPF delay activated)"); vty_out (vty, " (not used, IETF SPF delay activated)");
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_outln (vty, " IPv4 route computation:"); vty_out (vty, " IPv4 route computation:\n");
vty_out (vty, " last run elapsed : "); vty_out (vty, " last run elapsed : ");
vty_out_timestr(vty, spftree->last_run_timestamp); vty_out_timestr(vty, spftree->last_run_timestamp);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_outln (vty, " last run duration : %u usec", vty_out (vty, " last run duration : %u usec\n",
(u_int32_t)spftree->last_run_duration); (u_int32_t)spftree->last_run_duration);
vty_outln (vty, " run count : %d", vty_out (vty, " run count : %d\n",
spftree->runcount); spftree->runcount);
spftree = area->spftree6[level - 1]; spftree = area->spftree6[level - 1];
vty_outln (vty, " IPv6 route computation:"); vty_out (vty, " IPv6 route computation:\n");
vty_out (vty, " last run elapsed : "); vty_out (vty, " last run elapsed : ");
vty_out_timestr(vty, spftree->last_run_timestamp); vty_out_timestr(vty, spftree->last_run_timestamp);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_outln (vty, " last run duration : %llu msec", vty_out (vty, " last run duration : %llu msec\n",
(unsigned long long)spftree->last_run_duration); (unsigned long long)spftree->last_run_duration);
vty_outln (vty, " run count : %d", vty_out (vty, " run count : %d\n",
spftree->runcount); spftree->runcount);
} }
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1508,7 +1508,7 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level)
for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
{ {
vty_outln (vty, "Area %s:",area->area_tag ? area->area_tag : "null"); vty_out (vty, "Area %s:\n",area->area_tag ? area->area_tag : "null");
for (level = 0; level < ISIS_LEVELS; level++) for (level = 0; level < ISIS_LEVELS; level++)
{ {
@ -1539,12 +1539,12 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level)
if (lsp != NULL || argv == NULL) if (lsp != NULL || argv == NULL)
{ {
vty_outln (vty, "IS-IS Level-%d link-state database:", vty_out (vty, "IS-IS Level-%d link-state database:\n",
level + 1); level + 1);
/* print the title in all cases */ /* print the title in all cases */
vty_outln (vty, vty_out (vty,
"LSP ID PduLen " "SeqNumber Chksum Holdtime ATT/P/OL"); "LSP ID PduLen SeqNumber Chksum Holdtime ATT/P/OL\n");
} }
if (lsp) if (lsp)
@ -1560,8 +1560,8 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level)
ui_level, ui_level,
area->dynhostname); area->dynhostname);
vty_outln (vty, " %u LSPs%s", vty_out (vty, " %u LSPs\n\n",
lsp_count, VTYNL); lsp_count);
} }
} }
} }
@ -1652,19 +1652,19 @@ DEFUN (isis_topology,
if (area->oldmetric) if (area->oldmetric)
{ {
vty_outln (vty, vty_out (vty,
"Multi topology IS-IS can only be used with wide metrics"); "Multi topology IS-IS can only be used with wide metrics\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
if (mtid == (uint16_t)-1) if (mtid == (uint16_t)-1)
{ {
vty_outln (vty, "Don't know topology '%s'", arg); vty_out (vty, "Don't know topology '%s'\n", arg);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
if (mtid == ISIS_MT_IPV4_UNICAST) if (mtid == ISIS_MT_IPV4_UNICAST)
{ {
vty_outln (vty, "Cannot configure IPv4 unicast topology"); vty_out (vty, "Cannot configure IPv4 unicast topology\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1688,19 +1688,19 @@ DEFUN (no_isis_topology,
if (area->oldmetric) if (area->oldmetric)
{ {
vty_outln (vty, vty_out (vty,
"Multi topology IS-IS can only be used with wide metrics"); "Multi topology IS-IS can only be used with wide metrics\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
if (mtid == (uint16_t)-1) if (mtid == (uint16_t)-1)
{ {
vty_outln (vty, "Don't know topology '%s'", arg); vty_out (vty, "Don't know topology '%s'\n", arg);
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
if (mtid == ISIS_MT_IPV4_UNICAST) if (mtid == ISIS_MT_IPV4_UNICAST)
{ {
vty_outln (vty, "Cannot configure IPv4 unicast topology"); vty_out (vty, "Cannot configure IPv4 unicast topology\n");
return CMD_ERR_AMBIGUOUS; return CMD_ERR_AMBIGUOUS;
} }
@ -1990,7 +1990,7 @@ isis_config_write (struct vty *vty)
for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
{ {
/* ISIS - Area name */ /* ISIS - Area name */
vty_outln (vty, "router isis %s", area->area_tag); vty_out (vty, "router isis %s\n", area->area_tag);
write++; write++;
/* ISIS - Net */ /* ISIS - Net */
if (listcount (area->area_addrs) > 0) if (listcount (area->area_addrs) > 0)
@ -1998,7 +1998,7 @@ isis_config_write (struct vty *vty)
struct area_addr *area_addr; struct area_addr *area_addr;
for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr)) for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr))
{ {
vty_outln (vty, " net %s", vty_out (vty, " net %s\n",
isonet_print(area_addr->area_addr, area_addr->addr_len + ISIS_SYS_ID_LEN + 1)); isonet_print(area_addr->area_addr, area_addr->addr_len + ISIS_SYS_ID_LEN + 1));
write++; write++;
} }
@ -2007,38 +2007,38 @@ isis_config_write (struct vty *vty)
* false. */ * false. */
if (!area->dynhostname) if (!area->dynhostname)
{ {
vty_outln (vty, " no hostname dynamic"); vty_out (vty, " no hostname dynamic\n");
write++; write++;
} }
/* ISIS - Metric-Style - when true displays wide */ /* ISIS - Metric-Style - when true displays wide */
if (area->newmetric) if (area->newmetric)
{ {
if (!area->oldmetric) if (!area->oldmetric)
vty_outln (vty, " metric-style wide"); vty_out (vty, " metric-style wide\n");
else else
vty_outln (vty, " metric-style transition"); vty_out (vty, " metric-style transition\n");
write++; write++;
} }
else else
{ {
vty_outln (vty, " metric-style narrow"); vty_out (vty, " metric-style narrow\n");
write++; write++;
} }
/* ISIS - overload-bit */ /* ISIS - overload-bit */
if (area->overload_bit) if (area->overload_bit)
{ {
vty_outln (vty, " set-overload-bit"); vty_out (vty, " set-overload-bit\n");
write++; write++;
} }
/* ISIS - Area is-type (level-1-2 is default) */ /* ISIS - Area is-type (level-1-2 is default) */
if (area->is_type == IS_LEVEL_1) if (area->is_type == IS_LEVEL_1)
{ {
vty_outln (vty, " is-type level-1"); vty_out (vty, " is-type level-1\n");
write++; write++;
} }
else if (area->is_type == IS_LEVEL_2) else if (area->is_type == IS_LEVEL_2)
{ {
vty_outln (vty, " is-type level-2-only"); vty_out (vty, " is-type level-2-only\n");
write++; write++;
} }
write += isis_redist_config_write(vty, area, AF_INET); write += isis_redist_config_write(vty, area, AF_INET);
@ -2048,7 +2048,7 @@ isis_config_write (struct vty *vty)
{ {
if (area->lsp_gen_interval[0] != DEFAULT_MIN_LSP_GEN_INTERVAL) if (area->lsp_gen_interval[0] != DEFAULT_MIN_LSP_GEN_INTERVAL)
{ {
vty_outln (vty, " lsp-gen-interval %d", vty_out (vty, " lsp-gen-interval %d\n",
area->lsp_gen_interval[0]); area->lsp_gen_interval[0]);
write++; write++;
} }
@ -2057,13 +2057,13 @@ isis_config_write (struct vty *vty)
{ {
if (area->lsp_gen_interval[0] != DEFAULT_MIN_LSP_GEN_INTERVAL) if (area->lsp_gen_interval[0] != DEFAULT_MIN_LSP_GEN_INTERVAL)
{ {
vty_outln (vty, " lsp-gen-interval level-1 %d", vty_out (vty, " lsp-gen-interval level-1 %d\n",
area->lsp_gen_interval[0]); area->lsp_gen_interval[0]);
write++; write++;
} }
if (area->lsp_gen_interval[1] != DEFAULT_MIN_LSP_GEN_INTERVAL) if (area->lsp_gen_interval[1] != DEFAULT_MIN_LSP_GEN_INTERVAL)
{ {
vty_outln (vty, " lsp-gen-interval level-2 %d", vty_out (vty, " lsp-gen-interval level-2 %d\n",
area->lsp_gen_interval[1]); area->lsp_gen_interval[1]);
write++; write++;
} }
@ -2073,7 +2073,7 @@ isis_config_write (struct vty *vty)
{ {
if (area->max_lsp_lifetime[0] != DEFAULT_LSP_LIFETIME) if (area->max_lsp_lifetime[0] != DEFAULT_LSP_LIFETIME)
{ {
vty_outln (vty, " max-lsp-lifetime %u", vty_out (vty, " max-lsp-lifetime %u\n",
area->max_lsp_lifetime[0]); area->max_lsp_lifetime[0]);
write++; write++;
} }
@ -2082,13 +2082,13 @@ isis_config_write (struct vty *vty)
{ {
if (area->max_lsp_lifetime[0] != DEFAULT_LSP_LIFETIME) if (area->max_lsp_lifetime[0] != DEFAULT_LSP_LIFETIME)
{ {
vty_outln (vty, " max-lsp-lifetime level-1 %u", vty_out (vty, " max-lsp-lifetime level-1 %u\n",
area->max_lsp_lifetime[0]); area->max_lsp_lifetime[0]);
write++; write++;
} }
if (area->max_lsp_lifetime[1] != DEFAULT_LSP_LIFETIME) if (area->max_lsp_lifetime[1] != DEFAULT_LSP_LIFETIME)
{ {
vty_outln (vty, " max-lsp-lifetime level-2 %u", vty_out (vty, " max-lsp-lifetime level-2 %u\n",
area->max_lsp_lifetime[1]); area->max_lsp_lifetime[1]);
write++; write++;
} }
@ -2098,7 +2098,7 @@ isis_config_write (struct vty *vty)
{ {
if (area->lsp_refresh[0] != DEFAULT_MAX_LSP_GEN_INTERVAL) if (area->lsp_refresh[0] != DEFAULT_MAX_LSP_GEN_INTERVAL)
{ {
vty_outln (vty, " lsp-refresh-interval %u", vty_out (vty, " lsp-refresh-interval %u\n",
area->lsp_refresh[0]); area->lsp_refresh[0]);
write++; write++;
} }
@ -2107,20 +2107,20 @@ isis_config_write (struct vty *vty)
{ {
if (area->lsp_refresh[0] != DEFAULT_MAX_LSP_GEN_INTERVAL) if (area->lsp_refresh[0] != DEFAULT_MAX_LSP_GEN_INTERVAL)
{ {
vty_outln (vty, " lsp-refresh-interval level-1 %u", vty_out (vty, " lsp-refresh-interval level-1 %u\n",
area->lsp_refresh[0]); area->lsp_refresh[0]);
write++; write++;
} }
if (area->lsp_refresh[1] != DEFAULT_MAX_LSP_GEN_INTERVAL) if (area->lsp_refresh[1] != DEFAULT_MAX_LSP_GEN_INTERVAL)
{ {
vty_outln (vty, " lsp-refresh-interval level-2 %u", vty_out (vty, " lsp-refresh-interval level-2 %u\n",
area->lsp_refresh[1]); area->lsp_refresh[1]);
write++; write++;
} }
} }
if (area->lsp_mtu != DEFAULT_LSP_MTU) if (area->lsp_mtu != DEFAULT_LSP_MTU)
{ {
vty_outln (vty, " lsp-mtu %u", area->lsp_mtu); vty_out (vty, " lsp-mtu %u\n", area->lsp_mtu);
write++; write++;
} }
@ -2129,7 +2129,7 @@ isis_config_write (struct vty *vty)
{ {
if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL) if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL)
{ {
vty_outln (vty, " spf-interval %d", vty_out (vty, " spf-interval %d\n",
area->min_spf_interval[0]); area->min_spf_interval[0]);
write++; write++;
} }
@ -2138,13 +2138,13 @@ isis_config_write (struct vty *vty)
{ {
if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL) if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL)
{ {
vty_outln (vty, " spf-interval level-1 %d", vty_out (vty, " spf-interval level-1 %d\n",
area->min_spf_interval[0]); area->min_spf_interval[0]);
write++; write++;
} }
if (area->min_spf_interval[1] != MINIMUM_SPF_INTERVAL) if (area->min_spf_interval[1] != MINIMUM_SPF_INTERVAL)
{ {
vty_outln (vty, " spf-interval level-2 %d", vty_out (vty, " spf-interval level-2 %d\n",
area->min_spf_interval[1]); area->min_spf_interval[1]);
write++; write++;
} }
@ -2153,7 +2153,7 @@ isis_config_write (struct vty *vty)
/* IETF SPF interval */ /* IETF SPF interval */
if (area->spf_delay_ietf[0]) if (area->spf_delay_ietf[0])
{ {
vty_outln (vty, " spf-delay-ietf init-delay %ld short-delay %ld long-delay %ld holddown %ld time-to-learn %ld", vty_out (vty, " spf-delay-ietf init-delay %ld short-delay %ld long-delay %ld holddown %ld time-to-learn %ld\n",
spf_backoff_init_delay(area->spf_delay_ietf[0]), spf_backoff_init_delay(area->spf_delay_ietf[0]),
spf_backoff_short_delay(area->spf_delay_ietf[0]), spf_backoff_short_delay(area->spf_delay_ietf[0]),
spf_backoff_long_delay(area->spf_delay_ietf[0]), spf_backoff_long_delay(area->spf_delay_ietf[0]),
@ -2174,7 +2174,7 @@ isis_config_write (struct vty *vty)
else else
vty_out(vty, "send-only"); vty_out(vty, "send-only");
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }
else if (area->area_passwd.type == ISIS_PASSWD_TYPE_CLEARTXT) else if (area->area_passwd.type == ISIS_PASSWD_TYPE_CLEARTXT)
@ -2188,7 +2188,7 @@ isis_config_write (struct vty *vty)
else else
vty_out(vty, "send-only"); vty_out(vty, "send-only");
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }
if (area->domain_passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5) if (area->domain_passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5)
@ -2203,7 +2203,7 @@ isis_config_write (struct vty *vty)
else else
vty_out(vty, "send-only"); vty_out(vty, "send-only");
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }
else if (area->domain_passwd.type == ISIS_PASSWD_TYPE_CLEARTXT) else if (area->domain_passwd.type == ISIS_PASSWD_TYPE_CLEARTXT)
@ -2218,13 +2218,13 @@ isis_config_write (struct vty *vty)
else else
vty_out(vty, "send-only"); vty_out(vty, "send-only");
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }
if (area->log_adj_changes) if (area->log_adj_changes)
{ {
vty_outln (vty, " log-adjacency-changes"); vty_out (vty, " log-adjacency-changes\n");
write++; write++;
} }

View File

@ -105,29 +105,29 @@ ldp_vty_debug(struct vty *vty, int disable, const char *type_str,
int int
ldp_vty_show_debugging(struct vty *vty) ldp_vty_show_debugging(struct vty *vty)
{ {
vty_outln (vty, "LDP debugging status:"); vty_out (vty, "LDP debugging status:\n");
if (LDP_DEBUG(hello, HELLO_RECV)) if (LDP_DEBUG(hello, HELLO_RECV))
vty_outln (vty," LDP discovery debugging is on (inbound)"); vty_out (vty," LDP discovery debugging is on (inbound)\n");
if (LDP_DEBUG(hello, HELLO_SEND)) if (LDP_DEBUG(hello, HELLO_SEND))
vty_outln (vty," LDP discovery debugging is on (outbound)"); vty_out (vty," LDP discovery debugging is on (outbound)\n");
if (LDP_DEBUG(errors, ERRORS)) if (LDP_DEBUG(errors, ERRORS))
vty_outln (vty, " LDP errors debugging is on"); vty_out (vty, " LDP errors debugging is on\n");
if (LDP_DEBUG(event, EVENT)) if (LDP_DEBUG(event, EVENT))
vty_outln (vty, " LDP events debugging is on"); vty_out (vty, " LDP events debugging is on\n");
if (LDP_DEBUG(msg, MSG_RECV_ALL)) if (LDP_DEBUG(msg, MSG_RECV_ALL))
vty_outln (vty, vty_out (vty,
" LDP detailed messages debugging is on " "(inbound)"); " LDP detailed messages debugging is on (inbound)\n");
else if (LDP_DEBUG(msg, MSG_RECV)) else if (LDP_DEBUG(msg, MSG_RECV))
vty_outln (vty," LDP messages debugging is on (inbound)"); vty_out (vty," LDP messages debugging is on (inbound)\n");
if (LDP_DEBUG(msg, MSG_SEND_ALL)) if (LDP_DEBUG(msg, MSG_SEND_ALL))
vty_outln (vty, vty_out (vty,
" LDP detailed messages debugging is on " "(outbound)"); " LDP detailed messages debugging is on (outbound)\n");
else if (LDP_DEBUG(msg, MSG_SEND)) else if (LDP_DEBUG(msg, MSG_SEND))
vty_outln (vty," LDP messages debugging is on (outbound)"); vty_out (vty," LDP messages debugging is on (outbound)\n");
if (LDP_DEBUG(zebra, ZEBRA)) if (LDP_DEBUG(zebra, ZEBRA))
vty_outln (vty, " LDP zebra debugging is on"); vty_out (vty, " LDP zebra debugging is on\n");
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
@ -138,43 +138,43 @@ ldp_debug_config_write(struct vty *vty)
int write = 0; int write = 0;
if (CONF_LDP_DEBUG(hello, HELLO_RECV)) { if (CONF_LDP_DEBUG(hello, HELLO_RECV)) {
vty_outln (vty,"debug mpls ldp discovery hello recv"); vty_out (vty,"debug mpls ldp discovery hello recv\n");
write = 1; write = 1;
} }
if (CONF_LDP_DEBUG(hello, HELLO_SEND)) { if (CONF_LDP_DEBUG(hello, HELLO_SEND)) {
vty_outln (vty,"debug mpls ldp discovery hello sent"); vty_out (vty,"debug mpls ldp discovery hello sent\n");
write = 1; write = 1;
} }
if (CONF_LDP_DEBUG(errors, ERRORS)) { if (CONF_LDP_DEBUG(errors, ERRORS)) {
vty_outln (vty, "debug mpls ldp errors"); vty_out (vty, "debug mpls ldp errors\n");
write = 1; write = 1;
} }
if (CONF_LDP_DEBUG(event, EVENT)) { if (CONF_LDP_DEBUG(event, EVENT)) {
vty_outln (vty, "debug mpls ldp event"); vty_out (vty, "debug mpls ldp event\n");
write = 1; write = 1;
} }
if (CONF_LDP_DEBUG(msg, MSG_RECV_ALL)) { if (CONF_LDP_DEBUG(msg, MSG_RECV_ALL)) {
vty_outln (vty, "debug mpls ldp messages recv all"); vty_out (vty, "debug mpls ldp messages recv all\n");
write = 1; write = 1;
} else if (CONF_LDP_DEBUG(msg, MSG_RECV)) { } else if (CONF_LDP_DEBUG(msg, MSG_RECV)) {
vty_outln (vty, "debug mpls ldp messages recv"); vty_out (vty, "debug mpls ldp messages recv\n");
write = 1; write = 1;
} }
if (CONF_LDP_DEBUG(msg, MSG_SEND_ALL)) { if (CONF_LDP_DEBUG(msg, MSG_SEND_ALL)) {
vty_outln (vty, "debug mpls ldp messages sent all"); vty_out (vty, "debug mpls ldp messages sent all\n");
write = 1; write = 1;
} else if (CONF_LDP_DEBUG(msg, MSG_SEND)) { } else if (CONF_LDP_DEBUG(msg, MSG_SEND)) {
vty_outln (vty, "debug mpls ldp messages sent"); vty_out (vty, "debug mpls ldp messages sent\n");
write = 1; write = 1;
} }
if (CONF_LDP_DEBUG(zebra, ZEBRA)) { if (CONF_LDP_DEBUG(zebra, ZEBRA)) {
vty_outln (vty, "debug mpls ldp zebra"); vty_out (vty, "debug mpls ldp zebra\n");
write = 1; write = 1;
} }

View File

@ -115,16 +115,16 @@ ldp_af_iface_config_write(struct vty *vty, int af)
if (!ia->enabled) if (!ia->enabled)
continue; continue;
vty_outln (vty, " !"); vty_out (vty, " !\n");
vty_outln (vty, " interface %s", iface->name); vty_out (vty, " interface %s\n", iface->name);
if (ia->hello_holdtime != LINK_DFLT_HOLDTIME && if (ia->hello_holdtime != LINK_DFLT_HOLDTIME &&
ia->hello_holdtime != 0) ia->hello_holdtime != 0)
vty_outln (vty, " discovery hello holdtime %u", vty_out (vty, " discovery hello holdtime %u\n",
ia->hello_holdtime); ia->hello_holdtime);
if (ia->hello_interval != DEFAULT_HELLO_INTERVAL && if (ia->hello_interval != DEFAULT_HELLO_INTERVAL &&
ia->hello_interval != 0) ia->hello_interval != 0)
vty_outln (vty, " discovery hello interval %u", vty_out (vty, " discovery hello interval %u\n",
ia->hello_interval); ia->hello_interval);
} }
} }
@ -138,16 +138,16 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf,
if (!(af_conf->flags & F_LDPD_AF_ENABLED)) if (!(af_conf->flags & F_LDPD_AF_ENABLED))
return; return;
vty_outln (vty, " !"); vty_out (vty, " !\n");
vty_outln (vty, " address-family %s", af_name(af)); vty_out (vty, " address-family %s\n", af_name(af));
if (af_conf->lhello_holdtime != LINK_DFLT_HOLDTIME && if (af_conf->lhello_holdtime != LINK_DFLT_HOLDTIME &&
af_conf->lhello_holdtime != 0 ) af_conf->lhello_holdtime != 0 )
vty_outln (vty, " discovery hello holdtime %u", vty_out (vty, " discovery hello holdtime %u\n",
af_conf->lhello_holdtime); af_conf->lhello_holdtime);
if (af_conf->lhello_interval != DEFAULT_HELLO_INTERVAL && if (af_conf->lhello_interval != DEFAULT_HELLO_INTERVAL &&
af_conf->lhello_interval != 0) af_conf->lhello_interval != 0)
vty_outln (vty, " discovery hello interval %u", vty_out (vty, " discovery hello interval %u\n",
af_conf->lhello_interval); af_conf->lhello_interval);
if (af_conf->flags & F_LDPD_AF_THELLO_ACCEPT) { if (af_conf->flags & F_LDPD_AF_THELLO_ACCEPT) {
@ -155,24 +155,24 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf,
if (af_conf->acl_thello_accept_from[0] != '\0') if (af_conf->acl_thello_accept_from[0] != '\0')
vty_out(vty, " from %s", vty_out(vty, " from %s",
af_conf->acl_thello_accept_from); af_conf->acl_thello_accept_from);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (af_conf->thello_holdtime != TARGETED_DFLT_HOLDTIME && if (af_conf->thello_holdtime != TARGETED_DFLT_HOLDTIME &&
af_conf->thello_holdtime != 0) af_conf->thello_holdtime != 0)
vty_outln (vty, " discovery targeted-hello holdtime %u", vty_out (vty, " discovery targeted-hello holdtime %u\n",
af_conf->thello_holdtime); af_conf->thello_holdtime);
if (af_conf->thello_interval != DEFAULT_HELLO_INTERVAL && if (af_conf->thello_interval != DEFAULT_HELLO_INTERVAL &&
af_conf->thello_interval != 0) af_conf->thello_interval != 0)
vty_outln (vty, " discovery targeted-hello interval %u", vty_out (vty, " discovery targeted-hello interval %u\n",
af_conf->thello_interval); af_conf->thello_interval);
if (ldp_addrisset(af, &af_conf->trans_addr)) if (ldp_addrisset(af, &af_conf->trans_addr))
vty_outln (vty, " discovery transport-address %s", vty_out (vty, " discovery transport-address %s\n",
log_addr(af, &af_conf->trans_addr)); log_addr(af, &af_conf->trans_addr));
else else
vty_outln (vty, vty_out (vty,
" ! Incomplete config, specify a discovery " "transport-address"); " ! Incomplete config, specify a discovery transport-address\n");
if ((af_conf->flags & F_LDPD_AF_ALLOCHOSTONLY) || if ((af_conf->flags & F_LDPD_AF_ALLOCHOSTONLY) ||
af_conf->acl_label_allocate_for[0] != '\0') { af_conf->acl_label_allocate_for[0] != '\0') {
@ -182,7 +182,7 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf,
else else
vty_out(vty, " for %s", vty_out(vty, " for %s",
af_conf->acl_label_allocate_for); af_conf->acl_label_allocate_for);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (af_conf->acl_label_advertise_for[0] != '\0' || if (af_conf->acl_label_advertise_for[0] != '\0' ||
@ -194,7 +194,7 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf,
if (af_conf->acl_label_advertise_for[0] != '\0') if (af_conf->acl_label_advertise_for[0] != '\0')
vty_out(vty, " for %s", vty_out(vty, " for %s",
af_conf->acl_label_advertise_for); af_conf->acl_label_advertise_for);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (af_conf->flags & F_LDPD_AF_EXPNULL) { if (af_conf->flags & F_LDPD_AF_EXPNULL) {
@ -202,7 +202,7 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf,
if (af_conf->acl_label_expnull_for[0] != '\0') if (af_conf->acl_label_expnull_for[0] != '\0')
vty_out(vty, " for %s", vty_out(vty, " for %s",
af_conf->acl_label_expnull_for); af_conf->acl_label_expnull_for);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (af_conf->acl_label_accept_for[0] != '\0' || if (af_conf->acl_label_accept_for[0] != '\0' ||
@ -214,26 +214,26 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf,
if (af_conf->acl_label_accept_for[0] != '\0') if (af_conf->acl_label_accept_for[0] != '\0')
vty_out(vty, " for %s", vty_out(vty, " for %s",
af_conf->acl_label_accept_for); af_conf->acl_label_accept_for);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (af_conf->flags & F_LDPD_AF_NO_GTSM) if (af_conf->flags & F_LDPD_AF_NO_GTSM)
vty_outln (vty, " ttl-security disable"); vty_out (vty, " ttl-security disable\n");
if (af_conf->keepalive != DEFAULT_KEEPALIVE) if (af_conf->keepalive != DEFAULT_KEEPALIVE)
vty_outln (vty, " session holdtime %u",af_conf->keepalive); vty_out (vty, " session holdtime %u\n",af_conf->keepalive);
RB_FOREACH(tnbr, tnbr_head, &ldpd_conf->tnbr_tree) { RB_FOREACH(tnbr, tnbr_head, &ldpd_conf->tnbr_tree) {
if (tnbr->af == af) { if (tnbr->af == af) {
vty_outln (vty, " !"); vty_out (vty, " !\n");
vty_outln (vty, " neighbor %s targeted", vty_out (vty, " neighbor %s targeted\n",
log_addr(tnbr->af, &tnbr->addr)); log_addr(tnbr->af, &tnbr->addr));
} }
} }
ldp_af_iface_config_write(vty, af); ldp_af_iface_config_write(vty, af);
vty_outln (vty, " !"); vty_out (vty, " !\n");
} }
int int
@ -244,61 +244,61 @@ ldp_config_write(struct vty *vty)
if (!(ldpd_conf->flags & F_LDPD_ENABLED)) if (!(ldpd_conf->flags & F_LDPD_ENABLED))
return (0); return (0);
vty_outln (vty, "mpls ldp"); vty_out (vty, "mpls ldp\n");
if (ldpd_conf->rtr_id.s_addr != 0) if (ldpd_conf->rtr_id.s_addr != 0)
vty_outln (vty, " router-id %s", vty_out (vty, " router-id %s\n",
inet_ntoa(ldpd_conf->rtr_id)); inet_ntoa(ldpd_conf->rtr_id));
if (ldpd_conf->lhello_holdtime != LINK_DFLT_HOLDTIME && if (ldpd_conf->lhello_holdtime != LINK_DFLT_HOLDTIME &&
ldpd_conf->lhello_holdtime != 0) ldpd_conf->lhello_holdtime != 0)
vty_outln (vty, " discovery hello holdtime %u", vty_out (vty, " discovery hello holdtime %u\n",
ldpd_conf->lhello_holdtime); ldpd_conf->lhello_holdtime);
if (ldpd_conf->lhello_interval != DEFAULT_HELLO_INTERVAL && if (ldpd_conf->lhello_interval != DEFAULT_HELLO_INTERVAL &&
ldpd_conf->lhello_interval != 0) ldpd_conf->lhello_interval != 0)
vty_outln (vty, " discovery hello interval %u", vty_out (vty, " discovery hello interval %u\n",
ldpd_conf->lhello_interval); ldpd_conf->lhello_interval);
if (ldpd_conf->thello_holdtime != TARGETED_DFLT_HOLDTIME && if (ldpd_conf->thello_holdtime != TARGETED_DFLT_HOLDTIME &&
ldpd_conf->thello_holdtime != 0) ldpd_conf->thello_holdtime != 0)
vty_outln (vty, " discovery targeted-hello holdtime %u", vty_out (vty, " discovery targeted-hello holdtime %u\n",
ldpd_conf->thello_holdtime); ldpd_conf->thello_holdtime);
if (ldpd_conf->thello_interval != DEFAULT_HELLO_INTERVAL && if (ldpd_conf->thello_interval != DEFAULT_HELLO_INTERVAL &&
ldpd_conf->thello_interval != 0) ldpd_conf->thello_interval != 0)
vty_outln (vty, " discovery targeted-hello interval %u", vty_out (vty, " discovery targeted-hello interval %u\n",
ldpd_conf->thello_interval); ldpd_conf->thello_interval);
if (ldpd_conf->trans_pref == DUAL_STACK_LDPOV4) if (ldpd_conf->trans_pref == DUAL_STACK_LDPOV4)
vty_outln (vty, vty_out (vty,
" dual-stack transport-connection prefer ipv4"); " dual-stack transport-connection prefer ipv4\n");
if (ldpd_conf->flags & F_LDPD_DS_CISCO_INTEROP) if (ldpd_conf->flags & F_LDPD_DS_CISCO_INTEROP)
vty_outln (vty, " dual-stack cisco-interop"); vty_out (vty, " dual-stack cisco-interop\n");
RB_FOREACH(nbrp, nbrp_head, &ldpd_conf->nbrp_tree) { RB_FOREACH(nbrp, nbrp_head, &ldpd_conf->nbrp_tree) {
if (nbrp->flags & F_NBRP_KEEPALIVE) if (nbrp->flags & F_NBRP_KEEPALIVE)
vty_outln (vty, " neighbor %s session holdtime %u", vty_out (vty, " neighbor %s session holdtime %u\n",
inet_ntoa(nbrp->lsr_id),nbrp->keepalive); inet_ntoa(nbrp->lsr_id),nbrp->keepalive);
if (nbrp->flags & F_NBRP_GTSM) { if (nbrp->flags & F_NBRP_GTSM) {
if (nbrp->gtsm_enabled) if (nbrp->gtsm_enabled)
vty_outln (vty, " neighbor %s ttl-security hops " vty_out (vty, " neighbor %s ttl-security hops "
"%u", inet_ntoa(nbrp->lsr_id), "%u\n", inet_ntoa(nbrp->lsr_id),
nbrp->gtsm_hops); nbrp->gtsm_hops);
else else
vty_outln (vty, " neighbor %s ttl-security " vty_out (vty, " neighbor %s ttl-security "
"disable",inet_ntoa(nbrp->lsr_id)); "disable\n",inet_ntoa(nbrp->lsr_id));
} }
if (nbrp->auth.method == AUTH_MD5SIG) if (nbrp->auth.method == AUTH_MD5SIG)
vty_outln (vty, " neighbor %s password %s", vty_out (vty, " neighbor %s password %s\n",
inet_ntoa(nbrp->lsr_id),nbrp->auth.md5key); inet_ntoa(nbrp->lsr_id),nbrp->auth.md5key);
} }
ldp_af_config_write(vty, AF_INET, ldpd_conf, &ldpd_conf->ipv4); ldp_af_config_write(vty, AF_INET, ldpd_conf, &ldpd_conf->ipv4);
ldp_af_config_write(vty, AF_INET6, ldpd_conf, &ldpd_conf->ipv6); ldp_af_config_write(vty, AF_INET6, ldpd_conf, &ldpd_conf->ipv6);
vty_outln (vty, " !"); vty_out (vty, " !\n");
vty_outln (vty, "!"); vty_out (vty, "!\n");
return (1); return (1);
} }
@ -309,34 +309,34 @@ ldp_l2vpn_pw_config_write(struct vty *vty, struct l2vpn_pw *pw)
int missing_lsrid = 0; int missing_lsrid = 0;
int missing_pwid = 0; int missing_pwid = 0;
vty_outln (vty, " !"); vty_out (vty, " !\n");
vty_outln (vty, " member pseudowire %s", pw->ifname); vty_out (vty, " member pseudowire %s\n", pw->ifname);
if (pw->lsr_id.s_addr != INADDR_ANY) if (pw->lsr_id.s_addr != INADDR_ANY)
vty_outln (vty, " neighbor lsr-id %s",inet_ntoa(pw->lsr_id)); vty_out (vty, " neighbor lsr-id %s\n",inet_ntoa(pw->lsr_id));
else else
missing_lsrid = 1; missing_lsrid = 1;
if (pw->flags & F_PW_STATIC_NBR_ADDR) if (pw->flags & F_PW_STATIC_NBR_ADDR)
vty_outln (vty, " neighbor address %s", vty_out (vty, " neighbor address %s\n",
log_addr(pw->af, &pw->addr)); log_addr(pw->af, &pw->addr));
if (pw->pwid != 0) if (pw->pwid != 0)
vty_outln (vty, " pw-id %u", pw->pwid); vty_out (vty, " pw-id %u\n", pw->pwid);
else else
missing_pwid = 1; missing_pwid = 1;
if (!(pw->flags & F_PW_CWORD_CONF)) if (!(pw->flags & F_PW_CWORD_CONF))
vty_outln (vty, " control-word exclude"); vty_out (vty, " control-word exclude\n");
if (!(pw->flags & F_PW_STATUSTLV_CONF)) if (!(pw->flags & F_PW_STATUSTLV_CONF))
vty_outln (vty, " pw-status disable"); vty_out (vty, " pw-status disable\n");
if (missing_lsrid) if (missing_lsrid)
vty_outln (vty, vty_out (vty,
" ! Incomplete config, specify a neighbor " "lsr-id"); " ! Incomplete config, specify a neighbor lsr-id\n");
if (missing_pwid) if (missing_pwid)
vty_outln (vty," ! Incomplete config, specify a pw-id"); vty_out (vty," ! Incomplete config, specify a pw-id\n");
} }
int int
@ -347,27 +347,27 @@ ldp_l2vpn_config_write(struct vty *vty)
struct l2vpn_pw *pw; struct l2vpn_pw *pw;
RB_FOREACH(l2vpn, l2vpn_head, &ldpd_conf->l2vpn_tree) { RB_FOREACH(l2vpn, l2vpn_head, &ldpd_conf->l2vpn_tree) {
vty_outln (vty, "l2vpn %s type vpls", l2vpn->name); vty_out (vty, "l2vpn %s type vpls\n", l2vpn->name);
if (l2vpn->pw_type != DEFAULT_PW_TYPE) if (l2vpn->pw_type != DEFAULT_PW_TYPE)
vty_outln (vty, " vc type ethernet-tagged"); vty_out (vty, " vc type ethernet-tagged\n");
if (l2vpn->mtu != DEFAULT_L2VPN_MTU) if (l2vpn->mtu != DEFAULT_L2VPN_MTU)
vty_outln (vty, " mtu %u", l2vpn->mtu); vty_out (vty, " mtu %u\n", l2vpn->mtu);
if (l2vpn->br_ifname[0] != '\0') if (l2vpn->br_ifname[0] != '\0')
vty_outln (vty, " bridge %s",l2vpn->br_ifname); vty_out (vty, " bridge %s\n",l2vpn->br_ifname);
RB_FOREACH(lif, l2vpn_if_head, &l2vpn->if_tree) RB_FOREACH(lif, l2vpn_if_head, &l2vpn->if_tree)
vty_outln (vty, " member interface %s",lif->ifname); vty_out (vty, " member interface %s\n",lif->ifname);
RB_FOREACH(pw, l2vpn_pw_head, &l2vpn->pw_tree) RB_FOREACH(pw, l2vpn_pw_head, &l2vpn->pw_tree)
ldp_l2vpn_pw_config_write(vty, pw); ldp_l2vpn_pw_config_write(vty, pw);
RB_FOREACH(pw, l2vpn_pw_head, &l2vpn->pw_inactive_tree) RB_FOREACH(pw, l2vpn_pw_head, &l2vpn->pw_inactive_tree)
ldp_l2vpn_pw_config_write(vty, pw); ldp_l2vpn_pw_config_write(vty, pw);
vty_outln (vty, " !"); vty_out (vty, " !\n");
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
return (0); return (0);
@ -473,7 +473,7 @@ ldp_vty_disc_holdtime(struct vty *vty, int disable, const char *hello_type_str,
secs = strtol(seconds_str, &ep, 10); secs = strtol(seconds_str, &ep, 10);
if (*ep != '\0' || secs < MIN_HOLDTIME || secs > MAX_HOLDTIME) { if (*ep != '\0' || secs < MIN_HOLDTIME || secs > MAX_HOLDTIME) {
vty_outln (vty, "%% Invalid holdtime"); vty_out (vty, "%% Invalid holdtime\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
@ -568,7 +568,7 @@ ldp_vty_disc_interval(struct vty *vty, int disable, const char *hello_type_str,
secs = strtol(seconds_str, &ep, 10); secs = strtol(seconds_str, &ep, 10);
if (*ep != '\0' || secs < MIN_HELLO_INTERVAL || if (*ep != '\0' || secs < MIN_HELLO_INTERVAL ||
secs > MAX_HELLO_INTERVAL) { secs > MAX_HELLO_INTERVAL) {
vty_outln (vty, "%% Invalid interval"); vty_out (vty, "%% Invalid interval\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
@ -686,13 +686,13 @@ ldp_vty_nbr_session_holdtime(struct vty *vty, int disable,
if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 ||
bad_addr_v4(lsr_id)) { bad_addr_v4(lsr_id)) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
secs = strtol(seconds_str, &ep, 10); secs = strtol(seconds_str, &ep, 10);
if (*ep != '\0' || secs < MIN_KEEPALIVE || secs > MAX_KEEPALIVE) { if (*ep != '\0' || secs < MIN_KEEPALIVE || secs > MAX_KEEPALIVE) {
vty_outln (vty, "%% Invalid holdtime"); vty_out (vty, "%% Invalid holdtime\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
@ -732,7 +732,7 @@ ldp_vty_af_session_holdtime(struct vty *vty, int disable,
secs = strtol(seconds_str, &ep, 10); secs = strtol(seconds_str, &ep, 10);
if (*ep != '\0' || secs < MIN_KEEPALIVE || secs > MAX_KEEPALIVE) { if (*ep != '\0' || secs < MIN_KEEPALIVE || secs > MAX_KEEPALIVE) {
vty_outln (vty, "%% Invalid holdtime"); vty_out (vty, "%% Invalid holdtime\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
@ -778,7 +778,7 @@ ldp_vty_interface(struct vty *vty, int disable, const char *ifname)
if (iface == NULL) { if (iface == NULL) {
if (ldp_iface_is_configured(vty_conf, ifname)) { if (ldp_iface_is_configured(vty_conf, ifname)) {
vty_outln (vty,"%% Interface is already in use"); vty_out (vty,"%% Interface is already in use\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
@ -825,7 +825,7 @@ ldp_vty_trans_addr(struct vty *vty, int disable, const char *addr_str)
else { else {
if (inet_pton(af, addr_str, &af_conf->trans_addr) != 1 || if (inet_pton(af, addr_str, &af_conf->trans_addr) != 1 ||
bad_addr(af, &af_conf->trans_addr)) { bad_addr(af, &af_conf->trans_addr)) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
} }
@ -846,11 +846,11 @@ ldp_vty_neighbor_targeted(struct vty *vty, int disable, const char *addr_str)
if (inet_pton(af, addr_str, &addr) != 1 || if (inet_pton(af, addr_str, &addr) != 1 ||
bad_addr(af, &addr)) { bad_addr(af, &addr)) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
if (af == AF_INET6 && IN6_IS_SCOPE_EMBED(&addr.v6)) { if (af == AF_INET6 && IN6_IS_SCOPE_EMBED(&addr.v6)) {
vty_outln (vty, "%% Address can not be link-local"); vty_out (vty, "%% Address can not be link-local\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
@ -1022,7 +1022,7 @@ ldp_vty_router_id(struct vty *vty, int disable, const char *addr_str)
else { else {
if (inet_pton(AF_INET, addr_str, &vty_conf->rtr_id) != 1 || if (inet_pton(AF_INET, addr_str, &vty_conf->rtr_id) != 1 ||
bad_addr_v4(vty_conf->rtr_id)) { bad_addr_v4(vty_conf->rtr_id)) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
} }
@ -1068,7 +1068,7 @@ ldp_vty_neighbor_password(struct vty *vty, int disable, const char *lsr_id_str,
if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 ||
bad_addr_v4(lsr_id)) { bad_addr_v4(lsr_id)) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
@ -1114,14 +1114,14 @@ ldp_vty_neighbor_ttl_security(struct vty *vty, int disable,
if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 ||
bad_addr_v4(lsr_id)) { bad_addr_v4(lsr_id)) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
if (hops_str) { if (hops_str) {
hops = strtol(hops_str, &ep, 10); hops = strtol(hops_str, &ep, 10);
if (*ep != '\0' || hops < 1 || hops > 254) { if (*ep != '\0' || hops < 1 || hops > 254) {
vty_outln (vty, "%% Invalid hop count"); vty_out (vty, "%% Invalid hop count\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
} }
@ -1226,7 +1226,7 @@ ldp_vty_l2vpn_mtu(struct vty *vty, int disable, const char *mtu_str)
mtu = strtol(mtu_str, &ep, 10); mtu = strtol(mtu_str, &ep, 10);
if (*ep != '\0' || mtu < MIN_L2VPN_MTU || mtu > MAX_L2VPN_MTU) { if (*ep != '\0' || mtu < MIN_L2VPN_MTU || mtu > MAX_L2VPN_MTU) {
vty_outln (vty, "%% Invalid MTU"); vty_out (vty, "%% Invalid MTU\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
@ -1286,7 +1286,7 @@ ldp_vty_l2vpn_interface(struct vty *vty, int disable, const char *ifname)
return (CMD_SUCCESS); return (CMD_SUCCESS);
if (ldp_iface_is_configured(vty_conf, ifname)) { if (ldp_iface_is_configured(vty_conf, ifname)) {
vty_outln (vty, "%% Interface is already in use"); vty_out (vty, "%% Interface is already in use\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
@ -1329,7 +1329,7 @@ ldp_vty_l2vpn_pseudowire(struct vty *vty, int disable, const char *ifname)
} }
if (ldp_iface_is_configured(vty_conf, ifname)) { if (ldp_iface_is_configured(vty_conf, ifname)) {
vty_outln (vty, "%% Interface is already in use"); vty_out (vty, "%% Interface is already in use\n");
return (CMD_SUCCESS); return (CMD_SUCCESS);
} }
@ -1373,7 +1373,7 @@ ldp_vty_l2vpn_pw_nbr_addr(struct vty *vty, int disable, const char *addr_str)
if (ldp_get_address(addr_str, &af, &addr) == -1 || if (ldp_get_address(addr_str, &af, &addr) == -1 ||
bad_addr(af, &addr)) { bad_addr(af, &addr)) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
@ -1400,7 +1400,7 @@ ldp_vty_l2vpn_pw_nbr_id(struct vty *vty, int disable, const char *lsr_id_str)
if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 ||
bad_addr_v4(lsr_id)) { bad_addr_v4(lsr_id)) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }
@ -1423,7 +1423,7 @@ ldp_vty_l2vpn_pw_pwid(struct vty *vty, int disable, const char *pwid_str)
pwid = strtol(pwid_str, &ep, 10); pwid = strtol(pwid_str, &ep, 10);
if (*ep != '\0' || pwid < MIN_PWID_ID || pwid > MAX_PWID_ID) { if (*ep != '\0' || pwid < MIN_PWID_ID || pwid > MAX_PWID_ID) {
vty_outln (vty, "%% Invalid pw-id"); vty_out (vty, "%% Invalid pw-id\n");
return (CMD_WARNING_CONFIG_FAILED); return (CMD_WARNING_CONFIG_FAILED);
} }

View File

@ -128,14 +128,14 @@ show_interface_msg(struct vty *vty, struct imsg *imsg,
snprintf(timers, sizeof(timers), "%u/%u", snprintf(timers, sizeof(timers), "%u/%u",
iface->hello_interval, iface->hello_holdtime); iface->hello_interval, iface->hello_holdtime);
vty_outln (vty, "%-4s %-11s %-6s %-8s %-12s %3u", vty_out (vty, "%-4s %-11s %-6s %-8s %-12s %3u\n",
af_name(iface->af), iface->name, af_name(iface->af), iface->name,
if_state_name(iface->state), iface->uptime == 0 ? if_state_name(iface->state), iface->uptime == 0 ?
"00:00:00" : log_time(iface->uptime), timers, "00:00:00" : log_time(iface->uptime), timers,
iface->adj_cnt); iface->adj_cnt);
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (1); return (1);
default: default:
break; break;
@ -211,13 +211,13 @@ show_discovery_msg(struct vty *vty, struct imsg *imsg,
vty_out(vty, "%-8s %-15s ", "Targeted", addr); vty_out(vty, "%-8s %-15s ", "Targeted", addr);
if (strlen(addr) > 15) if (strlen(addr) > 15)
vty_out(vty, "%s%46s", VTYNL, " "); vty_out(vty, "\n%46s", " ");
break; break;
} }
vty_outln (vty, "%9u", adj->holdtime); vty_out (vty, "%9u\n", adj->holdtime);
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (1); return (1);
default: default:
break; break;
@ -232,23 +232,23 @@ show_discovery_detail_adj(struct vty *vty, char *buffer, struct ctl_adj *adj)
size_t buflen = strlen(buffer); size_t buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen, snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" LSR Id: %s:0%s", inet_ntoa(adj->id), VTYNL); " LSR Id: %s:0\n", inet_ntoa(adj->id));
buflen = strlen(buffer); buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen, snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Source address: %s%s", " Source address: %s\n",
log_addr(adj->af, &adj->src_addr), VTYNL); log_addr(adj->af, &adj->src_addr));
buflen = strlen(buffer); buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen, snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Transport address: %s%s", " Transport address: %s\n",
log_addr(adj->af, &adj->trans_addr), VTYNL); log_addr(adj->af, &adj->trans_addr));
buflen = strlen(buffer); buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen, snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Hello hold time: %u secs (due in %u secs)%s", " Hello hold time: %u secs (due in %u secs)\n",
adj->holdtime, adj->holdtime_remaining, VTYNL); adj->holdtime, adj->holdtime_remaining);
buflen = strlen(buffer); buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen, snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Dual-stack capability TLV: %s%s", " Dual-stack capability TLV: %s\n",
(adj->ds_tlv) ? "yes" : "no", VTYNL); (adj->ds_tlv) ? "yes" : "no");
} }
static int static int
@ -279,8 +279,8 @@ show_discovery_detail_msg(struct vty *vty, struct imsg *imsg,
buflen = strlen(ifaces_buffer); buflen = strlen(ifaces_buffer);
snprintf(ifaces_buffer + buflen, LDPBUFSIZ - buflen, snprintf(ifaces_buffer + buflen, LDPBUFSIZ - buflen,
" %s: %s%s", iface->name, (iface->no_adj) ? " %s: %s\n", iface->name, (iface->no_adj) ?
"(no adjacencies)" : "", VTYNL); "(no adjacencies)" : "");
break; break;
case IMSG_CTL_SHOW_DISC_TNBR: case IMSG_CTL_SHOW_DISC_TNBR:
tnbr = imsg->data; tnbr = imsg->data;
@ -292,9 +292,9 @@ show_discovery_detail_msg(struct vty *vty, struct imsg *imsg,
tnbr->af))->trans_addr; tnbr->af))->trans_addr;
buflen = strlen(tnbrs_buffer); buflen = strlen(tnbrs_buffer);
snprintf(tnbrs_buffer + buflen, LDPBUFSIZ - buflen, snprintf(tnbrs_buffer + buflen, LDPBUFSIZ - buflen,
" %s -> %s: %s%s", log_addr(tnbr->af, trans_addr), " %s -> %s: %s\n", log_addr(tnbr->af, trans_addr),
log_addr(tnbr->af, &tnbr->addr), (tnbr->no_adj) ? log_addr(tnbr->af, &tnbr->addr), (tnbr->no_adj) ?
"(no adjacencies)" : "", VTYNL); "(no adjacencies)" : "");
break; break;
case IMSG_CTL_SHOW_DISC_ADJ: case IMSG_CTL_SHOW_DISC_ADJ:
adj = imsg->data; adj = imsg->data;
@ -313,20 +313,20 @@ show_discovery_detail_msg(struct vty *vty, struct imsg *imsg,
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
rtr_id.s_addr = ldp_rtr_id_get(ldpd_conf); rtr_id.s_addr = ldp_rtr_id_get(ldpd_conf);
vty_outln (vty, "Local:"); vty_out (vty, "Local:\n");
vty_outln (vty, " LSR Id: %s:0",inet_ntoa(rtr_id)); vty_out (vty, " LSR Id: %s:0\n",inet_ntoa(rtr_id));
if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED) if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED)
vty_outln (vty, " Transport Address (IPv4): %s", vty_out (vty, " Transport Address (IPv4): %s\n",
log_addr(AF_INET, &ldpd_conf->ipv4.trans_addr)); log_addr(AF_INET, &ldpd_conf->ipv4.trans_addr));
if (ldpd_conf->ipv6.flags & F_LDPD_AF_ENABLED) if (ldpd_conf->ipv6.flags & F_LDPD_AF_ENABLED)
vty_outln (vty, " Transport Address (IPv6): %s", vty_out (vty, " Transport Address (IPv6): %s\n",
log_addr(AF_INET6, &ldpd_conf->ipv6.trans_addr)); log_addr(AF_INET6, &ldpd_conf->ipv6.trans_addr));
vty_outln (vty, "Discovery Sources:"); vty_out (vty, "Discovery Sources:\n");
vty_outln (vty, " Interfaces:"); vty_out (vty, " Interfaces:\n");
vty_out(vty, "%s", ifaces_buffer); vty_out(vty, "%s", ifaces_buffer);
vty_outln (vty, " Targeted Hellos:"); vty_out (vty, " Targeted Hellos:\n");
vty_out(vty, "%s", tnbrs_buffer); vty_out(vty, "%s", tnbrs_buffer);
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (1); return (1);
default: default:
break; break;
@ -511,8 +511,8 @@ show_nbr_msg(struct vty *vty, struct imsg *imsg, struct show_params *params)
af_name(nbr->af), inet_ntoa(nbr->id), af_name(nbr->af), inet_ntoa(nbr->id),
nbr_state_name(nbr->nbr_state), addr); nbr_state_name(nbr->nbr_state), addr);
if (strlen(addr) > 15) if (strlen(addr) > 15)
vty_out(vty, "%s%48s", VTYNL, " "); vty_out(vty, "\n%48s", " ");
vty_outln (vty, " %8s", log_time(nbr->uptime)); vty_out (vty, " %8s\n", log_time(nbr->uptime));
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
return (1); return (1);
@ -531,12 +531,12 @@ show_nbr_detail_adj(struct vty *vty, char *buffer, struct ctl_adj *adj)
switch (adj->type) { switch (adj->type) {
case HELLO_LINK: case HELLO_LINK:
snprintf(buffer + buflen, LDPBUFSIZ - buflen, snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Interface: %s%s", adj->ifname, VTYNL); " Interface: %s\n", adj->ifname);
break; break;
case HELLO_TARGETED: case HELLO_TARGETED:
snprintf(buffer + buflen, LDPBUFSIZ - buflen, snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Targeted Hello: %s%s", log_addr(adj->af, " Targeted Hello: %s\n", log_addr(adj->af,
&adj->src_addr), VTYNL); &adj->src_addr));
break; break;
} }
} }
@ -557,41 +557,41 @@ show_nbr_detail_msg(struct vty *vty, struct imsg *imsg,
v4adjs_buffer[0] = '\0'; v4adjs_buffer[0] = '\0';
v6adjs_buffer[0] = '\0'; v6adjs_buffer[0] = '\0';
vty_outln (vty, "Peer LDP Identifier: %s:0", vty_out (vty, "Peer LDP Identifier: %s:0\n",
inet_ntoa(nbr->id)); inet_ntoa(nbr->id));
vty_outln (vty, " TCP connection: %s:%u - %s:%u", vty_out (vty, " TCP connection: %s:%u - %s:%u\n",
log_addr(nbr->af, &nbr->laddr), ntohs(nbr->lport), log_addr(nbr->af, &nbr->laddr), ntohs(nbr->lport),
log_addr(nbr->af, &nbr->raddr),ntohs(nbr->rport)); log_addr(nbr->af, &nbr->raddr),ntohs(nbr->rport));
vty_outln (vty, " Authentication: %s", vty_out (vty, " Authentication: %s\n",
(nbr->auth_method == AUTH_MD5SIG) ? "TCP MD5 Signature" : "none"); (nbr->auth_method == AUTH_MD5SIG) ? "TCP MD5 Signature" : "none");
vty_outln(vty, " Session Holdtime: %u secs; " vty_out(vty, " Session Holdtime: %u secs; "
"KeepAlive interval: %u secs", nbr->holdtime, "KeepAlive interval: %u secs\n", nbr->holdtime,
nbr->holdtime / KEEPALIVE_PER_PERIOD); nbr->holdtime / KEEPALIVE_PER_PERIOD);
vty_outln(vty, " State: %s; Downstream-Unsolicited", vty_out(vty, " State: %s; Downstream-Unsolicited\n",
nbr_state_name(nbr->nbr_state)); nbr_state_name(nbr->nbr_state));
vty_outln (vty, " Up time: %s",log_time(nbr->uptime)); vty_out (vty, " Up time: %s\n",log_time(nbr->uptime));
stats = &nbr->stats; stats = &nbr->stats;
vty_outln (vty, " Messages sent/rcvd:"); vty_out (vty, " Messages sent/rcvd:\n");
vty_outln (vty, " - Keepalive Messages: %u/%u", vty_out (vty, " - Keepalive Messages: %u/%u\n",
stats->kalive_sent, stats->kalive_rcvd); stats->kalive_sent, stats->kalive_rcvd);
vty_outln (vty, " - Address Messages: %u/%u", vty_out (vty, " - Address Messages: %u/%u\n",
stats->addr_sent, stats->addr_rcvd); stats->addr_sent, stats->addr_rcvd);
vty_outln (vty, " - Address Withdraw Messages: %u/%u", vty_out (vty, " - Address Withdraw Messages: %u/%u\n",
stats->addrwdraw_sent, stats->addrwdraw_rcvd); stats->addrwdraw_sent, stats->addrwdraw_rcvd);
vty_outln (vty, " - Notification Messages: %u/%u", vty_out (vty, " - Notification Messages: %u/%u\n",
stats->notif_sent, stats->notif_rcvd); stats->notif_sent, stats->notif_rcvd);
vty_outln (vty, " - Capability Messages: %u/%u", vty_out (vty, " - Capability Messages: %u/%u\n",
stats->capability_sent, stats->capability_rcvd); stats->capability_sent, stats->capability_rcvd);
vty_outln (vty, " - Label Mapping Messages: %u/%u", vty_out (vty, " - Label Mapping Messages: %u/%u\n",
stats->labelmap_sent, stats->labelmap_rcvd); stats->labelmap_sent, stats->labelmap_rcvd);
vty_outln (vty, " - Label Request Messages: %u/%u", vty_out (vty, " - Label Request Messages: %u/%u\n",
stats->labelreq_sent, stats->labelreq_rcvd); stats->labelreq_sent, stats->labelreq_rcvd);
vty_outln (vty, " - Label Withdraw Messages: %u/%u", vty_out (vty, " - Label Withdraw Messages: %u/%u\n",
stats->labelwdraw_sent, stats->labelwdraw_rcvd); stats->labelwdraw_sent, stats->labelwdraw_rcvd);
vty_outln (vty, " - Label Release Messages: %u/%u", vty_out (vty, " - Label Release Messages: %u/%u\n",
stats->labelrel_sent, stats->labelrel_rcvd); stats->labelrel_sent, stats->labelrel_rcvd);
vty_outln (vty, " - Label Abort Request Messages: %u/%u", vty_out (vty, " - Label Abort Request Messages: %u/%u\n",
stats->labelabreq_sent, stats->labelabreq_rcvd); stats->labelabreq_sent, stats->labelabreq_rcvd);
show_nbr_capabilities(vty, nbr); show_nbr_capabilities(vty, nbr);
@ -611,16 +611,16 @@ show_nbr_detail_msg(struct vty *vty, struct imsg *imsg,
} }
break; break;
case IMSG_CTL_SHOW_NBR_END: case IMSG_CTL_SHOW_NBR_END:
vty_outln (vty, " LDP Discovery Sources:"); vty_out (vty, " LDP Discovery Sources:\n");
if (v4adjs_buffer[0] != '\0') { if (v4adjs_buffer[0] != '\0') {
vty_outln (vty, " IPv4:"); vty_out (vty, " IPv4:\n");
vty_out(vty, "%s", v4adjs_buffer); vty_out(vty, "%s", v4adjs_buffer);
} }
if (v6adjs_buffer[0] != '\0') { if (v6adjs_buffer[0] != '\0') {
vty_outln (vty, " IPv6:"); vty_out (vty, " IPv6:\n");
vty_out(vty, "%s", v6adjs_buffer); vty_out(vty, "%s", v6adjs_buffer);
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
return (1); return (1);
@ -869,18 +869,17 @@ show_nbr_detail_msg_json(struct imsg *imsg, struct show_params *params,
void void
show_nbr_capabilities(struct vty *vty, struct ctl_nbr *nbr) show_nbr_capabilities(struct vty *vty, struct ctl_nbr *nbr)
{ {
vty_outln (vty, " Capabilities Sent:%s" vty_out (vty, " Capabilities Sent:\n"
" - Dynamic Announcement (0x0506)%s" " - Dynamic Announcement (0x0506)\n"
" - Typed Wildcard (0x050B)%s" " - Typed Wildcard (0x050B)\n"
" - Unrecognized Notification (0x0603)", " - Unrecognized Notification (0x0603)\n");
VTYNL, VTYNL, VTYNL); vty_out (vty, " Capabilities Received:\n");
vty_outln (vty, " Capabilities Received:");
if (nbr->flags & F_NBR_CAP_DYNAMIC) if (nbr->flags & F_NBR_CAP_DYNAMIC)
vty_outln (vty," - Dynamic Announcement (0x0506)"); vty_out (vty," - Dynamic Announcement (0x0506)\n");
if (nbr->flags & F_NBR_CAP_TWCARD) if (nbr->flags & F_NBR_CAP_TWCARD)
vty_outln (vty, " - Typed Wildcard (0x050B)"); vty_out (vty, " - Typed Wildcard (0x050B)\n");
if (nbr->flags & F_NBR_CAP_UNOTIF) if (nbr->flags & F_NBR_CAP_UNOTIF)
vty_outln (vty," - Unrecognized Notification (0x0603)"); vty_out (vty," - Unrecognized Notification (0x0603)\n");
} }
static int static int
@ -895,13 +894,13 @@ show_nbr_capabilities_msg(struct vty *vty, struct imsg *imsg, struct show_params
if (nbr->nbr_state != NBR_STA_OPER) if (nbr->nbr_state != NBR_STA_OPER)
break; break;
vty_outln (vty, "Peer LDP Identifier: %s:0", vty_out (vty, "Peer LDP Identifier: %s:0\n",
inet_ntoa(nbr->id)); inet_ntoa(nbr->id));
show_nbr_capabilities(vty, nbr); show_nbr_capabilities(vty, nbr);
vty_out (vty, VTYNL); vty_out (vty, "\n");
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (1); return (1);
default: default:
break; break;
@ -1021,13 +1020,13 @@ show_lib_msg(struct vty *vty, struct imsg *imsg, struct show_params *params)
vty_out(vty, "%-4s %-20s", af_name(rt->af), dstnet); vty_out(vty, "%-4s %-20s", af_name(rt->af), dstnet);
if (strlen(dstnet) > 20) if (strlen(dstnet) > 20)
vty_out(vty, "%s%25s", VTYNL, " "); vty_out(vty, "\n%25s", " ");
vty_outln (vty, " %-15s %-11s %-13s %6s", inet_ntoa(rt->nexthop), vty_out (vty, " %-15s %-11s %-13s %6s\n", inet_ntoa(rt->nexthop),
log_label(rt->local_label), log_label(rt->remote_label), log_label(rt->local_label), log_label(rt->remote_label),
rt->in_use ? "yes" : "no"); rt->in_use ? "yes" : "no");
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (1); return (1);
default: default:
break; break;
@ -1069,37 +1068,37 @@ show_lib_detail_msg(struct vty *vty, struct imsg *imsg, struct show_params *para
snprintf(dstnet, sizeof(dstnet), "%s/%d", snprintf(dstnet, sizeof(dstnet), "%s/%d",
log_addr(rt->af, &rt->prefix), rt->prefixlen); log_addr(rt->af, &rt->prefix), rt->prefixlen);
vty_outln (vty, "%s", dstnet); vty_out (vty, "%s\n", dstnet);
vty_outln (vty, "%-8sLocal binding: label: %s", "", vty_out (vty, "%-8sLocal binding: label: %s\n", "",
log_label(rt->local_label)); log_label(rt->local_label));
break; break;
case IMSG_CTL_SHOW_LIB_SENT: case IMSG_CTL_SHOW_LIB_SENT:
upstream = 1; upstream = 1;
buflen = strlen(sent_buffer); buflen = strlen(sent_buffer);
snprintf(sent_buffer + buflen, LDPBUFSIZ - buflen, snprintf(sent_buffer + buflen, LDPBUFSIZ - buflen,
"%12s%s:0%s", "", inet_ntoa(rt->nexthop), VTYNL); "%12s%s:0\n", "", inet_ntoa(rt->nexthop));
break; break;
case IMSG_CTL_SHOW_LIB_RCVD: case IMSG_CTL_SHOW_LIB_RCVD:
downstream = 1; downstream = 1;
buflen = strlen(rcvd_buffer); buflen = strlen(rcvd_buffer);
snprintf(rcvd_buffer + buflen, LDPBUFSIZ - buflen, snprintf(rcvd_buffer + buflen, LDPBUFSIZ - buflen,
"%12s%s:0, label %s%s%s", "", inet_ntoa(rt->nexthop), "%12s%s:0, label %s%s\n", "", inet_ntoa(rt->nexthop),
log_label(rt->remote_label), log_label(rt->remote_label),
rt->in_use ? " (in use)" : "", VTYNL); rt->in_use ? " (in use)" : "");
break; break;
case IMSG_CTL_SHOW_LIB_END: case IMSG_CTL_SHOW_LIB_END:
if (upstream) { if (upstream) {
vty_outln (vty, "%-8sAdvertised to:", ""); vty_out (vty, "%-8sAdvertised to:\n", "");
vty_out(vty, "%s", sent_buffer); vty_out(vty, "%s", sent_buffer);
} }
if (downstream) { if (downstream) {
vty_outln (vty, "%-8sRemote bindings:", ""); vty_out (vty, "%-8sRemote bindings:\n", "");
vty_out(vty, "%s", rcvd_buffer); vty_out(vty, "%s", rcvd_buffer);
} else } else
vty_outln (vty, "%-8sNo remote bindings",""); vty_out (vty, "%-8sNo remote bindings\n","");
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (1); return (1);
default: default:
break; break;
@ -1235,33 +1234,33 @@ show_l2vpn_binding_msg(struct vty *vty, struct imsg *imsg,
case IMSG_CTL_SHOW_L2VPN_BINDING: case IMSG_CTL_SHOW_L2VPN_BINDING:
pw = imsg->data; pw = imsg->data;
vty_outln (vty, " Destination Address: %s, VC ID: %u", vty_out (vty, " Destination Address: %s, VC ID: %u\n",
inet_ntoa(pw->lsr_id), pw->pwid); inet_ntoa(pw->lsr_id), pw->pwid);
/* local binding */ /* local binding */
if (pw->local_label != NO_LABEL) { if (pw->local_label != NO_LABEL) {
vty_outln (vty, " Local Label: %u", vty_out (vty, " Local Label: %u\n",
pw->local_label); pw->local_label);
vty_outln (vty, "%-8sCbit: %u, VC Type: %s, " vty_out (vty, "%-8sCbit: %u, VC Type: %s, "
"GroupID: %u", "", pw->local_cword, "GroupID: %u\n", "", pw->local_cword,
pw_type_name(pw->type),pw->local_gid); pw_type_name(pw->type),pw->local_gid);
vty_outln (vty, "%-8sMTU: %u", "",pw->local_ifmtu); vty_out (vty, "%-8sMTU: %u\n", "",pw->local_ifmtu);
} else } else
vty_outln (vty," Local Label: unassigned"); vty_out (vty," Local Label: unassigned\n");
/* remote binding */ /* remote binding */
if (pw->remote_label != NO_LABEL) { if (pw->remote_label != NO_LABEL) {
vty_outln (vty, " Remote Label: %u", vty_out (vty, " Remote Label: %u\n",
pw->remote_label); pw->remote_label);
vty_outln (vty, "%-8sCbit: %u, VC Type: %s, " vty_out (vty, "%-8sCbit: %u, VC Type: %s, "
"GroupID: %u", "", pw->remote_cword, "GroupID: %u\n", "", pw->remote_cword,
pw_type_name(pw->type),pw->remote_gid); pw_type_name(pw->type),pw->remote_gid);
vty_outln (vty, "%-8sMTU: %u", "",pw->remote_ifmtu); vty_out (vty, "%-8sMTU: %u\n", "",pw->remote_ifmtu);
} else } else
vty_outln (vty," Remote Label: unassigned"); vty_out (vty," Remote Label: unassigned\n");
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (1); return (1);
default: default:
break; break;
@ -1340,12 +1339,12 @@ show_l2vpn_pw_msg(struct vty *vty, struct imsg *imsg, struct show_params *params
case IMSG_CTL_SHOW_L2VPN_PW: case IMSG_CTL_SHOW_L2VPN_PW:
pw = imsg->data; pw = imsg->data;
vty_outln (vty, "%-9s %-15s %-10u %-16s %-10s", pw->ifname, vty_out (vty, "%-9s %-15s %-10u %-16s %-10s\n", pw->ifname,
inet_ntoa(pw->lsr_id), pw->pwid, pw->l2vpn_name, inet_ntoa(pw->lsr_id), pw->pwid, pw->l2vpn_name,
(pw->status ? "UP" : "DOWN")); (pw->status ? "UP" : "DOWN"));
break; break;
case IMSG_CTL_END: case IMSG_CTL_END:
vty_out (vty, VTYNL); vty_out (vty, "\n");
return (1); return (1);
default: default:
break; break;
@ -1540,7 +1539,7 @@ ldp_vty_dispatch(struct vty *vty, struct imsgbuf *ibuf, enum show_command cmd,
done: done:
close(ibuf->fd); close(ibuf->fd);
if (json) { if (json) {
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json); json_object_free(json);
} }
@ -1584,7 +1583,7 @@ ldp_vty_show_binding(struct vty *vty, const char *af_str, int detail, int json)
params.json = json; params.json = json;
if (!params.detail && !params.json) if (!params.detail && !params.json)
vty_outln (vty, "%-4s %-20s %-15s %-11s %-13s %6s", "AF", vty_out (vty, "%-4s %-20s %-15s %-11s %-13s %6s\n", "AF",
"Destination", "Nexthop", "Local Label", "Remote Label", "Destination", "Nexthop", "Local Label", "Remote Label",
"In Use"); "In Use");
@ -1612,7 +1611,7 @@ ldp_vty_show_discovery(struct vty *vty, const char *af_str, int detail,
params.json = json; params.json = json;
if (!params.detail && !params.json) if (!params.detail && !params.json)
vty_outln (vty, "%-4s %-15s %-8s %-15s %9s", vty_out (vty, "%-4s %-15s %-8s %-15s %9s\n",
"AF", "ID", "Type", "Source", "Holdtime"); "AF", "ID", "Type", "Source", "Holdtime");
if (params.detail) if (params.detail)
@ -1643,7 +1642,7 @@ ldp_vty_show_interface(struct vty *vty, const char *af_str, int json)
/* header */ /* header */
if (!params.json) { if (!params.json) {
vty_outln (vty, "%-4s %-11s %-6s %-8s %-12s %3s", "AF", vty_out (vty, "%-4s %-11s %-6s %-8s %-12s %3s\n", "AF",
"Interface", "State", "Uptime", "Hello Timers","ac"); "Interface", "State", "Uptime", "Hello Timers","ac");
} }
@ -1688,18 +1687,17 @@ ldp_vty_show_capabilities(struct vty *vty, int json)
"0x0603"); "0x0603");
json_object_array_add(json_array, json_cap); json_object_array_add(json_array, json_cap);
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json); json_object_free(json);
return (0); return (0);
} }
vty_outln (vty, vty_out (vty,
"Supported LDP Capabilities%s" "Supported LDP Capabilities\n"
" * Dynamic Announcement (0x0506)%s" " * Dynamic Announcement (0x0506)\n"
" * Typed Wildcard (0x050B)%s" " * Typed Wildcard (0x050B)\n"
" * Unrecognized Notification (0x0603)%s", VTYNL, " * Unrecognized Notification (0x0603)\n\n");
VTYNL, VTYNL, VTYNL);
return (0); return (0);
} }
@ -1722,7 +1720,7 @@ ldp_vty_show_neighbor(struct vty *vty, int capabilities, int detail, int json)
params.detail = 1; params.detail = 1;
if (!params.detail && !params.json) if (!params.detail && !params.json)
vty_outln (vty, "%-4s %-15s %-11s %-15s %8s", vty_out (vty, "%-4s %-15s %-11s %-15s %8s\n",
"AF", "ID", "State", "Remote Address","Uptime"); "AF", "ID", "State", "Remote Address","Uptime");
imsg_compose(&ibuf, IMSG_CTL_SHOW_NBR, 0, 0, -1, NULL, 0); imsg_compose(&ibuf, IMSG_CTL_SHOW_NBR, 0, 0, -1, NULL, 0);
@ -1759,9 +1757,9 @@ ldp_vty_show_atom_vc(struct vty *vty, int json)
if (!params.json) { if (!params.json) {
/* header */ /* header */
vty_outln (vty, "%-9s %-15s %-10s %-16s %-10s", vty_out (vty, "%-9s %-15s %-10s %-16s %-10s\n",
"Interface", "Peer ID", "VC ID", "Name","Status"); "Interface", "Peer ID", "VC ID", "Name","Status");
vty_outln (vty, "%-9s %-15s %-10s %-16s %-10s", vty_out (vty, "%-9s %-15s %-10s %-16s %-10s\n",
"---------", "---------------", "----------", "---------", "---------------", "----------",
"----------------", "----------"); "----------------", "----------");
} }
@ -1780,7 +1778,7 @@ ldp_vty_clear_nbr(struct vty *vty, const char *addr_str)
if (addr_str && if (addr_str &&
(ldp_get_address(addr_str, &nbr.af, &nbr.raddr) == -1 || (ldp_get_address(addr_str, &nbr.af, &nbr.raddr) == -1 ||
bad_addr(nbr.af, &nbr.raddr))) { bad_addr(nbr.af, &nbr.raddr))) {
vty_outln (vty, "%% Malformed address"); vty_out (vty, "%% Malformed address\n");
return (CMD_WARNING); return (CMD_WARNING);
} }

View File

@ -168,7 +168,7 @@ static int
config_write_agentx (struct vty *vty) config_write_agentx (struct vty *vty)
{ {
if (agentx_enabled) if (agentx_enabled)
vty_outln (vty, "agentx"); vty_out (vty, "agentx\n");
return 1; return 1;
} }
@ -185,7 +185,7 @@ DEFUN (agentx_enable,
agentx_enabled = 1; agentx_enabled = 1;
return CMD_SUCCESS; return CMD_SUCCESS;
} }
vty_outln (vty, "SNMP AgentX already enabled"); vty_out (vty, "SNMP AgentX already enabled\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -196,7 +196,7 @@ DEFUN (no_agentx,
"SNMP AgentX protocol settings\n") "SNMP AgentX protocol settings\n")
{ {
if (!agentx_enabled) return CMD_SUCCESS; if (!agentx_enabled) return CMD_SUCCESS;
vty_outln (vty, "SNMP AgentX support cannot be disabled once enabled"); vty_out (vty, "SNMP AgentX support cannot be disabled once enabled\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }

View File

@ -394,8 +394,8 @@ bfd_show_param(struct vty *vty, struct bfd_info *bfd_info, int bfd_tag,
} }
else else
{ {
vty_outln (vty, " %s%sDetect Mul: %d, Min Rx interval: %d," vty_out (vty, " %s%sDetect Mul: %d, Min Rx interval: %d,"
" Min Tx interval: %d", " Min Tx interval: %d\n",
(extra_space) ? " ": "", (bfd_tag) ? "BFD: " : " ", (extra_space) ? " ": "", (bfd_tag) ? "BFD: " : " ",
bfd_info->detect_mult, bfd_info->required_min_rx, bfd_info->detect_mult, bfd_info->required_min_rx,
bfd_info->desired_min_tx); bfd_info->desired_min_tx);
@ -423,7 +423,7 @@ bfd_show_status(struct vty *vty, struct bfd_info *bfd_info, int bfd_tag,
} }
else else
{ {
vty_outln (vty, " %s%sStatus: %s, Last update: %s", vty_out (vty, " %s%sStatus: %s, Last update: %s\n",
(extra_space) ? " ": "", (bfd_tag) ? "BFD: " : " ", (extra_space) ? " ": "", (bfd_tag) ? "BFD: " : " ",
bfd_get_status_str(bfd_info->status), time_buf); bfd_get_status_str(bfd_info->status), time_buf);
} }
@ -451,7 +451,7 @@ bfd_show_info(struct vty *vty, struct bfd_info *bfd_info, int multihop,
} }
else else
{ {
vty_outln (vty, " %sBFD: Type: %s", (extra_space) ? " " : "", vty_out (vty, " %sBFD: Type: %s\n", (extra_space) ? " " : "",
(multihop) ? "multi hop" : "single hop"); (multihop) ? "multi hop" : "single hop");
} }
@ -461,7 +461,7 @@ bfd_show_info(struct vty *vty, struct bfd_info *bfd_info, int multihop,
if (use_json) if (use_json)
json_object_object_add(json_obj, "peerBfdInfo", json_bfd); json_object_object_add(json_obj, "peerBfdInfo", json_bfd);
else else
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
/* /*

View File

@ -199,6 +199,50 @@ buffer_putstr (struct buffer *b, const char *c)
buffer_put(b, c, strlen(c)); buffer_put(b, c, strlen(c));
} }
/* Expand \n to \r\n */
void
buffer_put_crlf(struct buffer *b, const void *origp, size_t origsize)
{
struct buffer_data *data = b->tail;
const char *p = origp, *end = p + origsize, *lf;
size_t size;
lf = memchr(p, '\n', end - p);
/* We use even last one byte of data buffer. */
while (p < end)
{
size_t avail, chunk;
/* If there is no data buffer add it. */
if (data == NULL || data->cp == b->size)
data = buffer_add (b);
size = (lf ? lf : end) - p;
avail = b->size - data->cp;
chunk = (size <= avail) ? size : avail;
memcpy (data->data + data->cp, p, chunk);
p += chunk;
data->cp += chunk;
if (lf && size <= avail)
{
/* we just copied up to (including) a '\n' */
if (data->cp == b->size)
data = buffer_add (b);
data->data[data->cp++] = '\r';
if (data->cp == b->size)
data = buffer_add (b);
data->data[data->cp++] = '\n';
p++;
lf = memchr(p, '\n', end - p);
}
}
}
/* Keep flushing data to the fd until the buffer is empty or an error is /* Keep flushing data to the fd until the buffer is empty or an error is
encountered or the operation would block. */ encountered or the operation would block. */
buffer_status_t buffer_status_t

View File

@ -41,6 +41,8 @@ extern void buffer_put (struct buffer *, const void *, size_t);
extern void buffer_putc (struct buffer *, u_char); extern void buffer_putc (struct buffer *, u_char);
/* Add a NUL-terminated string to the end of the buffer. */ /* Add a NUL-terminated string to the end of the buffer. */
extern void buffer_putstr (struct buffer *, const char *); extern void buffer_putstr (struct buffer *, const char *);
/* Add given data, inline-expanding \n to \r\n */
extern void buffer_put_crlf(struct buffer *b, const void *p, size_t size);
/* Combine all accumulated (and unflushed) data inside the buffer into a /* Combine all accumulated (and unflushed) data inside the buffer into a
single NUL-terminated string allocated using XMALLOC(MTYPE_TMP). Note single NUL-terminated string allocated using XMALLOC(MTYPE_TMP). Note

View File

@ -433,27 +433,27 @@ static int
config_write_host (struct vty *vty) config_write_host (struct vty *vty)
{ {
if (host.name) if (host.name)
vty_outln (vty, "hostname %s", host.name); vty_out (vty, "hostname %s\n", host.name);
if (host.encrypt) if (host.encrypt)
{ {
if (host.password_encrypt) if (host.password_encrypt)
vty_outln (vty, "password 8 %s", host.password_encrypt); vty_out (vty, "password 8 %s\n", host.password_encrypt);
if (host.enable_encrypt) if (host.enable_encrypt)
vty_outln (vty, "enable password 8 %s", host.enable_encrypt); vty_out (vty, "enable password 8 %s\n", host.enable_encrypt);
} }
else else
{ {
if (host.password) if (host.password)
vty_outln (vty, "password %s", host.password); vty_out (vty, "password %s\n", host.password);
if (host.enable) if (host.enable)
vty_outln (vty, "enable password %s", host.enable); vty_out (vty, "enable password %s\n", host.enable);
} }
if (zlog_default->default_lvl != LOG_DEBUG) if (zlog_default->default_lvl != LOG_DEBUG)
{ {
vty_outln (vty,"! N.B. The 'log trap' command is deprecated."); vty_out (vty,"! N.B. The 'log trap' command is deprecated.\n");
vty_outln (vty, "log trap %s", vty_out (vty, "log trap %s\n",
zlog_priority[zlog_default->default_lvl]); zlog_priority[zlog_default->default_lvl]);
} }
@ -463,7 +463,7 @@ config_write_host (struct vty *vty)
if (zlog_default->maxlvl[ZLOG_DEST_FILE] != zlog_default->default_lvl) if (zlog_default->maxlvl[ZLOG_DEST_FILE] != zlog_default->default_lvl)
vty_out (vty, " %s", vty_out (vty, " %s",
zlog_priority[zlog_default->maxlvl[ZLOG_DEST_FILE]]); zlog_priority[zlog_default->maxlvl[ZLOG_DEST_FILE]]);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (zlog_default->maxlvl[ZLOG_DEST_STDOUT] != ZLOG_DISABLED) if (zlog_default->maxlvl[ZLOG_DEST_STDOUT] != ZLOG_DISABLED)
@ -472,13 +472,13 @@ config_write_host (struct vty *vty)
if (zlog_default->maxlvl[ZLOG_DEST_STDOUT] != zlog_default->default_lvl) if (zlog_default->maxlvl[ZLOG_DEST_STDOUT] != zlog_default->default_lvl)
vty_out (vty, " %s", vty_out (vty, " %s",
zlog_priority[zlog_default->maxlvl[ZLOG_DEST_STDOUT]]); zlog_priority[zlog_default->maxlvl[ZLOG_DEST_STDOUT]]);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED) if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED)
vty_outln (vty,"no log monitor"); vty_out (vty,"no log monitor\n");
else if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] != zlog_default->default_lvl) else if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] != zlog_default->default_lvl)
vty_outln (vty,"log monitor %s", vty_out (vty,"log monitor %s\n",
zlog_priority[zlog_default->maxlvl[ZLOG_DEST_MONITOR]]); zlog_priority[zlog_default->maxlvl[ZLOG_DEST_MONITOR]]);
if (zlog_default->maxlvl[ZLOG_DEST_SYSLOG] != ZLOG_DISABLED) if (zlog_default->maxlvl[ZLOG_DEST_SYSLOG] != ZLOG_DISABLED)
@ -487,33 +487,33 @@ config_write_host (struct vty *vty)
if (zlog_default->maxlvl[ZLOG_DEST_SYSLOG] != zlog_default->default_lvl) if (zlog_default->maxlvl[ZLOG_DEST_SYSLOG] != zlog_default->default_lvl)
vty_out (vty, " %s", vty_out (vty, " %s",
zlog_priority[zlog_default->maxlvl[ZLOG_DEST_SYSLOG]]); zlog_priority[zlog_default->maxlvl[ZLOG_DEST_SYSLOG]]);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (zlog_default->facility != LOG_DAEMON) if (zlog_default->facility != LOG_DAEMON)
vty_outln (vty, "log facility %s", vty_out (vty, "log facility %s\n",
facility_name(zlog_default->facility)); facility_name(zlog_default->facility));
if (zlog_default->record_priority == 1) if (zlog_default->record_priority == 1)
vty_outln (vty, "log record-priority"); vty_out (vty, "log record-priority\n");
if (zlog_default->timestamp_precision > 0) if (zlog_default->timestamp_precision > 0)
vty_outln (vty, "log timestamp precision %d", vty_out (vty, "log timestamp precision %d\n",
zlog_default->timestamp_precision); zlog_default->timestamp_precision);
if (host.advanced) if (host.advanced)
vty_outln (vty, "service advanced-vty"); vty_out (vty, "service advanced-vty\n");
if (host.encrypt) if (host.encrypt)
vty_outln (vty, "service password-encryption"); vty_out (vty, "service password-encryption\n");
if (host.lines >= 0) if (host.lines >= 0)
vty_outln (vty, "service terminal-length %d",host.lines); vty_out (vty, "service terminal-length %d\n",host.lines);
if (host.motdfile) if (host.motdfile)
vty_outln (vty, "banner motd file %s", host.motdfile); vty_out (vty, "banner motd file %s\n", host.motdfile);
else if (! host.motd) else if (! host.motd)
vty_outln (vty, "no banner motd"); vty_out (vty, "no banner motd\n");
return 1; return 1;
} }
@ -718,13 +718,12 @@ cmd_variable_complete (struct cmd_token *token, const char *arg, vector comps)
#define AUTOCOMP_INDENT 5 #define AUTOCOMP_INDENT 5
char * char *
cmd_variable_comp2str(vector comps, unsigned short cols, const char nl[]) cmd_variable_comp2str(vector comps, unsigned short cols)
{ {
size_t bsz = 16; size_t bsz = 16;
char *buf = XCALLOC(MTYPE_TMP, bsz); char *buf = XCALLOC(MTYPE_TMP, bsz);
int lc = AUTOCOMP_INDENT; int lc = AUTOCOMP_INDENT;
size_t cs = AUTOCOMP_INDENT; size_t cs = AUTOCOMP_INDENT;
size_t nllen = strlen(nl);
size_t itemlen; size_t itemlen;
snprintf(buf, bsz, "%*s", AUTOCOMP_INDENT, ""); snprintf(buf, bsz, "%*s", AUTOCOMP_INDENT, "");
for (size_t j = 0; j < vector_active (comps); j++) for (size_t j = 0; j < vector_active (comps); j++)
@ -732,12 +731,12 @@ cmd_variable_comp2str(vector comps, unsigned short cols, const char nl[])
char *item = vector_slot (comps, j); char *item = vector_slot (comps, j);
itemlen = strlen(item); itemlen = strlen(item);
if (cs + itemlen + nllen + AUTOCOMP_INDENT + 2 >= bsz) if (cs + itemlen + AUTOCOMP_INDENT + 3 >= bsz)
buf = XREALLOC(MTYPE_TMP, buf, (bsz *= 2)); buf = XREALLOC(MTYPE_TMP, buf, (bsz *= 2));
if (lc + itemlen + 1 >= cols) if (lc + itemlen + 1 >= cols)
{ {
cs += snprintf(&buf[cs], bsz - cs, "%s%*s", nl, AUTOCOMP_INDENT, ""); cs += snprintf(&buf[cs], bsz - cs, "\n%*s", AUTOCOMP_INDENT, "");
lc = AUTOCOMP_INDENT; lc = AUTOCOMP_INDENT;
} }
@ -1184,7 +1183,7 @@ DEFUN (config_terminal,
vty->node = CONFIG_NODE; vty->node = CONFIG_NODE;
else else
{ {
vty_outln (vty, "VTY configuration is locked by other VTY"); vty_out (vty, "VTY configuration is locked by other VTY\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1381,10 +1380,10 @@ DEFUN (show_version,
SHOW_STR SHOW_STR
"Displays zebra version\n") "Displays zebra version\n")
{ {
vty_outln (vty, "%s %s (%s).", FRR_FULL_NAME, FRR_VERSION, vty_out (vty, "%s %s (%s).\n", FRR_FULL_NAME, FRR_VERSION,
host.name ? host.name : ""); host.name ? host.name : "");
vty_outln (vty, "%s%s", FRR_COPYRIGHT, GIT_INFO); vty_out (vty, "%s%s\n", FRR_COPYRIGHT, GIT_INFO);
vty_outln (vty, "configured with:%s %s", VTYNL, vty_out (vty, "configured with:\n %s\n",
FRR_CONFIG_ARGS); FRR_CONFIG_ARGS);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1408,21 +1407,19 @@ DEFUN (config_help,
"help", "help",
"Description of the interactive help system\n") "Description of the interactive help system\n")
{ {
vty_outln (vty, vty_out (vty,
"Quagga VTY provides advanced help feature. When you need help,%s\ "Quagga VTY provides advanced help feature. When you need help,\n\
anytime at the command line please press '?'.%s\ anytime at the command line please press '?'.\n\
%s\ \n\
If nothing matches, the help list will be empty and you must backup%s\ If nothing matches, the help list will be empty and you must backup\n\
until entering a '?' shows the available options.%s\ until entering a '?' shows the available options.\n\
Two styles of help are provided:%s\ Two styles of help are provided:\n\
1. Full help is available when you are ready to enter a%s\ 1. Full help is available when you are ready to enter a\n\
command argument (e.g. 'show ?') and describes each possible%s\ command argument (e.g. 'show ?') and describes each possible\n\
argument.%s\ argument.\n\
2. Partial help is provided when an abbreviated argument is entered%s\ 2. Partial help is provided when an abbreviated argument is entered\n\
and you want to know what arguments match the input%s\ and you want to know what arguments match the input\n\
(e.g. 'show me?'.)%s", VTYNL, VTYNL, VTYNL, (e.g. 'show me?'.)\n\n");
VTYNL, VTYNL, VTYNL, VTYNL, VTYNL,
VTYNL, VTYNL, VTYNL, VTYNL);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1456,7 +1453,7 @@ permute (struct graph_node *start, struct vty *vty)
} }
if (gn == start) if (gn == start)
vty_out (vty, "..."); vty_out (vty, "...");
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
else else
{ {
@ -1490,7 +1487,7 @@ cmd_list_cmds (struct vty *vty, int do_permute)
if ((element = vector_slot (node->cmd_vector, i)) && if ((element = vector_slot (node->cmd_vector, i)) &&
element->attr != CMD_ATTR_DEPRECATED && element->attr != CMD_ATTR_DEPRECATED &&
element->attr != CMD_ATTR_HIDDEN) element->attr != CMD_ATTR_HIDDEN)
vty_outln (vty, " %s", element->string); vty_out (vty, " %s\n", element->string);
} }
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1523,25 +1520,25 @@ vty_write_config (struct vty *vty)
if (vty->type == VTY_TERM) if (vty->type == VTY_TERM)
{ {
vty_outln (vty, "%sCurrent configuration:",VTYNL); vty_out (vty, "\nCurrent configuration:\n");
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
vty_outln (vty, "frr version %s", FRR_VER_SHORT); vty_out (vty, "frr version %s\n", FRR_VER_SHORT);
vty_outln (vty, "frr defaults %s", DFLT_NAME); vty_out (vty, "frr defaults %s\n", DFLT_NAME);
vty_outln (vty, "!"); vty_out (vty, "!\n");
for (i = 0; i < vector_active (cmdvec); i++) for (i = 0; i < vector_active (cmdvec); i++)
if ((node = vector_slot (cmdvec, i)) && node->func if ((node = vector_slot (cmdvec, i)) && node->func
&& (node->vtysh || vty->type != VTY_SHELL)) && (node->vtysh || vty->type != VTY_SHELL))
{ {
if ((*node->func) (vty)) if ((*node->func) (vty))
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
if (vty->type == VTY_TERM) if (vty->type == VTY_TERM)
{ {
vty_outln (vty, "end"); vty_out (vty, "end\n");
} }
} }
@ -1578,7 +1575,7 @@ DEFUN (config_write,
/* Check and see if we are operating under vtysh configuration */ /* Check and see if we are operating under vtysh configuration */
if (host.config == NULL) if (host.config == NULL)
{ {
vty_outln (vty,"Can't save to configuration file, using vtysh."); vty_out (vty,"Can't save to configuration file, using vtysh.\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1613,12 +1610,12 @@ DEFUN (config_write,
fd = mkstemp (config_file_tmp); fd = mkstemp (config_file_tmp);
if (fd < 0) if (fd < 0)
{ {
vty_outln (vty, "Can't open configuration file %s.",config_file_tmp); vty_out (vty, "Can't open configuration file %s.\n",config_file_tmp);
goto finished; goto finished;
} }
if (fchmod (fd, CONFIGFILE_MASK) != 0) if (fchmod (fd, CONFIGFILE_MASK) != 0)
{ {
vty_outln (vty, "Can't chmod configuration file %s: %s (%d).", vty_out (vty, "Can't chmod configuration file %s: %s (%d).\n",
config_file_tmp, safe_strerror(errno), errno); config_file_tmp, safe_strerror(errno), errno);
goto finished; goto finished;
} }
@ -1640,13 +1637,13 @@ DEFUN (config_write,
if (unlink (config_file_sav) != 0) if (unlink (config_file_sav) != 0)
if (errno != ENOENT) if (errno != ENOENT)
{ {
vty_outln (vty, "Can't unlink backup configuration file %s.", vty_out (vty, "Can't unlink backup configuration file %s.\n",
config_file_sav); config_file_sav);
goto finished; goto finished;
} }
if (link (config_file, config_file_sav) != 0) if (link (config_file, config_file_sav) != 0)
{ {
vty_outln (vty, "Can't backup old configuration file %s.", vty_out (vty, "Can't backup old configuration file %s.\n",
config_file_sav); config_file_sav);
goto finished; goto finished;
} }
@ -1655,13 +1652,13 @@ DEFUN (config_write,
} }
if (rename (config_file_tmp, config_file) != 0) if (rename (config_file_tmp, config_file) != 0)
{ {
vty_outln (vty, "Can't save configuration file %s.",config_file); vty_out (vty, "Can't save configuration file %s.\n",config_file);
goto finished; goto finished;
} }
if (dirfd >= 0) if (dirfd >= 0)
fsync (dirfd); fsync (dirfd);
vty_outln (vty, "Configuration saved to %s",config_file); vty_out (vty, "Configuration saved to %s\n",config_file);
ret = CMD_SUCCESS; ret = CMD_SUCCESS;
finished: finished:
@ -1716,7 +1713,7 @@ DEFUN (show_startup_config,
confp = fopen (host.config, "r"); confp = fopen (host.config, "r");
if (confp == NULL) if (confp == NULL)
{ {
vty_outln (vty, "Can't open configuration file [%s] due to '%s'", vty_out (vty, "Can't open configuration file [%s] due to '%s'\n",
host.config, safe_strerror(errno)); host.config, safe_strerror(errno));
return CMD_WARNING; return CMD_WARNING;
} }
@ -1729,7 +1726,7 @@ DEFUN (show_startup_config,
cp++; cp++;
*cp = '\0'; *cp = '\0';
vty_outln (vty, "%s", buf); vty_out (vty, "%s\n", buf);
} }
fclose (confp); fclose (confp);
@ -1756,7 +1753,7 @@ DEFUN (config_hostname,
if (!isalpha((int) word->arg[0])) if (!isalpha((int) word->arg[0]))
{ {
vty_outln (vty, "Please specify string starting with alphabet"); vty_out (vty, "Please specify string starting with alphabet\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1796,8 +1793,8 @@ DEFUN (config_password,
if (!isalnum (argv[idx_8]->arg[0])) if (!isalnum (argv[idx_8]->arg[0]))
{ {
vty_outln (vty, vty_out (vty,
"Please specify string starting with alphanumeric"); "Please specify string starting with alphanumeric\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1846,15 +1843,15 @@ DEFUN (config_enable_password,
} }
else else
{ {
vty_outln (vty, "Unknown encryption type."); vty_out (vty, "Unknown encryption type.\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
if (!isalnum (argv[idx_8]->arg[0])) if (!isalnum (argv[idx_8]->arg[0]))
{ {
vty_outln (vty, vty_out (vty,
"Please specify string starting with alphanumeric"); "Please specify string starting with alphanumeric\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2003,7 +2000,7 @@ DEFUN_HIDDEN (do_echo,
{ {
char *message; char *message;
vty_outln (vty, "%s", vty_out (vty, "%s\n",
((message = argv_concat(argv, argc, 1)) ? message : "")); ((message = argv_concat(argv, argc, 1)) ? message : ""));
if (message) if (message)
XFREE(MTYPE_TMP, message); XFREE(MTYPE_TMP, message);
@ -2047,7 +2044,7 @@ DEFUN (show_logging,
vty_out (vty, "level %s, facility %s, ident %s", vty_out (vty, "level %s, facility %s, ident %s",
zlog_priority[zl->maxlvl[ZLOG_DEST_SYSLOG]], zlog_priority[zl->maxlvl[ZLOG_DEST_SYSLOG]],
facility_name(zl->facility), zl->ident); facility_name(zl->facility), zl->ident);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, "Stdout logging: "); vty_out (vty, "Stdout logging: ");
if (zl->maxlvl[ZLOG_DEST_STDOUT] == ZLOG_DISABLED) if (zl->maxlvl[ZLOG_DEST_STDOUT] == ZLOG_DISABLED)
@ -2055,7 +2052,7 @@ DEFUN (show_logging,
else else
vty_out (vty, "level %s", vty_out (vty, "level %s",
zlog_priority[zl->maxlvl[ZLOG_DEST_STDOUT]]); zlog_priority[zl->maxlvl[ZLOG_DEST_STDOUT]]);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, "Monitor logging: "); vty_out (vty, "Monitor logging: ");
if (zl->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED) if (zl->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED)
@ -2063,7 +2060,7 @@ DEFUN (show_logging,
else else
vty_out (vty, "level %s", vty_out (vty, "level %s",
zlog_priority[zl->maxlvl[ZLOG_DEST_MONITOR]]); zlog_priority[zl->maxlvl[ZLOG_DEST_MONITOR]]);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, "File logging: "); vty_out (vty, "File logging: ");
if ((zl->maxlvl[ZLOG_DEST_FILE] == ZLOG_DISABLED) || if ((zl->maxlvl[ZLOG_DEST_FILE] == ZLOG_DISABLED) ||
@ -2073,13 +2070,13 @@ DEFUN (show_logging,
vty_out (vty, "level %s, filename %s", vty_out (vty, "level %s, filename %s",
zlog_priority[zl->maxlvl[ZLOG_DEST_FILE]], zlog_priority[zl->maxlvl[ZLOG_DEST_FILE]],
zl->filename); zl->filename);
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_outln (vty, "Protocol name: %s", vty_out (vty, "Protocol name: %s\n",
zl->protoname); zl->protoname);
vty_outln (vty, "Record priority: %s", vty_out (vty, "Record priority: %s\n",
(zl->record_priority ? "enabled" : "disabled")); (zl->record_priority ? "enabled" : "disabled"));
vty_outln (vty, "Timestamp precision: %d", vty_out (vty, "Timestamp precision: %d\n",
zl->timestamp_precision); zl->timestamp_precision);
return CMD_SUCCESS; return CMD_SUCCESS;

View File

@ -406,6 +406,6 @@ struct cmd_variable_handler {
extern void cmd_variable_complete (struct cmd_token *token, const char *arg, vector comps); extern void cmd_variable_complete (struct cmd_token *token, const char *arg, vector comps);
extern void cmd_variable_handler_register (const struct cmd_variable_handler *cvh); extern void cmd_variable_handler_register (const struct cmd_variable_handler *cvh);
extern char *cmd_variable_comp2str (vector comps, unsigned short cols, const char nl[]); extern char *cmd_variable_comp2str (vector comps, unsigned short cols);
#endif /* _ZEBRA_COMMAND_H */ #endif /* _ZEBRA_COMMAND_H */

View File

@ -349,7 +349,7 @@ DEFUN (no_distribute_list,
if (! ret) if (! ret)
{ {
vty_outln (vty, "distribute list doesn't exist"); vty_out (vty, "distribute list doesn't exist\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
return CMD_SUCCESS; return CMD_SUCCESS;
@ -393,9 +393,9 @@ config_show_distribute (struct vty *vty)
DISTRIBUTE_V6_OUT, has_print); DISTRIBUTE_V6_OUT, has_print);
} }
if (has_print) if (has_print)
vty_out (vty, VTYNL); vty_out (vty, "\n");
else else
vty_outln (vty, " not set"); vty_out (vty, " not set\n");
for (i = 0; i < disthash->size; i++) for (i = 0; i < disthash->size; i++)
for (mp = disthash->index[i]; mp; mp = mp->next) for (mp = disthash->index[i]; mp; mp = mp->next)
@ -414,9 +414,9 @@ config_show_distribute (struct vty *vty)
has_print = distribute_print(vty, dist->prefix, 1, has_print = distribute_print(vty, dist->prefix, 1,
DISTRIBUTE_V6_OUT, has_print); DISTRIBUTE_V6_OUT, has_print);
if (has_print) if (has_print)
vty_out (vty, VTYNL); vty_out (vty, "\n");
else else
vty_outln (vty, " nothing"); vty_out (vty, " nothing\n");
} }
} }
@ -437,9 +437,9 @@ config_show_distribute (struct vty *vty)
DISTRIBUTE_V6_IN, has_print); DISTRIBUTE_V6_IN, has_print);
} }
if (has_print) if (has_print)
vty_out (vty, VTYNL); vty_out (vty, "\n");
else else
vty_outln (vty, " not set"); vty_out (vty, " not set\n");
for (i = 0; i < disthash->size; i++) for (i = 0; i < disthash->size; i++)
for (mp = disthash->index[i]; mp; mp = mp->next) for (mp = disthash->index[i]; mp; mp = mp->next)
@ -458,9 +458,9 @@ config_show_distribute (struct vty *vty)
has_print = distribute_print(vty, dist->prefix, 1, has_print = distribute_print(vty, dist->prefix, 1,
DISTRIBUTE_V6_IN, has_print); DISTRIBUTE_V6_IN, has_print);
if (has_print) if (has_print)
vty_out (vty, VTYNL); vty_out (vty, "\n");
else else
vty_outln (vty, " nothing"); vty_out (vty, " nothing\n");
} }
} }
return 0; return 0;
@ -487,7 +487,7 @@ config_write_distribute (struct vty *vty)
if (dist->list[j]) { if (dist->list[j]) {
output = j == DISTRIBUTE_V4_OUT || j == DISTRIBUTE_V6_OUT; output = j == DISTRIBUTE_V4_OUT || j == DISTRIBUTE_V6_OUT;
v6 = j == DISTRIBUTE_V6_IN || j == DISTRIBUTE_V6_OUT; v6 = j == DISTRIBUTE_V6_IN || j == DISTRIBUTE_V6_OUT;
vty_outln (vty, " %sdistribute-list %s %s %s", vty_out (vty, " %sdistribute-list %s %s %s\n",
v6 ? "ipv6 " : "", v6 ? "ipv6 " : "",
dist->list[j], dist->list[j],
output ? "out" : "in", output ? "out" : "in",
@ -499,7 +499,7 @@ config_write_distribute (struct vty *vty)
if (dist->prefix[j]) { if (dist->prefix[j]) {
output = j == DISTRIBUTE_V4_OUT || j == DISTRIBUTE_V6_OUT; output = j == DISTRIBUTE_V4_OUT || j == DISTRIBUTE_V6_OUT;
v6 = j == DISTRIBUTE_V6_IN || j == DISTRIBUTE_V6_OUT; v6 = j == DISTRIBUTE_V6_IN || j == DISTRIBUTE_V6_OUT;
vty_outln (vty, " %sdistribute-list prefix %s %s %s", vty_out (vty, " %sdistribute-list prefix %s %s %s\n",
v6 ? "ipv6 " : "", v6 ? "ipv6 " : "",
dist->prefix[j], dist->prefix[j],
output ? "out" : "in", output ? "out" : "in",

View File

@ -576,7 +576,7 @@ vty_access_list_remark_unset (struct vty *vty, afi_t afi, const char *name)
access = access_list_lookup (afi, name); access = access_list_lookup (afi, name);
if (! access) if (! access)
{ {
vty_outln (vty, "%% access-list %s doesn't exist",name); vty_out (vty, "%% access-list %s doesn't exist\n",name);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -615,21 +615,21 @@ filter_set_cisco (struct vty *vty, const char *name_str, const char *type_str,
type = FILTER_DENY; type = FILTER_DENY;
else else
{ {
vty_outln (vty, "%% filter type must be permit or deny"); vty_out (vty, "%% filter type must be permit or deny\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
ret = inet_aton (addr_str, &addr); ret = inet_aton (addr_str, &addr);
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty,"%%Inconsistent address and mask"); vty_out (vty,"%%Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
ret = inet_aton (addr_mask_str, &addr_mask); ret = inet_aton (addr_mask_str, &addr_mask);
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty,"%%Inconsistent address and mask"); vty_out (vty,"%%Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -638,14 +638,14 @@ filter_set_cisco (struct vty *vty, const char *name_str, const char *type_str,
ret = inet_aton (mask_str, &mask); ret = inet_aton (mask_str, &mask);
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty,"%%Inconsistent address and mask"); vty_out (vty,"%%Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
ret = inet_aton (mask_mask_str, &mask_mask); ret = inet_aton (mask_mask_str, &mask_mask);
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty,"%%Inconsistent address and mask"); vty_out (vty,"%%Inconsistent address and mask\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -1256,8 +1256,8 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str,
if (strlen(name_str) > ACL_NAMSIZ) if (strlen(name_str) > ACL_NAMSIZ)
{ {
vty_outln (vty, "%% ACL name %s is invalid: length exceeds " vty_out (vty, "%% ACL name %s is invalid: length exceeds "
"%d characters", "%d characters\n",
name_str, ACL_NAMSIZ); name_str, ACL_NAMSIZ);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1269,7 +1269,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str,
type = FILTER_DENY; type = FILTER_DENY;
else 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; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1279,7 +1279,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str,
ret = str2prefix_ipv4 (prefix_str, (struct prefix_ipv4 *)&p); ret = str2prefix_ipv4 (prefix_str, (struct prefix_ipv4 *)&p);
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty,"IP address prefix/prefixlen is malformed"); vty_out (vty,"IP address prefix/prefixlen is malformed\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -1288,7 +1288,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str,
ret = str2prefix_ipv6 (prefix_str, (struct prefix_ipv6 *) &p); ret = str2prefix_ipv6 (prefix_str, (struct prefix_ipv6 *) &p);
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty,"IPv6 address prefix/prefixlen is malformed"); vty_out (vty,"IPv6 address prefix/prefixlen is malformed\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -1424,7 +1424,7 @@ DEFUN (no_access_list_all,
access = access_list_lookup (AFI_IP, argv[idx_acl]->arg); access = access_list_lookup (AFI_IP, argv[idx_acl]->arg);
if (access == NULL) if (access == NULL)
{ {
vty_outln (vty, "%% access-list %s doesn't exist",argv[idx_acl]->arg); vty_out (vty, "%% access-list %s doesn't exist\n",argv[idx_acl]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1601,7 +1601,7 @@ DEFUN (no_ipv6_access_list_all,
access = access_list_lookup (AFI_IP6, argv[idx_word]->arg); access = access_list_lookup (AFI_IP6, argv[idx_word]->arg);
if (access == NULL) if (access == NULL)
{ {
vty_outln (vty, "%% access-list %s doesn't exist",argv[idx_word]->arg); vty_out (vty, "%% access-list %s doesn't exist\n",argv[idx_word]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1688,7 +1688,7 @@ filter_show (struct vty *vty, const char *name, afi_t afi)
return 0; return 0;
/* Print the name of the protocol */ /* Print the name of the protocol */
vty_outln (vty, "%s:", frr_protoname); vty_out (vty, "%s:\n", frr_protoname);
for (access = master->num.head; access; access = access->next) for (access = master->num.head; access; access = access->next)
{ {
@ -1703,7 +1703,7 @@ filter_show (struct vty *vty, const char *name, afi_t afi)
if (write) if (write)
{ {
vty_outln (vty, "%s IP%s access list %s", vty_out (vty, "%s IP%s access list %s\n",
mfilter->cisco ? mfilter->cisco ?
(filter->extended ? "Extended" : "Standard") : "Zebra", (filter->extended ? "Extended" : "Standard") : "Zebra",
afi == AFI_IP6 ? "v6" : "", afi == AFI_IP6 ? "v6" : "",
@ -1721,13 +1721,13 @@ filter_show (struct vty *vty, const char *name, afi_t afi)
else else
{ {
if (filter->addr_mask.s_addr == 0xffffffff) if (filter->addr_mask.s_addr == 0xffffffff)
vty_outln (vty, " any"); vty_out (vty, " any\n");
else else
{ {
vty_out (vty, " %s", inet_ntoa (filter->addr)); vty_out (vty, " %s", inet_ntoa (filter->addr));
if (filter->addr_mask.s_addr != 0) if (filter->addr_mask.s_addr != 0)
vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask)); vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask));
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
} }
@ -1746,7 +1746,7 @@ filter_show (struct vty *vty, const char *name, afi_t afi)
if (write) if (write)
{ {
vty_outln (vty, "%s IP%s access list %s", vty_out (vty, "%s IP%s access list %s\n",
mfilter->cisco ? mfilter->cisco ?
(filter->extended ? "Extended" : "Standard") : "Zebra", (filter->extended ? "Extended" : "Standard") : "Zebra",
afi == AFI_IP6 ? "v6" : "", afi == AFI_IP6 ? "v6" : "",
@ -1764,13 +1764,13 @@ filter_show (struct vty *vty, const char *name, afi_t afi)
else else
{ {
if (filter->addr_mask.s_addr == 0xffffffff) if (filter->addr_mask.s_addr == 0xffffffff)
vty_outln (vty, " any"); vty_out (vty, " any\n");
else else
{ {
vty_out (vty, " %s", inet_ntoa (filter->addr)); vty_out (vty, " %s", inet_ntoa (filter->addr));
if (filter->addr_mask.s_addr != 0) if (filter->addr_mask.s_addr != 0)
vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask)); vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask));
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
} }
@ -1855,18 +1855,18 @@ config_write_access_cisco (struct vty *vty, struct filter *mfilter)
vty_out (vty, " %s", inet_ntoa (filter->mask)); vty_out (vty, " %s", inet_ntoa (filter->mask));
vty_out (vty, " %s", inet_ntoa (filter->mask_mask)); vty_out (vty, " %s", inet_ntoa (filter->mask_mask));
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
else else
{ {
if (filter->addr_mask.s_addr == 0xffffffff) if (filter->addr_mask.s_addr == 0xffffffff)
vty_outln (vty, " any"); vty_out (vty, " any\n");
else else
{ {
vty_out (vty, " %s", inet_ntoa (filter->addr)); vty_out (vty, " %s", inet_ntoa (filter->addr));
if (filter->addr_mask.s_addr != 0) if (filter->addr_mask.s_addr != 0)
vty_out (vty, " %s", inet_ntoa (filter->addr_mask)); vty_out (vty, " %s", inet_ntoa (filter->addr_mask));
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
} }
@ -1889,7 +1889,7 @@ config_write_access_zebra (struct vty *vty, struct filter *mfilter)
p->prefixlen, p->prefixlen,
filter->exact ? " exact-match" : ""); filter->exact ? " exact-match" : "");
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
static int static int
@ -1908,7 +1908,7 @@ config_write_access (struct vty *vty, afi_t afi)
{ {
if (access->remark) if (access->remark)
{ {
vty_outln (vty, "%saccess-list %s remark %s", vty_out (vty, "%saccess-list %s remark %s\n",
afi == AFI_IP ? "" : "ipv6 ", afi == AFI_IP ? "" : "ipv6 ",
access->name,access->remark); access->name,access->remark);
write++; write++;
@ -1934,7 +1934,7 @@ config_write_access (struct vty *vty, afi_t afi)
{ {
if (access->remark) if (access->remark)
{ {
vty_outln (vty, "%saccess-list %s remark %s", vty_out (vty, "%saccess-list %s remark %s\n",
afi == AFI_IP ? "" : "ipv6 ", afi == AFI_IP ? "" : "ipv6 ",
access->name,access->remark); access->name,access->remark);
write++; write++;

View File

@ -52,7 +52,7 @@ struct graph *nodegraph = NULL, *nodegraph_free = NULL;
#define check_nodegraph() \ #define check_nodegraph() \
do { if (!nodegraph) { \ do { if (!nodegraph) { \
vty_outln(vty, "nodegraph not initialized"); \ vty_out(vty, "nodegraph not initialized\n"); \
return CMD_WARNING; \ return CMD_WARNING; \
} } while (0) } } while (0)
@ -128,7 +128,7 @@ DEFUN (grammar_test_complete,
// print completions // print completions
for (i = 0; i < vector_active (comps); i++) { for (i = 0; i < vector_active (comps); i++) {
tkn = vector_slot (comps, i); tkn = vector_slot (comps, i);
vty_outln (vty, " %-*s %s", width, tkn->text, tkn->desc); vty_out (vty, " %-*s %s\n", width, tkn->text, tkn->desc);
} }
for (i = 0; i < vector_active (comps); i++) for (i = 0; i < vector_active (comps); i++)
@ -136,7 +136,7 @@ DEFUN (grammar_test_complete,
vector_free (comps); vector_free (comps);
} }
else else
vty_outln (vty, "%% No match"); vty_out (vty, "%% No match\n");
// free resources // free resources
list_delete (completions); list_delete (completions);
@ -176,13 +176,13 @@ DEFUN (grammar_test_match,
// print completions or relevant error message // print completions or relevant error message
if (element) if (element)
{ {
vty_outln (vty, "Matched: %s", element->string); vty_out (vty, "Matched: %s\n", element->string);
struct listnode *ln; struct listnode *ln;
struct cmd_token *token; struct cmd_token *token;
for (ALL_LIST_ELEMENTS_RO(argvv,ln,token)) for (ALL_LIST_ELEMENTS_RO(argvv,ln,token))
vty_outln (vty, "%s -- %s", token->text, token->arg); vty_out (vty, "%s -- %s\n", token->text, token->arg);
vty_outln (vty, "func: %p", element->func); vty_out (vty, "func: %p\n", element->func);
list_delete (argvv); list_delete (argvv);
} }
@ -190,16 +190,16 @@ DEFUN (grammar_test_match,
assert(MATCHER_ERROR(result)); assert(MATCHER_ERROR(result));
switch (result) { switch (result) {
case MATCHER_NO_MATCH: case MATCHER_NO_MATCH:
vty_outln (vty, "%% Unknown command"); vty_out (vty, "%% Unknown command\n");
break; break;
case MATCHER_INCOMPLETE: case MATCHER_INCOMPLETE:
vty_outln (vty, "%% Incomplete command"); vty_out (vty, "%% Incomplete command\n");
break; break;
case MATCHER_AMBIGUOUS: case MATCHER_AMBIGUOUS:
vty_outln (vty, "%% Ambiguous command"); vty_out (vty, "%% Ambiguous command\n");
break; break;
default: default:
vty_outln (vty, "%% Unknown error"); vty_out (vty, "%% Unknown error\n");
break; break;
} }
} }
@ -411,7 +411,7 @@ DEFUN (grammar_findambig,
nodegraph = cnode->cmdgraph; nodegraph = cnode->cmdgraph;
if (!nodegraph) if (!nodegraph)
continue; continue;
vty_outln (vty, "scanning node %d", scannode - 1); vty_out (vty, "scanning node %d\n", scannode - 1);
} }
commands = cmd_graph_permutations (nodegraph); commands = cmd_graph_permutations (nodegraph);
@ -420,25 +420,25 @@ DEFUN (grammar_findambig,
{ {
int same = prev && !strcmp (prev->cmd, cur->cmd); int same = prev && !strcmp (prev->cmd, cur->cmd);
if (printall && !same) if (printall && !same)
vty_outln (vty, "'%s' [%x]", cur->cmd, cur->el->daemon); vty_out (vty, "'%s' [%x]\n", cur->cmd, cur->el->daemon);
if (same) if (same)
{ {
vty_outln (vty, "'%s' AMBIGUOUS:", cur->cmd); vty_out (vty, "'%s' AMBIGUOUS:\n", cur->cmd);
vty_outln (vty, " %s%s '%s'", prev->el->name, VTYNL, vty_out (vty, " %s\n '%s'\n", prev->el->name,
prev->el->string); prev->el->string);
vty_outln (vty, " %s%s '%s'", cur->el->name, VTYNL, vty_out (vty, " %s\n '%s'\n", cur->el->name,
cur->el->string); cur->el->string);
vty_out (vty, VTYNL); vty_out (vty, "\n");
ambig++; ambig++;
} }
prev = cur; prev = cur;
} }
list_delete (commands); list_delete (commands);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} while (scan && scannode < LINK_PARAMS_NODE); } while (scan && scannode < LINK_PARAMS_NODE);
vty_outln (vty, "%d ambiguous commands found.", ambig); vty_out (vty, "%d ambiguous commands found.\n", ambig);
if (scan) if (scan)
nodegraph = NULL; nodegraph = NULL;
@ -475,11 +475,11 @@ DEFUN (grammar_access,
cnode = vector_slot (cmdvec, atoi (argv[2]->arg)); cnode = vector_slot (cmdvec, atoi (argv[2]->arg));
if (!cnode) if (!cnode)
{ {
vty_outln (vty, "%% no such node"); vty_out (vty, "%% no such node\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
vty_outln (vty, "node %d", (int)cnode->node); vty_out (vty, "node %d\n", (int)cnode->node);
nodegraph = cnode->cmdgraph; nodegraph = cnode->cmdgraph;
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -542,7 +542,7 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level,
if (stackpos == MAXDEPTH) if (stackpos == MAXDEPTH)
{ {
vty_outln (vty, " -aborting! (depth limit)"); vty_out (vty, " -aborting! (depth limit)\n");
return; return;
} }
stack[stackpos++] = start; stack[stackpos++] = start;
@ -551,7 +551,7 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level,
if (numto) if (numto)
{ {
if (numto > 1) if (numto > 1)
vty_out (vty, VTYNL); vty_out (vty, "\n");
for (unsigned int i = 0; i < vector_active (start->to); i++) for (unsigned int i = 0; i < vector_active (start->to); i++)
{ {
struct graph_node *adj = vector_slot (start->to, i); struct graph_node *adj = vector_slot (start->to, i);
@ -563,12 +563,12 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level,
if (adj == start) if (adj == start)
vty_out(vty, "*"); vty_out(vty, "*");
else if (((struct cmd_token *)adj->data)->type == END_TKN) else if (((struct cmd_token *)adj->data)->type == END_TKN)
vty_outln (vty, "--END"); vty_out (vty, "--END\n");
else { else {
size_t k; size_t k;
for (k = 0; k < stackpos; k++) for (k = 0; k < stackpos; k++)
if (stack[k] == adj) { if (stack[k] == adj) {
vty_outln (vty, "<<loop@%zu ", k); vty_out (vty, "<<loop@%zu \n", k);
break; break;
} }
if (k == stackpos) if (k == stackpos)
@ -577,7 +577,7 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level,
} }
} }
else else
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
static void static void
@ -660,5 +660,5 @@ init_cmdgraph (struct vty *vty, struct graph **graph)
struct cmd_token *token = cmd_token_new (START_TKN, 0, NULL, NULL); struct cmd_token *token = cmd_token_new (START_TKN, 0, NULL, NULL);
graph_new_node (*graph, token, (void (*)(void *)) &cmd_token_del); graph_new_node (*graph, token, (void (*)(void *)) &cmd_token_del);
if (vty) if (vty)
vty_outln (vty, "initialized graph"); vty_out (vty, "initialized graph\n");
} }

View File

@ -426,7 +426,7 @@ DEFUN(show_hash_stats,
if (!_hashes) if (!_hashes)
{ {
pthread_mutex_unlock (&_hashes_mtx); pthread_mutex_unlock (&_hashes_mtx);
vty_outln (vty, "No hash tables in use."); vty_out (vty, "No hash tables in use.\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -460,21 +460,21 @@ DEFUN(show_hash_stats,
char underln[sizeof(header) + strlen(frr_protonameinst)]; char underln[sizeof(header) + strlen(frr_protonameinst)];
memset (underln, '-', sizeof(underln)); memset (underln, '-', sizeof(underln));
underln[sizeof(underln) - 1] = '\0'; underln[sizeof(underln) - 1] = '\0';
vty_outln (vty, "%s%s", header, frr_protonameinst); vty_out (vty, "%s%s\n", header, frr_protonameinst);
vty_outln (vty, "%s", underln); vty_out (vty, "%s\n", underln);
vty_outln (vty, "# allocated: %d", _hashes->count); vty_out (vty, "# allocated: %d\n", _hashes->count);
vty_outln (vty, "# named: %d%s", tt->nrows - 1, VTYNL); vty_out (vty, "# named: %d\n\n", tt->nrows - 1);
if (tt->nrows > 1) if (tt->nrows > 1)
{ {
ttable_colseps (tt, 0, RIGHT, true, '|'); ttable_colseps (tt, 0, RIGHT, true, '|');
char *table = ttable_dump (tt, VTYNL); char *table = ttable_dump (tt, "\n");
vty_out (vty, "%s%s", table, VTYNL); vty_out (vty, "%s\n", table);
XFREE (MTYPE_TMP, table); XFREE (MTYPE_TMP, table);
} }
else else
vty_outln (vty, "No named hash tables to display."); vty_out (vty, "No named hash tables to display.\n");
ttable_del (tt); ttable_del (tt);

View File

@ -690,8 +690,8 @@ DEFUN (interface,
if ((sl = strlen(ifname)) > INTERFACE_NAMSIZ) if ((sl = strlen(ifname)) > INTERFACE_NAMSIZ)
{ {
vty_outln (vty, "%% Interface name %s is invalid: length exceeds " vty_out (vty, "%% Interface name %s is invalid: length exceeds "
"%d characters", "%d characters\n",
ifname, INTERFACE_NAMSIZ); ifname, INTERFACE_NAMSIZ);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -709,7 +709,7 @@ DEFUN (interface,
if (!ifp) if (!ifp)
{ {
vty_outln (vty, "%% interface %s not in %s", ifname, vrfname); vty_out (vty, "%% interface %s not in %s\n", ifname, vrfname);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
VTY_PUSH_CONTEXT (INTERFACE_NODE, ifp); VTY_PUSH_CONTEXT (INTERFACE_NODE, ifp);
@ -739,14 +739,13 @@ DEFUN_NOSH (no_interface,
if (ifp == NULL) if (ifp == NULL)
{ {
vty_out (vty, "%% Interface %s does not exist%s", ifname, VTYNL); vty_out (vty, "%% Interface %s does not exist\n", ifname);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{ {
vty_out (vty, "%% Only inactive interfaces can be deleted%s", vty_out (vty, "%% Only inactive interfaces can be deleted\n");
VTYNL);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -793,8 +792,7 @@ DEFUN (show_address,
p = ifc->address; p = ifc->address;
if (p->family == AF_INET) if (p->family == AF_INET)
vty_out (vty, "%s/%d%s", inet_ntoa (p->u.prefix4), p->prefixlen, vty_out (vty, "%s/%d\n", inet_ntoa (p->u.prefix4), p->prefixlen);
VTYNL);
} }
} }
return CMD_SUCCESS; return CMD_SUCCESS;
@ -819,8 +817,7 @@ DEFUN (show_address_vrf_all,
if (!vrf->iflist || !listcount (vrf->iflist)) if (!vrf->iflist || !listcount (vrf->iflist))
continue; continue;
vty_out (vty, "%sVRF %u%s%s", VTYNL, vrf->vrf_id, VTYNL, vty_out (vty, "\nVRF %u\n\n", vrf->vrf_id);
VTYNL);
for (ALL_LIST_ELEMENTS_RO (vrf->iflist, node, ifp)) for (ALL_LIST_ELEMENTS_RO (vrf->iflist, node, ifp))
{ {
@ -829,8 +826,7 @@ DEFUN (show_address_vrf_all,
p = ifc->address; p = ifc->address;
if (p->family == AF_INET) if (p->family == AF_INET)
vty_out (vty, "%s/%d%s", inet_ntoa (p->u.prefix4), p->prefixlen, vty_out (vty, "%s/%d\n", inet_ntoa (p->u.prefix4), p->prefixlen);
VTYNL);
} }
} }
} }

View File

@ -228,7 +228,7 @@ DEFUN (if_rmap,
type = IF_RMAP_OUT; type = IF_RMAP_OUT;
else else
{ {
vty_outln (vty, "route-map direction must be [in|out]"); vty_out (vty, "route-map direction must be [in|out]\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -259,14 +259,14 @@ DEFUN (no_if_rmap,
type = IF_RMAP_OUT; type = IF_RMAP_OUT;
else else
{ {
vty_outln (vty, "route-map direction must be [in|out]"); vty_out (vty, "route-map direction must be [in|out]\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
ret = if_rmap_unset (argv[idx_ifname]->arg, type, argv[idx_routemap_name]->arg); ret = if_rmap_unset (argv[idx_ifname]->arg, type, argv[idx_routemap_name]->arg);
if (! ret) if (! ret)
{ {
vty_outln (vty, "route-map doesn't exist"); vty_out (vty, "route-map doesn't exist\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
return CMD_SUCCESS; return CMD_SUCCESS;
@ -290,7 +290,7 @@ config_write_if_rmap (struct vty *vty)
if (if_rmap->routemap[IF_RMAP_IN]) if (if_rmap->routemap[IF_RMAP_IN])
{ {
vty_outln (vty, " route-map %s in %s", vty_out (vty, " route-map %s in %s\n",
if_rmap->routemap[IF_RMAP_IN], if_rmap->routemap[IF_RMAP_IN],
if_rmap->ifname); if_rmap->ifname);
write++; write++;
@ -298,7 +298,7 @@ config_write_if_rmap (struct vty *vty)
if (if_rmap->routemap[IF_RMAP_OUT]) if (if_rmap->routemap[IF_RMAP_OUT])
{ {
vty_outln (vty, " route-map %s out %s", vty_out (vty, " route-map %s out %s\n",
if_rmap->routemap[IF_RMAP_OUT], if_rmap->routemap[IF_RMAP_OUT],
if_rmap->ifname); if_rmap->ifname);
write++; write++;

View File

@ -271,7 +271,7 @@ DEFUN (no_key_chain,
if (! keychain) if (! keychain)
{ {
vty_outln (vty, "Can't find keychain %s", argv[idx_word]->arg); vty_out (vty, "Can't find keychain %s\n", argv[idx_word]->arg);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -314,7 +314,7 @@ DEFUN (no_key,
key = key_lookup (keychain, index); key = key_lookup (keychain, index);
if (! key) if (! key)
{ {
vty_outln (vty, "Can't find key %d", index); vty_out (vty, "Can't find key %d\n", index);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -477,20 +477,20 @@ key_lifetime_set (struct vty *vty, struct key_range *krange,
time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str); time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str);
if (time_start < 0) if (time_start < 0)
{ {
vty_outln (vty, "Malformed time value"); vty_out (vty, "Malformed time value\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
time_end = key_str2time (etime_str, eday_str, emonth_str, eyear_str); time_end = key_str2time (etime_str, eday_str, emonth_str, eyear_str);
if (time_end < 0) if (time_end < 0)
{ {
vty_outln (vty, "Malformed time value"); vty_out (vty, "Malformed time value\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (time_end <= time_start) if (time_end <= time_start)
{ {
vty_outln (vty, "Expire time is not later than start time"); vty_out (vty, "Expire time is not later than start time\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -512,7 +512,7 @@ key_lifetime_duration_set (struct vty *vty, struct key_range *krange,
time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str); time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str);
if (time_start < 0) if (time_start < 0)
{ {
vty_outln (vty, "Malformed time value"); vty_out (vty, "Malformed time value\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
krange->start = time_start; krange->start = time_start;
@ -534,7 +534,7 @@ key_lifetime_infinite_set (struct vty *vty, struct key_range *krange,
time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str); time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str);
if (time_start < 0) if (time_start < 0)
{ {
vty_outln (vty, "Malformed time value"); vty_out (vty, "Malformed time value\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
krange->start = time_start; krange->start = time_start;
@ -966,14 +966,14 @@ keychain_config_write (struct vty *vty)
for (ALL_LIST_ELEMENTS_RO (keychain_list, node, keychain)) for (ALL_LIST_ELEMENTS_RO (keychain_list, node, keychain))
{ {
vty_outln (vty, "key chain %s", keychain->name); vty_out (vty, "key chain %s\n", keychain->name);
for (ALL_LIST_ELEMENTS_RO (keychain->key, knode, key)) for (ALL_LIST_ELEMENTS_RO (keychain->key, knode, key))
{ {
vty_outln (vty, " key %d", key->index); vty_out (vty, " key %d\n", key->index);
if (key->string) if (key->string)
vty_outln (vty, " key-string %s", key->string); vty_out (vty, " key-string %s\n", key->string);
if (key->accept.start) if (key->accept.start)
{ {
@ -990,7 +990,7 @@ keychain_config_write (struct vty *vty)
keychain_strftime (buf, BUFSIZ, &key->accept.end); keychain_strftime (buf, BUFSIZ, &key->accept.end);
vty_out (vty, " %s", buf); vty_out (vty, " %s", buf);
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (key->send.start) if (key->send.start)
@ -1007,10 +1007,10 @@ keychain_config_write (struct vty *vty)
keychain_strftime (buf, BUFSIZ, &key->send.end); keychain_strftime (buf, BUFSIZ, &key->send.end);
vty_out (vty, " %s", buf); vty_out (vty, " %s", buf);
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
return 0; return 0;

View File

@ -44,26 +44,26 @@ show_memory_mallinfo (struct vty *vty)
struct mallinfo minfo = mallinfo(); struct mallinfo minfo = mallinfo();
char buf[MTYPE_MEMSTR_LEN]; char buf[MTYPE_MEMSTR_LEN];
vty_outln (vty, "System allocator statistics:"); vty_out (vty, "System allocator statistics:\n");
vty_outln (vty, " Total heap allocated: %s", vty_out (vty, " Total heap allocated: %s\n",
mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.arena)); mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.arena));
vty_outln (vty, " Holding block headers: %s", vty_out (vty, " Holding block headers: %s\n",
mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.hblkhd)); mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.hblkhd));
vty_outln (vty, " Used small blocks: %s", vty_out (vty, " Used small blocks: %s\n",
mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.usmblks)); mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.usmblks));
vty_outln (vty, " Used ordinary blocks: %s", vty_out (vty, " Used ordinary blocks: %s\n",
mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.uordblks)); mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.uordblks));
vty_outln (vty, " Free small blocks: %s", vty_out (vty, " Free small blocks: %s\n",
mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.fsmblks)); mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.fsmblks));
vty_outln (vty, " Free ordinary blocks: %s", vty_out (vty, " Free ordinary blocks: %s\n",
mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.fordblks)); mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.fordblks));
vty_outln (vty, " Ordinary blocks: %ld", vty_out (vty, " Ordinary blocks: %ld\n",
(unsigned long)minfo.ordblks); (unsigned long)minfo.ordblks);
vty_outln (vty, " Small blocks: %ld", vty_out (vty, " Small blocks: %ld\n",
(unsigned long)minfo.smblks); (unsigned long)minfo.smblks);
vty_outln (vty, " Holding blocks: %ld", vty_out (vty, " Holding blocks: %ld\n",
(unsigned long)minfo.hblks); (unsigned long)minfo.hblks);
vty_outln (vty,"(see system documentation for 'mallinfo' for meaning)"); vty_out (vty,"(see system documentation for 'mallinfo' for meaning)\n");
return 1; return 1;
} }
#endif /* HAVE_MALLINFO */ #endif /* HAVE_MALLINFO */
@ -72,12 +72,12 @@ static int qmem_walker(void *arg, struct memgroup *mg, struct memtype *mt)
{ {
struct vty *vty = arg; struct vty *vty = arg;
if (!mt) if (!mt)
vty_outln (vty, "--- qmem %s ---", mg->name); vty_out (vty, "--- qmem %s ---\n", mg->name);
else { else {
if (mt->n_alloc != 0) { if (mt->n_alloc != 0) {
char size[32]; char size[32];
snprintf(size, sizeof(size), "%6zu", mt->size); snprintf(size, sizeof(size), "%6zu", mt->size);
vty_outln (vty, "%-30s: %10zu %s", vty_out (vty, "%-30s: %10zu %s\n",
mt->name, mt->n_alloc, mt->name, mt->n_alloc,
mt->size == 0 ? "" : mt->size == SIZE_VAR ? "(variably sized)" : size); mt->size == 0 ? "" : mt->size == SIZE_VAR ? "(variably sized)" : size);
} }
@ -108,14 +108,13 @@ DEFUN (show_modules,
{ {
struct frrmod_runtime *plug = frrmod_list; struct frrmod_runtime *plug = frrmod_list;
vty_outln (vty, "%-12s %-25s %s%s", vty_out (vty, "%-12s %-25s %s\n\n",
"Module Name", "Version", "Description", "Module Name", "Version", "Description");
VTYNL);
while (plug) while (plug)
{ {
const struct frrmod_info *i = plug->info; const struct frrmod_info *i = plug->info;
vty_outln (vty, "%-12s %-25s %s", i->name, i->version,i->description); vty_out (vty, "%-12s %-25s %s\n", i->name, i->version,i->description);
if (plug->dl_handle) if (plug->dl_handle)
{ {
#ifdef HAVE_DLINFO_ORIGIN #ifdef HAVE_DLINFO_ORIGIN
@ -129,13 +128,13 @@ DEFUN (show_modules,
{ {
name = strrchr(lm->l_name, '/'); name = strrchr(lm->l_name, '/');
name = name ? name + 1 : lm->l_name; name = name ? name + 1 : lm->l_name;
vty_outln (vty, "\tfrom: %s/%s", origin, name); vty_out (vty, "\tfrom: %s/%s\n", origin, name);
} }
# else # else
vty_outln (vty, "\tfrom: %s ", origin, plug->load_name); vty_out (vty, "\tfrom: %s \n", origin, plug->load_name);
# endif # endif
#else #else
vty_outln (vty, "\tfrom: %s", plug->load_name); vty_out (vty, "\tfrom: %s\n", plug->load_name);
#endif #endif
} }
plug = plug->next; plug = plug->next;

View File

@ -296,7 +296,7 @@ ns_netns_pathname (struct vty *vty, const char *name)
if (! result) if (! result)
{ {
vty_outln (vty, "Invalid pathname: %s",safe_strerror(errno)); vty_out (vty, "Invalid pathname: %s\n",safe_strerror(errno));
return NULL; return NULL;
} }
return pathname; return pathname;
@ -324,8 +324,8 @@ DEFUN_NOSH (ns_netns,
if (ns->name && strcmp (ns->name, pathname) != 0) if (ns->name && strcmp (ns->name, pathname) != 0)
{ {
vty_out (vty, "NS %u is already configured with NETNS %s%s", vty_out (vty, "NS %u is already configured with NETNS %s\n",
ns->ns_id, ns->name, VTYNL); ns->ns_id, ns->name);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -334,8 +334,8 @@ DEFUN_NOSH (ns_netns,
if (!ns_enable (ns)) if (!ns_enable (ns))
{ {
vty_out (vty, "Can not associate NS %u with NETNS %s%s", vty_out (vty, "Can not associate NS %u with NETNS %s\n",
ns->ns_id, ns->name, VTYNL); ns->ns_id, ns->name);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -365,13 +365,13 @@ DEFUN (no_ns_netns,
if (!ns) if (!ns)
{ {
vty_outln (vty, "NS %u is not found", ns_id); vty_out (vty, "NS %u is not found\n", ns_id);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
if (ns->name && strcmp (ns->name, pathname) != 0) if (ns->name && strcmp (ns->name, pathname) != 0)
{ {
vty_outln (vty, "Incorrect NETNS file name"); vty_out (vty, "Incorrect NETNS file name\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -405,7 +405,7 @@ ns_config_write (struct vty *vty)
if (ns->ns_id == NS_DEFAULT || ns->name == NULL) if (ns->ns_id == NS_DEFAULT || ns->name == NULL)
continue; continue;
vty_outln (vty, "logical-router %u netns %s", ns->ns_id,ns->name); vty_out (vty, "logical-router %u netns %s\n", ns->ns_id,ns->name);
write = 1; write = 1;
} }

View File

@ -882,7 +882,7 @@ prefix_entry_dup_check (struct prefix_list *plist,
static int static int
vty_invalid_prefix_range (struct vty *vty, const char *prefix) vty_invalid_prefix_range (struct vty *vty, const char *prefix)
{ {
vty_outln (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value", vty_out (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value\n",
prefix); prefix);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -920,7 +920,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
type = PREFIX_DENY; type = PREFIX_DENY;
else else
{ {
vty_outln (vty, "%% prefix type must be permit or deny"); vty_out (vty, "%% prefix type must be permit or deny\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -940,7 +940,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty, "%% Malformed IPv4 prefix"); vty_out (vty, "%% Malformed IPv4 prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -962,7 +962,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty, "%% Malformed IPv6 prefix"); vty_out (vty, "%% Malformed IPv6 prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -973,7 +973,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
break; break;
case AFI_L2VPN: case AFI_L2VPN:
default: default:
vty_outln (vty, "%% Unrecognized AFI (%d)", afi); vty_out (vty, "%% Unrecognized AFI (%d)\n", afi);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
break; break;
} }
@ -1042,7 +1042,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
plist = prefix_list_lookup (afi, name); plist = prefix_list_lookup (afi, name);
if (! plist) if (! plist)
{ {
vty_outln (vty, "%% Can't find specified prefix-list"); vty_out (vty, "%% Can't find specified prefix-list\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1057,7 +1057,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
/* We must have, at a minimum, both the type and prefix here */ /* We must have, at a minimum, both the type and prefix here */
if ((typestr == NULL) || (prefix == NULL)) if ((typestr == NULL) || (prefix == NULL))
{ {
vty_outln (vty, "%% Both prefix and type required"); vty_out (vty, "%% Both prefix and type required\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1078,7 +1078,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
type = PREFIX_DENY; type = PREFIX_DENY;
else else
{ {
vty_outln (vty, "%% prefix type must be permit or deny"); vty_out (vty, "%% prefix type must be permit or deny\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1096,7 +1096,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty, "%% Malformed IPv4 prefix"); vty_out (vty, "%% Malformed IPv4 prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -1113,7 +1113,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty, "%% Malformed IPv6 prefix"); vty_out (vty, "%% Malformed IPv6 prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }
@ -1123,7 +1123,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
if (pentry == NULL) if (pentry == NULL)
{ {
vty_outln (vty, "%% Can't find specified prefix-list"); vty_out (vty, "%% Can't find specified prefix-list\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1141,7 +1141,7 @@ vty_prefix_list_desc_unset (struct vty *vty, afi_t afi, const char *name)
plist = prefix_list_lookup (afi, name); plist = prefix_list_lookup (afi, name);
if (! plist) if (! plist)
{ {
vty_outln (vty, "%% Can't find specified prefix-list"); vty_out (vty, "%% Can't find specified prefix-list\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1179,21 +1179,21 @@ vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist,
if (dtype == normal_display) if (dtype == normal_display)
{ {
vty_outln (vty, "ip%s prefix-list %s: %d entries", vty_out (vty, "ip%s prefix-list %s: %d entries\n",
afi == AFI_IP ? "" : "v6", afi == AFI_IP ? "" : "v6",
plist->name, plist->count); plist->name, plist->count);
if (plist->desc) if (plist->desc)
vty_outln (vty, " Description: %s", plist->desc); vty_out (vty, " Description: %s\n", plist->desc);
} }
else if (dtype == summary_display || dtype == detail_display) else if (dtype == summary_display || dtype == detail_display)
{ {
vty_outln (vty, "ip%s prefix-list %s:", vty_out (vty, "ip%s prefix-list %s:\n",
afi == AFI_IP ? "" : "v6", plist->name); afi == AFI_IP ? "" : "v6", plist->name);
if (plist->desc) if (plist->desc)
vty_outln (vty, " Description: %s", plist->desc); vty_out (vty, " Description: %s\n", plist->desc);
vty_outln (vty, " count: %d, range entries: %d, sequences: %u - %u", vty_out (vty, " count: %d, range entries: %d, sequences: %u - %u\n",
plist->count, plist->rangecount, plist->count, plist->rangecount,
plist->head ? plist->head->seq : 0, plist->head ? plist->head->seq : 0,
plist->tail ? plist->tail->seq : 0); plist->tail ? plist->tail->seq : 0);
@ -1234,7 +1234,7 @@ vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist,
vty_out (vty, " (hit count: %ld, refcount: %ld)", vty_out (vty, " (hit count: %ld, refcount: %ld)",
pentry->hitcnt, pentry->refcnt); pentry->hitcnt, pentry->refcnt);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
} }
@ -1259,7 +1259,7 @@ vty_show_prefix_list (struct vty *vty, afi_t afi, const char *name,
plist = prefix_list_lookup (afi, name); plist = prefix_list_lookup (afi, name);
if (! plist) if (! plist)
{ {
vty_outln (vty, "%% Can't find specified prefix-list"); vty_out (vty, "%% Can't find specified prefix-list\n");
return CMD_WARNING; return CMD_WARNING;
} }
vty_show_prefix_entry (vty, afi, plist, master, dtype, seqnum); vty_show_prefix_entry (vty, afi, plist, master, dtype, seqnum);
@ -1269,7 +1269,7 @@ vty_show_prefix_list (struct vty *vty, afi_t afi, const char *name,
if (dtype == detail_display || dtype == summary_display) if (dtype == detail_display || dtype == summary_display)
{ {
if (master->recent) if (master->recent)
vty_outln (vty, "Prefix-list with the last deletion/insertion: %s", vty_out (vty, "Prefix-list with the last deletion/insertion: %s\n",
master->recent->name); master->recent->name);
} }
@ -1296,14 +1296,14 @@ vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, const char *name,
plist = prefix_list_lookup (afi, name); plist = prefix_list_lookup (afi, name);
if (! plist) if (! plist)
{ {
vty_outln (vty, "%% Can't find specified prefix-list"); vty_out (vty, "%% Can't find specified prefix-list\n");
return CMD_WARNING; return CMD_WARNING;
} }
ret = str2prefix (prefix, &p); ret = str2prefix (prefix, &p);
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty, "%% prefix is malformed"); vty_out (vty, "%% prefix is malformed\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1346,7 +1346,7 @@ vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, const char *name,
vty_out (vty, " (hit count: %ld, refcount: %ld)", vty_out (vty, " (hit count: %ld, refcount: %ld)",
pentry->hitcnt, pentry->refcnt); pentry->hitcnt, pentry->refcnt);
vty_out (vty, VTYNL); vty_out (vty, "\n");
if (type == first_match_display) if (type == first_match_display)
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1384,7 +1384,7 @@ vty_clear_prefix_list (struct vty *vty, afi_t afi, const char *name,
plist = prefix_list_lookup (afi, name); plist = prefix_list_lookup (afi, name);
if (! plist) if (! plist)
{ {
vty_outln (vty, "%% Can't find specified prefix-list"); vty_out (vty, "%% Can't find specified prefix-list\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -1393,7 +1393,7 @@ vty_clear_prefix_list (struct vty *vty, afi_t afi, const char *name,
ret = str2prefix (prefix, &p); ret = str2prefix (prefix, &p);
if (ret <= 0) if (ret <= 0)
{ {
vty_outln (vty, "%% prefix is malformed"); vty_out (vty, "%% prefix is malformed\n");
return CMD_WARNING; return CMD_WARNING;
} }
} }
@ -1816,16 +1816,16 @@ config_write_prefix_afi (afi_t afi, struct vty *vty)
if (! master->seqnum) if (! master->seqnum)
{ {
vty_outln (vty, "no ip%s prefix-list sequence-number", vty_out (vty, "no ip%s prefix-list sequence-number\n",
afi == AFI_IP ? "" : "v6"); afi == AFI_IP ? "" : "v6");
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
for (plist = master->num.head; plist; plist = plist->next) for (plist = master->num.head; plist; plist = plist->next)
{ {
if (plist->desc) if (plist->desc)
{ {
vty_outln (vty, "ip%s prefix-list %s description %s", vty_out (vty, "ip%s prefix-list %s description %s\n",
afi == AFI_IP ? "" : "v6", afi == AFI_IP ? "" : "v6",
plist->name, plist->desc); plist->name, plist->desc);
write++; write++;
@ -1858,17 +1858,17 @@ config_write_prefix_afi (afi_t afi, struct vty *vty)
if (pentry->le) if (pentry->le)
vty_out (vty, " le %d", pentry->le); vty_out (vty, " le %d", pentry->le);
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }
/* vty_out (vty, "!%s", VTYNL); */ /* vty_out (vty, "!\n"); */
} }
for (plist = master->str.head; plist; plist = plist->next) for (plist = master->str.head; plist; plist = plist->next)
{ {
if (plist->desc) if (plist->desc)
{ {
vty_outln (vty, "ip%s prefix-list %s description %s", vty_out (vty, "ip%s prefix-list %s description %s\n",
afi == AFI_IP ? "" : "v6", afi == AFI_IP ? "" : "v6",
plist->name, plist->desc); plist->name, plist->desc);
write++; write++;
@ -1901,7 +1901,7 @@ config_write_prefix_afi (afi_t afi, struct vty *vty)
if (pentry->le) if (pentry->le)
vty_out (vty, " le %d", pentry->le); vty_out (vty, " le %d", pentry->le);
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
write++; write++;
} }
} }
@ -2046,13 +2046,13 @@ prefix_bgp_show_prefix_list (struct vty *vty, afi_t afi, char *name, u_char use_
else else
json_object_object_add(json, "ipv6PrefixList", json_prefix); json_object_object_add(json, "ipv6PrefixList", json_prefix);
vty_outln (vty, "%s", vty_out (vty, "%s\n",
json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
json_object_free(json); json_object_free(json);
} }
else else
{ {
vty_outln (vty, "ip%s prefix-list %s: %d entries", vty_out (vty, "ip%s prefix-list %s: %d entries\n",
afi == AFI_IP ? "" : "v6", afi == AFI_IP ? "" : "v6",
plist->name, plist->count); plist->name, plist->count);
@ -2071,7 +2071,7 @@ prefix_bgp_show_prefix_list (struct vty *vty, afi_t afi, char *name, u_char use_
if (pentry->le) if (pentry->le)
vty_out (vty, " le %d", pentry->le); vty_out (vty, " le %d", pentry->le);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
} }
return plist->count; return plist->count;

View File

@ -113,19 +113,15 @@ sub codelist {
$protodetail{$p}->{"shorthelp"}); $protodetail{$p}->{"shorthelp"});
if (length($str . $s) > 70) { if (length($str . $s) > 70) {
$str =~ s/ $//; $str =~ s/ $//;
push @lines, $str . "%s\" \\\n"; push @lines, $str . "\\n\" \\\n";
$str = " \" "; $str = " \" ";
} }
$str .= $s; $str .= $s;
} }
$str =~ s/ $//; $str =~ s/ $//;
push @lines, $str . "%s\" \\\n"; push @lines, $str . "\\n\" \\\n";
push @lines, " \" > - selected route, * - FIB route%s%s\", \\\n"; push @lines, " \" > - selected route, * - FIB route\\n\\n\"";
my @nl = (); return join("", @lines);
for (my $c = 0; $c < @lines + 1; $c++) {
push @nl, "VTYNL"
}
return join("", @lines) ." ". join(", ", @nl);
} }
print "\n"; print "\n";

View File

@ -521,10 +521,10 @@ generic_match_add (struct vty *vty, struct route_map_index *index,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst); vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.", vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n",
frr_protonameinst); frr_protonameinst);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -568,10 +568,10 @@ generic_match_delete (struct vty *vty, struct route_map_index *index,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst); vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst);
break; break;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.", vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n",
frr_protonameinst); frr_protonameinst);
break; break;
} }
@ -605,10 +605,10 @@ generic_set_add (struct vty *vty, struct route_map_index *index,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst); vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.", vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n",
frr_protonameinst); frr_protonameinst);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -628,10 +628,10 @@ generic_set_delete (struct vty *vty, struct route_map_index *index,
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst); vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.", vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n",
frr_protonameinst); frr_protonameinst);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -993,43 +993,43 @@ vty_show_route_map_entry (struct vty *vty, struct route_map *map)
struct route_map_index *index; struct route_map_index *index;
struct route_map_rule *rule; struct route_map_rule *rule;
vty_outln (vty, "%s:", frr_protonameinst); vty_out (vty, "%s:\n", frr_protonameinst);
for (index = map->head; index; index = index->next) for (index = map->head; index; index = index->next)
{ {
vty_outln (vty, "route-map %s, %s, sequence %d", vty_out (vty, "route-map %s, %s, sequence %d\n",
map->name, route_map_type_str (index->type), map->name, route_map_type_str (index->type),
index->pref); index->pref);
/* Description */ /* Description */
if (index->description) if (index->description)
vty_outln (vty, " Description:%s %s", VTYNL, vty_out (vty, " Description:\n %s\n",
index->description); index->description);
/* Match clauses */ /* Match clauses */
vty_outln (vty, " Match clauses:"); vty_out (vty, " Match clauses:\n");
for (rule = index->match_list.head; rule; rule = rule->next) for (rule = index->match_list.head; rule; rule = rule->next)
vty_outln (vty, " %s %s", vty_out (vty, " %s %s\n",
rule->cmd->str, rule->rule_str); rule->cmd->str, rule->rule_str);
vty_outln (vty, " Set clauses:"); vty_out (vty, " Set clauses:\n");
for (rule = index->set_list.head; rule; rule = rule->next) for (rule = index->set_list.head; rule; rule = rule->next)
vty_outln (vty, " %s %s", vty_out (vty, " %s %s\n",
rule->cmd->str, rule->rule_str); rule->cmd->str, rule->rule_str);
/* Call clause */ /* Call clause */
vty_outln (vty, " Call clause:"); vty_out (vty, " Call clause:\n");
if (index->nextrm) if (index->nextrm)
vty_outln (vty, " Call %s", index->nextrm); vty_out (vty, " Call %s\n", index->nextrm);
/* Exit Policy */ /* Exit Policy */
vty_outln (vty, " Action:"); vty_out (vty, " Action:\n");
if (index->exitpolicy == RMAP_GOTO) if (index->exitpolicy == RMAP_GOTO)
vty_outln (vty, " Goto %d", index->nextpref); vty_out (vty, " Goto %d\n", index->nextpref);
else if (index->exitpolicy == RMAP_NEXT) else if (index->exitpolicy == RMAP_NEXT)
vty_outln (vty, " Continue to next entry"); vty_out (vty, " Continue to next entry\n");
else if (index->exitpolicy == RMAP_EXIT) else if (index->exitpolicy == RMAP_EXIT)
vty_outln (vty, " Exit routemap"); vty_out (vty, " Exit routemap\n");
} }
} }
@ -1049,7 +1049,7 @@ vty_show_route_map (struct vty *vty, const char *name)
} }
else else
{ {
vty_outln (vty, "%s: 'route-map %s' not found", frr_protonameinst, vty_out (vty, "%s: 'route-map %s' not found\n", frr_protonameinst,
name); name);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -2359,14 +2359,14 @@ DEFUN (set_ip_nexthop,
ret = str2sockunion (argv[idx_ipv4]->arg, &su); ret = str2sockunion (argv[idx_ipv4]->arg, &su);
if (ret < 0) if (ret < 0)
{ {
vty_outln (vty, "%% Malformed nexthop address"); vty_out (vty, "%% Malformed nexthop address\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (su.sin.sin_addr.s_addr == 0 || if (su.sin.sin_addr.s_addr == 0 ||
IPV4_CLASS_DE(su.sin.sin_addr.s_addr)) IPV4_CLASS_DE(su.sin.sin_addr.s_addr))
{ {
vty_outln (vty, vty_out (vty,
"%% nexthop address cannot be 0.0.0.0, multicast " "or reserved"); "%% nexthop address cannot be 0.0.0.0, multicast or reserved\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2416,12 +2416,12 @@ DEFUN (set_ipv6_nexthop_local,
ret = inet_pton (AF_INET6, argv[idx_ipv6]->arg, &addr); ret = inet_pton (AF_INET6, argv[idx_ipv6]->arg, &addr);
if (!ret) if (!ret)
{ {
vty_outln (vty, "%% Malformed nexthop address"); vty_out (vty, "%% Malformed nexthop address\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (!IN6_IS_ADDR_LINKLOCAL(&addr)) if (!IN6_IS_ADDR_LINKLOCAL(&addr))
{ {
vty_outln (vty, "%% Invalid link-local nexthop address"); vty_out (vty, "%% Invalid link-local nexthop address\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2577,7 +2577,7 @@ DEFUN (no_route_map_all,
map = route_map_lookup_by_name (mapname); map = route_map_lookup_by_name (mapname);
if (map == NULL) if (map == NULL)
{ {
vty_outln (vty, "%% Could not find route-map %s", mapname); vty_out (vty, "%% Could not find route-map %s\n", mapname);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2612,7 +2612,7 @@ DEFUN (no_route_map,
map = route_map_lookup_by_name (mapname); map = route_map_lookup_by_name (mapname);
if (map == NULL) if (map == NULL)
{ {
vty_outln (vty, "%% Could not find route-map %s", mapname); vty_out (vty, "%% Could not find route-map %s\n", mapname);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2620,7 +2620,7 @@ DEFUN (no_route_map,
index = route_map_index_lookup (map, permit, pref); index = route_map_index_lookup (map, permit, pref);
if (index == NULL) if (index == NULL)
{ {
vty_outln (vty, "%% Could not find route-map entry %s %s", vty_out (vty, "%% Could not find route-map entry %s %s\n",
mapname, prefstr); mapname, prefstr);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2648,7 +2648,7 @@ DEFUN (rmap_onmatch_next,
if (index->type == RMAP_DENY) if (index->type == RMAP_DENY)
{ {
/* Under a deny clause, match means it's finished. No need to set next */ /* Under a deny clause, match means it's finished. No need to set next */
vty_outln (vty,"on-match next not supported under route-map deny"); vty_out (vty,"on-match next not supported under route-map deny\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
index->exitpolicy = RMAP_NEXT; index->exitpolicy = RMAP_NEXT;
@ -2689,7 +2689,7 @@ DEFUN (rmap_onmatch_goto,
if (index->type == RMAP_DENY) if (index->type == RMAP_DENY)
{ {
/* Under a deny clause, match means it's finished. No need to go anywhere */ /* Under a deny clause, match means it's finished. No need to go anywhere */
vty_outln (vty,"on-match goto not supported under route-map deny"); vty_out (vty,"on-match goto not supported under route-map deny\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2701,7 +2701,7 @@ DEFUN (rmap_onmatch_goto,
if (d <= index->pref) if (d <= index->pref)
{ {
/* Can't allow you to do that, Dave */ /* Can't allow you to do that, Dave */
vty_outln (vty, "can't jump backwards in route-maps"); vty_out (vty, "can't jump backwards in route-maps\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
else else
@ -2860,31 +2860,31 @@ route_map_config_write (struct vty *vty)
for (index = map->head; index; index = index->next) for (index = map->head; index; index = index->next)
{ {
if (!first) if (!first)
vty_outln (vty, "!"); vty_out (vty, "!\n");
else else
first = 0; first = 0;
vty_outln (vty, "route-map %s %s %d", vty_out (vty, "route-map %s %s %d\n",
map->name, map->name,
route_map_type_str (index->type), route_map_type_str (index->type),
index->pref); index->pref);
if (index->description) if (index->description)
vty_outln (vty, " description %s", index->description); vty_out (vty, " description %s\n", index->description);
for (rule = index->match_list.head; rule; rule = rule->next) for (rule = index->match_list.head; rule; rule = rule->next)
vty_outln (vty, " match %s %s", rule->cmd->str, vty_out (vty, " match %s %s\n", rule->cmd->str,
rule->rule_str ? rule->rule_str : ""); rule->rule_str ? rule->rule_str : "");
for (rule = index->set_list.head; rule; rule = rule->next) for (rule = index->set_list.head; rule; rule = rule->next)
vty_outln (vty, " set %s %s", rule->cmd->str, vty_out (vty, " set %s %s\n", rule->cmd->str,
rule->rule_str ? rule->rule_str : ""); rule->rule_str ? rule->rule_str : "");
if (index->nextrm) if (index->nextrm)
vty_outln (vty, " call %s", index->nextrm); vty_out (vty, " call %s\n", index->nextrm);
if (index->exitpolicy == RMAP_GOTO) if (index->exitpolicy == RMAP_GOTO)
vty_outln (vty, " on-match goto %d", index->nextpref); vty_out (vty, " on-match goto %d\n", index->nextpref);
if (index->exitpolicy == RMAP_NEXT) if (index->exitpolicy == RMAP_NEXT)
vty_outln (vty," on-match next"); vty_out (vty," on-match next\n");
write++; write++;
} }

View File

@ -602,9 +602,9 @@ skiplist_debug(struct vty *vty, struct skiplist *l)
if (!l) if (!l)
l = skiplist_last_created; l = skiplist_last_created;
vty_outln (vty, "Skiplist %p has max level %d", l, l->level); vty_out (vty, "Skiplist %p has max level %d\n", l, l->level);
for (i = l->level; i >= 0; --i) for (i = l->level; i >= 0; --i)
vty_outln (vty, " @%d: %ld", vty_out (vty, " @%d: %ld\n",
i,(long)((l->stats->forward[i]) - (struct skiplistnode *)NULL)); i,(long)((l->stats->forward[i]) - (struct skiplistnode *)NULL));
} }

View File

@ -1278,7 +1278,7 @@ smux_peer_oid (struct vty *vty, const char *oid_str, const char *passwd_str)
ret = smux_str2oid (oid_str, oid, &oid_len); ret = smux_str2oid (oid_str, oid, &oid_len);
if (ret != 0) if (ret != 0)
{ {
vty_out (vty, "object ID malformed%s", VTYNL); vty_out (vty, "object ID malformed\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1387,7 +1387,7 @@ config_write_smux (struct vty *vty)
vty_out (vty, "%s%d", first ? "" : ".", (int) smux_oid[i]); vty_out (vty, "%s%d", first ? "" : ".", (int) smux_oid[i]);
first = 0; first = 0;
} }
vty_outln (vty, " %s", smux_passwd); vty_out (vty, " %s\n", smux_passwd);
} }
return 0; return 0;
} }

View File

@ -223,43 +223,43 @@ void
spf_backoff_show(struct spf_backoff *backoff, struct vty *vty, spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
const char *prefix) const char *prefix)
{ {
vty_outln (vty, "%sCurrent state: %s", prefix, vty_out (vty, "%sCurrent state: %s\n", prefix,
spf_backoff_state2str(backoff->state)); spf_backoff_state2str(backoff->state));
vty_outln (vty, "%sInit timer: %ld msec", prefix, vty_out (vty, "%sInit timer: %ld msec\n", prefix,
backoff->init_delay); backoff->init_delay);
vty_outln (vty, "%sShort timer: %ld msec", prefix, vty_out (vty, "%sShort timer: %ld msec\n", prefix,
backoff->short_delay); backoff->short_delay);
vty_outln (vty, "%sLong timer: %ld msec", prefix, vty_out (vty, "%sLong timer: %ld msec\n", prefix,
backoff->long_delay); backoff->long_delay);
vty_outln (vty, "%sHolddown timer: %ld msec", prefix, vty_out (vty, "%sHolddown timer: %ld msec\n", prefix,
backoff->holddown); backoff->holddown);
if (backoff->t_holddown) if (backoff->t_holddown)
{ {
struct timeval remain = thread_timer_remain(backoff->t_holddown); struct timeval remain = thread_timer_remain(backoff->t_holddown);
vty_outln (vty, "%s Still runs for %ld msec", vty_out (vty, "%s Still runs for %ld msec\n",
prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000); prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000);
} }
else else
{ {
vty_outln (vty, "%s Inactive", prefix); vty_out (vty, "%s Inactive\n", prefix);
} }
vty_outln (vty, "%sTimeToLearn timer: %ld msec", prefix, vty_out (vty, "%sTimeToLearn timer: %ld msec\n", prefix,
backoff->timetolearn); backoff->timetolearn);
if (backoff->t_timetolearn) if (backoff->t_timetolearn)
{ {
struct timeval remain = thread_timer_remain(backoff->t_timetolearn); struct timeval remain = thread_timer_remain(backoff->t_timetolearn);
vty_outln (vty, "%s Still runs for %ld msec", vty_out (vty, "%s Still runs for %ld msec\n",
prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000); prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000);
} }
else else
{ {
vty_outln (vty, "%s Inactive", prefix); vty_out (vty, "%s Inactive\n", prefix);
} }
vty_outln (vty, "%sFirst event: %s", prefix, vty_out (vty, "%sFirst event: %s\n", prefix,
timeval_format(&backoff->first_event_time)); timeval_format(&backoff->first_event_time));
vty_outln (vty, "%sLast event: %s", prefix, vty_out (vty, "%sLast event: %s\n", prefix,
timeval_format(&backoff->last_event_time)); timeval_format(&backoff->last_event_time));
} }
@ -291,7 +291,7 @@ spf_backoff_write_config(struct vty *vty)
if (debug_spf_backoff) if (debug_spf_backoff)
{ {
vty_outln (vty, "debug spf-delay-ietf"); vty_out (vty, "debug spf-delay-ietf\n");
written++; written++;
} }

View File

@ -95,7 +95,7 @@ vty_out_cpu_thread_history(struct vty* vty,
a->total_active, a->cpu.total/1000, a->cpu.total%1000, a->total_calls, a->total_active, a->cpu.total/1000, a->cpu.total%1000, a->total_calls,
a->cpu.total/a->total_calls, a->cpu.max, a->cpu.total/a->total_calls, a->cpu.max,
a->real.total/a->total_calls, a->real.max); a->real.total/a->total_calls, a->real.max);
vty_outln (vty, " %c%c%c%c%c %s", vty_out (vty, " %c%c%c%c%c %s\n",
a->types & (1 << THREAD_READ) ? 'R':' ', a->types & (1 << THREAD_READ) ? 'R':' ',
a->types & (1 << THREAD_WRITE) ? 'W':' ', a->types & (1 << THREAD_WRITE) ? 'W':' ',
a->types & (1 << THREAD_TIMER) ? 'T':' ', a->types & (1 << THREAD_TIMER) ? 'T':' ',
@ -147,13 +147,13 @@ cpu_record_print(struct vty *vty, thread_type filter)
memset (underline, '-', sizeof (underline)); memset (underline, '-', sizeof (underline));
underline[sizeof(underline)] = '\0'; underline[sizeof(underline)] = '\0';
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_outln(vty, "Showing statistics for pthread %s", name); vty_out(vty, "Showing statistics for pthread %s\n", name);
vty_outln(vty, "-------------------------------%s", underline); vty_out(vty, "-------------------------------%s\n", underline);
vty_outln(vty, "%21s %18s %18s", "", "CPU (user+system):", "Real (wall-clock):"); vty_out(vty, "%21s %18s %18s\n", "", "CPU (user+system):", "Real (wall-clock):");
vty_out(vty, "Active Runtime(ms) Invoked Avg uSec Max uSecs"); vty_out(vty, "Active Runtime(ms) Invoked Avg uSec Max uSecs");
vty_out(vty, " Avg uSec Max uSecs"); vty_out(vty, " Avg uSec Max uSecs");
vty_outln(vty, " Type Thread"); vty_out(vty, " Type Thread\n");
if (m->cpu_record->count) if (m->cpu_record->count)
hash_iterate(m->cpu_record, hash_iterate(m->cpu_record,
@ -161,20 +161,20 @@ cpu_record_print(struct vty *vty, thread_type filter)
cpu_record_hash_print, cpu_record_hash_print,
args); args);
else else
vty_outln(vty, "No data to display yet."); vty_out(vty, "No data to display yet.\n");
vty_out(vty, VTYNL); vty_out(vty, "\n");
} }
} }
pthread_mutex_unlock (&masters_mtx); pthread_mutex_unlock (&masters_mtx);
vty_out(vty, VTYNL); vty_out(vty, "\n");
vty_outln(vty, "Total thread statistics"); vty_out(vty, "Total thread statistics\n");
vty_outln(vty, "-------------------------"); vty_out(vty, "-------------------------\n");
vty_outln(vty, "%21s %18s %18s", "", "CPU (user+system):", "Real (wall-clock):"); vty_out(vty, "%21s %18s %18s\n", "", "CPU (user+system):", "Real (wall-clock):");
vty_out(vty, "Active Runtime(ms) Invoked Avg uSec Max uSecs"); vty_out(vty, "Active Runtime(ms) Invoked Avg uSec Max uSecs");
vty_out(vty, " Avg uSec Max uSecs"); vty_out(vty, " Avg uSec Max uSecs");
vty_outln(vty, " Type Thread"); vty_out(vty, " Type Thread\n");
if (tmp.total_calls > 0) if (tmp.total_calls > 0)
vty_out_cpu_thread_history(vty, &tmp); vty_out_cpu_thread_history(vty, &tmp);
@ -270,8 +270,8 @@ DEFUN (show_thread_cpu,
if (argv_find (argv, argc, "FILTER", &idx)) { if (argv_find (argv, argc, "FILTER", &idx)) {
filter = parse_filter (argv[idx]->arg); filter = parse_filter (argv[idx]->arg);
if (!filter) { if (!filter) {
vty_outln(vty, "Invalid filter \"%s\" specified; must contain at least" vty_out(vty, "Invalid filter \"%s\" specified; must contain at least"
"one of 'RWTEXB'", argv[idx]->arg); "one of 'RWTEXB'\n", argv[idx]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
} }
@ -294,8 +294,8 @@ DEFUN (clear_thread_cpu,
if (argv_find (argv, argc, "FILTER", &idx)) { if (argv_find (argv, argc, "FILTER", &idx)) {
filter = parse_filter (argv[idx]->arg); filter = parse_filter (argv[idx]->arg);
if (!filter) { if (!filter) {
vty_outln(vty, "Invalid filter \"%s\" specified; must contain at least" vty_out(vty, "Invalid filter \"%s\" specified; must contain at least"
"one of 'RWTEXB'", argv[idx]->arg); "one of 'RWTEXB'\n", argv[idx]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
} }

View File

@ -474,8 +474,8 @@ DEFUN_NOSH (vrf,
if (strlen(vrfname) > VRF_NAMSIZ) if (strlen(vrfname) > VRF_NAMSIZ)
{ {
vty_out (vty, "%% VRF name %s is invalid: length exceeds " vty_out (vty, "%% VRF name %s is invalid: length exceeds "
"%d characters%s", "%d characters\n",
vrfname, VRF_NAMSIZ, VTYNL); vrfname, VRF_NAMSIZ);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -501,14 +501,13 @@ DEFUN_NOSH (no_vrf,
if (vrfp == NULL) if (vrfp == NULL)
{ {
vty_out (vty, "%% VRF %s does not exist%s", vrfname, VTYNL); vty_out (vty, "%% VRF %s does not exist\n", vrfname);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
if (CHECK_FLAG (vrfp->status, VRF_ACTIVE)) if (CHECK_FLAG (vrfp->status, VRF_ACTIVE))
{ {
vty_out (vty, "%% Only inactive VRFs can be deleted%s", vty_out (vty, "%% Only inactive VRFs can be deleted\n");
VTYNL);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -555,7 +554,7 @@ static int
vrf_write_host (struct vty *vty) vrf_write_host (struct vty *vty)
{ {
if (debug_vrf) if (debug_vrf)
vty_outln (vty, "debug vrf"); vty_out (vty, "debug vrf\n");
return 1; return 1;
} }

View File

@ -115,12 +115,12 @@ extern vrf_id_t vrf_name_to_id (const char *);
struct vrf *vrf; \ struct vrf *vrf; \
if (!(vrf = vrf_lookup_by_name(NAME))) \ if (!(vrf = vrf_lookup_by_name(NAME))) \
{ \ { \
vty_out (vty, "%% VRF %s not found%s", NAME, VTYNL);\ vty_out (vty, "%% VRF %s not found\n", NAME);\
return CMD_WARNING; \ return CMD_WARNING; \
} \ } \
if (vrf->vrf_id == VRF_UNKNOWN) \ if (vrf->vrf_id == VRF_UNKNOWN) \
{ \ { \
vty_out (vty, "%% VRF %s not active%s", NAME, VTYNL);\ vty_out (vty, "%% VRF %s not active\n", NAME);\
return CMD_WARNING; \ return CMD_WARNING; \
} \ } \
(V) = vrf->vrf_id; \ (V) = vrf->vrf_id; \

161
lib/vty.c
View File

@ -92,23 +92,28 @@ char integrate_default[] = SYSCONFDIR INTEGRATE_DEFAULT_CONFIG;
static int do_log_commands = 0; static int do_log_commands = 0;
static int /* VTY standard output function. */
vty_out_variadic (struct vty *vty, const char *format, va_list args) int
vty_out (struct vty *vty, const char *format, ...)
{ {
va_list args;
int len = 0; int len = 0;
int size = 1024; int size = 1024;
char buf[1024]; char buf[1024];
char *p = NULL; char *p = NULL;
va_list cp;
if (vty_shell (vty)) if (vty_shell (vty))
{
va_start (args, format);
vprintf (format, args); vprintf (format, args);
va_end (args);
}
else else
{ {
/* Try to write to initial buffer. */ /* Try to write to initial buffer. */
va_copy (cp, args); va_start (args, format);
len = vsnprintf (buf, sizeof(buf), format, cp); len = vsnprintf (buf, sizeof(buf), format, args);
va_end (cp); va_end (args);
/* Initial buffer is not enough. */ /* Initial buffer is not enough. */
if (len < 0 || len >= size) if (len < 0 || len >= size)
@ -124,9 +129,9 @@ vty_out_variadic (struct vty *vty, const char *format, va_list args)
if (! p) if (! p)
return -1; return -1;
va_copy (cp, args); va_start (args, format);
len = vsnprintf (p, size, format, cp); len = vsnprintf (p, size, format, args);
va_end (cp); va_end (args);
if (len > -1 && len < size) if (len > -1 && len < size)
break; break;
@ -138,7 +143,10 @@ vty_out_variadic (struct vty *vty, const char *format, va_list args)
p = buf; p = buf;
/* Pointer p must point out buffer. */ /* Pointer p must point out buffer. */
if (vty->type != VTY_TERM)
buffer_put (vty->obuf, (u_char *) p, len); buffer_put (vty->obuf, (u_char *) p, len);
else
buffer_put_crlf (vty->obuf, (u_char *) p, len);
/* If p is not different with buf, it is allocated buffer. */ /* If p is not different with buf, it is allocated buffer. */
if (p != buf) if (p != buf)
@ -147,32 +155,6 @@ vty_out_variadic (struct vty *vty, const char *format, va_list args)
return len; return len;
} }
/* VTY standard output function. */
int
vty_out (struct vty *vty, const char *format, ...)
{
int len;
va_list args;
va_start (args, format);
len = vty_out_variadic (vty, format, args);
va_end (args);
return len;
}
int
vty_outln (struct vty *vty, const char *format, ...)
{
int len;
va_list args;
va_start (args, format);
len = vty_out_variadic (vty, format, args);
va_end (args);
return len + vty_out (vty, "%s", VTYNL);
}
static int static int
vty_log_out (struct vty *vty, const char *level, const char *proto_str, vty_log_out (struct vty *vty, const char *level, const char *proto_str,
@ -265,12 +247,12 @@ vty_hello (struct vty *vty)
for (s = buf + strlen (buf); (s > buf) && isspace ((int)*(s - 1)); for (s = buf + strlen (buf); (s > buf) && isspace ((int)*(s - 1));
s--); s--);
*s = '\0'; *s = '\0';
vty_outln (vty, "%s", buf); vty_out (vty, "%s\n", buf);
} }
fclose (f); fclose (f);
} }
else else
vty_outln (vty, "MOTD file not found"); vty_out (vty, "MOTD file not found\n");
} }
else if (host.motd) else if (host.motd)
vty_out (vty, "%s", host.motd); vty_out (vty, "%s", host.motd);
@ -403,14 +385,14 @@ vty_auth (struct vty *vty, char *buf)
{ {
if (vty->node == AUTH_NODE) if (vty->node == AUTH_NODE)
{ {
vty_outln (vty, "%% Bad passwords, too many failures!"); vty_out (vty, "%% Bad passwords, too many failures!\n");
vty->status = VTY_CLOSE; vty->status = VTY_CLOSE;
} }
else else
{ {
/* AUTH_ENABLE_NODE */ /* AUTH_ENABLE_NODE */
vty->fail = 0; vty->fail = 0;
vty_outln (vty, "%% Bad enable passwords, too many failures!"); vty_out (vty, "%% Bad enable passwords, too many failures!\n");
vty->status = VTY_CLOSE; vty->status = VTY_CLOSE;
} }
} }
@ -495,16 +477,16 @@ vty_command (struct vty *vty, char *buf)
{ {
case CMD_WARNING: case CMD_WARNING:
if (vty->type == VTY_FILE) if (vty->type == VTY_FILE)
vty_outln (vty, "Warning..."); vty_out (vty, "Warning...\n");
break; break;
case CMD_ERR_AMBIGUOUS: case CMD_ERR_AMBIGUOUS:
vty_outln (vty, "%% Ambiguous command."); vty_out (vty, "%% Ambiguous command.\n");
break; break;
case CMD_ERR_NO_MATCH: case CMD_ERR_NO_MATCH:
vty_outln (vty, "%% [%s] Unknown command: %s", protocolname, buf); vty_out (vty, "%% [%s] Unknown command: %s\n", protocolname, buf);
break; break;
case CMD_ERR_INCOMPLETE: case CMD_ERR_INCOMPLETE:
vty_outln (vty, "%% Command incomplete."); vty_out (vty, "%% Command incomplete.\n");
break; break;
} }
cmd_free_strvec (vline); cmd_free_strvec (vline);
@ -732,7 +714,7 @@ vty_backward_word (struct vty *vty)
static void static void
vty_down_level (struct vty *vty) vty_down_level (struct vty *vty)
{ {
vty_out (vty, VTYNL); vty_out (vty, "\n");
cmd_exit (vty); cmd_exit (vty);
vty_prompt (vty); vty_prompt (vty);
vty->cp = 0; vty->cp = 0;
@ -742,7 +724,7 @@ vty_down_level (struct vty *vty)
static void static void
vty_end_config (struct vty *vty) vty_end_config (struct vty *vty)
{ {
vty_out (vty, VTYNL); vty_out (vty, "\n");
switch (vty->node) switch (vty->node)
{ {
@ -947,16 +929,16 @@ vty_complete_command (struct vty *vty)
cmd_free_strvec (vline); cmd_free_strvec (vline);
vty_out (vty, VTYNL); vty_out (vty, "\n");
switch (ret) switch (ret)
{ {
case CMD_ERR_AMBIGUOUS: case CMD_ERR_AMBIGUOUS:
vty_outln (vty, "%% Ambiguous command."); vty_out (vty, "%% Ambiguous command.\n");
vty_prompt (vty); vty_prompt (vty);
vty_redraw_line (vty); vty_redraw_line (vty);
break; break;
case CMD_ERR_NO_MATCH: case CMD_ERR_NO_MATCH:
/* vty_out (vty, "%% There is no matched command.%s", VTYNL); */ /* vty_out (vty, "%% There is no matched command.\n"); */
vty_prompt (vty); vty_prompt (vty);
vty_redraw_line (vty); vty_redraw_line (vty);
break; break;
@ -964,7 +946,7 @@ vty_complete_command (struct vty *vty)
if (!matched[0]) if (!matched[0])
{ {
/* 2016-11-28 equinox -- need to debug, SEGV here */ /* 2016-11-28 equinox -- need to debug, SEGV here */
vty_outln (vty, "%% CLI BUG: FULL_MATCH with NULL str"); vty_out (vty, "%% CLI BUG: FULL_MATCH with NULL str\n");
vty_prompt (vty); vty_prompt (vty);
vty_redraw_line (vty); vty_redraw_line (vty);
break; break;
@ -987,11 +969,11 @@ vty_complete_command (struct vty *vty)
for (i = 0; matched[i] != NULL; i++) for (i = 0; matched[i] != NULL; i++)
{ {
if (i != 0 && ((i % 6) == 0)) if (i != 0 && ((i % 6) == 0))
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_out (vty, "%-10s ", matched[i]); vty_out (vty, "%-10s ", matched[i]);
XFREE (MTYPE_COMPLETION, matched[i]); XFREE (MTYPE_COMPLETION, matched[i]);
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_prompt (vty); vty_prompt (vty);
vty_redraw_line (vty); vty_redraw_line (vty);
@ -1019,7 +1001,7 @@ vty_describe_fold (struct vty *vty, int cmd_width,
if (desc_width <= 0) if (desc_width <= 0)
{ {
vty_outln (vty, " %-*s %s", cmd_width, cmd, token->desc); vty_out (vty, " %-*s %s\n", cmd_width, cmd, token->desc);
return; return;
} }
@ -1036,12 +1018,12 @@ vty_describe_fold (struct vty *vty, int cmd_width,
strncpy (buf, p, pos); strncpy (buf, p, pos);
buf[pos] = '\0'; buf[pos] = '\0';
vty_outln (vty, " %-*s %s", cmd_width, cmd, buf); vty_out (vty, " %-*s %s\n", cmd_width, cmd, buf);
cmd = ""; cmd = "";
} }
vty_outln (vty, " %-*s %s", cmd_width, cmd, p); vty_out (vty, " %-*s %s\n", cmd_width, cmd, p);
XFREE (MTYPE_TMP, buf); XFREE (MTYPE_TMP, buf);
} }
@ -1070,17 +1052,17 @@ vty_describe_command (struct vty *vty)
describe = cmd_describe_command (vline, vty, &ret); describe = cmd_describe_command (vline, vty, &ret);
vty_out (vty, VTYNL); vty_out (vty, "\n");
/* Ambiguous error. */ /* Ambiguous error. */
switch (ret) switch (ret)
{ {
case CMD_ERR_AMBIGUOUS: case CMD_ERR_AMBIGUOUS:
vty_outln (vty, "%% Ambiguous command."); vty_out (vty, "%% Ambiguous command.\n");
goto out; goto out;
break; break;
case CMD_ERR_NO_MATCH: case CMD_ERR_NO_MATCH:
vty_outln (vty, "%% There is no matched command."); vty_out (vty, "%% There is no matched command.\n");
goto out; goto out;
break; break;
} }
@ -1118,10 +1100,10 @@ vty_describe_command (struct vty *vty)
} }
if (!token->desc) if (!token->desc)
vty_outln (vty, " %-s", vty_out (vty, " %-s\n",
token->text); token->text);
else if (desc_width >= strlen (token->desc)) else if (desc_width >= strlen (token->desc))
vty_outln (vty, " %-*s %s", width, vty_out (vty, " %-*s %s\n", width,
token->text, token->text,
token->desc); token->desc);
else else
@ -1136,27 +1118,27 @@ vty_describe_command (struct vty *vty)
if (vector_active (varcomps) > 0) if (vector_active (varcomps) > 0)
{ {
char *ac = cmd_variable_comp2str(varcomps, vty->width, VTYNL); char *ac = cmd_variable_comp2str(varcomps, vty->width);
vty_outln(vty, "%s", ac); vty_out(vty, "%s\n", ac);
XFREE(MTYPE_TMP, ac); XFREE(MTYPE_TMP, ac);
} }
vector_free(varcomps); vector_free(varcomps);
} }
#if 0 #if 0
vty_out (vty, " %-*s %s%s", width vty_out (vty, " %-*s %s\n", width
desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd, desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd,
desc->str ? desc->str : "", VTYNL); desc->str ? desc->str : "");
#endif /* 0 */ #endif /* 0 */
} }
if ((token = token_cr)) if ((token = token_cr))
{ {
if (!token->desc) if (!token->desc)
vty_outln (vty, " %-s", vty_out (vty, " %-s\n",
token->text); token->text);
else if (desc_width >= strlen (token->desc)) else if (desc_width >= strlen (token->desc))
vty_outln (vty, " %-*s %s", width, vty_out (vty, " %-*s %s\n", width,
token->text, token->text,
token->desc); token->desc);
else else
@ -1184,7 +1166,7 @@ vty_stop_input (struct vty *vty)
{ {
vty->cp = vty->length = 0; vty->cp = vty->length = 0;
vty_clear_buf (vty); vty_clear_buf (vty);
vty_out (vty, VTYNL); vty_out (vty, "\n");
switch (vty->node) switch (vty->node)
{ {
@ -1295,20 +1277,20 @@ vty_telnet_option (struct vty *vty, unsigned char *buf, int nbytes)
vty_out (vty, "SE "); vty_out (vty, "SE ");
break; break;
case TELOPT_ECHO: case TELOPT_ECHO:
vty_outln (vty, "TELOPT_ECHO "); vty_out (vty, "TELOPT_ECHO \n");
break; break;
case TELOPT_SGA: case TELOPT_SGA:
vty_outln (vty, "TELOPT_SGA "); vty_out (vty, "TELOPT_SGA \n");
break; break;
case TELOPT_NAWS: case TELOPT_NAWS:
vty_outln (vty, "TELOPT_NAWS "); vty_out (vty, "TELOPT_NAWS \n");
break; break;
default: default:
vty_out (vty, "%x ", buf[i]); vty_out (vty, "%x ", buf[i]);
break; break;
} }
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
#endif /* TELNET_OPTION_DEBUG */ #endif /* TELNET_OPTION_DEBUG */
@ -1345,8 +1327,8 @@ vty_telnet_option (struct vty *vty, unsigned char *buf, int nbytes)
vty->width = ((vty->sb_buf[1] << 8)|vty->sb_buf[2]); vty->width = ((vty->sb_buf[1] << 8)|vty->sb_buf[2]);
vty->height = ((vty->sb_buf[3] << 8)|vty->sb_buf[4]); vty->height = ((vty->sb_buf[3] << 8)|vty->sb_buf[4]);
#ifdef TELNET_OPTION_DEBUG #ifdef TELNET_OPTION_DEBUG
vty_outln (vty, "TELNET NAWS window size negotiation completed: " vty_out (vty, "TELNET NAWS window size negotiation completed: "
"width %d, height %d", "width %d, height %d\n",
vty->width, vty->height); vty->width, vty->height);
#endif #endif
} }
@ -1604,7 +1586,7 @@ vty_read (struct thread *thread)
break; break;
case '\n': case '\n':
case '\r': case '\r':
vty_out (vty, VTYNL); vty_out (vty, "\n");
vty_execute (vty); vty_execute (vty);
break; break;
case '\t': case '\t':
@ -1763,7 +1745,7 @@ vty_create (int vty_sock, union sockunion *su)
/* Vty is not available if password isn't set. */ /* Vty is not available if password isn't set. */
if (host.password == NULL && host.password_encrypt == NULL) if (host.password == NULL && host.password_encrypt == NULL)
{ {
vty_outln (vty, "Vty password is not set."); vty_out (vty, "Vty password is not set.\n");
vty->status = VTY_CLOSE; vty->status = VTY_CLOSE;
vty_close (vty); vty_close (vty);
return NULL; return NULL;
@ -1773,8 +1755,7 @@ vty_create (int vty_sock, union sockunion *su)
/* Say hello to the world. */ /* Say hello to the world. */
vty_hello (vty); vty_hello (vty);
if (! no_password_check) if (! no_password_check)
vty_outln (vty, "%sUser Access Verification%s", VTYNL, vty_out (vty, "\nUser Access Verification\n\n");
VTYNL);
/* Setting up terminal. */ /* Setting up terminal. */
vty_will_echo (vty); vty_will_echo (vty);
@ -2191,7 +2172,7 @@ vtysh_read (struct thread *thread)
/* Clear command line buffer. */ /* Clear command line buffer. */
vty->cp = vty->length = 0; vty->cp = vty->length = 0;
vty_clear_buf (vty); vty_clear_buf (vty);
vty_outln (vty, "%% Command is too long."); vty_out (vty, "%% Command is too long.\n");
} }
else else
{ {
@ -2334,7 +2315,7 @@ vty_timeout (struct thread *thread)
/* Clear buffer*/ /* Clear buffer*/
buffer_reset (vty->obuf); buffer_reset (vty->obuf);
vty_outln (vty, "%sVty connection is timed out.", VTYNL); vty_out (vty, "\nVty connection is timed out.\n");
/* Close connection. */ /* Close connection. */
vty->status = VTY_CLOSE; vty->status = VTY_CLOSE;
@ -2715,9 +2696,9 @@ DEFUN_NOSH (config_who,
for (i = 0; i < vector_active (vtyvec); i++) for (i = 0; i < vector_active (vtyvec); i++)
if ((v = vector_slot (vtyvec, i)) != NULL) if ((v = vector_slot (vtyvec, i)) != NULL)
vty_out (vty, "%svty[%d] connected from %s.%s", vty_out (vty, "%svty[%d] connected from %s.\n",
v->config ? "*" : " ", v->config ? "*" : " ",
i, v->address, VTYNL); i, v->address);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -2815,7 +2796,7 @@ DEFUN (no_vty_access_class,
const char *accesslist = (argc == 3) ? argv[idx_word]->arg : NULL; const char *accesslist = (argc == 3) ? argv[idx_word]->arg : NULL;
if (! vty_accesslist_name || (argc == 3 && strcmp(vty_accesslist_name, accesslist))) if (! vty_accesslist_name || (argc == 3 && strcmp(vty_accesslist_name, accesslist)))
{ {
vty_outln (vty,"Access-class is not currently applied to vty"); vty_out (vty,"Access-class is not currently applied to vty\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2858,7 +2839,7 @@ DEFUN (no_vty_ipv6_access_class,
if (! vty_ipv6_accesslist_name || if (! vty_ipv6_accesslist_name ||
(argc == 4 && strcmp(vty_ipv6_accesslist_name, accesslist))) (argc == 4 && strcmp(vty_ipv6_accesslist_name, accesslist)))
{ {
vty_outln (vty,"IPv6 access-class is not currently applied to vty"); vty_out (vty,"IPv6 access-class is not currently applied to vty\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -2959,7 +2940,7 @@ DEFUN_NOSH (show_history,
} }
if (vty->hist[index] != NULL) if (vty->hist[index] != NULL)
vty_out (vty, " %s%s", vty->hist[index], VTYNL); vty_out (vty, " %s\n", vty->hist[index]);
index++; index++;
} }
@ -2982,30 +2963,30 @@ DEFUN (log_commands,
static int static int
vty_config_write (struct vty *vty) vty_config_write (struct vty *vty)
{ {
vty_outln (vty, "line vty"); vty_out (vty, "line vty\n");
if (vty_accesslist_name) if (vty_accesslist_name)
vty_outln (vty, " access-class %s", vty_out (vty, " access-class %s\n",
vty_accesslist_name); vty_accesslist_name);
if (vty_ipv6_accesslist_name) if (vty_ipv6_accesslist_name)
vty_outln (vty, " ipv6 access-class %s", vty_out (vty, " ipv6 access-class %s\n",
vty_ipv6_accesslist_name); vty_ipv6_accesslist_name);
/* exec-timeout */ /* exec-timeout */
if (vty_timeout_val != VTY_TIMEOUT_DEFAULT) if (vty_timeout_val != VTY_TIMEOUT_DEFAULT)
vty_outln (vty, " exec-timeout %ld %ld", vty_out (vty, " exec-timeout %ld %ld\n",
vty_timeout_val / 60, vty_timeout_val / 60,
vty_timeout_val % 60); vty_timeout_val % 60);
/* login */ /* login */
if (no_password_check) if (no_password_check)
vty_outln (vty, " no login"); vty_out (vty, " no login\n");
if (do_log_commands) if (do_log_commands)
vty_outln (vty, "log commands"); vty_out (vty, "log commands\n");
vty_outln (vty, "!"); vty_out (vty, "!\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }

View File

@ -156,7 +156,7 @@ static inline void vty_push_context(struct vty *vty,
#define VTY_CHECK_CONTEXT(ptr) \ #define VTY_CHECK_CONTEXT(ptr) \
if (!ptr) { \ if (!ptr) { \
vty_out (vty, "Current configuration object was deleted " \ vty_out (vty, "Current configuration object was deleted " \
"by another process.%s", VTYNL); \ "by another process.\n"); \
return CMD_WARNING; \ return CMD_WARNING; \
} }
@ -179,17 +179,43 @@ struct vty_arg
/* Integrated configuration file. */ /* Integrated configuration file. */
#define INTEGRATE_DEFAULT_CONFIG "frr.conf" #define INTEGRATE_DEFAULT_CONFIG "frr.conf"
/* Small macro to determine newline is newline only or linefeed needed. */
#define VTYNL ((vty->type == VTY_TERM) ? "\r\n" : "\n")
/* for compatibility */ /* for compatibility */
#define VTY_NEWLINE VTYNL #if defined(__ICC)
#define VTY_GET_INTEGER(desc,v,str) {(v)=strtoul ((str), NULL, 10);} #define CPP_WARN_STR(X) #X
#define VTY_GET_INTEGER_RANGE(desc,v,str,min,max) {(v)=strtoul ((str), NULL, 10);} #define CPP_WARN(text) _Pragma(CPP_WARN_STR(message __FILE__ ": " text))
#define VTY_GET_ULONG(desc,v,str) {(v)=strtoul ((str), NULL, 10);}
#define VTY_GET_ULL(desc,v,str) {(v)=strtoull ((str), NULL, 10);} #elif (defined(__GNUC__) && \
#define VTY_GET_IPV4_ADDRESS(desc,v,str) inet_aton ((str), &(v)) (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) || \
#define VTY_GET_IPV4_PREFIX(desc,v,str) str2prefix_ipv4 ((str), &(v)) (defined(__clang__) && \
(__clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 5)))
#define CPP_WARN_STR(X) #X
#define CPP_WARN(text) _Pragma(CPP_WARN_STR(GCC warning text))
#else
#define CPP_WARN(text)
#endif
#define VNL "\n" \
CPP_WARN("VNL has been replaced with \\n.")
#define VTYNL "\n" \
CPP_WARN("VTYNL has been replaced with \\n.")
#define VTY_NEWLINE "\n" \
CPP_WARN("VTY_NEWLINE has been replaced with \\n.")
#define VTY_GET_INTEGER(desc,v,str) {(v)=strtoul ((str), NULL, 10);} \
CPP_WARN("VTY_GET_INTEGER is no longer useful, use strtoul() or DEFPY.")
#define VTY_GET_INTEGER_RANGE(desc,v,str,min,max) {(v)=strtoul ((str), NULL, 10);} \
CPP_WARN("VTY_GET_INTEGER_RANGE is no longer useful, use strtoul() or DEFPY.")
#define VTY_GET_ULONG(desc,v,str) {(v)=strtoul ((str), NULL, 10);} \
CPP_WARN("VTY_GET_ULONG is no longer useful, use strtoul() or DEFPY.")
#define VTY_GET_ULL(desc,v,str) {(v)=strtoull ((str), NULL, 10);} \
CPP_WARN("VTY_GET_ULL is no longer useful, use strtoull() or DEFPY.")
#define VTY_GET_IPV4_ADDRESS(desc,v,str) inet_aton ((str), &(v)) \
CPP_WARN("VTY_GET_IPV4_ADDRESS is no longer useful, use inet_aton() or DEFPY.")
#define VTY_GET_IPV4_PREFIX(desc,v,str) str2prefix_ipv4 ((str), &(v)) \
CPP_WARN("VTY_GET_IPV4_PREFIX is no longer useful, use str2prefix_ipv4() or DEFPY.")
#define vty_outln(vty, str, ...) \
vty_out(vty, str "\n", ## __VA_ARGS__) \
CPP_WARN("vty_outln is no longer useful, use vty_out(...\\n...)")
/* Default time out value */ /* Default time out value */
#define VTY_TIMEOUT_DEFAULT 600 #define VTY_TIMEOUT_DEFAULT 600
@ -217,7 +243,6 @@ extern void vty_reset (void);
extern struct vty *vty_new (void); extern struct vty *vty_new (void);
extern struct vty *vty_stdio (void (*atclose)(void)); extern struct vty *vty_stdio (void (*atclose)(void));
extern int vty_out (struct vty *, const char *, ...) PRINTF_ATTRIBUTE(2, 3); extern int vty_out (struct vty *, const char *, ...) PRINTF_ATTRIBUTE(2, 3);
extern int vty_outln (struct vty *, const char *, ...) PRINTF_ATTRIBUTE(2, 3);
extern void vty_read_config (const char *, char *); extern void vty_read_config (const char *, char *);
extern void vty_time_print (struct vty *, int); extern void vty_time_print (struct vty *, int);
extern void vty_serv_sock (const char *, unsigned short, const char *); extern void vty_serv_sock (const char *, unsigned short, const char *);

View File

@ -191,11 +191,11 @@ DEFUN (show_work_queues,
struct listnode *node; struct listnode *node;
struct work_queue *wq; struct work_queue *wq;
vty_outln (vty, vty_out (vty,
"%c %8s %5s %8s %8s %21s", "%c %8s %5s %8s %8s %21s\n",
' ', "List","(ms) ","Q. Runs","Yields","Cycle Counts "); ' ', "List","(ms) ","Q. Runs","Yields","Cycle Counts ");
vty_outln (vty, vty_out (vty,
"%c %8s %5s %8s %8s %7s %6s %8s %6s %s", "%c %8s %5s %8s %8s %7s %6s %8s %6s %s\n",
'P', 'P',
"Items", "Items",
"Hold", "Hold",
@ -205,7 +205,7 @@ DEFUN (show_work_queues,
for (ALL_LIST_ELEMENTS_RO (work_queues, node, wq)) for (ALL_LIST_ELEMENTS_RO (work_queues, node, wq))
{ {
vty_outln (vty,"%c %8d %5d %8ld %8ld %7d %6d %8ld %6u %s", vty_out (vty,"%c %8d %5d %8ld %8ld %7d %6d %8ld %6u %s\n",
(CHECK_FLAG (wq->flags, WQ_UNPLUGGED) ? ' ' : 'P'), (CHECK_FLAG (wq->flags, WQ_UNPLUGGED) ? ' ' : 'P'),
listcount (wq->items), listcount (wq->items),
wq->spec.hold, wq->spec.hold,

View File

@ -83,7 +83,7 @@ static int nhrp_vty_return(struct vty *vty, int ret)
snprintf(buf, sizeof(buf), "Unknown error %d", ret); snprintf(buf, sizeof(buf), "Unknown error %d", ret);
} }
vty_outln (vty, "%% %s", str); vty_out (vty, "%% %s\n", str);
return CMD_WARNING_CONFIG_FAILED;; return CMD_WARNING_CONFIG_FAILED;;
} }
@ -104,7 +104,7 @@ static int toggle_flag(
return CMD_SUCCESS; return CMD_SUCCESS;
} }
vty_outln (vty, "%% Invalid value %s", name); vty_out (vty, "%% Invalid value %s\n", name);
return CMD_WARNING_CONFIG_FAILED;; return CMD_WARNING_CONFIG_FAILED;;
} }
@ -118,7 +118,7 @@ DEFUN(show_debugging_nhrp, show_debugging_nhrp_cmd,
{ {
int i; int i;
vty_outln (vty, "NHRP debugging status:"); vty_out (vty, "NHRP debugging status:\n");
for (i = 0; debug_flags_desc[i].str != NULL; i++) { for (i = 0; debug_flags_desc[i].str != NULL; i++) {
if (debug_flags_desc[i].key == NHRP_DEBUG_ALL) if (debug_flags_desc[i].key == NHRP_DEBUG_ALL)
@ -126,7 +126,7 @@ DEFUN(show_debugging_nhrp, show_debugging_nhrp_cmd,
if (!(debug_flags_desc[i].key & debug_flags)) if (!(debug_flags_desc[i].key & debug_flags))
continue; continue;
vty_outln (vty, " NHRP %s debugging is on", vty_out (vty, " NHRP %s debugging is on\n",
debug_flags_desc[i].str); debug_flags_desc[i].str);
} }
@ -158,7 +158,7 @@ static int nhrp_config_write(struct vty *vty)
{ {
#ifndef NO_DEBUG #ifndef NO_DEBUG
if (debug_flags == NHRP_DEBUG_ALL) { if (debug_flags == NHRP_DEBUG_ALL) {
vty_outln (vty, "debug nhrp all"); vty_out (vty, "debug nhrp all\n");
} else { } else {
int i; int i;
@ -167,19 +167,19 @@ static int nhrp_config_write(struct vty *vty)
continue; continue;
if (!(debug_flags & debug_flags_desc[i].key)) if (!(debug_flags & debug_flags_desc[i].key))
continue; continue;
vty_outln (vty, "debug nhrp %s", vty_out (vty, "debug nhrp %s\n",
debug_flags_desc[i].str); debug_flags_desc[i].str);
} }
} }
vty_outln (vty, "!"); vty_out (vty, "!\n");
#endif /* NO_DEBUG */ #endif /* NO_DEBUG */
if (nhrp_event_socket_path) { if (nhrp_event_socket_path) {
vty_outln (vty, "nhrp event socket %s", vty_out (vty, "nhrp event socket %s\n",
nhrp_event_socket_path); nhrp_event_socket_path);
} }
if (netlink_nflog_group) { if (netlink_nflog_group) {
vty_outln (vty, "nhrp nflog-group %d", vty_out (vty, "nhrp nflog-group %d\n",
netlink_nflog_group); netlink_nflog_group);
} }
@ -598,7 +598,7 @@ static void show_ip_nhrp_cache(struct nhrp_cache *c, void *pctx)
return; return;
if (!ctx->count) { if (!ctx->count) {
vty_outln (vty, "%-8s %-8s %-24s %-24s %-6s %s", vty_out (vty, "%-8s %-8s %-24s %-24s %-6s %s\n",
"Iface", "Iface",
"Type", "Type",
"Protocol", "Protocol",
@ -608,7 +608,7 @@ static void show_ip_nhrp_cache(struct nhrp_cache *c, void *pctx)
} }
ctx->count++; ctx->count++;
vty_outln(ctx->vty, "%-8s %-8s %-24s %-24s %c%c%c %s", vty_out(ctx->vty, "%-8s %-8s %-24s %-24s %c%c%c %s\n",
c->ifp->name, c->ifp->name,
nhrp_cache_type_str[c->cur.type], nhrp_cache_type_str[c->cur.type],
sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]), sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]),
@ -626,7 +626,7 @@ static void show_ip_nhrp_nhs(struct nhrp_nhs *n, struct nhrp_registration *reg,
char buf[2][SU_ADDRSTRLEN]; char buf[2][SU_ADDRSTRLEN];
if (!ctx->count) { if (!ctx->count) {
vty_outln (vty, "%-8s %-24s %-16s %-16s", vty_out (vty, "%-8s %-24s %-16s %-16s\n",
"Iface", "Iface",
"FQDN", "FQDN",
"NBMA", "NBMA",
@ -634,7 +634,7 @@ static void show_ip_nhrp_nhs(struct nhrp_nhs *n, struct nhrp_registration *reg,
} }
ctx->count++; ctx->count++;
vty_outln (vty, "%-8s %-24s %-16s %-16s", vty_out (vty, "%-8s %-24s %-16s %-16s\n",
n->ifp->name, n->ifp->name,
n->nbma_fqdn, n->nbma_fqdn,
(reg && reg->peer) ? sockunion2str(&reg->peer->vc->remote.nbma, (reg && reg->peer) ? sockunion2str(&reg->peer->vc->remote.nbma,
@ -652,7 +652,7 @@ static void show_ip_nhrp_shortcut(struct nhrp_shortcut *s, void *pctx)
char buf1[PREFIX_STRLEN], buf2[SU_ADDRSTRLEN]; char buf1[PREFIX_STRLEN], buf2[SU_ADDRSTRLEN];
if (!ctx->count) { if (!ctx->count) {
vty_outln (vty, "%-8s %-24s %-24s %s", vty_out (vty, "%-8s %-24s %-24s %s\n",
"Type", "Type",
"Prefix", "Prefix",
"Via", "Via",
@ -661,7 +661,7 @@ static void show_ip_nhrp_shortcut(struct nhrp_shortcut *s, void *pctx)
ctx->count++; ctx->count++;
c = s->cache; c = s->cache;
vty_outln(ctx->vty, "%-8s %-24s %-24s %s", vty_out(ctx->vty, "%-8s %-24s %-24s %s\n",
nhrp_cache_type_str[s->type], nhrp_cache_type_str[s->type],
prefix2str(s->p, buf1, sizeof buf1), prefix2str(s->p, buf1, sizeof buf1),
c ? sockunion2str(&c->remote_addr, buf2, sizeof buf2) : "", c ? sockunion2str(&c->remote_addr, buf2, sizeof buf2) : "",
@ -677,32 +677,30 @@ static void show_ip_opennhrp_cache(struct nhrp_cache *c, void *pctx)
if (ctx->afi != family2afi(sockunion_family(&c->remote_addr))) if (ctx->afi != family2afi(sockunion_family(&c->remote_addr)))
return; return;
vty_outln(ctx->vty, vty_out(ctx->vty,
"Type: %s%s" "Type: %s\n"
"Flags:%s%s%s" "Flags:%s%s\n"
"Protocol-Address: %s/%zu", "Protocol-Address: %s/%zu\n",
nhrp_cache_type_str[c->cur.type], nhrp_cache_type_str[c->cur.type],
VTYNL,
(c->cur.peer && c->cur.peer->online) ? " up": "", (c->cur.peer && c->cur.peer->online) ? " up": "",
c->used ? " used": "", c->used ? " used": "",
VTYNL,
sockunion2str(&c->remote_addr, buf, sizeof buf), sockunion2str(&c->remote_addr, buf, sizeof buf),
8 * family2addrsize(sockunion_family(&c->remote_addr))); 8 * family2addrsize(sockunion_family(&c->remote_addr)));
if (c->cur.peer) { if (c->cur.peer) {
vty_outln(ctx->vty, vty_out(ctx->vty,
"NBMA-Address: %s", "NBMA-Address: %s\n",
sockunion2str(&c->cur.peer->vc->remote.nbma, sockunion2str(&c->cur.peer->vc->remote.nbma,
buf, sizeof buf)); buf, sizeof buf));
} }
if (sockunion_family(&c->cur.remote_nbma_natoa) != AF_UNSPEC) { if (sockunion_family(&c->cur.remote_nbma_natoa) != AF_UNSPEC) {
vty_outln(ctx->vty, vty_out(ctx->vty,
"NBMA-NAT-OA-Address: %s", "NBMA-NAT-OA-Address: %s\n",
sockunion2str(&c->cur.remote_nbma_natoa, buf, sizeof buf)); sockunion2str(&c->cur.remote_nbma_natoa, buf, sizeof buf));
} }
vty_outln(ctx->vty, VTYNL); vty_out(ctx->vty, "\n\n");
} }
DEFUN(show_ip_nhrp, show_ip_nhrp_cmd, DEFUN(show_ip_nhrp, show_ip_nhrp_cmd,
@ -731,14 +729,14 @@ DEFUN(show_ip_nhrp, show_ip_nhrp_cmd,
} else if (argv[3]->text[0] == 's') { } else if (argv[3]->text[0] == 's') {
nhrp_shortcut_foreach(ctx.afi, show_ip_nhrp_shortcut, &ctx); nhrp_shortcut_foreach(ctx.afi, show_ip_nhrp_shortcut, &ctx);
} else { } else {
vty_outln (vty, "Status: ok%s", VTYNL); vty_out (vty, "Status: ok\n\n");
ctx.count++; ctx.count++;
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp))
nhrp_cache_foreach(ifp, show_ip_opennhrp_cache, &ctx); nhrp_cache_foreach(ifp, show_ip_opennhrp_cache, &ctx);
} }
if (!ctx.count) { if (!ctx.count) {
vty_outln (vty, "%% No entries"); vty_out (vty, "%% No entries\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -750,7 +748,7 @@ static void show_dmvpn_entry(struct nhrp_vc *vc, void *ctx)
struct vty *vty = ctx; struct vty *vty = ctx;
char buf[2][SU_ADDRSTRLEN]; char buf[2][SU_ADDRSTRLEN];
vty_outln (vty, "%-24s %-24s %c %-4d %-24s", vty_out (vty, "%-24s %-24s %c %-4d %-24s\n",
sockunion2str(&vc->local.nbma, buf[0], sizeof buf[0]), sockunion2str(&vc->local.nbma, buf[0], sizeof buf[0]),
sockunion2str(&vc->remote.nbma, buf[1], sizeof buf[1]), sockunion2str(&vc->remote.nbma, buf[1], sizeof buf[1]),
notifier_active(&vc->notifier_list) ? 'n' : ' ', notifier_active(&vc->notifier_list) ? 'n' : ' ',
@ -763,7 +761,7 @@ DEFUN(show_dmvpn, show_dmvpn_cmd,
SHOW_STR SHOW_STR
"DMVPN information\n") "DMVPN information\n")
{ {
vty_outln (vty, "%-24s %-24s %-6s %-4s %-24s", vty_out (vty, "%-24s %-24s %-6s %-4s %-24s\n",
"Src", "Src",
"Dst", "Dst",
"Flags", "Flags",
@ -815,11 +813,11 @@ DEFUN(clear_nhrp, clear_nhrp_cmd,
} }
if (!ctx.count) { if (!ctx.count) {
vty_outln (vty, "%% No entries"); vty_out (vty, "%% No entries\n");
return CMD_WARNING; return CMD_WARNING;
} }
vty_outln (vty, "%% %d entries cleared", ctx.count); vty_out (vty, "%% %d entries cleared\n", ctx.count);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -838,7 +836,7 @@ static void interface_config_write_nhrp_map(struct nhrp_cache *c, void *data)
if (!c->map) return; if (!c->map) return;
if (sockunion_family(&c->remote_addr) != ctx->family) return; if (sockunion_family(&c->remote_addr) != ctx->family) return;
vty_outln (vty, " %s nhrp map %s %s", vty_out (vty, " %s nhrp map %s %s\n",
ctx->aficmd, ctx->aficmd,
sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]), sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]),
c->cur.type == NHRP_CACHE_LOCAL ? "local" : sockunion2str(&c->cur.peer->vc->remote.nbma, buf[1], sizeof buf[1])); c->cur.type == NHRP_CACHE_LOCAL ? "local" : sockunion2str(&c->cur.peer->vc->remote.nbma, buf[1], sizeof buf[1]));
@ -857,9 +855,9 @@ static int interface_config_write(struct vty *vty)
int i; int i;
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) { for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
vty_outln (vty, "interface %s", ifp->name); vty_out (vty, "interface %s\n", ifp->name);
if (ifp->desc) if (ifp->desc)
vty_outln (vty, " description %s", ifp->desc); vty_out (vty, " description %s\n", ifp->desc);
nifp = ifp->info; nifp = ifp->info;
if (nifp->ipsec_profile) { if (nifp->ipsec_profile) {
@ -868,10 +866,10 @@ static int interface_config_write(struct vty *vty)
if (nifp->ipsec_fallback_profile) if (nifp->ipsec_fallback_profile)
vty_out(vty, " fallback-profile %s", vty_out(vty, " fallback-profile %s",
nifp->ipsec_fallback_profile); nifp->ipsec_fallback_profile);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
if (nifp->source) if (nifp->source)
vty_outln (vty, " tunnel source %s", vty_out (vty, " tunnel source %s\n",
nifp->source); nifp->source);
for (afi = 0; afi < AFI_MAX; afi++) { for (afi = 0; afi < AFI_MAX; afi++) {
@ -880,24 +878,24 @@ static int interface_config_write(struct vty *vty)
aficmd = afi_to_cmd(afi); aficmd = afi_to_cmd(afi);
if (ad->network_id) if (ad->network_id)
vty_outln (vty, " %s nhrp network-id %u", vty_out (vty, " %s nhrp network-id %u\n",
aficmd,ad->network_id); aficmd,ad->network_id);
if (ad->holdtime != NHRPD_DEFAULT_HOLDTIME) if (ad->holdtime != NHRPD_DEFAULT_HOLDTIME)
vty_outln (vty, " %s nhrp holdtime %u", vty_out (vty, " %s nhrp holdtime %u\n",
aficmd,ad->holdtime); aficmd,ad->holdtime);
if (ad->configured_mtu < 0) if (ad->configured_mtu < 0)
vty_outln (vty, " %s nhrp mtu opennhrp", vty_out (vty, " %s nhrp mtu opennhrp\n",
aficmd); aficmd);
else if (ad->configured_mtu) else if (ad->configured_mtu)
vty_outln (vty, " %s nhrp mtu %u", vty_out (vty, " %s nhrp mtu %u\n",
aficmd,ad->configured_mtu); aficmd,ad->configured_mtu);
for (i = 0; interface_flags_desc[i].str != NULL; i++) { for (i = 0; interface_flags_desc[i].str != NULL; i++) {
if (!(ad->flags & interface_flags_desc[i].key)) if (!(ad->flags & interface_flags_desc[i].key))
continue; continue;
vty_outln (vty, " %s nhrp %s", vty_out (vty, " %s nhrp %s\n",
aficmd, interface_flags_desc[i].str); aficmd, interface_flags_desc[i].str);
} }
@ -909,14 +907,14 @@ static int interface_config_write(struct vty *vty)
nhrp_cache_foreach(ifp, interface_config_write_nhrp_map, &mapctx); nhrp_cache_foreach(ifp, interface_config_write_nhrp_map, &mapctx);
list_for_each_entry(nhs, &ad->nhslist_head, nhslist_entry) { list_for_each_entry(nhs, &ad->nhslist_head, nhslist_entry) {
vty_outln (vty, " %s nhrp nhs %s nbma %s", vty_out (vty, " %s nhrp nhs %s nbma %s\n",
aficmd, aficmd,
sockunion_family(&nhs->proto_addr) == AF_UNSPEC ? "dynamic" : sockunion2str(&nhs->proto_addr, buf, sizeof buf), sockunion_family(&nhs->proto_addr) == AF_UNSPEC ? "dynamic" : sockunion2str(&nhs->proto_addr, buf, sizeof buf),
nhs->nbma_fqdn); nhs->nbma_fqdn);
} }
} }
vty_outln (vty, "!"); vty_out (vty, "!\n");
} }
return 0; return 0;

View File

@ -1066,16 +1066,16 @@ ospf6_inter_area_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
prefix_lsa = (struct ospf6_inter_prefix_lsa *) prefix_lsa = (struct ospf6_inter_prefix_lsa *)
OSPF6_LSA_HEADER_END (lsa->header); OSPF6_LSA_HEADER_END (lsa->header);
vty_out (vty, " Metric: %lu%s", vty_out (vty, " Metric: %lu\n",
(u_long) OSPF6_ABR_SUMMARY_METRIC (prefix_lsa), VNL); (u_long) OSPF6_ABR_SUMMARY_METRIC (prefix_lsa));
ospf6_prefix_options_printbuf (prefix_lsa->prefix.prefix_options, ospf6_prefix_options_printbuf (prefix_lsa->prefix.prefix_options,
buf, sizeof (buf)); buf, sizeof (buf));
vty_out (vty, " Prefix Options: %s%s", buf, VNL); vty_out (vty, " Prefix Options: %s\n", buf);
vty_out (vty, " Prefix: %s%s", vty_out (vty, " Prefix: %s\n",
ospf6_inter_area_prefix_lsa_get_prefix_str (lsa, buf, sizeof(buf), ospf6_inter_area_prefix_lsa_get_prefix_str (lsa, buf, sizeof(buf),
0), VNL); 0));
return 0; return 0;
} }
@ -1109,12 +1109,12 @@ ospf6_inter_area_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
OSPF6_LSA_HEADER_END (lsa->header); OSPF6_LSA_HEADER_END (lsa->header);
ospf6_options_printbuf (router_lsa->options, buf, sizeof (buf)); ospf6_options_printbuf (router_lsa->options, buf, sizeof (buf));
vty_out (vty, " Options: %s%s", buf, VNL); vty_out (vty, " Options: %s\n", buf);
vty_out (vty, " Metric: %lu%s", vty_out (vty, " Metric: %lu\n",
(u_long) OSPF6_ABR_SUMMARY_METRIC (router_lsa), VNL); (u_long) OSPF6_ABR_SUMMARY_METRIC (router_lsa));
inet_ntop (AF_INET, &router_lsa->router_id, buf, sizeof (buf)); inet_ntop (AF_INET, &router_lsa->router_id, buf, sizeof (buf));
vty_out (vty, " Destination Router ID: %s%s", buf, VNL); vty_out (vty, " Destination Router ID: %s\n", buf);
return 0; return 0;
} }
@ -1149,7 +1149,7 @@ int
config_write_ospf6_debug_abr (struct vty *vty) config_write_ospf6_debug_abr (struct vty *vty)
{ {
if (IS_OSPF6_DEBUG_ABR) if (IS_OSPF6_DEBUG_ABR)
vty_out (vty, "debug ospf6 abr%s", VNL); vty_out (vty, "debug ospf6 abr\n");
return 0; return 0;
} }

View File

@ -371,43 +371,43 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa)
unsigned long result; unsigned long result;
if (!IS_AREA_STUB (oa)) if (!IS_AREA_STUB (oa))
vty_out (vty, " Area %s%s", oa->name, VNL); vty_out (vty, " Area %s\n", oa->name);
else else
{ {
if (oa->no_summary) if (oa->no_summary)
{ {
vty_out (vty, " Area %s[Stub, No Summary]%s", oa->name, VNL); vty_out (vty, " Area %s[Stub, No Summary]\n", oa->name);
} }
else else
{ {
vty_out (vty, " Area %s[Stub]%s", oa->name, VNL); vty_out (vty, " Area %s[Stub]\n", oa->name);
} }
} }
vty_out (vty, " Number of Area scoped LSAs is %u%s", vty_out (vty, " Number of Area scoped LSAs is %u\n",
oa->lsdb->count, VNL); oa->lsdb->count);
vty_out (vty, " Interface attached to this area:"); vty_out (vty, " Interface attached to this area:");
for (ALL_LIST_ELEMENTS_RO (oa->if_list, i, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, i, oi))
vty_out (vty, " %s", oi->interface->name); vty_out (vty, " %s", oi->interface->name);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
if (oa->ts_spf.tv_sec || oa->ts_spf.tv_usec) if (oa->ts_spf.tv_sec || oa->ts_spf.tv_usec)
{ {
result = monotime_since(&oa->ts_spf, NULL); result = monotime_since(&oa->ts_spf, NULL);
if (result/TIMER_SECOND_MICRO > 0) if (result/TIMER_SECOND_MICRO > 0)
{ {
vty_outln (vty, "SPF last executed %ld.%lds ago", vty_out (vty, "SPF last executed %ld.%lds ago\n",
result/TIMER_SECOND_MICRO, result/TIMER_SECOND_MICRO,
result % TIMER_SECOND_MICRO); result % TIMER_SECOND_MICRO);
} }
else else
{ {
vty_outln (vty, "SPF last executed %ldus ago", vty_out (vty, "SPF last executed %ldus ago\n",
result); result);
} }
} }
else else
vty_outln (vty, "SPF has not been run"); vty_out (vty, "SPF has not been run\n");
} }
@ -417,7 +417,7 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa)
u_int32_t area_id = htonl (strtoul (str, &ep, 10)); \ u_int32_t area_id = htonl (strtoul (str, &ep, 10)); \
if (*ep && inet_pton (AF_INET, str, &area_id) != 1) \ if (*ep && inet_pton (AF_INET, str, &area_id) != 1) \
{ \ { \
vty_out (vty, "Malformed Area-ID: %s%s", str, VNL); \ vty_out (vty, "Malformed Area-ID: %s\n", str); \
return CMD_SUCCESS; \ return CMD_SUCCESS; \
} \ } \
int format = !*ep ? OSPF6_AREA_FMT_DECIMAL : \ int format = !*ep ? OSPF6_AREA_FMT_DECIMAL : \
@ -454,7 +454,7 @@ DEFUN (area_range,
ret = str2prefix (argv[idx_ipv6_prefixlen]->arg, &prefix); ret = str2prefix (argv[idx_ipv6_prefixlen]->arg, &prefix);
if (ret != 1 || prefix.family != AF_INET6) if (ret != 1 || prefix.family != AF_INET6)
{ {
vty_out (vty, "Malformed argument: %s%s", argv[idx_ipv6_prefixlen]->arg, VNL); vty_out (vty, "Malformed argument: %s\n", argv[idx_ipv6_prefixlen]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -528,14 +528,14 @@ DEFUN (no_area_range,
ret = str2prefix (argv[idx_ipv6]->arg, &prefix); ret = str2prefix (argv[idx_ipv6]->arg, &prefix);
if (ret != 1 || prefix.family != AF_INET6) if (ret != 1 || prefix.family != AF_INET6)
{ {
vty_out (vty, "Malformed argument: %s%s", argv[idx_ipv6]->arg, VNL); vty_out (vty, "Malformed argument: %s\n", argv[idx_ipv6]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
range = ospf6_route_lookup (&prefix, oa->range_table); range = ospf6_route_lookup (&prefix, oa->range_table);
if (range == NULL) if (range == NULL)
{ {
vty_out (vty, "Range %s does not exists.%s", argv[idx_ipv6]->arg, VNL); vty_out (vty, "Range %s does not exists.\n", argv[idx_ipv6]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -583,28 +583,28 @@ ospf6_area_config_write (struct vty *vty)
if (range->path.u.cost_config != OSPF_AREA_RANGE_COST_UNSPEC) if (range->path.u.cost_config != OSPF_AREA_RANGE_COST_UNSPEC)
vty_out (vty, " cost %d", range->path.u.cost_config); vty_out (vty, " cost %d", range->path.u.cost_config);
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
} }
if (IS_AREA_STUB (oa)) if (IS_AREA_STUB (oa))
{ {
if (oa->no_summary) if (oa->no_summary)
vty_out (vty, " area %s stub no-summary%s", oa->name, VNL); vty_out (vty, " area %s stub no-summary\n", oa->name);
else else
vty_out (vty, " area %s stub%s", oa->name, VNL); vty_out (vty, " area %s stub\n", oa->name);
} }
if (PREFIX_NAME_IN (oa)) if (PREFIX_NAME_IN (oa))
vty_out (vty, " area %s filter-list prefix %s in%s", vty_out (vty, " area %s filter-list prefix %s in\n",
oa->name, PREFIX_NAME_IN (oa), VNL); oa->name, PREFIX_NAME_IN (oa));
if (PREFIX_NAME_OUT (oa)) if (PREFIX_NAME_OUT (oa))
vty_out (vty, " area %s filter-list prefix %s out%s", vty_out (vty, " area %s filter-list prefix %s out\n",
oa->name, PREFIX_NAME_OUT (oa), VNL); oa->name, PREFIX_NAME_OUT (oa));
if (IMPORT_NAME (oa)) if (IMPORT_NAME (oa))
vty_out (vty, " area %s import-list %s%s", vty_out (vty, " area %s import-list %s\n",
oa->name, IMPORT_NAME (oa), VNL); oa->name, IMPORT_NAME (oa));
if (EXPORT_NAME (oa)) if (EXPORT_NAME (oa))
vty_out (vty, " area %s export-list %s%s", vty_out (vty, " area %s export-list %s\n",
oa->name, EXPORT_NAME (oa), VNL); oa->name, EXPORT_NAME (oa));
} }
} }
@ -831,8 +831,8 @@ DEFUN (show_ipv6_ospf6_spf_tree,
route = ospf6_route_lookup (&prefix, oa->spf_table); route = ospf6_route_lookup (&prefix, oa->spf_table);
if (route == NULL) if (route == NULL)
{ {
vty_out (vty, "LS entry for root not found in area %s%s", vty_out (vty, "LS entry for root not found in area %s\n",
oa->name, VNL); oa->name);
continue; continue;
} }
root = (struct ospf6_vertex *) route->route_option; root = (struct ospf6_vertex *) route->route_option;
@ -866,21 +866,21 @@ DEFUN (show_ipv6_ospf6_area_spf_tree,
if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1)
{ {
vty_out (vty, "Malformed Area-ID: %s%s", argv[idx_ipv4]->arg, VNL); vty_out (vty, "Malformed Area-ID: %s\n", argv[idx_ipv4]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
oa = ospf6_area_lookup (area_id, ospf6); oa = ospf6_area_lookup (area_id, ospf6);
if (oa == NULL) if (oa == NULL)
{ {
vty_out (vty, "No such Area: %s%s", argv[idx_ipv4]->arg, VNL); vty_out (vty, "No such Area: %s\n", argv[idx_ipv4]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
route = ospf6_route_lookup (&prefix, oa->spf_table); route = ospf6_route_lookup (&prefix, oa->spf_table);
if (route == NULL) if (route == NULL)
{ {
vty_out (vty, "LS entry for root not found in area %s%s", vty_out (vty, "LS entry for root not found in area %s\n",
oa->name, VNL); oa->name);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
root = (struct ospf6_vertex *) route->route_option; root = (struct ospf6_vertex *) route->route_option;
@ -919,13 +919,13 @@ DEFUN (show_ipv6_ospf6_simulate_spf_tree_root,
if (inet_pton (AF_INET, argv[idx_ipv4_2]->arg, &area_id) != 1) if (inet_pton (AF_INET, argv[idx_ipv4_2]->arg, &area_id) != 1)
{ {
vty_out (vty, "Malformed Area-ID: %s%s", argv[idx_ipv4_2]->arg, VNL); vty_out (vty, "Malformed Area-ID: %s\n", argv[idx_ipv4_2]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
oa = ospf6_area_lookup (area_id, ospf6); oa = ospf6_area_lookup (area_id, ospf6);
if (oa == NULL) if (oa == NULL)
{ {
vty_out (vty, "No such Area: %s%s", argv[idx_ipv4_2]->arg, VNL); vty_out (vty, "No such Area: %s\n", argv[idx_ipv4_2]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -968,7 +968,7 @@ DEFUN (ospf6_area_stub,
if (!ospf6_area_stub_set (ospf6, area)) if (!ospf6_area_stub_set (ospf6, area))
{ {
vty_outln (vty,"First deconfigure all virtual link through this area"); vty_out (vty,"First deconfigure all virtual link through this area\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -993,7 +993,7 @@ DEFUN (ospf6_area_stub_no_summary,
if (!ospf6_area_stub_set (ospf6, area)) if (!ospf6_area_stub_set (ospf6, area))
{ {
vty_outln (vty,"First deconfigure all virtual link through this area"); vty_out (vty,"First deconfigure all virtual link through this area\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }

View File

@ -759,11 +759,11 @@ ospf6_redistribute_config_write (struct vty *vty)
continue; continue;
if (ospf6->rmap[type].name) if (ospf6->rmap[type].name)
vty_out (vty, " redistribute %s route-map %s%s", vty_out (vty, " redistribute %s route-map %s\n",
ZROUTE_NAME (type), ospf6->rmap[type].name, VNL); ZROUTE_NAME (type), ospf6->rmap[type].name);
else else
vty_out (vty, " redistribute %s%s", vty_out (vty, " redistribute %s\n",
ZROUTE_NAME (type), VNL); ZROUTE_NAME (type));
} }
return 0; return 0;
@ -789,7 +789,7 @@ ospf6_redistribute_show_config (struct vty *vty)
total++; total++;
} }
vty_out (vty, "Redistributing External Routes from:%s", VNL); vty_out (vty, "Redistributing External Routes from:\n");
for (type = 0; type < ZEBRA_ROUTE_MAX; type++) for (type = 0; type < ZEBRA_ROUTE_MAX; type++)
{ {
if (type == ZEBRA_ROUTE_OSPF6) if (type == ZEBRA_ROUTE_OSPF6)
@ -798,15 +798,14 @@ ospf6_redistribute_show_config (struct vty *vty)
continue; continue;
if (ospf6->rmap[type].name) if (ospf6->rmap[type].name)
vty_out (vty, " %d: %s with route-map \"%s\"%s%s", nroute[type], vty_out (vty, " %d: %s with route-map \"%s\"%s\n", nroute[type],
ZROUTE_NAME (type), ospf6->rmap[type].name, ZROUTE_NAME (type), ospf6->rmap[type].name,
(ospf6->rmap[type].map ? "" : " (not found !)"), (ospf6->rmap[type].map ? "" : " (not found !)"));
VNL);
else else
vty_out (vty, " %d: %s%s", nroute[type], vty_out (vty, " %d: %s\n", nroute[type],
ZROUTE_NAME (type), VNL); ZROUTE_NAME (type));
} }
vty_out (vty, "Total %d routes%s", total, VNL); vty_out (vty, "Total %d routes\n", total);
} }
@ -1082,13 +1081,13 @@ route_map_command_status (struct vty *vty, int ret)
switch (ret) switch (ret)
{ {
case RMAP_RULE_MISSING: case RMAP_RULE_MISSING:
vty_out (vty, "OSPF6 Can't find rule.%s", VNL); vty_out (vty, "OSPF6 Can't find rule.\n");
break; break;
case RMAP_COMPILE_ERROR: case RMAP_COMPILE_ERROR:
vty_out (vty, "OSPF6 Argument is malformed.%s", VNL); vty_out (vty, "OSPF6 Argument is malformed.\n");
break; break;
default: default:
vty_out (vty, "OSPF6 route-map add set failed.%s", VNL); vty_out (vty, "OSPF6 route-map add set failed.\n");
break; break;
} }
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
@ -1247,35 +1246,31 @@ ospf6_as_external_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
(CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_F) ? 'F' : '-'), (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_F) ? 'F' : '-'),
(CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_T) ? 'T' : '-')); (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_T) ? 'T' : '-'));
vty_out (vty, " Bits: %s%s", buf, VNL); vty_out (vty, " Bits: %s\n", buf);
vty_out (vty, " Metric: %5lu%s", (u_long) OSPF6_ASBR_METRIC (external), vty_out (vty, " Metric: %5lu\n", (u_long) OSPF6_ASBR_METRIC (external));
VNL);
ospf6_prefix_options_printbuf (external->prefix.prefix_options, ospf6_prefix_options_printbuf (external->prefix.prefix_options,
buf, sizeof (buf)); buf, sizeof (buf));
vty_out (vty, " Prefix Options: %s%s", buf, vty_out (vty, " Prefix Options: %s\n", buf);
VNL);
vty_out (vty, " Referenced LSType: %d%s", vty_out (vty, " Referenced LSType: %d\n",
ntohs (external->prefix.prefix_refer_lstype), ntohs (external->prefix.prefix_refer_lstype));
VNL);
vty_out (vty, " Prefix: %s%s", vty_out (vty, " Prefix: %s\n",
ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 0), VNL); ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 0));
/* Forwarding-Address */ /* Forwarding-Address */
if (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_F)) if (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_F))
{ {
vty_out (vty, " Forwarding-Address: %s%s", vty_out (vty, " Forwarding-Address: %s\n",
ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 1), ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 1));
VNL);
} }
/* Tag */ /* Tag */
if (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_T)) if (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_T))
{ {
vty_out (vty, " Tag: %"ROUTE_TAG_PRI"%s", vty_out (vty, " Tag: %"ROUTE_TAG_PRI"\n",
ospf6_as_external_lsa_get_tag (lsa), VNL); ospf6_as_external_lsa_get_tag (lsa));
} }
return 0; return 0;
@ -1297,12 +1292,12 @@ ospf6_asbr_external_route_show (struct vty *vty, struct ospf6_route *route)
snprintf (forwarding, sizeof (forwarding), ":: (ifindex %d)", snprintf (forwarding, sizeof (forwarding), ":: (ifindex %d)",
ospf6_route_get_first_nh_index (route)); ospf6_route_get_first_nh_index (route));
vty_out (vty, "%c %-32s %-15s type-%d %5lu %s%s", vty_out (vty, "%c %-32s %-15s type-%d %5lu %s\n",
zebra_route_char(info->type), zebra_route_char(info->type),
prefix, id, route->path.metric_type, prefix, id, route->path.metric_type,
(u_long) (route->path.metric_type == 2 ? (u_long) (route->path.metric_type == 2 ?
route->path.u.cost_e2 : route->path.cost), route->path.u.cost_e2 : route->path.cost),
forwarding, VNL); forwarding);
} }
DEFUN (show_ipv6_ospf6_redistribute, DEFUN (show_ipv6_ospf6_redistribute,
@ -1399,7 +1394,7 @@ int
config_write_ospf6_debug_asbr (struct vty *vty) config_write_ospf6_debug_asbr (struct vty *vty)
{ {
if (IS_OSPF6_DEBUG_ASBR) if (IS_OSPF6_DEBUG_ASBR)
vty_out (vty, "debug ospf6 asbr%s", VNL); vty_out (vty, "debug ospf6 asbr\n");
return 0; return 0;
} }

View File

@ -295,11 +295,11 @@ ospf6_bfd_write_config(struct vty *vty, struct ospf6_interface *oi)
bfd_info = (struct bfd_info *)oi->bfd_info; bfd_info = (struct bfd_info *)oi->bfd_info;
if (CHECK_FLAG(bfd_info->flags, BFD_FLAG_PARAM_CFG)) if (CHECK_FLAG(bfd_info->flags, BFD_FLAG_PARAM_CFG))
vty_outln (vty, " ipv6 ospf6 bfd %d %d %d", vty_out (vty, " ipv6 ospf6 bfd %d %d %d\n",
bfd_info->detect_mult, bfd_info->required_min_rx, bfd_info->detect_mult, bfd_info->required_min_rx,
bfd_info->desired_min_tx); bfd_info->desired_min_tx);
else else
vty_outln (vty, " ipv6 ospf6 bfd"); vty_out (vty, " ipv6 ospf6 bfd\n");
} }
/* /*

View File

@ -1032,7 +1032,7 @@ int
config_write_ospf6_debug_flood (struct vty *vty) config_write_ospf6_debug_flood (struct vty *vty)
{ {
if (IS_OSPF6_DEBUG_FLOODING) if (IS_OSPF6_DEBUG_FLOODING)
vty_out (vty, "debug ospf6 flooding%s", VNL); vty_out (vty, "debug ospf6 flooding\n");
return 0; return 0;
} }

View File

@ -917,20 +917,19 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
else else
type = "UNKNOWN"; type = "UNKNOWN";
vty_out (vty, "%s is %s, type %s%s", vty_out (vty, "%s is %s, type %s\n",
ifp->name, updown[if_is_operative (ifp)], type, ifp->name, updown[if_is_operative (ifp)], type);
VNL); vty_out (vty, " Interface ID: %d\n", ifp->ifindex);
vty_out (vty, " Interface ID: %d%s", ifp->ifindex, VNL);
if (ifp->info == NULL) if (ifp->info == NULL)
{ {
vty_out (vty, " OSPF not enabled on this interface%s", VNL); vty_out (vty, " OSPF not enabled on this interface\n");
return 0; return 0;
} }
else else
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
vty_out (vty, " Internet Address:%s", VNL); vty_out (vty, " Internet Address:\n");
for (ALL_LIST_ELEMENTS_RO (ifp->connected, i, c)) for (ALL_LIST_ELEMENTS_RO (ifp->connected, i, c))
{ {
@ -939,49 +938,43 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
switch (p->family) switch (p->family)
{ {
case AF_INET: case AF_INET:
vty_out (vty, " inet : %s%s", strbuf, vty_out (vty, " inet : %s\n", strbuf);
VNL);
break; break;
case AF_INET6: case AF_INET6:
vty_out (vty, " inet6: %s%s", strbuf, vty_out (vty, " inet6: %s\n", strbuf);
VNL);
break; break;
default: default:
vty_out (vty, " ??? : %s%s", strbuf, vty_out (vty, " ??? : %s\n", strbuf);
VNL);
break; break;
} }
} }
if (oi->area) if (oi->area)
{ {
vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)%s", vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)\n",
oi->instance_id, oi->ifmtu, ifp->mtu6, VNL); oi->instance_id, oi->ifmtu, ifp->mtu6);
vty_out (vty, " MTU mismatch detection: %s%s", oi->mtu_ignore ? vty_out (vty, " MTU mismatch detection: %s\n", oi->mtu_ignore ?
"disabled" : "enabled", VNL); "disabled" : "enabled");
inet_ntop (AF_INET, &oi->area->area_id, inet_ntop (AF_INET, &oi->area->area_id,
strbuf, sizeof (strbuf)); strbuf, sizeof (strbuf));
vty_out (vty, " Area ID %s, Cost %u%s", strbuf, oi->cost, vty_out (vty, " Area ID %s, Cost %u\n", strbuf, oi->cost);
VNL);
} }
else else
vty_out (vty, " Not Attached to Area%s", VNL); vty_out (vty, " Not Attached to Area\n");
vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d%s", vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d\n",
ospf6_interface_state_str[oi->state], ospf6_interface_state_str[oi->state],
oi->transdelay, oi->priority, oi->transdelay, oi->priority);
VNL); vty_out (vty, " Timer intervals configured:\n");
vty_out (vty, " Timer intervals configured:%s", VNL); vty_out (vty, " Hello %d, Dead %d, Retransmit %d\n",
vty_out (vty, " Hello %d, Dead %d, Retransmit %d%s", oi->hello_interval, oi->dead_interval, oi->rxmt_interval);
oi->hello_interval, oi->dead_interval, oi->rxmt_interval,
VNL);
inet_ntop (AF_INET, &oi->drouter, drouter, sizeof (drouter)); inet_ntop (AF_INET, &oi->drouter, drouter, sizeof (drouter));
inet_ntop (AF_INET, &oi->bdrouter, bdrouter, sizeof (bdrouter)); inet_ntop (AF_INET, &oi->bdrouter, bdrouter, sizeof (bdrouter));
vty_out (vty, " DR: %s BDR: %s%s", drouter, bdrouter, VNL); vty_out (vty, " DR: %s BDR: %s\n", drouter, bdrouter);
vty_out (vty, " Number of I/F scoped LSAs is %u%s", vty_out (vty, " Number of I/F scoped LSAs is %u\n",
oi->lsdb->count, VNL); oi->lsdb->count);
monotime(&now); monotime(&now);
@ -989,25 +982,23 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
if (oi->thread_send_lsupdate) if (oi->thread_send_lsupdate)
timersub (&oi->thread_send_lsupdate->u.sands, &now, &res); timersub (&oi->thread_send_lsupdate->u.sands, &now, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s", vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]\n",
oi->lsupdate_list->count, duration, oi->lsupdate_list->count, duration,
(oi->thread_send_lsupdate ? "on" : "off"), (oi->thread_send_lsupdate ? "on" : "off"));
VNL);
for (lsa = ospf6_lsdb_head (oi->lsupdate_list); lsa; for (lsa = ospf6_lsdb_head (oi->lsupdate_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
timerclear (&res); timerclear (&res);
if (oi->thread_send_lsack) if (oi->thread_send_lsack)
timersub (&oi->thread_send_lsack->u.sands, &now, &res); timersub (&oi->thread_send_lsack->u.sands, &now, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s", vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]\n",
oi->lsack_list->count, duration, oi->lsack_list->count, duration,
(oi->thread_send_lsack ? "on" : "off"), (oi->thread_send_lsack ? "on" : "off"));
VNL);
for (lsa = ospf6_lsdb_head (oi->lsack_list); lsa; for (lsa = ospf6_lsdb_head (oi->lsack_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
ospf6_bfd_show_info(vty, oi->bfd_info, 1); ospf6_bfd_show_info(vty, oi->bfd_info, 1);
return 0; return 0;
} }
@ -1031,8 +1022,7 @@ DEFUN (show_ipv6_ospf6_interface,
ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT); ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT);
if (ifp == NULL) if (ifp == NULL)
{ {
vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, vty_out (vty, "No such Interface: %s\n", argv[idx_ifname]->arg);
VNL);
return CMD_WARNING; return CMD_WARNING;
} }
ospf6_interface_show (vty, ifp); ospf6_interface_show (vty, ifp);
@ -1068,14 +1058,14 @@ DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT); ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT);
if (ifp == NULL) if (ifp == NULL)
{ {
vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, VNL); vty_out (vty, "No such Interface: %s\n", argv[idx_ifname]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
oi = ifp->info; oi = ifp->info;
if (oi == NULL) if (oi == NULL)
{ {
vty_out (vty, "OSPFv3 is not enabled on %s%s", argv[idx_ifname]->arg, VNL); vty_out (vty, "OSPFv3 is not enabled on %s\n", argv[idx_ifname]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
@ -1145,8 +1135,8 @@ DEFUN (ipv6_ospf6_ifmtu,
if (ifp->mtu6 != 0 && ifp->mtu6 < ifmtu) if (ifp->mtu6 != 0 && ifp->mtu6 < ifmtu)
{ {
vty_out (vty, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)%s", vty_out (vty, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)\n",
ifp->name, ifp->mtu6, VNL); ifp->name, ifp->mtu6);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1155,8 +1145,8 @@ DEFUN (ipv6_ospf6_ifmtu,
iobuflen = ospf6_iobuf_size (ifmtu); iobuflen = ospf6_iobuf_size (ifmtu);
if (iobuflen < ifmtu) if (iobuflen < ifmtu)
{ {
vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).\n",
ifp->name, iobuflen, VNL); ifp->name, iobuflen);
oi->ifmtu = oi->c_ifmtu = iobuflen; oi->ifmtu = oi->c_ifmtu = iobuflen;
} }
else else
@ -1203,8 +1193,8 @@ DEFUN (no_ipv6_ospf6_ifmtu,
iobuflen = ospf6_iobuf_size (ifp->mtu); iobuflen = ospf6_iobuf_size (ifp->mtu);
if (iobuflen < ifp->mtu) if (iobuflen < ifp->mtu)
{ {
vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).\n",
ifp->name, iobuflen, VNL); ifp->name, iobuflen);
oi->ifmtu = iobuflen; oi->ifmtu = iobuflen;
} }
else else
@ -1250,7 +1240,7 @@ DEFUN (ipv6_ospf6_cost,
if (lcost > UINT32_MAX) if (lcost > UINT32_MAX)
{ {
vty_out (vty, "Cost %ld is out of range%s", lcost, VNL); vty_out (vty, "Cost %ld is out of range\n", lcost);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1307,7 +1297,7 @@ DEFUN (auto_cost_reference_bandwidth,
refbw = strtol (argv[idx_number]->arg, NULL, 10); refbw = strtol (argv[idx_number]->arg, NULL, 10);
if (refbw < 1 || refbw > 4294967) if (refbw < 1 || refbw > 4294967)
{ {
vty_outln (vty, "reference-bandwidth value is invalid"); vty_out (vty, "reference-bandwidth value is invalid\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1769,63 +1759,63 @@ config_write_ospf6_interface (struct vty *vty)
if (oi == NULL) if (oi == NULL)
continue; continue;
vty_out (vty, "interface %s%s", vty_out (vty, "interface %s\n",
oi->interface->name, VNL); oi->interface->name);
if (ifp->desc) if (ifp->desc)
vty_out (vty, " description %s%s", ifp->desc, VNL); vty_out (vty, " description %s\n", ifp->desc);
if (oi->c_ifmtu) if (oi->c_ifmtu)
vty_out (vty, " ipv6 ospf6 ifmtu %d%s", oi->c_ifmtu, VNL); vty_out (vty, " ipv6 ospf6 ifmtu %d\n", oi->c_ifmtu);
if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_NOAUTOCOST)) if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_NOAUTOCOST))
vty_out (vty, " ipv6 ospf6 cost %d%s", vty_out (vty, " ipv6 ospf6 cost %d\n",
oi->cost, VNL); oi->cost);
if (oi->hello_interval != OSPF6_INTERFACE_HELLO_INTERVAL) if (oi->hello_interval != OSPF6_INTERFACE_HELLO_INTERVAL)
vty_out (vty, " ipv6 ospf6 hello-interval %d%s", vty_out (vty, " ipv6 ospf6 hello-interval %d\n",
oi->hello_interval, VNL); oi->hello_interval);
if (oi->dead_interval != OSPF6_INTERFACE_DEAD_INTERVAL) if (oi->dead_interval != OSPF6_INTERFACE_DEAD_INTERVAL)
vty_out (vty, " ipv6 ospf6 dead-interval %d%s", vty_out (vty, " ipv6 ospf6 dead-interval %d\n",
oi->dead_interval, VNL); oi->dead_interval);
if (oi->rxmt_interval != OSPF6_INTERFACE_RXMT_INTERVAL) if (oi->rxmt_interval != OSPF6_INTERFACE_RXMT_INTERVAL)
vty_out (vty, " ipv6 ospf6 retransmit-interval %d%s", vty_out (vty, " ipv6 ospf6 retransmit-interval %d\n",
oi->rxmt_interval, VNL); oi->rxmt_interval);
if (oi->priority != OSPF6_INTERFACE_PRIORITY) if (oi->priority != OSPF6_INTERFACE_PRIORITY)
vty_out (vty, " ipv6 ospf6 priority %d%s", vty_out (vty, " ipv6 ospf6 priority %d\n",
oi->priority, VNL); oi->priority);
if (oi->transdelay != OSPF6_INTERFACE_TRANSDELAY) if (oi->transdelay != OSPF6_INTERFACE_TRANSDELAY)
vty_out (vty, " ipv6 ospf6 transmit-delay %d%s", vty_out (vty, " ipv6 ospf6 transmit-delay %d\n",
oi->transdelay, VNL); oi->transdelay);
if (oi->instance_id != OSPF6_INTERFACE_INSTANCE_ID) if (oi->instance_id != OSPF6_INTERFACE_INSTANCE_ID)
vty_out (vty, " ipv6 ospf6 instance-id %d%s", vty_out (vty, " ipv6 ospf6 instance-id %d\n",
oi->instance_id, VNL); oi->instance_id);
if (oi->plist_name) if (oi->plist_name)
vty_out (vty, " ipv6 ospf6 advertise prefix-list %s%s", vty_out (vty, " ipv6 ospf6 advertise prefix-list %s\n",
oi->plist_name, VNL); oi->plist_name);
if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE)) if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE))
vty_out (vty, " ipv6 ospf6 passive%s", VNL); vty_out (vty, " ipv6 ospf6 passive\n");
if (oi->mtu_ignore) if (oi->mtu_ignore)
vty_out (vty, " ipv6 ospf6 mtu-ignore%s", VNL); vty_out (vty, " ipv6 ospf6 mtu-ignore\n");
if (oi->type != ospf6_default_iftype(ifp)) if (oi->type != ospf6_default_iftype(ifp))
{ {
if (oi->type == OSPF_IFTYPE_POINTOPOINT) if (oi->type == OSPF_IFTYPE_POINTOPOINT)
vty_out (vty, " ipv6 ospf6 network point-to-point%s", VNL); vty_out (vty, " ipv6 ospf6 network point-to-point\n");
else if (oi->type == OSPF_IFTYPE_BROADCAST) else if (oi->type == OSPF_IFTYPE_BROADCAST)
vty_out (vty, " ipv6 ospf6 network broadcast%s", VNL); vty_out (vty, " ipv6 ospf6 network broadcast\n");
} }
ospf6_bfd_write_config(vty, oi); ospf6_bfd_write_config(vty, oi);
vty_out (vty, "!%s", VNL); vty_out (vty, "!\n");
} }
return 0; return 0;
} }
@ -1922,7 +1912,7 @@ DEFUN (clear_ipv6_ospf6_interface,
{ {
if ((ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT)) == NULL) if ((ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT)) == NULL)
{ {
vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, VNL); vty_out (vty, "No such Interface: %s\n", argv[idx_ifname]->arg);
return CMD_WARNING; return CMD_WARNING;
} }
ospf6_interface_clear (vty, ifp); ospf6_interface_clear (vty, ifp);
@ -1966,7 +1956,7 @@ int
config_write_ospf6_debug_interface (struct vty *vty) config_write_ospf6_debug_interface (struct vty *vty)
{ {
if (IS_OSPF6_DEBUG_INTERFACE) if (IS_OSPF6_DEBUG_INTERFACE)
vty_out (vty, "debug ospf6 interface%s", VNL); vty_out (vty, "debug ospf6 interface\n");
return 0; return 0;
} }

View File

@ -105,7 +105,7 @@ ospf6_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
ospf6_capability_printbuf (router_lsa->bits, bits, sizeof (bits)); ospf6_capability_printbuf (router_lsa->bits, bits, sizeof (bits));
ospf6_options_printbuf (router_lsa->options, options, sizeof (options)); ospf6_options_printbuf (router_lsa->options, options, sizeof (options));
vty_out (vty, " Bits: %s Options: %s%s", bits, options, VNL); vty_out (vty, " Bits: %s Options: %s\n", bits, options);
start = (char *) router_lsa + sizeof (struct ospf6_router_lsa); start = (char *) router_lsa + sizeof (struct ospf6_router_lsa);
end = (char *) lsa->header + ntohs (lsa->header->length); end = (char *) lsa->header + ntohs (lsa->header->length);
@ -125,17 +125,17 @@ ospf6_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
else else
snprintf (name, sizeof (name), "Unknown (%#x)", lsdesc->type); snprintf (name, sizeof (name), "Unknown (%#x)", lsdesc->type);
vty_out (vty, " Type: %s Metric: %d%s", vty_out (vty, " Type: %s Metric: %d\n",
name, ntohs (lsdesc->metric), VNL); name, ntohs (lsdesc->metric));
vty_out (vty, " Interface ID: %s%s", vty_out (vty, " Interface ID: %s\n",
inet_ntop (AF_INET, &lsdesc->interface_id, inet_ntop (AF_INET, &lsdesc->interface_id,
buf, sizeof (buf)), VNL); buf, sizeof (buf)));
vty_out (vty, " Neighbor Interface ID: %s%s", vty_out (vty, " Neighbor Interface ID: %s\n",
inet_ntop (AF_INET, &lsdesc->neighbor_interface_id, inet_ntop (AF_INET, &lsdesc->neighbor_interface_id,
buf, sizeof (buf)), VNL); buf, sizeof (buf)));
vty_out (vty, " Neighbor Router ID: %s%s", vty_out (vty, " Neighbor Router ID: %s\n",
inet_ntop (AF_INET, &lsdesc->neighbor_router_id, inet_ntop (AF_INET, &lsdesc->neighbor_router_id,
buf, sizeof (buf)), VNL); buf, sizeof (buf)));
} }
return 0; return 0;
} }
@ -408,7 +408,7 @@ ospf6_network_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
((caddr_t) lsa->header + sizeof (struct ospf6_lsa_header)); ((caddr_t) lsa->header + sizeof (struct ospf6_lsa_header));
ospf6_options_printbuf (network_lsa->options, options, sizeof (options)); ospf6_options_printbuf (network_lsa->options, options, sizeof (options));
vty_out (vty, " Options: %s%s", options, VNL); vty_out (vty, " Options: %s\n", options);
start = (char *) network_lsa + sizeof (struct ospf6_network_lsa); start = (char *) network_lsa + sizeof (struct ospf6_network_lsa);
end = (char *) lsa->header + ntohs (lsa->header->length); end = (char *) lsa->header + ntohs (lsa->header->length);
@ -417,7 +417,7 @@ ospf6_network_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
{ {
lsdesc = (struct ospf6_network_lsdesc *) current; lsdesc = (struct ospf6_network_lsdesc *) current;
inet_ntop (AF_INET, &lsdesc->router_id, buf, sizeof (buf)); inet_ntop (AF_INET, &lsdesc->router_id, buf, sizeof (buf));
vty_out (vty, " Attached Router: %s%s", buf, VNL); vty_out (vty, " Attached Router: %s\n", buf);
} }
return 0; return 0;
} }
@ -623,10 +623,10 @@ ospf6_link_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
inet_ntop (AF_INET6, &link_lsa->linklocal_addr, buf, sizeof (buf)); inet_ntop (AF_INET6, &link_lsa->linklocal_addr, buf, sizeof (buf));
prefixnum = ntohl (link_lsa->prefix_num); prefixnum = ntohl (link_lsa->prefix_num);
vty_out (vty, " Priority: %d Options: %s%s", vty_out (vty, " Priority: %d Options: %s\n",
link_lsa->priority, options, VNL); link_lsa->priority, options);
vty_out (vty, " LinkLocal Address: %s%s", buf, VNL); vty_out (vty, " LinkLocal Address: %s\n", buf);
vty_out (vty, " Number of Prefix: %d%s", prefixnum, VNL); vty_out (vty, " Number of Prefix: %d\n", prefixnum);
start = (char *) link_lsa + sizeof (struct ospf6_link_lsa); start = (char *) link_lsa + sizeof (struct ospf6_link_lsa);
end = (char *) lsa->header + ntohs (lsa->header->length); end = (char *) lsa->header + ntohs (lsa->header->length);
@ -645,15 +645,15 @@ ospf6_link_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
"LA" : "--"); "LA" : "--");
nu = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_NU) ? nu = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_NU) ?
"NU" : "--"); "NU" : "--");
vty_out (vty, " Prefix Options: %s|%s|%s|%s%s", vty_out (vty, " Prefix Options: %s|%s|%s|%s\n",
p, mc, la, nu, VNL); p, mc, la, nu);
memset (&in6, 0, sizeof (in6)); memset (&in6, 0, sizeof (in6));
memcpy (&in6, OSPF6_PREFIX_BODY (prefix), memcpy (&in6, OSPF6_PREFIX_BODY (prefix),
OSPF6_PREFIX_SPACE (prefix->prefix_length)); OSPF6_PREFIX_SPACE (prefix->prefix_length));
inet_ntop (AF_INET6, &in6, buf, sizeof (buf)); inet_ntop (AF_INET6, &in6, buf, sizeof (buf));
vty_out (vty, " Prefix: %s/%d%s", vty_out (vty, " Prefix: %s/%d\n",
buf, prefix->prefix_length, VNL); buf, prefix->prefix_length);
} }
return 0; return 0;
@ -825,14 +825,13 @@ ospf6_intra_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
prefixnum = ntohs (intra_prefix_lsa->prefix_num); prefixnum = ntohs (intra_prefix_lsa->prefix_num);
vty_out (vty, " Number of Prefix: %d%s", prefixnum, VNL); vty_out (vty, " Number of Prefix: %d\n", prefixnum);
inet_ntop (AF_INET, &intra_prefix_lsa->ref_id, id, sizeof (id)); inet_ntop (AF_INET, &intra_prefix_lsa->ref_id, id, sizeof (id));
inet_ntop (AF_INET, &intra_prefix_lsa->ref_adv_router, inet_ntop (AF_INET, &intra_prefix_lsa->ref_adv_router,
adv_router, sizeof (adv_router)); adv_router, sizeof (adv_router));
vty_out (vty, " Reference: %s Id: %s Adv: %s%s", vty_out (vty, " Reference: %s Id: %s Adv: %s\n",
ospf6_lstype_name (intra_prefix_lsa->ref_type), id, adv_router, ospf6_lstype_name (intra_prefix_lsa->ref_type), id, adv_router);
VNL);
start = (char *) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa); start = (char *) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa);
end = (char *) lsa->header + ntohs (lsa->header->length); end = (char *) lsa->header + ntohs (lsa->header->length);
@ -851,15 +850,15 @@ ospf6_intra_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
"LA" : "--"); "LA" : "--");
nu = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_NU) ? nu = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_NU) ?
"NU" : "--"); "NU" : "--");
vty_out (vty, " Prefix Options: %s|%s|%s|%s%s", vty_out (vty, " Prefix Options: %s|%s|%s|%s\n",
p, mc, la, nu, VNL); p, mc, la, nu);
memset (&in6, 0, sizeof (in6)); memset (&in6, 0, sizeof (in6));
memcpy (&in6, OSPF6_PREFIX_BODY (prefix), memcpy (&in6, OSPF6_PREFIX_BODY (prefix),
OSPF6_PREFIX_SPACE (prefix->prefix_length)); OSPF6_PREFIX_SPACE (prefix->prefix_length));
inet_ntop (AF_INET6, &in6, buf, sizeof (buf)); inet_ntop (AF_INET6, &in6, buf, sizeof (buf));
vty_out (vty, " Prefix: %s/%d%s", vty_out (vty, " Prefix: %s/%d\n",
buf, prefix->prefix_length, VNL); buf, prefix->prefix_length);
} }
return 0; return 0;
@ -1793,18 +1792,18 @@ config_write_ospf6_debug_brouter (struct vty *vty)
{ {
char buf[16]; char buf[16];
if (IS_OSPF6_DEBUG_BROUTER) if (IS_OSPF6_DEBUG_BROUTER)
vty_out (vty, "debug ospf6 border-routers%s", VNL); vty_out (vty, "debug ospf6 border-routers\n");
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER) if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER)
{ {
inet_ntop (AF_INET, &conf_debug_ospf6_brouter_specific_router_id, inet_ntop (AF_INET, &conf_debug_ospf6_brouter_specific_router_id,
buf, sizeof (buf)); buf, sizeof (buf));
vty_out (vty, "debug ospf6 border-routers router-id %s%s", buf, VNL); vty_out (vty, "debug ospf6 border-routers router-id %s\n", buf);
} }
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA) if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA)
{ {
inet_ntop (AF_INET, &conf_debug_ospf6_brouter_specific_area_id, inet_ntop (AF_INET, &conf_debug_ospf6_brouter_specific_area_id,
buf, sizeof (buf)); buf, sizeof (buf));
vty_out (vty, "debug ospf6 border-routers area-id %s%s", buf, VNL); vty_out (vty, "debug ospf6 border-routers area-id %s\n", buf);
} }
return 0; return 0;
} }

View File

@ -54,11 +54,11 @@ ospf6_unknown_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
start = (u_char *) lsa->header + sizeof (struct ospf6_lsa_header); start = (u_char *) lsa->header + sizeof (struct ospf6_lsa_header);
end = (u_char *) lsa->header + ntohs (lsa->header->length); end = (u_char *) lsa->header + ntohs (lsa->header->length);
vty_out (vty, " Unknown contents:%s", VNL); vty_out (vty, " Unknown contents:\n");
for (current = start; current < end; current ++) for (current = start; current < end; current ++)
{ {
if ((current - start) % 16 == 0) if ((current - start) % 16 == 0)
vty_out (vty, "%s ", VNL); vty_out (vty, "\n ");
else if ((current - start) % 4 == 0) else if ((current - start) % 4 == 0)
vty_out (vty, " "); vty_out (vty, " ");
@ -66,7 +66,7 @@ ospf6_unknown_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
vty_out (vty, "%s", byte); vty_out (vty, "%s", byte);
} }
vty_out (vty, "%s%s", VNL, VNL); vty_out (vty, "\n\n");
return 0; return 0;
} }
@ -381,9 +381,9 @@ ospf6_lsa_header_print (struct ospf6_lsa *lsa)
void void
ospf6_lsa_show_summary_header (struct vty *vty) ospf6_lsa_show_summary_header (struct vty *vty)
{ {
vty_out (vty, "%-4s %-15s%-15s%4s %8s %30s%s", vty_out (vty, "%-4s %-15s%-15s%4s %8s %30s\n",
"Type", "LSId", "AdvRouter", "Age", "SeqNum", "Type", "LSId", "AdvRouter", "Age", "SeqNum",
"Payload", VNL); "Payload");
} }
void void
@ -408,11 +408,11 @@ ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa)
(type == OSPF6_LSTYPE_INTER_ROUTER) || (type == OSPF6_LSTYPE_INTER_ROUTER) ||
(type == OSPF6_LSTYPE_AS_EXTERNAL)) (type == OSPF6_LSTYPE_AS_EXTERNAL))
{ {
vty_out (vty, "%-4s %-15s%-15s%4hu %8lx %30s%s", vty_out (vty, "%-4s %-15s%-15s%4hu %8lx %30s\n",
ospf6_lstype_short_name (lsa->header->type), ospf6_lstype_short_name (lsa->header->type),
id, adv_router, ospf6_lsa_age_current (lsa), id, adv_router, ospf6_lsa_age_current (lsa),
(u_long) ntohl (lsa->header->seqnum), (u_long) ntohl (lsa->header->seqnum),
handler->get_prefix_str(lsa, buf, sizeof(buf), 0), VNL); handler->get_prefix_str(lsa, buf, sizeof(buf), 0));
} }
else if (type != OSPF6_LSTYPE_UNKNOWN) else if (type != OSPF6_LSTYPE_UNKNOWN)
{ {
@ -423,16 +423,16 @@ ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa)
while (handler->get_prefix_str(lsa, buf, sizeof(buf), cnt) != NULL) while (handler->get_prefix_str(lsa, buf, sizeof(buf), cnt) != NULL)
{ {
vty_out (vty, "%s %30s%s", tmpbuf, buf, VNL); vty_out (vty, "%s %30s\n", tmpbuf, buf);
cnt++; cnt++;
} }
} }
else else
{ {
vty_out (vty, "%-4s %-15s%-15s%4hu %8lx%s", vty_out (vty, "%-4s %-15s%-15s%4hu %8lx\n",
ospf6_lstype_short_name (lsa->header->type), ospf6_lstype_short_name (lsa->header->type),
id, adv_router, ospf6_lsa_age_current (lsa), id, adv_router, ospf6_lsa_age_current (lsa),
(u_long) ntohl (lsa->header->seqnum), VNL); (u_long) ntohl (lsa->header->seqnum));
} }
} }
@ -445,13 +445,13 @@ ospf6_lsa_show_dump (struct vty *vty, struct ospf6_lsa *lsa)
start = (u_char *) lsa->header; start = (u_char *) lsa->header;
end = (u_char *) lsa->header + ntohs (lsa->header->length); end = (u_char *) lsa->header + ntohs (lsa->header->length);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
vty_out (vty, "%s:%s", lsa->name, VNL); vty_out (vty, "%s:\n", lsa->name);
for (current = start; current < end; current ++) for (current = start; current < end; current ++)
{ {
if ((current - start) % 16 == 0) if ((current - start) % 16 == 0)
vty_out (vty, "%s ", VNL); vty_out (vty, "\n ");
else if ((current - start) % 4 == 0) else if ((current - start) % 4 == 0)
vty_out (vty, " "); vty_out (vty, " ");
@ -459,7 +459,7 @@ ospf6_lsa_show_dump (struct vty *vty, struct ospf6_lsa *lsa)
vty_out (vty, "%s", byte); vty_out (vty, "%s", byte);
} }
vty_out (vty, "%s%s", VNL, VNL); vty_out (vty, "\n\n");
return; return;
} }
@ -474,22 +474,22 @@ ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa)
inet_ntop (AF_INET, &lsa->header->adv_router, inet_ntop (AF_INET, &lsa->header->adv_router,
adv_router, sizeof (adv_router)); adv_router, sizeof (adv_router));
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
vty_out (vty, "Age: %4hu Type: %s%s", ospf6_lsa_age_current (lsa), vty_out (vty, "Age: %4hu Type: %s\n", ospf6_lsa_age_current (lsa),
ospf6_lstype_name (lsa->header->type), VNL); ospf6_lstype_name (lsa->header->type));
vty_out (vty, "Link State ID: %s%s", id, VNL); vty_out (vty, "Link State ID: %s\n", id);
vty_out (vty, "Advertising Router: %s%s", adv_router, VNL); vty_out (vty, "Advertising Router: %s\n", adv_router);
vty_out (vty, "LS Sequence Number: %#010lx%s", vty_out (vty, "LS Sequence Number: %#010lx\n",
(u_long) ntohl (lsa->header->seqnum), VNL); (u_long) ntohl (lsa->header->seqnum));
vty_out (vty, "CheckSum: %#06hx Length: %hu%s", vty_out (vty, "CheckSum: %#06hx Length: %hu\n",
ntohs (lsa->header->checksum), ntohs (lsa->header->checksum),
ntohs (lsa->header->length), VNL); ntohs (lsa->header->length));
vty_out (vty, "Flag: %x %s", lsa->flag, VNL); vty_out (vty, "Flag: %x \n", lsa->flag);
vty_out (vty, "Lock: %d %s", lsa->lock, VNL); vty_out (vty, "Lock: %d \n", lsa->lock);
vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VNL); vty_out (vty, "ReTx Count: %d\n", lsa->retrans_count);
vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p %s", vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p \n",
(void *)lsa->expire, (void *)lsa->refresh, VNL); (void *)lsa->expire, (void *)lsa->refresh);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return; return;
} }
@ -511,23 +511,23 @@ ospf6_lsa_show (struct vty *vty, struct ospf6_lsa *lsa)
timersub (&now, &lsa->installed, &res); timersub (&now, &lsa->installed, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, "Age: %4hu Type: %s%s", ospf6_lsa_age_current (lsa), vty_out (vty, "Age: %4hu Type: %s\n", ospf6_lsa_age_current (lsa),
ospf6_lstype_name (lsa->header->type), VNL); ospf6_lstype_name (lsa->header->type));
vty_out (vty, "Link State ID: %s%s", id, VNL); vty_out (vty, "Link State ID: %s\n", id);
vty_out (vty, "Advertising Router: %s%s", adv_router, VNL); vty_out (vty, "Advertising Router: %s\n", adv_router);
vty_out (vty, "LS Sequence Number: %#010lx%s", vty_out (vty, "LS Sequence Number: %#010lx\n",
(u_long) ntohl (lsa->header->seqnum), VNL); (u_long) ntohl (lsa->header->seqnum));
vty_out (vty, "CheckSum: %#06hx Length: %hu%s", vty_out (vty, "CheckSum: %#06hx Length: %hu\n",
ntohs (lsa->header->checksum), ntohs (lsa->header->checksum),
ntohs (lsa->header->length), VNL); ntohs (lsa->header->length));
vty_out (vty, "Duration: %s%s", duration, VNL); vty_out (vty, "Duration: %s\n", duration);
handler = ospf6_get_lsa_handler (lsa->header->type); handler = ospf6_get_lsa_handler (lsa->header->type);
if (handler->show == NULL) if (handler->show == NULL)
handler = &unknown_handler; handler = &unknown_handler;
(*handler->show) (vty, lsa); (*handler->show) (vty, lsa);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
} }
/* OSPFv3 LSA creation/deletion function */ /* OSPFv3 LSA creation/deletion function */
@ -937,17 +937,17 @@ config_write_ospf6_debug_lsa (struct vty *vty)
if (handler == NULL) if (handler == NULL)
continue; continue;
if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG)) if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG))
vty_out (vty, "debug ospf6 lsa %s%s", vty_out (vty, "debug ospf6 lsa %s\n",
ospf6_lsa_handler_name (handler), VNL); ospf6_lsa_handler_name (handler));
if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE)) if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE))
vty_out (vty, "debug ospf6 lsa %s originate%s", vty_out (vty, "debug ospf6 lsa %s originate\n",
ospf6_lsa_handler_name (handler), VNL); ospf6_lsa_handler_name (handler));
if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN)) if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN))
vty_out (vty, "debug ospf6 lsa %s examine%s", vty_out (vty, "debug ospf6 lsa %s examine\n",
ospf6_lsa_handler_name (handler), VNL); ospf6_lsa_handler_name (handler));
if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD)) if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD))
vty_out (vty, "debug ospf6 lsa %s flooding%s", vty_out (vty, "debug ospf6 lsa %s flooding\n",
ospf6_lsa_handler_name (handler), VNL); ospf6_lsa_handler_name (handler));
} }
return 0; return 0;

View File

@ -2459,41 +2459,39 @@ config_write_ospf6_debug_message (struct vty *vty)
if (s == 0x3f && r == 0x3f) if (s == 0x3f && r == 0x3f)
{ {
vty_out (vty, "debug ospf6 message all%s", VNL); vty_out (vty, "debug ospf6 message all\n");
return 0; return 0;
} }
if (s == 0x3f && r == 0) if (s == 0x3f && r == 0)
{ {
vty_out (vty, "debug ospf6 message all send%s", VNL); vty_out (vty, "debug ospf6 message all send\n");
return 0; return 0;
} }
else if (s == 0 && r == 0x3f) else if (s == 0 && r == 0x3f)
{ {
vty_out (vty, "debug ospf6 message all recv%s", VNL); vty_out (vty, "debug ospf6 message all recv\n");
return 0; return 0;
} }
/* Unknown message is logged by default */ /* Unknown message is logged by default */
if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, SEND) && if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, SEND) &&
! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, RECV)) ! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, RECV))
vty_out (vty, "no debug ospf6 message unknown%s", VNL); vty_out (vty, "no debug ospf6 message unknown\n");
else if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, SEND)) else if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, SEND))
vty_out (vty, "no debug ospf6 message unknown send%s", VNL); vty_out (vty, "no debug ospf6 message unknown send\n");
else if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, RECV)) else if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, RECV))
vty_out (vty, "no debug ospf6 message unknown recv%s", VNL); vty_out (vty, "no debug ospf6 message unknown recv\n");
for (i = 1; i < 6; i++) for (i = 1; i < 6; i++)
{ {
if (IS_OSPF6_DEBUG_MESSAGE (i, SEND) && if (IS_OSPF6_DEBUG_MESSAGE (i, SEND) &&
IS_OSPF6_DEBUG_MESSAGE (i, RECV)) IS_OSPF6_DEBUG_MESSAGE (i, RECV))
vty_out (vty, "debug ospf6 message %s%s", type_str[i], VNL); vty_out (vty, "debug ospf6 message %s\n", type_str[i]);
else if (IS_OSPF6_DEBUG_MESSAGE (i, SEND)) else if (IS_OSPF6_DEBUG_MESSAGE (i, SEND))
vty_out (vty, "debug ospf6 message %s send%s", type_str[i], vty_out (vty, "debug ospf6 message %s send\n", type_str[i]);
VNL);
else if (IS_OSPF6_DEBUG_MESSAGE (i, RECV)) else if (IS_OSPF6_DEBUG_MESSAGE (i, RECV))
vty_out (vty, "debug ospf6 message %s recv%s", type_str[i], vty_out (vty, "debug ospf6 message %s recv\n", type_str[i]);
VNL);
} }
return 0; return 0;

View File

@ -673,16 +673,16 @@ ospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on)
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
/* /*
vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]%s", vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]\n",
"Neighbor ID", "Pri", "DeadTime", "State", "", "Duration", "Neighbor ID", "Pri", "DeadTime", "State", "", "Duration",
"I/F", "State", VNL); "I/F", "State");
*/ */
vty_out (vty, "%-15s %3d %11s %8s/%-12s %11s %s[%s]%s", vty_out (vty, "%-15s %3d %11s %8s/%-12s %11s %s[%s]\n",
router_id, on->priority, deadtime, router_id, on->priority, deadtime,
ospf6_neighbor_state_str[on->state], nstate, duration, ospf6_neighbor_state_str[on->state], nstate, duration,
on->ospf6_if->interface->name, on->ospf6_if->interface->name,
ospf6_interface_state_str[on->ospf6_if->state], VNL); ospf6_interface_state_str[on->ospf6_if->state]);
} }
static void static void
@ -694,9 +694,9 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on)
struct timeval now, res; struct timeval now, res;
/* /*
vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]%s", vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]\n",
"RouterID", "State", "Duration", "DR", "BDR", "I/F", "RouterID", "State", "Duration", "DR", "BDR", "I/F",
"State", VNL); "State");
*/ */
inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id)); inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id));
@ -707,11 +707,10 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on)
timersub (&now, &on->last_changed, &res); timersub (&now, &on->last_changed, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]%s", vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]\n",
router_id, ospf6_neighbor_state_str[on->state], router_id, ospf6_neighbor_state_str[on->state],
duration, drouter, bdrouter, on->ospf6_if->interface->name, duration, drouter, bdrouter, on->ospf6_if->interface->name,
ospf6_interface_state_str[on->ospf6_if->state], ospf6_interface_state_str[on->ospf6_if->state]);
VNL);
} }
static void static void
@ -731,94 +730,81 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
timersub (&now, &on->last_changed, &res); timersub (&now, &on->last_changed, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, " Neighbor %s%s", on->name, vty_out (vty, " Neighbor %s\n", on->name);
VNL); vty_out (vty, " Area %s via interface %s (ifindex %d)\n",
vty_out (vty, " Area %s via interface %s (ifindex %d)%s",
on->ospf6_if->area->name, on->ospf6_if->area->name,
on->ospf6_if->interface->name, on->ospf6_if->interface->name,
on->ospf6_if->interface->ifindex, on->ospf6_if->interface->ifindex);
VNL); vty_out (vty, " His IfIndex: %d Link-local address: %s\n",
vty_out (vty, " His IfIndex: %d Link-local address: %s%s", on->ifindex, linklocal_addr);
on->ifindex, linklocal_addr, vty_out (vty, " State %s for a duration of %s\n",
VNL); ospf6_neighbor_state_str[on->state], duration);
vty_out (vty, " State %s for a duration of %s%s", vty_out (vty, " His choice of DR/BDR %s/%s, Priority %d\n",
ospf6_neighbor_state_str[on->state], duration, drouter, bdrouter, on->priority);
VNL); vty_out (vty, " DbDesc status: %s%s%s SeqNum: %#lx\n",
vty_out (vty, " His choice of DR/BDR %s/%s, Priority %d%s",
drouter, bdrouter, on->priority,
VNL);
vty_out (vty, " DbDesc status: %s%s%s SeqNum: %#lx%s",
(CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT) ? "Initial " : ""), (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT) ? "Initial " : ""),
(CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT) ? "More " : ""), (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT) ? "More " : ""),
(CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT) ? (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT) ?
"Master" : "Slave"), (u_long) ntohl (on->dbdesc_seqnum), "Master" : "Slave"), (u_long) ntohl (on->dbdesc_seqnum));
VNL);
vty_out (vty, " Summary-List: %d LSAs%s", on->summary_list->count, vty_out (vty, " Summary-List: %d LSAs\n", on->summary_list->count);
VNL);
for (lsa = ospf6_lsdb_head (on->summary_list); lsa; for (lsa = ospf6_lsdb_head (on->summary_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
vty_out (vty, " Request-List: %d LSAs%s", on->request_list->count, vty_out (vty, " Request-List: %d LSAs\n", on->request_list->count);
VNL);
for (lsa = ospf6_lsdb_head (on->request_list); lsa; for (lsa = ospf6_lsdb_head (on->request_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
vty_out (vty, " Retrans-List: %d LSAs%s", on->retrans_list->count, vty_out (vty, " Retrans-List: %d LSAs\n", on->retrans_list->count);
VNL);
for (lsa = ospf6_lsdb_head (on->retrans_list); lsa; for (lsa = ospf6_lsdb_head (on->retrans_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
timerclear (&res); timerclear (&res);
if (on->thread_send_dbdesc) if (on->thread_send_dbdesc)
timersub (&on->thread_send_dbdesc->u.sands, &now, &res); timersub (&on->thread_send_dbdesc->u.sands, &now, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, " %d Pending LSAs for DbDesc in Time %s [thread %s]%s", vty_out (vty, " %d Pending LSAs for DbDesc in Time %s [thread %s]\n",
on->dbdesc_list->count, duration, on->dbdesc_list->count, duration,
(on->thread_send_dbdesc ? "on" : "off"), (on->thread_send_dbdesc ? "on" : "off"));
VNL);
for (lsa = ospf6_lsdb_head (on->dbdesc_list); lsa; for (lsa = ospf6_lsdb_head (on->dbdesc_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
timerclear (&res); timerclear (&res);
if (on->thread_send_lsreq) if (on->thread_send_lsreq)
timersub (&on->thread_send_lsreq->u.sands, &now, &res); timersub (&on->thread_send_lsreq->u.sands, &now, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, " %d Pending LSAs for LSReq in Time %s [thread %s]%s", vty_out (vty, " %d Pending LSAs for LSReq in Time %s [thread %s]\n",
on->request_list->count, duration, on->request_list->count, duration,
(on->thread_send_lsreq ? "on" : "off"), (on->thread_send_lsreq ? "on" : "off"));
VNL);
for (lsa = ospf6_lsdb_head (on->request_list); lsa; for (lsa = ospf6_lsdb_head (on->request_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
timerclear (&res); timerclear (&res);
if (on->thread_send_lsupdate) if (on->thread_send_lsupdate)
timersub (&on->thread_send_lsupdate->u.sands, &now, &res); timersub (&on->thread_send_lsupdate->u.sands, &now, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s", vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]\n",
on->lsupdate_list->count, duration, on->lsupdate_list->count, duration,
(on->thread_send_lsupdate ? "on" : "off"), (on->thread_send_lsupdate ? "on" : "off"));
VNL);
for (lsa = ospf6_lsdb_head (on->lsupdate_list); lsa; for (lsa = ospf6_lsdb_head (on->lsupdate_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
timerclear (&res); timerclear (&res);
if (on->thread_send_lsack) if (on->thread_send_lsack)
timersub (&on->thread_send_lsack->u.sands, &now, &res); timersub (&on->thread_send_lsack->u.sands, &now, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s", vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]\n",
on->lsack_list->count, duration, on->lsack_list->count, duration,
(on->thread_send_lsack ? "on" : "off"), (on->thread_send_lsack ? "on" : "off"));
VNL);
for (lsa = ospf6_lsdb_head (on->lsack_list); lsa; for (lsa = ospf6_lsdb_head (on->lsack_list); lsa;
lsa = ospf6_lsdb_next (lsa)) lsa = ospf6_lsdb_next (lsa))
vty_out (vty, " %s%s", lsa->name, VNL); vty_out (vty, " %s\n", lsa->name);
ospf6_bfd_show_info(vty, on->bfd_info, 0); ospf6_bfd_show_info(vty, on->bfd_info, 0);
} }
@ -852,13 +838,13 @@ DEFUN (show_ipv6_ospf6_neighbor,
} }
if (showfunc == ospf6_neighbor_show) if (showfunc == ospf6_neighbor_show)
vty_out (vty, "%-15s %3s %11s %8s/%-12s %11s %s[%s]%s", vty_out (vty, "%-15s %3s %11s %8s/%-12s %11s %s[%s]\n",
"Neighbor ID", "Pri", "DeadTime", "State", "IfState", "Duration", "Neighbor ID", "Pri", "DeadTime", "State", "IfState", "Duration",
"I/F", "State", VNL); "I/F", "State");
else if (showfunc == ospf6_neighbor_show_drchoice) else if (showfunc == ospf6_neighbor_show_drchoice)
vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]%s", vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]\n",
"RouterID", "State", "Duration", "DR", "BDR", "I/F", "RouterID", "State", "Duration", "DR", "BDR", "I/F",
"State", VNL); "State");
for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, i, oa))
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
@ -892,8 +878,7 @@ DEFUN (show_ipv6_ospf6_neighbor_one,
if ((inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id)) != 1) if ((inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id)) != 1)
{ {
vty_out (vty, "Router-ID is not parsable: %s%s", argv[idx_ipv4]->arg, vty_out (vty, "Router-ID is not parsable: %s\n", argv[idx_ipv4]->arg);
VNL);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1016,11 +1001,11 @@ config_write_ospf6_debug_neighbor (struct vty *vty)
{ {
if (IS_OSPF6_DEBUG_NEIGHBOR (STATE) && if (IS_OSPF6_DEBUG_NEIGHBOR (STATE) &&
IS_OSPF6_DEBUG_NEIGHBOR (EVENT)) IS_OSPF6_DEBUG_NEIGHBOR (EVENT))
vty_out (vty, "debug ospf6 neighbor%s", VNL); vty_out (vty, "debug ospf6 neighbor\n");
else if (IS_OSPF6_DEBUG_NEIGHBOR (STATE)) else if (IS_OSPF6_DEBUG_NEIGHBOR (STATE))
vty_out (vty, "debug ospf6 neighbor state%s", VNL); vty_out (vty, "debug ospf6 neighbor state\n");
else if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT)) else if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT))
vty_out (vty, "debug ospf6 neighbor event%s", VNL); vty_out (vty, "debug ospf6 neighbor event\n");
return 0; return 0;
} }

View File

@ -1043,16 +1043,16 @@ ospf6_route_show (struct vty *vty, struct ospf6_route *route)
if (!i) if (!i)
{ {
vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s", vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s\n",
(ospf6_route_is_best (route) ? '*' : ' '), (ospf6_route_is_best (route) ? '*' : ' '),
OSPF6_DEST_TYPE_SUBSTR (route->type), OSPF6_DEST_TYPE_SUBSTR (route->type),
OSPF6_PATH_TYPE_SUBSTR (route->path.type), OSPF6_PATH_TYPE_SUBSTR (route->path.type),
destination, nexthop, IFNAMSIZ, ifname, duration, VNL); destination, nexthop, IFNAMSIZ, ifname, duration);
i++; i++;
} }
else else
vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s", vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s\n",
' ', "", "", "", nexthop, IFNAMSIZ, ifname, "", VNL); ' ', "", "", "", nexthop, IFNAMSIZ, ifname, "");
} }
} }
@ -1078,77 +1078,74 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route)
destination, sizeof (destination)); destination, sizeof (destination));
else else
prefix2str (&route->prefix, destination, sizeof (destination)); prefix2str (&route->prefix, destination, sizeof (destination));
vty_out (vty, "Destination: %s%s", destination, VNL); vty_out (vty, "Destination: %s\n", destination);
/* destination type */ /* destination type */
vty_out (vty, "Destination type: %s%s", vty_out (vty, "Destination type: %s\n",
OSPF6_DEST_TYPE_NAME (route->type), OSPF6_DEST_TYPE_NAME (route->type));
VNL);
/* Time */ /* Time */
timersub (&now, &route->installed, &res); timersub (&now, &route->installed, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, "Installed Time: %s ago%s", duration, VNL); vty_out (vty, "Installed Time: %s ago\n", duration);
timersub (&now, &route->changed, &res); timersub (&now, &route->changed, &res);
timerstring (&res, duration, sizeof (duration)); timerstring (&res, duration, sizeof (duration));
vty_out (vty, " Changed Time: %s ago%s", duration, VNL); vty_out (vty, " Changed Time: %s ago\n", duration);
/* Debugging info */ /* Debugging info */
vty_out (vty, "Lock: %d Flags: %s%s%s%s%s", route->lock, vty_out (vty, "Lock: %d Flags: %s%s%s%s\n", route->lock,
(CHECK_FLAG (route->flag, OSPF6_ROUTE_BEST) ? "B" : "-"), (CHECK_FLAG (route->flag, OSPF6_ROUTE_BEST) ? "B" : "-"),
(CHECK_FLAG (route->flag, OSPF6_ROUTE_ADD) ? "A" : "-"), (CHECK_FLAG (route->flag, OSPF6_ROUTE_ADD) ? "A" : "-"),
(CHECK_FLAG (route->flag, OSPF6_ROUTE_REMOVE) ? "R" : "-"), (CHECK_FLAG (route->flag, OSPF6_ROUTE_REMOVE) ? "R" : "-"),
(CHECK_FLAG (route->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-"), (CHECK_FLAG (route->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-"));
VNL); vty_out (vty, "Memory: prev: %p this: %p next: %p\n",
vty_out (vty, "Memory: prev: %p this: %p next: %p%s", (void *)route->prev, (void *)route, (void *)route->next);
(void *)route->prev, (void *)route, (void *)route->next, VNL);
/* Path section */ /* Path section */
/* Area-ID */ /* Area-ID */
inet_ntop (AF_INET, &route->path.area_id, area_id, sizeof (area_id)); inet_ntop (AF_INET, &route->path.area_id, area_id, sizeof (area_id));
vty_out (vty, "Associated Area: %s%s", area_id, VNL); vty_out (vty, "Associated Area: %s\n", area_id);
/* Path type */ /* Path type */
vty_out (vty, "Path Type: %s%s", vty_out (vty, "Path Type: %s\n",
OSPF6_PATH_TYPE_NAME (route->path.type), VNL); OSPF6_PATH_TYPE_NAME (route->path.type));
/* LS Origin */ /* LS Origin */
inet_ntop (AF_INET, &route->path.origin.id, id, sizeof (id)); inet_ntop (AF_INET, &route->path.origin.id, id, sizeof (id));
inet_ntop (AF_INET, &route->path.origin.adv_router, adv_router, inet_ntop (AF_INET, &route->path.origin.adv_router, adv_router,
sizeof (adv_router)); sizeof (adv_router));
vty_out (vty, "LS Origin: %s Id: %s Adv: %s%s", vty_out (vty, "LS Origin: %s Id: %s Adv: %s\n",
ospf6_lstype_name (route->path.origin.type), ospf6_lstype_name (route->path.origin.type),
id, adv_router, VNL); id, adv_router);
/* Options */ /* Options */
ospf6_options_printbuf (route->path.options, options, sizeof (options)); ospf6_options_printbuf (route->path.options, options, sizeof (options));
vty_out (vty, "Options: %s%s", options, VNL); vty_out (vty, "Options: %s\n", options);
/* Router Bits */ /* Router Bits */
ospf6_capability_printbuf (route->path.router_bits, capa, sizeof (capa)); ospf6_capability_printbuf (route->path.router_bits, capa, sizeof (capa));
vty_out (vty, "Router Bits: %s%s", capa, VNL); vty_out (vty, "Router Bits: %s\n", capa);
/* Prefix Options */ /* Prefix Options */
vty_out (vty, "Prefix Options: xxx%s", VNL); vty_out (vty, "Prefix Options: xxx\n");
/* Metrics */ /* Metrics */
vty_out (vty, "Metric Type: %d%s", route->path.metric_type, vty_out (vty, "Metric Type: %d\n", route->path.metric_type);
VNL); vty_out (vty, "Metric: %d (%d)\n",
vty_out (vty, "Metric: %d (%d)%s", route->path.cost, route->path.u.cost_e2);
route->path.cost, route->path.u.cost_e2, VNL);
/* Nexthops */ /* Nexthops */
vty_out (vty, "Nexthop:%s", VNL); vty_out (vty, "Nexthop:\n");
for (ALL_LIST_ELEMENTS_RO (route->nh_list, node, nh)) for (ALL_LIST_ELEMENTS_RO (route->nh_list, node, nh))
{ {
/* nexthop */ /* nexthop */
inet_ntop (AF_INET6, &nh->address, nexthop, sizeof (nexthop)); inet_ntop (AF_INET6, &nh->address, nexthop, sizeof (nexthop));
ifname = ifindex2ifname (nh->ifindex, VRF_DEFAULT); ifname = ifindex2ifname (nh->ifindex, VRF_DEFAULT);
vty_out (vty, " %s %.*s%s", nexthop, IFNAMSIZ, ifname, VNL); vty_out (vty, " %s %.*s\n", nexthop, IFNAMSIZ, ifname);
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
} }
static void static void
@ -1184,14 +1181,14 @@ ospf6_route_show_table_summary (struct vty *vty,
assert (number == table->count); assert (number == table->count);
vty_out (vty, "Number of OSPFv3 routes: %d%s", number, VNL); vty_out (vty, "Number of OSPFv3 routes: %d\n", number);
vty_out (vty, "Number of Destination: %d%s", destination, VNL); vty_out (vty, "Number of Destination: %d\n", destination);
vty_out (vty, "Number of Alternative routes: %d%s", alternative, VNL); vty_out (vty, "Number of Alternative routes: %d\n", alternative);
vty_out (vty, "Number of Equal Cost Multi Path: %d%s", ecmp, VNL); vty_out (vty, "Number of Equal Cost Multi Path: %d\n", ecmp);
for (i = OSPF6_PATH_TYPE_INTRA; i <= OSPF6_PATH_TYPE_EXTERNAL2; i++) for (i = OSPF6_PATH_TYPE_INTRA; i <= OSPF6_PATH_TYPE_EXTERNAL2; i++)
{ {
vty_out (vty, "Number of %s routes: %d%s", vty_out (vty, "Number of %s routes: %d\n",
OSPF6_PATH_TYPE_NAME (i), pathtype[i], VNL); OSPF6_PATH_TYPE_NAME (i), pathtype[i]);
} }
} }
@ -1364,7 +1361,7 @@ ospf6_route_table_show (struct vty *vty, int argc_start, int argc, struct cmd_to
continue; continue;
} }
vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); vty_out (vty, "Malformed argument: %s\n", argv[i]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1400,8 +1397,8 @@ ospf6_route_table_show (struct vty *vty, int argc_start, int argc, struct cmd_to
static void static void
ospf6_linkstate_show_header (struct vty *vty) ospf6_linkstate_show_header (struct vty *vty)
{ {
vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %s%s", vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %s\n",
"Type", "Router-ID", "Net-ID", "Rtr-Bits", "Options", "Cost", VNL); "Type", "Router-ID", "Net-ID", "Rtr-Bits", "Options", "Cost");
} }
static void static void
@ -1419,13 +1416,13 @@ ospf6_linkstate_show (struct vty *vty, struct ospf6_route *route)
ospf6_options_printbuf (route->path.options, options, sizeof (options)); ospf6_options_printbuf (route->path.options, options, sizeof (options));
if (ntohl (id)) if (ntohl (id))
vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu%s", vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu\n",
"Network", routername, idname, rbits, options, "Network", routername, idname, rbits, options,
(unsigned long) route->path.cost, VNL); (unsigned long) route->path.cost);
else else
vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu%s", vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu\n",
"Router", routername, idname, rbits, options, "Router", routername, idname, rbits, options,
(unsigned long) route->path.cost, VNL); (unsigned long) route->path.cost);
} }
@ -1502,7 +1499,7 @@ ospf6_linkstate_table_show (struct vty *vty, int idx_ipv4, int argc,
is_router++; is_router++;
continue; continue;
} }
vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); vty_out (vty, "Malformed argument: %s\n", argv[i]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1514,11 +1511,11 @@ ospf6_linkstate_table_show (struct vty *vty, int idx_ipv4, int argc,
is_id++; is_id++;
continue; continue;
} }
vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); vty_out (vty, "Malformed argument: %s\n", argv[i]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); vty_out (vty, "Malformed argument: %s\n", argv[i]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1538,8 +1535,8 @@ ospf6_linkstate_table_show (struct vty *vty, int idx_ipv4, int argc,
void void
ospf6_brouter_show_header (struct vty *vty) ospf6_brouter_show_header (struct vty *vty)
{ {
vty_out (vty, "%-15s %-8s %-14s %-10s %-15s%s", vty_out (vty, "%-15s %-8s %-14s %-10s %-15s\n",
"Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area", VNL); "Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area");
} }
void void
@ -1554,11 +1551,11 @@ ospf6_brouter_show (struct vty *vty, struct ospf6_route *route)
ospf6_options_printbuf (route->path.options, options, sizeof (options)); ospf6_options_printbuf (route->path.options, options, sizeof (options));
inet_ntop (AF_INET, &route->path.area_id, area, sizeof (area)); inet_ntop (AF_INET, &route->path.area_id, area, sizeof (area));
/* vty_out (vty, "%-15s %-8s %-14s %-10s %-15s%s", /* vty_out (vty, "%-15s %-8s %-14s %-10s %-15s\n",
"Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area", VNL); */ "Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area"); */
vty_out (vty, "%-15s %-8s %-14s %-10s %-15s%s", vty_out (vty, "%-15s %-8s %-14s %-10s %-15s\n",
adv, rbits, options, OSPF6_PATH_TYPE_NAME (route->path.type), adv, rbits, options, OSPF6_PATH_TYPE_NAME (route->path.type),
area, VNL); area);
} }
DEFUN (debug_ospf6_route, DEFUN (debug_ospf6_route,
@ -1619,11 +1616,11 @@ int
config_write_ospf6_debug_route (struct vty *vty) config_write_ospf6_debug_route (struct vty *vty)
{ {
if (IS_OSPF6_DEBUG_ROUTE (TABLE)) if (IS_OSPF6_DEBUG_ROUTE (TABLE))
vty_out (vty, "debug ospf6 route table%s", VNL); vty_out (vty, "debug ospf6 route table\n");
if (IS_OSPF6_DEBUG_ROUTE (INTRA)) if (IS_OSPF6_DEBUG_ROUTE (INTRA))
vty_out (vty, "debug ospf6 route intra-area%s", VNL); vty_out (vty, "debug ospf6 route intra-area\n");
if (IS_OSPF6_DEBUG_ROUTE (INTER)) if (IS_OSPF6_DEBUG_ROUTE (INTER))
vty_out (vty, "debug ospf6 route inter-area%s", VNL); vty_out (vty, "debug ospf6 route inter-area\n");
return 0; return 0;
} }

View File

@ -742,13 +742,13 @@ ospf6_spf_display_subtree (struct vty *vty, const char *prefix, int rest,
int restnum; int restnum;
/* "prefix" is the space prefix of the display line */ /* "prefix" is the space prefix of the display line */
vty_out (vty, "%s+-%s [%d]%s", prefix, v->name, v->cost, VNL); vty_out (vty, "%s+-%s [%d]\n", prefix, v->name, v->cost);
len = strlen (prefix) + 4; len = strlen (prefix) + 4;
next_prefix = (char *) malloc (len); next_prefix = (char *) malloc (len);
if (next_prefix == NULL) if (next_prefix == NULL)
{ {
vty_out (vty, "malloc failed%s", VNL); vty_out (vty, "malloc failed\n");
return; return;
} }
snprintf (next_prefix, len, "%s%s", prefix, (rest ? "| " : " ")); snprintf (next_prefix, len, "%s%s", prefix, (rest ? "| " : " "));
@ -914,11 +914,11 @@ int
config_write_ospf6_debug_spf (struct vty *vty) config_write_ospf6_debug_spf (struct vty *vty)
{ {
if (IS_OSPF6_DEBUG_SPF (PROCESS)) if (IS_OSPF6_DEBUG_SPF (PROCESS))
vty_out (vty, "debug ospf6 spf process%s", VNL); vty_out (vty, "debug ospf6 spf process\n");
if (IS_OSPF6_DEBUG_SPF (TIME)) if (IS_OSPF6_DEBUG_SPF (TIME))
vty_out (vty, "debug ospf6 spf time%s", VNL); vty_out (vty, "debug ospf6 spf time\n");
if (IS_OSPF6_DEBUG_SPF (DATABASE)) if (IS_OSPF6_DEBUG_SPF (DATABASE))
vty_out (vty, "debug ospf6 spf database%s", VNL); vty_out (vty, "debug ospf6 spf database\n");
return 0; return 0;
} }
@ -929,7 +929,7 @@ ospf6_spf_config_write (struct vty *vty)
if (ospf6->spf_delay != OSPF_SPF_DELAY_DEFAULT || if (ospf6->spf_delay != OSPF_SPF_DELAY_DEFAULT ||
ospf6->spf_holdtime != OSPF_SPF_HOLDTIME_DEFAULT || ospf6->spf_holdtime != OSPF_SPF_HOLDTIME_DEFAULT ||
ospf6->spf_max_holdtime != OSPF_SPF_MAX_HOLDTIME_DEFAULT) ospf6->spf_max_holdtime != OSPF_SPF_MAX_HOLDTIME_DEFAULT)
vty_outln (vty, " timers throttle spf %d %d %d", vty_out (vty, " timers throttle spf %d %d %d\n",
ospf6->spf_delay, ospf6->spf_holdtime, ospf6->spf_delay, ospf6->spf_holdtime,
ospf6->spf_max_holdtime); ospf6->spf_max_holdtime);

View File

@ -315,7 +315,7 @@ DEFUN (no_router_ospf6,
OSPF6_STR) OSPF6_STR)
{ {
if (ospf6 == NULL) if (ospf6 == NULL)
vty_out (vty, "OSPFv3 is not configured%s", VNL); vty_out (vty, "OSPFv3 is not configured\n");
else else
{ {
ospf6_delete (ospf6); ospf6_delete (ospf6);
@ -343,7 +343,7 @@ DEFUN (ospf6_router_id,
ret = inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id); ret = inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id);
if (ret == 0) if (ret == 0)
{ {
vty_out (vty, "malformed OSPF Router-ID: %s%s", argv[idx_ipv4]->arg, VNL); vty_out (vty, "malformed OSPF Router-ID: %s\n", argv[idx_ipv4]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -588,15 +588,15 @@ DEFUN (ospf6_interface_area,
oi = ospf6_interface_create (ifp); oi = ospf6_interface_create (ifp);
if (oi->area) if (oi->area)
{ {
vty_out (vty, "%s already attached to Area %s%s", vty_out (vty, "%s already attached to Area %s\n",
oi->interface->name, oi->area->name, VNL); oi->interface->name, oi->area->name);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
/* parse Area-ID */ /* parse Area-ID */
if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1)
{ {
vty_out (vty, "Invalid Area-ID: %s%s", argv[idx_ipv4]->arg, VNL); vty_out (vty, "Invalid Area-ID: %s\n", argv[idx_ipv4]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -645,35 +645,35 @@ DEFUN (no_ospf6_interface_area,
ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT); ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT);
if (ifp == NULL) if (ifp == NULL)
{ {
vty_out (vty, "No such interface %s%s", argv[idx_ifname]->arg, VNL); vty_out (vty, "No such interface %s\n", argv[idx_ifname]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
if (oi == NULL) if (oi == NULL)
{ {
vty_out (vty, "Interface %s not enabled%s", ifp->name, VNL); vty_out (vty, "Interface %s not enabled\n", ifp->name);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
/* parse Area-ID */ /* parse Area-ID */
if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1)
{ {
vty_out (vty, "Invalid Area-ID: %s%s", argv[idx_ipv4]->arg, VNL); vty_out (vty, "Invalid Area-ID: %s\n", argv[idx_ipv4]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
/* Verify Area */ /* Verify Area */
if (oi->area == NULL) if (oi->area == NULL)
{ {
vty_out (vty, "No such Area-ID: %s%s", argv[idx_ipv4]->arg, VNL); vty_out (vty, "No such Area-ID: %s\n", argv[idx_ipv4]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
if (oi->area->area_id != area_id) if (oi->area->area_id != area_id)
{ {
vty_out (vty, "Wrong Area-ID: %s is attached to area %s%s", vty_out (vty, "Wrong Area-ID: %s is attached to area %s\n",
oi->interface->name, oi->area->name, VNL); oi->interface->name, oi->area->name);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -799,29 +799,29 @@ ospf6_show (struct vty *vty, struct ospf6 *o)
/* process id, router id */ /* process id, router id */
inet_ntop (AF_INET, &o->router_id, router_id, sizeof (router_id)); inet_ntop (AF_INET, &o->router_id, router_id, sizeof (router_id));
vty_out (vty, " OSPFv3 Routing Process (0) with Router-ID %s%s", vty_out (vty, " OSPFv3 Routing Process (0) with Router-ID %s\n",
router_id, VNL); router_id);
/* running time */ /* running time */
monotime(&now); monotime(&now);
timersub (&now, &o->starttime, &running); timersub (&now, &o->starttime, &running);
timerstring (&running, duration, sizeof (duration)); timerstring (&running, duration, sizeof (duration));
vty_out (vty, " Running %s%s", duration, VNL); vty_out (vty, " Running %s\n", duration);
/* Redistribute configuration */ /* Redistribute configuration */
/* XXX */ /* XXX */
vty_outln (vty, " LSA minimum arrival %d msecs",o->lsa_minarrival); vty_out (vty, " LSA minimum arrival %d msecs\n",o->lsa_minarrival);
/* Show SPF parameters */ /* Show SPF parameters */
vty_out(vty, " Initial SPF scheduling delay %d millisec(s)%s" vty_out(vty, " Initial SPF scheduling delay %d millisec(s)\n"
" Minimum hold time between consecutive SPFs %d millsecond(s)%s" " Minimum hold time between consecutive SPFs %d millsecond(s)\n"
" Maximum hold time between consecutive SPFs %d millsecond(s)%s" " Maximum hold time between consecutive SPFs %d millsecond(s)\n"
" Hold time multiplier is currently %d%s", " Hold time multiplier is currently %d\n",
o->spf_delay, VNL, o->spf_delay,
o->spf_holdtime, VNL, o->spf_holdtime,
o->spf_max_holdtime, VNL, o->spf_max_holdtime,
o->spf_hold_multiplier, VNL); o->spf_hold_multiplier);
vty_out(vty, " SPF algorithm "); vty_out(vty, " SPF algorithm ");
if (o->ts_spf.tv_sec || o->ts_spf.tv_usec) if (o->ts_spf.tv_sec || o->ts_spf.tv_usec)
@ -829,37 +829,37 @@ ospf6_show (struct vty *vty, struct ospf6 *o)
timersub(&now, &o->ts_spf, &result); timersub(&now, &o->ts_spf, &result);
timerstring(&result, buf, sizeof(buf)); timerstring(&result, buf, sizeof(buf));
ospf6_spf_reason_string(o->last_spf_reason, rbuf, sizeof(rbuf)); ospf6_spf_reason_string(o->last_spf_reason, rbuf, sizeof(rbuf));
vty_out(vty, "last executed %s ago, reason %s%s", buf, rbuf, VNL); vty_out(vty, "last executed %s ago, reason %s\n", buf, rbuf);
vty_out (vty, " Last SPF duration %lld sec %lld usec%s", vty_out (vty, " Last SPF duration %lld sec %lld usec\n",
(long long)o->ts_spf_duration.tv_sec, (long long)o->ts_spf_duration.tv_sec,
(long long)o->ts_spf_duration.tv_usec, VNL); (long long)o->ts_spf_duration.tv_usec);
} }
else else
vty_out(vty, "has not been run$%s", VNL); vty_out(vty, "has not been run$\n");
threadtimer_string(now, o->t_spf_calc, buf, sizeof(buf)); threadtimer_string(now, o->t_spf_calc, buf, sizeof(buf));
vty_out (vty, " SPF timer %s%s%s", vty_out (vty, " SPF timer %s%s\n",
(o->t_spf_calc ? "due in " : "is "), buf, VNL); (o->t_spf_calc ? "due in " : "is "), buf);
if (CHECK_FLAG (o->flag, OSPF6_STUB_ROUTER)) if (CHECK_FLAG (o->flag, OSPF6_STUB_ROUTER))
vty_out (vty, " Router Is Stub Router%s", VNL); vty_out (vty, " Router Is Stub Router\n");
/* LSAs */ /* LSAs */
vty_out (vty, " Number of AS scoped LSAs is %u%s", vty_out (vty, " Number of AS scoped LSAs is %u\n",
o->lsdb->count, VNL); o->lsdb->count);
/* Areas */ /* Areas */
vty_out (vty, " Number of areas in this router is %u%s", vty_out (vty, " Number of areas in this router is %u\n",
listcount (o->area_list), VNL); listcount (o->area_list));
if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_CHANGES))
{ {
if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_DETAIL)) if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_DETAIL))
vty_outln (vty, " All adjacency changes are logged"); vty_out (vty, " All adjacency changes are logged\n");
else else
vty_outln (vty, " Adjacency changes are logged"); vty_out (vty, " Adjacency changes are logged\n");
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
for (ALL_LIST_ELEMENTS_RO (o->area_list, n, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, n, oa))
ospf6_area_show (vty, oa); ospf6_area_show (vty, oa);
@ -963,7 +963,7 @@ ospf6_stub_router_config_write (struct vty *vty)
{ {
if (CHECK_FLAG (ospf6->flag, OSPF6_STUB_ROUTER)) if (CHECK_FLAG (ospf6->flag, OSPF6_STUB_ROUTER))
{ {
vty_out (vty, " stub-router administrative%s", VNL); vty_out (vty, " stub-router administrative\n");
} }
return; return;
} }
@ -975,7 +975,7 @@ ospf6_distance_config_write (struct vty *vty)
struct ospf6_distance *odistance; struct ospf6_distance *odistance;
if (ospf6->distance_all) if (ospf6->distance_all)
vty_outln (vty, " distance %u", ospf6->distance_all); vty_out (vty, " distance %u\n", ospf6->distance_all);
if (ospf6->distance_intra if (ospf6->distance_intra
|| ospf6->distance_inter || ospf6->distance_inter
@ -990,7 +990,7 @@ ospf6_distance_config_write (struct vty *vty)
if (ospf6->distance_external) if (ospf6->distance_external)
vty_out (vty, " external %u", ospf6->distance_external); vty_out (vty, " external %u", ospf6->distance_external);
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
for (rn = route_top (ospf6->distance_table); rn; rn = route_next (rn)) for (rn = route_top (ospf6->distance_table); rn; rn = route_next (rn))
@ -998,7 +998,7 @@ ospf6_distance_config_write (struct vty *vty)
{ {
char buf[PREFIX_STRLEN]; char buf[PREFIX_STRLEN];
vty_outln (vty, " distance %u %s %s", odistance->distance, vty_out (vty, " distance %u %s %s\n", odistance->distance,
prefix2str (&rn->p, buf, sizeof (buf)), prefix2str (&rn->p, buf, sizeof (buf)),
odistance->access_list ? odistance->access_list : ""); odistance->access_list ? odistance->access_list : "");
} }
@ -1019,30 +1019,29 @@ config_write_ospf6 (struct vty *vty)
return CMD_SUCCESS; return CMD_SUCCESS;
inet_ntop (AF_INET, &ospf6->router_id_static, router_id, sizeof (router_id)); inet_ntop (AF_INET, &ospf6->router_id_static, router_id, sizeof (router_id));
vty_out (vty, "router ospf6%s", VNL); vty_out (vty, "router ospf6\n");
if (ospf6->router_id_static != 0) if (ospf6->router_id_static != 0)
vty_out (vty, " router-id %s%s", router_id, VNL); vty_out (vty, " router-id %s\n", router_id);
/* log-adjacency-changes flag print. */ /* log-adjacency-changes flag print. */
if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES))
{ {
if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL)) if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL))
vty_outln (vty, " log-adjacency-changes detail"); vty_out (vty, " log-adjacency-changes detail\n");
else if (!DFLT_OSPF6_LOG_ADJACENCY_CHANGES) else if (!DFLT_OSPF6_LOG_ADJACENCY_CHANGES)
vty_outln (vty, " log-adjacency-changes"); vty_out (vty, " log-adjacency-changes\n");
} }
else if (DFLT_OSPF6_LOG_ADJACENCY_CHANGES) else if (DFLT_OSPF6_LOG_ADJACENCY_CHANGES)
{ {
vty_outln (vty, " no log-adjacency-changes"); vty_out (vty, " no log-adjacency-changes\n");
} }
if (ospf6->ref_bandwidth != OSPF6_REFERENCE_BANDWIDTH) if (ospf6->ref_bandwidth != OSPF6_REFERENCE_BANDWIDTH)
vty_out (vty, " auto-cost reference-bandwidth %d%s", ospf6->ref_bandwidth, vty_out (vty, " auto-cost reference-bandwidth %d\n", ospf6->ref_bandwidth);
VNL);
/* LSA timers print. */ /* LSA timers print. */
if (ospf6->lsa_minarrival != OSPF_MIN_LS_ARRIVAL) if (ospf6->lsa_minarrival != OSPF_MIN_LS_ARRIVAL)
vty_outln (vty, " timers lsa min-arrival %d",ospf6->lsa_minarrival); vty_out (vty, " timers lsa min-arrival %d\n",ospf6->lsa_minarrival);
ospf6_stub_router_config_write (vty); ospf6_stub_router_config_write (vty);
ospf6_redistribute_config_write (vty); ospf6_redistribute_config_write (vty);
@ -1053,10 +1052,10 @@ config_write_ospf6 (struct vty *vty)
for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, j, oa)) for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, j, oa))
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, k, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, k, oi))
vty_out (vty, " interface %s area %s%s", vty_out (vty, " interface %s area %s\n",
oi->interface->name, oa->name, VNL); oi->interface->name, oa->name);
} }
vty_out (vty, "!%s", VNL); vty_out (vty, "!\n");
return 0; return 0;
} }

View File

@ -315,23 +315,22 @@ DEFUN (show_zebra,
int i; int i;
if (zclient == NULL) if (zclient == NULL)
{ {
vty_out (vty, "Not connected to zebra%s", VNL); vty_out (vty, "Not connected to zebra\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
vty_out (vty, "Zebra Infomation%s", VNL); vty_out (vty, "Zebra Infomation\n");
vty_out (vty, " enable: %d fail: %d%s", vty_out (vty, " enable: %d fail: %d\n",
zclient->enable, zclient->fail, VNL); zclient->enable, zclient->fail);
vty_out (vty, " redistribute default: %d%s", vty_out (vty, " redistribute default: %d\n",
vrf_bitmap_check (zclient->default_information, VRF_DEFAULT), vrf_bitmap_check (zclient->default_information, VRF_DEFAULT));
VNL);
vty_out (vty, " redistribute:"); vty_out (vty, " redistribute:");
for (i = 0; i < ZEBRA_ROUTE_MAX; i++) for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
{ {
if (vrf_bitmap_check (zclient->redist[AFI_IP6][i], VRF_DEFAULT)) if (vrf_bitmap_check (zclient->redist[AFI_IP6][i], VRF_DEFAULT))
vty_out (vty, " %s", zebra_route_string(i)); vty_out (vty, " %s", zebra_route_string(i));
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -341,15 +340,15 @@ config_write_ospf6_zebra (struct vty *vty)
{ {
if (! zclient->enable) if (! zclient->enable)
{ {
vty_out (vty, "no router zebra%s", VNL); vty_out (vty, "no router zebra\n");
vty_out (vty, "!%s", VNL); vty_out (vty, "!\n");
} }
else if (! vrf_bitmap_check (zclient->redist[AFI_IP6][ZEBRA_ROUTE_OSPF6], else if (! vrf_bitmap_check (zclient->redist[AFI_IP6][ZEBRA_ROUTE_OSPF6],
VRF_DEFAULT)) VRF_DEFAULT))
{ {
vty_out (vty, "router zebra%s", VNL); vty_out (vty, "router zebra\n");
vty_out (vty, " no redistribute ospf6%s", VNL); vty_out (vty, " no redistribute ospf6\n");
vty_out (vty, "!%s", VNL); vty_out (vty, "!\n");
} }
return 0; return 0;
} }
@ -683,7 +682,7 @@ ospf6_distance_set (struct vty *vty, struct ospf6 *o,
ret = str2prefix_ipv6 (ip_str, &p); ret = str2prefix_ipv6 (ip_str, &p);
if (ret == 0) if (ret == 0)
{ {
vty_outln (vty, "Malformed prefix"); vty_out (vty, "Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -731,14 +730,14 @@ ospf6_distance_unset (struct vty *vty, struct ospf6 *o,
ret = str2prefix_ipv6 (ip_str, &p); ret = str2prefix_ipv6 (ip_str, &p);
if (ret == 0) if (ret == 0)
{ {
vty_outln (vty, "Malformed prefix"); vty_out (vty, "Malformed prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
rn = route_node_lookup (o->distance_table, (struct prefix *) &p); rn = route_node_lookup (o->distance_table, (struct prefix *) &p);
if (!rn) if (!rn)
{ {
vty_outln (vty, "Can't find specified prefix"); vty_out (vty, "Cant't find specified prefix\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -905,13 +904,13 @@ int
config_write_ospf6_debug_zebra (struct vty *vty) config_write_ospf6_debug_zebra (struct vty *vty)
{ {
if (IS_OSPF6_DEBUG_ZEBRA (SEND) && IS_OSPF6_DEBUG_ZEBRA (RECV)) if (IS_OSPF6_DEBUG_ZEBRA (SEND) && IS_OSPF6_DEBUG_ZEBRA (RECV))
vty_out (vty, "debug ospf6 zebra%s", VNL); vty_out (vty, "debug ospf6 zebra\n");
else else
{ {
if (IS_OSPF6_DEBUG_ZEBRA (SEND)) if (IS_OSPF6_DEBUG_ZEBRA (SEND))
vty_out (vty, "debug ospf6 zebra send%s", VNL); vty_out (vty, "debug ospf6 zebra send\n");
if (IS_OSPF6_DEBUG_ZEBRA (RECV)) if (IS_OSPF6_DEBUG_ZEBRA (RECV))
vty_out (vty, "debug ospf6 zebra recv%s", VNL); vty_out (vty, "debug ospf6 zebra recv\n");
} }
return 0; return 0;
} }

View File

@ -83,8 +83,8 @@ DEFUN (show_version_ospf6,
"Display ospf6d version\n" "Display ospf6d version\n"
) )
{ {
vty_out (vty, "Zebra OSPF6d Version: %s%s", vty_out (vty, "Zebra OSPF6d Version: %s\n",
ospf6_daemon_version, VNL); ospf6_daemon_version);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -110,16 +110,16 @@ config_write_ospf6_debug (struct vty *vty)
config_write_ospf6_debug_asbr (vty); config_write_ospf6_debug_asbr (vty);
config_write_ospf6_debug_abr (vty); config_write_ospf6_debug_abr (vty);
config_write_ospf6_debug_flood (vty); config_write_ospf6_debug_flood (vty);
vty_out (vty, "!%s", VNL); vty_out (vty, "!\n");
return 0; return 0;
} }
#define AREA_LSDB_TITLE_FORMAT \ #define AREA_LSDB_TITLE_FORMAT \
"%s Area Scoped Link State Database (Area %s)%s%s" "\n Area Scoped Link State Database (Area %s)\n\n"
#define IF_LSDB_TITLE_FORMAT \ #define IF_LSDB_TITLE_FORMAT \
"%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s" "\n I/F Scoped Link State Database (I/F %s in Area %s)\n\n"
#define AS_LSDB_TITLE_FORMAT \ #define AS_LSDB_TITLE_FORMAT \
"%s AS Scoped Link State Database%s%s" "\n AS Scoped Link State Database\n\n"
static int static int
parse_show_level (int idx_level, int argc, struct cmd_token **argv) parse_show_level (int idx_level, int argc, struct cmd_token **argv)
@ -189,7 +189,7 @@ DEFUN (show_ipv6_ospf6_database,
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
} }
@ -197,16 +197,16 @@ DEFUN (show_ipv6_ospf6_database,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
} }
} }
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -250,7 +250,7 @@ DEFUN (show_ipv6_ospf6_database_type,
case OSPF6_SCOPE_AREA: case OSPF6_SCOPE_AREA:
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
} }
break; break;
@ -260,15 +260,15 @@ DEFUN (show_ipv6_ospf6_database_type,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
} }
} }
break; break;
case OSPF6_SCOPE_AS: case OSPF6_SCOPE_AS:
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb);
break; break;
@ -277,7 +277,7 @@ DEFUN (show_ipv6_ospf6_database_type,
break; break;
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -313,7 +313,7 @@ DEFUN (show_ipv6_ospf6_database_id,
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
} }
@ -321,16 +321,16 @@ DEFUN (show_ipv6_ospf6_database_id,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
} }
} }
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -364,7 +364,7 @@ DEFUN (show_ipv6_ospf6_database_router,
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
} }
@ -372,16 +372,16 @@ DEFUN (show_ipv6_ospf6_database_router,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
} }
} }
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -430,7 +430,7 @@ DEFUN (show_ipv6_ospf6_database_type_id,
case OSPF6_SCOPE_AREA: case OSPF6_SCOPE_AREA:
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb); ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
} }
break; break;
@ -440,15 +440,15 @@ DEFUN (show_ipv6_ospf6_database_type_id,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb); ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
} }
} }
break; break;
case OSPF6_SCOPE_AS: case OSPF6_SCOPE_AS:
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb); ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb);
break; break;
@ -457,7 +457,7 @@ DEFUN (show_ipv6_ospf6_database_type_id,
break; break;
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -507,7 +507,7 @@ DEFUN (show_ipv6_ospf6_database_type_router,
case OSPF6_SCOPE_AREA: case OSPF6_SCOPE_AREA:
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
} }
break; break;
@ -517,15 +517,15 @@ DEFUN (show_ipv6_ospf6_database_type_router,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
} }
} }
break; break;
case OSPF6_SCOPE_AS: case OSPF6_SCOPE_AS:
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
break; break;
@ -534,7 +534,7 @@ DEFUN (show_ipv6_ospf6_database_type_router,
break; break;
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -572,7 +572,7 @@ DEFUN (show_ipv6_ospf6_database_id_router,
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
} }
@ -580,16 +580,16 @@ DEFUN (show_ipv6_ospf6_database_id_router,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
} }
} }
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -627,7 +627,7 @@ DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
} }
@ -635,16 +635,16 @@ DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
} }
} }
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -694,7 +694,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_router,
case OSPF6_SCOPE_AREA: case OSPF6_SCOPE_AREA:
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
} }
break; break;
@ -704,15 +704,15 @@ DEFUN (show_ipv6_ospf6_database_type_id_router,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
} }
} }
break; break;
case OSPF6_SCOPE_AS: case OSPF6_SCOPE_AS:
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
break; break;
@ -721,7 +721,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_router,
break; break;
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -774,7 +774,7 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
case OSPF6_SCOPE_AREA: case OSPF6_SCOPE_AREA:
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
} }
break; break;
@ -784,15 +784,15 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
} }
} }
break; break;
case OSPF6_SCOPE_AS: case OSPF6_SCOPE_AS:
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
break; break;
@ -801,7 +801,7 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
break; break;
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -831,7 +831,7 @@ DEFUN (show_ipv6_ospf6_database_self_originated,
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
} }
@ -839,16 +839,16 @@ DEFUN (show_ipv6_ospf6_database_self_originated,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
} }
} }
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -896,7 +896,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated,
case OSPF6_SCOPE_AREA: case OSPF6_SCOPE_AREA:
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
} }
break; break;
@ -906,15 +906,15 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
} }
} }
break; break;
case OSPF6_SCOPE_AS: case OSPF6_SCOPE_AS:
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
break; break;
@ -923,7 +923,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated,
break; break;
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -974,7 +974,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
case OSPF6_SCOPE_AREA: case OSPF6_SCOPE_AREA:
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
} }
break; break;
@ -984,15 +984,15 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
} }
} }
break; break;
case OSPF6_SCOPE_AS: case OSPF6_SCOPE_AS:
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
break; break;
@ -1001,7 +1001,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
break; break;
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1051,7 +1051,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
case OSPF6_SCOPE_AREA: case OSPF6_SCOPE_AREA:
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{ {
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
} }
break; break;
@ -1061,15 +1061,15 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
{ {
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{ {
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, vty_out (vty, IF_LSDB_TITLE_FORMAT,
oi->interface->name, oa->name, VNL, VNL); oi->interface->name, oa->name);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
} }
} }
break; break;
case OSPF6_SCOPE_AS: case OSPF6_SCOPE_AS:
vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); vty_out (vty, AS_LSDB_TITLE_FORMAT);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
break; break;
@ -1078,7 +1078,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
break; break;
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1115,7 +1115,7 @@ DEFUN (show_ipv6_ospf6_border_routers,
ro = ospf6_route_lookup (&prefix, ospf6->brouter_table); ro = ospf6_route_lookup (&prefix, ospf6->brouter_table);
if (!ro) if (!ro)
{ {
vty_out (vty, "No Route found for Router ID: %s%s", argv[4]->arg, VNL); vty_out (vty, "No Route found for Router ID: %s\n", argv[4]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1157,12 +1157,11 @@ DEFUN (show_ipv6_ospf6_linkstate,
for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
{ {
vty_out (vty, "%s SPF Result in Area %s%s%s", vty_out (vty, "\n SPF Result in Area %s\n\n", oa->name);
VNL, oa->name, VNL, VNL);
ospf6_linkstate_table_show (vty, idx_ipv4, argc, argv, oa->spf_table); ospf6_linkstate_table_show (vty, idx_ipv4, argc, argv, oa->spf_table);
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1185,12 +1184,11 @@ DEFUN (show_ipv6_ospf6_linkstate_detail,
for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
{ {
vty_out (vty, "%s SPF Result in Area %s%s%s", vty_out (vty, "\n SPF Result in Area %s\n\n", oa->name);
VNL, oa->name, VNL, VNL);
ospf6_linkstate_table_show (vty, idx_detail, argc, argv, oa->spf_table); ospf6_linkstate_table_show (vty, idx_detail, argc, argv, oa->spf_table);
} }
vty_out (vty, "%s", VNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }

View File

@ -90,11 +90,10 @@ extern struct thread_master *master;
#define OSPF6_ROUTER_ID_STR "Specify Router-ID\n" #define OSPF6_ROUTER_ID_STR "Specify Router-ID\n"
#define OSPF6_LS_ID_STR "Specify Link State ID\n" #define OSPF6_LS_ID_STR "Specify Link State ID\n"
#define VNL VTYNL
#define OSPF6_CMD_CHECK_RUNNING() \ #define OSPF6_CMD_CHECK_RUNNING() \
if (ospf6 == NULL) \ if (ospf6 == NULL) \
{ \ { \
vty_out (vty, "OSPFv3 is not running%s", VTYNL); \ vty_out (vty, "OSPFv3 is not running\n"); \
return CMD_SUCCESS; \ return CMD_SUCCESS; \
} }

View File

@ -2192,7 +2192,7 @@ ospf_apiserver_show_info (struct vty *vty, struct ospf_lsa *lsa)
if (vty != NULL) if (vty != NULL)
{ {
int i; int i;
vty_outln (vty, " Added using OSPF API: %u octets of opaque data %s", vty_out (vty, " Added using OSPF API: %u octets of opaque data %s\n",
opaquelen, opaquelen,
VALID_OPAQUE_INFO_LEN(lsa->data) ? "" : "(Invalid length?)"); VALID_OPAQUE_INFO_LEN(lsa->data) ? "" : "(Invalid length?)");
vty_out (vty, " Opaque data: "); vty_out (vty, " Opaque data: ");
@ -2201,7 +2201,7 @@ ospf_apiserver_show_info (struct vty *vty, struct ospf_lsa *lsa)
{ {
vty_out (vty, "0x%x ", olsa->data[i]); vty_out (vty, "0x%x ", olsa->data[i]);
} }
vty_out (vty, VTYNL); vty_out (vty, "\n");
} }
else else
{ {

View File

@ -307,11 +307,11 @@ ospf_bfd_write_config(struct vty *vty, struct ospf_if_params *params)
bfd_info = (struct bfd_info *)params->bfd_info; bfd_info = (struct bfd_info *)params->bfd_info;
if (CHECK_FLAG(bfd_info->flags, BFD_FLAG_PARAM_CFG)) if (CHECK_FLAG(bfd_info->flags, BFD_FLAG_PARAM_CFG))
vty_outln (vty, " ip ospf bfd %d %d %d", vty_out (vty, " ip ospf bfd %d %d %d\n",
bfd_info->detect_mult, bfd_info->required_min_rx, bfd_info->detect_mult, bfd_info->required_min_rx,
bfd_info->desired_min_tx); bfd_info->desired_min_tx);
else else
vty_outln (vty, " ip ospf bfd"); vty_out (vty, " ip ospf bfd\n");
} }
/* /*

View File

@ -1568,92 +1568,91 @@ show_debugging_ospf_common (struct vty *vty, struct ospf *ospf)
int i; int i;
if (ospf->instance) if (ospf->instance)
vty_outln (vty, "%sOSPF Instance: %d%s", VTYNL, ospf->instance, vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance);
VTYNL);
vty_outln (vty, "OSPF debugging status:"); vty_out (vty, "OSPF debugging status:\n");
/* Show debug status for events. */ /* Show debug status for events. */
if (IS_DEBUG_OSPF(event,EVENT)) if (IS_DEBUG_OSPF(event,EVENT))
vty_outln (vty, " OSPF event debugging is on"); vty_out (vty, " OSPF event debugging is on\n");
/* Show debug status for ISM. */ /* Show debug status for ISM. */
if (IS_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM) if (IS_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
vty_outln (vty, " OSPF ISM debugging is on"); vty_out (vty, " OSPF ISM debugging is on\n");
else else
{ {
if (IS_DEBUG_OSPF (ism, ISM_STATUS)) if (IS_DEBUG_OSPF (ism, ISM_STATUS))
vty_outln (vty, " OSPF ISM status debugging is on"); vty_out (vty, " OSPF ISM status debugging is on\n");
if (IS_DEBUG_OSPF (ism, ISM_EVENTS)) if (IS_DEBUG_OSPF (ism, ISM_EVENTS))
vty_outln (vty, " OSPF ISM event debugging is on"); vty_out (vty, " OSPF ISM event debugging is on\n");
if (IS_DEBUG_OSPF (ism, ISM_TIMERS)) if (IS_DEBUG_OSPF (ism, ISM_TIMERS))
vty_outln (vty, " OSPF ISM timer debugging is on"); vty_out (vty, " OSPF ISM timer debugging is on\n");
} }
/* Show debug status for NSM. */ /* Show debug status for NSM. */
if (IS_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM) if (IS_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM)
vty_outln (vty, " OSPF NSM debugging is on"); vty_out (vty, " OSPF NSM debugging is on\n");
else else
{ {
if (IS_DEBUG_OSPF (nsm, NSM_STATUS)) if (IS_DEBUG_OSPF (nsm, NSM_STATUS))
vty_outln (vty, " OSPF NSM status debugging is on"); vty_out (vty, " OSPF NSM status debugging is on\n");
if (IS_DEBUG_OSPF (nsm, NSM_EVENTS)) if (IS_DEBUG_OSPF (nsm, NSM_EVENTS))
vty_outln (vty, " OSPF NSM event debugging is on"); vty_out (vty, " OSPF NSM event debugging is on\n");
if (IS_DEBUG_OSPF (nsm, NSM_TIMERS)) if (IS_DEBUG_OSPF (nsm, NSM_TIMERS))
vty_outln (vty, " OSPF NSM timer debugging is on"); vty_out (vty, " OSPF NSM timer debugging is on\n");
} }
/* Show debug status for OSPF Packets. */ /* Show debug status for OSPF Packets. */
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
if (IS_DEBUG_OSPF_PACKET (i, SEND) && IS_DEBUG_OSPF_PACKET (i, RECV)) if (IS_DEBUG_OSPF_PACKET (i, SEND) && IS_DEBUG_OSPF_PACKET (i, RECV))
{ {
vty_outln (vty, " OSPF packet %s%s debugging is on", vty_out (vty, " OSPF packet %s%s debugging is on\n",
lookup_msg(ospf_packet_type_str, i + 1, NULL), lookup_msg(ospf_packet_type_str, i + 1, NULL),
IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : ""); IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "");
} }
else else
{ {
if (IS_DEBUG_OSPF_PACKET (i, SEND)) if (IS_DEBUG_OSPF_PACKET (i, SEND))
vty_outln (vty, " OSPF packet %s send%s debugging is on", vty_out (vty, " OSPF packet %s send%s debugging is on\n",
lookup_msg(ospf_packet_type_str, i + 1, NULL), lookup_msg(ospf_packet_type_str, i + 1, NULL),
IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : ""); IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "");
if (IS_DEBUG_OSPF_PACKET (i, RECV)) if (IS_DEBUG_OSPF_PACKET (i, RECV))
vty_outln (vty, " OSPF packet %s receive%s debugging is on", vty_out (vty, " OSPF packet %s receive%s debugging is on\n",
lookup_msg(ospf_packet_type_str, i + 1, NULL), lookup_msg(ospf_packet_type_str, i + 1, NULL),
IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : ""); IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "");
} }
/* Show debug status for OSPF LSAs. */ /* Show debug status for OSPF LSAs. */
if (IS_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA) if (IS_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA)
vty_outln (vty, " OSPF LSA debugging is on"); vty_out (vty, " OSPF LSA debugging is on\n");
else else
{ {
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
vty_outln (vty, " OSPF LSA generation debugging is on"); vty_out (vty, " OSPF LSA generation debugging is on\n");
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING)) if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
vty_outln (vty, " OSPF LSA flooding debugging is on"); vty_out (vty, " OSPF LSA flooding debugging is on\n");
if (IS_DEBUG_OSPF (lsa, LSA_INSTALL)) if (IS_DEBUG_OSPF (lsa, LSA_INSTALL))
vty_outln (vty, " OSPF LSA install debugging is on"); vty_out (vty, " OSPF LSA install debugging is on\n");
if (IS_DEBUG_OSPF (lsa, LSA_REFRESH)) if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
vty_outln (vty, " OSPF LSA refresh debugging is on"); vty_out (vty, " OSPF LSA refresh debugging is on\n");
} }
/* Show debug status for Zebra. */ /* Show debug status for Zebra. */
if (IS_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA) if (IS_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA)
vty_outln (vty, " OSPF Zebra debugging is on"); vty_out (vty, " OSPF Zebra debugging is on\n");
else else
{ {
if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE)) if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
vty_outln (vty, " OSPF Zebra interface debugging is on"); vty_out (vty, " OSPF Zebra interface debugging is on\n");
if (IS_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE)) if (IS_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE))
vty_outln (vty, " OSPF Zebra redistribute debugging is on"); vty_out (vty, " OSPF Zebra redistribute debugging is on\n");
} }
/* Show debug status for NSSA. */ /* Show debug status for NSSA. */
if (IS_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA) if (IS_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA)
vty_outln (vty, " OSPF NSSA debugging is on"); vty_out (vty, " OSPF NSSA debugging is on\n");
vty_out (vty, VTYNL); vty_out (vty, "\n");
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1722,56 +1721,56 @@ config_write_debug (struct vty *vty)
/* debug ospf ism (status|events|timers). */ /* debug ospf ism (status|events|timers). */
if (IS_CONF_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM) if (IS_CONF_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
vty_outln (vty, "debug ospf%s ism", str); vty_out (vty, "debug ospf%s ism\n", str);
else else
{ {
if (IS_CONF_DEBUG_OSPF (ism, ISM_STATUS)) if (IS_CONF_DEBUG_OSPF (ism, ISM_STATUS))
vty_outln (vty, "debug ospf%s ism status", str); vty_out (vty, "debug ospf%s ism status\n", str);
if (IS_CONF_DEBUG_OSPF (ism, ISM_EVENTS)) if (IS_CONF_DEBUG_OSPF (ism, ISM_EVENTS))
vty_outln (vty, "debug ospf%s ism event", str); vty_out (vty, "debug ospf%s ism event\n", str);
if (IS_CONF_DEBUG_OSPF (ism, ISM_TIMERS)) if (IS_CONF_DEBUG_OSPF (ism, ISM_TIMERS))
vty_outln (vty, "debug ospf%s ism timer", str); vty_out (vty, "debug ospf%s ism timer\n", str);
} }
/* debug ospf nsm (status|events|timers). */ /* debug ospf nsm (status|events|timers). */
if (IS_CONF_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM) if (IS_CONF_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM)
vty_outln (vty, "debug ospf%s nsm", str); vty_out (vty, "debug ospf%s nsm\n", str);
else else
{ {
if (IS_CONF_DEBUG_OSPF (nsm, NSM_STATUS)) if (IS_CONF_DEBUG_OSPF (nsm, NSM_STATUS))
vty_outln (vty, "debug ospf%s nsm status", str); vty_out (vty, "debug ospf%s nsm status\n", str);
if (IS_CONF_DEBUG_OSPF (nsm, NSM_EVENTS)) if (IS_CONF_DEBUG_OSPF (nsm, NSM_EVENTS))
vty_outln (vty, "debug ospf%s nsm event", str); vty_out (vty, "debug ospf%s nsm event\n", str);
if (IS_CONF_DEBUG_OSPF (nsm, NSM_TIMERS)) if (IS_CONF_DEBUG_OSPF (nsm, NSM_TIMERS))
vty_outln (vty, "debug ospf%s nsm timer", str); vty_out (vty, "debug ospf%s nsm timer\n", str);
} }
/* debug ospf lsa (generate|flooding|install|refresh). */ /* debug ospf lsa (generate|flooding|install|refresh). */
if (IS_CONF_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA) if (IS_CONF_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA)
vty_outln (vty, "debug ospf%s lsa", str); vty_out (vty, "debug ospf%s lsa\n", str);
else else
{ {
if (IS_CONF_DEBUG_OSPF (lsa, LSA_GENERATE)) if (IS_CONF_DEBUG_OSPF (lsa, LSA_GENERATE))
vty_outln (vty, "debug ospf%s lsa generate", str); vty_out (vty, "debug ospf%s lsa generate\n", str);
if (IS_CONF_DEBUG_OSPF (lsa, LSA_FLOODING)) if (IS_CONF_DEBUG_OSPF (lsa, LSA_FLOODING))
vty_outln (vty, "debug ospf%s lsa flooding", str); vty_out (vty, "debug ospf%s lsa flooding\n", str);
if (IS_CONF_DEBUG_OSPF (lsa, LSA_INSTALL)) if (IS_CONF_DEBUG_OSPF (lsa, LSA_INSTALL))
vty_outln (vty, "debug ospf%s lsa install", str); vty_out (vty, "debug ospf%s lsa install\n", str);
if (IS_CONF_DEBUG_OSPF (lsa, LSA_REFRESH)) if (IS_CONF_DEBUG_OSPF (lsa, LSA_REFRESH))
vty_outln (vty, "debug ospf%s lsa refresh", str); vty_out (vty, "debug ospf%s lsa refresh\n", str);
write = 1; write = 1;
} }
/* debug ospf zebra (interface|redistribute). */ /* debug ospf zebra (interface|redistribute). */
if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA) if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA)
vty_outln (vty, "debug ospf%s zebra", str); vty_out (vty, "debug ospf%s zebra\n", str);
else else
{ {
if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_INTERFACE)) if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
vty_outln (vty, "debug ospf%s zebra interface", str); vty_out (vty, "debug ospf%s zebra interface\n", str);
if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE)) if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE))
vty_outln (vty, "debug ospf%s zebra redistribute", str); vty_out (vty, "debug ospf%s zebra redistribute\n", str);
write = 1; write = 1;
} }
@ -1779,14 +1778,14 @@ config_write_debug (struct vty *vty)
/* debug ospf event. */ /* debug ospf event. */
if (IS_CONF_DEBUG_OSPF (event, EVENT) == OSPF_DEBUG_EVENT) if (IS_CONF_DEBUG_OSPF (event, EVENT) == OSPF_DEBUG_EVENT)
{ {
vty_outln (vty, "debug ospf%s event", str); vty_out (vty, "debug ospf%s event\n", str);
write = 1; write = 1;
} }
/* debug ospf nssa. */ /* debug ospf nssa. */
if (IS_CONF_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA) if (IS_CONF_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA)
{ {
vty_outln (vty, "debug ospf%s nssa", str); vty_out (vty, "debug ospf%s nssa\n", str);
write = 1; write = 1;
} }
@ -1796,7 +1795,7 @@ config_write_debug (struct vty *vty)
r &= conf_debug_ospf_packet[i] & (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL); r &= conf_debug_ospf_packet[i] & (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL);
if (r == (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL)) if (r == (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL))
{ {
vty_outln (vty, "debug ospf%s packet all detail", str); vty_out (vty, "debug ospf%s packet all detail\n", str);
return 1; return 1;
} }
@ -1806,10 +1805,10 @@ config_write_debug (struct vty *vty)
r &= conf_debug_ospf_packet[i] & OSPF_DEBUG_SEND_RECV; r &= conf_debug_ospf_packet[i] & OSPF_DEBUG_SEND_RECV;
if (r == OSPF_DEBUG_SEND_RECV) if (r == OSPF_DEBUG_SEND_RECV)
{ {
vty_outln (vty, "debug ospf%s packet all", str); vty_out (vty, "debug ospf%s packet all\n", str);
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL) if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL)
vty_outln (vty, "debug ospf%s packet %s detail", str, vty_out (vty, "debug ospf%s packet %s detail\n", str,
type_str[i]); type_str[i]);
return 1; return 1;
} }
@ -1821,7 +1820,7 @@ config_write_debug (struct vty *vty)
if (conf_debug_ospf_packet[i] == 0) if (conf_debug_ospf_packet[i] == 0)
continue; continue;
vty_outln (vty, "debug ospf%s packet %s%s", str, vty_out (vty, "debug ospf%s packet %s%s\n", str,
type_str[i],detail_str[conf_debug_ospf_packet[i]]); type_str[i],detail_str[conf_debug_ospf_packet[i]]);
write = 1; write = 1;
} }

View File

@ -1120,7 +1120,7 @@ ospf_opaque_config_write_router (struct vty *vty, struct ospf *ospf)
struct list *funclist; struct list *funclist;
if (CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE)) if (CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE))
vty_outln (vty, " capability opaque"); vty_out (vty, " capability opaque\n");
funclist = ospf_opaque_wildcard_funclist; funclist = ospf_opaque_wildcard_funclist;
opaque_lsa_config_write_router_callback (funclist, vty); opaque_lsa_config_write_router_callback (funclist, vty);
@ -1189,11 +1189,11 @@ show_opaque_info_detail (struct vty *vty, struct ospf_lsa *lsa)
/* Switch output functionality by vty address. */ /* Switch output functionality by vty address. */
if (vty != NULL) if (vty != NULL)
{ {
vty_outln (vty, " Opaque-Type %u (%s)", opaque_type, vty_out (vty, " Opaque-Type %u (%s)\n", opaque_type,
ospf_opaque_type_name(opaque_type)); ospf_opaque_type_name(opaque_type));
vty_outln (vty, " Opaque-ID 0x%x", opaque_id); vty_out (vty, " Opaque-ID 0x%x\n", opaque_id);
vty_outln (vty, " Opaque-Info: %u octets of data%s", vty_out (vty, " Opaque-Info: %u octets of data%s\n",
ntohs (lsah->length) - OSPF_LSA_HEADER_SIZE, ntohs (lsah->length) - OSPF_LSA_HEADER_SIZE,
VALID_OPAQUE_INFO_LEN(lsah) ? "" : "(Invalid length?)"); VALID_OPAQUE_INFO_LEN(lsah) ? "" : "(Invalid length?)");
} }

View File

@ -906,7 +906,7 @@ show_vty_router_cap (struct vty *vty, struct ri_tlv_header *tlvh)
struct ri_tlv_router_cap *top = (struct ri_tlv_router_cap *) tlvh; struct ri_tlv_router_cap *top = (struct ri_tlv_router_cap *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Router Capabilities: 0x%x",ntohl(top->value)); vty_out (vty, " Router Capabilities: 0x%x\n",ntohl(top->value));
else else
zlog_debug (" Router Capabilities: 0x%x", ntohl (top->value)); zlog_debug (" Router Capabilities: 0x%x", ntohl (top->value));
@ -921,7 +921,7 @@ show_vty_pce_subtlv_address (struct vty *vty, struct ri_tlv_header *tlvh)
if (ntohs (top->address.type) == PCE_ADDRESS_TYPE_IPV4) if (ntohs (top->address.type) == PCE_ADDRESS_TYPE_IPV4)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " PCE Address: %s",inet_ntoa(top->address.value)); vty_out (vty, " PCE Address: %s\n",inet_ntoa(top->address.value));
else else
zlog_debug (" PCE Address: %s", inet_ntoa (top->address.value)); zlog_debug (" PCE Address: %s", inet_ntoa (top->address.value));
} }
@ -929,7 +929,7 @@ show_vty_pce_subtlv_address (struct vty *vty, struct ri_tlv_header *tlvh)
{ {
/* TODO: Add support to IPv6 with inet_ntop() */ /* TODO: Add support to IPv6 with inet_ntop() */
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " PCE Address: 0x%x", vty_out (vty, " PCE Address: 0x%x\n",
ntohl(top->address.value.s_addr)); ntohl(top->address.value.s_addr));
else else
zlog_debug (" PCE Address: 0x%x", zlog_debug (" PCE Address: 0x%x",
@ -946,7 +946,7 @@ show_vty_pce_subtlv_path_scope (struct vty *vty, struct ri_tlv_header *tlvh)
(struct ri_pce_subtlv_path_scope *) tlvh; (struct ri_pce_subtlv_path_scope *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " PCE Path Scope: 0x%x",ntohl(top->value)); vty_out (vty, " PCE Path Scope: 0x%x\n",ntohl(top->value));
else else
zlog_debug (" PCE Path Scope: 0x%x", ntohl (top->value)); zlog_debug (" PCE Path Scope: 0x%x", ntohl (top->value));
@ -963,14 +963,14 @@ show_vty_pce_subtlv_domain (struct vty *vty, struct ri_tlv_header *tlvh)
{ {
tmp.s_addr = top->value; tmp.s_addr = top->value;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " PCE domain Area: %s",inet_ntoa(tmp)); vty_out (vty, " PCE domain Area: %s\n",inet_ntoa(tmp));
else else
zlog_debug (" PCE domain Area: %s", inet_ntoa (tmp)); zlog_debug (" PCE domain Area: %s", inet_ntoa (tmp));
} }
else else
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " PCE domain AS: %d",ntohl(top->value)); vty_out (vty, " PCE domain AS: %d\n",ntohl(top->value));
else else
zlog_debug (" PCE domain AS: %d", ntohl (top->value)); zlog_debug (" PCE domain AS: %d", ntohl (top->value));
} }
@ -988,14 +988,14 @@ show_vty_pce_subtlv_neighbor (struct vty *vty, struct ri_tlv_header *tlvh)
{ {
tmp.s_addr = top->value; tmp.s_addr = top->value;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " PCE neighbor Area: %s",inet_ntoa(tmp)); vty_out (vty, " PCE neighbor Area: %s\n",inet_ntoa(tmp));
else else
zlog_debug (" PCE neighbor Area: %s", inet_ntoa (tmp)); zlog_debug (" PCE neighbor Area: %s", inet_ntoa (tmp));
} }
else else
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " PCE neighbor AS: %d",ntohl(top->value)); vty_out (vty, " PCE neighbor AS: %d\n",ntohl(top->value));
else else
zlog_debug (" PCE neighbor AS: %d", ntohl (top->value)); zlog_debug (" PCE neighbor AS: %d", ntohl (top->value));
} }
@ -1008,7 +1008,7 @@ show_vty_pce_subtlv_cap_flag (struct vty *vty, struct ri_tlv_header *tlvh)
struct ri_pce_subtlv_cap_flag *top = (struct ri_pce_subtlv_cap_flag *) tlvh; struct ri_pce_subtlv_cap_flag *top = (struct ri_pce_subtlv_cap_flag *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " PCE Capabilities Flag: 0x%x",ntohl(top->value)); vty_out (vty, " PCE Capabilities Flag: 0x%x\n",ntohl(top->value));
else else
zlog_debug (" PCE Capabilities Flag: 0x%x", ntohl (top->value)); zlog_debug (" PCE Capabilities Flag: 0x%x", ntohl (top->value));
@ -1019,7 +1019,7 @@ static u_int16_t
show_vty_unknown_tlv (struct vty *vty, struct ri_tlv_header *tlvh) show_vty_unknown_tlv (struct vty *vty, struct ri_tlv_header *tlvh)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unknown TLV: [type(0x%x), length(0x%x)]", vty_out (vty, " Unknown TLV: [type(0x%x), length(0x%x)]\n",
ntohs (tlvh->type), ntohs(tlvh->length)); ntohs (tlvh->type), ntohs(tlvh->length));
else else
zlog_debug (" Unknown TLV: [type(0x%x), length(0x%x)]", zlog_debug (" Unknown TLV: [type(0x%x), length(0x%x)]",
@ -1105,16 +1105,16 @@ ospf_router_info_config_write_router (struct vty *vty)
if (OspfRI.status == enabled) if (OspfRI.status == enabled)
{ {
if (OspfRI.scope == OSPF_OPAQUE_AS_LSA) if (OspfRI.scope == OSPF_OPAQUE_AS_LSA)
vty_outln (vty, " router-info as"); vty_out (vty, " router-info as\n");
else else
vty_outln (vty, " router-info area %s",inet_ntoa(OspfRI.area_id)); vty_out (vty, " router-info area %s\n",inet_ntoa(OspfRI.area_id));
if (pce->pce_address.header.type != 0) if (pce->pce_address.header.type != 0)
vty_outln (vty, " pce address %s", vty_out (vty, " pce address %s\n",
inet_ntoa(pce->pce_address.address.value)); inet_ntoa(pce->pce_address.address.value));
if (pce->pce_cap_flag.header.type != 0) if (pce->pce_cap_flag.header.type != 0)
vty_outln (vty, " pce flag 0x%x",ntohl(pce->pce_cap_flag.value)); vty_out (vty, " pce flag 0x%x\n",ntohl(pce->pce_cap_flag.value));
for (ALL_LIST_ELEMENTS_RO (pce->pce_domain, node, domain)) for (ALL_LIST_ELEMENTS_RO (pce->pce_domain, node, domain))
{ {
@ -1123,11 +1123,11 @@ ospf_router_info_config_write_router (struct vty *vty)
if (domain->type == PCE_DOMAIN_TYPE_AREA) if (domain->type == PCE_DOMAIN_TYPE_AREA)
{ {
tmp.s_addr = domain->value; tmp.s_addr = domain->value;
vty_outln (vty, " pce domain area %s",inet_ntoa(tmp)); vty_out (vty, " pce domain area %s\n",inet_ntoa(tmp));
} }
else else
{ {
vty_outln (vty, " pce domain as %d",ntohl(domain->value)); vty_out (vty, " pce domain as %d\n",ntohl(domain->value));
} }
} }
} }
@ -1139,18 +1139,18 @@ ospf_router_info_config_write_router (struct vty *vty)
if (neighbor->type == PCE_DOMAIN_TYPE_AREA) if (neighbor->type == PCE_DOMAIN_TYPE_AREA)
{ {
tmp.s_addr = neighbor->value; tmp.s_addr = neighbor->value;
vty_outln (vty, " pce neighbor area %s",inet_ntoa(tmp)); vty_out (vty, " pce neighbor area %s\n",inet_ntoa(tmp));
} }
else else
{ {
vty_outln (vty, " pce neighbor as %d", vty_out (vty, " pce neighbor as %d\n",
ntohl(neighbor->value)); ntohl(neighbor->value));
} }
} }
} }
if (pce->pce_scope.header.type != 0) if (pce->pce_scope.header.type != 0)
vty_outln (vty, " pce scope 0x%x", vty_out (vty, " pce scope 0x%x\n",
ntohl(OspfRI.pce_info.pce_scope.value)); ntohl(OspfRI.pce_info.pce_scope.value));
} }
return; return;
@ -1181,7 +1181,7 @@ DEFUN (router_info,
{ {
if (!inet_aton (area, &OspfRI.area_id)) if (!inet_aton (area, &OspfRI.area_id))
{ {
vty_outln (vty, "%% specified Area ID %s is invalid", vty_out (vty, "%% specified Area ID %s is invalid\n",
area); area);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1257,7 +1257,7 @@ ospf_ri_enabled (struct vty *vty)
return 1; return 1;
if (vty) if (vty)
vty_outln (vty, "%% OSPF RI is not turned on"); vty_out (vty, "%% OSPF RI is not turned on\n");
return 0; return 0;
} }
@ -1278,7 +1278,7 @@ DEFUN (pce_address,
if (!inet_aton (argv[idx_ipv4]->arg, &value)) if (!inet_aton (argv[idx_ipv4]->arg, &value))
{ {
vty_outln (vty, "Please specify PCE Address by A.B.C.D"); vty_out (vty, "Please specify PCE Address by A.B.C.D\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1330,7 +1330,7 @@ DEFUN (pce_path_scope,
if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &scope) != 1) if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &scope) != 1)
{ {
vty_outln (vty, "pce_path_scope: fscanf: %s",safe_strerror(errno)); vty_out (vty, "pce_path_scope: fscanf: %s\n",safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1384,7 +1384,7 @@ DEFUN (pce_domain,
if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) if (sscanf (argv[idx_number]->arg, "%d", &as) != 1)
{ {
vty_outln (vty, "pce_domain: fscanf: %s",safe_strerror(errno)); vty_out (vty, "pce_domain: fscanf: %s\n",safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1421,7 +1421,7 @@ DEFUN (no_pce_domain,
if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) if (sscanf (argv[idx_number]->arg, "%d", &as) != 1)
{ {
vty_outln (vty, "no_pce_domain: fscanf: %s",safe_strerror(errno)); vty_out (vty, "no_pce_domain: fscanf: %s\n",safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1455,7 +1455,7 @@ DEFUN (pce_neigbhor,
if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) if (sscanf (argv[idx_number]->arg, "%d", &as) != 1)
{ {
vty_outln (vty, "pce_neighbor: fscanf: %s",safe_strerror(errno)); vty_out (vty, "pce_neighbor: fscanf: %s\n",safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1492,7 +1492,7 @@ DEFUN (no_pce_neighbor,
if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) if (sscanf (argv[idx_number]->arg, "%d", &as) != 1)
{ {
vty_outln (vty, "no_pce_neighbor: fscanf: %s",safe_strerror(errno)); vty_out (vty, "no_pce_neighbor: fscanf: %s\n",safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1523,7 +1523,7 @@ DEFUN (pce_cap_flag,
if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &cap) != 1) if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &cap) != 1)
{ {
vty_outln (vty, "pce_cap_flag: fscanf: %s",safe_strerror(errno)); vty_out (vty, "pce_cap_flag: fscanf: %s\n",safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
@ -1568,13 +1568,13 @@ DEFUN (show_ip_ospf_router_info,
if (OspfRI.status == enabled) if (OspfRI.status == enabled)
{ {
vty_outln (vty, "--- Router Information parameters ---"); vty_out (vty, "--- Router Information parameters ---\n");
show_vty_router_cap (vty, &OspfRI.router_cap.header); show_vty_router_cap (vty, &OspfRI.router_cap.header);
} }
else else
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Router Information is disabled on this router"); vty_out (vty, " Router Information is disabled on this router\n");
} }
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -1596,7 +1596,7 @@ DEFUN (show_ip_opsf_router_info_pce,
if (OspfRI.status == enabled) if (OspfRI.status == enabled)
{ {
vty_outln (vty, "--- PCE parameters ---"); vty_out (vty, "--- PCE parameters ---\n");
if (pce->pce_address.header.type != 0) if (pce->pce_address.header.type != 0)
show_vty_pce_subtlv_address (vty, &pce->pce_address.header); show_vty_pce_subtlv_address (vty, &pce->pce_address.header);
@ -1622,7 +1622,7 @@ DEFUN (show_ip_opsf_router_info_pce,
} }
else else
{ {
vty_outln (vty," Router Information is disabled on this router"); vty_out (vty," Router Information is disabled on this router\n");
} }
return CMD_SUCCESS; return CMD_SUCCESS;

View File

@ -1671,7 +1671,7 @@ show_vty_router_addr (struct vty *vty, struct te_tlv_header *tlvh)
struct te_tlv_router_addr *top = (struct te_tlv_router_addr *) tlvh; struct te_tlv_router_addr *top = (struct te_tlv_router_addr *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Router-Address: %s",inet_ntoa(top->value)); vty_out (vty, " Router-Address: %s\n",inet_ntoa(top->value));
else else
zlog_debug (" Router-Address: %s", inet_ntoa (top->value)); zlog_debug (" Router-Address: %s", inet_ntoa (top->value));
@ -1684,7 +1684,7 @@ show_vty_link_header (struct vty *vty, struct te_tlv_header *tlvh)
struct te_tlv_link *top = (struct te_tlv_link *) tlvh; struct te_tlv_link *top = (struct te_tlv_link *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Link: %u octets of data",ntohs(top->header.length)); vty_out (vty, " Link: %u octets of data\n",ntohs(top->header.length));
else else
zlog_debug (" Link: %u octets of data", ntohs (top->header.length)); zlog_debug (" Link: %u octets of data", ntohs (top->header.length));
@ -1711,7 +1711,7 @@ show_vty_link_subtlv_link_type (struct vty *vty, struct te_tlv_header *tlvh)
} }
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Link-Type: %s (%u)", cp,top->link_type.value); vty_out (vty, " Link-Type: %s (%u)\n", cp,top->link_type.value);
else else
zlog_debug (" Link-Type: %s (%u)", cp, top->link_type.value); zlog_debug (" Link-Type: %s (%u)", cp, top->link_type.value);
@ -1725,7 +1725,7 @@ show_vty_link_subtlv_link_id (struct vty *vty, struct te_tlv_header *tlvh)
top = (struct te_link_subtlv_link_id *) tlvh; top = (struct te_link_subtlv_link_id *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Link-ID: %s", inet_ntoa(top->value)); vty_out (vty, " Link-ID: %s\n", inet_ntoa(top->value));
else else
zlog_debug (" Link-ID: %s", inet_ntoa (top->value)); zlog_debug (" Link-ID: %s", inet_ntoa (top->value));
@ -1743,14 +1743,14 @@ show_vty_link_subtlv_lclif_ipaddr (struct vty *vty,
n = ntohs (tlvh->length) / sizeof (top->value[0]); n = ntohs (tlvh->length) / sizeof (top->value[0]);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Local Interface IP Address(es): %d", n); vty_out (vty, " Local Interface IP Address(es): %d\n", n);
else else
zlog_debug (" Local Interface IP Address(es): %d", n); zlog_debug (" Local Interface IP Address(es): %d", n);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " #%d: %s", i,inet_ntoa(top->value[i])); vty_out (vty, " #%d: %s\n", i,inet_ntoa(top->value[i]));
else else
zlog_debug (" #%d: %s", i, inet_ntoa (top->value[i])); zlog_debug (" #%d: %s", i, inet_ntoa (top->value[i]));
} }
@ -1767,14 +1767,14 @@ show_vty_link_subtlv_rmtif_ipaddr (struct vty *vty,
top = (struct te_link_subtlv_rmtif_ipaddr *) tlvh; top = (struct te_link_subtlv_rmtif_ipaddr *) tlvh;
n = ntohs (tlvh->length) / sizeof (top->value[0]); n = ntohs (tlvh->length) / sizeof (top->value[0]);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Remote Interface IP Address(es): %d", n); vty_out (vty, " Remote Interface IP Address(es): %d\n", n);
else else
zlog_debug (" Remote Interface IP Address(es): %d", n); zlog_debug (" Remote Interface IP Address(es): %d", n);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " #%d: %s", i,inet_ntoa(top->value[i])); vty_out (vty, " #%d: %s\n", i,inet_ntoa(top->value[i]));
else else
zlog_debug (" #%d: %s", i, inet_ntoa (top->value[i])); zlog_debug (" #%d: %s", i, inet_ntoa (top->value[i]));
} }
@ -1788,7 +1788,7 @@ show_vty_link_subtlv_te_metric (struct vty *vty, struct te_tlv_header *tlvh)
top = (struct te_link_subtlv_te_metric *) tlvh; top = (struct te_link_subtlv_te_metric *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Traffic Engineering Metric: %u", vty_out (vty, " Traffic Engineering Metric: %u\n",
(u_int32_t)ntohl(top->value)); (u_int32_t)ntohl(top->value));
else else
zlog_debug (" Traffic Engineering Metric: %u", zlog_debug (" Traffic Engineering Metric: %u",
@ -1807,7 +1807,7 @@ show_vty_link_subtlv_max_bw (struct vty *vty, struct te_tlv_header *tlvh)
fval = ntohf (top->value); fval = ntohf (top->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Maximum Bandwidth: %g (Bytes/sec)", fval); vty_out (vty, " Maximum Bandwidth: %g (Bytes/sec)\n", fval);
else else
zlog_debug (" Maximum Bandwidth: %g (Bytes/sec)", fval); zlog_debug (" Maximum Bandwidth: %g (Bytes/sec)", fval);
@ -1824,7 +1824,7 @@ show_vty_link_subtlv_max_rsv_bw (struct vty *vty, struct te_tlv_header *tlvh)
fval = ntohf (top->value); fval = ntohf (top->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Maximum Reservable Bandwidth: %g (Bytes/sec)",fval); vty_out (vty, " Maximum Reservable Bandwidth: %g (Bytes/sec)\n",fval);
else else
zlog_debug (" Maximum Reservable Bandwidth: %g (Bytes/sec)", fval); zlog_debug (" Maximum Reservable Bandwidth: %g (Bytes/sec)", fval);
@ -1840,7 +1840,7 @@ show_vty_link_subtlv_unrsv_bw (struct vty *vty, struct te_tlv_header *tlvh)
top = (struct te_link_subtlv_unrsv_bw *) tlvh; top = (struct te_link_subtlv_unrsv_bw *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unreserved Bandwidth per Class Type in Byte/s:"); vty_out (vty, " Unreserved Bandwidth per Class Type in Byte/s:\n");
else else
zlog_debug (" Unreserved Bandwidth per Class Type in Byte/s:"); zlog_debug (" Unreserved Bandwidth per Class Type in Byte/s:");
for (i = 0; i < MAX_CLASS_TYPE; i+=2) for (i = 0; i < MAX_CLASS_TYPE; i+=2)
@ -1849,7 +1849,7 @@ show_vty_link_subtlv_unrsv_bw (struct vty *vty, struct te_tlv_header *tlvh)
fval2 = ntohf (top->value[i+1]); fval2 = ntohf (top->value[i+1]);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", vty_out (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)\n",
i, fval1, i+1, fval2); i, fval1, i+1, fval2);
else else
zlog_debug (" [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", zlog_debug (" [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)",
@ -1866,7 +1866,7 @@ show_vty_link_subtlv_rsc_clsclr (struct vty *vty, struct te_tlv_header *tlvh)
top = (struct te_link_subtlv_rsc_clsclr *) tlvh; top = (struct te_link_subtlv_rsc_clsclr *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Resource class/color: 0x%x", vty_out (vty, " Resource class/color: 0x%x\n",
(u_int32_t)ntohl(top->value)); (u_int32_t)ntohl(top->value));
else else
zlog_debug (" Resource Class/Color: 0x%x", zlog_debug (" Resource Class/Color: 0x%x",
@ -1884,8 +1884,8 @@ show_vty_link_subtlv_lrrid (struct vty *vty, struct te_tlv_header *tlvh)
if (vty != NULL) if (vty != NULL)
{ {
vty_outln (vty, " Local TE Router ID: %s",inet_ntoa(top->local)); vty_out (vty, " Local TE Router ID: %s\n",inet_ntoa(top->local));
vty_outln (vty, " Remote TE Router ID: %s",inet_ntoa(top->remote)); vty_out (vty, " Remote TE Router ID: %s\n",inet_ntoa(top->remote));
} }
else else
{ {
@ -1905,8 +1905,8 @@ show_vty_link_subtlv_llri (struct vty *vty, struct te_tlv_header *tlvh)
if (vty != NULL) if (vty != NULL)
{ {
vty_outln (vty, " Link Local ID: %d",(u_int32_t)ntohl(top->local)); vty_out (vty, " Link Local ID: %d\n",(u_int32_t)ntohl(top->local));
vty_outln (vty, " Link Remote ID: %d",(u_int32_t)ntohl(top->remote)); vty_out (vty, " Link Remote ID: %d\n",(u_int32_t)ntohl(top->remote));
} }
else else
{ {
@ -1925,7 +1925,7 @@ show_vty_link_subtlv_rip (struct vty *vty, struct te_tlv_header *tlvh)
top = (struct te_link_subtlv_rip *) tlvh; top = (struct te_link_subtlv_rip *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Inter-AS TE Remote ASBR IP address: %s", vty_out (vty, " Inter-AS TE Remote ASBR IP address: %s\n",
inet_ntoa(top->value)); inet_ntoa(top->value));
else else
zlog_debug (" Inter-AS TE Remote ASBR IP address: %s", zlog_debug (" Inter-AS TE Remote ASBR IP address: %s",
@ -1942,7 +1942,7 @@ show_vty_link_subtlv_ras (struct vty *vty, struct te_tlv_header *tlvh)
top = (struct te_link_subtlv_ras *) tlvh; top = (struct te_link_subtlv_ras *) tlvh;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Inter-AS TE Remote AS number: %u",ntohl(top->value)); vty_out (vty, " Inter-AS TE Remote AS number: %u\n",ntohl(top->value));
else else
zlog_debug (" Inter-AS TE Remote AS number: %u", ntohl (top->value)); zlog_debug (" Inter-AS TE Remote AS number: %u", ntohl (top->value));
@ -1961,7 +1961,7 @@ show_vty_link_subtlv_av_delay (struct vty *vty, struct te_tlv_header *tlvh)
anomalous = (u_int32_t) ntohl (top->value) & TE_EXT_ANORMAL; anomalous = (u_int32_t) ntohl (top->value) & TE_EXT_ANORMAL;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " %s Average Link Delay: %d (micro-sec)", vty_out (vty, " %s Average Link Delay: %d (micro-sec)\n",
anomalous ? "Anomalous" : "Normal", delay); anomalous ? "Anomalous" : "Normal", delay);
else else
zlog_debug (" %s Average Link Delay: %d (micro-sec)", zlog_debug (" %s Average Link Delay: %d (micro-sec)",
@ -1983,7 +1983,7 @@ show_vty_link_subtlv_mm_delay (struct vty *vty, struct te_tlv_header *tlvh)
high = (u_int32_t) ntohl (top->high); high = (u_int32_t) ntohl (top->high);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " %s Min/Max Link Delay: %d/%d (micro-sec)", vty_out (vty, " %s Min/Max Link Delay: %d/%d (micro-sec)\n",
anomalous ? "Anomalous" : "Normal", low, high); anomalous ? "Anomalous" : "Normal", low, high);
else else
zlog_debug (" %s Min/Max Link Delay: %d/%d (micro-sec)", zlog_debug (" %s Min/Max Link Delay: %d/%d (micro-sec)",
@ -2002,7 +2002,7 @@ show_vty_link_subtlv_delay_var (struct vty *vty, struct te_tlv_header *tlvh)
jitter = (u_int32_t) ntohl (top->value) & TE_EXT_MASK; jitter = (u_int32_t) ntohl (top->value) & TE_EXT_MASK;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Delay Variation: %d (micro-sec)", jitter); vty_out (vty, " Delay Variation: %d (micro-sec)\n", jitter);
else else
zlog_debug (" Delay Variation: %d (micro-sec)", jitter); zlog_debug (" Delay Variation: %d (micro-sec)", jitter);
@ -2023,7 +2023,7 @@ show_vty_link_subtlv_pkt_loss (struct vty *vty, struct te_tlv_header *tlvh)
anomalous = (u_int32_t) ntohl (top->value) & TE_EXT_ANORMAL; anomalous = (u_int32_t) ntohl (top->value) & TE_EXT_ANORMAL;
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " %s Link Loss: %g (%%)", anomalous ? "Anomalous" : "Normal", vty_out (vty, " %s Link Loss: %g (%%)\n", anomalous ? "Anomalous" : "Normal",
fval); fval);
else else
zlog_debug (" %s Link Loss: %g (%%)", anomalous ? "Anomalous" : "Normal", zlog_debug (" %s Link Loss: %g (%%)", anomalous ? "Anomalous" : "Normal",
@ -2042,7 +2042,7 @@ show_vty_link_subtlv_res_bw (struct vty *vty, struct te_tlv_header *tlvh)
fval = ntohf (top->value); fval = ntohf (top->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unidirectional Residual Bandwidth: %g (Bytes/sec)", vty_out (vty, " Unidirectional Residual Bandwidth: %g (Bytes/sec)\n",
fval); fval);
else else
zlog_debug (" Unidirectional Residual Bandwidth: %g (Bytes/sec)", zlog_debug (" Unidirectional Residual Bandwidth: %g (Bytes/sec)",
@ -2061,7 +2061,7 @@ show_vty_link_subtlv_ava_bw (struct vty *vty, struct te_tlv_header *tlvh)
fval = ntohf (top->value); fval = ntohf (top->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unidirectional Available Bandwidth: %g (Bytes/sec)", vty_out (vty, " Unidirectional Available Bandwidth: %g (Bytes/sec)\n",
fval); fval);
else else
zlog_debug (" Unidirectional Available Bandwidth: %g (Bytes/sec)", zlog_debug (" Unidirectional Available Bandwidth: %g (Bytes/sec)",
@ -2080,7 +2080,7 @@ show_vty_link_subtlv_use_bw (struct vty *vty, struct te_tlv_header *tlvh)
fval = ntohf (top->value); fval = ntohf (top->value);
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)", vty_out (vty, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)\n",
fval); fval);
else else
zlog_debug (" Unidirectional Utilized Bandwidth: %g (Bytes/sec)", zlog_debug (" Unidirectional Utilized Bandwidth: %g (Bytes/sec)",
@ -2093,7 +2093,7 @@ static u_int16_t
show_vty_unknown_tlv (struct vty *vty, struct te_tlv_header *tlvh) show_vty_unknown_tlv (struct vty *vty, struct te_tlv_header *tlvh)
{ {
if (vty != NULL) if (vty != NULL)
vty_outln (vty, " Unknown TLV: [type(0x%x), length(0x%x)]", vty_out (vty, " Unknown TLV: [type(0x%x), length(0x%x)]\n",
ntohs (tlvh->type), ntohs(tlvh->length)); ntohs (tlvh->type), ntohs(tlvh->length));
else else
zlog_debug (" Unknown TLV: [type(0x%x), length(0x%x)]", zlog_debug (" Unknown TLV: [type(0x%x), length(0x%x)]",
@ -2230,15 +2230,15 @@ ospf_mpls_te_config_write_router (struct vty *vty)
if (OspfMplsTE.status == enabled) if (OspfMplsTE.status == enabled)
{ {
vty_outln (vty, " mpls-te on"); vty_out (vty, " mpls-te on\n");
vty_outln (vty, " mpls-te router-address %s", vty_out (vty, " mpls-te router-address %s\n",
inet_ntoa(OspfMplsTE.router_addr.value)); inet_ntoa(OspfMplsTE.router_addr.value));
} }
if (OspfMplsTE.inter_as == AS) if (OspfMplsTE.inter_as == AS)
vty_outln (vty, " mpls-te inter-as as"); vty_out (vty, " mpls-te inter-as as\n");
if (OspfMplsTE.inter_as == Area) if (OspfMplsTE.inter_as == Area)
vty_outln (vty, " mpls-te inter-as area %s ", vty_out (vty, " mpls-te inter-as area %s \n",
inet_ntoa(OspfMplsTE.interas_areaid)); inet_ntoa(OspfMplsTE.interas_areaid));
return; return;
@ -2325,7 +2325,7 @@ DEFUN (ospf_mpls_te_router_addr,
if (! inet_aton (argv[idx_ipv4]->arg, &value)) if (! inet_aton (argv[idx_ipv4]->arg, &value))
{ {
vty_outln (vty, "Please specify Router-Addr by A.B.C.D"); vty_out (vty, "Please specify Router-Addr by A.B.C.D\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -2393,7 +2393,7 @@ set_inter_as_mode (struct vty *vty, const char *mode_name,
} }
else else
{ {
vty_outln (vty,"Unknown mode. Please choose between as or area"); vty_out (vty,"Unknown mode. Please choose between as or area\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -2404,8 +2404,8 @@ set_inter_as_mode (struct vty *vty, const char *mode_name,
/* Register new callbacks regarding the flooding scope (AS or Area) */ /* Register new callbacks regarding the flooding scope (AS or Area) */
if (ospf_mpls_te_register (mode) < 0) if (ospf_mpls_te_register (mode) < 0)
{ {
vty_outln (vty, vty_out (vty,
"Internal error: Unable to register Inter-AS functions"); "Internal error: Unable to register Inter-AS functions\n");
return CMD_WARNING; return CMD_WARNING;
} }
@ -2428,14 +2428,14 @@ set_inter_as_mode (struct vty *vty, const char *mode_name,
} }
else else
{ {
vty_outln (vty, "Please change Inter-AS support to disable first before going to mode %s", vty_out (vty, "Please change Inter-AS support to disable first before going to mode %s\n",
mode2text[mode]); mode2text[mode]);
return CMD_WARNING; return CMD_WARNING;
} }
} }
else else
{ {
vty_outln (vty, "mpls-te has not been turned on"); vty_out (vty, "mpls-te has not been turned on\n");
return CMD_WARNING; return CMD_WARNING;
} }
return CMD_SUCCESS; return CMD_SUCCESS;
@ -2505,12 +2505,12 @@ DEFUN (show_ip_ospf_mpls_te_router,
{ {
if (OspfMplsTE.status == enabled) if (OspfMplsTE.status == enabled)
{ {
vty_outln (vty, "--- MPLS-TE router parameters ---"); vty_out (vty, "--- MPLS-TE router parameters ---\n");
if (ntohs (OspfMplsTE.router_addr.header.type) != 0) if (ntohs (OspfMplsTE.router_addr.header.type) != 0)
show_vty_router_addr (vty, &OspfMplsTE.router_addr.header); show_vty_router_addr (vty, &OspfMplsTE.router_addr.header);
else if (vty != NULL) else if (vty != NULL)
vty_outln (vty, " N/A"); vty_out (vty, " N/A\n");
} }
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -2531,21 +2531,21 @@ show_mpls_te_link_sub (struct vty *vty, struct interface *ifp)
{ {
if (IS_INTER_AS (lp->type)) if (IS_INTER_AS (lp->type))
{ {
vty_outln (vty, "-- Inter-AS TEv2 link parameters for %s --", vty_out (vty, "-- Inter-AS TEv2 link parameters for %s --\n",
ifp->name); ifp->name);
} }
else else
{ {
/* MPLS-TE is not activate on this interface */ /* MPLS-TE is not activate on this interface */
/* or this interface is passive and Inter-AS TEv2 is not activate */ /* or this interface is passive and Inter-AS TEv2 is not activate */
vty_outln (vty, " %s: MPLS-TE is disabled on this interface", vty_out (vty, " %s: MPLS-TE is disabled on this interface\n",
ifp->name); ifp->name);
return; return;
} }
} }
else else
{ {
vty_outln (vty, "-- MPLS-TE link parameters for %s --", vty_out (vty, "-- MPLS-TE link parameters for %s --\n",
ifp->name); ifp->name);
} }
@ -2585,11 +2585,11 @@ show_mpls_te_link_sub (struct vty *vty, struct interface *ifp)
show_vty_link_subtlv_ava_bw (vty, &lp->ava_bw.header); show_vty_link_subtlv_ava_bw (vty, &lp->ava_bw.header);
if (TLV_TYPE(lp->use_bw) != 0) if (TLV_TYPE(lp->use_bw) != 0)
show_vty_link_subtlv_use_bw (vty, &lp->use_bw.header); show_vty_link_subtlv_use_bw (vty, &lp->use_bw.header);
vty_outln (vty, "---------------%s", VTYNL); vty_out (vty, "---------------\n\n");
} }
else else
{ {
vty_outln (vty, " %s: MPLS-TE is disabled on this interface", vty_out (vty, " %s: MPLS-TE is disabled on this interface\n",
ifp->name); ifp->name);
} }
@ -2620,7 +2620,7 @@ DEFUN (show_ip_ospf_mpls_te_link,
else else
{ {
if ((ifp = if_lookup_by_name (argv[idx_interface]->arg, VRF_DEFAULT)) == NULL) if ((ifp = if_lookup_by_name (argv[idx_interface]->arg, VRF_DEFAULT)) == NULL)
vty_outln (vty, "No such interface name"); vty_out (vty, "No such interface name\n");
else else
show_mpls_te_link_sub (vty, ifp); show_mpls_te_link_sub (vty, ifp);
} }

Some files were not shown because too many files have changed in this diff Show More