"vty port = %d%s"
"id = %s%s"
"kernel_metric = %d",
- state_file, VTY_NEWLINE,
+ state_file, VTYNL,
babel_config_file ? babel_config_file : babel_config_default,
- VTY_NEWLINE,
- VTY_NEWLINE,
- format_address(protocol_group), VTY_NEWLINE,
- protocol_port, VTY_NEWLINE,
+ VTYNL,
+ VTYNL,
+ format_address(protocol_group), VTYNL,
+ protocol_port, VTYNL,
babel_vty_addr ? babel_vty_addr : "None",
- VTY_NEWLINE,
- babel_vty_port, VTY_NEWLINE,
- format_eui64(myid), VTY_NEWLINE,
+ VTYNL,
+ babel_vty_port, VTYNL,
+ format_eui64(myid), VTYNL,
kernel_metric);
}
"Status codes: s suppressed, d damped, h history, * valid, > best, i - internal");
vty_outln (vty,
"Origin codes: i - IGP, e - EGP, ? - incomplete%s",
- VTY_NEWLINE);
+ VTYNL);
vty_outln(vty, V4_HEADER);
}
}
total_count);
else
vty_outln (vty, "%sDisplayed %ld out of %ld total prefixes",
- VTY_NEWLINE, output_count, total_count);
+ VTYNL, output_count, total_count);
return CMD_SUCCESS;
}
vty_outln (vty,
"Status codes: s suppressed, d damped, h history, * valid, > best, i - internal");
vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s",
- VTY_NEWLINE);
+ VTYNL);
vty_outln (vty, V4_HEADER);
}
}
vty_outln (vty, "No prefixes displayed, %ld exist", total_count);
else
vty_outln (vty, "%sDisplayed %ld routes and %ld total paths",
- VTY_NEWLINE, output_count, total_count);
+ VTYNL, output_count, total_count);
}
return CMD_SUCCESS;
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
vty_outln (vty, "%sInstance %s:",
- VTY_NEWLINE,
+ VTYNL,
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name);
bgp_show_nexthops (vty, bgp, 0);
}
len = 17 - len;
if (len < 1)
- vty_out (vty, "%s%*s", VTY_NEWLINE, 20, " ");
+ vty_out (vty, "%s%*s", VTYNL, 20, " ");
else
vty_out (vty, "%*s", len, " ");
}
len = 7 - len; /* len of IPv6 addr + max len of def ifname */
if (len < 1)
- vty_out (vty, "%s%*s", VTY_NEWLINE, 45, " ");
+ vty_out (vty, "%s%*s", VTYNL, 45, " ");
else
vty_out (vty, "%*s", len, " ");
}
len = 16 - len;
if (len < 1)
- vty_out (vty, "%s%*s", VTY_NEWLINE, 36, " ");
+ vty_out (vty, "%s%*s", VTYNL, 36, " ");
else
vty_out (vty, "%*s", len, " ");
}
len = 16 - len;
if (len < 1)
- vty_out (vty, "%s%*s", VTY_NEWLINE, 36, " ");
+ vty_out (vty, "%s%*s", VTYNL, 36, " ");
else
vty_out (vty, "%*s", len, " ");
}
buf, BUFSIZ));
len = 16 - len;
if (len < 1)
- vty_out (vty, "%s%*s", VTY_NEWLINE, 36, " ");
+ vty_out (vty, "%s%*s", VTYNL, 36, " ");
else
vty_out (vty, "%*s", len, " ");
}
if (len < 1)
{
if (!use_json)
- vty_out (vty, "%s%*s", VTY_NEWLINE, 34, " ");
+ vty_out (vty, "%s%*s", VTYNL, 34, " ");
}
else
{
if (len < 1)
{
if (!use_json)
- vty_out (vty, "%s%*s", VTY_NEWLINE, 33, " ");
+ vty_out (vty, "%s%*s", VTYNL, 33, " ");
}
else
{
{
vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version,
inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE);
+ vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
+ vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
if (type == bgp_show_type_dampend_paths
|| type == bgp_show_type_damp_neighbor)
vty_outln (vty, BGP_SHOW_DAMP_HEADER);
}
else
vty_outln (vty, "%sDisplayed %ld routes and %ld total paths",
- VTY_NEWLINE, output_count, total_count);
+ VTYNL, output_count, total_count);
}
return CMD_SUCCESS;
else
{
vty_outln (vty, "%sInstance %s:",
- VTY_NEWLINE,
+ VTYNL,
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name);
}
bgp_show (vty, bgp, afi, safi, bgp_show_type_normal, NULL, use_json);
thread_execute (bm->master, bgp_table_stats_walker, &ts, 0);
vty_outln (vty, "BGP %s RIB statistics%s",
- afi_safi_print (afi, safi), VTY_NEWLINE);
+ afi_safi_print (afi, safi), VTYNL);
for (i = 0; i < BGP_STATS_MAX; i++)
{
vty_outln (vty, "PfxCt: %ld", peer->pcount[afi][safi]);
vty_outln (vty, "%sCounts from RIB table walk:%s",
- VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL);
for (i = 0; i < PCOUNT_MAX; i++)
vty_outln (vty, "%20s: %-10d", pcount_strs[i], pcounts.count[i]);
{
vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version,
inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE);
+ vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
+ vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
vty_outln (vty, "Originating default network 0.0.0.0%s",
- VTY_NEWLINE);
+ VTYNL);
}
header1 = 0;
}
{
vty_outln (vty, "BGP table version is 0, local router ID is %s",
inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE);
+ vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
+ vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
}
header1 = 0;
}
{
vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version,
inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE);
+ vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
+ vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
}
header1 = 0;
}
json_object_int_add(json, "totalPrefixCounter", output_count);
else
vty_outln (vty, "%sTotal number of prefixes %ld",
- VTY_NEWLINE, output_count);
+ VTYNL, output_count);
}
if (use_json)
{
vty_outln (vty,
"BGP table version is %" PRIu64 ", local router ID is %s",
table->version,inet_ntoa(bgp->router_id));
- vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE);
- vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE);
+ vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL);
+ vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL);
header1 = 0;
}
if (header2)
}
if (output_count != 0)
vty_outln (vty, "%sTotal number of prefixes %ld",
- VTY_NEWLINE, output_count);
+ VTYNL, output_count);
}
static int
vty_outln (vty,
"Status codes: s suppressed, d damped, h history, * valid, > best, i - internal");
vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s",
- VTY_NEWLINE);
+ VTYNL);
vty_outln (vty, V4_HEADER);
}
header = 0;
*bgp = bgp_lookup_by_name (vrf_name);
if (!*bgp)
{
- vty_out (vty, "View/Vrf specified is unknown: %s%s", vrf_name, VTY_NEWLINE);
+ vty_out (vty, "View/Vrf specified is unknown: %s%s", vrf_name, VTYNL);
*idx = 0;
return 0;
}
*bgp = bgp_get_default ();
if (!*bgp)
{
- vty_out (vty, "Unable to find default BGP instance%s", VTY_NEWLINE);
+ vty_out (vty, "Unable to find default BGP instance%s", VTYNL);
*idx = 0;
return 0;
}
{
if ((peer = peer_lookup_by_hostname(bgp, ip_str)) == NULL)
{
- vty_out (vty, "%% Malformed address or name: %s%s", ip_str, VTY_NEWLINE);
+ vty_out (vty, "%% Malformed address or name: %s%s", ip_str, VTYNL);
return NULL;
}
}
if (! peer)
{
vty_out (vty, "%% Specify remote-as or peer-group commands first%s",
- VTY_NEWLINE);
+ VTYNL);
return NULL;
}
if (peer_dynamic_neighbor (peer))
{
vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s",
- VTY_NEWLINE);
+ VTYNL);
return NULL;
}
if (peer_dynamic_neighbor (peer))
{
vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s",
- VTY_NEWLINE);
+ VTYNL);
return NULL;
}
return group->conf;
vty_out (vty, "%% Specify remote-as or peer-group commands first%s",
- VTY_NEWLINE);
+ VTYNL);
return NULL;
}
}
if (str)
{
- vty_out (vty, "%% %s%s", str, VTY_NEWLINE);
+ vty_out (vty, "%% %s%s", str, VTYNL);
return CMD_WARNING;
}
return CMD_SUCCESS;
case BGP_ERR_AF_UNCONFIGURED:
vty_out (vty,
"%%BGP: Enable %s address family for the neighbor %s%s",
- afi_safi_print(afi, safi), peer->host, VTY_NEWLINE);
+ afi_safi_print(afi, safi), peer->host, VTYNL);
break;
case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED:
- vty_out (vty, "%%BGP: Inbound soft reconfig for %s not possible as it%s has neither refresh capability, nor inbound soft reconfig%s", peer->host, VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%%BGP: Inbound soft reconfig for %s not possible as it%s has neither refresh capability, nor inbound soft reconfig%s", peer->host, VTYNL, VTYNL);
break;
default:
break;
peer = peer_lookup_by_hostname(bgp, arg);
if (!peer)
{
- vty_out (vty, "Malformed address or name: %s%s", arg, VTY_NEWLINE);
+ vty_out (vty, "Malformed address or name: %s%s", arg, VTYNL);
return CMD_WARNING;
}
}
peer = peer_lookup (bgp, &su);
if (! peer)
{
- vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"%s", arg, VTY_NEWLINE);
+ vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"%s", arg, VTYNL);
return CMD_WARNING;
}
}
group = peer_group_lookup (bgp, arg);
if (! group)
{
- vty_out (vty, "%%BGP: No such peer-group %s%s", arg, VTY_NEWLINE);
+ vty_out (vty, "%%BGP: No such peer-group %s%s", arg, VTYNL);
return CMD_WARNING;
}
}
if (! find)
vty_out (vty, "%%BGP: No peer is configured with AS %s%s", arg,
- VTY_NEWLINE);
+ VTYNL);
return CMD_SUCCESS;
}
bgp = bgp_lookup_by_name (name);
if (bgp == NULL)
{
- vty_out (vty, "Can't find BGP instance %s%s", name, VTY_NEWLINE);
+ vty_out (vty, "Can't find BGP instance %s%s", name, VTYNL);
return CMD_WARNING;
}
}
bgp = bgp_get_default ();
if (bgp == NULL)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_out (vty, "No BGP process is configured%s", VTYNL);
return CMD_WARNING;
}
}
ret = bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE);
if (ret < 0)
{
- vty_out (vty, "%% There are more than two BGP instances%s", VTY_NEWLINE);
+ vty_out (vty, "%% There are more than two BGP instances%s", VTYNL);
return CMD_WARNING;
}
return CMD_SUCCESS;
if (bgp == NULL)
{
- vty_out (vty, "%% No BGP process is configured%s", VTY_NEWLINE);
+ vty_out (vty, "%% No BGP process is configured%s", VTYNL);
return CMD_WARNING;
}
if (listcount(bm->bgp) > 1)
{
- vty_out (vty, "%% Multiple BGP processes are configured%s", VTY_NEWLINE);
+ vty_out (vty, "%% Multiple BGP processes are configured%s", VTYNL);
return CMD_WARNING;
}
}
{
case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET:
vty_out (vty, "Please specify 'bgp multiple-instance' first%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
case BGP_ERR_AS_MISMATCH:
- vty_out (vty, "BGP is already running; AS is %u%s", as, VTY_NEWLINE);
+ vty_out (vty, "BGP is already running; AS is %u%s", as, VTYNL);
return CMD_WARNING;
case BGP_ERR_INSTANCE_MISMATCH:
- vty_out (vty, "BGP instance name and AS number mismatch%s", VTY_NEWLINE);
+ vty_out (vty, "BGP instance name and AS number mismatch%s", VTYNL);
vty_out (vty, "BGP instance is already running; AS is %u%s",
- as, VTY_NEWLINE);
+ as, VTYNL);
return CMD_WARNING;
}
if (bgp == NULL)
{
- vty_out (vty, "%% No BGP process is configured%s", VTY_NEWLINE);
+ vty_out (vty, "%% No BGP process is configured%s", VTYNL);
return CMD_WARNING;
}
if (listcount(bm->bgp) > 1)
{
- vty_out (vty, "%% Multiple BGP processes are configured%s", VTY_NEWLINE);
+ vty_out (vty, "%% Multiple BGP processes are configured%s", VTYNL);
return CMD_WARNING;
}
}
bgp = bgp_lookup (as, name);
if (! bgp)
{
- vty_out (vty, "%% Can't find BGP instance%s", VTY_NEWLINE);
+ vty_out (vty, "%% Can't find BGP instance%s", VTYNL);
return CMD_WARNING;
}
}
{
if (! IPV4_ADDR_SAME (&bgp->router_id_static, &router_id))
{
- vty_out (vty, "%% BGP router-id doesn't match%s", VTY_NEWLINE);
+ vty_outln (vty, "%% BGP router-id doesn't match%s");
return CMD_WARNING;
}
}
ret = inet_aton (argv[idx_ipv4]->arg, &cluster);
if (! ret)
{
- vty_out (vty, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE);
+ vty_out (vty, "%% Malformed bgp cluster identifier%s", VTYNL);
return CMD_WARNING;
}
if (bgp->as == as)
{
vty_out (vty, "%% Local member-AS not allowed in confed peer list%s",
- VTY_NEWLINE);
+ VTYNL);
continue;
}
"%% Failed to %sset maximum-paths %s %u for afi %u, safi %u%s",
(set == 1) ? "" : "un",
(peer_type == BGP_PEER_EBGP) ? "ebgp" : "ibgp",
- maxpaths, afi, safi, VTY_NEWLINE);
+ maxpaths, afi, safi, VTYNL);
return CMD_WARNING;
}
if (update_delay < establish_wait)
{
vty_out (vty, "%%Failed: update-delay less than the establish-wait!%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
vty_out (vty, " update-delay %d", bgp->v_update_delay);
if (bgp->v_update_delay != bgp->v_establish_wait)
vty_out (vty, " %d", bgp->v_establish_wait);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
return 0;
{
if (bgp->wpkt_quanta != BGP_WRITE_PACKET_MAX)
vty_out (vty, " write-quanta %d%s",
- bgp->wpkt_quanta, VTY_NEWLINE);
+ bgp->wpkt_quanta, VTYNL);
return 0;
}
{
if (bgp->coalesce_time != BGP_DEFAULT_SUBGROUP_COALESCE_TIME)
vty_out (vty, " coalesce-time %u%s",
- bgp->coalesce_time, VTY_NEWLINE);
+ bgp->coalesce_time, VTYNL);
return 0;
}
{
bgp_config_write_family_header (vty, afi, safi, write);
vty_out (vty, " maximum-paths %d%s",
- bgp->maxpaths[afi][safi].maxpaths_ebgp, VTY_NEWLINE);
+ bgp->maxpaths[afi][safi].maxpaths_ebgp, VTYNL);
}
if (bgp->maxpaths[afi][safi].maxpaths_ibgp != MULTIPATH_NUM)
if (CHECK_FLAG (bgp->maxpaths[afi][safi].ibgp_flags,
BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN))
vty_out (vty, " equal-cluster-length");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
return 0;
if (holdtime < 3 && holdtime != 0)
{
vty_out (vty, "%% hold time value must be either 0 or greater than 3%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (bestpath_per_as_used)
{
vty_out (vty, "bgp deterministic-med cannot be disabled while addpath-tx-bestpath-per-AS is in use%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
else
ret = str2prefix (prefix, &range);
if (! ret)
{
- vty_out (vty, "%% Malformed listen range%s", VTY_NEWLINE);
+ vty_out (vty, "%% Malformed listen range%s", VTYNL);
return CMD_WARNING;
}
if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6))
{
vty_out (vty, "%% Malformed listen range (link-local address)%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
else
{
vty_out (vty, "%% Same listen range is attached to peer-group %s%s",
- existing_group->name, VTY_NEWLINE);
+ existing_group->name, VTYNL);
return CMD_WARNING;
}
}
if (listen_range_exists (bgp, &range, 0))
{
vty_out (vty, "%% Listen range overlaps with existing listen range%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
group = peer_group_lookup (bgp, peergroup);
if (! group)
{
- vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE);
+ vty_out (vty, "%% Configure the peer-group first%s", VTYNL);
return CMD_WARNING;
}
ret = str2prefix (prefix, &range);
if (! ret)
{
- vty_out (vty, "%% Malformed listen range%s", VTY_NEWLINE);
+ vty_out (vty, "%% Malformed listen range%s", VTYNL);
return CMD_WARNING;
}
if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6))
{
vty_out (vty, "%% Malformed listen range (link-local address)%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
group = peer_group_lookup (bgp, peergroup);
if (! group)
{
- vty_out (vty, "%% Peer-group does not exist%s", VTY_NEWLINE);
+ vty_out (vty, "%% Peer-group does not exist%s", VTYNL);
return CMD_WARNING;
}
if (bgp->dynamic_neighbors_limit != BGP_DYNAMIC_NEIGHBORS_LIMIT_DEFAULT)
vty_out (vty, " bgp listen limit %d%s",
- bgp->dynamic_neighbors_limit, VTY_NEWLINE);
+ bgp->dynamic_neighbors_limit, VTYNL);
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
{
prefix2str(range, buf, sizeof(buf));
vty_out(vty, " bgp listen range %s peer-group %s%s",
- buf, group->name, VTY_NEWLINE);
+ buf, group->name, VTYNL);
}
}
}
if (ret < 0)
{
vty_out (vty, "%% Create the peer-group or interface first%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
return CMD_SUCCESS;
if (peer_address_self_check (bgp, &su))
{
vty_out (vty, "%% Can not configure the local system as neighbor%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
ret = peer_remote_as (bgp, &su, NULL, &as, as_type, afi, safi);
switch (ret)
{
case BGP_ERR_PEER_GROUP_MEMBER:
- vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as, VTY_NEWLINE);
+ vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as, VTYNL);
return CMD_WARNING;
case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT:
- vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external%s", as, as_str, VTY_NEWLINE);
+ vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external%s", as, as_str, VTYNL);
return CMD_WARNING;
}
return bgp_vty_return (vty, ret);
if (group)
{
- vty_out (vty, "%% Name conflict with peer-group %s", VTY_NEWLINE);
+ vty_out (vty, "%% Name conflict with peer-group %s", VTYNL);
return CMD_WARNING;
}
group = peer_group_lookup (bgp, peer_group_name);
if (! group)
{
- vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE);
+ vty_out (vty, "%% Configure the peer-group first%s", VTYNL);
return CMD_WARNING;
}
peer = peer_lookup_by_conf_if (bgp, argv[idx_word]->arg);
if (peer)
{
- vty_out (vty, "%% Name conflict with interface: %s", VTY_NEWLINE);
+ vty_out (vty, "%% Name conflict with interface: %s", VTYNL);
return CMD_WARNING;
}
peer_group_delete (group);
else
{
- vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE);
+ vty_out (vty, "%% Create the peer-group first%s", VTYNL);
return CMD_WARNING;
}
}
if (peer_dynamic_neighbor (peer))
{
vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
}
else
{
- vty_out (vty, "%% Create the bgp interface first%s", VTY_NEWLINE);
+ vty_out (vty, "%% Create the bgp interface first%s", VTYNL);
return CMD_WARNING;
}
return CMD_SUCCESS;
peer_group_delete (group);
else
{
- vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE);
+ vty_out (vty, "%% Create the peer-group first%s", VTYNL);
return CMD_WARNING;
}
return CMD_SUCCESS;
peer_group_remote_as_delete (group);
else
{
- vty_out (vty, "%% Create the peer-group or interface first%s", VTY_NEWLINE);
+ vty_out (vty, "%% Create the peer-group or interface first%s", VTYNL);
return CMD_WARNING;
}
return CMD_SUCCESS;
peer = peer_lookup_by_conf_if (bgp, argv[idx_peer]->arg);
if (!peer)
{
- vty_out (vty, "%% Malformed address or name: %s%s", argv[idx_peer]->arg, VTY_NEWLINE);
+ vty_out (vty, "%% Malformed address or name: %s%s", argv[idx_peer]->arg, VTYNL);
return CMD_WARNING;
}
}
if (peer_address_self_check (bgp, &su))
{
vty_out (vty, "%% Can not configure the local system as neighbor%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (peer && peer_dynamic_neighbor (peer))
{
vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
}
group = peer_group_lookup (bgp, argv[idx_word]->arg);
if (! group)
{
- vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE);
+ vty_out (vty, "%% Configure the peer-group first%s", VTYNL);
return CMD_WARNING;
}
if (ret == BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT)
{
- vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external%s", as, VTY_NEWLINE);
+ vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external%s", as, VTYNL);
return CMD_WARNING;
}
group = peer_group_lookup (bgp, argv[idx_word]->arg);
if (! group)
{
- vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE);
+ vty_out (vty, "%% Configure the peer-group first%s", VTYNL);
return CMD_WARNING;
}
*/
if (peer->conf_if && (flag == PEER_FLAG_DISABLE_CONNECTED_CHECK)) {
vty_out (vty, "%s is directly connected peer, cannot accept disable-"
- "connected-check%s", ip_str, VTY_NEWLINE);
+ "connected-check%s", ip_str, VTYNL);
return CMD_WARNING;
}
if (str2prefix (source_str, &p))
{
vty_out (vty, "%% Invalid update-source, remove prefix length %s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
else
*/
if (peer->conf_if && (gtsm_hops > 1)) {
vty_out (vty, "%s is directly connected peer, hops cannot exceed 1%s",
- argv[idx_peer]->arg, VTY_NEWLINE);
+ argv[idx_peer]->arg, VTYNL);
return CMD_WARNING;
}
bgp = bgp_lookup_by_name (view_name);
if (bgp == NULL)
{
- vty_out (vty, "%% Can't find BGP instance %s%s", view_name, VTY_NEWLINE);
+ vty_out (vty, "%% Can't find BGP instance %s%s", view_name, VTYNL);
return CMD_WARNING;
}
}
bgp = bgp_get_default ();
if (bgp == NULL)
{
- vty_out (vty, "%% No BGP process is configured%s", VTY_NEWLINE);
+ vty_out (vty, "%% No BGP process is configured%s", VTYNL);
return CMD_WARNING;
}
}
ret = str2prefix (ip_str, &match);
if (! ret)
{
- vty_out (vty, "%% address is malformed%s", VTY_NEWLINE);
+ vty_out (vty, "%% address is malformed%s", VTYNL);
return CMD_WARNING;
}
if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE))
{
- vty_out (vty, "BGP Multiple Instance is not enabled%s", VTY_NEWLINE);
+ vty_out (vty, "BGP Multiple Instance is not enabled%s", VTYNL);
return CMD_WARNING;
}
- vty_out (vty, "Defined BGP views:%s", VTY_NEWLINE);
+ vty_out (vty, "Defined BGP views:%s", VTYNL);
for (ALL_LIST_ELEMENTS_RO(inst, node, bgp))
{
/* Skip VRFs. */
continue;
vty_out (vty, "\t%s (AS%u)%s",
bgp->name ? bgp->name : "(null)",
- bgp->as, VTY_NEWLINE);
+ bgp->as, VTYNL);
}
return CMD_SUCCESS;
if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE))
{
- vty_out (vty, "BGP Multiple Instance is not enabled%s", VTY_NEWLINE);
+ vty_out (vty, "BGP Multiple Instance is not enabled%s", VTYNL);
return CMD_WARNING;
}
count++;
if (!uj && count == 1)
- vty_out (vty, "%s%s", header, VTY_NEWLINE);
+ vty_out (vty, "%s%s", header, VTYNL);
peers_cfg = peers_estb = 0;
if (uj)
vty_out (vty, "%4s %-5d %-16s %9u %10u %s%s",
type, vrf_id_ui, inet_ntoa (bgp->router_id),
peers_cfg, peers_estb, name,
- VTY_NEWLINE);
+ VTYNL);
}
if (uj)
json_object_int_add(json, "totalVrfs", count);
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
{
if (count)
vty_out (vty, "%sTotal number of VRFs (including default): %d%s",
- VTY_NEWLINE, count, VTY_NEWLINE);
+ VTYNL, count, VTYNL);
}
return CMD_SUCCESS;
vty_out (vty, "%ld RIB nodes, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bgp_node)),
- VTY_NEWLINE);
+ VTYNL);
count = mtype_stats_alloc (MTYPE_BGP_ROUTE);
vty_out (vty, "%ld BGP routes, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bgp_info)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA)))
vty_out (vty, "%ld BGP route ancillaries, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bgp_info_extra)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_BGP_STATIC)))
vty_out (vty, "%ld Static routes, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bgp_static)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_BGP_PACKET)))
vty_out (vty, "%ld Packets, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bpacket)),
- VTY_NEWLINE);
+ VTYNL);
/* Adj-In/Out */
if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_IN)))
vty_out (vty, "%ld Adj-In entries, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bgp_adj_in)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_OUT)))
vty_out (vty, "%ld Adj-Out entries, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bgp_adj_out)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE)))
vty_out (vty, "%ld Nexthop cache entries, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bgp_nexthop_cache)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_BGP_DAMP_INFO)))
vty_out (vty, "%ld Dampening entries, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct bgp_damp_info)),
- VTY_NEWLINE);
+ VTYNL);
/* Attributes */
count = attr_count();
vty_out (vty, "%ld BGP attributes, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof(struct attr)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_ATTR_EXTRA)))
vty_out (vty, "%ld BGP extra attributes, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof(struct attr_extra)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = attr_unknown_count()))
- vty_out (vty, "%ld unknown attributes%s", count, VTY_NEWLINE);
+ vty_out (vty, "%ld unknown attributes%s", count, VTYNL);
/* AS_PATH attributes */
count = aspath_count ();
vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct aspath)),
- VTY_NEWLINE);
+ VTYNL);
count = mtype_stats_alloc (MTYPE_AS_SEG);
vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct assegment)),
- VTY_NEWLINE);
+ VTYNL);
/* Other attributes */
if ((count = community_count ()))
vty_out (vty, "%ld BGP community entries, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct community)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_ECOMMUNITY)))
vty_out (vty, "%ld BGP community entries, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct ecommunity)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_LCOMMUNITY)))
vty_out (vty, "%ld BGP large-community entries, using %s of memory%s",
count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct lcommunity)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_CLUSTER)))
vty_out (vty, "%ld Cluster lists, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct cluster_list)),
- VTY_NEWLINE);
+ VTYNL);
/* Peer related usage */
count = mtype_stats_alloc (MTYPE_BGP_PEER);
vty_out (vty, "%ld peers, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct peer)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_PEER_GROUP)))
vty_out (vty, "%ld peer groups, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct peer_group)),
- VTY_NEWLINE);
+ VTYNL);
/* Other */
if ((count = mtype_stats_alloc (MTYPE_HASH)))
vty_out (vty, "%ld hash tables, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct hash)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_HASH_BACKET)))
vty_out (vty, "%ld hash buckets, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (struct hash_backet)),
- VTY_NEWLINE);
+ VTYNL);
if ((count = mtype_stats_alloc (MTYPE_BGP_REGEXP)))
vty_out (vty, "%ld compiled regexes, using %s of memory%s", count,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
count * sizeof (regex_t)),
- VTY_NEWLINE);
+ VTYNL);
return CMD_SUCCESS;
}
vty_out (vty,
"BGP router identifier %s, local AS number %u vrf-id %d",
inet_ntoa (bgp->router_id), bgp->as, vrf_id_ui);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
if (bgp_update_delay_configured(bgp))
else
{
vty_out (vty, "Read-only mode update-delay limit: %d seconds%s",
- bgp->v_update_delay, VTY_NEWLINE);
+ bgp->v_update_delay, VTYNL);
if (bgp->v_update_delay != bgp->v_establish_wait)
vty_out (vty, " Establish wait: %d seconds%s",
- bgp->v_establish_wait, VTY_NEWLINE);
+ bgp->v_establish_wait, VTYNL);
if (bgp_update_delay_active(bgp))
{
vty_out (vty, " First neighbor established: %s%s",
- bgp->update_delay_begin_time, VTY_NEWLINE);
- vty_out (vty, " Delay in progress%s", VTY_NEWLINE);
+ bgp->update_delay_begin_time, VTYNL);
+ vty_out (vty, " Delay in progress%s", VTYNL);
}
else
{
if (bgp->update_delay_over)
{
vty_out (vty, " First neighbor established: %s%s",
- bgp->update_delay_begin_time, VTY_NEWLINE);
+ bgp->update_delay_begin_time, VTYNL);
vty_out (vty, " Best-paths resumed: %s%s",
- bgp->update_delay_end_time, VTY_NEWLINE);
+ bgp->update_delay_end_time, VTYNL);
vty_out (vty, " zebra update resumed: %s%s",
- bgp->update_delay_zebra_resume_time, VTY_NEWLINE);
+ bgp->update_delay_zebra_resume_time, VTYNL);
vty_out (vty, " peers update resumed: %s%s",
- bgp->update_delay_peers_resume_time, VTY_NEWLINE);
+ bgp->update_delay_peers_resume_time, VTYNL);
}
}
}
else
{
if (bgp_maxmed_onstartup_configured(bgp) && bgp->maxmed_active)
- vty_out (vty, "Max-med on-startup active%s", VTY_NEWLINE);
+ vty_out (vty, "Max-med on-startup active%s", VTYNL);
if (bgp->v_maxmed_admin)
- vty_out (vty, "Max-med administrative active%s", VTY_NEWLINE);
+ vty_out (vty, "Max-med administrative active%s", VTYNL);
vty_out(vty, "BGP table version %" PRIu64 "%s",
- bgp_table_version(bgp->rib[afi][safi]), VTY_NEWLINE);
+ bgp_table_version(bgp->rib[afi][safi]), VTYNL);
ents = bgp_table_count (bgp->rib[afi][safi]);
vty_out (vty, "RIB entries %ld, using %s of memory%s", ents,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
ents * sizeof (struct bgp_node)),
- VTY_NEWLINE);
+ VTYNL);
/* Peer related usage */
ents = listcount (bgp->peer);
ents,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
ents * sizeof (struct peer)),
- VTY_NEWLINE);
+ VTYNL);
if ((ents = listcount (bgp->group)))
vty_out (vty, "Peer groups %ld, using %s of memory%s", ents,
mtype_memstr (memstrbuf, sizeof (memstrbuf),
ents * sizeof (struct peer_group)),
- VTY_NEWLINE);
+ VTYNL);
if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
- vty_out (vty, "Dampening enabled.%s", VTY_NEWLINE);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "Dampening enabled.%s", VTYNL);
+ vty_out (vty, "%s", VTYNL);
/* Subtract 8 here because 'Neighbor' is 8 characters */
vty_out (vty, "Neighbor");
vty_out (vty, "%*s", max_neighbor_width - 8, " ");
- vty_out (vty, "V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd%s", VTY_NEWLINE);
+ vty_out (vty, "V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd%s", VTYNL);
}
}
else
vty_out (vty, " %12s", lookup_msg(bgp_status_msg, peer->status, NULL));
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
}
json_object_int_add(json, "totalPeers", count);
json_object_int_add(json, "dynamicPeers", dn_count);
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
{
if (count)
- vty_out (vty, "%sTotal number of neighbors %d%s", VTY_NEWLINE,
- count, VTY_NEWLINE);
+ vty_out (vty, "%sTotal number of neighbors %d%s", VTYNL,
+ count, VTYNL);
else
{
if (use_json)
vty_out(vty, "{\"error\": {\"message\": \"No %s neighbor configured\"}}%s",
- afi_safi_print(afi, safi), VTY_NEWLINE);
+ afi_safi_print(afi, safi), VTYNL);
else
vty_out (vty, "No %s neighbor is configured%s",
- afi_safi_print(afi, safi), VTY_NEWLINE);
+ afi_safi_print(afi, safi), VTYNL);
}
if (dn_count && ! use_json)
{
- vty_out(vty, "* - dynamic neighbor%s", VTY_NEWLINE);
+ vty_out(vty, "* - dynamic neighbor%s", VTYNL);
vty_out(vty,
"%d dynamic neighbor(s), limit %d%s",
- dn_count, bgp->dynamic_neighbors_limit, VTY_NEWLINE);
+ dn_count, bgp->dynamic_neighbors_limit, VTYNL);
}
}
bool json_output = false;
if (use_json && is_wildcard)
- vty_out (vty, "{%s", VTY_NEWLINE);
+ vty_out (vty, "{%s", VTYNL);
if (afi_wildcard)
afi = 1; /* AFI_IP */
while (afi < AFI_MAX)
json = json_object_new_object();
if (! is_first)
- vty_out (vty, ",%s", VTY_NEWLINE);
+ vty_out (vty, ",%s", VTYNL);
else
is_first = 0;
else
{
vty_out (vty, "%s%s Summary:%s",
- VTY_NEWLINE, afi_safi_print(afi, safi), VTY_NEWLINE);
+ VTYNL, afi_safi_print(afi, safi), VTYNL);
}
}
bgp_show_summary (vty, bgp, afi, safi, use_json, json);
}
if (use_json && is_wildcard)
- vty_out (vty, "}%s", VTY_NEWLINE);
+ vty_out (vty, "}%s", VTYNL);
else if (use_json && !json_output)
- vty_out (vty, "{}%s", VTY_NEWLINE);
+ vty_out (vty, "{}%s", VTYNL);
}
static void
int is_first = 1;
if (use_json)
- vty_out (vty, "{%s", VTY_NEWLINE);
+ vty_out (vty, "{%s", VTYNL);
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
json = json_object_new_object();
if (! is_first)
- vty_out (vty, ",%s", VTY_NEWLINE);
+ vty_out (vty, ",%s", VTYNL);
else
is_first = 0;
else
{
vty_out (vty, "%sInstance %s:%s",
- VTY_NEWLINE,
+ VTYNL,
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
- ? "Default" : bgp->name, VTY_NEWLINE);
+ ? "Default" : bgp->name, VTYNL);
}
bgp_show_summary_afi_safi (vty, bgp, afi, safi, use_json, json);
}
if (use_json)
- vty_out (vty, "}%s", VTY_NEWLINE);
+ vty_out (vty, "}%s", VTYNL);
}
if (! bgp)
{
if (use_json)
- vty_out (vty, "{}%s", VTY_NEWLINE);
+ vty_out (vty, "{}%s", VTYNL);
else
- vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
+ vty_out (vty, "%% No such BGP instance exist%s", VTYNL);
return CMD_WARNING;
}
vty_out (vty, "%sreceived",
CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) ?
", " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
vty_out (vty, "%sreceived",
CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) ?
", " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
}
filter = &p->filter[afi][safi];
vty_out (vty, " For address family: %s%s", afi_safi_print (afi, safi),
- VTY_NEWLINE);
+ VTYNL);
if (peer_group_active(p))
- vty_out (vty, " %s peer-group member%s", p->group->name, VTY_NEWLINE);
+ vty_out (vty, " %s peer-group member%s", p->group->name, VTYNL);
paf = peer_af_find(p, afi, safi);
if (paf && PAF_SUBGRP(paf))
{
vty_out (vty, " Update group %" PRIu64 ", subgroup %" PRIu64 "%s",
- PAF_UPDGRP(paf)->id, PAF_SUBGRP(paf)->id, VTY_NEWLINE);
+ PAF_UPDGRP(paf)->id, PAF_SUBGRP(paf)->id, VTYNL);
vty_out (vty, " Packet Queue length %d%s",
- bpacket_queue_virtual_length(paf), VTY_NEWLINE);
+ bpacket_queue_virtual_length(paf), VTYNL);
}
else
{
- vty_out(vty, " Not part of any update group%s", VTY_NEWLINE);
+ vty_out(vty, " Not part of any update group%s", VTYNL);
}
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))
- vty_out (vty, " AF-dependant capabilities:%s", VTY_NEWLINE);
+ vty_out (vty, " AF-dependant capabilities:%s", VTYNL);
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV)
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV))
{
vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
- ORF_TYPE_PREFIX, VTY_NEWLINE);
+ ORF_TYPE_PREFIX, VTYNL);
bgp_show_peer_afi_orf_cap (vty, p, afi, safi,
PEER_CAP_ORF_PREFIX_SM_ADV,
PEER_CAP_ORF_PREFIX_RM_ADV,
|| CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))
{
vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
- ORF_TYPE_PREFIX_OLD, VTY_NEWLINE);
+ ORF_TYPE_PREFIX_OLD, VTYNL);
bgp_show_peer_afi_orf_cap (vty, p, afi, safi,
PEER_CAP_ORF_PREFIX_SM_ADV,
PEER_CAP_ORF_PREFIX_RM_ADV,
vty_out (vty, " sent;");
if (orf_pfx_count)
vty_out (vty, " received (%d entries)", orf_pfx_count);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH))
- vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE);
+ vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT))
- vty_out (vty, " Route-Reflector Client%s", VTY_NEWLINE);
+ vty_out (vty, " Route-Reflector Client%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))
- vty_out (vty, " Route-Server Client%s", VTY_NEWLINE);
+ vty_out (vty, " Route-Server Client%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG))
- vty_out (vty, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE);
+ vty_out (vty, " Inbound soft reconfiguration allowed%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE))
- vty_out (vty, " Private AS numbers (all) replaced in updates to this neighbor%s", VTY_NEWLINE);
+ vty_out (vty, " Private AS numbers (all) replaced in updates to this neighbor%s", VTYNL);
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE))
- vty_out (vty, " Private AS numbers replaced in updates to this neighbor%s", VTY_NEWLINE);
+ vty_out (vty, " Private AS numbers replaced in updates to this neighbor%s", VTYNL);
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_ALL))
- vty_out (vty, " Private AS numbers (all) removed in updates to this neighbor%s", VTY_NEWLINE);
+ vty_out (vty, " Private AS numbers (all) removed in updates to this neighbor%s", VTYNL);
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS))
- vty_out (vty, " Private AS numbers removed in updates to this neighbor%s", VTY_NEWLINE);
+ vty_out (vty, " Private AS numbers removed in updates to this neighbor%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_ADDPATH_TX_ALL_PATHS))
- vty_out (vty, " Advertise all paths via addpath%s", VTY_NEWLINE);
+ vty_out (vty, " Advertise all paths via addpath%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS))
- vty_out (vty, " Advertise bestpath per AS via addpath%s", VTY_NEWLINE);
+ vty_out (vty, " Advertise bestpath per AS via addpath%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_OVERRIDE))
- vty_out (vty, " Override ASNs in outbound updates if aspath equals remote-as%s", VTY_NEWLINE);
+ vty_out (vty, " Override ASNs in outbound updates if aspath equals remote-as%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF) ||
CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_FORCE_NEXTHOP_SELF))
- vty_out (vty, " NEXT_HOP is always this router%s", VTY_NEWLINE);
+ vty_out (vty, " NEXT_HOP is always this router%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED))
- vty_out (vty, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE);
+ vty_out (vty, " AS_PATH is propagated unchanged to this neighbor%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED))
- vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE);
+ vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MED_UNCHANGED))
- vty_out (vty, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE);
+ vty_out (vty, " MED is propagated unchanged to this neighbor%s", VTYNL);
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
|| CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
|| CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
&& CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
&& CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
- vty_out (vty, "(all)%s", VTY_NEWLINE);
+ vty_out (vty, "(all)%s", VTYNL);
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
- vty_out (vty, "(large)%s", VTY_NEWLINE);
+ vty_out (vty, "(large)%s", VTYNL);
else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY))
- vty_out (vty, "(extended)%s", VTY_NEWLINE);
+ vty_out (vty, "(extended)%s", VTYNL);
else
- vty_out (vty, "(standard)%s", VTY_NEWLINE);
+ vty_out (vty, "(standard)%s", VTYNL);
}
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_DEFAULT_ORIGINATE))
{
p->default_rmap[afi][safi].map ? "*" : "",
p->default_rmap[afi][safi].name);
if (paf && PAF_SUBGRP(paf) && CHECK_FLAG(PAF_SUBGRP(paf)->sflags, SUBGRP_STATUS_DEFAULT_ORIGINATE))
- vty_out (vty, " default sent%s", VTY_NEWLINE);
+ vty_out (vty, " default sent%s", VTYNL);
else
- vty_out (vty, " default not sent%s", VTY_NEWLINE);
+ vty_out (vty, " default not sent%s", VTYNL);
}
if (filter->plist[FILTER_IN].name
|| filter->dlist[FILTER_IN].name
|| filter->aslist[FILTER_IN].name
|| filter->map[RMAP_IN].name)
- vty_out (vty, " Inbound path policy configured%s", VTY_NEWLINE);
+ vty_out (vty, " Inbound path policy configured%s", VTYNL);
if (filter->plist[FILTER_OUT].name
|| filter->dlist[FILTER_OUT].name
|| filter->aslist[FILTER_OUT].name
|| filter->map[RMAP_OUT].name
|| filter->usmap.name)
- vty_out (vty, " Outbound path policy configured%s", VTY_NEWLINE);
+ vty_out (vty, " Outbound path policy configured%s", VTYNL);
/* prefix-list */
if (filter->plist[FILTER_IN].name)
vty_out (vty, " Incoming update prefix filter list is %s%s%s",
filter->plist[FILTER_IN].plist ? "*" : "",
filter->plist[FILTER_IN].name,
- VTY_NEWLINE);
+ VTYNL);
if (filter->plist[FILTER_OUT].name)
vty_out (vty, " Outgoing update prefix filter list is %s%s%s",
filter->plist[FILTER_OUT].plist ? "*" : "",
filter->plist[FILTER_OUT].name,
- VTY_NEWLINE);
+ VTYNL);
/* distribute-list */
if (filter->dlist[FILTER_IN].name)
vty_out (vty, " Incoming update network filter list is %s%s%s",
filter->dlist[FILTER_IN].alist ? "*" : "",
filter->dlist[FILTER_IN].name,
- VTY_NEWLINE);
+ VTYNL);
if (filter->dlist[FILTER_OUT].name)
vty_out (vty, " Outgoing update network filter list is %s%s%s",
filter->dlist[FILTER_OUT].alist ? "*" : "",
filter->dlist[FILTER_OUT].name,
- VTY_NEWLINE);
+ VTYNL);
/* filter-list. */
if (filter->aslist[FILTER_IN].name)
vty_out (vty, " Incoming update AS path filter list is %s%s%s",
filter->aslist[FILTER_IN].aslist ? "*" : "",
filter->aslist[FILTER_IN].name,
- VTY_NEWLINE);
+ VTYNL);
if (filter->aslist[FILTER_OUT].name)
vty_out (vty, " Outgoing update AS path filter list is %s%s%s",
filter->aslist[FILTER_OUT].aslist ? "*" : "",
filter->aslist[FILTER_OUT].name,
- VTY_NEWLINE);
+ VTYNL);
/* route-map. */
if (filter->map[RMAP_IN].name)
vty_out (vty, " Route map for incoming advertisements is %s%s%s",
filter->map[RMAP_IN].map ? "*" : "",
filter->map[RMAP_IN].name,
- VTY_NEWLINE);
+ VTYNL);
if (filter->map[RMAP_OUT].name)
vty_out (vty, " Route map for outgoing advertisements is %s%s%s",
filter->map[RMAP_OUT].map ? "*" : "",
filter->map[RMAP_OUT].name,
- VTY_NEWLINE);
+ VTYNL);
/* unsuppress-map */
if (filter->usmap.name)
vty_out (vty, " Route map for selective unsuppress is %s%s%s",
filter->usmap.map ? "*" : "",
- filter->usmap.name, VTY_NEWLINE);
+ filter->usmap.name, VTYNL);
/* Receive prefix count */
- vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTY_NEWLINE);
+ vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTYNL);
/* Maximum prefix */
if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX))
{
vty_out (vty, " Maximum prefixes allowed %ld%s%s", p->pmax[afi][safi],
CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING)
- ? " (warning-only)" : "", VTY_NEWLINE);
+ ? " (warning-only)" : "", VTYNL);
vty_out (vty, " Threshold for warning message %d%%",
p->pmax_threshold[afi][safi]);
if (p->pmax_restart[afi][safi])
vty_out (vty, ", restart interval %d min", p->pmax_restart[afi][safi]);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
else
{
if (CHECK_FLAG(bgp->config, BGP_CONFIG_CONFEDERATION))
- vty_out (vty, "confed-internal link%s", VTY_NEWLINE);
+ vty_out (vty, "confed-internal link%s", VTYNL);
else
- vty_out (vty, "internal link%s", VTY_NEWLINE);
+ vty_out (vty, "internal link%s", VTYNL);
}
}
else
else
{
if (bgp_confederation_peers_check(bgp, p->as))
- vty_out (vty, "confed-external link%s", VTY_NEWLINE);
+ vty_out (vty, "confed-external link%s", VTYNL);
else
- vty_out (vty, "external link%s", VTY_NEWLINE);
+ vty_out (vty, "external link%s", VTYNL);
}
}
if (use_json)
json_object_string_add(json_neigh, "nbrDesc", p->desc);
else
- vty_out (vty, " Description: %s%s", p->desc, VTY_NEWLINE);
+ vty_out (vty, " Description: %s%s", p->desc, VTYNL);
}
if (p->hostname)
{
if (p->domainname && (p->domainname[0] != '\0'))
vty_out(vty, "Hostname: %s.%s%s", p->hostname, p->domainname,
- VTY_NEWLINE);
+ VTYNL);
else
- vty_out(vty, "Hostname: %s%s", p->hostname, VTY_NEWLINE);
+ vty_out(vty, "Hostname: %s%s", p->hostname, VTYNL);
}
}
else
{
vty_out (vty, " Member of peer-group %s for session parameters%s",
- p->group->name, VTY_NEWLINE);
+ p->group->name, VTYNL);
if (dn_flag[0])
{
if (range)
{
prefix2str(range, buf1, sizeof(buf1));
- vty_out (vty, " Belongs to the subnet range group: %s%s", buf1, VTY_NEWLINE);
+ vty_out (vty, " Belongs to the subnet range group: %s%s", buf1, VTYNL);
}
}
}
{
/* Administrative shutdown. */
if (CHECK_FLAG (p->flags, PEER_FLAG_SHUTDOWN))
- vty_out (vty, " Administratively shut down%s", VTY_NEWLINE);
+ vty_out (vty, " Administratively shut down%s", VTYNL);
/* BGP Version. */
vty_out (vty, " BGP version 4");
vty_out (vty, ", remote router ID %s%s",
inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1)),
- VTY_NEWLINE);
+ VTYNL);
/* Confederation */
if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION)
&& bgp_confederation_peers_check (bgp, p->as))
- vty_out (vty, " Neighbor under common administration%s", VTY_NEWLINE);
+ vty_out (vty, " Neighbor under common administration%s", VTYNL);
/* Status. */
vty_out (vty, " BGP state = %s", lookup_msg(bgp_status_msg, p->status, NULL));
else if (CHECK_FLAG (p->sflags, PEER_STATUS_NSF_WAIT))
vty_out (vty, " (NSF passive)");
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
/* read timer */
vty_out (vty, " Last read %s", peer_uptime (p->readtime, timebuf, BGP_UPTIME_LEN, 0, NULL));
vty_out (vty, ", Last write %s%s",
- peer_uptime (p->last_write, timebuf, BGP_UPTIME_LEN, 0, NULL), VTY_NEWLINE);
+ peer_uptime (p->last_write, timebuf, BGP_UPTIME_LEN, 0, NULL), VTYNL);
/* Configured timer values. */
vty_out (vty, " Hold time is %d, keepalive interval is %d seconds%s",
- p->v_holdtime, p->v_keepalive, VTY_NEWLINE);
+ p->v_holdtime, p->v_keepalive, VTYNL);
if (CHECK_FLAG (p->config, PEER_CONFIG_TIMER))
{
vty_out (vty, " Configured hold time is %d", p->holdtime);
vty_out (vty, ", keepalive interval is %d seconds%s",
- p->keepalive, VTY_NEWLINE);
+ p->keepalive, VTYNL);
}
}
/* Capability. */
}
else
{
- vty_out (vty, " Neighbor capabilities:%s", VTY_NEWLINE);
+ vty_out (vty, " Neighbor capabilities:%s", VTYNL);
/* AS4 */
if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV)
if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV) ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* AddPath */
if (CHECK_FLAG (p->cap, PEER_CAP_ADDPATH_RCV)
|| CHECK_FLAG (p->cap, PEER_CAP_ADDPATH_ADV))
{
- vty_out (vty, " AddPath:%s", VTY_NEWLINE);
+ vty_out (vty, " AddPath:%s", VTYNL);
for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_TX_RCV))
vty_out (vty, "%sreceived", CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_TX_ADV) ? " and " : "" );
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_ADV) ||
if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_RCV))
vty_out (vty, "%sreceived", CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_ADV) ? " and " : "" );
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
}
if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV) ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Extended nexthop */
if (CHECK_FLAG (p->cap, PEER_CAP_ENHE_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_ENHE_ADV) ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
if (CHECK_FLAG (p->cap, PEER_CAP_ENHE_RCV))
{
- vty_out (vty, " Address families by peer:%s ", VTY_NEWLINE);
+ vty_out (vty, " Address families by peer:%s ", VTYNL);
for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
if (CHECK_FLAG (p->af_cap[AFI_IP][safi], PEER_CAP_ENHE_AF_RCV))
vty_out (vty, " %s%s",
- afi_safi_print (AFI_IP, safi), VTY_NEWLINE);
+ afi_safi_print (AFI_IP, safi), VTYNL);
}
}
&& CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)) ?
"old & new" : CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) ? "old" : "new");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Multiprotocol Extensions */
vty_out (vty, " advertised");
if (p->afc_recv[afi][safi])
vty_out (vty, " %sreceived", p->afc_adv[afi][safi] ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Hostname capability */
if (CHECK_FLAG (p->cap, PEER_CAP_HOSTNAME_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_HOSTNAME_ADV) ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Gracefull Restart */
if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV))
vty_out (vty, " %sreceived",
CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV) ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV))
{
int restart_af_count = 0;
vty_out (vty, " Remote Restart timer is %d seconds%s",
- p->v_gr_restart, VTY_NEWLINE);
- vty_out (vty, " Address families by peer:%s ", VTY_NEWLINE);
+ p->v_gr_restart, VTYNL);
+ vty_out (vty, " Address families by peer:%s ", VTYNL);
for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
}
if (! restart_af_count)
vty_out (vty, "none");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
}
}
else
{
- vty_out (vty, " Graceful restart informations:%s", VTY_NEWLINE);
+ vty_out (vty, " Graceful restart informations:%s", VTYNL);
if (p->status == Established)
{
vty_out (vty, " End-of-RIB send: ");
}
}
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
vty_out (vty, " End-of-RIB received: ");
for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
{
}
}
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
if (p->t_gr_restart)
vty_out (vty, " The remaining time of restart timer is %ld%s",
- thread_timer_remain_second (p->t_gr_restart), VTY_NEWLINE);
+ thread_timer_remain_second (p->t_gr_restart), VTYNL);
if (p->t_gr_stale)
vty_out (vty, " The remaining time of stalepath timer is %ld%s",
- thread_timer_remain_second (p->t_gr_stale), VTY_NEWLINE);
+ thread_timer_remain_second (p->t_gr_stale), VTYNL);
}
}
if (use_json)
else
{
/* Packet counts. */
- vty_out (vty, " Message statistics:%s", VTY_NEWLINE);
- vty_out (vty, " Inq depth is 0%s", VTY_NEWLINE);
- vty_out (vty, " Outq depth is %lu%s", (unsigned long) p->obuf->count, VTY_NEWLINE);
- vty_out (vty, " Sent Rcvd%s", VTY_NEWLINE);
- vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTY_NEWLINE);
- vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTY_NEWLINE);
- vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTY_NEWLINE);
- vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTY_NEWLINE);
- vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTY_NEWLINE);
- vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTY_NEWLINE);
+ vty_out (vty, " Message statistics:%s", VTYNL);
+ vty_out (vty, " Inq depth is 0%s", VTYNL);
+ vty_out (vty, " Outq depth is %lu%s", (unsigned long) p->obuf->count, VTYNL);
+ vty_out (vty, " Sent Rcvd%s", VTYNL);
+ vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTYNL);
+ vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTYNL);
+ vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTYNL);
+ vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTYNL);
+ vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTYNL);
+ vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTYNL);
vty_out (vty, " Total: %10d %10d%s", p->open_out + p->notify_out +
p->update_out + p->keepalive_out + p->refresh_out + p->dynamic_cap_out,
p->open_in + p->notify_in + p->update_in + p->keepalive_in + p->refresh_in +
- p->dynamic_cap_in, VTY_NEWLINE);
+ p->dynamic_cap_in, VTYNL);
}
if (use_json)
{
/* advertisement-interval */
vty_out (vty, " Minimum time between advertisement runs is %d seconds%s",
- p->v_routeadv, VTY_NEWLINE);
+ p->v_routeadv, VTYNL);
/* Update-source. */
if (p->update_if || p->update_source)
vty_out (vty, "%s", p->update_if);
else if (p->update_source)
vty_out (vty, "%s", sockunion2str (p->update_source, buf1, SU_ADDRSTRLEN));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Address Family Information */
}
else
vty_out (vty, " Connections established %d; dropped %d%s", p->established, p->dropped,
- VTY_NEWLINE);
+ VTYNL);
if (! p->last_reset)
{
if (use_json)
json_object_string_add(json_neigh, "lastReset", "never");
else
- vty_out (vty, " Last reset never%s", VTY_NEWLINE);
+ vty_out (vty, " Last reset never%s", VTYNL);
}
else
{
subcode_str = bgp_notify_subcode_str(p->notify.code, p->notify.subcode);
vty_out (vty, "due to NOTIFICATION %s (%s%s)%s",
p->last_reset == PEER_DOWN_NOTIFY_SEND ? "sent" : "received",
- code_str, subcode_str, VTY_NEWLINE);
+ code_str, subcode_str, VTYNL);
if (p->last_reset == PEER_DOWN_NOTIFY_RECEIVED
&& p->notify.code == BGP_NOTIFY_CEASE
&& (p->notify.subcode == BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN
msg_str = bgp_notify_admin_message(msgbuf, sizeof(msgbuf),
(u_char*)p->notify.data, p->notify.length);
if (msg_str)
- vty_out (vty, " Message: \"%s\"%s", msg_str, VTY_NEWLINE);
+ vty_out (vty, " Message: \"%s\"%s", msg_str, VTYNL);
}
}
else
{
vty_out (vty, "due to %s%s",
- peer_down_str[(int) p->last_reset], VTY_NEWLINE);
+ peer_down_str[(int) p->last_reset], VTYNL);
}
if (p->last_reset_cause_size)
{
msg = p->last_reset_cause;
- vty_out(vty, " Message received that caused BGP to send a NOTIFICATION:%s ", VTY_NEWLINE);
+ vty_out(vty, " Message received that caused BGP to send a NOTIFICATION:%s ", VTYNL);
for (i = 1; i <= p->last_reset_cause_size; i++)
{
vty_out(vty, "%02X", *msg++);
{
if (i % 16 == 0)
{
- vty_out(vty, "%s ", VTY_NEWLINE);
+ vty_out(vty, "%s ", VTYNL);
}
else if (i % 4 == 0)
{
}
}
}
- vty_out(vty, "%s", VTY_NEWLINE);
+ vty_out(vty, "%s", VTYNL);
}
}
}
if (use_json)
json_object_boolean_true_add(json_neigh, "prefixesConfigExceedMax");
else
- vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE);
+ vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTYNL);
if (p->t_pmax_restart)
{
else
vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
p->host, thread_timer_remain_second (p->t_pmax_restart),
- VTY_NEWLINE);
+ VTYNL);
}
else
{
json_object_boolean_true_add(json_neigh, "reducePrefixNumAndClearIpBgp");
else
vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
- p->host, VTY_NEWLINE);
+ p->host, VTYNL);
}
}
{
if (p->gtsm_hops > 0)
vty_out (vty, " External BGP neighbor may be up to %d hops away.%s",
- p->gtsm_hops, VTY_NEWLINE);
+ p->gtsm_hops, VTYNL);
else if (p->ttl > 1)
vty_out (vty, " External BGP neighbor may be up to %d hops away.%s",
- p->ttl, VTY_NEWLINE);
+ p->ttl, VTYNL);
}
}
else
json_object_int_add(json_neigh, "internalBgpNbrMaxHopsAway", p->gtsm_hops);
else
vty_out (vty, " Internal BGP neighbor may be up to %d hops away.%s",
- p->gtsm_hops, VTY_NEWLINE);
+ p->gtsm_hops, VTYNL);
}
}
vty_out (vty, "Local host: %s, Local port: %d%s",
sockunion2str (p->su_local, buf1, SU_ADDRSTRLEN),
ntohs (p->su_local->sin.sin_port),
- VTY_NEWLINE);
+ VTYNL);
}
/* Remote address. */
vty_out (vty, "Foreign host: %s, Foreign port: %d%s",
sockunion2str (p->su_remote, buf1, SU_ADDRSTRLEN),
ntohs (p->su_remote->sin.sin_port),
- VTY_NEWLINE);
+ VTYNL);
}
/* Nexthop display. */
{
vty_out (vty, "Nexthop: %s%s",
inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1)),
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, "Nexthop global: %s%s",
inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1)),
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, "Nexthop local: %s%s",
inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1)),
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, "BGP connection: %s%s",
p->shared_network ? "shared network" : "non shared network",
- VTY_NEWLINE);
+ VTYNL);
}
}
else
{
vty_out (vty, "BGP Connect Retry Timer in Seconds: %d%s",
- p->v_connect, VTY_NEWLINE);
+ p->v_connect, VTYNL);
if (p->status == Established && p->rtt)
vty_out (vty, "Estimated round trip time: %d ms%s",
- p->rtt, VTY_NEWLINE);
+ p->rtt, VTYNL);
if (p->t_start)
vty_out (vty, "Next start timer due in %ld seconds%s",
- thread_timer_remain_second (p->t_start), VTY_NEWLINE);
+ thread_timer_remain_second (p->t_start), VTYNL);
if (p->t_connect)
vty_out (vty, "Next connect timer due in %ld seconds%s",
- thread_timer_remain_second (p->t_connect), VTY_NEWLINE);
+ thread_timer_remain_second (p->t_connect), VTYNL);
if (p->t_routeadv)
vty_out (vty, "MRAI (interval %u) timer expires in %ld seconds%s",
p->v_routeadv, thread_timer_remain_second (p->t_routeadv),
- VTY_NEWLINE);
+ VTYNL);
if (p->password)
- vty_out (vty, "Peer Authentication Enabled%s", VTY_NEWLINE);
+ vty_out (vty, "Peer Authentication Enabled%s", VTYNL);
vty_out (vty, "Read thread: %s Write thread: %s%s",
p->t_read ? "on" : "off",
p->t_write ? "on" : "off",
- VTY_NEWLINE);
+ VTYNL);
}
if (p->notify.code == BGP_NOTIFY_OPEN_ERR
bgp_capability_vty_out (vty, p, use_json, json_neigh);
if (!use_json)
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
/* BFD information. */
bgp_bfd_show_info(vty, p, use_json, json_neigh);
if (use_json)
json_object_boolean_true_add(json, "bgpNoSuchNeighbor");
else
- vty_out (vty, "%% No such neighbor%s", VTY_NEWLINE);
+ vty_out (vty, "%% No such neighbor%s", VTYNL);
}
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
{
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
return CMD_SUCCESS;
int is_first = 1;
if (use_json)
- vty_out (vty, "{%s", VTY_NEWLINE);
+ vty_out (vty, "{%s", VTYNL);
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
zlog_err("Unable to allocate memory for JSON object");
vty_out (vty,
"{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}%s",
- VTY_NEWLINE);
+ VTYNL);
return;
}
? "Default" : bgp->name);
if (! is_first)
- vty_out (vty, ",%s", VTY_NEWLINE);
+ vty_out (vty, ",%s", VTYNL);
else
is_first = 0;
else
{
vty_out (vty, "%sInstance %s:%s",
- VTY_NEWLINE,
+ VTYNL,
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
? "Default" : bgp->name,
- VTY_NEWLINE);
+ VTYNL);
}
bgp_show_neighbor (vty, bgp, show_all, NULL, NULL, use_json, json);
}
if (use_json)
- vty_out (vty, "}%s", VTY_NEWLINE);
+ vty_out (vty, "}%s", VTYNL);
}
static int
{
json = json_object_new_object();
json_object_boolean_true_add(json, "bgpNoSuchInstance");
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
+ vty_out (vty, "%% No such BGP instance exist%s", VTYNL);
return CMD_WARNING;
}
BGP_SAFI_HELP_STR
"Path information\n")
{
- vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE);
+ vty_out (vty, "Address Refcnt Path%s", VTYNL);
aspath_print_all_vty (vty);
return CMD_SUCCESS;
}
com = (struct community *) backet->data;
vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt,
- community_str (com), VTY_NEWLINE);
+ community_str (com), VTYNL);
}
/* Show BGP's community internal data. */
BGP_STR
"List all bgp community information\n")
{
- vty_out (vty, "Address Refcnt Community%s", VTY_NEWLINE);
+ vty_out (vty, "Address Refcnt Community%s", VTYNL);
hash_iterate (community_hash (),
(void (*) (struct hash_backet *, void *))
lcom = (struct lcommunity *) backet->data;
vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, lcom->refcnt,
- lcommunity_str (lcom), VTY_NEWLINE);
+ lcommunity_str (lcom), VTYNL);
}
/* Show BGP's community internal data. */
BGP_STR
"List all bgp large-community information\n")
{
- vty_out (vty, "Address Refcnt Large-community%s", VTY_NEWLINE);
+ vty_out (vty, "Address Refcnt Large-community%s", VTYNL);
hash_iterate (lcommunity_hash (),
(void (*) (struct hash_backet *, void *))
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
{
vty_out (vty, "%sInstance %s:%s",
- VTY_NEWLINE,
+ VTYNL,
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name,
- VTY_NEWLINE);
+ VTYNL);
update_group_show(bgp, afi, safi, vty, 0);
}
}
if (conf->as_type == AS_SPECIFIED ||
conf->as_type == AS_EXTERNAL) {
vty_out (vty, "%sBGP peer-group %s, remote AS %d%s",
- VTY_NEWLINE, group->name, conf->as, VTY_NEWLINE);
+ VTYNL, group->name, conf->as, VTYNL);
} else if (conf->as_type == AS_INTERNAL) {
vty_out (vty, "%sBGP peer-group %s, remote AS %d%s",
- VTY_NEWLINE, group->name, group->bgp->as, VTY_NEWLINE);
+ VTYNL, group->name, group->bgp->as, VTYNL);
} else {
vty_out (vty, "%sBGP peer-group %s%s",
- VTY_NEWLINE, group->name, VTY_NEWLINE);
+ VTYNL, group->name, VTYNL);
}
if ((group->bgp->as == conf->as) || (conf->as_type == AS_INTERNAL))
- vty_out (vty, " Peer-group type is internal%s", VTY_NEWLINE);
+ vty_out (vty, " Peer-group type is internal%s", VTYNL);
else
- vty_out (vty, " Peer-group type is external%s", VTY_NEWLINE);
+ vty_out (vty, " Peer-group type is external%s", VTYNL);
/* Display AFs configured. */
vty_out (vty, " Configured address-families:");
}
}
if (!af_cfgd)
- vty_out (vty, " none%s", VTY_NEWLINE);
+ vty_out (vty, " none%s", VTYNL);
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
/* Display listen ranges (for dynamic neighbors), if any */
for (afi = AFI_IP; afi < AFI_MAX; afi++)
{
vty_out(vty,
" %d %s listen range(s)%s",
- lr_count, af_str, VTY_NEWLINE);
+ lr_count, af_str, VTYNL);
for (ALL_LIST_ELEMENTS (group->listen_range[afi], node,
nnode, range))
{
prefix2str(range, buf, sizeof(buf));
- vty_out(vty, " %s%s", buf, VTY_NEWLINE);
+ vty_out(vty, " %s%s", buf, VTYNL);
}
}
}
/* Display group members and their status */
if (listcount(group->peer))
{
- vty_out (vty, " Peer-group members:%s", VTY_NEWLINE);
+ vty_out (vty, " Peer-group members:%s", VTYNL);
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
dynamic = peer_dynamic_neighbor(peer);
vty_out (vty, " %s %s %s %s",
peer->host, dynamic ? "(dynamic)" : "",
- peer_status, VTY_NEWLINE);
+ peer_status, VTYNL);
}
}
}
if (type == show_peer_group && ! find)
- vty_out (vty, "%% No such peer-group%s", VTY_NEWLINE);
+ vty_out (vty, "%% No such peer-group%s", VTYNL);
return CMD_SUCCESS;
}
if (! bgp)
{
- vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
+ vty_out (vty, "%% No such BGP instance exist%s", VTYNL);
return CMD_WARNING;
}
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
bgp_redist_add(bgp, AFI_IP, type, 0);
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
type = proto_redistnum (AFI_IP, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
return bgp_redistribute_unset (bgp, AFI_IP, type, 0);
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
metric = strtoul(argv[idx_number]->arg, NULL, 10);
type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text);
if (type < 0)
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_out (vty, "%% Invalid route type%s", VTYNL);
return CMD_WARNING;
}
vty_out (vty, " metric %u", red->redist_metric);
if (red->rmap.name)
vty_out (vty, " route-map %s", red->rmap.name);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
}
switch (ret)
{
case COMMUNITY_LIST_ERR_CANT_FIND_LIST:
- vty_out (vty, "%% Can't find community-list%s", VTY_NEWLINE);
+ vty_out (vty, "%% Can't find community-list%s", VTYNL);
break;
case COMMUNITY_LIST_ERR_MALFORMED_VAL:
- vty_out (vty, "%% Malformed community-list value%s", VTY_NEWLINE);
+ vty_out (vty, "%% Malformed community-list value%s", VTYNL);
break;
case COMMUNITY_LIST_ERR_STANDARD_CONFLICT:
- vty_out (vty, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE);
+ vty_out (vty, "%% Community name conflict, previously defined as standard community%s", VTYNL);
break;
case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT:
- vty_out (vty, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE);
+ vty_out (vty, "%% Community name conflict, previously defined as expanded community%s", VTYNL);
break;
}
}
vty_out (vty, "Community %s list %s%s",
entry->style == COMMUNITY_LIST_STANDARD ?
"standard" : "(expanded) access",
- list->name, VTY_NEWLINE);
+ list->name, VTYNL);
else
vty_out (vty, "Named Community %s list %s%s",
entry->style == COMMUNITY_LIST_STANDARD ?
"standard" : "expanded",
- list->name, VTY_NEWLINE);
+ list->name, VTYNL);
}
if (entry->any)
vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTY_NEWLINE);
+ community_direct_str (entry->direct), VTYNL);
else
vty_out (vty, " %s %s%s",
community_direct_str (entry->direct),
entry->style == COMMUNITY_LIST_STANDARD
? community_str (entry->u.com) : entry->config,
- VTY_NEWLINE);
+ VTYNL);
}
}
list = community_list_lookup (bgp_clist, argv[idx_comm_list]->arg, COMMUNITY_LIST_MASTER);
if (! list)
{
- vty_out (vty, "%% Can't find community-list%s", VTY_NEWLINE);
+ vty_out (vty, "%% Can't find community-list%s", VTYNL);
return CMD_WARNING;
}
cl_name = argv[idx]->arg;
if (reject_all_digit_name && all_digit (cl_name))
{
- vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE);
+ vty_out (vty, "%% Community name cannot have all digits%s", VTYNL);
return CMD_WARNING;
}
vty_out (vty, "Large community %s list %s%s",
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
"standard" : "(expanded) access",
- list->name, VTY_NEWLINE);
+ list->name, VTYNL);
else
vty_out (vty, "Named large community %s list %s%s",
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
"standard" : "expanded",
- list->name, VTY_NEWLINE);
+ list->name, VTYNL);
}
if (entry->any)
vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTY_NEWLINE);
+ community_direct_str (entry->direct), VTYNL);
else
vty_out (vty, " %s %s%s",
community_direct_str (entry->direct),
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
entry->u.ecom->str : entry->config,
- VTY_NEWLINE);
+ VTYNL);
}
}
list = community_list_lookup (bgp_clist, argv[3]->arg, LARGE_COMMUNITY_LIST_MASTER);
if (! list)
{
- vty_out (vty, "%% Can't find extcommunity-list%s", VTY_NEWLINE);
+ vty_out (vty, "%% Can't find extcommunity-list%s", VTYNL);
return CMD_WARNING;
}
vty_out (vty, "Extended community %s list %s%s",
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
"standard" : "(expanded) access",
- list->name, VTY_NEWLINE);
+ list->name, VTYNL);
else
vty_out (vty, "Named extended community %s list %s%s",
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
"standard" : "expanded",
- list->name, VTY_NEWLINE);
+ list->name, VTYNL);
}
if (entry->any)
vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTY_NEWLINE);
+ community_direct_str (entry->direct), VTYNL);
else
vty_out (vty, " %s %s%s",
community_direct_str (entry->direct),
entry->style == EXTCOMMUNITY_LIST_STANDARD ?
entry->u.ecom->str : entry->config,
- VTY_NEWLINE);
+ VTYNL);
}
}
list = community_list_lookup (bgp_clist, argv[idx_comm_list]->arg, EXTCOMMUNITY_LIST_MASTER);
if (! list)
{
- vty_out (vty, "%% Can't find extcommunity-list%s", VTY_NEWLINE);
+ vty_out (vty, "%% Can't find extcommunity-list%s", VTYNL);
return CMD_WARNING;
}
vty_out (vty, "ip community-list %s %s %s%s",
list->name, community_direct_str (entry->direct),
community_list_config_str (entry),
- VTY_NEWLINE);
+ VTYNL);
write++;
}
for (list = cm->str.head; list; list = list->next)
? "standard" : "expanded",
list->name, community_direct_str (entry->direct),
community_list_config_str (entry),
- VTY_NEWLINE);
+ VTYNL);
write++;
}
{
vty_out (vty, "ip extcommunity-list %s %s %s%s",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTY_NEWLINE);
+ community_list_config_str (entry), VTYNL);
write++;
}
for (list = cm->str.head; list; list = list->next)
entry->style == EXTCOMMUNITY_LIST_STANDARD
? "standard" : "expanded",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTY_NEWLINE);
+ community_list_config_str (entry), VTYNL);
write++;
}
{
vty_out (vty, "ip large-community-list %s %s %s%s",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTY_NEWLINE);
+ community_list_config_str (entry), VTYNL);
write++;
}
for (list = cm->str.head; list; list = list->next)
entry->style == LARGE_COMMUNITY_LIST_STANDARD
? "standard" : "expanded",
list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTY_NEWLINE);
+ community_list_config_str (entry), VTYNL);
write++;
}
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s distribute-list %s in%s",
- addr, filter->dlist[in].name, VTY_NEWLINE);
+ addr, filter->dlist[in].name, VTYNL);
}
if (filter->dlist[out].name && ! gfilter)
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s distribute-list %s out%s",
- addr, filter->dlist[out].name, VTY_NEWLINE);
+ addr, filter->dlist[out].name, VTYNL);
}
/* prefix-list. */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s prefix-list %s in%s",
- addr, filter->plist[in].name, VTY_NEWLINE);
+ addr, filter->plist[in].name, VTYNL);
}
if (filter->plist[out].name && ! gfilter)
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s prefix-list %s out%s",
- addr, filter->plist[out].name, VTY_NEWLINE);
+ addr, filter->plist[out].name, VTYNL);
}
/* route-map. */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s route-map %s in%s",
- addr, filter->map[RMAP_IN].name, VTY_NEWLINE);
+ addr, filter->map[RMAP_IN].name, VTYNL);
}
if (filter->map[RMAP_OUT].name)
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s route-map %s out%s",
- addr, filter->map[RMAP_OUT].name, VTY_NEWLINE);
+ addr, filter->map[RMAP_OUT].name, VTYNL);
}
/* unsuppress-map */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s unsuppress-map %s%s",
- addr, filter->usmap.name, VTY_NEWLINE);
+ addr, filter->usmap.name, VTYNL);
}
/* filter-list. */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s filter-list %s in%s",
- addr, filter->aslist[in].name, VTY_NEWLINE);
+ addr, filter->aslist[in].name, VTYNL);
}
if (filter->aslist[out].name && ! gfilter)
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s filter-list %s out%s",
- addr, filter->aslist[out].name, VTY_NEWLINE);
+ addr, filter->aslist[out].name, VTYNL);
}
}
{
afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s activate%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* If the peer-group is not active but peer is, print an 'activate' */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s activate%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
}
else
{
afi_header_vty_out(vty, afi, safi, write,
" neighbor %s activate%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
}
else
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s activate%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else
{
{
afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s activate%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
}
}
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s addpath-tx-all-paths%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS))
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s addpath-tx-bestpath-per-AS%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* ORF capability. */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s route-reflector-client%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* next-hop-self force */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s next-hop-self force%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* next-hop-self */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s next-hop-self%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* remove-private-AS */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s remove-private-AS all replace-AS%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE))
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s remove-private-AS replace-AS%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL))
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s remove-private-AS all%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS))
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s remove-private-AS%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* as-override */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s as-override%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* send-community print. */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s send-community all%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY))
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s send-community large%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY))
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s send-community extended%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY))
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s send-community%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
}
else
{
afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s send-community all%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else
{
{
afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s send-community large%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
if (!peer_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY) &&
{
afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s send-community extended%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
if (!peer_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY) &&
{
afi_header_vty_out (vty, afi, safi, write,
" no neighbor %s send-community%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
}
}
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s soft-reconfiguration inbound%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* maximum-prefix. */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s route-server-client%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* Nexthop-local unchanged. */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s nexthop-local unchanged%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
/* allowas-in <1-10> */
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s allowas-in%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s allowas-in %d%s",
- addr, peer->allowas_in[afi][safi], VTY_NEWLINE);
+ addr, peer->allowas_in[afi][safi], VTYNL);
}
}
}
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s allowas-in origin%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
}
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s weight %lu%s",
- addr, peer->weight[afi][safi], VTY_NEWLINE);
+ addr, peer->weight[afi][safi], VTYNL);
}
}
{
afi_header_vty_out (vty, afi, safi, write,
" neighbor %s attribute-unchanged%s",
- addr, VTY_NEWLINE);
+ addr, VTYNL);
}
else
{
peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED) ?
" next-hop" : "",
peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_MED_UNCHANGED) ?
- " med" : "", VTY_NEWLINE);
+ " med" : "", VTYNL);
}
}
}
if (*write)
return;
- vty_outln (vty, " !%s address-family ", VTY_NEWLINE);
+ vty_outln (vty, " !%s address-family ", VTYNL);
if (afi == AFI_IP)
{
if (!rfg)
{
/* Error out of memory */
- vty_out (vty, "Can't allocate memory for NVE group%s", VTY_NEWLINE);
+ vty_out (vty, "Can't allocate memory for NVE group%s", VTYNL);
return CMD_WARNING;
}
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_out (vty, "No BGP process is configured%s", VTYNL);
return CMD_WARNING;
}
if (!rfg)
{
/* Error out of memory */
- vty_out (vty, "Can't allocate memory for NVE group%s", VTY_NEWLINE);
+ vty_out (vty, "Can't allocate memory for NVE group%s", VTYNL);
return CMD_WARNING;
}
}
if (!str2prefix (argv[1]->arg, &p) && p.family)
{
- //vty_out (vty, "Nexthop set to self%s", VTY_NEWLINE);
+ //vty_out (vty, "Nexthop set to self%s", VTYNL);
SET_FLAG (rfg->flags, RFAPI_RFG_VPN_NH_SELF);
memset(&rfg->vn_prefix, 0, sizeof(struct prefix));
}
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_out (vty, "No BGP process is configured%s", VTYNL);
return CMD_WARNING;
}
if (!rfg)
{
/* Error out of memory */
- vty_out (vty, "Can't allocate memory for L2 group%s", VTY_NEWLINE);
+ vty_out (vty, "Can't allocate memory for L2 group%s", VTYNL);
return CMD_WARNING;
}
rfg->name = strdup (argv[1]->arg);
inet_ntop(rfg->vn_prefix.family, &rfg->vn_prefix.u.prefix, buf, sizeof(buf));
if (!buf[0] || buf[BUFSIZ - 1])
{
- //vty_out (vty, "nexthop self%s", VTY_NEWLINE);
+ //vty_out (vty, "nexthop self%s", VTYNL);
}
else
{
fp (out, "Nexthops Callback, Target=(");
//rfapiPrintRfapiIpAddr(stream, target);
- fp (out, ")%s", VTY_NEWLINE);
+ fp (out, ")%s", VTYNL);
rfapiPrintNhl (stream, next_hops);
if (first_l2)
{
vty_outln (vty, "%sLNI-based Ethernet Tables:",
- VTY_NEWLINE);
+ VTYNL);
first_l2 = 0;
}
snprintf (buf, BUFSIZ, "L2VPN LNI=%u", lni);
fp (out, "%-24s ", "Responses: (Prefixes)");
fp (out, "%-8s %-8u ", "Active:", bgp->rfapi->rib_prefix_count_total);
fp (out, "%-8s %-8u", "Maximum:", bgp->rfapi->rib_prefix_count_total_max);
- fp (out, "%s", VTY_NEWLINE);
+ fp (out, "%s", VTYNL);
fp (out, "%-24s ", " (Updated)");
fp (out, "%-8s %-8u ", "Update:",
fp (out, "%-8s %-8u", "Total:",
bgp->rfapi->stat.count_updated_response_updates +
bgp->rfapi->stat.count_updated_response_deletes);
- fp (out, "%s", VTY_NEWLINE);
+ fp (out, "%s", VTYNL);
fp (out, "%-24s ", " (NVEs)");
for (ALL_LIST_ELEMENTS_RO (&bgp->rfapi->descriptors, node, rfd))
}
fp (out, "%-8s %-8u ", "Active:", nves_with_nonempty_ribs);
fp (out, "%-8s %-8u", "Total:", nves);
- fp (out, "%s", VTY_NEWLINE);
+ fp (out, "%s", VTYNL);
}
fp (out, " %c %-20s %-15s %-15s %-4u %-8s %-8s%s%s",
deleted ? 'r' : ' ',
*printedprefix ? "" : str_pfx,
- str_vn, str_un, ri->cost, str_lifetime, str_age, str_rd, VTY_NEWLINE);
+ str_vn, str_un, ri->cost, str_lifetime, str_age, str_rd, VTYNL);
if (!*printedprefix)
*printedprefix = 1;
++printedheader;
fp (out, "%s[%s]%s",
- VTY_NEWLINE,
- show_removed ? "Removed" : "Active", VTY_NEWLINE);
+ VTYNL,
+ show_removed ? "Removed" : "Active", VTYNL);
fp (out, "%-15s %-15s%s", "Querying VN", "Querying UN",
- VTY_NEWLINE);
+ VTYNL);
fp (out, " %-20s %-15s %-15s %4s %-8s %-8s%s",
"Prefix", "Registered VN", "Registered UN", "Cost",
"Lifetime",
#else
"Remaining",
#endif
- VTY_NEWLINE);
+ VTYNL);
}
if (!printednve)
{
fp (out, "%-15s %-15s%s",
rfapiRfapiIpAddr2Str (&rfd->vn_addr, str_vn, BUFSIZ),
rfapiRfapiIpAddr2Str (&rfd->un_addr, str_un, BUFSIZ),
- VTY_NEWLINE);
+ VTYNL);
}
prefix2str (&rn->p, str_pfx, BUFSIZ);
- //fp(out, " %s%s", buf, VTY_NEWLINE); /* prefix */
+ //fp(out, " %s%s", buf, VTYNL); /* prefix */
routes_displayed++;
nhs_displayed += print_rib_sl (fp, vty, out, sl,
if (routes_total)
{
- fp (out, "%s", VTY_NEWLINE);
+ fp (out, "%s", VTYNL);
fp (out, "Displayed %u NVEs, and %u out of %u %s prefixes",
nves_displayed, routes_displayed,
routes_total, show_removed ? "removed" : "active");
if (nhs_displayed != routes_displayed || nhs_total != routes_total)
fp (out, " with %u out of %u next hops", nhs_displayed, nhs_total);
- fp (out, "%s", VTY_NEWLINE);
+ fp (out, "%s", VTYNL);
}
}
/* Fake out for debug logging */
static struct vty vty_dummy_zlog;
static struct vty vty_dummy_stdio;
-#define HVTY_NEWLINE ((vty == &vty_dummy_zlog)? "": VTY_NEWLINE)
+#define HVTYNL ((vty == &vty_dummy_zlog)? "": VTYNL)
static const char *
str_vty_newline (struct vty *vty)
{
if (vty == &vty_dummy_zlog)
return "";
- return VTY_NEWLINE;
+ return VTYNL;
}
int
if (!stream)
{
- vty_dummy_zlog.type = VTY_SHELL; /* for VTY_NEWLINE */
+ vty_dummy_zlog.type = VTY_SHELL; /* for VTYNL */
*vty = &vty_dummy_zlog;
*fp = (int (*)(void *, const char *,...)) rfapiDebugPrintf;
*outstream = NULL;
((uintptr_t) stream == (uintptr_t) 2))
{
- vty_dummy_stdio.type = VTY_SHELL; /* for VTY_NEWLINE */
+ vty_dummy_stdio.type = VTY_SHELL; /* for VTYNL */
*vty = &vty_dummy_stdio;
*fp = (int (*)(void *, const char *,...)) rfapiStdioPrintf;
*outstream = stream;
if (stream)
{
- *vty = stream; /* VTY_NEWLINE requires vty to be legit */
+ *vty = stream; /* VTYNL requires vty to be legit */
*fp = (int (*)(void *, const char *,...)) vty_out;
*outstream = stream;
*vty_newline = str_vty_newline (*vty);
vty_out (vty, " type=%s, subtype=%d",
zebra_route_string (bi->type), bi->sub_type);
- vty_out (vty, "%s", HVTY_NEWLINE);
+ vty_out (vty, "%s", HVTYNL);
}
void
if (rfapiStream2Vty (stream, &fp, &vty, &out, &vty_newline) == 0)
return;
- fp (out, "Attr[%p]:%s", attr, HVTY_NEWLINE);
+ fp (out, "Attr[%p]:%s", attr, HVTYNL);
if (!attr)
return;
/* IPv4 Nexthop */
inet_ntop (AF_INET, &attr->nexthop, buf, BUFSIZ);
- fp (out, " nexthop=%s%s", buf, HVTY_NEWLINE);
+ fp (out, " nexthop=%s%s", buf, HVTYNL);
fp (out, " aspath=%p, refcnt=%d%s", attr->aspath,
- (attr->aspath ? attr->aspath->refcnt : 0), HVTY_NEWLINE);
+ (attr->aspath ? attr->aspath->refcnt : 0), HVTYNL);
fp (out, " community=%p, refcnt=%d%s", attr->community,
- (attr->community ? attr->community->refcnt : 0), HVTY_NEWLINE);
+ (attr->community ? attr->community->refcnt : 0), HVTYNL);
if ((ae = attr->extra))
{
fp (out, " ecommunity=%p, refcnt=%d%s", ae->ecommunity,
- (ae->ecommunity ? ae->ecommunity->refcnt : 0), HVTY_NEWLINE);
+ (ae->ecommunity ? ae->ecommunity->refcnt : 0), HVTYNL);
fp (out, " cluster=%p, refcnt=%d%s", ae->cluster,
- (ae->cluster ? ae->cluster->refcnt : 0), HVTY_NEWLINE);
+ (ae->cluster ? ae->cluster->refcnt : 0), HVTYNL);
fp (out, " transit=%p, refcnt=%d%s", ae->transit,
- (ae->transit ? ae->transit->refcnt : 0), HVTY_NEWLINE);
+ (ae->transit ? ae->transit->refcnt : 0), HVTYNL);
}
}
snprintf (p, REMAIN, " %c:%u", zebra_route_char (bi->type), bi->sub_type);
INCP;
- fp (out, "%s%s", line, HVTY_NEWLINE);
+ fp (out, "%s%s", line, HVTYNL);
if (has_macaddr)
{
macaddr.octet[0],
macaddr.octet[1],
macaddr.octet[2],
- macaddr.octet[3], macaddr.octet[4], macaddr.octet[5], HVTY_NEWLINE);
+ macaddr.octet[3], macaddr.octet[4], macaddr.octet[5], HVTYNL);
}
if (!rfapiGetL2o (bi->attr, &l2o_buf))
l2o_buf.macaddr.octet[0], l2o_buf.macaddr.octet[1],
l2o_buf.macaddr.octet[2], l2o_buf.macaddr.octet[3],
l2o_buf.macaddr.octet[4], l2o_buf.macaddr.octet[5], l2o_buf.label,
- l2o_buf.logical_net_id, l2o_buf.local_nve_id, HVTY_NEWLINE);
+ l2o_buf.logical_net_id, l2o_buf.local_nve_id, HVTYNL);
}
if (bi->extra && bi->extra->vnc.import.aux_prefix.family)
{
buf[BUFSIZ - 1] = 0;
if (sp)
{
- fp (out, " IP: %s%s", sp, HVTY_NEWLINE);
+ fp (out, " IP: %s%s", sp, HVTYNL);
}
}
{
return;
rfapiMonitorVpn2Str (m, buf, BUFSIZ);
- fp (out, " Mon %s%s", buf, HVTY_NEWLINE);
+ fp (out, " Mon %s%s", buf, HVTYNL);
}
static void
return;
fp (out, " Mon m=%p, next=%p, node=%p, bi=%p%s",
- m, m->next, m->node, m->bi, HVTY_NEWLINE);
+ m, m->next, m->node, m->bi, HVTYNL);
}
void
fp (out, "%s/%d @%p #%d%s",
rfapi_ntop (rn->p.family, &rn->p.u.prefix, buf, BUFSIZ),
- rn->p.prefixlen, rn, rn->lock, HVTY_NEWLINE);
+ rn->p.prefixlen, rn, rn->lock, HVTYNL);
for (bi = rn->info; bi; bi = bi->next)
{
if (rfapiStream2Vty (stream, &fp, &vty, &out, &vty_newline) == 0)
return;
- fp (out, "Import Table [%s]%s", label, HVTY_NEWLINE);
+ fp (out, "Import Table [%s]%s", label, HVTYNL);
for (rn = route_top (rt); rn; rn = route_next (rn))
{
}
fp (out, "%s/%d @%p #%d%s", buf, rn->p.prefixlen, rn, rn->lock - 1, /* account for loop iterator locking */
- HVTY_NEWLINE);
+ HVTYNL);
for (bi = rn->info; bi; bi = bi->next)
{
if (!printedheader)
{
++printedheader;
- fp (out, "%s", VTY_NEWLINE);
+ fp (out, "%s", VTYNL);
fp (out, "%-15s %-15s %-15s %-10s%s",
"VN Address", "UN Address",
- "Target", "Remaining", VTY_NEWLINE);
+ "Target", "Remaining", VTYNL);
}
if (!printedquerier)
}
fp (out, " %-15s %-10s%s",
inet_ntop (m->p.family, &m->p.u.prefix, buf_pfx, BUFSIZ),
- buf_remain, VTY_NEWLINE);
+ buf_remain, VTYNL);
}
}
if (!printedheader)
{
++printedheader;
- fp (out, "%s", VTY_NEWLINE);
+ fp (out, "%s", VTYNL);
fp (out, "%-15s %-15s %-17s %10s %-10s%s",
"VN Address", "UN Address",
- "Target", "LNI", "Remaining", VTY_NEWLINE);
+ "Target", "LNI", "Remaining", VTYNL);
}
if (!printedquerier)
fp (out, " %-17s %10d %-10s%s",
rfapi_ntop (pfx_mac.family, &pfx_mac.u.prefix, buf_pfx,
BUFSIZ), mon_eth->logical_net_id, buf_remain,
- VTY_NEWLINE);
+ VTYNL);
}
}
}
if (queries_total)
{
- fp (out, "%s", VTY_NEWLINE);
+ fp (out, "%s", VTYNL);
fp (out, "Displayed %d out of %d total queries%s",
- queries_displayed, queries_total, VTY_NEWLINE);
+ queries_displayed, queries_total, VTYNL);
}
return CMD_SUCCESS;
}
}
fp (out, "%-10s ", buf_age);
}
- fp (out, "%s", HVTY_NEWLINE);
+ fp (out, "%s", HVTYNL);
if (rn->p.family == AF_ETHERNET)
{
}
}
if (nlines > 1)
- fp (out, "%s", HVTY_NEWLINE);
+ fp (out, "%s", HVTYNL);
return 1;
}
if (pLni)
{
fp (out, "%s[%s] L2VPN Network 0x%x (%u) RT={%s}",
- HVTY_NEWLINE, type, *pLni, (*pLni & 0xfff), s);
+ HVTYNL, type, *pLni, (*pLni & 0xfff), s);
}
else
{
fp (out, "%s[%s] Prefix RT={%s}",
- HVTY_NEWLINE, type, s);
+ HVTYNL, type, s);
}
XFREE (MTYPE_ECOMMUNITY_STR, s);
"VRF" : "NVE group"),
it->rfg->name);
}
- fp (out, "%s", HVTY_NEWLINE);
+ fp (out, "%s", HVTYNL);
if (show_expiring)
{
#if RFAPI_REGISTRATIONS_REPORT_AGE
fp (out, "%-20s %-15s %-15s %4s %-10s %-10s%s",
(pLni ? "L2 Address/IP" : "Prefix"),
"VN Address", "UN Address", "Cost",
- "Lifetime", agetype, HVTY_NEWLINE);
+ "Lifetime", agetype, HVTYNL);
}
printed += rfapiPrintRemoteRegBi (bgp, stream, rn, bi);
}
}
fp (out, "Displayed %d out of %d %s%s",
- printed, total, type, HVTY_NEWLINE);
+ printed, total, type, HVTYNL);
#if DEBUG_SHOW_EXTRA
- fp(out, "IT table above: it=%p%s", it, HVTY_NEWLINE);
+ fp(out, "IT table above: it=%p%s", it, HVTYNL);
#endif
}
return printed;
}
bn = bgp_afi_node_get (bgp->rib[afi][safi], afi, safi, p, prd);
- vty_out (vty, " bn=%p%s", bn, HVTY_NEWLINE);
+ vty_out (vty, " bn=%p%s", bn, HVTYNL);
for (bi = bn->info; bi; bi = bi->next)
{
if (!printed)
{
- vty_out (vty, " --?--%s", HVTY_NEWLINE);
+ vty_out (vty, " --?--%s", HVTYNL);
return;
}
rfapiPrintRd (vty, &rfd->rd);
vty_out (vty, " %d", rfd->response_lifetime);
vty_out (vty, " %s", (rfd->rfg ? rfd->rfg->name : "<orphaned>"));
- vty_out (vty, "%s", HVTY_NEWLINE);
+ vty_out (vty, "%s", HVTYNL);
- vty_out (vty, " Peer %p #%d%s", rfd->peer, rfd->peer->lock, HVTY_NEWLINE);
+ vty_out (vty, " Peer %p #%d%s", rfd->peer, rfd->peer->lock, HVTYNL);
/* export RT list */
if (rfd->rt_export_list)
s =
ecommunity_ecom2str (rfd->rt_export_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
- vty_out (vty, " Export %s%s", s, HVTY_NEWLINE);
+ vty_out (vty, " Export %s%s", s, HVTYNL);
XFREE (MTYPE_ECOMMUNITY_STR, s);
}
else
{
- vty_out (vty, " Export (nil)%s", HVTY_NEWLINE);
+ vty_out (vty, " Export (nil)%s", HVTYNL);
}
/* import RT list */
{
s = ecommunity_ecom2str (rfd->import_table->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
- vty_out (vty, " Import %s%s", s, HVTY_NEWLINE);
+ vty_out (vty, " Import %s%s", s, HVTYNL);
XFREE (MTYPE_ECOMMUNITY_STR, s);
}
else
{
- vty_out (vty, " Import (nil)%s", HVTY_NEWLINE);
+ vty_out (vty, " Import (nil)%s", HVTYNL);
}
for (afi = AFI_IP; afi < AFI_MAX; ++afi)
prefix2str (&adb->u.s.prefix_ip, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */
- vty_out (vty, " Adv Pfx: %s%s", buf, HVTY_NEWLINE);
+ vty_out (vty, " Adv Pfx: %s%s", buf, HVTYNL);
rfapiPrintAdvertisedInfo (vty, rfd, SAFI_MPLS_VPN, &adb->u.s.prefix_ip);
}
}
prefix2str (&adb->u.s.prefix_eth, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */
- vty_out (vty, " Adv Pfx: %s%s", buf, HVTY_NEWLINE);
+ vty_out (vty, " Adv Pfx: %s%s", buf, HVTYNL);
/* TBD update the following function to print ethernet info */
/* Also need to pass/use rd */
rfapiPrintAdvertisedInfo (vty, rfd, SAFI_MPLS_VPN, &adb->u.s.prefix_ip);
}
- vty_out (vty, "%s", HVTY_NEWLINE);
+ vty_out (vty, "%s", HVTYNL);
}
/*
vty_out (vty,
"%s %s %s %s %s %s %s %s%s",
"descriptor", "un-addr", "vn-addr", "callback", "cookie",
- "RD", "lifetime", "group", HVTY_NEWLINE);
+ "RD", "lifetime", "group", HVTYNL);
}
rfapiPrintDescriptor (vty, rfd);
printed = 1;
{
if (!str2prefix (str, p))
{
- vty_out (vty, "Malformed address \"%s\"%s", str, HVTY_NEWLINE);
+ vty_out (vty, "Malformed address \"%s\"%s", str, HVTYNL);
return CMD_WARNING;
}
switch (p->family)
case AF_INET:
if (p->prefixlen != 32)
{
- vty_out (vty, "Not a host address: \"%s\"%s", str, HVTY_NEWLINE);
+ vty_out (vty, "Not a host address: \"%s\"%s", str, HVTYNL);
return CMD_WARNING;
}
break;
case AF_INET6:
if (p->prefixlen != 128)
{
- vty_out (vty, "Not a host address: \"%s\"%s", str, HVTY_NEWLINE);
+ vty_out (vty, "Not a host address: \"%s\"%s", str, HVTYNL);
return CMD_WARNING;
}
break;
default:
- vty_out (vty, "Invalid address \"%s\"%s", str, HVTY_NEWLINE);
+ vty_out (vty, "Invalid address \"%s\"%s", str, HVTYNL);
return CMD_WARNING;
}
return 0;
truncate:
line[BUFSIZ - 1] = 0;
- fp (out, "%s%s", line, HVTY_NEWLINE);
+ fp (out, "%s%s", line, HVTYNL);
/*
* options
fp (out, "%sL2 %s LBL=0x%06x NETID=0x%06x NVEID=%d%s",
offset, pbuf, (vo->v.l2addr.label & 0x00ffffff),
(vo->v.l2addr.logical_net_id & 0x00ffffff),
- vo->v.l2addr.local_nve_id, HVTY_NEWLINE);
+ vo->v.l2addr.local_nve_id, HVTYNL);
break;
case RFAPI_VN_OPTION_TYPE_LOCAL_NEXTHOP:
prefix2str (&vo->v.local_nexthop.addr, pbuf, sizeof (pbuf));
fp (out, "%sLNH %s cost=%d%s",
- offset, pbuf, vo->v.local_nexthop.cost, HVTY_NEWLINE);
+ offset, pbuf, vo->v.local_nexthop.cost, HVTYNL);
break;
default:
fp (out, "%svn option type %d (unknown)%s",
- offset, vo->type, HVTY_NEWLINE);
+ offset, vo->type, HVTYNL);
break;
}
}
static void
print_cleared_stats (struct rfapi_local_reg_delete_arg *cda)
{
- struct vty *vty = cda->vty; /* for benefit of VTY_NEWLINE */
+ struct vty *vty = cda->vty; /* for benefit of VTYNL */
/* Our special element-deleting function counts nves */
if (cda->nves)
{
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_NEWLINE,
- "EIGRP interfaces for AS(",eigrp->AS,")",VTY_NEWLINE,VTY_NEWLINE,
+ VTYNL,
+ "EIGRP interfaces for AS(",eigrp->AS,")",VTYNL,VTYNL,
"Interface", "Bandwidth", "Delay", "Peers", "Xmit Queue", "Mean",
"Pacing Time", "Multicast", "Pending", "Hello", "Holdtime",
- VTY_NEWLINE,"","Un/Reliable","SRTT","Un/Reliable","Flow Timer",
+ VTYNL,"","Un/Reliable","SRTT","Un/Reliable","Flow Timer",
"Routes");
}
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_NEWLINE,
- "EIGRP neighbors for AS(",eigrp->AS,")",VTY_NEWLINE,VTY_NEWLINE,
+ VTYNL,
+ "EIGRP neighbors for AS(",eigrp->AS,")",VTYNL,VTYNL,
"H", "Address", "Interface", "Hold", "Uptime",
- "SRTT", "RTO", "Q", "Seq", VTY_NEWLINE
+ "SRTT", "RTO", "Q", "Seq", VTYNL
,"","(sec)","","(ms)","","Cnt","Num");
}
router_id.s_addr = eigrp->router_id;
vty_outln (vty, "%sEIGRP Topology Table for AS(%d)/ID(%s)%s",
- VTY_NEWLINE, eigrp->AS, inet_ntoa(router_id), VTY_NEWLINE);
+ VTYNL, eigrp->AS, inet_ntoa(router_id), VTYNL);
vty_outln (vty, "Codes: P - Passive, A - Active, U - Update, Q - Query, "
"R - Reply%s r - reply Status, s - sia Status%s",
- VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL);
}
void
lookup_msg(eigrp_packet_type_str, i + 1, NULL),
IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : "");
if (IS_DEBUG_EIGRP_PACKET (i, RECV))
- vty_outln (vty, " EIGRP packet %s receive%s debugging is on%s",
+ vty_outln (vty, " EIGRP packet %s receive%s debugging is on",
lookup_msg(eigrp_packet_type_str, i + 1, NULL),
IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : "");
}
vty_out (vty, " %#.2x", v[i]);
if (rtn == 8)
{
- vty_out (vty, "%s [%.2x]", VTY_NEWLINE, i + 1);
+ vty_out (vty, "%s [%.2x]", VTYNL, i + 1);
rtn = 1;
}
else
show_vty_subtlv_res_bw (vty, &mtc->res_bw);
show_vty_subtlv_ava_bw (vty, &mtc->ava_bw);
show_vty_subtlv_use_bw (vty, &mtc->use_bw);
- vty_outln (vty, "---------------%s", VTY_NEWLINE);
+ vty_outln (vty, "---------------%s", VTYNL);
}
else
{
area->dynhostname);
vty_outln (vty, " %u LSPs%s",
- lsp_count, VTY_NEWLINE);
+ lsp_count, VTYNL);
}
}
}
vty_out(vty, "%-8s %-15s ", "Targeted", addr);
if (strlen(addr) > 15)
- vty_out(vty, "%s%46s", VTY_NEWLINE, " ");
+ vty_out(vty, "%s%46s", VTYNL, " ");
break;
}
vty_outln (vty, "%9u", adj->holdtime);
size_t buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen,
- " LSR Id: %s:0%s", inet_ntoa(adj->id), VTY_NEWLINE);
+ " LSR Id: %s:0%s", inet_ntoa(adj->id), VTYNL);
buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Source address: %s%s",
- log_addr(adj->af, &adj->src_addr), VTY_NEWLINE);
+ log_addr(adj->af, &adj->src_addr), VTYNL);
buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Transport address: %s%s",
- log_addr(adj->af, &adj->trans_addr), VTY_NEWLINE);
+ log_addr(adj->af, &adj->trans_addr), VTYNL);
buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Hello hold time: %u secs (due in %u secs)%s",
- adj->holdtime, adj->holdtime_remaining, VTY_NEWLINE);
+ adj->holdtime, adj->holdtime_remaining, VTYNL);
buflen = strlen(buffer);
snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Dual-stack capability TLV: %s%s",
- (adj->ds_tlv) ? "yes" : "no", VTY_NEWLINE);
+ (adj->ds_tlv) ? "yes" : "no", VTYNL);
}
static int
buflen = strlen(ifaces_buffer);
snprintf(ifaces_buffer + buflen, LDPBUFSIZ - buflen,
" %s: %s%s", iface->name, (iface->no_adj) ?
- "(no adjacencies)" : "", VTY_NEWLINE);
+ "(no adjacencies)" : "", VTYNL);
break;
case IMSG_CTL_SHOW_DISC_TNBR:
tnbr = imsg->data;
snprintf(tnbrs_buffer + buflen, LDPBUFSIZ - buflen,
" %s -> %s: %s%s", log_addr(tnbr->af, trans_addr),
log_addr(tnbr->af, &tnbr->addr), (tnbr->no_adj) ?
- "(no adjacencies)" : "", VTY_NEWLINE);
+ "(no adjacencies)" : "", VTYNL);
break;
case IMSG_CTL_SHOW_DISC_ADJ:
adj = imsg->data;
af_name(nbr->af), inet_ntoa(nbr->id),
nbr_state_name(nbr->nbr_state), addr);
if (strlen(addr) > 15)
- vty_out(vty, "%s%48s", VTY_NEWLINE, " ");
+ vty_out(vty, "%s%48s", VTYNL, " ");
vty_outln (vty, " %8s", log_time(nbr->uptime));
break;
case IMSG_CTL_END:
switch (adj->type) {
case HELLO_LINK:
snprintf(buffer + buflen, LDPBUFSIZ - buflen,
- " Interface: %s%s", adj->ifname, VTY_NEWLINE);
+ " Interface: %s%s", adj->ifname, VTYNL);
break;
case HELLO_TARGETED:
snprintf(buffer + buflen, LDPBUFSIZ - buflen,
" Targeted Hello: %s%s", log_addr(adj->af,
- &adj->src_addr), VTY_NEWLINE);
+ &adj->src_addr), VTYNL);
break;
}
}
" - Dynamic Announcement (0x0506)%s"
" - Typed Wildcard (0x050B)%s"
" - Unrecognized Notification (0x0603)",
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL, VTYNL);
vty_outln (vty, " Capabilities Received:");
if (nbr->flags & F_NBR_CAP_DYNAMIC)
vty_outln (vty," - Dynamic Announcement (0x0506)");
vty_out(vty, "%-4s %-20s", af_name(rt->af), dstnet);
if (strlen(dstnet) > 20)
- vty_out(vty, "%s%25s", VTY_NEWLINE, " ");
+ vty_out(vty, "%s%25s", VTYNL, " ");
vty_outln (vty, " %-15s %-11s %-13s %6s", inet_ntoa(rt->nexthop),
log_label(rt->local_label), log_label(rt->remote_label),
rt->in_use ? "yes" : "no");
upstream = 1;
buflen = strlen(sent_buffer);
snprintf(sent_buffer + buflen, LDPBUFSIZ - buflen,
- "%12s%s:0%s", "", inet_ntoa(rt->nexthop), VTY_NEWLINE);
+ "%12s%s:0%s", "", inet_ntoa(rt->nexthop), VTYNL);
break;
case IMSG_CTL_SHOW_LIB_RCVD:
downstream = 1;
snprintf(rcvd_buffer + buflen, LDPBUFSIZ - buflen,
"%12s%s:0, label %s%s%s", "", inet_ntoa(rt->nexthop),
log_label(rt->remote_label),
- rt->in_use ? " (in use)" : "", VTY_NEWLINE);
+ rt->in_use ? " (in use)" : "", VTYNL);
break;
case IMSG_CTL_SHOW_LIB_END:
if (upstream) {
"Supported LDP Capabilities%s"
" * Dynamic Announcement (0x0506)%s"
" * Typed Wildcard (0x050B)%s"
- " * Unrecognized Notification (0x0603)%s", VTY_NEWLINE,
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ " * Unrecognized Notification (0x0603)%s", VTYNL,
+ VTYNL, VTYNL, VTYNL);
return (0);
}
vty_outln (vty, "%s %s (%s).", FRR_FULL_NAME, FRR_VERSION,
host.name ? host.name : "");
vty_outln (vty, "%s%s", FRR_COPYRIGHT, GIT_INFO);
- vty_outln (vty, "configured with:%s %s", VTY_NEWLINE,
+ vty_outln (vty, "configured with:%s %s", VTYNL,
FRR_CONFIG_ARGS);
return CMD_SUCCESS;
argument.%s\
2. Partial help is provided when an abbreviated argument is entered%s\
and you want to know what arguments match the input%s\
- (e.g. 'show me?'.)%s", VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE,
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE,
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ (e.g. 'show me?'.)%s", VTYNL, VTYNL, VTYNL,
+ VTYNL, VTYNL, VTYNL, VTYNL, VTYNL,
+ VTYNL, VTYNL, VTYNL, VTYNL);
return CMD_SUCCESS;
}
if (vty->type == VTY_TERM)
{
- vty_outln (vty, "%sCurrent configuration:",VTY_NEWLINE);
+ vty_outln (vty, "%sCurrent configuration:",VTYNL);
vty_outln (vty, "!");
}
if (same)
{
vty_outln (vty, "'%s' AMBIGUOUS:", cur->cmd);
- vty_outln (vty, " %s%s '%s'", prev->el->name, VTY_NEWLINE,
+ vty_outln (vty, " %s%s '%s'", prev->el->name, VTYNL,
prev->el->string);
- vty_outln (vty, " %s%s '%s'", cur->el->name, VTY_NEWLINE,
+ vty_outln (vty, " %s%s '%s'", cur->el->name, VTYNL,
cur->el->string);
vty_outln (vty, "");
ambig++;
if (ifp == NULL)
{
- vty_out (vty, "%% Interface %s does not exist%s", ifname, VTY_NEWLINE);
+ vty_out (vty, "%% Interface %s does not exist%s", ifname, VTYNL);
return CMD_WARNING;
}
if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{
vty_out (vty, "%% Only inactive interfaces can be deleted%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (p->family == AF_INET)
vty_out (vty, "%s/%d%s", inet_ntoa (p->u.prefix4), p->prefixlen,
- VTY_NEWLINE);
+ VTYNL);
}
}
return CMD_SUCCESS;
if (!vrf->iflist || !listcount (vrf->iflist))
continue;
- vty_out (vty, "%sVRF %u%s%s", VTY_NEWLINE, vrf->vrf_id, VTY_NEWLINE,
- VTY_NEWLINE);
+ vty_out (vty, "%sVRF %u%s%s", VTYNL, vrf->vrf_id, VTYNL,
+ VTYNL);
for (ALL_LIST_ELEMENTS_RO (vrf->iflist, node, ifp))
{
if (p->family == AF_INET)
vty_out (vty, "%s/%d%s", inet_ntoa (p->u.prefix4), p->prefixlen,
- VTY_NEWLINE);
+ VTYNL);
}
}
}
vty_outln (vty, "%-12s %-25s %s%s",
"Module Name", "Version", "Description",
- VTY_NEWLINE);
+ VTYNL);
while (plug)
{
const struct frrmod_info *i = plug->info;
if (ns->name && strcmp (ns->name, pathname) != 0)
{
vty_out (vty, "NS %u is already configured with NETNS %s%s",
- ns->ns_id, ns->name, VTY_NEWLINE);
+ ns->ns_id, ns->name, VTYNL);
return CMD_WARNING;
}
if (!ns_enable (ns))
{
vty_out (vty, "Can not associate NS %u with NETNS %s%s",
- ns->ns_id, ns->name, VTY_NEWLINE);
+ ns->ns_id, ns->name, VTYNL);
return CMD_WARNING;
}
vty_outln (vty, "");
write++;
}
- /* vty_out (vty, "!%s", VTY_NEWLINE); */
+ /* vty_out (vty, "!%s", VTYNL); */
}
for (plist = master->str.head; plist; plist = plist->next)
push @lines, " \" > - selected route, * - FIB route%s%s\", \\\n";
my @nl = ();
for (my $c = 0; $c < @lines + 1; $c++) {
- push @nl, "VTY_NEWLINE"
+ push @nl, "VTYNL"
}
return join("", @lines) ." ". join(", ", @nl);
}
/* Description */
if (index->description)
- vty_outln (vty, " Description:%s %s", VTY_NEWLINE,
+ vty_outln (vty, " Description:%s %s", VTYNL,
index->description);
/* Match clauses */
ret = smux_str2oid (oid_str, oid, &oid_len);
if (ret != 0)
{
- vty_out (vty, "object ID malformed%s", VTY_NEWLINE);
+ vty_out (vty, "object ID malformed%s", VTYNL);
return CMD_WARNING;
}
{
vty_out (vty, "%% VRF name %s is invalid: length exceeds "
"%d characters%s",
- vrfname, VRF_NAMSIZ, VTY_NEWLINE);
+ vrfname, VRF_NAMSIZ, VTYNL);
return CMD_WARNING;
}
if (vrfp == NULL)
{
- vty_out (vty, "%% VRF %s does not exist%s", vrfname, VTY_NEWLINE);
+ vty_out (vty, "%% VRF %s does not exist%s", vrfname, VTYNL);
return CMD_WARNING;
}
if (CHECK_FLAG (vrfp->status, VRF_ACTIVE))
{
vty_out (vty, "%% Only inactive VRFs can be deleted%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
struct vrf *vrf; \
if (!(vrf = vrf_lookup_by_name(NAME))) \
{ \
- vty_out (vty, "%% VRF %s not found%s", NAME, VTY_NEWLINE);\
+ vty_out (vty, "%% VRF %s not found%s", NAME, VTYNL);\
return CMD_WARNING; \
} \
if (vrf->vrf_id == VRF_UNKNOWN) \
{ \
- vty_out (vty, "%% VRF %s not active%s", NAME, VTY_NEWLINE);\
+ vty_out (vty, "%% VRF %s not active%s", NAME, VTYNL);\
return CMD_WARNING; \
} \
(V) = vrf->vrf_id; \
len = vty_out_variadic (vty, format, args);
va_end (args);
- return len + vty_out (vty, "%s", VTY_NEWLINE);
+ return len + vty_out (vty, "%s", VTYNL);
}
static int
vty_redraw_line (vty);
break;
case CMD_ERR_NO_MATCH:
- /* vty_out (vty, "%% There is no matched command.%s", VTY_NEWLINE); */
+ /* vty_out (vty, "%% There is no matched command.%s", VTYNL); */
vty_prompt (vty);
vty_redraw_line (vty);
break;
#if 0
vty_out (vty, " %-*s %s%s", width
desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd,
- desc->str ? desc->str : "", VTY_NEWLINE);
+ desc->str ? desc->str : "", VTYNL);
#endif /* 0 */
}
/* Say hello to the world. */
vty_hello (vty);
if (! no_password_check)
- vty_outln (vty, "%sUser Access Verification%s", VTY_NEWLINE,
- VTY_NEWLINE);
+ vty_outln (vty, "%sUser Access Verification%s", VTYNL,
+ VTYNL);
/* Setting up terminal. */
vty_will_echo (vty);
/* Clear buffer*/
buffer_reset (vty->obuf);
- vty_outln (vty, "%sVty connection is timed out.", VTY_NEWLINE);
+ vty_outln (vty, "%sVty connection is timed out.", VTYNL);
/* Close connection. */
vty->status = VTY_CLOSE;
if ((v = vector_slot (vtyvec, i)) != NULL)
vty_out (vty, "%svty[%d] connected from %s.%s",
v->config ? "*" : " ",
- i, v->address, VTY_NEWLINE);
+ i, v->address, VTYNL);
return CMD_SUCCESS;
}
}
if (vty->hist[index] != NULL)
- vty_out (vty, " %s%s", vty->hist[index], VTY_NEWLINE);
+ vty_out (vty, " %s%s", vty->hist[index], VTYNL);
index++;
}
#define VTY_CHECK_CONTEXT(ptr) \
if (!ptr) { \
vty_out (vty, "Current configuration object was deleted " \
- "by another process.%s", VTY_NEWLINE); \
+ "by another process.%s", VTYNL); \
return CMD_WARNING; \
}
#define INTEGRATE_DEFAULT_CONFIG "frr.conf"
/* Small macro to determine newline is newline only or linefeed needed. */
-#define VTY_NEWLINE ((vty->type == VTY_TERM) ? "\r\n" : "\n")
+#define VTYNL ((vty->type == VTY_TERM) ? "\r\n" : "\n")
/* Default time out value */
#define VTY_TIMEOUT_DEFAULT 600
"Flags:%s%s%s"
"Protocol-Address: %s/%zu",
nhrp_cache_type_str[c->cur.type],
- VTY_NEWLINE,
+ VTYNL,
(c->cur.peer && c->cur.peer->online) ? " up": "",
c->used ? " used": "",
- VTY_NEWLINE,
+ VTYNL,
sockunion2str(&c->remote_addr, buf, sizeof buf),
8 * family2addrsize(sockunion_family(&c->remote_addr)));
} else if (argv[3]->text[0] == 's') {
nhrp_shortcut_foreach(ctx.afi, show_ip_nhrp_shortcut, &ctx);
} else {
- vty_outln (vty, "Status: ok%s", VTY_NEWLINE);
+ vty_outln (vty, "Status: ok%s", VTYNL);
ctx.count++;
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp))
nhrp_cache_foreach(ifp, show_ip_opennhrp_cache, &ctx);
#define OSPF6_ROUTER_ID_STR "Specify Router-ID\n"
#define OSPF6_LS_ID_STR "Specify Link State ID\n"
-#define VNL VTY_NEWLINE
+#define VNL VTYNL
#define OSPF6_CMD_CHECK_RUNNING() \
if (ospf6 == NULL) \
{ \
- vty_out (vty, "OSPFv3 is not running%s", VTY_NEWLINE); \
+ vty_out (vty, "OSPFv3 is not running%s", VTYNL); \
return CMD_SUCCESS; \
}
int i;
if (ospf->instance)
- vty_outln (vty, "%sOSPF Instance: %d%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE);
+ vty_outln (vty, "%sOSPF Instance: %d%s", VTYNL, ospf->instance,
+ VTYNL);
vty_outln (vty, "OSPF debugging status:");
show_vty_link_subtlv_ava_bw (vty, &lp->ava_bw.header);
if (TLV_TYPE(lp->use_bw) != 0)
show_vty_link_subtlv_use_bw (vty, &lp->use_bw.header);
- vty_outln (vty, "---------------%s", VTY_NEWLINE);
+ vty_outln (vty, "---------------%s", VTYNL);
}
else
{
*metric = strtol (str, NULL, 10);
if (*metric < 0 && *metric > 16777214)
{
- /* vty_out (vty, "OSPF metric value is invalid%s", VTY_NEWLINE); */
+ /* vty_out (vty, "OSPF metric value is invalid%s", VTYNL); */
return 0;
}
ospf = ospf_lookup();
if (!ospf)
{
- vty_out (vty, "There isn't active ospf instance %s", VTY_NEWLINE);
+ vty_out (vty, "There isn't active ospf instance %s", VTYNL);
return CMD_WARNING;
}
ret = inet_aton (argv[idx_ipv4]->arg, &router_id);
if (!ret)
{
- vty_out (vty, "Please specify Router ID by A.B.C.D%s", VTY_NEWLINE);
+ vty_out (vty, "Please specify Router ID by A.B.C.D%s", VTYNL);
return CMD_WARNING;
}
if (area->full_nbrs)
{
vty_out (vty, "For this router-id change to take effect,"
- " save config and restart ospfd%s", VTY_NEWLINE);
+ " save config and restart ospfd%s", VTYNL);
return CMD_SUCCESS;
}
ret = inet_aton (argv[idx_ipv4]->arg, &router_id);
if (!ret)
{
- vty_out (vty, "Please specify Router ID by A.B.C.D%s", VTY_NEWLINE);
+ vty_out (vty, "Please specify Router ID by A.B.C.D%s", VTYNL);
return CMD_WARNING;
}
if (area->full_nbrs)
{
vty_out (vty, "For this router-id change to take effect,"
- " save config and restart ospfd%s", VTY_NEWLINE);
+ " save config and restart ospfd%s", VTYNL);
return CMD_SUCCESS;
}
if (area->full_nbrs)
{
vty_out (vty, "For this router-id change to take effect,"
- " save config and restart ospfd%s", VTY_NEWLINE);
+ " save config and restart ospfd%s", VTYNL);
return CMD_SUCCESS;
}
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (ospf->instance)
{
vty_out (vty, "The network command is not supported in multi-instance ospf%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (ospf->if_ospf_cli_count > 0)
{
vty_out (vty, "Please remove all ip ospf area x.x.x.x commands first.%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
ret = ospf_network_set (ospf, &p, area_id, format);
if (ret == 0)
{
- vty_out (vty, "There is already same network statement.%s", VTY_NEWLINE);
+ vty_out (vty, "There is already same network statement.%s", VTYNL);
return CMD_WARNING;
}
if (ospf->instance)
{
vty_out (vty, "The network command is not supported in multi-instance ospf%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (ret == 0)
{
vty_out (vty, "Can't find specified network area configuration.%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
{
vty_out (vty,
"Configuring VLs over the backbone is not allowed%s",
- VTY_NEWLINE);
+ VTYNL);
return NULL;
}
area = ospf_area_get (ospf, area_id);
vty_out (vty, "Area %s is %s%s",
inet_ntoa (area_id),
area->external_routing == OSPF_AREA_NSSA?"nssa":"stub",
- VTY_NEWLINE);
+ VTYNL);
else
vty_out (vty, "Area %ld is %s%s",
(u_long)ntohl (area_id.s_addr),
area->external_routing == OSPF_AREA_NSSA?"nssa":"stub",
- VTY_NEWLINE);
+ VTYNL);
return NULL;
}
!= NULL)
{
vty_out (vty, "OSPF: Key %d already exists%s",
- vl_config->crypto_key_id, VTY_NEWLINE);
+ vl_config->crypto_key_id, VTYNL);
return CMD_WARNING;
}
ck = ospf_crypt_key_new ();
vl_config->crypto_key_id) == NULL)
{
vty_out (vty, "OSPF: Key %d does not exist%s",
- vl_config->crypto_key_id, VTY_NEWLINE);
+ vl_config->crypto_key_id, VTYNL);
return CMD_WARNING;
}
&vl_config.area_id_fmt);
if (ret < 0)
{
- vty_out (vty, "OSPF area ID is invalid%s", VTY_NEWLINE);
+ vty_out (vty, "OSPF area ID is invalid%s", VTYNL);
return CMD_WARNING;
}
if (! ret)
{
vty_out (vty, "Please specify valid Router ID as a.b.c.d%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
for (i=5; i < argc; i++)
{
- /* vty_out (vty, "argv[%d]->arg - %s%s", i, argv[i]->text, VTY_NEWLINE); */
+ /* vty_out (vty, "argv[%d]->arg - %s%s", i, argv[i]->text, VTYNL); */
switch (argv[i]->arg[0])
{
ret = str2area_id (argv[idx_ipv4_number]->arg, &vl_config.area_id, &format);
if (ret < 0)
{
- vty_out (vty, "OSPF area ID is invalid%s", VTY_NEWLINE);
+ vty_out (vty, "OSPF area ID is invalid%s", VTYNL);
return CMD_WARNING;
}
area = ospf_area_lookup_by_area_id (ospf, vl_config.area_id);
if (!area)
{
- vty_out (vty, "Area does not exist%s", VTY_NEWLINE);
+ vty_out (vty, "Area does not exist%s", VTYNL);
return CMD_WARNING;
}
if (! ret)
{
vty_out (vty, "Please specify valid Router ID as a.b.c.d%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
/* Deal with other parameters */
for (i=6; i < argc; i++)
{
- /* vty_out (vty, "argv[%d] - %s%s", i, argv[i], VTY_NEWLINE); */
+ /* vty_out (vty, "argv[%d] - %s%s", i, argv[i], VTYNL); */
switch (argv[i]->arg[0])
{
ret = str2area_id (area_id, &vl_config.area_id, &vl_config.area_id_fmt);
if (ret < 0)
{
- vty_out (vty, "OSPF area ID is invalid%s", VTY_NEWLINE);
+ vty_out (vty, "OSPF area ID is invalid%s", VTYNL);
return CMD_WARNING;
}
ret = inet_aton (router_id, &vl_config.vl_peer);
if (! ret)
{
- vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", VTY_NEWLINE);
+ vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", VTYNL);
return CMD_WARNING;
}
ret = str2area_id (area_id, &vl_config.area_id, &vl_config.area_id_fmt);
if (ret < 0)
{
- vty_out (vty, "OSPF area ID is invalid%s", VTY_NEWLINE);
+ vty_out (vty, "OSPF area ID is invalid%s", VTYNL);
return CMD_WARNING;
}
ret = inet_aton (router_id, &vl_config.vl_peer);
if (! ret)
{
- vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", VTY_NEWLINE);
+ vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", VTYNL);
return CMD_WARNING;
}
if (ospf->abr_type != OSPF_ABR_SHORTCUT)
vty_out (vty, "Shortcut area setting will take effect "
"only when the router is configured as Shortcut ABR%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_SUCCESS;
}
if (ret == 0)
{
vty_out (vty, "First deconfigure all virtual link through this area%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (ret == 0)
{
vty_out (vty, "%% Area cannot be stub as it contains a virtual link%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (ret == 0)
{
vty_out (vty, "%% Area cannot be nssa as it contains a virtual link%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (area->external_routing == OSPF_AREA_DEFAULT)
{
- vty_out (vty, "The area is neither stub, nor NSSA%s", VTY_NEWLINE);
+ vty_out (vty, "The area is neither stub, nor NSSA%s", VTYNL);
return CMD_WARNING;
}
if (area->external_routing == OSPF_AREA_DEFAULT)
{
- vty_out (vty, "The area is neither stub, nor NSSA%s", VTY_NEWLINE);
+ vty_out (vty, "The area is neither stub, nor NSSA%s", VTYNL);
return CMD_WARNING;
}
if (argc < 5)
{
- vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE);
+ vty_out (vty, "Insufficient arguments%s", VTYNL);
return CMD_WARNING;
}
if (argc < 4)
{
- vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE);
+ vty_out (vty, "Insufficient arguments%s", VTYNL);
return CMD_WARNING;
}
if (argc < 6)
{
- vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE);
+ vty_out (vty, "Insufficient arguments%s", VTYNL);
return CMD_WARNING;
}
if (argc < 4)
{
- vty_out (vty, "Insufficient number of arguments%s", VTY_NEWLINE);
+ vty_out (vty, "Insufficient number of arguments%s", VTYNL);
return CMD_WARNING;
}
refbw = strtol (argv[idx_number]->arg, NULL, 10);
if (refbw < 1 || refbw > 4294967)
{
- vty_out (vty, "reference-bandwidth value is invalid%s", VTY_NEWLINE);
+ vty_out (vty, "reference-bandwidth value is invalid%s", VTYNL);
return CMD_WARNING;
}
return CMD_SUCCESS;
ospf->ref_bandwidth = OSPF_DEFAULT_REF_BANDWIDTH;
- vty_out (vty, "%% OSPF: Reference bandwidth is changed.%s", VTY_NEWLINE);
- vty_out (vty, " Please ensure reference bandwidth is consistent across all routers%s", VTY_NEWLINE);
+ vty_out (vty, "%% OSPF: Reference bandwidth is changed.%s", VTYNL);
+ vty_out (vty, " Please ensure reference bandwidth is consistent across all routers%s", VTYNL);
for (ALL_LIST_ELEMENTS (om->iflist, node, nnode, ifp))
ospf_if_recalculate_output_cost (ifp);
write_oi_count = strtol (argv[idx_number]->arg, NULL, 10);
if (write_oi_count < 1 || write_oi_count > 100)
{
- vty_out (vty, "write-multiplier value is invalid%s", VTY_NEWLINE);
+ vty_out (vty, "write-multiplier value is invalid%s", VTYNL);
return CMD_WARNING;
}
if (use_json)
json_object_boolean_true_add(json_area, "backbone");
else
- vty_out (vty, " (Backbone)%s", VTY_NEWLINE);
+ vty_out (vty, " (Backbone)%s", VTYNL);
}
else
{
area->no_summary ? ", no summary" : "",
area->shortcut_configured ? "; " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
vty_out (vty, " Shortcutting mode: %s",
ospf_shortcut_mode_descr_str[area->shortcut_configured]);
vty_out (vty, ", S-bit consensus: %s%s",
- area->shortcut_capability ? "ok" : "no", VTY_NEWLINE);
+ area->shortcut_capability ? "ok" : "no", VTYNL);
}
}
else
vty_out (vty, " Number of interfaces in this area: Total: %d, "
"Active: %d%s", listcount (area->oiflist),
- area->act_ints, VTY_NEWLINE);
+ area->act_ints, VTYNL);
if (area->external_routing == OSPF_AREA_NSSA)
{
}
else
{
- vty_out (vty, " It is an NSSA configuration. %s Elected NSSA/ABR performs type-7/type-5 LSA translation. %s", VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, " It is an NSSA configuration. %s Elected NSSA/ABR performs type-7/type-5 LSA translation. %s", VTYNL, VTYNL);
if (! IS_OSPF_ABR (area->ospf))
vty_out (vty, " It is not ABR, therefore not Translator. %s",
- VTY_NEWLINE);
+ VTYNL);
else if (area->NSSATranslatorState)
{
vty_out (vty, " We are an ABR and ");
if (area->NSSATranslatorRole == OSPF_NSSA_ROLE_CANDIDATE)
vty_out (vty, "the NSSA Elected Translator. %s",
- VTY_NEWLINE);
+ VTYNL);
else if (area->NSSATranslatorRole == OSPF_NSSA_ROLE_ALWAYS)
vty_out (vty, "always an NSSA Translator. %s",
- VTY_NEWLINE);
+ VTYNL);
}
else
{
vty_out (vty, " We are an ABR, but ");
if (area->NSSATranslatorRole == OSPF_NSSA_ROLE_CANDIDATE)
vty_out (vty, "not the NSSA Elected Translator. %s",
- VTY_NEWLINE);
+ VTYNL);
else
vty_out (vty, "never an NSSA Translator. %s",
- VTY_NEWLINE);
+ VTYNL);
}
}
}
else
{
vty_out (vty, " Originating stub / maximum-distance Router-LSA%s",
- VTY_NEWLINE);
+ VTYNL);
if (CHECK_FLAG(area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED))
vty_out (vty, " Administratively activated (indefinitely)%s",
- VTY_NEWLINE);
+ VTYNL);
if (area->t_stub_router)
vty_out (vty, " Active from startup, %s remaining%s",
ospf_timer_dump (area->t_stub_router, timebuf,
- sizeof(timebuf)), VTY_NEWLINE);
+ sizeof(timebuf)), VTYNL);
}
}
{
/* Show number of fully adjacent neighbors. */
vty_out (vty, " Number of fully adjacent neighbors in this area:"
- " %d%s", area->full_nbrs, VTY_NEWLINE);
+ " %d%s", area->full_nbrs, VTYNL);
/* Show authentication type. */
vty_out (vty, " Area has ");
if (area->auth_type == OSPF_AUTH_NULL)
- vty_out (vty, "no authentication%s", VTY_NEWLINE);
+ vty_out (vty, "no authentication%s", VTYNL);
else if (area->auth_type == OSPF_AUTH_SIMPLE)
- vty_out (vty, "simple password authentication%s", VTY_NEWLINE);
+ vty_out (vty, "simple password authentication%s", VTYNL);
else if (area->auth_type == OSPF_AUTH_CRYPTOGRAPHIC)
- vty_out (vty, "message digest authentication%s", VTY_NEWLINE);
+ vty_out (vty, "message digest authentication%s", VTYNL);
if (!OSPF_IS_AREA_BACKBONE (area))
vty_out (vty, " Number of full virtual adjacencies going through"
- " this area: %d%s", area->full_vls, VTY_NEWLINE);
+ " this area: %d%s", area->full_vls, VTYNL);
/* Show SPF calculation times. */
vty_out (vty, " SPF algorithm executed %d times%s",
- area->spf_calculation, VTY_NEWLINE);
+ area->spf_calculation, VTYNL);
/* Show number of LSA. */
- vty_out (vty, " Number of LSA %ld%s", area->lsdb->total, VTY_NEWLINE);
+ vty_out (vty, " Number of LSA %ld%s", area->lsdb->total, VTYNL);
vty_out (vty, " Number of router LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (area->lsdb, OSPF_ROUTER_LSA),
- ospf_lsdb_checksum (area->lsdb, OSPF_ROUTER_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (area->lsdb, OSPF_ROUTER_LSA), VTYNL);
vty_out (vty, " Number of network LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (area->lsdb, OSPF_NETWORK_LSA),
- ospf_lsdb_checksum (area->lsdb, OSPF_NETWORK_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (area->lsdb, OSPF_NETWORK_LSA), VTYNL);
vty_out (vty, " Number of summary LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (area->lsdb, OSPF_SUMMARY_LSA),
- ospf_lsdb_checksum (area->lsdb, OSPF_SUMMARY_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (area->lsdb, OSPF_SUMMARY_LSA), VTYNL);
vty_out (vty, " Number of ASBR summary LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (area->lsdb, OSPF_ASBR_SUMMARY_LSA),
- ospf_lsdb_checksum (area->lsdb, OSPF_ASBR_SUMMARY_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (area->lsdb, OSPF_ASBR_SUMMARY_LSA), VTYNL);
vty_out (vty, " Number of NSSA LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (area->lsdb, OSPF_AS_NSSA_LSA),
- ospf_lsdb_checksum (area->lsdb, OSPF_AS_NSSA_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (area->lsdb, OSPF_AS_NSSA_LSA), VTYNL);
}
if (use_json)
{
vty_out (vty, " Number of opaque link LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (area->lsdb, OSPF_OPAQUE_LINK_LSA),
- ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_LINK_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_LINK_LSA), VTYNL);
vty_out (vty, " Number of opaque area LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (area->lsdb, OSPF_OPAQUE_AREA_LSA),
- ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_AREA_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_AREA_LSA), VTYNL);
}
if (use_json)
json_object_object_add(json_areas, inet_ntoa (area->area_id), json_area);
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
static int
}
else
{
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
}
{
vty_out (vty, " OSPF Routing Process, Router ID: %s%s",
inet_ntoa (ospf->router_id),
- VTY_NEWLINE);
+ VTYNL);
}
/* Graceful shutdown */
{
vty_out (vty, " Deferred shutdown in progress, %s remaining%s",
ospf_timer_dump (ospf->t_deferred_shutdown,
- timebuf, sizeof (timebuf)), VTY_NEWLINE);
+ timebuf, sizeof (timebuf)), VTYNL);
}
}
}
else
{
- vty_out (vty, " Supports only single TOS (TOS0) routes%s", VTY_NEWLINE);
- vty_out (vty, " This implementation conforms to RFC2328%s", VTY_NEWLINE);
+ vty_out (vty, " Supports only single TOS (TOS0) routes%s", VTYNL);
+ vty_out (vty, " This implementation conforms to RFC2328%s", VTYNL);
vty_out (vty, " RFC1583Compatibility flag is %s%s",
CHECK_FLAG (ospf->config, OSPF_RFC1583_COMPATIBLE) ?
- "enabled" : "disabled", VTY_NEWLINE);
+ "enabled" : "disabled", VTYNL);
}
if (use_json)
{
vty_out (vty, " OpaqueCapability flag is %s%s",
CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE) ? "enabled" : "disabled",
- VTY_NEWLINE);
+ VTYNL);
}
/* Show stub-router configuration */
else
{
vty_out (vty, " Stub router advertisement is configured%s",
- VTY_NEWLINE);
+ VTYNL);
if (ospf->stub_router_startup_time != OSPF_STUB_ROUTER_UNCONFIGURED)
vty_out (vty, " Enabled for %us after start-up%s",
- ospf->stub_router_startup_time, VTY_NEWLINE);
+ ospf->stub_router_startup_time, VTYNL);
if (ospf->stub_router_shutdown_time != OSPF_STUB_ROUTER_UNCONFIGURED)
vty_out (vty, " Enabled for %us prior to full shutdown%s",
- ospf->stub_router_shutdown_time, VTY_NEWLINE);
+ ospf->stub_router_shutdown_time, VTYNL);
}
}
" Minimum hold time between consecutive SPFs %d millisec(s)%s"
" Maximum hold time between consecutive SPFs %d millisec(s)%s"
" Hold time multiplier is currently %d%s",
- ospf->spf_delay, VTY_NEWLINE,
- ospf->spf_holdtime, VTY_NEWLINE,
- ospf->spf_max_holdtime, VTY_NEWLINE,
- ospf->spf_hold_multiplier, VTY_NEWLINE);
+ ospf->spf_delay, VTYNL,
+ ospf->spf_holdtime, VTYNL,
+ ospf->spf_max_holdtime, VTYNL,
+ ospf->spf_hold_multiplier, VTYNL);
}
if (use_json)
monotime_since(&ospf->ts_spf, &result);
vty_out (vty, "last executed %s ago%s",
ospf_timeval_dump (&result, timebuf, sizeof (timebuf)),
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, " Last SPF duration %s%s",
ospf_timeval_dump (&ospf->ts_spf_duration, timebuf, sizeof (timebuf)),
- VTY_NEWLINE);
+ VTYNL);
}
else
- vty_out (vty, "has not been run%s", VTY_NEWLINE);
+ vty_out (vty, "has not been run%s", VTYNL);
}
if (use_json)
vty_out (vty, " SPF timer %s%s%s",
(ospf->t_spf_calc ? "due in " : "is "),
ospf_timer_dump (ospf->t_spf_calc, timebuf, sizeof (timebuf)),
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, " LSA minimum interval %d msecs%s",
- ospf->min_ls_interval, VTY_NEWLINE);
+ ospf->min_ls_interval, VTYNL);
vty_out (vty, " LSA minimum arrival %d msecs%s",
- ospf->min_ls_arrival, VTY_NEWLINE);
+ ospf->min_ls_arrival, VTYNL);
/* Show write multiplier values */
vty_out (vty, " Write Multiplier set to %d %s",
- ospf->write_oi_count, VTY_NEWLINE);
+ ospf->write_oi_count, VTYNL);
/* Show refresh parameters. */
vty_out (vty, " Refresh timer %d secs%s",
- ospf->lsa_refresh_interval, VTY_NEWLINE);
+ ospf->lsa_refresh_interval, VTYNL);
}
/* Show ABR/ASBR flags. */
json_object_string_add(json, "abrType", ospf_abr_type_descr_str[ospf->abr_type]);
else
vty_out (vty, " This router is an ABR, ABR type is: %s%s",
- ospf_abr_type_descr_str[ospf->abr_type], VTY_NEWLINE);
+ ospf_abr_type_descr_str[ospf->abr_type], VTYNL);
}
if (CHECK_FLAG (ospf->flags, OSPF_FLAG_ASBR))
{
json_object_string_add(json, "asbrRouter", "injectingExternalRoutingInformation");
else
vty_out (vty, " This router is an ASBR "
- "(injecting external routing information)%s", VTY_NEWLINE);
+ "(injecting external routing information)%s", VTYNL);
}
/* Show Number of AS-external-LSAs. */
{
vty_out (vty, " Number of external LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (ospf->lsdb, OSPF_AS_EXTERNAL_LSA),
- ospf_lsdb_checksum (ospf->lsdb, OSPF_AS_EXTERNAL_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (ospf->lsdb, OSPF_AS_EXTERNAL_LSA), VTYNL);
}
if (use_json)
{
vty_out (vty, " Number of opaque AS LSA %ld. Checksum Sum 0x%08x%s",
ospf_lsdb_count (ospf->lsdb, OSPF_OPAQUE_AS_LSA),
- ospf_lsdb_checksum (ospf->lsdb, OSPF_OPAQUE_AS_LSA), VTY_NEWLINE);
+ ospf_lsdb_checksum (ospf->lsdb, OSPF_OPAQUE_AS_LSA), VTYNL);
}
/* Show number of areas attached. */
json_object_int_add(json, "attachedAreaCounter", listcount (ospf->areas));
else
vty_out (vty, " Number of areas attached to this router: %d%s",
- listcount (ospf->areas), VTY_NEWLINE);
+ listcount (ospf->areas), VTYNL);
if (CHECK_FLAG(ospf->config, OSPF_LOG_ADJACENCY_CHANGES))
{
if (use_json)
json_object_boolean_true_add(json, "adjacencyChangesLoggedAll");
else
- vty_out(vty, " All adjacency changes are logged%s",VTY_NEWLINE);
+ vty_out(vty, " All adjacency changes are logged%s",VTYNL);
}
else
{
if (use_json)
json_object_boolean_true_add(json, "adjacencyChangesLogged");
else
- vty_out(vty, " Adjacency changes are logged%s",VTY_NEWLINE);
+ vty_out(vty, " Adjacency changes are logged%s",VTYNL);
}
}
/* Show each area status. */
if (use_json)
{
json_object_object_add(json, "areas", json_areas);
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%s",VTY_NEWLINE);
+ vty_out (vty, "%s",VTYNL);
return CMD_SUCCESS;
}
}
else
{
- vty_out (vty, "%s is %s%s", ifp->name,
- ((is_up = if_is_operative(ifp)) ? "up" : "down"), VTY_NEWLINE);
- vty_out (vty, " ifindex %u, MTU %u bytes, BW %u Mbit %s%s",
- ifp->ifindex, ifp->mtu, bandwidth, if_flag_dump(ifp->flags),
- VTY_NEWLINE);
+ vty_outln (vty, "%s is %s", ifp->name,
+ ((is_up = if_is_operative(ifp)) ? "up" : "down"));
+ vty_outln (vty, " ifindex %u, MTU %u bytes, BW %u Mbit %s",
+ ifp->ifindex, ifp->mtu, bandwidth, if_flag_dump(ifp->flags))
}
/* Is interface OSPF enabled? */
{
if (ospf_oi_count(ifp) == 0)
{
- vty_out (vty, " OSPF not enabled on this interface%s", VTY_NEWLINE);
+ vty_out (vty, " OSPF not enabled on this interface%s", VTYNL);
return;
}
else if (!is_up)
{
vty_out (vty, " OSPF is enabled, but not running on this interface%s",
- VTY_NEWLINE);
+ VTYNL);
return;
}
}
}
else
{
- vty_out (vty, " Area %s%s", ospf_area_desc_string (oi->area),
- VTY_NEWLINE);
+ vty_outln (vty, " Area %s", ospf_area_desc_string (oi->area));
- vty_out (vty, " MTU mismatch detection:%s%s",
- OSPF_IF_PARAM(oi, mtu_ignore) ? "disabled" : "enabled", VTY_NEWLINE);
+ vty_outln (vty, " MTU mismatch detection: %s",
+ OSPF_IF_PARAM(oi, mtu_ignore) ? "disabled" : "enabled");
- vty_out (vty, " Router ID %s, Network Type %s, Cost: %d%s",
- inet_ntoa (ospf->router_id), ospf_network_type_str[oi->type],
- oi->output_cost, VTY_NEWLINE);
+ vty_outln (vty, " Router ID %s, Network Type %s, Cost: %d",
+ inet_ntoa (ospf->router_id), ospf_network_type_str[oi->type],
+ oi->output_cost);
- vty_out (vty, " Transmit Delay is %d sec, State %s, Priority %d%s",
- OSPF_IF_PARAM (oi,transmit_delay), lookup_msg(ospf_ism_state_msg, oi->state, NULL),
- PRIORITY (oi), VTY_NEWLINE);
+ vty_outln (vty, " Transmit Delay is %d sec, State %s, Priority %d",
+ OSPF_IF_PARAM (oi,transmit_delay), lookup_msg(ospf_ism_state_msg, oi->state, NULL),
+ PRIORITY (oi));
}
/* Show DR information. */
if (DR (oi).s_addr == 0)
{
if (!use_json)
- vty_out (vty, " No backup designated router on this network%s",
- VTY_NEWLINE);
+ vty_outln (vty, " No backup designated router on this network");
}
else
{
{
vty_out (vty, " Backup Designated Router (ID) %s,",
inet_ntoa (nbr->router_id));
- vty_out (vty, " Interface Address %s%s",
- inet_ntoa (nbr->address.u.prefix4), VTY_NEWLINE);
+ vty_outln (vty, " Interface Address %s",
+ inet_ntoa (nbr->address.u.prefix4));
}
}
}
json_object_int_add(json_interface_sub, "networkLsaSequence", ntohl (oi->params->network_lsa_seqnum));
else
vty_out (vty, " Saved Network-LSA sequence number 0x%x%s",
- ntohl (oi->params->network_lsa_seqnum), VTY_NEWLINE);
+ ntohl (oi->params->network_lsa_seqnum), VTYNL);
}
if (use_json)
}
else
vty_out (vty, " <None>");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
if (use_json)
OSPF_IF_PARAM (oi, v_wait),
OSPF_IF_PARAM (oi, v_wait),
OSPF_IF_PARAM (oi, retransmit_interval),
- VTY_NEWLINE);
+ VTYNL);
}
if (OSPF_IF_PASSIVE_STATUS (oi) == OSPF_IF_ACTIVE)
else
vty_out (vty, " Hello due in %s%s",
ospf_timer_dump (oi->t_hello, timebuf, sizeof(timebuf)),
- VTY_NEWLINE);
+ VTYNL);
}
else /* passive-interface is set */
{
if (use_json)
json_object_boolean_true_add(json_interface_sub, "timerPassiveIface");
else
- vty_out (vty, " No Hellos (Passive interface)%s", VTY_NEWLINE);
+ vty_out (vty, " No Hellos (Passive interface)%s", VTYNL);
}
if (use_json)
else
vty_out (vty, " Neighbor Count is %d, Adjacent neighbor count is %d%s",
ospf_nbr_count (oi, 0), ospf_nbr_count (oi, NSM_Full),
- VTY_NEWLINE);
+ VTYNL);
ospf_bfd_interface_show(vty, ifp, json_interface_sub, use_json);
}
}
if (use_json)
json_object_int_add(json, "ospfInstance", ospf->instance);
else
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
if (argc == iface_argv)
if (use_json)
json_object_boolean_true_add(json, "noSuchIface");
else
- vty_out (vty, "No such interface name%s", VTY_NEWLINE);
+ vty_out (vty, "No such interface name%s", VTYNL);
}
else
{
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
show_ip_ospf_neighbour_header (struct vty *vty)
{
vty_out (vty, "%s%-15s %3s %-15s %9s %-15s %-20s %5s %5s %5s%s",
- VTY_NEWLINE,
+ VTYNL,
"Neighbor ID", "Pri", "State", "Dead Time",
"Address", "Interface", "RXmtL", "RqstL", "DBsmL",
- VTY_NEWLINE);
+ VTYNL);
}
static void
vty_out (vty, "%-20s %5ld %5ld %5d%s",
IF_NAME (oi), ospf_ls_retransmit_count (nbr),
ospf_ls_request_count (nbr), ospf_db_summary_count (nbr),
- VTY_NEWLINE);
+ VTYNL);
}
}
}
if (use_json)
json_object_int_add(json, "ospfInstance", ospf->instance);
else
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi))
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
if (use_json)
json_object_int_add(json, "ospfInstance", ospf->instance);
else
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi))
"-", nbr_nbma->priority, "Down", "-");
vty_out (vty, "%-15s %-20s %5d %5d %5d%s",
inet_ntoa (nbr_nbma->addr), IF_NAME (oi),
- 0, 0, 0, VTY_NEWLINE);
+ 0, 0, 0, VTYNL);
}
}
}
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
if (use_json)
json_object_int_add(json, "ospfInstance", ospf->instance);
else
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
ifp = if_lookup_by_name (argv[arg_base]->arg, VRF_DEFAULT);
if (use_json)
json_object_boolean_true_add(json, "noSuchIface");
else
- vty_out (vty, "No such interface.%s", VTY_NEWLINE);
+ vty_out (vty, "No such interface.%s", VTYNL);
return CMD_WARNING;
}
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
json_object_string_add(json_sub, "ifaceAddress", inet_ntoa (nbr_nbma->addr));
else
vty_out (vty, " interface address %s%s",
- inet_ntoa (nbr_nbma->addr), VTY_NEWLINE);
+ inet_ntoa (nbr_nbma->addr), VTYNL);
/* Show Area ID. */
if (use_json)
}
else
vty_out (vty, " In the area %s via interface %s%s",
- ospf_area_desc_string (oi->area), IF_NAME (oi), VTY_NEWLINE);
+ ospf_area_desc_string (oi->area), IF_NAME (oi), VTYNL);
/* Show neighbor priority and state. */
if (use_json)
if (use_json)
json_object_int_add(json_sub, "stateChangeCounter", nbr_nbma->state_change);
else
- vty_out (vty, " %d state changes%s", nbr_nbma->state_change, VTY_NEWLINE);
+ vty_out (vty, " %d state changes%s", nbr_nbma->state_change, VTYNL);
/* Show PollInterval */
if (use_json)
json_object_int_add(json_sub, "pollInterval", nbr_nbma->v_poll);
else
- vty_out (vty, " Poll interval %d%s", nbr_nbma->v_poll, VTY_NEWLINE);
+ vty_out (vty, " Poll interval %d%s", nbr_nbma->v_poll, VTYNL);
/* Show poll-interval timer. */
if (use_json)
else
vty_out (vty, " Poll timer due in %s%s",
ospf_timer_dump (nbr_nbma->t_poll, timebuf, sizeof(timebuf)),
- VTY_NEWLINE);
+ VTYNL);
/* Show poll-interval timer thread. */
if (use_json)
}
else
vty_out (vty, " Thread Poll Timer %s%s",
- nbr_nbma->t_poll != NULL ? "on" : "off", VTY_NEWLINE);
+ nbr_nbma->t_poll != NULL ? "on" : "off", VTYNL);
if (use_json)
json_object_object_add(json, "noNbrId", json_sub);
json_object_string_add(json_sub, "ifaceAddress", inet_ntoa (nbr->address.u.prefix4));
else
vty_out (vty, " interface address %s%s",
- inet_ntoa (nbr->address.u.prefix4), VTY_NEWLINE);
+ inet_ntoa (nbr->address.u.prefix4), VTYNL);
/* Show Area ID. */
if (use_json)
}
else
vty_out (vty, " In the area %s via interface %s%s",
- ospf_area_desc_string (oi->area), oi->ifp->name, VTY_NEWLINE);
+ ospf_area_desc_string (oi->area), oi->ifp->name, VTYNL);
/* Show neighbor priority and state. */
if (use_json)
if (use_json)
json_object_int_add(json_sub, "stateChangeCounter", nbr->state_change);
else
- vty_out (vty, " %d state changes%s", nbr->state_change, VTY_NEWLINE);
+ vty_out (vty, " %d state changes%s", nbr->state_change, VTYNL);
if (nbr->ts_last_progress.tv_sec || nbr->ts_last_progress.tv_usec)
{
else
{
vty_out (vty, " Most recent state change statistics:%s",
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, " Progressive change %s ago%s",
ospf_timeval_dump (&res, timebuf, sizeof(timebuf)),
- VTY_NEWLINE);
+ VTYNL);
}
}
vty_out (vty, " Regressive change %s ago, due to %s%s",
ospf_timeval_dump (&res, timebuf, sizeof(timebuf)),
(nbr->last_regress_str ? nbr->last_regress_str : "??"),
- VTY_NEWLINE);
+ VTYNL);
}
}
if (use_json)
json_object_string_add(json_sub, "routerDesignatedBackupId", inet_ntoa (nbr->bd_router));
else
- vty_out (vty, " BDR is %s%s", inet_ntoa (nbr->bd_router), VTY_NEWLINE);
+ vty_out (vty, " BDR is %s%s", inet_ntoa (nbr->bd_router), VTYNL);
/* Show options. */
if (use_json)
}
else
vty_out (vty, " Options %d %s%s", nbr->options,
- ospf_options_dump (nbr->options), VTY_NEWLINE);
+ ospf_options_dump (nbr->options), VTYNL);
/* Show Router Dead interval timer. */
if (use_json)
else
vty_out (vty, " Dead timer due in %s%s",
ospf_timer_dump (nbr->t_inactivity, timebuf, sizeof (timebuf)),
- VTY_NEWLINE);
+ VTYNL);
/* Show Database Summary list. */
if (use_json)
json_object_int_add(json_sub, "databaseSummaryListCounter", ospf_db_summary_count (nbr));
else
vty_out (vty, " Database Summary List %d%s",
- ospf_db_summary_count (nbr), VTY_NEWLINE);
+ ospf_db_summary_count (nbr), VTYNL);
/* Show Link State Request list. */
if (use_json)
json_object_int_add(json_sub, "linkStateRequestListCounter", ospf_ls_request_count (nbr));
else
vty_out (vty, " Link State Request List %ld%s",
- ospf_ls_request_count (nbr), VTY_NEWLINE);
+ ospf_ls_request_count (nbr), VTYNL);
/* Show Link State Retransmission list. */
if (use_json)
json_object_int_add(json_sub, "linkStateRetransmissionListCounter", ospf_ls_retransmit_count (nbr));
else
vty_out (vty, " Link State Retransmission List %ld%s",
- ospf_ls_retransmit_count (nbr), VTY_NEWLINE);
+ ospf_ls_retransmit_count (nbr), VTYNL);
/* Show inactivity timer thread. */
if (use_json)
}
else
vty_out (vty, " Thread Inactivity Timer %s%s",
- nbr->t_inactivity != NULL ? "on" : "off", VTY_NEWLINE);
+ nbr->t_inactivity != NULL ? "on" : "off", VTYNL);
/* Show Database Description retransmission thread. */
if (use_json)
}
else
vty_out (vty, " Thread Database Description Retransmision %s%s",
- nbr->t_db_desc != NULL ? "on" : "off", VTY_NEWLINE);
+ nbr->t_db_desc != NULL ? "on" : "off", VTYNL);
/* Show Link State Request Retransmission thread. */
if (use_json)
}
else
vty_out (vty, " Thread Link State Request Retransmission %s%s",
- nbr->t_ls_req != NULL ? "on" : "off", VTY_NEWLINE);
+ nbr->t_ls_req != NULL ? "on" : "off", VTYNL);
/* Show Link State Update Retransmission thread. */
if (use_json)
}
else
vty_out (vty, " Thread Link State Update Retransmission %s%s%s",
- nbr->t_ls_upd != NULL ? "on" : "off", VTY_NEWLINE, VTY_NEWLINE);
+ nbr->t_ls_upd != NULL ? "on" : "off", VTYNL, VTYNL);
if (use_json)
{
if (use_json)
json_object_int_add(json, "ospfInstance", ospf->instance);
else
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
ret = inet_aton (argv[arg_base]->arg, &router_id);
if (!ret)
{
if (!use_json)
- vty_out (vty, "Please specify Neighbor ID by A.B.C.D%s", VTY_NEWLINE);
+ vty_out (vty, "Please specify Neighbor ID by A.B.C.D%s", VTYNL);
return CMD_WARNING;
}
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
if (use_json)
json_object_int_add(json, "ospfInstance", ospf->instance);
else
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi))
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
if (use_json)
json_object_int_add(json, "ospfInstance", ospf->instance);
else
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi))
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
{
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
return CMD_SUCCESS;
if (use_json)
json_object_int_add(json, "ospfInstance", ospf->instance);
else
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
}
ifp = if_lookup_by_name (argv[arg_base]->arg, VRF_DEFAULT);
if (!ifp)
{
if (!use_json)
- vty_out (vty, "No such interface.%s", VTY_NEWLINE);
+ vty_out (vty, "No such interface.%s", VTYNL);
return CMD_WARNING;
}
if (use_json)
{
- vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
+ vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL);
json_object_free(json);
}
else
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
default:
break;
}
- vty_out (vty, VTY_NEWLINE);
+ vty_out (vty, VTYNL);
}
return 0;
{
struct router_lsa *rlsa = (struct router_lsa*) lsa->data;
- vty_out (vty, " LS age: %d%s", LS_AGE (lsa), VTY_NEWLINE);
- vty_out (vty, " Options: 0x%-2x : %s%s",
- lsa->data->options,
- ospf_options_dump(lsa->data->options),
- VTY_NEWLINE);
- vty_out (vty, " LS Flags: 0x%-2x %s%s",
- lsa->flags,
- ((lsa->flags & OSPF_LSA_LOCAL_XLT) ? "(Translated from Type-7)" : ""),
- VTY_NEWLINE);
+ vty_outln (vty, " LS age: %d", LS_AGE (lsa));
+ vty_outln (vty, " Options: 0x%-2x : %s", lsa->data->options,
+ ospf_options_dump(lsa->data->options));
+ vty_outln (vty, " LS Flags: 0x%-2x %s",
+ lsa->flags,
+ ((lsa->flags & OSPF_LSA_LOCAL_XLT) ?
+ "(Translated from Type-7)" : ""));
if (lsa->data->type == OSPF_ROUTER_LSA)
{
IS_ROUTER_LSA_VIRTUAL (rlsa) ? " VL-endpoint" : "",
IS_ROUTER_LSA_SHORTCUT (rlsa) ? " Shortcut" : "");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_outln (vty, "");
}
- vty_out (vty, " LS Type: %s%s",
- lookup_msg(ospf_lsa_type_msg, lsa->data->type, NULL), VTY_NEWLINE);
- vty_out (vty, " Link State ID: %s %s%s", inet_ntoa (lsa->data->id),
- lookup_msg(ospf_link_state_id_type_msg, lsa->data->type, NULL), VTY_NEWLINE);
- vty_out (vty, " Advertising Router: %s%s",
- inet_ntoa (lsa->data->adv_router), VTY_NEWLINE);
- vty_out (vty, " LS Seq Number: %08lx%s", (u_long)ntohl (lsa->data->ls_seqnum),
- VTY_NEWLINE);
- vty_out (vty, " Checksum: 0x%04x%s", ntohs (lsa->data->checksum),
- VTY_NEWLINE);
- vty_out (vty, " Length: %d%s", ntohs (lsa->data->length), VTY_NEWLINE);
+ vty_outln (vty, " LS Type: %s",
+ lookup_msg(ospf_lsa_type_msg, lsa->data->type, NULL));
+ vty_outln (vty, " Link State ID: %s %s", inet_ntoa (lsa->data->id),
+ lookup_msg(ospf_link_state_id_type_msg, lsa->data->type, NULL));
+ vty_outln (vty, " Advertising Router: %s", inet_ntoa (lsa->data->adv_router));
+ vty_outln (vty, " LS Seq Number: %08lx", (u_long)ntohl (lsa->data->ls_seqnum));
+ vty_outln (vty, " Checksum: 0x%04x", ntohs (lsa->data->checksum));
+ vty_outln (vty, " Length: %d%s", ntohs (lsa->data->length), VTYNL);
}
const char *link_type_desc[] =
type = rl->link[i].type;
vty_out (vty, " Link connected to: %s%s",
- link_type_desc[type], VTY_NEWLINE);
+ link_type_desc[type], VTYNL);
vty_out (vty, " (Link ID) %s: %s%s", link_id_desc[type],
- inet_ntoa (rl->link[i].link_id), VTY_NEWLINE);
+ inet_ntoa (rl->link[i].link_id), VTYNL);
vty_out (vty, " (Link Data) %s: %s%s", link_data_desc[type],
- inet_ntoa (rl->link[i].link_data), VTY_NEWLINE);
- vty_out (vty, " Number of TOS metrics: 0%s", VTY_NEWLINE);
+ inet_ntoa (rl->link[i].link_data), VTYNL);
+ vty_out (vty, " Number of TOS metrics: 0%s", VTYNL);
vty_out (vty, " TOS 0 Metric: %d%s",
- ntohs (rl->link[i].metric), VTY_NEWLINE);
- vty_out (vty, "%s", VTY_NEWLINE);
+ ntohs (rl->link[i].metric), VTYNL);
+ vty_out (vty, "%s", VTYNL);
}
}
show_ip_ospf_database_header (vty, lsa);
vty_out (vty, " Number of Links: %d%s%s", ntohs (rl->links),
- VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL);
show_ip_ospf_database_router_links (vty, rl);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
return 0;
show_ip_ospf_database_header (vty, lsa);
vty_out (vty, " Network Mask: /%d%s",
- ip_masklen (nl->mask), VTY_NEWLINE);
+ ip_masklen (nl->mask), VTYNL);
length = ntohs (lsa->data->length) - OSPF_LSA_HEADER_SIZE - 4;
for (i = 0; length > 0; i++, length -= 4)
vty_out (vty, " Attached Router: %s%s",
- inet_ntoa (nl->routers[i]), VTY_NEWLINE);
+ inet_ntoa (nl->routers[i]), VTYNL);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
return 0;
show_ip_ospf_database_header (vty, lsa);
vty_out (vty, " Network Mask: /%d%s", ip_masklen (sl->mask),
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, " TOS: 0 Metric: %d%s", GET_METRIC (sl->metric),
- VTY_NEWLINE);
- vty_out (vty, "%s", VTY_NEWLINE);
+ VTYNL);
+ vty_out (vty, "%s", VTYNL);
}
return 0;
show_ip_ospf_database_header (vty, lsa);
vty_out (vty, " Network Mask: /%d%s",
- ip_masklen (sl->mask), VTY_NEWLINE);
+ ip_masklen (sl->mask), VTYNL);
vty_out (vty, " TOS: 0 Metric: %d%s", GET_METRIC (sl->metric),
- VTY_NEWLINE);
- vty_out (vty, "%s", VTY_NEWLINE);
+ VTYNL);
+ vty_out (vty, "%s", VTYNL);
}
return 0;
show_ip_ospf_database_header (vty, lsa);
vty_out (vty, " Network Mask: /%d%s",
- ip_masklen (al->mask), VTY_NEWLINE);
+ ip_masklen (al->mask), VTYNL);
vty_out (vty, " Metric Type: %s%s",
IS_EXTERNAL_METRIC (al->e[0].tos) ?
- "2 (Larger than any link state path)" : "1", VTY_NEWLINE);
- vty_out (vty, " TOS: 0%s", VTY_NEWLINE);
+ "2 (Larger than any link state path)" : "1", VTYNL);
+ vty_out (vty, " TOS: 0%s", VTYNL);
vty_out (vty, " Metric: %d%s",
- GET_METRIC (al->e[0].metric), VTY_NEWLINE);
+ GET_METRIC (al->e[0].metric), VTYNL);
vty_out (vty, " Forward Address: %s%s",
- inet_ntoa (al->e[0].fwd_addr), VTY_NEWLINE);
+ inet_ntoa (al->e[0].fwd_addr), VTYNL);
vty_out (vty, " External Route Tag: %"ROUTE_TAG_PRI"%s%s",
- (route_tag_t)ntohl (al->e[0].route_tag), VTY_NEWLINE, VTY_NEWLINE);
+ (route_tag_t)ntohl (al->e[0].route_tag), VTYNL, VTYNL);
}
return 0;
show_ip_ospf_database_header (vty, lsa);
vty_out (vty, " Network Mask: /%d%s",
- ip_masklen (al->mask), VTY_NEWLINE);
+ ip_masklen (al->mask), VTYNL);
vty_out (vty, " Metric Type: %s%s",
IS_EXTERNAL_METRIC (al->e[0].tos) ?
- "2 (Larger than any link state path)" : "1", VTY_NEWLINE);
- vty_out (vty, " TOS: 0%s", VTY_NEWLINE);
+ "2 (Larger than any link state path)" : "1", VTYNL);
+ vty_out (vty, " TOS: 0%s", VTYNL);
vty_out (vty, " Metric: %d%s",
- GET_METRIC (al->e[0].metric), VTY_NEWLINE);
+ GET_METRIC (al->e[0].metric), VTYNL);
vty_out (vty, " NSSA: Forward Address: %s%s",
- inet_ntoa (al->e[0].fwd_addr), VTY_NEWLINE);
+ inet_ntoa (al->e[0].fwd_addr), VTYNL);
vty_out (vty, " External Route Tag: %"ROUTE_TAG_PRI"%s%s",
- (route_tag_t)ntohl (al->e[0].route_tag), VTY_NEWLINE, VTY_NEWLINE);
+ (route_tag_t)ntohl (al->e[0].route_tag), VTYNL, VTYNL);
}
return 0;
show_ip_ospf_database_header (vty, lsa);
show_opaque_info_detail (vty, lsa);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
return 0;
}
case OSPF_OPAQUE_AS_LSA:
vty_out (vty, " %s %s%s",
show_database_desc[type],
- VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL);
show_lsa_detail_proc (vty, AS_LSDB (ospf, type), id, adv_router);
break;
default:
for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area))
{
vty_out (vty, "%s %s (Area %s)%s%s",
- VTY_NEWLINE, show_database_desc[type],
- ospf_area_desc_string (area), VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, show_database_desc[type],
+ ospf_area_desc_string (area), VTYNL, VTYNL);
show_lsa_detail_proc (vty, AREA_LSDB (area, type), id, adv_router);
}
break;
case OSPF_OPAQUE_AS_LSA:
vty_out (vty, " %s %s%s",
show_database_desc[type],
- VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL);
show_lsa_detail_adv_router_proc (vty, AS_LSDB (ospf, type),
adv_router);
break;
for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area))
{
vty_out (vty, "%s %s (Area %s)%s%s",
- VTY_NEWLINE, show_database_desc[type],
- ospf_area_desc_string (area), VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, show_database_desc[type],
+ ospf_area_desc_string (area), VTYNL, VTYNL);
show_lsa_detail_adv_router_proc (vty, AREA_LSDB (area, type),
adv_router);
}
vty_out (vty, " %s (Area %s)%s%s",
show_database_desc[type],
ospf_area_desc_string (area),
- VTY_NEWLINE, VTY_NEWLINE);
- vty_out (vty, "%s%s", show_database_header[type], VTY_NEWLINE);
+ VTYNL, VTYNL);
+ vty_out (vty, "%s%s", show_database_header[type], VTYNL);
LSDB_LOOP (AREA_LSDB (area, type), rn, lsa)
show_lsa_summary (vty, lsa, self);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
}
{
vty_out (vty, " %s%s%s",
show_database_desc[type],
- VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL);
vty_out (vty, "%s%s", show_database_header[type],
- VTY_NEWLINE);
+ VTYNL);
LSDB_LOOP (AS_LSDB (ospf, type), rn, lsa)
show_lsa_summary (vty, lsa, self);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
static void
struct route_node *rn;
vty_out (vty, "%s MaxAge Link States:%s%s",
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL, VTYNL);
for (rn = route_top (ospf->maxage_lsa); rn; rn = route_next (rn))
{
if ((lsa = rn->info) != NULL)
{
- vty_out (vty, "Link type: %d%s", lsa->data->type, VTY_NEWLINE);
+ vty_out (vty, "Link type: %d%s", lsa->data->type, VTYNL);
vty_out (vty, "Link State ID: %s%s",
- inet_ntoa (lsa->data->id), VTY_NEWLINE);
+ inet_ntoa (lsa->data->id), VTYNL);
vty_out (vty, "Advertising Router: %s%s",
- inet_ntoa (lsa->data->adv_router), VTY_NEWLINE);
- vty_out (vty, "LSA lock count: %d%s", lsa->lock, VTY_NEWLINE);
- vty_out (vty, "%s", VTY_NEWLINE);
+ inet_ntoa (lsa->data->adv_router), VTYNL);
+ vty_out (vty, "LSA lock count: %d%s", lsa->lock, VTYNL);
+ vty_out (vty, "%s", VTYNL);
}
}
}
struct in_addr id, adv_router;
if (ospf->instance)
- vty_out (vty, "%sOSPF Instance: %d%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s", VTYNL, ospf->instance,
+ VTYNL);
- vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTY_NEWLINE,
- inet_ntoa (ospf->router_id), VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTYNL,
+ inet_ntoa (ospf->router_id), VTYNL, VTYNL);
/* Show all LSA. */
if (argc == arg_base + 4)
struct in_addr adv_router;
if (ospf->instance)
- vty_out (vty, "%sOSPF Instance: %d%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s", VTYNL, ospf->instance,
+ VTYNL);
- vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTY_NEWLINE,
- inet_ntoa (ospf->router_id), VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTYNL,
+ inet_ntoa (ospf->router_id), VTYNL, VTYNL);
if (argc != arg_base + 7)
return CMD_WARNING;
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
return CMD_SUCCESS;
}
- vty_out (vty, "You shouldn't get here!%s", VTY_NEWLINE);
+ vty_out (vty, "You shouldn't get here!%s", VTYNL);
return CMD_WARNING;
}
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
params = ospf_lookup_if_params (ifp, addr);
if (params == NULL)
{
- vty_out (vty, "Ip Address specified is unknown%s", VTY_NEWLINE);
+ vty_out (vty, "Ip Address specified is unknown%s", VTYNL);
return CMD_WARNING;
}
params->auth_type = OSPF_AUTH_NOTSET;
}
else
{
- vty_out (vty, "Unexpected input encountered%s", VTY_NEWLINE);
+ vty_out (vty, "Unexpected input encountered%s", VTYNL);
return CMD_WARNING;
}
/*
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
params = ospf_lookup_if_params (ifp, addr);
if (params == NULL)
{
- vty_out (vty, "Ip Address specified is unknown%s", VTY_NEWLINE);
+ vty_out (vty, "Ip Address specified is unknown%s", VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
key_id = strtol (keyid, NULL, 10);
if (ospf_crypt_key_lookup (params->auth_crypt, key_id) != NULL)
{
- vty_out (vty, "OSPF: Key %d already exists%s", key_id, VTY_NEWLINE);
+ vty_out (vty, "OSPF: Key %d already exists%s", key_id, VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
ck = ospf_crypt_key_lookup (params->auth_crypt, key_id);
if (ck == NULL)
{
- vty_out (vty, "OSPF: Key %d does not exist%s", key_id, VTY_NEWLINE);
+ vty_out (vty, "OSPF: Key %d does not exist%s", key_id, VTYNL);
return CMD_WARNING;
}
if(!inet_aton(ifaddr, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!inet_aton(ifaddr, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
else
{
vty_out (vty, "Please specify dead-interval or hello-multiplier%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if(!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if(!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (old_type == OSPF_IFTYPE_LOOPBACK)
{
- vty_out (vty, "This is a loopback interface. Can't set network type.%s", VTY_NEWLINE);
+ vty_out (vty, "This is a loopback interface. Can't set network type.%s", VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!inet_aton(argv[idx]->arg, &addr))
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (ret < 0)
{
vty_out (vty, "Please specify area by A.B.C.D|<0-4294967295>%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (memcmp (ifp->name, "VLINK", 5) == 0)
{
- vty_out (vty, "Cannot enable OSPF on a virtual link.%s", VTY_NEWLINE);
+ vty_out (vty, "Cannot enable OSPF on a virtual link.%s", VTYNL);
return CMD_WARNING;
}
{
vty_out (vty,
"Must remove previous area config before changing ospf area %s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
{
if (rn->info != NULL)
{
- vty_out (vty, "Please remove all network commands first.%s", VTY_NEWLINE);
+ vty_out (vty, "Please remove all network commands first.%s", VTYNL);
return CMD_WARNING;
}
}
if (!OSPF_IF_PARAM_CONFIGURED(params, if_area))
{
- vty_out (vty, "Can't find specified interface area configuration.%s",
- VTY_NEWLINE);
+ vty_outln (vty, "Can't find specified interface area configuration.");
return CMD_WARNING;
}
if ((source == ZEBRA_ROUTE_OSPF) && !ospf->instance)
{
vty_out (vty, "Instance redistribution in non-instanced OSPF not allowed%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if ((source == ZEBRA_ROUTE_OSPF) && (ospf->instance == instance))
{
vty_out (vty, "Same instance OSPF redistribution not allowed%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if ((source == ZEBRA_ROUTE_OSPF) && !ospf->instance)
{
vty_out (vty, "Instance redistribution in non-instanced OSPF not allowed%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if ((source == ZEBRA_ROUTE_OSPF) && (ospf->instance == instance))
{
vty_out (vty, "Same instance OSPF redistribution not allowed%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
params = ospf_get_if_params (ifp, addr);
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
- VTY_NEWLINE);
+ VTYNL);
return CMD_WARNING;
}
params = ospf_get_if_params (ifp, addr);
if (ospf->stub_router_startup_time != OSPF_STUB_ROUTER_UNCONFIGURED)
vty_out (vty, " max-metric router-lsa on-startup %u%s",
- ospf->stub_router_startup_time, VTY_NEWLINE);
+ ospf->stub_router_startup_time, VTYNL);
if (ospf->stub_router_shutdown_time != OSPF_STUB_ROUTER_UNCONFIGURED)
vty_out (vty, " max-metric router-lsa on-shutdown %u%s",
- ospf->stub_router_shutdown_time, VTY_NEWLINE);
+ ospf->stub_router_shutdown_time, VTYNL);
for (ALL_LIST_ELEMENTS_RO (ospf->areas, ln, area))
{
if (CHECK_FLAG (area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED))
{
vty_out (vty, " max-metric router-lsa administrative%s",
- VTY_NEWLINE);
+ VTYNL);
break;
}
}
struct ospf_path *path;
vty_out (vty, "============ OSPF network routing table ============%s",
- VTY_NEWLINE);
+ VTYNL);
for (rn = route_top (rt); rn; rn = route_next (rn))
if ((or = rn->info) != NULL)
case OSPF_PATH_INTER_AREA:
if (or->type == OSPF_DESTINATION_NETWORK)
vty_out (vty, "N IA %-18s [%d] area: %s%s", buf1, or->cost,
- inet_ntoa (or->u.std.area_id), VTY_NEWLINE);
+ inet_ntoa (or->u.std.area_id), VTYNL);
else if (or->type == OSPF_DESTINATION_DISCARD)
- vty_out (vty, "D IA %-18s Discard entry%s", buf1, VTY_NEWLINE);
+ vty_out (vty, "D IA %-18s Discard entry%s", buf1, VTYNL);
break;
case OSPF_PATH_INTRA_AREA:
vty_out (vty, "N %-18s [%d] area: %s%s", buf1, or->cost,
- inet_ntoa (or->u.std.area_id), VTY_NEWLINE);
+ inet_ntoa (or->u.std.area_id), VTYNL);
break;
default:
break;
{
if (path->nexthop.s_addr == 0)
vty_out (vty, "%24s directly attached to %s%s",
- "", ifindex2ifname (path->ifindex, VRF_DEFAULT), VTY_NEWLINE);
+ "", ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL);
else
vty_out (vty, "%24s via %s, %s%s", "",
inet_ntoa (path->nexthop),
- ifindex2ifname (path->ifindex, VRF_DEFAULT), VTY_NEWLINE);
+ ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL);
}
}
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
static void
struct ospf_path *path;
vty_out (vty, "============ OSPF router routing table =============%s",
- VTY_NEWLINE);
+ VTYNL);
for (rn = route_top (rtrs); rn; rn = route_next (rn))
if (rn->info)
{
vty_out (vty, "%s%s%s",
(or->u.std.flags & ROUTER_LSA_BORDER ? ", ABR" : ""),
(or->u.std.flags & ROUTER_LSA_EXTERNAL ? ", ASBR" : ""),
- VTY_NEWLINE);
+ VTYNL);
for (ALL_LIST_ELEMENTS_RO (or->paths, pnode, path))
{
if (path->nexthop.s_addr == 0)
vty_out (vty, "%24s directly attached to %s%s",
"", ifindex2ifname (path->ifindex, VRF_DEFAULT),
- VTY_NEWLINE);
+ VTYNL);
else
vty_out (vty, "%24s via %s, %s%s", "",
inet_ntoa (path->nexthop),
ifindex2ifname (path->ifindex, VRF_DEFAULT),
- VTY_NEWLINE);
+ VTYNL);
}
}
}
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
static void
struct ospf_path *path;
vty_out (vty, "============ OSPF external routing table ===========%s",
- VTY_NEWLINE);
+ VTYNL);
for (rn = route_top (rt); rn; rn = route_next (rn))
if ((er = rn->info) != NULL)
{
{
case OSPF_PATH_TYPE1_EXTERNAL:
vty_out (vty, "N E1 %-18s [%d] tag: %"ROUTE_TAG_PRI"%s", buf1,
- er->cost, er->u.ext.tag, VTY_NEWLINE);
+ er->cost, er->u.ext.tag, VTYNL);
break;
case OSPF_PATH_TYPE2_EXTERNAL:
vty_out (vty, "N E2 %-18s [%d/%d] tag: %"ROUTE_TAG_PRI"%s", buf1, er->cost,
- er->u.ext.type2_cost, er->u.ext.tag, VTY_NEWLINE);
+ er->u.ext.type2_cost, er->u.ext.tag, VTYNL);
break;
}
{
if (path->nexthop.s_addr == 0)
vty_out (vty, "%24s directly attached to %s%s",
- "", ifindex2ifname (path->ifindex, VRF_DEFAULT), VTY_NEWLINE);
+ "", ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL);
else
vty_out (vty, "%24s via %s, %s%s", "",
inet_ntoa (path->nexthop),
ifindex2ifname (path->ifindex, VRF_DEFAULT),
- VTY_NEWLINE);
+ VTYNL);
}
}
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
static int
show_ip_ospf_border_routers_common (struct vty *vty, struct ospf *ospf)
{
if (ospf->instance)
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
if (ospf->new_table == NULL)
{
- vty_out (vty, "No OSPF routing information exist%s", VTY_NEWLINE);
+ vty_out (vty, "No OSPF routing information exist%s", VTYNL);
return CMD_SUCCESS;
}
/* Show Router routes. */
show_ip_ospf_route_router (vty, ospf->new_rtrs);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
show_ip_ospf_route_common (struct vty *vty, struct ospf *ospf)
{
if (ospf->instance)
- vty_out (vty, "%sOSPF Instance: %d%s%s", VTY_NEWLINE, ospf->instance,
- VTY_NEWLINE, VTY_NEWLINE);
+ vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance,
+ VTYNL, VTYNL);
if (ospf->new_table == NULL)
{
- vty_out (vty, "No OSPF routing information exist%s", VTY_NEWLINE);
+ vty_out (vty, "No OSPF routing information exist%s", VTYNL);
return CMD_SUCCESS;
}
/* Show AS External routes. */
show_ip_ospf_route_external (vty, ospf->old_external_route);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
return CMD_SUCCESS;
}
if (ifp->ifindex == IFINDEX_DELETED)
continue;
- vty_out (vty, "!%s", VTY_NEWLINE);
+ vty_out (vty, "!%s", VTYNL);
vty_out (vty, "interface %s%s", ifp->name,
- VTY_NEWLINE);
+ VTYNL);
if (ifp->desc)
vty_out (vty, " description %s%s", ifp->desc,
- VTY_NEWLINE);
+ VTYNL);
write++;
ospf_int_type_str[params->type]);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
vty_out (vty, " ip ospf authentication%s", auth_str);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Simple Authentication Password print. */
params->auth_simple);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Cryptographic Authentication Key print. */
ck->key_id, ck->auth_key);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Interface Output Cost print. */
vty_out (vty, " ip ospf cost %u", params->output_cost_cmd);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Hello Interval print. */
vty_out (vty, " ip ospf hello-interval %u", params->v_hello);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Router Priority print. */
vty_out (vty, " ip ospf priority %u", params->priority);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Retransmit Interval print. */
params->retransmit_interval);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Transmit Delay print. */
vty_out (vty, " ip ospf transmit-delay %u", params->transmit_delay);
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Area print. */
vty_out (vty, " area %s", inet_ntoa (params->if_area));
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, VTYNL);
}
/* bfd print. */
vty_out (vty, " ip ospf mtu-ignore");
if (params != IF_DEF_PARAMS (ifp))
vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
/* Network print. */
vty_out (vty, " network %s/%d area %s%s",
inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen,
- buf, VTY_NEWLINE);
+ buf, VTYNL);
}
return 0;
if (area->auth_type != OSPF_AUTH_NULL)
{
if (area->auth_type == OSPF_AUTH_SIMPLE)
- vty_out (vty, " area %s authentication%s", buf, VTY_NEWLINE);
+ vty_out (vty, " area %s authentication%s", buf, VTYNL);
else
vty_out (vty, " area %s authentication message-digest%s",
- buf, VTY_NEWLINE);
+ buf, VTYNL);
}
if (area->shortcut_configured != OSPF_SHORTCUT_DEFAULT)
vty_out (vty, " area %s shortcut %s%s", buf,
ospf_shortcut_mode_str[area->shortcut_configured],
- VTY_NEWLINE);
+ VTYNL);
if ((area->external_routing == OSPF_AREA_STUB)
|| (area->external_routing == OSPF_AREA_NSSA)
if (area->no_summary)
vty_out (vty, " no-summary");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
if (area->default_cost != 1)
vty_out (vty, " area %s default-cost %d%s", buf,
- area->default_cost, VTY_NEWLINE);
+ area->default_cost, VTYNL);
}
for (rn1 = route_top (area->ranges); rn1; rn1 = route_next (rn1))
vty_out (vty, " substitute %s/%d",
inet_ntoa (range->subst_addr), range->subst_masklen);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
if (EXPORT_NAME (area))
vty_out (vty, " area %s export-list %s%s", buf,
- EXPORT_NAME (area), VTY_NEWLINE);
+ EXPORT_NAME (area), VTYNL);
if (IMPORT_NAME (area))
vty_out (vty, " area %s import-list %s%s", buf,
- IMPORT_NAME (area), VTY_NEWLINE);
+ IMPORT_NAME (area), VTYNL);
if (PREFIX_NAME_IN (area))
vty_out (vty, " area %s filter-list prefix %s in%s", buf,
- PREFIX_NAME_IN (area), VTY_NEWLINE);
+ PREFIX_NAME_IN (area), VTYNL);
if (PREFIX_NAME_OUT (area))
vty_out (vty, " area %s filter-list prefix %s out%s", buf,
- PREFIX_NAME_OUT (area), VTY_NEWLINE);
+ PREFIX_NAME_OUT (area), VTYNL);
}
return 0;
if (nbr_nbma->v_poll != OSPF_POLL_INTERVAL_DEFAULT)
vty_out (vty, " poll-interval %d", nbr_nbma->v_poll);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
return 0;
OSPF_IF_PARAM (oi, retransmit_interval),
OSPF_IF_PARAM (oi, transmit_delay),
OSPF_IF_PARAM (oi, v_wait),
- VTY_NEWLINE);
+ VTYNL);
else
vty_out (vty, " area %s virtual-link %s%s", buf,
- inet_ntoa (vl_data->vl_peer), VTY_NEWLINE);
+ inet_ntoa (vl_data->vl_peer), VTYNL);
/* Auth key */
if (IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_simple[0] != '\0')
vty_out (vty, " area %s virtual-link %s authentication-key %s%s",
buf,
inet_ntoa (vl_data->vl_peer),
IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_simple,
- VTY_NEWLINE);
+ VTYNL);
/* md5 keys */
for (ALL_LIST_ELEMENTS_RO (IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_crypt,
n2, ck))
" message-digest-key %d md5 %s%s",
buf,
inet_ntoa (vl_data->vl_peer),
- ck->key_id, ck->auth_key, VTY_NEWLINE);
+ ck->key_id, ck->auth_key, VTYNL);
}
}
if (ROUTEMAP_NAME (red))
vty_out (vty, " route-map %s", ROUTEMAP_NAME (red));
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
{
if (ospf->default_metric != -1)
vty_out (vty, " default-metric %d%s", ospf->default_metric,
- VTY_NEWLINE);
+ VTYNL);
return 0;
}
if (DISTRIBUTE_NAME (ospf, type))
vty_out (vty, " distribute-list %s out %s%s",
DISTRIBUTE_NAME (ospf, type),
- zebra_route_string(type), VTY_NEWLINE);
+ zebra_route_string(type), VTYNL);
/* default-information print. */
if (ospf->default_originate != DEFAULT_ORIGINATE_NONE)
ROUTEMAP_NAME (red));
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
struct ospf_distance *odistance;
if (ospf->distance_all)
- vty_out (vty, " distance %d%s", ospf->distance_all, VTY_NEWLINE);
+ vty_out (vty, " distance %d%s", ospf->distance_all, VTYNL);
if (ospf->distance_intra
|| ospf->distance_inter
if (ospf->distance_external)
vty_out (vty, " external %d", ospf->distance_external);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
for (rn = route_top (ospf->distance_table); rn; rn = route_next (rn))
vty_out (vty, " distance %d %s/%d %s%s", odistance->distance,
inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen,
odistance->access_list ? odistance->access_list : "",
- VTY_NEWLINE);
+ VTYNL);
}
return 0;
}
{
/* `router ospf' print. */
if (ospf->instance)
- vty_out (vty, "router ospf %d%s", ospf->instance, VTY_NEWLINE);
+ vty_out (vty, "router ospf %d%s", ospf->instance, VTYNL);
else
- vty_out (vty, "router ospf%s", VTY_NEWLINE);
+ vty_out (vty, "router ospf%s", VTYNL);
write++;
/* Router ID print. */
if (ospf->router_id_static.s_addr != 0)
vty_out (vty, " ospf router-id %s%s",
- inet_ntoa (ospf->router_id_static), VTY_NEWLINE);
+ inet_ntoa (ospf->router_id_static), VTYNL);
/* ABR type print. */
if (ospf->abr_type != OSPF_ABR_DEFAULT)
vty_out (vty, " ospf abr-type %s%s",
- ospf_abr_type_str[ospf->abr_type], VTY_NEWLINE);
+ ospf_abr_type_str[ospf->abr_type], VTYNL);
/* log-adjacency-changes flag print. */
if (CHECK_FLAG(ospf->config, OSPF_LOG_ADJACENCY_CHANGES))
{
if (CHECK_FLAG(ospf->config, OSPF_LOG_ADJACENCY_DETAIL))
- vty_out(vty, " log-adjacency-changes detail%s", VTY_NEWLINE);
+ vty_out(vty, " log-adjacency-changes detail%s", VTYNL);
else if (!DFLT_OSPF_LOG_ADJACENCY_CHANGES)
- vty_out(vty, " log-adjacency-changes%s", VTY_NEWLINE);
+ vty_out(vty, " log-adjacency-changes%s", VTYNL);
}
else if (DFLT_OSPF_LOG_ADJACENCY_CHANGES)
{
- vty_out(vty, " no log-adjacency-changes%s", VTY_NEWLINE);
+ vty_out(vty, " no log-adjacency-changes%s", VTYNL);
}
/* RFC1583 compatibility flag print -- Compatible with CISCO 12.1. */
if (CHECK_FLAG (ospf->config, OSPF_RFC1583_COMPATIBLE))
- vty_out (vty, " compatible rfc1583%s", VTY_NEWLINE);
+ vty_out (vty, " compatible rfc1583%s", VTYNL);
/* auto-cost reference-bandwidth configuration. */
if (ospf->ref_bandwidth != OSPF_DEFAULT_REF_BANDWIDTH)
{
vty_out (vty, "! Important: ensure reference bandwidth "
- "is consistent across all routers%s", VTY_NEWLINE);
+ "is consistent across all routers%s", VTYNL);
vty_out (vty, " auto-cost reference-bandwidth %d%s",
- ospf->ref_bandwidth, VTY_NEWLINE);
+ ospf->ref_bandwidth, VTYNL);
}
/* SPF timers print. */
ospf->spf_max_holdtime != OSPF_SPF_MAX_HOLDTIME_DEFAULT)
vty_out (vty, " timers throttle spf %d %d %d%s",
ospf->spf_delay, ospf->spf_holdtime,
- ospf->spf_max_holdtime, VTY_NEWLINE);
+ ospf->spf_max_holdtime, VTYNL);
/* LSA timers print. */
if (ospf->min_ls_interval != OSPF_MIN_LS_INTERVAL)
vty_out (vty, " timers throttle lsa all %d%s",
- ospf->min_ls_interval, VTY_NEWLINE);
+ ospf->min_ls_interval, VTYNL);
if (ospf->min_ls_arrival != OSPF_MIN_LS_ARRIVAL)
vty_out (vty, " timers lsa min-arrival %d%s",
- ospf->min_ls_arrival, VTY_NEWLINE);
+ ospf->min_ls_arrival, VTYNL);
/* Write multiplier print. */
if (ospf->write_oi_count != OSPF_WRITE_INTERFACE_COUNT_DEFAULT)
vty_out (vty, " ospf write-multiplier %d%s",
- ospf->write_oi_count, VTY_NEWLINE);
+ ospf->write_oi_count, VTYNL);
/* Max-metric router-lsa print */
config_write_stub_router (vty, ospf);
/* SPF refresh parameters print. */
if (ospf->lsa_refresh_interval != OSPF_LSA_REFRESH_INTERVAL_DEFAULT)
vty_out (vty, " refresh timer %d%s",
- ospf->lsa_refresh_interval, VTY_NEWLINE);
+ ospf->lsa_refresh_interval, VTYNL);
/* Redistribute information print. */
config_write_ospf_redistribute (vty, ospf);
/* passive-interface print. */
if (ospf->passive_interface_default == OSPF_IF_PASSIVE)
- vty_out (vty, " passive-interface default%s", VTY_NEWLINE);
+ vty_out (vty, " passive-interface default%s", VTYNL);
for (ALL_LIST_ELEMENTS_RO (om->iflist, node, ifp))
if (OSPF_IF_PARAM_CONFIGURED (IF_DEF_PARAMS (ifp), passive_interface)
{
vty_out (vty, " %spassive-interface %s%s",
IF_DEF_PARAMS (ifp)->passive_interface ? "" : "no ",
- ifp->name, VTY_NEWLINE);
+ ifp->name, VTYNL);
}
for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi))
{
vty_out (vty, " %spassive-interface %s %s%s",
oi->params->passive_interface ? "" : "no ",
oi->ifp->name,
- inet_ntoa (oi->address->u.prefix4), VTY_NEWLINE);
+ inet_ntoa (oi->address->u.prefix4), VTYNL);
}
/* Network area print. */
else /* Interface name is specified. */
{
if ((ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT)) == NULL)
- vty_out (vty, "No such interface name%s", VTY_NEWLINE);
+ vty_out (vty, "No such interface name%s", VTYNL);
else
ospf_interface_clear(ifp);
}
retv = str2area_id ((STR), &(V), &(F)); \
if (retv < 0) \
{ \
- vty_out (vty, "%% Invalid OSPF area ID%s", VTY_NEWLINE); \
+ vty_out (vty, "%% Invalid OSPF area ID%s", VTYNL); \
return CMD_WARNING; \
} \
}
retv = str2area_id ((STR), &(V), &(F)); \
if (retv < 0) \
{ \
- vty_out (vty, "%% Invalid OSPF area ID%s", VTY_NEWLINE); \
+ vty_out (vty, "%% Invalid OSPF area ID%s", VTYNL); \
return CMD_WARNING; \
} \
if (OSPF_IS_AREA_ID_BACKBONE ((V))) \
{ \
vty_out (vty, "%% You can't configure %s to backbone%s", \
- NAME, VTY_NEWLINE); \
+ NAME, VTYNL); \
} \
}
"ECA: Evaluate CouldAssert%s"
"ATD: AssertTrackingDesired%s"
"eATD: Evaluate AssertTrackingDesired%s",
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL, VTYNL, VTYNL);
vty_outln (vty,
"Interface Address Source Group CA eCA ATD eATD");
} else {
vty_out(vty, "Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G)");
vty_outln (vty, "%sInstalled Source Group IIF OIL",
- VTY_NEWLINE);
+ VTYNL);
}
for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) {
"RPF Cache Refresh Last: %s%s"
"Nexthop Lookups: %lld%s"
"Nexthop Lookups Avoided: %lld",
- qpim_rpf_cache_refresh_delay_msec, VTY_NEWLINE,
- pim_time_timer_remain_msec(qpim_rpf_cache_refresher), VTY_NEWLINE,
- (long long)qpim_rpf_cache_refresh_requests, VTY_NEWLINE,
- (long long)qpim_rpf_cache_refresh_events, VTY_NEWLINE,
- refresh_uptime, VTY_NEWLINE,
- (long long) qpim_nexthop_lookups, VTY_NEWLINE,
+ qpim_rpf_cache_refresh_delay_msec, VTYNL,
+ pim_time_timer_remain_msec(qpim_rpf_cache_refresher), VTYNL,
+ (long long)qpim_rpf_cache_refresh_requests, VTYNL,
+ (long long)qpim_rpf_cache_refresh_events, VTYNL,
+ refresh_uptime, VTYNL,
+ (long long) qpim_nexthop_lookups, VTYNL,
(long long)nexthop_lookups_avoided);
}
}
"Scan OIL - Last: %s Events: %lld%s"
"MFC Add - Last: %s Events: %lld%s"
"MFC Del - Last: %s Events: %lld",
- uptime_scan_oil, (long long) qpim_scan_oil_events, VTY_NEWLINE,
- uptime_mroute_add, (long long) qpim_mroute_add_events, VTY_NEWLINE,
+ uptime_scan_oil, (long long) qpim_scan_oil_events, VTYNL,
+ uptime_mroute_add, (long long) qpim_mroute_add_events, VTYNL,
uptime_mroute_del, (long long)qpim_mroute_del_events);
}
pim_ifp->mroute_vif_index,
errno,
safe_strerror(errno),
- VTY_NEWLINE);
+ VTYNL);
}
ifaddr = pim_ifp->primary_address;
" (n) - normal, (s) - static, (d) - default, (r) - redistribute,%s"
" (i) - interface%s%s"
" Network Next Hop Metric From Tag Time",
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL, VTYNL, VTYNL, VTYNL);
for (np = route_top (rip->table); np; np = route_next (np))
if ((list = np->info) != NULL)
for (ALL_LIST_ELEMENTS (peer_list, node, nnode, peer))
{
vty_outln (vty, " %s %s%14s %10d %10d %10d %s", inet6_ntoa (peer->addr),
- VTY_NEWLINE, " ",
+ VTYNL, " ",
peer->recv_badpackets, peer->recv_badroutes,
ZEBRA_RIPNG_DISTANCE_DEFAULT,
ripng_peer_uptime(peer, timebuf, RIPNG_UPTIME_LEN));
" (n) - normal, (s) - static, (d) - default, (r) - redistribute,%s"
" (i) - interface, (a/S) - aggregated/Suppressed%s%s"
" Network Next Hop Via Metric Tag Time",
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE,
- VTY_NEWLINE, VTY_NEWLINE);
+ VTYNL, VTYNL, VTYNL,
+ VTYNL, VTYNL);
for (rp = route_top (ripng->table); rp; rp = route_next (rp))
{
update = strtoul (argv[0], &endptr, 10);
if (update == ULONG_MAX || *endptr != '\0')
{
- vty_out (vty, "update timer value error%s", VTY_NEWLINE);
+ vty_out (vty, "update timer value error%s", VTYNL);
return CMD_WARNING;
}
timeout = strtoul (argv[0], &endptr, 10);
if (timeout == ULONG_MAX || *endptr != '\0')
{
- vty_out (vty, "timeout timer value error%s", VTY_NEWLINE);
+ vty_out (vty, "timeout timer value error%s", VTYNL);
return CMD_WARNING;
}
garbage = strtoul (argv[0], &endptr, 10);
if (garbage == ULONG_MAX || *endptr != '\0')
{
- vty_out (vty, "garbage timer value error%s", VTY_NEWLINE);
+ vty_out (vty, "garbage timer value error%s", VTYNL);
return CMD_WARNING;
}
if (! ripng)
return CMD_SUCCESS;
- vty_out (vty, "Routing Protocol is \"ripng\"%s", VTY_NEWLINE);
+ vty_out (vty, "Routing Protocol is \"ripng\"%s", VTYNL);
vty_out (vty, "Sending updates every %ld seconds, next due in %d seconds%s",
ripng->update_time, 0,
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, "Timerout after %ld seconds, garbage correct %ld%s",
ripng->timeout_time,
ripng->garbage_time,
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, "Outgoing update filter list for all interfaces is not set");
vty_out (vty, "Incoming update filter list for all interfaces is not set");
#if 0
if (ripng->update_time != RIPNG_UPDATE_TIMER_DEFAULT)
vty_out (vty, " update-timer %d%s", ripng->update_time,
- VTY_NEWLINE);
+ VTYNL);
if (ripng->timeout_time != RIPNG_TIMEOUT_TIMER_DEFAULT)
vty_out (vty, " timeout-timer %d%s", ripng->timeout_time,
- VTY_NEWLINE);
+ VTYNL);
if (ripng->garbage_time != RIPNG_GARBAGE_TIMER_DEFAULT)
vty_out (vty, " garbage-timer %d%s", ripng->garbage_time,
- VTY_NEWLINE);
+ VTYNL);
#endif /* 0 */
write += config_write_distribute (vty);
printf ("%s: hard error\n", __func__);
if ((i % ITERS_PRINT) == 0)
- printf ("%s did %d, x = %g%s", str, i, x, VTY_NEWLINE);
+ printf ("%s did %d, x = %g%s", str, i, x, VTYNL);
}
static void
fp = stdout;
vty_outln (vty, "Building configuration...");
- vty_outln (vty, "%sCurrent configuration:",VTY_NEWLINE);
+ vty_outln (vty, "%sCurrent configuration:",VTYNL);
vty_outln (vty, "!");
for (i = 0; i < array_size(vtysh_client); i++)
"Debugging information\n"
"Zebra configuration\n")
{
- vty_out (vty, "Zebra debugging status:%s", VTY_NEWLINE);
+ vty_out (vty, "Zebra debugging status:%s", VTYNL);
if (IS_ZEBRA_DEBUG_EVENT)
- vty_out (vty, " Zebra event debugging is on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra event debugging is on%s", VTYNL);
if (IS_ZEBRA_DEBUG_PACKET)
{
{
vty_out (vty, " Zebra packet%s debugging is on%s",
IS_ZEBRA_DEBUG_DETAIL ? " detail" : "",
- VTY_NEWLINE);
+ VTYNL);
}
else
{
if (IS_ZEBRA_DEBUG_SEND)
vty_out (vty, " Zebra packet send%s debugging is on%s",
IS_ZEBRA_DEBUG_DETAIL ? " detail" : "",
- VTY_NEWLINE);
+ VTYNL);
else
vty_out (vty, " Zebra packet receive%s debugging is on%s",
IS_ZEBRA_DEBUG_DETAIL ? " detail" : "",
- VTY_NEWLINE);
+ VTYNL);
}
}
if (IS_ZEBRA_DEBUG_KERNEL)
- vty_out (vty, " Zebra kernel debugging is on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra kernel debugging is on%s", VTYNL);
if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND)
- vty_out (vty, " Zebra kernel netlink message dumps (send) are on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra kernel netlink message dumps (send) are on%s", VTYNL);
if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV)
- vty_out (vty, " Zebra kernel netlink message dumps (recv) are on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra kernel netlink message dumps (recv) are on%s", VTYNL);
/* Check here using flags as the 'macro' does an OR */
if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB))
- vty_out (vty, " Zebra RIB debugging is on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra RIB debugging is on%s", VTYNL);
if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED))
- vty_out (vty, " Zebra RIB detailed debugging is on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra RIB detailed debugging is on%s", VTYNL);
if (IS_ZEBRA_DEBUG_FPM)
- vty_out (vty, " Zebra FPM debugging is on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra FPM debugging is on%s", VTYNL);
if (IS_ZEBRA_DEBUG_NHT)
- vty_out (vty, " Zebra next-hop tracking debugging is on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra next-hop tracking debugging is on%s", VTYNL);
if (IS_ZEBRA_DEBUG_MPLS)
- vty_out (vty, " Zebra MPLS debugging is on%s", VTY_NEWLINE);
+ vty_out (vty, " Zebra MPLS debugging is on%s", VTYNL);
return CMD_SUCCESS;
}
if (IS_ZEBRA_DEBUG_EVENT)
{
- vty_out (vty, "debug zebra events%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra events%s", VTYNL);
write++;
}
if (IS_ZEBRA_DEBUG_PACKET)
{
vty_out (vty, "debug zebra packet%s%s",
IS_ZEBRA_DEBUG_DETAIL ? " detail" : "",
- VTY_NEWLINE);
+ VTYNL);
write++;
}
else
if (IS_ZEBRA_DEBUG_SEND)
vty_out (vty, "debug zebra packet send%s%s",
IS_ZEBRA_DEBUG_DETAIL ? " detail" : "",
- VTY_NEWLINE);
+ VTYNL);
else
vty_out (vty, "debug zebra packet recv%s%s",
IS_ZEBRA_DEBUG_DETAIL ? " detail" : "",
- VTY_NEWLINE);
+ VTYNL);
write++;
}
}
if (IS_ZEBRA_DEBUG_KERNEL)
{
- vty_out (vty, "debug zebra kernel%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra kernel%s", VTYNL);
write++;
}
if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV)
{
- vty_out (vty, "debug zebra kernel msgdump recv%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra kernel msgdump recv%s", VTYNL);
write++;
}
if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND)
{
- vty_out (vty, "debug zebra kernel msgdump send%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra kernel msgdump send%s", VTYNL);
write++;
}
/* Check here using flags as the 'macro' does an OR */
if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB))
{
- vty_out (vty, "debug zebra rib%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra rib%s", VTYNL);
write++;
}
if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED))
{
- vty_out (vty, "debug zebra rib detailed%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra rib detailed%s", VTYNL);
write++;
}
if (IS_ZEBRA_DEBUG_FPM)
{
- vty_out (vty, "debug zebra fpm%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra fpm%s", VTYNL);
write++;
}
if (IS_ZEBRA_DEBUG_NHT)
{
- vty_out (vty, "debug zebra nht%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra nht%s", VTYNL);
write++;
}
if (IS_ZEBRA_DEBUG_MPLS)
{
- vty_out (vty, "debug zebra mpls%s", VTY_NEWLINE);
+ vty_out (vty, "debug zebra mpls%s", VTYNL);
write++;
}
return write;
ifp->ifindex, ifp->metric, ifp->mtu, ifp->speed);
if (ifp->mtu6 != ifp->mtu)
vty_out (vty, "mtu6 %d ", ifp->mtu6);
- vty_outln (vty, "%s flags: %s", VTY_NEWLINE,
+ vty_outln (vty, "%s flags: %s", VTYNL,
if_flag_dump(ifp->flags));
/* Hardware address. */
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
if (!list_isempty (vrf->iflist))
{
- vty_outln (vty, "%s\tVRF %u%s", VTY_NEWLINE, vrf->vrf_id,
- VTY_NEWLINE);
+ vty_outln (vty, "%s\tVRF %u%s", VTYNL, vrf->vrf_id,
+ VTYNL);
if_show_description (vty, vrf->vrf_id);
}
zfpm_stats_t total_stats;
time_t elapsed;
- vty_outln (vty, "%s%-40s %10s Last %2d secs%s", VTY_NEWLINE, "Counter",
- "Total", ZFPM_STATS_IVL_SECS, VTY_NEWLINE);
+ vty_outln (vty, "%s%-40s %10s Last %2d secs%s", VTYNL, "Counter",
+ "Total", ZFPM_STATS_IVL_SECS, VTYNL);
/*
* Compute the total stats up to this instant.
elapsed = zfpm_get_elapsed_time (zfpm_g->last_stats_clear_time);
- vty_outln (vty, "%sStats were cleared %lu seconds ago", VTY_NEWLINE,
+ vty_outln (vty, "%sStats were cleared %lu seconds ago", VTYNL,
(unsigned long)elapsed);
}
default:
break;
}
- vty_out(vty, "%s", VTY_NEWLINE);
+ vty_out(vty, "%s", VTYNL);
}
static void
rnh = rn->info;
vty_out(vty, "%s%s%s", inet_ntop(rn->p.family, &rn->p.u.prefix, buf, BUFSIZ),
CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED) ? "(Connected)" : "",
- VTY_NEWLINE);
+ VTYNL);
if (rnh->state)
{
vty_out(vty, " resolved via %s%s",
- zebra_route_string(rnh->state->type), VTY_NEWLINE);
+ zebra_route_string(rnh->state->type), VTYNL);
for (nexthop = rnh->state->nexthop; nexthop; nexthop = nexthop->next)
print_nh(nexthop, vty);
}
else
vty_out(vty, " unresolved%s%s",
CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED) ? "(Connected)" : "",
- VTY_NEWLINE);
+ VTYNL);
vty_out(vty, " Client list:");
for (ALL_LIST_ELEMENTS_RO(rnh->client_list, node, client))
client->sock, rnh->filtered[client->proto] ? "(filtered)" : "");
if (!list_isempty(rnh->zebra_static_route_list))
vty_out(vty, " zebra%s", rnh->filtered[ZEBRA_ROUTE_STATIC] ? "(filtered)" : "");
- vty_out(vty, "%s", VTY_NEWLINE);
+ vty_out(vty, "%s", VTYNL);
}
vty_out (vty, "Routing entry for %s%s%s",
srcdest_rnode2str(rn, buf, sizeof(buf)), mcast_info,
- VTY_NEWLINE);
+ VTYNL);
vty_out (vty, " Known via \"%s", zebra_route_string (re->type));
if (re->instance)
vty_out (vty, "[%d]", re->instance);
vty_out (vty, ", blackhole");
if (CHECK_FLAG (re->flags, ZEBRA_FLAG_REJECT))
vty_out (vty, ", reject");
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
if (re->type == ZEBRA_ROUTE_RIP
|| re->type == ZEBRA_ROUTE_OSPF
vty_out (vty, "%02dw%dd%02dh",
tm->tm_yday/7,
tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
- vty_out (vty, " ago%s", VTY_NEWLINE);
+ vty_out (vty, " ago%s", VTYNL);
}
for (ALL_NEXTHOPS_RO(re->nexthop, nexthop, tnexthop, recursing))
nexthop->nh_label->label, buf, sizeof buf, 1));
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
tm->tm_yday/7,
tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_out (vty, "%s", VTYNL);
}
}
vty_out (vty, SHOW_ROUTE_V6_HEADER);
if (zvrf_id (zvrf) != VRF_DEFAULT)
- vty_outln (vty, "%sVRF %s:", VTY_NEWLINE,
+ vty_outln (vty, "%sVRF %s:", VTYNL,
zvrf_name(zvrf));
first = 0;
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
if ((zvrf = vrf->info) != NULL)
{
- vty_outln (vty, "%sVRF %s:", VTY_NEWLINE, zvrf_name(zvrf));
+ vty_outln (vty, "%sVRF %s:", VTYNL, zvrf_name(zvrf));
zebra_print_rnh_table(zvrf_id (zvrf), AF_INET, vty, RNH_NEXTHOP_TYPE);
}
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
if ((zvrf = vrf->info) != NULL)
{
- vty_outln (vty, "%sVRF %s:", VTY_NEWLINE, zvrf_name(zvrf));
+ vty_outln (vty, "%sVRF %s:", VTYNL, zvrf_name(zvrf));
zebra_print_rnh_table(zvrf_id (zvrf), AF_INET6, vty, RNH_NEXTHOP_TYPE);
}