diff options
Diffstat (limited to 'ospfd/ospf_vty.c')
| -rw-r--r-- | ospfd/ospf_vty.c | 599 |
1 files changed, 275 insertions, 324 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index e0cbc842ec..98d36bb504 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -815,15 +815,13 @@ ospf_find_vl_data (struct ospf *ospf, struct ospf_vl_config_data *vl_config) if (area->external_routing != OSPF_AREA_DEFAULT) { if (vl_config->area_id_fmt == OSPF_AREA_ID_FMT_DOTTEDQUAD) - vty_out (vty, "Area %s is %s%s", + vty_out (vty, "Area %s is %s\n", inet_ntoa (area_id), - area->external_routing == OSPF_AREA_NSSA?"nssa":"stub", - VTYNL); + area->external_routing == OSPF_AREA_NSSA?"nssa":"stub"); else - vty_out (vty, "Area %ld is %s%s", + vty_out (vty, "Area %ld is %s\n", (u_long)ntohl (area_id.s_addr), - area->external_routing == OSPF_AREA_NSSA?"nssa":"stub", - VTYNL); + area->external_routing == OSPF_AREA_NSSA?"nssa":"stub"); return NULL; } @@ -868,8 +866,8 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data, if (ospf_crypt_key_lookup (IF_DEF_PARAMS (ifp)->auth_crypt, vl_config->crypto_key_id) != NULL) { - vty_out (vty, "OSPF: Key %d already exists%s", - vl_config->crypto_key_id, VTYNL); + vty_out (vty, "OSPF: Key %d already exists\n", + vl_config->crypto_key_id); return CMD_WARNING; } ck = ospf_crypt_key_new (); @@ -886,8 +884,8 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data, if (ospf_crypt_key_lookup (IF_DEF_PARAMS (ifp)->auth_crypt, vl_config->crypto_key_id) == NULL) { - vty_out (vty, "OSPF: Key %d does not exist%s", - vl_config->crypto_key_id, VTYNL); + vty_out (vty, "OSPF: Key %d does not exist\n", + vl_config->crypto_key_id); return CMD_WARNING; } @@ -1052,7 +1050,7 @@ DEFUN (ospf_area_vlink, for (i=5; i < argc; i++) { - /* vty_out (vty, "argv[%d]->arg - %s%s", i, argv[i]->text, VTYNL); */ + /* vty_out (vty, "argv[%d]->arg - %s\n", i, argv[i]->text); */ switch (argv[i]->arg[0]) { @@ -1184,7 +1182,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], VTYNL); */ + /* vty_out (vty, "argv[%d] - %s\n", i, argv[i]); */ switch (argv[i]->arg[0]) { @@ -2705,8 +2703,8 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar vty_out (vty, "\n"); 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", VTYNL); + vty_out (vty, ", S-bit consensus: %s\n", + area->shortcut_capability ? "ok" : "no"); } } @@ -2792,9 +2790,9 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar if (CHECK_FLAG(area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED)) vty_out (vty, " Administratively activated (indefinitely)\n"); if (area->t_stub_router) - vty_out (vty, " Active from startup, %s remaining%s", + vty_out (vty, " Active from startup, %s remaining\n", ospf_timer_dump (area->t_stub_router, timebuf, - sizeof(timebuf)), VTYNL); + sizeof(timebuf))); } } @@ -2848,26 +2846,26 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar " this area: %d%s", area->full_vls, VTYNL); /* Show SPF calculation times. */ - vty_out (vty, " SPF algorithm executed %d times%s", - area->spf_calculation, VTYNL); + vty_out (vty, " SPF algorithm executed %d times\n", + area->spf_calculation); /* Show number of LSA. */ - 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", + vty_out (vty, " Number of LSA %ld\n", area->lsdb->total); + vty_out (vty, " Number of router LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_ROUTER_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_ROUTER_LSA), VTYNL); - vty_out (vty, " Number of network LSA %ld. Checksum Sum 0x%08x%s", + ospf_lsdb_checksum (area->lsdb, OSPF_ROUTER_LSA)); + vty_out (vty, " Number of network LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_NETWORK_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_NETWORK_LSA), VTYNL); - vty_out (vty, " Number of summary LSA %ld. Checksum Sum 0x%08x%s", + ospf_lsdb_checksum (area->lsdb, OSPF_NETWORK_LSA)); + vty_out (vty, " Number of summary LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_SUMMARY_LSA), - 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_checksum (area->lsdb, OSPF_SUMMARY_LSA)); + vty_out (vty, " Number of ASBR summary LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_ASBR_SUMMARY_LSA), - 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_checksum (area->lsdb, OSPF_ASBR_SUMMARY_LSA)); + vty_out (vty, " Number of NSSA LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_AS_NSSA_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_AS_NSSA_LSA), VTYNL); + ospf_lsdb_checksum (area->lsdb, OSPF_AS_NSSA_LSA)); } if (use_json) @@ -2879,12 +2877,12 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar } else { - vty_out (vty, " Number of opaque link LSA %ld. Checksum Sum 0x%08x%s", + vty_out (vty, " Number of opaque link LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_OPAQUE_LINK_LSA), - 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_checksum (area->lsdb, OSPF_OPAQUE_LINK_LSA)); + vty_out (vty, " Number of opaque area LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_OPAQUE_AREA_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_AREA_LSA), VTYNL); + ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_AREA_LSA)); } if (use_json) @@ -2917,8 +2915,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } } @@ -2929,9 +2926,8 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " OSPF Routing Process, Router ID: %s%s", - inet_ntoa (ospf->router_id), - VTYNL); + vty_out (vty, " OSPF Routing Process, Router ID: %s\n", + inet_ntoa (ospf->router_id)); } /* Graceful shutdown */ @@ -2945,9 +2941,9 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Deferred shutdown in progress, %s remaining%s", + vty_out (vty, " Deferred shutdown in progress, %s remaining\n", ospf_timer_dump (ospf->t_deferred_shutdown, - timebuf, sizeof (timebuf)), VTYNL); + timebuf, sizeof (timebuf))); } } @@ -2965,9 +2961,9 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) { vty_out (vty, " Supports only single TOS (TOS0) routes\n"); vty_out (vty, " This implementation conforms to RFC2328\n"); - vty_out (vty, " RFC1583Compatibility flag is %s%s", + vty_out (vty, " RFC1583Compatibility flag is %s\n", CHECK_FLAG (ospf->config, OSPF_RFC1583_COMPATIBLE) ? - "enabled" : "disabled", VTYNL); + "enabled" : "disabled"); } if (use_json) @@ -2979,9 +2975,8 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " OpaqueCapability flag is %s%s", - CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE) ? "enabled" : "disabled", - VTYNL); + vty_out (vty, " OpaqueCapability flag is %s\n", + CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE) ? "enabled" : "disabled"); } /* Show stub-router configuration */ @@ -3000,11 +2995,11 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) { vty_out (vty, " Stub router advertisement is configured\n"); 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, VTYNL); + vty_out (vty, " Enabled for %us after start-up\n", + ospf->stub_router_startup_time); 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, VTYNL); + vty_out (vty, " Enabled for %us prior to full shutdown\n", + ospf->stub_router_shutdown_time); } } @@ -3049,12 +3044,10 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) if (ospf->ts_spf.tv_sec || ospf->ts_spf.tv_usec) { monotime_since(&ospf->ts_spf, &result); - vty_out (vty, "last executed %s ago%s", - ospf_timeval_dump (&result, timebuf, sizeof (timebuf)), - VTYNL); - vty_out (vty, " Last SPF duration %s%s", - ospf_timeval_dump (&ospf->ts_spf_duration, timebuf, sizeof (timebuf)), - VTYNL); + vty_out (vty, "last executed %s ago\n", + ospf_timeval_dump (&result, timebuf, sizeof (timebuf))); + vty_out (vty, " Last SPF duration %s\n", + ospf_timeval_dump (&ospf->ts_spf_duration, timebuf, sizeof (timebuf))); } else vty_out (vty, "has not been run\n"); @@ -3078,23 +3071,22 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " SPF timer %s%s%s", + vty_out (vty, " SPF timer %s%s\n", (ospf->t_spf_calc ? "due in " : "is "), - ospf_timer_dump (ospf->t_spf_calc, timebuf, sizeof (timebuf)), - VTYNL); + ospf_timer_dump (ospf->t_spf_calc, timebuf, sizeof (timebuf))); - vty_out (vty, " LSA minimum interval %d msecs%s", - ospf->min_ls_interval, VTYNL); - vty_out (vty, " LSA minimum arrival %d msecs%s", - ospf->min_ls_arrival, VTYNL); + vty_out (vty, " LSA minimum interval %d msecs\n", + ospf->min_ls_interval); + vty_out (vty, " LSA minimum arrival %d msecs\n", + ospf->min_ls_arrival); /* Show write multiplier values */ - vty_out (vty, " Write Multiplier set to %d %s", - ospf->write_oi_count, VTYNL); + vty_out (vty, " Write Multiplier set to %d \n", + ospf->write_oi_count); /* Show refresh parameters. */ - vty_out (vty, " Refresh timer %d secs%s", - ospf->lsa_refresh_interval, VTYNL); + vty_out (vty, " Refresh timer %d secs\n", + ospf->lsa_refresh_interval); } /* Show ABR/ASBR flags. */ @@ -3103,8 +3095,8 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) if (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], VTYNL); + vty_out (vty, " This router is an ABR, ABR type is: %s\n", + ospf_abr_type_descr_str[ospf->abr_type]); } if (CHECK_FLAG (ospf->flags, OSPF_FLAG_ASBR)) { @@ -3125,9 +3117,9 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Number of external LSA %ld. Checksum Sum 0x%08x%s", + vty_out (vty, " Number of external LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (ospf->lsdb, OSPF_AS_EXTERNAL_LSA), - ospf_lsdb_checksum (ospf->lsdb, OSPF_AS_EXTERNAL_LSA), VTYNL); + ospf_lsdb_checksum (ospf->lsdb, OSPF_AS_EXTERNAL_LSA)); } if (use_json) @@ -3139,17 +3131,17 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Number of opaque AS LSA %ld. Checksum Sum 0x%08x%s", + vty_out (vty, " Number of opaque AS LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (ospf->lsdb, OSPF_OPAQUE_AS_LSA), - ospf_lsdb_checksum (ospf->lsdb, OSPF_OPAQUE_AS_LSA), VTYNL); + ospf_lsdb_checksum (ospf->lsdb, OSPF_OPAQUE_AS_LSA)); } /* Show number of areas attached. */ if (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), VTYNL); + vty_out (vty, " Number of areas attached to this router: %d\n", + listcount (ospf->areas)); if (CHECK_FLAG(ospf->config, OSPF_LOG_ADJACENCY_CHANGES)) { @@ -3175,7 +3167,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -3405,8 +3397,8 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface if (use_json) 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), VTYNL); + vty_out (vty, " Saved Network-LSA sequence number 0x%x\n", + ntohl (oi->params->network_lsa_seqnum)); } if (use_json) @@ -3454,11 +3446,10 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface vty_out (vty, "%ds,", OSPF_IF_PARAM (oi, v_hello)); else vty_out (vty, "%dms,", 1000 / OSPF_IF_PARAM (oi, fast_hello)); - vty_out (vty, " Dead %ds, Wait %ds, Retransmit %d%s", + vty_out (vty, " Dead %ds, Wait %ds, Retransmit %d\n", OSPF_IF_PARAM (oi, v_wait), OSPF_IF_PARAM (oi, v_wait), - OSPF_IF_PARAM (oi, retransmit_interval), - VTYNL); + OSPF_IF_PARAM (oi, retransmit_interval)); } if (OSPF_IF_PASSIVE_STATUS (oi) == OSPF_IF_ACTIVE) @@ -3472,9 +3463,8 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface json_object_int_add(json_interface_sub, "timerHelloInMsecs", time_store); } else - vty_out (vty, " Hello due in %s%s", - ospf_timer_dump (oi->t_hello, timebuf, sizeof(timebuf)), - VTYNL); + vty_out (vty, " Hello due in %s\n", + ospf_timer_dump (oi->t_hello, timebuf, sizeof(timebuf))); } else /* passive-interface is set */ { @@ -3490,9 +3480,8 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface json_object_int_add(json_interface_sub, "nbrAdjacentCount", ospf_nbr_count (oi, NSM_Full)); } 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), - VTYNL); + vty_out (vty, " Neighbor Count is %d, Adjacent neighbor count is %d\n", + ospf_nbr_count (oi, 0), ospf_nbr_count (oi, NSM_Full)); ospf_bfd_interface_show(vty, ifp, json_interface_sub, use_json); } } @@ -3516,8 +3505,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } if (argc == iface_argv) @@ -3561,7 +3549,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -3621,10 +3609,9 @@ DEFUN (show_ip_ospf_instance_interface, static void show_ip_ospf_neighbour_header (struct vty *vty) { - vty_out (vty, "\n%-15s %3s %-15s %9s %-15s %-20s %5s %5s %5s%s", + vty_out (vty, "\n%-15s %3s %-15s %9s %-15s %-20s %5s %5s %5s\n", "Neighbor ID", "Pri", "State", "Dead Time", - "Address", "Interface", "RXmtL", "RqstL", "DBsmL", - VTYNL); + "Address", "Interface", "RXmtL", "RqstL", "DBsmL"); } static void @@ -3685,10 +3672,9 @@ show_ip_ospf_neighbor_sub (struct vty *vty, struct ospf_interface *oi, json_obje ospf_timer_dump (nbr->t_inactivity, timebuf, sizeof(timebuf))); vty_out (vty, "%-15s ", inet_ntoa (nbr->src)); - vty_out (vty, "%-20s %5ld %5ld %5d%s", + vty_out (vty, "%-20s %5ld %5ld %5d\n", IF_NAME (oi), ospf_ls_retransmit_count (nbr), - ospf_ls_request_count (nbr), ospf_db_summary_count (nbr), - VTYNL); + ospf_ls_request_count (nbr), ospf_db_summary_count (nbr)); } } } @@ -3713,8 +3699,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -3722,7 +3707,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -3793,8 +3778,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -3824,9 +3808,9 @@ show_ip_ospf_neighbor_all_common (struct vty *vty, struct ospf *ospf, u_char use { vty_out (vty, "%-15s %3d %-15s %9s ", "-", nbr_nbma->priority, "Down", "-"); - vty_out (vty, "%-15s %-20s %5d %5d %5d%s", + vty_out (vty, "%-15s %-20s %5d %5d %5d\n", inet_ntoa (nbr_nbma->addr), IF_NAME (oi), - 0, 0, 0, VTYNL); + 0, 0, 0); } } } @@ -3834,7 +3818,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -3903,8 +3887,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } ifp = if_lookup_by_name (argv[arg_base]->arg, VRF_DEFAULT); @@ -3929,7 +3912,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -3996,8 +3979,8 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st if (use_json) 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), VTYNL); + vty_out (vty, " interface address %s\n", + inet_ntoa (nbr_nbma->addr)); /* Show Area ID. */ if (use_json) @@ -4006,8 +3989,8 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st json_object_string_add(json_sub, "iface", IF_NAME (oi)); } else - vty_out (vty, " In the area %s via interface %s%s", - ospf_area_desc_string (oi->area), IF_NAME (oi), VTYNL); + vty_out (vty, " In the area %s via interface %s\n", + ospf_area_desc_string (oi->area), IF_NAME (oi)); /* Show neighbor priority and state. */ if (use_json) @@ -4023,13 +4006,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, VTYNL); + vty_out (vty, " %d state changes\n", nbr_nbma->state_change); /* 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, VTYNL); + vty_out (vty, " Poll interval %d\n", nbr_nbma->v_poll); /* Show poll-interval timer. */ if (use_json) @@ -4039,9 +4022,8 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st json_object_int_add(json_sub, "pollIntervalTimerDueMsec", time_store); } else - vty_out (vty, " Poll timer due in %s%s", - ospf_timer_dump (nbr_nbma->t_poll, timebuf, sizeof(timebuf)), - VTYNL); + vty_out (vty, " Poll timer due in %s\n", + ospf_timer_dump (nbr_nbma->t_poll, timebuf, sizeof(timebuf))); /* Show poll-interval timer thread. */ if (use_json) @@ -4050,8 +4032,8 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st json_object_string_add(json_sub, "pollIntervalTimerThread", "on"); } else - vty_out (vty, " Thread Poll Timer %s%s", - nbr_nbma->t_poll != NULL ? "on" : "off", VTYNL); + vty_out (vty, " Thread Poll Timer %s\n", + nbr_nbma->t_poll != NULL ? "on" : "off"); if (use_json) json_object_object_add(json, "noNbrId", json_sub); @@ -4079,8 +4061,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, if (use_json) 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), VTYNL); + vty_out (vty, " interface address %s\n", + inet_ntoa (nbr->address.u.prefix4)); /* Show Area ID. */ if (use_json) @@ -4089,8 +4071,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "ifaceName", oi->ifp->name); } else - vty_out (vty, " In the area %s via interface %s%s", - ospf_area_desc_string (oi->area), oi->ifp->name, VTYNL); + vty_out (vty, " In the area %s via interface %s\n", + ospf_area_desc_string (oi->area), oi->ifp->name); /* Show neighbor priority and state. */ if (use_json) @@ -4106,7 +4088,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, VTYNL); + vty_out (vty, " %d state changes\n", nbr->state_change); if (nbr->ts_last_progress.tv_sec || nbr->ts_last_progress.tv_usec) { @@ -4121,9 +4103,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, else { vty_out (vty, " Most recent state change statistics:\n"); - vty_out (vty, " Progressive change %s ago%s", - ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), - VTYNL); + vty_out (vty, " Progressive change %s ago\n", + ospf_timeval_dump (&res, timebuf, sizeof(timebuf))); } } @@ -4141,10 +4122,9 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } else { - vty_out (vty, " Regressive change %s ago, due to %s%s", + vty_out (vty, " Regressive change %s ago, due to %s\n", ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), - (nbr->last_regress_str ? nbr->last_regress_str : "??"), - VTYNL); + (nbr->last_regress_str ? nbr->last_regress_str : "??")); } } @@ -4158,7 +4138,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), VTYNL); + vty_out (vty, " BDR is %s\n", inet_ntoa (nbr->bd_router)); /* Show options. */ if (use_json) @@ -4167,8 +4147,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "optionsList", ospf_options_dump (nbr->options)); } else - vty_out (vty, " Options %d %s%s", nbr->options, - ospf_options_dump (nbr->options), VTYNL); + vty_out (vty, " Options %d %s\n", nbr->options, + ospf_options_dump (nbr->options)); /* Show Router Dead interval timer. */ if (use_json) @@ -4183,30 +4163,29 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_int_add(json_sub, "routerDeadIntervalTimerDueMsec", -1); } else - vty_out (vty, " Dead timer due in %s%s", - ospf_timer_dump (nbr->t_inactivity, timebuf, sizeof (timebuf)), - VTYNL); + vty_out (vty, " Dead timer due in %s\n", + ospf_timer_dump (nbr->t_inactivity, timebuf, sizeof (timebuf))); /* 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), VTYNL); + vty_out (vty, " Database Summary List %d\n", + ospf_db_summary_count (nbr)); /* 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), VTYNL); + vty_out (vty, " Link State Request List %ld\n", + ospf_ls_request_count (nbr)); /* 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), VTYNL); + vty_out (vty, " Link State Retransmission List %ld\n", + ospf_ls_retransmit_count (nbr)); /* Show inactivity timer thread. */ if (use_json) @@ -4215,8 +4194,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "threadInactivityTimer", "on"); } else - vty_out (vty, " Thread Inactivity Timer %s%s", - nbr->t_inactivity != NULL ? "on" : "off", VTYNL); + vty_out (vty, " Thread Inactivity Timer %s\n", + nbr->t_inactivity != NULL ? "on" : "off"); /* Show Database Description retransmission thread. */ if (use_json) @@ -4225,8 +4204,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "threadDatabaseDescriptionRetransmission", "on"); } else - vty_out (vty, " Thread Database Description Retransmision %s%s", - nbr->t_db_desc != NULL ? "on" : "off", VTYNL); + vty_out (vty, " Thread Database Description Retransmision %s\n", + nbr->t_db_desc != NULL ? "on" : "off"); /* Show Link State Request Retransmission thread. */ if (use_json) @@ -4235,8 +4214,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "threadLinkStateRequestRetransmission", "on"); } else - vty_out (vty, " Thread Link State Request Retransmission %s%s", - nbr->t_ls_req != NULL ? "on" : "off", VTYNL); + vty_out (vty, " Thread Link State Request Retransmission %s\n", + nbr->t_ls_req != NULL ? "on" : "off"); /* Show Link State Update Retransmission thread. */ if (use_json) @@ -4245,8 +4224,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "threadLinkStateUpdateRetransmission", "on"); } else - vty_out (vty, " Thread Link State Update Retransmission %s%s%s", - nbr->t_ls_upd != NULL ? "on" : "off", VTYNL, VTYNL); + vty_out (vty, " Thread Link State Update Retransmission %s\n\n", + nbr->t_ls_upd != NULL ? "on" : "off"); if (use_json) { @@ -4278,8 +4257,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } ret = inet_aton (argv[arg_base]->arg, &router_id); @@ -4300,7 +4278,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -4366,8 +4344,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -4392,7 +4369,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -4458,8 +4435,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -4488,7 +4464,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -4561,8 +4537,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } ifp = if_lookup_by_name (argv[arg_base]->arg, VRF_DEFAULT); @@ -4593,7 +4568,7 @@ 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), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else @@ -4774,7 +4749,7 @@ show_ip_ospf_database_header (struct vty *vty, struct ospf_lsa *lsa) vty_out (vty, " Advertising Router: %s\n", inet_ntoa (lsa->data->adv_router)); vty_out (vty, " LS Seq Number: %08lx\n", (u_long)ntohl (lsa->data->ls_seqnum)); vty_out (vty, " Checksum: 0x%04x\n", ntohs (lsa->data->checksum)); - vty_out (vty, " Length: %d%s\n", ntohs (lsa->data->length), VTYNL); + vty_out (vty, " Length: %d\n\n", ntohs (lsa->data->length)); } const char *link_type_desc[] = @@ -4817,15 +4792,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], VTYNL); - vty_out (vty, " (Link ID) %s: %s%s", link_id_desc[type], - 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), VTYNL); + vty_out (vty, " Link connected to: %s\n", + link_type_desc[type]); + vty_out (vty, " (Link ID) %s: %s\n", link_id_desc[type], + inet_ntoa (rl->link[i].link_id)); + vty_out (vty, " (Link Data) %s: %s\n", link_data_desc[type], + inet_ntoa (rl->link[i].link_data)); vty_out (vty, " Number of TOS metrics: 0\n"); - vty_out (vty, " TOS 0 Metric: %d%s", - ntohs (rl->link[i].metric), VTYNL); + vty_out (vty, " TOS 0 Metric: %d\n", + ntohs (rl->link[i].metric)); vty_out (vty, "\n"); } } @@ -4840,8 +4815,7 @@ 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), - VTYNL, VTYNL); + vty_out (vty, " Number of Links: %d\n\n", ntohs (rl->links)); show_ip_ospf_database_router_links (vty, rl); vty_out (vty, "\n"); @@ -4862,14 +4836,14 @@ 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), VTYNL); + vty_out (vty, " Network Mask: /%d\n", + ip_masklen (nl->mask)); 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]), VTYNL); + vty_out (vty, " Attached Router: %s\n", + inet_ntoa (nl->routers[i])); vty_out (vty, "\n"); } @@ -4887,10 +4861,8 @@ 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), - VTYNL); - vty_out (vty, " TOS: 0 Metric: %d%s", GET_METRIC (sl->metric), - VTYNL); + vty_out (vty, " Network Mask: /%d\n", ip_masklen (sl->mask)); + vty_out (vty, " TOS: 0 Metric: %d\n", GET_METRIC (sl->metric)); vty_out (vty, "\n"); } @@ -4907,10 +4879,9 @@ 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), VTYNL); - vty_out (vty, " TOS: 0 Metric: %d%s", GET_METRIC (sl->metric), - VTYNL); + vty_out (vty, " Network Mask: /%d\n", + ip_masklen (sl->mask)); + vty_out (vty, " TOS: 0 Metric: %d\n", GET_METRIC (sl->metric)); vty_out (vty, "\n"); } @@ -4927,16 +4898,16 @@ 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), VTYNL); - vty_out (vty, " Metric Type: %s%s", + vty_out (vty, " Network Mask: /%d\n", + ip_masklen (al->mask)); + vty_out (vty, " Metric Type: %s\n", IS_EXTERNAL_METRIC (al->e[0].tos) ? - "2 (Larger than any link state path)" : "1", VTYNL); + "2 (Larger than any link state path)" : "1"); vty_out (vty, " TOS: 0\n"); - vty_out (vty, " Metric: %d%s", - GET_METRIC (al->e[0].metric), VTYNL); - vty_out (vty, " Forward Address: %s%s", - inet_ntoa (al->e[0].fwd_addr), VTYNL); + vty_out (vty, " Metric: %d\n", + GET_METRIC (al->e[0].metric)); + vty_out (vty, " Forward Address: %s\n", + inet_ntoa (al->e[0].fwd_addr)); vty_out (vty, " External Route Tag: %"ROUTE_TAG_PRI"%s%s", (route_tag_t)ntohl (al->e[0].route_tag), VTYNL, VTYNL); @@ -4979,16 +4950,16 @@ 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), VTYNL); - vty_out (vty, " Metric Type: %s%s", + vty_out (vty, " Network Mask: /%d\n", + ip_masklen (al->mask)); + vty_out (vty, " Metric Type: %s\n", IS_EXTERNAL_METRIC (al->e[0].tos) ? - "2 (Larger than any link state path)" : "1", VTYNL); + "2 (Larger than any link state path)" : "1"); vty_out (vty, " TOS: 0\n"); - vty_out (vty, " Metric: %d%s", - GET_METRIC (al->e[0].metric), VTYNL); - vty_out (vty, " NSSA: Forward Address: %s%s", - inet_ntoa (al->e[0].fwd_addr), VTYNL); + vty_out (vty, " Metric: %d\n", + GET_METRIC (al->e[0].metric)); + vty_out (vty, " NSSA: Forward Address: %s\n", + inet_ntoa (al->e[0].fwd_addr)); vty_out (vty, " External Route Tag: %"ROUTE_TAG_PRI"%s%s", (route_tag_t)ntohl (al->e[0].route_tag), VTYNL, VTYNL); @@ -5089,16 +5060,15 @@ show_lsa_detail (struct vty *vty, struct ospf *ospf, int type, { case OSPF_AS_EXTERNAL_LSA: case OSPF_OPAQUE_AS_LSA: - vty_out (vty, " %s %s%s", - show_database_desc[type], - VTYNL, VTYNL); + vty_out (vty, " %s \n\n", + show_database_desc[type]); 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, "\n %s (Area %s)%s%s", show_database_desc[type], - ospf_area_desc_string (area), VTYNL, VTYNL); + vty_out (vty, "\n %s (Area %s)\n\n", show_database_desc[type], + ospf_area_desc_string (area)); show_lsa_detail_proc (vty, AREA_LSDB (area, type), id, adv_router); } break; @@ -5135,17 +5105,16 @@ show_lsa_detail_adv_router (struct vty *vty, struct ospf *ospf, int type, { case OSPF_AS_EXTERNAL_LSA: case OSPF_OPAQUE_AS_LSA: - vty_out (vty, " %s %s%s", - show_database_desc[type], - VTYNL, VTYNL); + vty_out (vty, " %s \n\n", + show_database_desc[type]); show_lsa_detail_adv_router_proc (vty, AS_LSDB (ospf, type), adv_router); break; default: for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area)) { - vty_out (vty, "\n %s (Area %s)%s%s", show_database_desc[type], - ospf_area_desc_string (area), VTYNL, VTYNL); + vty_out (vty, "\n %s (Area %s)\n\n", show_database_desc[type], + ospf_area_desc_string (area)); show_lsa_detail_adv_router_proc (vty, AREA_LSDB (area, type), adv_router); } @@ -5177,11 +5146,10 @@ show_ip_ospf_database_summary (struct vty *vty, struct ospf *ospf, int self) if (ospf_lsdb_count_self (area->lsdb, type) > 0 || (!self && ospf_lsdb_count (area->lsdb, type) > 0)) { - vty_out (vty, " %s (Area %s)%s%s", + vty_out (vty, " %s (Area %s)\n\n", show_database_desc[type], - ospf_area_desc_string (area), - VTYNL, VTYNL); - vty_out (vty, "%s%s", show_database_header[type], VTYNL); + ospf_area_desc_string (area)); + vty_out (vty, "%s\n", show_database_header[type]); LSDB_LOOP (AREA_LSDB (area, type), rn, lsa) show_lsa_summary (vty, lsa, self); @@ -5204,11 +5172,9 @@ show_ip_ospf_database_summary (struct vty *vty, struct ospf *ospf, int self) if (ospf_lsdb_count_self (ospf->lsdb, type) || (!self && ospf_lsdb_count (ospf->lsdb, type))) { - vty_out (vty, " %s%s%s", - show_database_desc[type], - VTYNL, VTYNL); - vty_out (vty, "%s%s", show_database_header[type], - VTYNL); + vty_out (vty, " %s\n\n", + show_database_desc[type]); + vty_out (vty, "%s\n", show_database_header[type]); LSDB_LOOP (AS_LSDB (ospf, type), rn, lsa) show_lsa_summary (vty, lsa, self); @@ -5233,12 +5199,12 @@ 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, VTYNL); - vty_out (vty, "Link State ID: %s%s", - inet_ntoa (lsa->data->id), VTYNL); - vty_out (vty, "Advertising Router: %s%s", - inet_ntoa (lsa->data->adv_router), VTYNL); - vty_out (vty, "LSA lock count: %d%s", lsa->lock, VTYNL); + vty_out (vty, "Link type: %d\n", lsa->data->type); + vty_out (vty, "Link State ID: %s\n", + inet_ntoa (lsa->data->id)); + vty_out (vty, "Advertising Router: %s\n", + inet_ntoa (lsa->data->adv_router)); + vty_out (vty, "LSA lock count: %d\n", lsa->lock); vty_out (vty, "\n"); } } @@ -5272,11 +5238,10 @@ show_ip_ospf_database_common (struct vty *vty, struct ospf *ospf, struct in_addr id, adv_router; if (ospf->instance) - vty_out (vty, "\nOSPF Instance: %d%s", ospf->instance, - VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n", ospf->instance); - vty_out (vty, "\n OSPF Router with ID (%s)%s%s", - inet_ntoa (ospf->router_id), VTYNL, VTYNL); + vty_out (vty, "\n OSPF Router with ID (%s)\n\n", + inet_ntoa (ospf->router_id)); /* Show all LSA. */ if (argc == arg_base + 4) @@ -5431,11 +5396,10 @@ 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, "\nOSPF Instance: %d%s", ospf->instance, - VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n", ospf->instance); - vty_out (vty, "\n OSPF Router with ID (%s)%s%s", - inet_ntoa (ospf->router_id), VTYNL, VTYNL); + vty_out (vty, "\n OSPF Router with ID (%s)\n\n", + inet_ntoa (ospf->router_id)); /* Set database type to show. */ if (strncmp (argv[arg_base + idx_type]->text, "r", 1) == 0) @@ -5904,7 +5868,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, VTYNL); + vty_out (vty, "OSPF: Key %d already exists\n", key_id); return CMD_WARNING; } @@ -5972,7 +5936,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, VTYNL); + vty_out (vty, "OSPF: Key %d does not exist\n", key_id); return CMD_WARNING; } @@ -7806,11 +7770,11 @@ config_write_stub_router (struct vty *vty, struct ospf *ospf) struct ospf_area *area; 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, VTYNL); + vty_out (vty, " max-metric router-lsa on-startup %u\n", + ospf->stub_router_startup_time); 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, VTYNL); + vty_out (vty, " max-metric router-lsa on-shutdown %u\n", + ospf->stub_router_shutdown_time); for (ALL_LIST_ELEMENTS_RO (ospf->areas, ln, area)) { if (CHECK_FLAG (area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED)) @@ -7843,14 +7807,14 @@ 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), VTYNL); + vty_out (vty, "N IA %-18s [%d] area: %s\n", buf1, or->cost, + inet_ntoa (or->u.std.area_id)); else if (or->type == OSPF_DESTINATION_DISCARD) - vty_out (vty, "D IA %-18s Discard entry%s", buf1, VTYNL); + vty_out (vty, "D IA %-18s Discard entry\n", buf1); 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), VTYNL); + vty_out (vty, "N %-18s [%d] area: %s\n", buf1, or->cost, + inet_ntoa (or->u.std.area_id)); break; default: break; @@ -7862,12 +7826,12 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt) if (if_lookup_by_index(path->ifindex, VRF_DEFAULT)) { if (path->nexthop.s_addr == 0) - vty_out (vty, "%24s directly attached to %s%s", - "", ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL); + vty_out (vty, "%24s directly attached to %s\n", + "", ifindex2ifname (path->ifindex, VRF_DEFAULT)); else - vty_out (vty, "%24s via %s, %s%s", "", + vty_out (vty, "%24s via %s, %s\n", "", inet_ntoa (path->nexthop), - ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL); + ifindex2ifname (path->ifindex, VRF_DEFAULT)); } } } @@ -7901,24 +7865,21 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs) (or->path_type == OSPF_PATH_INTER_AREA ? "IA" : " "), or->cost, inet_ntoa (or->u.std.area_id)); /* Show flags. */ - vty_out (vty, "%s%s%s", + vty_out (vty, "%s%s\n", (or->u.std.flags & ROUTER_LSA_BORDER ? ", ABR" : ""), - (or->u.std.flags & ROUTER_LSA_EXTERNAL ? ", ASBR" : ""), - VTYNL); + (or->u.std.flags & ROUTER_LSA_EXTERNAL ? ", ASBR" : "")); for (ALL_LIST_ELEMENTS_RO (or->paths, pnode, path)) { if (if_lookup_by_index(path->ifindex, VRF_DEFAULT)) { if (path->nexthop.s_addr == 0) - vty_out (vty, "%24s directly attached to %s%s", - "", ifindex2ifname (path->ifindex, VRF_DEFAULT), - VTYNL); + vty_out (vty, "%24s directly attached to %s\n", + "", ifindex2ifname (path->ifindex, VRF_DEFAULT)); else - vty_out (vty, "%24s via %s, %s%s", "", + vty_out (vty, "%24s via %s, %s\n", "", inet_ntoa (path->nexthop), - ifindex2ifname (path->ifindex, VRF_DEFAULT), - VTYNL); + ifindex2ifname (path->ifindex, VRF_DEFAULT)); } } } @@ -7959,13 +7920,12 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt) if (if_lookup_by_index(path->ifindex, VRF_DEFAULT)) { if (path->nexthop.s_addr == 0) - vty_out (vty, "%24s directly attached to %s%s", - "", ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL); + vty_out (vty, "%24s directly attached to %s\n", + "", ifindex2ifname (path->ifindex, VRF_DEFAULT)); else - vty_out (vty, "%24s via %s, %s%s", "", + vty_out (vty, "%24s via %s, %s\n", "", inet_ntoa (path->nexthop), - ifindex2ifname (path->ifindex, VRF_DEFAULT), - VTYNL); + ifindex2ifname (path->ifindex, VRF_DEFAULT)); } } } @@ -7976,8 +7936,7 @@ static int show_ip_ospf_border_routers_common (struct vty *vty, struct ospf *ospf) { if (ospf->instance) - vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); if (ospf->new_table == NULL) { @@ -8036,8 +7995,7 @@ static int show_ip_ospf_route_common (struct vty *vty, struct ospf *ospf) { if (ospf->instance) - vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); if (ospf->new_table == NULL) { @@ -8143,11 +8101,9 @@ config_write_interface (struct vty *vty) continue; vty_out (vty, "!\n"); - vty_out (vty, "interface %s%s", ifp->name, - VTYNL); + vty_out (vty, "interface %s\n", ifp->name); if (ifp->desc) - vty_out (vty, " description %s%s", ifp->desc, - VTYNL); + vty_out (vty, " description %s\n", ifp->desc); write++; @@ -8366,9 +8322,9 @@ config_write_network_area (struct vty *vty, struct ospf *ospf) (unsigned long int) ntohl (n->area_id.s_addr)); /* Network print. */ - vty_out (vty, " network %s/%d area %s%s", + vty_out (vty, " network %s/%d area %s\n", inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen, - buf, VTYNL); + buf); } return 0; @@ -8392,16 +8348,15 @@ 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, VTYNL); + vty_out (vty, " area %s authentication\n", buf); else - vty_out (vty, " area %s authentication message-digest%s", - buf, VTYNL); + vty_out (vty, " area %s authentication message-digest\n", + buf); } if (area->shortcut_configured != OSPF_SHORTCUT_DEFAULT) - vty_out (vty, " area %s shortcut %s%s", buf, - ospf_shortcut_mode_str[area->shortcut_configured], - VTYNL); + vty_out (vty, " area %s shortcut %s\n", buf, + ospf_shortcut_mode_str[area->shortcut_configured]); if ((area->external_routing == OSPF_AREA_STUB) || (area->external_routing == OSPF_AREA_NSSA) @@ -8432,8 +8387,8 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) vty_out (vty, "\n"); if (area->default_cost != 1) - vty_out (vty, " area %s default-cost %d%s", buf, - area->default_cost, VTYNL); + vty_out (vty, " area %s default-cost %d\n", buf, + area->default_cost); } for (rn1 = route_top (area->ranges); rn1; rn1 = route_next (rn1)) @@ -8458,20 +8413,20 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) } if (EXPORT_NAME (area)) - vty_out (vty, " area %s export-list %s%s", buf, - EXPORT_NAME (area), VTYNL); + vty_out (vty, " area %s export-list %s\n", buf, + EXPORT_NAME (area)); if (IMPORT_NAME (area)) - vty_out (vty, " area %s import-list %s%s", buf, - IMPORT_NAME (area), VTYNL); + vty_out (vty, " area %s import-list %s\n", buf, + IMPORT_NAME (area)); if (PREFIX_NAME_IN (area)) - vty_out (vty, " area %s filter-list prefix %s in%s", buf, - PREFIX_NAME_IN (area), VTYNL); + vty_out (vty, " area %s filter-list prefix %s in\n", buf, + PREFIX_NAME_IN (area)); if (PREFIX_NAME_OUT (area)) - vty_out (vty, " area %s filter-list prefix %s out%s", buf, - PREFIX_NAME_OUT (area), VTYNL); + vty_out (vty, " area %s filter-list prefix %s out\n", buf, + PREFIX_NAME_OUT (area)); } return 0; @@ -8527,24 +8482,22 @@ config_write_virtual_link (struct vty *vty, struct ospf *ospf) OSPF_IF_PARAM (oi, v_wait) != OSPF_ROUTER_DEAD_INTERVAL_DEFAULT || OSPF_IF_PARAM (oi, retransmit_interval) != OSPF_RETRANSMIT_INTERVAL_DEFAULT || OSPF_IF_PARAM (oi, transmit_delay) != OSPF_TRANSMIT_DELAY_DEFAULT) - vty_out (vty, " area %s virtual-link %s hello-interval %d retransmit-interval %d transmit-delay %d dead-interval %d%s", + vty_out (vty, " area %s virtual-link %s hello-interval %d retransmit-interval %d transmit-delay %d dead-interval %d\n", buf, inet_ntoa (vl_data->vl_peer), OSPF_IF_PARAM (oi, v_hello), OSPF_IF_PARAM (oi, retransmit_interval), OSPF_IF_PARAM (oi, transmit_delay), - OSPF_IF_PARAM (oi, v_wait), - VTYNL); + OSPF_IF_PARAM (oi, v_wait)); else - vty_out (vty, " area %s virtual-link %s%s", buf, - inet_ntoa (vl_data->vl_peer), VTYNL); + vty_out (vty, " area %s virtual-link %s\n", buf, + inet_ntoa (vl_data->vl_peer)); /* 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", + vty_out (vty, " area %s virtual-link %s authentication-key %s\n", buf, inet_ntoa (vl_data->vl_peer), - IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_simple, - VTYNL); + IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_simple); /* md5 keys */ for (ALL_LIST_ELEMENTS_RO (IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_crypt, n2, ck)) @@ -8603,8 +8556,7 @@ static int 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, - VTYNL); + vty_out (vty, " default-metric %d\n", ospf->default_metric); return 0; } @@ -8619,9 +8571,9 @@ config_write_ospf_distribute (struct vty *vty, struct ospf *ospf) /* distribute-list print. */ for (type = 0; type < ZEBRA_ROUTE_MAX; type++) if (DISTRIBUTE_NAME (ospf, type)) - vty_out (vty, " distribute-list %s out %s%s", + vty_out (vty, " distribute-list %s out %s\n", DISTRIBUTE_NAME (ospf, type), - zebra_route_string(type), VTYNL); + zebra_route_string(type)); /* default-information print. */ if (ospf->default_originate != DEFAULT_ORIGINATE_NONE) @@ -8659,7 +8611,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, VTYNL); + vty_out (vty, " distance %d\n", ospf->distance_all); if (ospf->distance_intra || ospf->distance_inter @@ -8680,10 +8632,9 @@ config_write_ospf_distance (struct vty *vty, struct ospf *ospf) for (rn = route_top (ospf->distance_table); rn; rn = route_next (rn)) if ((odistance = rn->info) != NULL) { - vty_out (vty, " distance %d %s/%d %s%s", odistance->distance, + vty_out (vty, " distance %d %s/%d %s\n", odistance->distance, inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen, - odistance->access_list ? odistance->access_list : "", - VTYNL); + odistance->access_list ? odistance->access_list : ""); } return 0; } @@ -8703,7 +8654,7 @@ ospf_config_write (struct vty *vty) { /* `router ospf' print. */ if (ospf->instance) - vty_out (vty, "router ospf %d%s", ospf->instance, VTYNL); + vty_out (vty, "router ospf %d\n", ospf->instance); else vty_out (vty, "router ospf\n"); @@ -8714,13 +8665,13 @@ 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), VTYNL); + vty_out (vty, " ospf router-id %s\n", + inet_ntoa (ospf->router_id_static)); /* 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], VTYNL); + vty_out (vty, " ospf abr-type %s\n", + ospf_abr_type_str[ospf->abr_type]); /* log-adjacency-changes flag print. */ if (CHECK_FLAG(ospf->config, OSPF_LOG_ADJACENCY_CHANGES)) @@ -8744,38 +8695,38 @@ ospf_config_write (struct vty *vty) { vty_out (vty, "! Important: ensure reference bandwidth " "is consistent across all routers%s", VTYNL); - vty_out (vty, " auto-cost reference-bandwidth %d%s", - ospf->ref_bandwidth, VTYNL); + vty_out (vty, " auto-cost reference-bandwidth %d\n", + ospf->ref_bandwidth); } /* SPF timers print. */ if (ospf->spf_delay != OSPF_SPF_DELAY_DEFAULT || ospf->spf_holdtime != OSPF_SPF_HOLDTIME_DEFAULT || ospf->spf_max_holdtime != OSPF_SPF_MAX_HOLDTIME_DEFAULT) - vty_out (vty, " timers throttle spf %d %d %d%s", + vty_out (vty, " timers throttle spf %d %d %d\n", ospf->spf_delay, ospf->spf_holdtime, - ospf->spf_max_holdtime, VTYNL); + ospf->spf_max_holdtime); /* 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, VTYNL); + vty_out (vty, " timers throttle lsa all %d\n", + ospf->min_ls_interval); if (ospf->min_ls_arrival != OSPF_MIN_LS_ARRIVAL) - vty_out (vty, " timers lsa min-arrival %d%s", - ospf->min_ls_arrival, VTYNL); + vty_out (vty, " timers lsa min-arrival %d\n", + ospf->min_ls_arrival); /* 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, VTYNL); + vty_out (vty, " ospf write-multiplier %d\n", + ospf->write_oi_count); /* 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, VTYNL); + vty_out (vty, " refresh timer %d\n", + ospf->lsa_refresh_interval); /* Redistribute information print. */ config_write_ospf_redistribute (vty, ospf); @@ -8789,9 +8740,9 @@ ospf_config_write (struct vty *vty) && IF_DEF_PARAMS (ifp)->passive_interface != ospf->passive_interface_default) { - vty_out (vty, " %spassive-interface %s%s", + vty_out (vty, " %spassive-interface %s\n", IF_DEF_PARAMS (ifp)->passive_interface ? "" : "no ", - ifp->name, VTYNL); + ifp->name); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) { @@ -8806,10 +8757,10 @@ ospf_config_write (struct vty *vty) else if (oi->params->passive_interface == ospf->passive_interface_default) continue; - vty_out (vty, " %spassive-interface %s %s%s", + vty_out (vty, " %spassive-interface %s %s\n", oi->params->passive_interface ? "" : "no ", oi->ifp->name, - inet_ntoa (oi->address->u.prefix4), VTYNL); + inet_ntoa (oi->address->u.prefix4)); } /* Network area print. */ |
