diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-21 19:15:40 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-29 19:34:54 +0200 |
commit | 1318e7c84190d55d958cd412276115850d46f55f (patch) | |
tree | 8d8c1b5831997a4771cb7614575ad42c471b9862 /ospfd/ospf_vty.c | |
parent | *: use vty_outln (diff) | |
download | frr-1318e7c84190d55d958cd412276115850d46f55f.tar.xz frr-1318e7c84190d55d958cd412276115850d46f55f.zip |
*: s/VTY_NEWLINE/VTYNL/g
Should be able to fit more vty_out onto one line now
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r-- | ospfd/ospf_vty.c | 787 |
1 files changed, 389 insertions, 398 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index e5ba4bf11..1639949c8 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -100,7 +100,7 @@ str2metric (const char *str, int *metric) *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; } @@ -150,7 +150,7 @@ DEFUN_NOSH (router_ospf, 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; } @@ -213,7 +213,7 @@ DEFUN (ospf_router_id, 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; } @@ -223,7 +223,7 @@ DEFUN (ospf_router_id, 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; } @@ -248,7 +248,7 @@ DEFUN_HIDDEN (ospf_router_id_old, 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; } @@ -258,7 +258,7 @@ DEFUN_HIDDEN (ospf_router_id_old, 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; } @@ -285,7 +285,7 @@ DEFUN (no_ospf_router_id, 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; } @@ -390,7 +390,7 @@ DEFUN (ospf_passive_interface, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -460,7 +460,7 @@ DEFUN (no_ospf_passive_interface, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -511,14 +511,14 @@ DEFUN (ospf_network_area, 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; } @@ -529,7 +529,7 @@ DEFUN (ospf_network_area, 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; } @@ -556,7 +556,7 @@ DEFUN (no_ospf_network_area, if (ospf->instance) { vty_out (vty, "The network command is not supported in multi-instance ospf%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -568,7 +568,7 @@ DEFUN (no_ospf_network_area, if (ret == 0) { vty_out (vty, "Can't find specified network area configuration.%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -813,7 +813,7 @@ ospf_find_vl_data (struct ospf *ospf, struct ospf_vl_config_data *vl_config) { vty_out (vty, "Configuring VLs over the backbone is not allowed%s", - VTY_NEWLINE); + VTYNL); return NULL; } area = ospf_area_get (ospf, area_id); @@ -825,12 +825,12 @@ ospf_find_vl_data (struct ospf *ospf, struct ospf_vl_config_data *vl_config) 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; } @@ -876,7 +876,7 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data, != 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 (); @@ -894,7 +894,7 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data, 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; } @@ -1037,7 +1037,7 @@ DEFUN (ospf_area_vlink, &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; } @@ -1045,7 +1045,7 @@ DEFUN (ospf_area_vlink, if (! ret) { vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -1060,7 +1060,7 @@ DEFUN (ospf_area_vlink, 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]) { @@ -1157,14 +1157,14 @@ DEFUN (no_ospf_area_vlink, 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; } @@ -1172,7 +1172,7 @@ DEFUN (no_ospf_area_vlink, if (! ret) { vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -1193,7 +1193,7 @@ DEFUN (no_ospf_area_vlink, /* 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]) { @@ -1257,14 +1257,14 @@ DEFUN (ospf_area_vlink_intervals, 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; } @@ -1303,14 +1303,14 @@ DEFUN (no_ospf_area_vlink_intervals, 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; } @@ -1368,7 +1368,7 @@ DEFUN (ospf_area_shortcut, 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; } @@ -1422,7 +1422,7 @@ DEFUN (ospf_area_stub, if (ret == 0) { vty_out (vty, "First deconfigure all virtual link through this area%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -1452,7 +1452,7 @@ DEFUN (ospf_area_stub_no_summary, if (ret == 0) { vty_out (vty, "%% Area cannot be stub as it contains a virtual link%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -1519,7 +1519,7 @@ ospf_area_nssa_cmd_handler (struct vty *vty, int argc, struct cmd_token **argv, if (ret == 0) { vty_out (vty, "%% Area cannot be nssa as it contains a virtual link%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -1658,7 +1658,7 @@ DEFUN (ospf_area_default_cost, 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; } @@ -1701,7 +1701,7 @@ DEFUN (no_ospf_area_default_cost, 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; } @@ -2205,7 +2205,7 @@ DEFUN (ospf_timers_min_ls_interval, if (argc < 5) { - vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE); + vty_out (vty, "Insufficient arguments%s", VTYNL); return CMD_WARNING; } @@ -2247,7 +2247,7 @@ DEFUN (ospf_timers_min_ls_arrival, if (argc < 4) { - vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE); + vty_out (vty, "Insufficient arguments%s", VTYNL); return CMD_WARNING; } @@ -2292,7 +2292,7 @@ DEFUN (ospf_timers_throttle_spf, if (argc < 6) { - vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE); + vty_out (vty, "Insufficient arguments%s", VTYNL); return CMD_WARNING; } @@ -2335,7 +2335,7 @@ DEFUN (ospf_timers_lsa, 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; } @@ -2549,7 +2549,7 @@ DEFUN (ospf_auto_cost_reference_bandwidth, 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; } @@ -2580,8 +2580,8 @@ DEFUN (no_ospf_auto_cost_reference_bandwidth, 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); @@ -2608,7 +2608,7 @@ DEFUN (ospf_write_multiplier, 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; } @@ -2677,7 +2677,7 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar 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 { @@ -2714,11 +2714,11 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar 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); } } @@ -2731,7 +2731,7 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar 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) { @@ -2759,29 +2759,29 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar } 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); } } } @@ -2806,14 +2806,14 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar 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); } } @@ -2851,42 +2851,42 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar { /* 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) @@ -2900,16 +2900,16 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar { 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 @@ -2936,8 +2936,8 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } 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); } } @@ -2950,7 +2950,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) { vty_out (vty, " OSPF Routing Process, Router ID: %s%s", inet_ntoa (ospf->router_id), - VTY_NEWLINE); + VTYNL); } /* Graceful shutdown */ @@ -2966,7 +2966,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) { 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); } } @@ -2982,11 +2982,11 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } 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) @@ -3000,7 +3000,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char 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 */ @@ -3018,13 +3018,13 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) 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); } } @@ -3042,10 +3042,10 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) " 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) @@ -3071,13 +3071,13 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char 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) @@ -3101,20 +3101,20 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char 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. */ @@ -3124,7 +3124,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) 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)) { @@ -3132,7 +3132,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) 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. */ @@ -3147,7 +3147,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) { 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) @@ -3161,7 +3161,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char 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. */ @@ -3169,7 +3169,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) 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)) { @@ -3178,14 +3178,14 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) 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. */ @@ -3195,11 +3195,11 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) 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; } @@ -3267,11 +3267,10 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface } 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? */ @@ -3294,13 +3293,13 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface { 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; } } @@ -3376,27 +3375,25 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface } 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 { @@ -3417,8 +3414,8 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface { 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)); } } } @@ -3430,7 +3427,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface 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) @@ -3457,7 +3454,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface } else vty_out (vty, " <None>"); - vty_out (vty, "%s", VTY_NEWLINE); + vty_out (vty, "%s", VTYNL); } if (use_json) @@ -3482,7 +3479,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface 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) @@ -3498,14 +3495,14 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface 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) @@ -3516,7 +3513,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface 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); } } @@ -3540,8 +3537,8 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, 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) @@ -3569,7 +3566,7 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, 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 { @@ -3585,11 +3582,11 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, 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; } @@ -3646,10 +3643,10 @@ static void 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 @@ -3713,7 +3710,7 @@ show_ip_ospf_neighbor_sub (struct vty *vty, struct ospf_interface *oi, json_obje 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); } } } @@ -3738,8 +3735,8 @@ show_ip_ospf_neighbor_common (struct vty *vty, struct ospf *ospf, u_char use_jso 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)) @@ -3747,11 +3744,11 @@ show_ip_ospf_neighbor_common (struct vty *vty, struct ospf *ospf, u_char use_jso 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; } @@ -3818,8 +3815,8 @@ show_ip_ospf_neighbor_all_common (struct vty *vty, struct ospf *ospf, u_char use 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)) @@ -3851,7 +3848,7 @@ show_ip_ospf_neighbor_all_common (struct vty *vty, struct ospf *ospf, u_char use "-", 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); } } } @@ -3859,11 +3856,11 @@ show_ip_ospf_neighbor_all_common (struct vty *vty, struct ospf *ospf, u_char use 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; } @@ -3928,8 +3925,8 @@ show_ip_ospf_neighbor_int_common (struct vty *vty, struct ospf *ospf, int arg_ba 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); @@ -3938,7 +3935,7 @@ show_ip_ospf_neighbor_int_common (struct vty *vty, struct ospf *ospf, int arg_ba 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; } @@ -3954,11 +3951,11 @@ show_ip_ospf_neighbor_int_common (struct vty *vty, struct ospf *ospf, int arg_ba 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; } @@ -4022,7 +4019,7 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st 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) @@ -4032,7 +4029,7 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st } 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) @@ -4048,13 +4045,13 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st 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) @@ -4066,7 +4063,7 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st 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) @@ -4076,7 +4073,7 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st } 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); @@ -4105,7 +4102,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, 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) @@ -4115,7 +4112,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } 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) @@ -4131,7 +4128,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, 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) { @@ -4146,10 +4143,10 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, 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); } } @@ -4170,7 +4167,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, 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); } } @@ -4184,7 +4181,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, 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) @@ -4194,7 +4191,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } 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) @@ -4211,28 +4208,28 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, 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) @@ -4242,7 +4239,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } 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) @@ -4252,7 +4249,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } 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) @@ -4262,7 +4259,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } 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) @@ -4272,7 +4269,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } 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) { @@ -4304,15 +4301,15 @@ show_ip_ospf_neighbor_id_common (struct vty *vty, struct ospf *ospf, 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; } @@ -4326,11 +4323,11 @@ show_ip_ospf_neighbor_id_common (struct vty *vty, struct ospf *ospf, 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; } @@ -4392,8 +4389,8 @@ show_ip_ospf_neighbor_detail_common (struct vty *vty, struct ospf *ospf, u_char 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)) @@ -4418,11 +4415,11 @@ show_ip_ospf_neighbor_detail_common (struct vty *vty, struct ospf *ospf, u_char 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; } @@ -4484,8 +4481,8 @@ show_ip_ospf_neighbor_detail_all_common (struct vty *vty, struct ospf *ospf, u_c 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)) @@ -4514,12 +4511,12 @@ show_ip_ospf_neighbor_detail_all_common (struct vty *vty, struct ospf *ospf, u_c 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; @@ -4587,15 +4584,15 @@ show_ip_ospf_neighbor_int_detail_common (struct vty *vty, struct ospf *ospf, 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; } @@ -4619,11 +4616,11 @@ show_ip_ospf_neighbor_int_detail_common (struct vty *vty, struct ospf *ospf, 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; } @@ -4729,7 +4726,7 @@ show_lsa_summary (struct vty *vty, struct ospf_lsa *lsa, int self) default: break; } - vty_out (vty, VTY_NEWLINE); + vty_out (vty, VTYNL); } return 0; @@ -4772,15 +4769,13 @@ show_ip_ospf_database_header (struct vty *vty, struct ospf_lsa *lsa) { 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) { @@ -4793,19 +4788,16 @@ show_ip_ospf_database_header (struct vty *vty, struct ospf_lsa *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[] = @@ -4849,15 +4841,15 @@ show_ip_ospf_database_router_links (struct vty *vty, 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); } } @@ -4872,10 +4864,10 @@ show_router_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; @@ -4894,15 +4886,15 @@ show_network_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; @@ -4919,10 +4911,10 @@ show_summary_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; @@ -4939,10 +4931,10 @@ show_summary_asbr_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; @@ -4959,18 +4951,18 @@ show_as_external_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; @@ -5011,18 +5003,18 @@ show_as_nssa_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; @@ -5042,7 +5034,7 @@ show_opaque_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; } @@ -5122,15 +5114,15 @@ show_lsa_detail (struct vty *vty, struct ospf *ospf, int type, 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; @@ -5169,7 +5161,7 @@ show_lsa_detail_adv_router (struct vty *vty, struct ospf *ospf, int type, 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; @@ -5177,8 +5169,8 @@ show_lsa_detail_adv_router (struct vty *vty, struct ospf *ospf, int type, 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); } @@ -5213,13 +5205,13 @@ show_ip_ospf_database_summary (struct vty *vty, struct ospf *ospf, int self) 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); } } } @@ -5239,18 +5231,18 @@ show_ip_ospf_database_summary (struct vty *vty, struct ospf *ospf, int self) { 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 @@ -5259,7 +5251,7 @@ show_ip_ospf_database_maxage (struct vty *vty, struct ospf *ospf) 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)) { @@ -5267,13 +5259,13 @@ show_ip_ospf_database_maxage (struct vty *vty, struct ospf *ospf) 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); } } } @@ -5306,11 +5298,11 @@ show_ip_ospf_database_common (struct vty *vty, struct ospf *ospf, 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) @@ -5465,11 +5457,11 @@ show_ip_ospf_database_type_adv_router_common (struct vty *vty, struct ospf *ospf 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; @@ -5581,7 +5573,7 @@ DEFUN (ip_ospf_authentication_args, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -5605,7 +5597,7 @@ DEFUN (ip_ospf_authentication_args, 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; } @@ -5631,7 +5623,7 @@ DEFUN (ip_ospf_authentication, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -5673,14 +5665,14 @@ DEFUN (no_ip_ospf_authentication_args, 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; @@ -5703,7 +5695,7 @@ DEFUN (no_ip_ospf_authentication_args, } else { - vty_out (vty, "Unexpected input encountered%s", VTY_NEWLINE); + vty_out (vty, "Unexpected input encountered%s", VTYNL); return CMD_WARNING; } /* @@ -5763,14 +5755,14 @@ DEFUN (no_ip_ospf_authentication, 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; } @@ -5843,7 +5835,7 @@ DEFUN (ip_ospf_authentication_key, 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; } @@ -5889,7 +5881,7 @@ DEFUN (no_ip_ospf_authentication_key, 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; } @@ -5951,7 +5943,7 @@ DEFUN (ip_ospf_message_digest_key, 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; } @@ -5962,7 +5954,7 @@ DEFUN (ip_ospf_message_digest_key, 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; } @@ -6018,7 +6010,7 @@ DEFUN (no_ip_ospf_message_digest_key, 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; } @@ -6031,7 +6023,7 @@ DEFUN (no_ip_ospf_message_digest_key, 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; } @@ -6086,7 +6078,7 @@ DEFUN (ip_ospf_cost, if(!inet_aton(ifaddr, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -6141,7 +6133,7 @@ DEFUN (no_ip_ospf_cost, if (!inet_aton(ifaddr, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -6213,7 +6205,7 @@ ospf_vty_dead_interval_set (struct vty *vty, const char *interval_str, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -6240,7 +6232,7 @@ ospf_vty_dead_interval_set (struct vty *vty, const char *interval_str, else { vty_out (vty, "Please specify dead-interval or hello-multiplier%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -6340,7 +6332,7 @@ DEFUN (no_ip_ospf_dead_interval, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -6419,7 +6411,7 @@ DEFUN (ip_ospf_hello_interval, 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; } @@ -6466,7 +6458,7 @@ DEFUN (no_ip_ospf_hello_interval, 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; } @@ -6517,7 +6509,7 @@ DEFUN (ip_ospf_network, 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; } @@ -6646,7 +6638,7 @@ DEFUN (ip_ospf_priority, 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; } @@ -6708,7 +6700,7 @@ DEFUN (no_ip_ospf_priority, 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; } @@ -6779,7 +6771,7 @@ DEFUN (ip_ospf_retransmit_interval, 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; } @@ -6826,7 +6818,7 @@ DEFUN (no_ip_ospf_retransmit_interval, 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; } @@ -6883,7 +6875,7 @@ DEFUN (ip_ospf_transmit_delay, 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; } @@ -6929,7 +6921,7 @@ DEFUN (no_ip_ospf_transmit_delay, 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; } @@ -7007,12 +6999,12 @@ DEFUN (ip_ospf_area, 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; } @@ -7021,7 +7013,7 @@ DEFUN (ip_ospf_area, { vty_out (vty, "Must remove previous area config before changing ospf area %s", - VTY_NEWLINE); + VTYNL); return CMD_WARNING; } @@ -7044,7 +7036,7 @@ DEFUN (ip_ospf_area, { 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; } } @@ -7097,8 +7089,7 @@ DEFUN (no_ip_ospf_area, 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; } @@ -7234,14 +7225,14 @@ DEFUN (ospf_redistribute_instance_source, 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; } @@ -7300,14 +7291,14 @@ DEFUN (no_ospf_redistribute_instance_source, 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; } @@ -7672,7 +7663,7 @@ DEFUN (ip_ospf_mtu_ignore, 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); @@ -7715,7 +7706,7 @@ DEFUN (no_ip_ospf_mtu_ignore, 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); @@ -7895,16 +7886,16 @@ config_write_stub_router (struct vty *vty, struct ospf *ospf) 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; } } @@ -7920,7 +7911,7 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt) 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) @@ -7934,13 +7925,13 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt) 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; @@ -7953,15 +7944,15 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt) { 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 @@ -7974,7 +7965,7 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs) 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) { @@ -7995,7 +7986,7 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs) 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)) { @@ -8004,17 +7995,17 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs) 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 @@ -8026,7 +8017,7 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt) 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) { @@ -8038,11 +8029,11 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt) { 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; } @@ -8052,28 +8043,28 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt) { 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; } @@ -8083,7 +8074,7 @@ show_ip_ospf_border_routers_common (struct vty *vty, struct ospf *ospf) /* 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; } @@ -8128,12 +8119,12 @@ static int 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; } @@ -8146,7 +8137,7 @@ show_ip_ospf_route_common (struct vty *vty, struct ospf *ospf) /* 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; } @@ -8234,12 +8225,12 @@ config_write_interface (struct vty *vty) 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++; @@ -8256,7 +8247,7 @@ config_write_interface (struct vty *vty) 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); } } @@ -8291,7 +8282,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8302,7 +8293,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8312,7 +8303,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8321,7 +8312,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8331,7 +8322,7 @@ config_write_interface (struct vty *vty) 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); } @@ -8350,7 +8341,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8360,7 +8351,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8371,7 +8362,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8381,7 +8372,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8395,7 +8386,7 @@ config_write_interface (struct vty *vty) 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. */ @@ -8411,7 +8402,7 @@ config_write_interface (struct vty *vty) 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); } @@ -8460,7 +8451,7 @@ config_write_network_area (struct vty *vty, struct ospf *ospf) /* 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; @@ -8484,16 +8475,16 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) 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) @@ -8521,11 +8512,11 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) 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)) @@ -8546,24 +8537,24 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) 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; @@ -8587,7 +8578,7 @@ config_write_ospf_nbr_nbma (struct vty *vty, struct ospf *ospf) 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; @@ -8626,17 +8617,17 @@ config_write_virtual_link (struct vty *vty, struct ospf *ospf) 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)) @@ -8644,7 +8635,7 @@ config_write_virtual_link (struct vty *vty, struct ospf *ospf) " 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); } } @@ -8684,7 +8675,7 @@ config_write_ospf_redistribute (struct vty *vty, struct ospf *ospf) if (ROUTEMAP_NAME (red)) vty_out (vty, " route-map %s", ROUTEMAP_NAME (red)); - vty_out (vty, "%s", VTY_NEWLINE); + vty_out (vty, "%s", VTYNL); } } @@ -8696,7 +8687,7 @@ config_write_ospf_default_metric (struct vty *vty, struct ospf *ospf) { if (ospf->default_metric != -1) vty_out (vty, " default-metric %d%s", ospf->default_metric, - VTY_NEWLINE); + VTYNL); return 0; } @@ -8713,7 +8704,7 @@ config_write_ospf_distribute (struct vty *vty, struct ospf *ospf) 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) @@ -8736,7 +8727,7 @@ config_write_ospf_distribute (struct vty *vty, struct ospf *ospf) ROUTEMAP_NAME (red)); } - vty_out (vty, "%s", VTY_NEWLINE); + vty_out (vty, "%s", VTYNL); } } @@ -8751,7 +8742,7 @@ config_write_ospf_distance (struct vty *vty, struct ospf *ospf) 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 @@ -8766,7 +8757,7 @@ config_write_ospf_distance (struct vty *vty, struct ospf *ospf) 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)) @@ -8775,7 +8766,7 @@ config_write_ospf_distance (struct vty *vty, struct ospf *ospf) 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; } @@ -8795,9 +8786,9 @@ ospf_config_write (struct vty *vty) { /* `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++; @@ -8807,37 +8798,37 @@ ospf_config_write (struct vty *vty) /* 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. */ @@ -8846,20 +8837,20 @@ ospf_config_write (struct vty *vty) 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); @@ -8867,14 +8858,14 @@ ospf_config_write (struct vty *vty) /* 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) @@ -8883,7 +8874,7 @@ ospf_config_write (struct vty *vty) { 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)) { @@ -8901,7 +8892,7 @@ ospf_config_write (struct vty *vty) 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. */ @@ -9132,7 +9123,7 @@ DEFUN (clear_ip_ospf_interface, 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); } |