diff options
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/interface.c | 232 | ||||
-rw-r--r-- | zebra/irdp_interface.c | 16 | ||||
-rw-r--r-- | zebra/router-id.c | 4 | ||||
-rw-r--r-- | zebra/rtadv.c | 54 | ||||
-rw-r--r-- | zebra/zebra_fpm.c | 12 | ||||
-rw-r--r-- | zebra/zebra_mpls.c | 24 | ||||
-rw-r--r-- | zebra/zebra_mpls_vty.c | 44 | ||||
-rw-r--r-- | zebra/zebra_ptm.c | 8 | ||||
-rw-r--r-- | zebra/zebra_routemap.c | 82 | ||||
-rw-r--r-- | zebra/zebra_vrf.c | 4 | ||||
-rw-r--r-- | zebra/zebra_vty.c | 140 | ||||
-rw-r--r-- | zebra/zserv.c | 94 |
12 files changed, 357 insertions, 357 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index b8426c689..e2def4a49 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -976,11 +976,11 @@ nd_dump_vty (struct vty *vty, struct interface *ifp) if (rtadv->AdvSendAdvertisements) { - vty_outln (vty, " ND advertised reachable time is %d milliseconds", + vty_out (vty, " ND advertised reachable time is %d milliseconds\n", rtadv->AdvReachableTime); - vty_outln (vty, " ND advertised retransmit interval is %d milliseconds", + vty_out (vty, " ND advertised retransmit interval is %d milliseconds\n", rtadv->AdvRetransTimer); - vty_outln (vty, " ND router advertisements sent: %d rcvd: %d", + vty_out (vty, " ND router advertisements sent: %d rcvd: %d\n", zif->ra_sent, zif->ra_rcvd); interval = rtadv->MaxRtrAdvInterval; if (interval % 1000) @@ -990,32 +990,32 @@ nd_dump_vty (struct vty *vty, struct interface *ifp) vty_outln (vty, " ND router advertisements are sent every " "%d seconds",interval / 1000); if (rtadv->AdvDefaultLifetime != -1) - vty_outln (vty, " ND router advertisements live for %d seconds", + vty_out (vty, " ND router advertisements live for %d seconds\n", rtadv->AdvDefaultLifetime); else - vty_outln (vty, - " ND router advertisements lifetime tracks ra-interval"); + vty_out (vty, + " ND router advertisements lifetime tracks ra-interval\n"); vty_outln (vty, " ND router advertisement default router preference is " "%s",rtadv_pref_strs[rtadv->DefaultPreference]); if (rtadv->AdvManagedFlag) - vty_outln (vty," Hosts use DHCP to obtain routable addresses."); + vty_out (vty," Hosts use DHCP to obtain routable addresses.\n"); else - vty_outln (vty," Hosts use stateless autoconfig for addresses."); + vty_out (vty," Hosts use stateless autoconfig for addresses.\n"); if (rtadv->AdvHomeAgentFlag) { vty_outln (vty, " ND router advertisements with " "Home Agent flag bit set."); if (rtadv->HomeAgentLifetime != -1) - vty_outln (vty, " Home Agent lifetime is %u seconds", + vty_out (vty, " Home Agent lifetime is %u seconds\n", rtadv->HomeAgentLifetime); else - vty_outln (vty," Home Agent lifetime tracks ra-lifetime"); - vty_outln (vty, " Home Agent preference is %u", + vty_out (vty," Home Agent lifetime tracks ra-lifetime\n"); + vty_out (vty, " Home Agent preference is %u\n", rtadv->HomeAgentPreference); } if (rtadv->AdvIntervalOption) - vty_outln (vty, - " ND router advertisements with Adv. Interval option."); + vty_out (vty, + " ND router advertisements with Adv. Interval option.\n"); } } #endif /* HAVE_RTADV */ @@ -1039,36 +1039,36 @@ if_dump_vty (struct vty *vty, struct interface *ifp) if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) { if (if_is_running(ifp)) - vty_outln (vty, "is up"); + vty_out (vty, "is up\n"); else - vty_outln (vty, "is down"); + vty_out (vty, "is down\n"); } else { - vty_outln (vty, "detection is disabled"); + vty_out (vty, "detection is disabled\n"); } } else { - vty_outln (vty, "down"); + vty_out (vty, "down\n"); } - vty_outln (vty, " Link ups: %5u last: %s", zebra_if->up_count, + vty_out (vty, " Link ups: %5u last: %s\n", zebra_if->up_count, zebra_if->up_last[0] ? zebra_if->up_last : "(never)"); - vty_outln (vty, " Link downs: %5u last: %s", zebra_if->down_count, + vty_out (vty, " Link downs: %5u last: %s\n", zebra_if->down_count, zebra_if->down_last[0] ? zebra_if->down_last : "(never)"); zebra_ptm_show_status(vty, ifp); vrf = vrf_lookup_by_id (ifp->vrf_id); - vty_outln (vty, " vrf: %s", vrf->name); + vty_out (vty, " vrf: %s\n", vrf->name); if (ifp->desc) - vty_outln (vty, " Description: %s",ifp->desc); + vty_out (vty, " Description: %s\n",ifp->desc); if (ifp->ifindex == IFINDEX_INTERNAL) { - vty_outln (vty, " pseudo interface"); + vty_out (vty, " pseudo interface\n"); return; } else if (! CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) { - vty_outln (vty, " index %d inactive interface", + vty_out (vty, " index %d inactive interface\n", ifp->ifindex); return; } @@ -1077,11 +1077,11 @@ if_dump_vty (struct vty *vty, struct interface *ifp) ifp->ifindex, ifp->metric, ifp->mtu, ifp->speed); if (ifp->mtu6 != ifp->mtu) vty_out (vty, "mtu6 %d ", ifp->mtu6); - vty_outln (vty, "%s flags: %s", VTYNL, + vty_out (vty, "%s flags: %s\n", VTYNL, if_flag_dump(ifp->flags)); /* Hardware address. */ - vty_outln (vty, " Type: %s", if_link_type_str(ifp->ll_type)); + vty_out (vty, " Type: %s\n", if_link_type_str(ifp->ll_type)); if (ifp->hw_addr_len != 0) { int i; @@ -1119,23 +1119,23 @@ if_dump_vty (struct vty *vty, struct interface *ifp) { int i; struct if_link_params *iflp = ifp->link_params; - vty_outln (vty, " Traffic Engineering Link Parameters:"); + vty_out (vty, " Traffic Engineering Link Parameters:\n"); if (IS_PARAM_SET(iflp, LP_TE_METRIC)) - vty_outln (vty, " TE metric %u",iflp->te_metric); + vty_out (vty, " TE metric %u\n",iflp->te_metric); if (IS_PARAM_SET(iflp, LP_MAX_BW)) - vty_outln (vty, " Maximum Bandwidth %g (Byte/s)", iflp->max_bw); + vty_out (vty, " Maximum Bandwidth %g (Byte/s)\n", iflp->max_bw); if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW)) - vty_outln (vty, " Maximum Reservable Bandwidth %g (Byte/s)", + vty_out (vty, " Maximum Reservable Bandwidth %g (Byte/s)\n", iflp->max_rsv_bw); if (IS_PARAM_SET(iflp, LP_UNRSV_BW)) { - vty_outln (vty, " Unreserved Bandwidth per Class Type in Byte/s:"); + vty_out (vty, " Unreserved Bandwidth per Class Type in Byte/s:\n"); for (i = 0; i < MAX_CLASS_TYPE; i+=2) - vty_outln (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", + vty_out (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)\n", i, iflp->unrsv_bw[i], i+1, iflp->unrsv_bw[i + 1]); } if (IS_PARAM_SET(iflp, LP_ADM_GRP)) - vty_outln (vty, " Administrative Group:%u", iflp->admin_grp); + vty_out (vty, " Administrative Group:%u\n", iflp->admin_grp); if (IS_PARAM_SET(iflp, LP_DELAY)) { vty_out(vty, " Link Delay Average: %u (micro-sec.)", iflp->av_delay); @@ -1147,18 +1147,18 @@ if_dump_vty (struct vty *vty, struct interface *ifp) vty_out (vty, VTYNL); } if (IS_PARAM_SET(iflp, LP_DELAY_VAR)) - vty_outln (vty, " Link Delay Variation %u (micro-sec.)", + vty_out (vty, " Link Delay Variation %u (micro-sec.)\n", iflp->delay_var); if (IS_PARAM_SET(iflp, LP_PKT_LOSS)) - vty_outln (vty, " Link Packet Loss %g (in %%)", iflp->pkt_loss); + vty_out (vty, " Link Packet Loss %g (in %%)\n", iflp->pkt_loss); if (IS_PARAM_SET(iflp, LP_AVA_BW)) - vty_outln (vty, " Available Bandwidth %g (Byte/s)", iflp->ava_bw); + vty_out (vty, " Available Bandwidth %g (Byte/s)\n", iflp->ava_bw); if (IS_PARAM_SET(iflp, LP_RES_BW)) - vty_outln (vty, " Residual Bandwidth %g (Byte/s)", iflp->res_bw); + vty_out (vty, " Residual Bandwidth %g (Byte/s)\n", iflp->res_bw); if (IS_PARAM_SET(iflp, LP_USE_BW)) - vty_outln (vty, " Utilized Bandwidth %g (Byte/s)", iflp->use_bw); + vty_out (vty, " Utilized Bandwidth %g (Byte/s)\n", iflp->use_bw); if (IS_PARAM_SET(iflp, LP_RMT_AS)) - vty_outln (vty, " Neighbor ASBR IP: %s AS: %u ", inet_ntoa(iflp->rmt_ip), + vty_out (vty, " Neighbor ASBR IP: %s AS: %u \n", inet_ntoa(iflp->rmt_ip), iflp->rmt_as); } @@ -1169,7 +1169,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) nd_dump_vty (vty, ifp); #endif /* HAVE_RTADV */ if (listhead(ifp->nbr_connected)) - vty_outln (vty, " Neighbor address(s):"); + vty_out (vty, " Neighbor address(s):\n"); for (ALL_LIST_ELEMENTS_RO (ifp->nbr_connected, node, nbr_connected)) nbr_connected_dump_vty (vty, nbr_connected); @@ -1186,10 +1186,10 @@ if_dump_vty (struct vty *vty, struct interface *ifp) ifp->stats.rx_over_errors, ifp->stats.rx_crc_errors, ifp->stats.rx_frame_errors); - vty_outln (vty, " %lu fifo, %lu missed", ifp->stats.rx_fifo_errors, + vty_out (vty, " %lu fifo, %lu missed\n", ifp->stats.rx_fifo_errors, ifp->stats.rx_missed_errors); - vty_outln (vty, " %lu output packets, %lu bytes, %lu dropped", + vty_out (vty, " %lu output packets, %lu bytes, %lu dropped\n", ifp->stats.tx_packets, ifp->stats.tx_bytes, ifp->stats.tx_dropped); @@ -1199,7 +1199,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) ifp->stats.tx_carrier_errors, ifp->stats.tx_fifo_errors, ifp->stats.tx_heartbeat_errors); - vty_outln (vty, " %lu window, %lu collisions", + vty_out (vty, " %lu window, %lu collisions\n", ifp->stats.tx_window_errors, ifp->stats.collisions); #endif /* HAVE_PROC_NET_DEV */ @@ -1213,7 +1213,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) (unsigned long long)ifp->stats.ifi_iqdrops, (unsigned long long)ifp->stats.ifi_imcasts); - vty_outln (vty, " input errors %llu", + vty_out (vty, " input errors %llu\n", (unsigned long long)ifp->stats.ifi_ierrors); vty_outln (vty, " output packets %llu, bytes %llu," @@ -1222,10 +1222,10 @@ if_dump_vty (struct vty *vty, struct interface *ifp) (unsigned long long)ifp->stats.ifi_obytes, (unsigned long long)ifp->stats.ifi_omcasts); - vty_outln (vty, " output errors %llu", + vty_out (vty, " output errors %llu\n", (unsigned long long)ifp->stats.ifi_oerrors); - vty_outln (vty, " collisions %llu", + vty_out (vty, " collisions %llu\n", (unsigned long long)ifp->stats.ifi_collisions); #else /* Statistics print out using sysctl (). */ @@ -1234,17 +1234,17 @@ if_dump_vty (struct vty *vty, struct interface *ifp) ifp->stats.ifi_ipackets, ifp->stats.ifi_ibytes, ifp->stats.ifi_iqdrops,ifp->stats.ifi_imcasts); - vty_outln (vty, " input errors %lu", + vty_out (vty, " input errors %lu\n", ifp->stats.ifi_ierrors); - vty_outln (vty, " output packets %lu, bytes %lu, multicast packets %lu", + vty_out (vty, " output packets %lu, bytes %lu, multicast packets %lu\n", ifp->stats.ifi_opackets, ifp->stats.ifi_obytes, ifp->stats.ifi_omcasts); - vty_outln (vty, " output errors %lu", + vty_out (vty, " output errors %lu\n", ifp->stats.ifi_oerrors); - vty_outln (vty, " collisions %lu", + vty_out (vty, " collisions %lu\n", ifp->stats.ifi_collisions); #endif /* __bsdi__ || __NetBSD__ */ #endif /* HAVE_NET_RT_IFLIST */ @@ -1340,7 +1340,7 @@ DEFUN (show_interface_name_vrf, ifp = if_lookup_by_name (argv[idx_ifname]->arg, vrf_id); if (ifp == NULL) { - vty_outln (vty, "%% Can't find interface %s",argv[idx_ifname]->arg); + vty_out (vty, "%% Can't find interface %s\n",argv[idx_ifname]->arg); return CMD_WARNING; } if_dump_vty (vty, ifp); @@ -1378,7 +1378,7 @@ DEFUN (show_interface_name_vrf_all, if (!found) { - vty_outln (vty, "%% Can't find interface %s", argv[idx_ifname]->arg); + vty_out (vty, "%% Can't find interface %s\n", argv[idx_ifname]->arg); return CMD_WARNING; } @@ -1392,7 +1392,7 @@ if_show_description (struct vty *vty, vrf_id_t vrf_id) struct listnode *node; struct interface *ifp; - vty_outln (vty, "Interface Status Protocol Description"); + vty_out (vty, "Interface Status Protocol Description\n"); for (ALL_LIST_ELEMENTS_RO (vrf_iflist (vrf_id), node, ifp)) { int len; @@ -1458,7 +1458,7 @@ DEFUN (show_interface_desc_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if (!list_isempty (vrf->iflist)) { - vty_outln (vty, "%s\tVRF %u%s", VTYNL, vrf->vrf_id, + vty_out (vty, "%s\tVRF %u%s\n", VTYNL, vrf->vrf_id, VTYNL); if_show_description (vty, vrf->vrf_id); } @@ -1480,7 +1480,7 @@ DEFUN (multicast, ret = if_set_flags (ifp, IFF_MULTICAST); if (ret < 0) { - vty_outln (vty, "Can't set multicast flag"); + vty_out (vty, "Can't set multicast flag\n"); return CMD_WARNING; } if_refresh (ifp); @@ -1506,7 +1506,7 @@ DEFUN (no_multicast, ret = if_unset_flags (ifp, IFF_MULTICAST); if (ret < 0) { - vty_outln (vty, "Can't unset multicast flag"); + vty_out (vty, "Can't unset multicast flag\n"); return CMD_WARNING; } if_refresh (ifp); @@ -1572,7 +1572,7 @@ DEFUN (shutdown_if, ret = if_unset_flags (ifp, IFF_UP); if (ret < 0) { - vty_outln (vty, "Can't shutdown interface"); + vty_out (vty, "Can't shutdown interface\n"); return CMD_WARNING; } if_refresh (ifp); @@ -1598,7 +1598,7 @@ DEFUN (no_shutdown_if, ret = if_set_flags (ifp, IFF_UP | IFF_RUNNING); if (ret < 0) { - vty_outln (vty, "Can't up interface"); + vty_out (vty, "Can't up interface\n"); return CMD_WARNING; } if_refresh (ifp); @@ -1630,7 +1630,7 @@ DEFUN (bandwidth_if, /* bandwidth range is <1-100000> */ if (bandwidth < 1 || bandwidth > 100000) { - vty_outln (vty, "Bandwidth is invalid"); + vty_out (vty, "Bandwidth is invalid\n"); return CMD_WARNING; } @@ -1832,7 +1832,7 @@ DEFUN (link_params_maxbw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_maxbw: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "link_params_maxbw: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING; } @@ -1850,8 +1850,8 @@ DEFUN (link_params_maxbw, || (bw <= iflp->res_bw) || (bw <= iflp->use_bw)) { - vty_outln (vty, - "Maximum Bandwidth could not be lower than others bandwidth"); + vty_out (vty, + "Maximum Bandwidth could not be lower than others bandwidth\n"); return CMD_WARNING; } @@ -1874,7 +1874,7 @@ DEFUN (link_params_max_rsv_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_max_rsv_bw: fscanf: %s", + vty_out (vty, "link_params_max_rsv_bw: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING; } @@ -1882,8 +1882,8 @@ DEFUN (link_params_max_rsv_bw, /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "Maximum Reservable Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "Maximum Reservable Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING; } @@ -1911,14 +1911,14 @@ DEFUN (link_params_unrsv_bw, /* We don't have to consider about range check here. */ if (sscanf (argv[idx_number]->arg, "%d", &priority) != 1) { - vty_outln (vty, "link_params_unrsv_bw: fscanf: %s", + vty_out (vty, "link_params_unrsv_bw: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING; } if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_unrsv_bw: fscanf: %s", + vty_out (vty, "link_params_unrsv_bw: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING; } @@ -1926,8 +1926,8 @@ DEFUN (link_params_unrsv_bw, /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "UnReserved Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "UnReserved Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING; } @@ -1951,7 +1951,7 @@ DEFUN (link_params_admin_grp, if (sscanf (argv[idx_bitpattern]->arg, "0x%lx", &value) != 1) { - vty_outln (vty, "link_params_admin_grp: fscanf: %s", + vty_out (vty, "link_params_admin_grp: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING; } @@ -1995,7 +1995,7 @@ DEFUN (link_params_inter_as, if (!inet_aton (argv[idx_ipv4]->arg, &addr)) { - vty_outln (vty, "Please specify Router-Addr by A.B.C.D"); + vty_out (vty, "Please specify Router-Addr by A.B.C.D\n"); return CMD_WARNING; } @@ -2069,7 +2069,7 @@ DEFUN (link_params_delay, if (IS_PARAM_SET(iflp, LP_MM_DELAY) && (delay <= iflp->min_delay || delay >= iflp->max_delay)) { - vty_outln (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay", + vty_out (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay\n", iflp->min_delay, iflp->max_delay); return CMD_WARNING; } @@ -2094,7 +2094,7 @@ DEFUN (link_params_delay, /* Check new delays value coherency */ if (delay <= low || delay >= high) { - vty_outln (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay", + vty_out (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay\n", low, high); return CMD_WARNING; } @@ -2190,7 +2190,7 @@ DEFUN (link_params_pkt_loss, if (sscanf (argv[idx_percentage]->arg, "%g", &fval) != 1) { - vty_outln (vty, "link_params_pkt_loss: fscanf: %s", + vty_out (vty, "link_params_pkt_loss: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING; } @@ -2231,15 +2231,15 @@ DEFUN (link_params_res_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_res_bw: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "link_params_res_bw: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "Residual Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "Residual Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING; } @@ -2277,15 +2277,15 @@ DEFUN (link_params_ava_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_ava_bw: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "link_params_ava_bw: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "Available Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "Available Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING; } @@ -2323,15 +2323,15 @@ DEFUN (link_params_use_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_use_bw: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "link_params_use_bw: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "Utilised Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "Utilised Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING; } @@ -2372,13 +2372,13 @@ ip_address_install (struct vty *vty, struct interface *ifp, ret = str2prefix_ipv4 (addr_str, &cp); if (ret <= 0) { - vty_outln (vty, "%% Malformed address "); + vty_out (vty, "%% Malformed address \n"); return CMD_WARNING; } if (ipv4_martian(&cp.prefix)) { - vty_outln (vty, "%% Invalid address"); + vty_out (vty, "%% Invalid address\n"); return CMD_WARNING; } @@ -2429,7 +2429,7 @@ ip_address_install (struct vty *vty, struct interface *ifp, ret = if_set_prefix (ifp, ifc); if (ret < 0) { - vty_outln (vty, "%% Can't set interface IP address: %s.", + vty_out (vty, "%% Can't set interface IP address: %s.\n", safe_strerror(errno)); return CMD_WARNING; } @@ -2456,7 +2456,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, ret = str2prefix_ipv4 (addr_str, &cp); if (ret <= 0) { - vty_outln (vty, "%% Malformed address "); + vty_out (vty, "%% Malformed address \n"); return CMD_WARNING; } @@ -2464,7 +2464,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, ifc = connected_check (ifp, (struct prefix *) &cp); if (! ifc) { - vty_outln (vty, "%% Can't find address"); + vty_out (vty, "%% Can't find address\n"); return CMD_WARNING; } @@ -2487,7 +2487,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, ret = if_unset_prefix (ifp, ifc); if (ret < 0) { - vty_outln (vty, "%% Can't unset interface IP address: %s.", + vty_out (vty, "%% Can't unset interface IP address: %s.\n", safe_strerror(errno)); return CMD_WARNING; } @@ -2572,13 +2572,13 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, ret = str2prefix_ipv6 (addr_str, &cp); if (ret <= 0) { - vty_outln (vty, "%% Malformed address "); + vty_out (vty, "%% Malformed address \n"); return CMD_WARNING; } if (ipv6_martian(&cp.prefix)) { - vty_outln (vty, "%% Invalid address"); + vty_out (vty, "%% Invalid address\n"); return CMD_WARNING; } @@ -2625,7 +2625,7 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, if (ret < 0) { - vty_outln (vty, "%% Can't set interface IP address: %s.", + vty_out (vty, "%% Can't set interface IP address: %s.\n", safe_strerror(errno)); return CMD_WARNING; } @@ -2665,7 +2665,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, ret = str2prefix_ipv6 (addr_str, &cp); if (ret <= 0) { - vty_outln (vty, "%% Malformed address "); + vty_out (vty, "%% Malformed address \n"); return CMD_WARNING; } @@ -2673,7 +2673,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, ifc = connected_check (ifp, (struct prefix *) &cp); if (! ifc) { - vty_outln (vty, "%% Can't find address"); + vty_out (vty, "%% Can't find address\n"); return CMD_WARNING; } @@ -2696,7 +2696,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, ret = if_prefix_delete_ipv6 (ifp, ifc); if (ret < 0) { - vty_outln (vty, "%% Can't unset interface IP address: %s.", + vty_out (vty, "%% Can't unset interface IP address: %s.\n", safe_strerror(errno)); return CMD_WARNING; } @@ -2742,23 +2742,23 @@ link_params_config_write (struct vty *vty, struct interface *ifp) struct if_link_params *iflp = ifp->link_params; - vty_outln (vty, " link-params"); - vty_outln (vty, " enable"); + vty_out (vty, " link-params\n"); + vty_out (vty, " enable\n"); if (IS_PARAM_SET(iflp, LP_TE_METRIC) && iflp->te_metric != ifp->metric) - vty_outln (vty, " metric %u",iflp->te_metric); + vty_out (vty, " metric %u\n",iflp->te_metric); if (IS_PARAM_SET(iflp, LP_MAX_BW) && iflp->max_bw != iflp->default_bw) - vty_outln (vty, " max-bw %g", iflp->max_bw); + vty_out (vty, " max-bw %g\n", iflp->max_bw); if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW) && iflp->max_rsv_bw != iflp->default_bw) - vty_outln (vty, " max-rsv-bw %g", iflp->max_rsv_bw); + vty_out (vty, " max-rsv-bw %g\n", iflp->max_rsv_bw); if (IS_PARAM_SET(iflp, LP_UNRSV_BW)) { for (i = 0; i < 8; i++) if (iflp->unrsv_bw[i] != iflp->default_bw) - vty_outln (vty, " unrsv-bw %d %g", + vty_out (vty, " unrsv-bw %d %g\n", i, iflp->unrsv_bw[i]); } if (IS_PARAM_SET(iflp, LP_ADM_GRP)) - vty_outln (vty, " admin-grp 0x%x", iflp->admin_grp); + vty_out (vty, " admin-grp 0x%x\n", iflp->admin_grp); if (IS_PARAM_SET(iflp, LP_DELAY)) { vty_out(vty, " delay %u", iflp->av_delay); @@ -2770,19 +2770,19 @@ link_params_config_write (struct vty *vty, struct interface *ifp) vty_out (vty, VTYNL); } if (IS_PARAM_SET(iflp, LP_DELAY_VAR)) - vty_outln (vty, " delay-variation %u", iflp->delay_var); + vty_out (vty, " delay-variation %u\n", iflp->delay_var); if (IS_PARAM_SET(iflp, LP_PKT_LOSS)) - vty_outln (vty, " packet-loss %g", iflp->pkt_loss); + vty_out (vty, " packet-loss %g\n", iflp->pkt_loss); if (IS_PARAM_SET(iflp, LP_AVA_BW)) - vty_outln (vty, " ava-bw %g", iflp->ava_bw); + vty_out (vty, " ava-bw %g\n", iflp->ava_bw); if (IS_PARAM_SET(iflp, LP_RES_BW)) - vty_outln (vty, " res-bw %g", iflp->res_bw); + vty_out (vty, " res-bw %g\n", iflp->res_bw); if (IS_PARAM_SET(iflp, LP_USE_BW)) - vty_outln (vty, " use-bw %g", iflp->use_bw); + vty_out (vty, " use-bw %g\n", iflp->use_bw); if (IS_PARAM_SET(iflp, LP_RMT_AS)) - vty_outln (vty, " neighbor %s as %u", inet_ntoa(iflp->rmt_ip), + vty_out (vty, " neighbor %s as %u\n", inet_ntoa(iflp->rmt_ip), iflp->rmt_as); - vty_outln (vty, " exit-link-params"); + vty_out (vty, " exit-link-params\n"); return 0; } @@ -2808,28 +2808,28 @@ if_config_write (struct vty *vty) vrf = vrf_lookup_by_id (ifp->vrf_id); if (ifp->vrf_id == VRF_DEFAULT) - vty_outln (vty, "interface %s", ifp->name); + vty_out (vty, "interface %s\n", ifp->name); else - vty_outln (vty, "interface %s vrf %s", ifp->name,vrf->name); + vty_out (vty, "interface %s vrf %s\n", ifp->name,vrf->name); if (if_data) { if (if_data->shutdown == IF_ZEBRA_SHUTDOWN_ON) - vty_outln (vty, " shutdown"); + vty_out (vty, " shutdown\n"); zebra_ptm_if_write(vty, if_data); } if (ifp->desc) - vty_outln (vty, " description %s",ifp->desc); + vty_out (vty, " description %s\n",ifp->desc); /* Assign bandwidth here to avoid unnecessary interface flap while processing config script */ if (ifp->bandwidth != 0) - vty_outln (vty, " bandwidth %u", ifp->bandwidth); + vty_out (vty, " bandwidth %u\n", ifp->bandwidth); if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) - vty_outln (vty, " no link-detect"); + vty_out (vty, " no link-detect\n"); for (ALL_LIST_ELEMENTS_RO (ifp->connected, addrnode, ifc)) { @@ -2851,7 +2851,7 @@ if_config_write (struct vty *vty) if (if_data) { if (if_data->multicast != IF_ZEBRA_MULTICAST_UNSPEC) - vty_outln (vty, " %smulticast", + vty_out (vty, " %smulticast\n", if_data->multicast == IF_ZEBRA_MULTICAST_ON ? "" : "no "); } @@ -2865,7 +2865,7 @@ if_config_write (struct vty *vty) link_params_config_write (vty, ifp); - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return 0; } diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index ca932ac43..4f19a873b 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -343,28 +343,28 @@ void irdp_config_write (struct vty *vty, struct interface *ifp) if(irdp->flags & IF_ACTIVE || irdp->flags & IF_SHUTDOWN) { if( irdp->flags & IF_SHUTDOWN) - vty_outln (vty, " ip irdp shutdown "); + vty_out (vty, " ip irdp shutdown \n"); if( irdp->flags & IF_BROADCAST) - vty_outln (vty, " ip irdp broadcast"); + vty_out (vty, " ip irdp broadcast\n"); else - vty_outln (vty, " ip irdp multicast"); + vty_out (vty, " ip irdp multicast\n"); - vty_outln (vty, " ip irdp preference %ld", + vty_out (vty, " ip irdp preference %ld\n", irdp->Preference); for (ALL_LIST_ELEMENTS_RO (irdp->AdvPrefList, node, adv)) - vty_outln (vty, " ip irdp address %s preference %d", + vty_out (vty, " ip irdp address %s preference %d\n", inet_2a(adv->ip.s_addr, b1), adv->pref); - vty_outln (vty, " ip irdp holdtime %d", + vty_out (vty, " ip irdp holdtime %d\n", irdp->Lifetime); - vty_outln (vty, " ip irdp minadvertinterval %ld", + vty_out (vty, " ip irdp minadvertinterval %ld\n", irdp->MinAdvertInterval); - vty_outln (vty, " ip irdp maxadvertinterval %ld", + vty_out (vty, " ip irdp maxadvertinterval %ld\n", irdp->MaxAdvertInterval); } diff --git a/zebra/router-id.c b/zebra/router-id.c index 07caef7ab..7e3e28631 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -202,10 +202,10 @@ router_id_write (struct vty *vty) if (zvrf->rid_user_assigned.u.prefix4.s_addr) { if (zvrf_id (zvrf) == VRF_DEFAULT) - vty_outln (vty, "router-id %s", + vty_out (vty, "router-id %s\n", inet_ntoa(zvrf->rid_user_assigned.u.prefix4)); else - vty_outln (vty, "router-id %s vrf %s", + vty_out (vty, "router-id %s vrf %s\n", inet_ntoa (zvrf->rid_user_assigned.u.prefix4), zvrf_name(zvrf)); } diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 677189751..1ba8dd7d1 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -877,8 +877,8 @@ DEFUN (ipv6_nd_suppress_ra, if (if_is_loopback (ifp) || CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK)) { - vty_outln (vty, - "Cannot configure IPv6 Router Advertisements on this interface"); + vty_out (vty, + "Cannot configure IPv6 Router Advertisements on this interface\n"); return CMD_WARNING; } @@ -901,8 +901,8 @@ DEFUN (no_ipv6_nd_suppress_ra, if (if_is_loopback (ifp) || CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK)) { - vty_outln (vty, - "Cannot configure IPv6 Router Advertisements on this interface"); + vty_out (vty, + "Cannot configure IPv6 Router Advertisements on this interface\n"); return CMD_WARNING; } @@ -931,8 +931,8 @@ DEFUN (ipv6_nd_ra_interval_msec, interval = strtoul(argv[idx_number]->arg, NULL, 10); if ((zif->rtadv.AdvDefaultLifetime != -1 && interval > (unsigned)zif->rtadv.AdvDefaultLifetime * 1000)) { - vty_outln (vty, - "This ra-interval would conflict with configured ra-lifetime!"); + vty_out (vty, + "This ra-interval would conflict with configured ra-lifetime!\n"); return CMD_WARNING; } @@ -968,8 +968,8 @@ DEFUN (ipv6_nd_ra_interval, interval = strtoul(argv[idx_number]->arg, NULL, 10); if ((zif->rtadv.AdvDefaultLifetime != -1 && interval > (unsigned)zif->rtadv.AdvDefaultLifetime)) { - vty_outln (vty, - "This ra-interval would conflict with configured ra-lifetime!"); + vty_out (vty, + "This ra-interval would conflict with configured ra-lifetime!\n"); return CMD_WARNING; } @@ -1036,8 +1036,8 @@ DEFUN (ipv6_nd_ra_lifetime, * MaxRtrAdvInterval and 9000 seconds. -- RFC4861, 6.2.1 */ if ((lifetime != 0 && lifetime * 1000 < zif->rtadv.MaxRtrAdvInterval)) { - vty_outln (vty, - "This ra-lifetime would conflict with configured ra-interval"); + vty_out (vty, + "This ra-lifetime would conflict with configured ra-interval\n"); return CMD_WARNING; } @@ -1333,7 +1333,7 @@ DEFUN (ipv6_nd_prefix, ret = str2prefix_ipv6 (prefix, &rp.prefix); if (!ret) { - vty_outln (vty, "Malformed IPv6 prefix"); + vty_out (vty, "Malformed IPv6 prefix\n"); return CMD_WARNING; } apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */ @@ -1349,7 +1349,7 @@ DEFUN (ipv6_nd_prefix, rp.AdvPreferredLifetime = strmatch (preflifetime, "infinite") ? UINT32_MAX : strtoll (preflifetime, NULL, 10); if (rp.AdvPreferredLifetime > rp.AdvValidLifetime) { - vty_outln (vty, "Invalid preferred lifetime"); + vty_out (vty, "Invalid preferred lifetime\n"); return CMD_WARNING; } } @@ -1386,7 +1386,7 @@ DEFUN (no_ipv6_nd_prefix, ret = str2prefix_ipv6 (prefix, &rp.prefix); if (!ret) { - vty_outln (vty, "Malformed IPv6 prefix"); + vty_out (vty, "Malformed IPv6 prefix\n"); return CMD_WARNING; } apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */ @@ -1394,7 +1394,7 @@ DEFUN (no_ipv6_nd_prefix, ret = rtadv_prefix_reset (zebra_if, &rp); if (!ret) { - vty_outln (vty, "Non-existant IPv6 prefix"); + vty_out (vty, "Non-existant IPv6 prefix\n"); return CMD_WARNING; } @@ -1495,49 +1495,49 @@ rtadv_config_write (struct vty *vty, struct interface *ifp) CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK))) { if (zif->rtadv.AdvSendAdvertisements) - vty_outln (vty, " no ipv6 nd suppress-ra"); + vty_out (vty, " no ipv6 nd suppress-ra\n"); } interval = zif->rtadv.MaxRtrAdvInterval; if (interval % 1000) - vty_outln (vty, " ipv6 nd ra-interval msec %d",interval); + vty_out (vty, " ipv6 nd ra-interval msec %d\n",interval); else if (interval != RTADV_MAX_RTR_ADV_INTERVAL) - vty_outln (vty, " ipv6 nd ra-interval %d",interval / 1000); + vty_out (vty, " ipv6 nd ra-interval %d\n",interval / 1000); if (zif->rtadv.AdvIntervalOption) - vty_outln (vty, " ipv6 nd adv-interval-option"); + vty_out (vty, " ipv6 nd adv-interval-option\n"); if (zif->rtadv.AdvDefaultLifetime != -1) - vty_outln (vty, " ipv6 nd ra-lifetime %d",zif->rtadv.AdvDefaultLifetime); + vty_out (vty, " ipv6 nd ra-lifetime %d\n",zif->rtadv.AdvDefaultLifetime); if (zif->rtadv.HomeAgentPreference) - vty_outln (vty, " ipv6 nd home-agent-preference %u", + vty_out (vty, " ipv6 nd home-agent-preference %u\n", zif->rtadv.HomeAgentPreference); if (zif->rtadv.HomeAgentLifetime != -1) - vty_outln (vty, " ipv6 nd home-agent-lifetime %u", + vty_out (vty, " ipv6 nd home-agent-lifetime %u\n", zif->rtadv.HomeAgentLifetime); if (zif->rtadv.AdvHomeAgentFlag) - vty_outln (vty, " ipv6 nd home-agent-config-flag"); + vty_out (vty, " ipv6 nd home-agent-config-flag\n"); if (zif->rtadv.AdvReachableTime) - vty_outln (vty, " ipv6 nd reachable-time %d", + vty_out (vty, " ipv6 nd reachable-time %d\n", zif->rtadv.AdvReachableTime); if (zif->rtadv.AdvManagedFlag) - vty_outln (vty, " ipv6 nd managed-config-flag"); + vty_out (vty, " ipv6 nd managed-config-flag\n"); if (zif->rtadv.AdvOtherConfigFlag) - vty_outln (vty, " ipv6 nd other-config-flag"); + vty_out (vty, " ipv6 nd other-config-flag\n"); if (zif->rtadv.DefaultPreference != RTADV_PREF_MEDIUM) - vty_outln (vty, " ipv6 nd router-preference %s", + vty_out (vty, " ipv6 nd router-preference %s\n", rtadv_pref_strs[zif->rtadv.DefaultPreference]); if (zif->rtadv.AdvLinkMTU) - vty_outln (vty, " ipv6 nd mtu %d", zif->rtadv.AdvLinkMTU); + vty_out (vty, " ipv6 nd mtu %d\n", zif->rtadv.AdvLinkMTU); for (ALL_LIST_ELEMENTS_RO (zif->rtadv.AdvPrefixList, node, rprefix)) { diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 3e408c929..b765b51b9 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -1438,7 +1438,7 @@ zfpm_start_stats_timer (void) */ #define ZFPM_SHOW_STAT(counter) \ do { \ - vty_outln (vty, "%-40s %10lu %16lu", #counter, total_stats.counter, \ + vty_out (vty, "%-40s %10lu %16lu\n", #counter, total_stats.counter, \ zfpm_g->last_ivl_stats.counter); \ } while (0) @@ -1451,7 +1451,7 @@ zfpm_show_stats (struct vty *vty) zfpm_stats_t total_stats; time_t elapsed; - vty_outln (vty, "%s%-40s %10s Last %2d secs%s", VTYNL, "Counter", + vty_out (vty, "%s%-40s %10s Last %2d secs%s\n", VTYNL, "Counter", "Total", ZFPM_STATS_IVL_SECS, VTYNL); /* @@ -1490,7 +1490,7 @@ zfpm_show_stats (struct vty *vty) elapsed = zfpm_get_elapsed_time (zfpm_g->last_stats_clear_time); - vty_outln (vty, "%sStats were cleared %lu seconds ago", VTYNL, + vty_out (vty, "%sStats were cleared %lu seconds ago\n", VTYNL, (unsigned long)elapsed); } @@ -1502,7 +1502,7 @@ zfpm_clear_stats (struct vty *vty) { if (!zfpm_is_enabled ()) { - vty_outln (vty, "The FPM module is not enabled..."); + vty_out (vty, "The FPM module is not enabled...\n"); return; } @@ -1515,7 +1515,7 @@ zfpm_clear_stats (struct vty *vty) zfpm_g->last_stats_clear_time = monotime(NULL); - vty_outln (vty, "Cleared FPM stats"); + vty_out (vty, "Cleared FPM stats\n"); } /* @@ -1671,7 +1671,7 @@ static int fpm_remote_srv_write (struct vty *vty) if (zfpm_g->fpm_server != FPM_DEFAULT_IP || zfpm_g->fpm_port != FPM_DEFAULT_PORT) - vty_outln (vty,"fpm connection ip %s port %d", inet_ntoa (in), + vty_out (vty,"fpm connection ip %s port %d\n", inet_ntoa (in), zfpm_g->fpm_port); return 0; diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 510d79693..d78c1629b 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -530,7 +530,7 @@ fec_print (zebra_fec_t *fec, struct vty *vty) rn = fec->rn; prefix2str(&rn->p, buf, BUFSIZ); - vty_outln (vty, "%s", buf); + vty_out (vty, "%s\n", buf); vty_out(vty, " Label: %s", label2str(fec->label, buf, BUFSIZ)); if (fec->label_index != MPLS_INVALID_LABEL_INDEX) vty_out(vty, ", Label Index: %u", fec->label_index); @@ -1398,7 +1398,7 @@ nhlfe_print (zebra_nhlfe_t *nhlfe, struct vty *vty) if (!nexthop || !nexthop->nh_label) // unexpected return; - vty_outln (vty, " type: %s remote label: %s distance: %d", + vty_out (vty, " type: %s remote label: %s distance: %d\n", nhlfe_type2str(nhlfe->type), label2str(nexthop->nh_label->label[0], buf, BUFSIZ), nhlfe->distance); @@ -1436,7 +1436,7 @@ lsp_print (zebra_lsp_t *lsp, void *ctxt) vty = (struct vty *) ctxt; - vty_outln (vty, "Local label: %u%s", + vty_out (vty, "Local label: %u%s\n", lsp->ile.in_label, CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED) ? " (installed)" : ""); @@ -2238,7 +2238,7 @@ zebra_mpls_write_fec_config (struct vty *vty, struct zebra_vrf *zvrf) write = 1; prefix2str(&rn->p, buf, BUFSIZ); - vty_outln (vty, "mpls label bind %s %s", buf, + vty_out (vty, "mpls label bind %s %s\n", buf, label2str(fec->label, lstr, BUFSIZ)); } } @@ -2809,7 +2809,7 @@ zebra_mpls_print_lsp (struct vty *vty, struct zebra_vrf *zvrf, mpls_label_t labe if (use_json) { json = lsp_json(lsp); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -2840,15 +2840,15 @@ zebra_mpls_print_lsp_table (struct vty *vty, struct zebra_vrf *zvrf, json_object_object_add(json, label2str(lsp->ile.in_label, buf, BUFSIZ), lsp_json(lsp)); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { - vty_outln (vty, " Inbound Outbound"); - vty_outln (vty, " Label Type Nexthop Label"); - vty_outln (vty, "-------- ------- --------------- --------"); + vty_out (vty, " Inbound Outbound\n"); + vty_out (vty, " Label Type Nexthop Label\n"); + vty_out (vty, "-------- ------- --------------- --------\n"); for (ALL_LIST_ELEMENTS_RO(lsp_list, node, lsp)) { @@ -2871,7 +2871,7 @@ zebra_mpls_print_lsp_table (struct vty *vty, struct zebra_vrf *zvrf, break; } - vty_outln (vty, " %8d", nexthop->nh_label->label[0]); + vty_out (vty, " %8d\n", nexthop->nh_label->label[0]); } } @@ -2913,7 +2913,7 @@ zebra_mpls_write_lsp_config (struct vty *vty, struct zebra_vrf *zvrf) break; } - vty_outln (vty, "mpls lsp %u %s %s", + vty_out (vty, "mpls lsp %u %s %s\n", slsp->ile.in_label, buf, lstr); } } @@ -2963,7 +2963,7 @@ zebra_mpls_write_label_block_config (struct vty *vty, struct zebra_vrf *zvrf) if ((zvrf->mpls_srgb.start_label != MPLS_DEFAULT_MIN_SRGB_LABEL) || (zvrf->mpls_srgb.end_label != MPLS_DEFAULT_MAX_SRGB_LABEL)) { - vty_outln (vty, "mpls label global-block %u %u", + vty_out (vty, "mpls label global-block %u %u\n", zvrf->mpls_srgb.start_label,zvrf->mpls_srgb.end_label); } diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c index 6c2dbca3a..41e3aac9a 100644 --- a/zebra/zebra_mpls_vty.c +++ b/zebra/zebra_mpls_vty.c @@ -53,20 +53,20 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!mpls_enabled) { - vty_outln (vty,"%% MPLS not turned on in kernel, ignoring command"); + vty_out (vty,"%% MPLS not turned on in kernel, ignoring command\n"); return CMD_WARNING; } zvrf = vrf_info_lookup(VRF_DEFAULT); if (!zvrf) { - vty_outln (vty, "%% Default VRF does not exist"); + vty_out (vty, "%% Default VRF does not exist\n"); return CMD_WARNING; } if (!inlabel_str) { - vty_outln (vty, "%% No Label Information"); + vty_out (vty, "%% No Label Information\n"); return CMD_WARNING; } @@ -74,7 +74,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, label = atoi(inlabel_str); if (!IS_MPLS_UNRESERVED_LABEL(label)) { - vty_outln (vty, "%% Invalid label"); + vty_out (vty, "%% Invalid label\n"); return CMD_WARNING; } @@ -82,12 +82,12 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, { if (!gate_str) { - vty_outln (vty, "%% No Nexthop Information"); + vty_out (vty, "%% No Nexthop Information\n"); return CMD_WARNING; } if (!outlabel_str) { - vty_outln (vty, "%% No Outgoing label Information"); + vty_out (vty, "%% No Outgoing label Information\n"); return CMD_WARNING; } } @@ -108,7 +108,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, gtype = NEXTHOP_TYPE_IPV4; else { - vty_outln (vty, "%% Invalid nexthop"); + vty_out (vty, "%% Invalid nexthop\n"); return CMD_WARNING; } } @@ -133,7 +133,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!zebra_mpls_lsp_label_consistent (zvrf, in_label, out_label, gtype, &gate, 0)) { - vty_outln (vty,"%% Label value not consistent"); + vty_out (vty,"%% Label value not consistent\n"); return CMD_WARNING; } #endif /* HAVE_CUMULUS */ @@ -146,7 +146,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (ret) { - vty_outln (vty, "%% LSP cannot be %s", + vty_out (vty, "%% LSP cannot be %s\n", add_cmd ? "added" : "deleted"); return CMD_WARNING; } @@ -218,7 +218,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, zvrf = vrf_info_lookup(VRF_DEFAULT); if (!zvrf) { - vty_outln (vty, "%% Default VRF does not exist"); + vty_out (vty, "%% Default VRF does not exist\n"); return CMD_WARNING; } @@ -226,7 +226,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, ret = str2prefix(prefix, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } @@ -234,7 +234,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, { if (!label_str) { - vty_outln (vty, "%% No label binding specified"); + vty_out (vty, "%% No label binding specified\n"); return CMD_WARNING; } @@ -252,12 +252,12 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, label = atoi(label_str); if (!IS_MPLS_UNRESERVED_LABEL(label)) { - vty_outln (vty, "%% Invalid label"); + vty_out (vty, "%% Invalid label\n"); return CMD_WARNING; } if (zebra_mpls_label_already_bound (zvrf, label)) { - vty_outln (vty,"%% Label already bound to a FEC"); + vty_out (vty,"%% Label already bound to a FEC\n"); return CMD_WARNING; } } @@ -269,7 +269,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (ret) { - vty_outln (vty, "%% FEC to label binding cannot be %s", + vty_out (vty, "%% FEC to label binding cannot be %s\n", add_cmd ? "added" : "deleted"); return CMD_WARNING; } @@ -874,7 +874,7 @@ DEFUN (show_mpls_fec, ret = str2prefix(argv[3]->arg, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } zebra_mpls_print_fec (vty, zvrf, &p); @@ -925,7 +925,7 @@ DEFUN (show_mpls_status, "MPLS information\n" "MPLS status\n") { - vty_outln (vty, "MPLS support enabled: %s", + vty_out (vty, "MPLS support enabled: %s\n", (mpls_enabled) ? "yes" : "no (mpls kernel extensions not detected)"); return CMD_SUCCESS; } @@ -942,7 +942,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT); if (!zvrf) { - vty_outln (vty, "%% Default VRF does not exist"); + vty_out (vty, "%% Default VRF does not exist\n"); return CMD_WARNING; } @@ -950,7 +950,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, { if (!start_label_str || !end_label_str) { - vty_outln (vty, "%% Labels not specified"); + vty_out (vty, "%% Labels not specified\n"); return CMD_WARNING; } @@ -959,12 +959,12 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, if (!IS_MPLS_UNRESERVED_LABEL(start_label) || !IS_MPLS_UNRESERVED_LABEL(end_label)) { - vty_outln (vty, "%% Invalid label"); + vty_out (vty, "%% Invalid label\n"); return CMD_WARNING; } if (end_label < start_label) { - vty_outln (vty,"%% End label is less than Start label"); + vty_out (vty,"%% End label is less than Start label\n"); return CMD_WARNING; } @@ -975,7 +975,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, if (ret) { - vty_outln (vty, "%% Global label block could not be %s", + vty_out (vty, "%% Global label block could not be %s\n", add_cmd ? "added" : "deleted"); return CMD_WARNING; } diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 9a7b029dd..39779793f 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -374,7 +374,7 @@ void zebra_ptm_write (struct vty *vty) { if (ptm_cb.ptm_enable) - vty_outln (vty, "ptm-enable"); + vty_out (vty, "ptm-enable\n"); return; } @@ -1089,9 +1089,9 @@ zebra_ptm_show_status(struct vty *vty, struct interface *ifp) { vty_out (vty, " PTM status: "); if (ifp->ptm_enable) { - vty_outln (vty, "%s",zebra_ptm_get_status_str(ifp->ptm_status)); + vty_out (vty, "%s\n",zebra_ptm_get_status_str(ifp->ptm_status)); } else { - vty_outln (vty, "disabled"); + vty_out (vty, "disabled\n"); } } @@ -1161,5 +1161,5 @@ void zebra_ptm_if_write (struct vty *vty, struct zebra_if *zebra_ifp) { if (zebra_ifp->ptm_enable == ZEBRA_IF_PTM_ENABLE_OFF) - vty_outln (vty, " no ptm-enable"); + vty_out (vty, " no ptm-enable\n"); } diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index c4f417d88..fc21ada3a 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -73,10 +73,10 @@ zebra_route_match_add(struct vty *vty, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% Zebra Can't find rule."); + vty_out (vty, "%% Zebra Can't find rule.\n"); return CMD_WARNING; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Zebra Argument is malformed."); + vty_out (vty, "%% Zebra Argument is malformed.\n"); return CMD_WARNING; } } @@ -121,10 +121,10 @@ zebra_route_match_delete (struct vty *vty, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% Zebra Can't find rule."); + vty_out (vty, "%% Zebra Can't find rule.\n"); return CMD_WARNING; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Zebra Argument is malformed."); + vty_out (vty, "%% Zebra Argument is malformed.\n"); return CMD_WARNING; } } @@ -350,7 +350,7 @@ DEFUN (set_src, { if (inet_pton(AF_INET6, argv[idx_ip]->arg, &src.ipv6) != 1) { - vty_outln (vty, "%% not a valid IPv4/v6 address"); + vty_out (vty, "%% not a valid IPv4/v6 address\n"); return CMD_WARNING; } @@ -367,7 +367,7 @@ DEFUN (set_src, if (!zebra_check_addr(&p)) { - vty_outln (vty, "%% not a valid source IPv4/v6 address"); + vty_out (vty, "%% not a valid source IPv4/v6 address\n"); return CMD_WARNING; } @@ -386,7 +386,7 @@ DEFUN (set_src, if (!pif) { - vty_outln (vty, "%% not a local address"); + vty_out (vty, "%% not a local address\n"); return CMD_WARNING; } @@ -529,20 +529,20 @@ DEFUN (show_ip_protocol, { int i; - vty_outln (vty, "Protocol : route-map "); - vty_outln (vty, "------------------------"); + vty_out (vty, "Protocol : route-map \n"); + vty_out (vty, "------------------------\n"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + vty_out (vty, "%-10s : %-10s\n", zebra_route_string(i), proto_rm[AFI_IP][i]); else - vty_outln (vty, "%-10s : none", zebra_route_string(i)); + vty_out (vty, "%-10s : none\n", zebra_route_string(i)); } if (proto_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", "any",proto_rm[AFI_IP][i]); + vty_out (vty, "%-10s : %-10s\n", "any",proto_rm[AFI_IP][i]); else - vty_outln (vty, "%-10s : none", "any"); + vty_out (vty, "%-10s : none\n", "any"); return CMD_SUCCESS; } @@ -635,20 +635,20 @@ DEFUN (show_ipv6_protocol, { int i; - vty_outln (vty, "Protocol : route-map "); - vty_outln (vty, "------------------------"); + vty_out (vty, "Protocol : route-map \n"); + vty_out (vty, "------------------------\n"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP6][i]) - vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + vty_out (vty, "%-10s : %-10s\n", zebra_route_string(i), proto_rm[AFI_IP6][i]); else - vty_outln (vty, "%-10s : none", zebra_route_string(i)); + vty_out (vty, "%-10s : none\n", zebra_route_string(i)); } if (proto_rm[AFI_IP6][i]) - vty_outln (vty, "%-10s : %-10s", "any",proto_rm[AFI_IP6][i]); + vty_out (vty, "%-10s : %-10s\n", "any",proto_rm[AFI_IP6][i]); else - vty_outln (vty, "%-10s : none", "any"); + vty_out (vty, "%-10s : none\n", "any"); return CMD_SUCCESS; } @@ -733,20 +733,20 @@ DEFUN (show_ip_protocol_nht, { int i; - vty_outln (vty, "Protocol : route-map "); - vty_outln (vty, "------------------------"); + vty_out (vty, "Protocol : route-map \n"); + vty_out (vty, "------------------------\n"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (nht_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + vty_out (vty, "%-10s : %-10s\n", zebra_route_string(i), nht_rm[AFI_IP][i]); else - vty_outln (vty, "%-10s : none", zebra_route_string(i)); + vty_out (vty, "%-10s : none\n", zebra_route_string(i)); } if (nht_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", "any",nht_rm[AFI_IP][i]); + vty_out (vty, "%-10s : %-10s\n", "any",nht_rm[AFI_IP][i]); else - vty_outln (vty, "%-10s : none", "any"); + vty_out (vty, "%-10s : none\n", "any"); return CMD_SUCCESS; } @@ -832,20 +832,20 @@ DEFUN (show_ipv6_protocol_nht, { int i; - vty_outln (vty, "Protocol : route-map "); - vty_outln (vty, "------------------------"); + vty_out (vty, "Protocol : route-map \n"); + vty_out (vty, "------------------------\n"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (nht_rm[AFI_IP6][i]) - vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + vty_out (vty, "%-10s : %-10s\n", zebra_route_string(i), nht_rm[AFI_IP6][i]); else - vty_outln (vty, "%-10s : none", zebra_route_string(i)); + vty_out (vty, "%-10s : none\n", zebra_route_string(i)); } if (nht_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", "any",nht_rm[AFI_IP6][i]); + vty_out (vty, "%-10s : %-10s\n", "any",nht_rm[AFI_IP6][i]); else - vty_outln (vty, "%-10s : none", "any"); + vty_out (vty, "%-10s : none\n", "any"); return CMD_SUCCESS; } @@ -1294,7 +1294,7 @@ void zebra_route_map_write_delay_timer (struct vty *vty) { if (vty && (zebra_rmap_update_timer != ZEBRA_RMAP_DEFAULT_UPDATE_TIMER)) - vty_outln (vty, "zebra route-map delay-timer %d", + vty_out (vty, "zebra route-map delay-timer %d\n", zebra_rmap_update_timer); return; } @@ -1431,40 +1431,40 @@ zebra_routemap_config_write_protocol (struct vty *vty) for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP][i]) - vty_outln (vty, "ip protocol %s route-map %s", zebra_route_string(i), + vty_out (vty, "ip protocol %s route-map %s\n", zebra_route_string(i), proto_rm[AFI_IP][i]); if (proto_rm[AFI_IP6][i]) - vty_outln (vty, "ipv6 protocol %s route-map %s", zebra_route_string(i), + vty_out (vty, "ipv6 protocol %s route-map %s\n", zebra_route_string(i), proto_rm[AFI_IP6][i]); if (nht_rm[AFI_IP][i]) - vty_outln (vty, "ip nht %s route-map %s", zebra_route_string(i), + vty_out (vty, "ip nht %s route-map %s\n", zebra_route_string(i), nht_rm[AFI_IP][i]); if (nht_rm[AFI_IP6][i]) - vty_outln (vty, "ipv6 nht %s route-map %s", zebra_route_string(i), + vty_out (vty, "ipv6 nht %s route-map %s\n", zebra_route_string(i), nht_rm[AFI_IP6][i]); } if (proto_rm[AFI_IP][ZEBRA_ROUTE_MAX]) - vty_outln (vty, "ip protocol %s route-map %s", "any", + vty_out (vty, "ip protocol %s route-map %s\n", "any", proto_rm[AFI_IP][ZEBRA_ROUTE_MAX]); if (proto_rm[AFI_IP6][ZEBRA_ROUTE_MAX]) - vty_outln (vty, "ipv6 protocol %s route-map %s", "any", + vty_out (vty, "ipv6 protocol %s route-map %s\n", "any", proto_rm[AFI_IP6][ZEBRA_ROUTE_MAX]); if (nht_rm[AFI_IP][ZEBRA_ROUTE_MAX]) - vty_outln (vty, "ip nht %s route-map %s", "any", + vty_out (vty, "ip nht %s route-map %s\n", "any", nht_rm[AFI_IP][ZEBRA_ROUTE_MAX]); if (nht_rm[AFI_IP6][ZEBRA_ROUTE_MAX]) - vty_outln (vty, "ipv6 nht %s route-map %s", "any", + vty_out (vty, "ipv6 nht %s route-map %s\n", "any", nht_rm[AFI_IP6][ZEBRA_ROUTE_MAX]); if (zebra_rmap_update_timer != ZEBRA_RMAP_DEFAULT_UPDATE_TIMER) - vty_outln (vty, "zebra route-map delay-timer %d", + vty_out (vty, "zebra route-map delay-timer %d\n", zebra_rmap_update_timer); } diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index 165689267..bedecf009 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -524,8 +524,8 @@ vrf_config_write (struct vty *vty) zvrf = vrf->info; if (! zvrf || strcmp (zvrf_name (zvrf), VRF_DEFAULT_NAME)) { - vty_outln (vty, "vrf %s", zvrf_name(zvrf)); - vty_outln (vty, "!"); + vty_out (vty, "vrf %s\n", zvrf_name(zvrf)); + vty_out (vty, "!\n"); } } return 0; diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 6ba4c1b9d..1da288cca 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -79,7 +79,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, ret = str2prefix (dest_str, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } @@ -89,7 +89,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, ret = inet_aton (mask_str, &mask); if (ret == 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } p.prefixlen = ip_masklen (mask); @@ -113,7 +113,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (!zvrf) { - vty_outln (vty, "%% vrf %s is not defined", vrf_id_str); + vty_out (vty, "%% vrf %s is not defined\n", vrf_id_str); return CMD_WARNING; } @@ -122,8 +122,8 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { if (!mpls_enabled) { - vty_outln (vty, - "%% MPLS not turned on in kernel, ignoring command"); + vty_out (vty, + "%% MPLS not turned on in kernel, ignoring command\n"); return CMD_WARNING; } int rc = mpls_str2label (label_str, &snh_label.num_labels, @@ -132,14 +132,14 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { switch (rc) { case -1: - vty_outln (vty, "%% Malformed label(s)"); + vty_out (vty, "%% Malformed label(s)\n"); break; case -2: - vty_outln (vty, "%% Cannot use reserved label(s) (%d-%d)", + vty_out (vty, "%% Cannot use reserved label(s) (%d-%d)\n", MPLS_MIN_RESERVED_LABEL,MPLS_MAX_RESERVED_LABEL); break; case -3: - vty_outln (vty, "%% Too many labels. Enter %d or fewer", + vty_out (vty, "%% Too many labels. Enter %d or fewer\n", MPLS_MAX_LABELS); break; } @@ -152,7 +152,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { if (flag_str) { - vty_outln (vty, "%% can not have flag %s with Null0", flag_str); + vty_out (vty, "%% can not have flag %s with Null0\n", flag_str); return CMD_WARNING; } if (add_cmd) @@ -176,7 +176,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE); break; default: - vty_outln (vty, "%% Malformed flag %s ", flag_str); + vty_out (vty, "%% Malformed flag %s \n", flag_str); return CMD_WARNING; } } @@ -201,7 +201,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, struct interface *ifp = if_lookup_by_name (gate_str, zvrf_id (zvrf)); if (!ifp) { - vty_outln (vty, "%% Unknown interface: %s", gate_str); + vty_out (vty, "%% Unknown interface: %s\n", gate_str); ifindex = IFINDEX_DELETED; } else @@ -286,7 +286,7 @@ DEFUN (ip_multicast_mode, multicast_mode_ipv4_set (MCAST_MIX_PFXLEN); else { - vty_outln (vty, "Invalid mode specified"); + vty_out (vty, "Invalid mode specified\n"); return CMD_WARNING; } @@ -340,7 +340,7 @@ DEFUN (show_ip_rpf_addr, ret = inet_aton (argv[idx_ipv4]->arg, &addr); if (ret == 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } @@ -349,7 +349,7 @@ DEFUN (show_ip_rpf_addr, if (re) vty_show_ip_route_detail (vty, rn, 1); else - vty_outln (vty, "%% No match for RPF lookup"); + vty_out (vty, "%% No match for RPF lookup\n"); return CMD_SUCCESS; } @@ -1107,18 +1107,18 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, if (!(zvrf = zebra_vrf_lookup_by_name (vrf_name))) { if (use_json) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); else - vty_outln (vty, "vrf %s not defined", vrf_name); + vty_out (vty, "vrf %s not defined\n", vrf_name); return CMD_SUCCESS; } if (zvrf_id (zvrf) == VRF_UNKNOWN) { if (use_json) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); else - vty_outln (vty, "vrf %s inactive", vrf_name); + vty_out (vty, "vrf %s inactive\n", vrf_name); return CMD_SUCCESS; } @@ -1126,7 +1126,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, if (! table) { if (use_json) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); return CMD_SUCCESS; } @@ -1183,7 +1183,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, vty_out (vty, SHOW_ROUTE_V6_HEADER); if (zvrf_id (zvrf) != VRF_DEFAULT) - vty_outln (vty, "%sVRF %s:", VTYNL, + vty_out (vty, "%sVRF %s:\n", VTYNL, zvrf_name(zvrf)); first = 0; @@ -1203,7 +1203,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, if (use_json) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -1244,7 +1244,7 @@ DEFUN (show_ip_nht_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if ((zvrf = vrf->info) != NULL) { - vty_outln (vty, "%sVRF %s:", VTYNL, zvrf_name(zvrf)); + vty_out (vty, "%sVRF %s:\n", VTYNL, zvrf_name(zvrf)); zebra_print_rnh_table(zvrf_id (zvrf), AF_INET, vty, RNH_NEXTHOP_TYPE); } @@ -1284,7 +1284,7 @@ DEFUN (show_ipv6_nht_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if ((zvrf = vrf->info) != NULL) { - vty_outln (vty, "%sVRF %s:", VTYNL, zvrf_name(zvrf)); + vty_out (vty, "%sVRF %s:\n", VTYNL, zvrf_name(zvrf)); zebra_print_rnh_table(zvrf_id (zvrf), AF_INET6, vty, RNH_NEXTHOP_TYPE); } @@ -1440,7 +1440,7 @@ DEFUN (show_ip_route, if (type < 0) { - vty_outln (vty, "Unknown route type"); + vty_out (vty, "Unknown route type\n"); return CMD_WARNING; } } @@ -1493,7 +1493,7 @@ DEFUN (show_ip_route_addr, if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 address"); + vty_out (vty, "%% Malformed IPv4 address\n"); return CMD_WARNING; } @@ -1504,7 +1504,7 @@ DEFUN (show_ip_route_addr, rn = route_node_match (table, (struct prefix *) &p); if (! rn) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -1542,7 +1542,7 @@ DEFUN (show_ip_route_prefix, if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 address"); + vty_out (vty, "%% Malformed IPv4 address\n"); return CMD_WARNING; } @@ -1553,7 +1553,7 @@ DEFUN (show_ip_route_prefix, rn = route_node_match (table, (struct prefix *) &p); if (! rn || rn->p.prefixlen != p.prefixlen) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -1602,7 +1602,7 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table) } } - vty_outln (vty, "%-20s %-20s %s (vrf %s)", + vty_out (vty, "%-20s %-20s %s (vrf %s)\n", "Route Source", "Routes", "FIB", zvrf_name(((rib_table_info_t *)table->info)->zvrf)); @@ -1613,19 +1613,19 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table) { if (i == ZEBRA_ROUTE_BGP) { - vty_outln (vty, "%-20s %-20d %-20d ", "ebgp", + vty_out (vty, "%-20s %-20d %-20d \n", "ebgp", rib_cnt[ZEBRA_ROUTE_BGP],fib_cnt[ZEBRA_ROUTE_BGP]); - vty_outln (vty, "%-20s %-20d %-20d ", "ibgp", + vty_out (vty, "%-20s %-20d %-20d \n", "ibgp", rib_cnt[ZEBRA_ROUTE_IBGP],fib_cnt[ZEBRA_ROUTE_IBGP]); } else - vty_outln (vty, "%-20s %-20d %-20d ", zebra_route_string(i), + vty_out (vty, "%-20s %-20d %-20d \n", zebra_route_string(i), rib_cnt[i], fib_cnt[i]); } } - vty_outln (vty, "------"); - vty_outln (vty, "%-20s %-20d %-20d ", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], + vty_out (vty, "------\n"); + vty_out (vty, "%-20s %-20d %-20d \n", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], fib_cnt[ZEBRA_ROUTE_TOTAL]); vty_out (vty, VTYNL); } @@ -1680,7 +1680,7 @@ vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table) } } - vty_outln (vty, "%-20s %-20s %s (vrf %s)", + vty_out (vty, "%-20s %-20s %s (vrf %s)\n", "Route Source", "Prefix Routes", "FIB", zvrf_name(((rib_table_info_t *)table->info)->zvrf)); @@ -1690,20 +1690,20 @@ vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table) { if (i == ZEBRA_ROUTE_BGP) { - vty_outln (vty, "%-20s %-20d %-20d ", "ebgp", + vty_out (vty, "%-20s %-20d %-20d \n", "ebgp", rib_cnt[ZEBRA_ROUTE_BGP] - rib_cnt[ZEBRA_ROUTE_IBGP], fib_cnt[ZEBRA_ROUTE_BGP] - fib_cnt[ZEBRA_ROUTE_IBGP]); - vty_outln (vty, "%-20s %-20d %-20d ", "ibgp", + vty_out (vty, "%-20s %-20d %-20d \n", "ibgp", rib_cnt[ZEBRA_ROUTE_IBGP],fib_cnt[ZEBRA_ROUTE_IBGP]); } else - vty_outln (vty, "%-20s %-20d %-20d ", zebra_route_string(i), + vty_out (vty, "%-20s %-20d %-20d \n", zebra_route_string(i), rib_cnt[i], fib_cnt[i]); } } - vty_outln (vty, "------"); - vty_outln (vty, "%-20s %-20d %-20d ", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], + vty_out (vty, "------\n"); + vty_out (vty, "%-20s %-20d %-20d \n", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], fib_cnt[ZEBRA_ROUTE_TOTAL]); vty_out (vty, VTYNL); } @@ -1780,7 +1780,7 @@ DEFUN (show_ip_route_vrf_all_addr, ret = str2prefix_ipv4 (argv[idx_ipv4]->arg, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 address"); + vty_out (vty, "%% Malformed IPv4 address\n"); return CMD_WARNING; } @@ -1822,7 +1822,7 @@ DEFUN (show_ip_route_vrf_all_prefix, ret = str2prefix_ipv4 (argv[idx_ipv4_prefixlen]->arg, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 address"); + vty_out (vty, "%% Malformed IPv4 address\n"); return CMD_WARNING; } @@ -1992,7 +1992,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ret = str2prefix (dest_str, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } @@ -2001,7 +2001,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ret = str2prefix (src_str, &src); if (ret <= 0 || src.family != AF_INET6) { - vty_outln (vty, "%% Malformed source address"); + vty_out (vty, "%% Malformed source address\n"); return CMD_WARNING; } src_p = (struct prefix_ipv6*)&src; @@ -2029,7 +2029,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (!zvrf) { - vty_outln (vty, "%% vrf %s is not defined", vrf_id_str); + vty_out (vty, "%% vrf %s is not defined\n", vrf_id_str); return CMD_WARNING; } @@ -2039,8 +2039,8 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { if (!mpls_enabled) { - vty_outln (vty, - "%% MPLS not turned on in kernel, ignoring command"); + vty_out (vty, + "%% MPLS not turned on in kernel, ignoring command\n"); return CMD_WARNING; } int rc = mpls_str2label (label_str, &snh_label.num_labels, @@ -2049,14 +2049,14 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { switch (rc) { case -1: - vty_outln (vty, "%% Malformed label(s)"); + vty_out (vty, "%% Malformed label(s)\n"); break; case -2: - vty_outln (vty, "%% Cannot use reserved label(s) (%d-%d)", + vty_out (vty, "%% Cannot use reserved label(s) (%d-%d)\n", MPLS_MIN_RESERVED_LABEL,MPLS_MAX_RESERVED_LABEL); break; case -3: - vty_outln (vty, "%% Too many labels. Enter %d or fewer", + vty_out (vty, "%% Too many labels. Enter %d or fewer\n", MPLS_MAX_LABELS); break; } @@ -2069,7 +2069,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { if (flag_str) { - vty_outln (vty, "%% can not have flag %s with Null0", flag_str); + vty_out (vty, "%% can not have flag %s with Null0\n", flag_str); return CMD_WARNING; } if (add_cmd) @@ -2093,7 +2093,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE); break; default: - vty_outln (vty, "%% Malformed flag %s ", flag_str); + vty_out (vty, "%% Malformed flag %s \n", flag_str); return CMD_WARNING; } } @@ -2104,7 +2104,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, address. */ if (ret != 1) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } type = STATIC_IPV6_GATEWAY_IFINDEX; @@ -2112,7 +2112,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ifp = if_lookup_by_name (ifname, zvrf_id (zvrf)); if (!ifp) { - vty_outln (vty, "%% Malformed Interface name %s", ifname); + vty_out (vty, "%% Malformed Interface name %s\n", ifname); return CMD_WARNING; } ifindex = ifp->ifindex; @@ -2130,7 +2130,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ifp = if_lookup_by_name (gate_str, zvrf_id (zvrf)); if (!ifp) { - vty_outln (vty, "%% Malformed Interface name %s", gate_str); + vty_out (vty, "%% Malformed Interface name %s\n", gate_str); ifindex = IFINDEX_DELETED; } else @@ -2618,7 +2618,7 @@ DEFUN (show_ipv6_route, if (type < 0) { - vty_outln (vty, "Unknown route type"); + vty_out (vty, "Unknown route type\n"); return CMD_WARNING; } } @@ -2671,7 +2671,7 @@ DEFUN (show_ipv6_route_addr, if (ret <= 0) { - vty_outln (vty, "Malformed IPv6 address"); + vty_out (vty, "Malformed IPv6 address\n"); return CMD_WARNING; } @@ -2682,7 +2682,7 @@ DEFUN (show_ipv6_route_addr, rn = route_node_match (table, (struct prefix *) &p); if (! rn) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -2718,7 +2718,7 @@ DEFUN (show_ipv6_route_prefix, if (ret <= 0) { - vty_outln (vty, "Malformed IPv6 prefix"); + vty_out (vty, "Malformed IPv6 prefix\n"); return CMD_WARNING; } @@ -2729,7 +2729,7 @@ DEFUN (show_ipv6_route_prefix, rn = route_node_match (table, (struct prefix *) &p); if (! rn || rn->p.prefixlen != p.prefixlen) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -2853,7 +2853,7 @@ DEFUN (show_ipv6_route_vrf_all_addr, ret = str2prefix_ipv6 (argv[idx_ipv6]->arg, &p); if (ret <= 0) { - vty_outln (vty, "Malformed IPv6 address"); + vty_out (vty, "Malformed IPv6 address\n"); return CMD_WARNING; } @@ -2895,7 +2895,7 @@ DEFUN (show_ipv6_route_vrf_all_prefix, ret = str2prefix_ipv6 (argv[idx_ipv6_prefixlen]->arg, &p); if (ret <= 0) { - vty_outln (vty, "Malformed IPv6 prefix"); + vty_out (vty, "Malformed IPv6 prefix\n"); return CMD_WARNING; } @@ -3085,14 +3085,14 @@ DEFUN (ip_zebra_import_table_distance, if (!is_zebra_valid_kernel_table(table_id)) { - vty_outln (vty, "Invalid routing table ID, %d. Must be in range 1-252", + vty_out (vty, "Invalid routing table ID, %d. Must be in range 1-252\n", table_id); return CMD_WARNING; } if (is_zebra_main_routing_table(table_id)) { - vty_outln (vty, "Invalid routing table ID, %d. Must be non-default table", + vty_out (vty, "Invalid routing table ID, %d. Must be non-default table\n", table_id); return CMD_WARNING; } @@ -3121,13 +3121,13 @@ DEFUN (no_ip_zebra_import_table, if (!is_zebra_valid_kernel_table(table_id)) { - vty_outln (vty,"Invalid routing table ID. Must be in range 1-252"); + vty_out (vty,"Invalid routing table ID. Must be in range 1-252\n"); return CMD_WARNING; } if (is_zebra_main_routing_table(table_id)) { - vty_outln (vty, "Invalid routing table ID, %d. Must be non-default table", + vty_out (vty, "Invalid routing table ID, %d. Must be non-default table\n", table_id); return CMD_WARNING; } @@ -3142,18 +3142,18 @@ static int config_write_protocol (struct vty *vty) { if (allow_delete) - vty_outln (vty, "allow-external-route-update"); + vty_out (vty, "allow-external-route-update\n"); if (zebra_rnh_ip_default_route) - vty_outln (vty, "ip nht resolve-via-default"); + vty_out (vty, "ip nht resolve-via-default\n"); if (zebra_rnh_ipv6_default_route) - vty_outln (vty, "ipv6 nht resolve-via-default"); + vty_out (vty, "ipv6 nht resolve-via-default\n"); enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get (); if (ipv4_multicast_mode != MCAST_NO_CONFIG) - vty_outln (vty, "ip multicast rpf-lookup-mode %s", + vty_out (vty, "ip multicast rpf-lookup-mode %s\n", ipv4_multicast_mode == MCAST_URIB_ONLY ? "urib-only" : ipv4_multicast_mode == MCAST_MRIB_ONLY ? "mrib-only" : ipv4_multicast_mode == MCAST_MIX_MRIB_FIRST ? "mrib-then-urib" : ipv4_multicast_mode == MCAST_MIX_DISTANCE ? "lower-distance" : "longer-prefix"); zebra_routemap_config_write_protocol(vty); diff --git a/zebra/zserv.c b/zebra/zserv.c index 3da94459f..bee70f951 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2678,53 +2678,53 @@ zebra_show_client_detail (struct vty *vty, struct zserv *client) vty_out (vty, " Instance: %d", client->instance); vty_out (vty, VTYNL); - vty_outln (vty, "------------------------ "); - vty_outln (vty, "FD: %d ", client->sock); - vty_outln (vty, "Route Table ID: %d ", client->rtm_table); + vty_out (vty, "------------------------ \n"); + vty_out (vty, "FD: %d \n", client->sock); + vty_out (vty, "Route Table ID: %d \n", client->rtm_table); - vty_outln (vty, "Connect Time: %s ", + vty_out (vty, "Connect Time: %s \n", zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF)); if (client->nh_reg_time) { - vty_outln (vty, "Nexthop Registry Time: %s ", + vty_out (vty, "Nexthop Registry Time: %s \n", zserv_time_buf(&client->nh_reg_time, nhbuf, ZEBRA_TIME_BUF)); if (client->nh_last_upd_time) - vty_outln (vty, "Nexthop Last Update Time: %s ", + vty_out (vty, "Nexthop Last Update Time: %s \n", zserv_time_buf(&client->nh_last_upd_time, mbuf, ZEBRA_TIME_BUF)); else - vty_outln (vty, "No Nexthop Update sent"); + vty_out (vty, "No Nexthop Update sent\n"); } else - vty_outln (vty, "Not registered for Nexthop Updates"); + vty_out (vty, "Not registered for Nexthop Updates\n"); - vty_outln (vty, "Last Msg Rx Time: %s ", + vty_out (vty, "Last Msg Rx Time: %s \n", zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF)); - vty_outln (vty, "Last Msg Tx Time: %s ", + vty_out (vty, "Last Msg Tx Time: %s \n", zserv_time_buf(&client->last_write_time, wbuf, ZEBRA_TIME_BUF)); if (client->last_read_time) - vty_outln (vty, "Last Rcvd Cmd: %s ", + vty_out (vty, "Last Rcvd Cmd: %s \n", zserv_command_string(client->last_read_cmd)); if (client->last_write_time) - vty_outln (vty, "Last Sent Cmd: %s ", + vty_out (vty, "Last Sent Cmd: %s \n", zserv_command_string(client->last_write_cmd)); vty_out (vty, VTYNL); - vty_outln (vty, "Type Add Update Del "); - vty_outln (vty, "================================================== "); - vty_outln (vty, "IPv4 %-12d%-12d%-12d", client->v4_route_add_cnt, + vty_out (vty, "Type Add Update Del \n"); + vty_out (vty, "================================================== \n"); + vty_out (vty, "IPv4 %-12d%-12d%-12d\n", client->v4_route_add_cnt, client->v4_route_upd8_cnt, client->v4_route_del_cnt); - vty_outln (vty, "IPv6 %-12d%-12d%-12d", client->v6_route_add_cnt, + vty_out (vty, "IPv6 %-12d%-12d%-12d\n", client->v6_route_add_cnt, client->v6_route_upd8_cnt, client->v6_route_del_cnt); - vty_outln (vty, "Redist:v4 %-12d%-12d%-12d", client->redist_v4_add_cnt, 0, + vty_out (vty, "Redist:v4 %-12d%-12d%-12d\n", client->redist_v4_add_cnt, 0, client->redist_v4_del_cnt); - vty_outln (vty, "Redist:v6 %-12d%-12d%-12d", client->redist_v6_add_cnt, 0, + vty_out (vty, "Redist:v6 %-12d%-12d%-12d\n", client->redist_v6_add_cnt, 0, client->redist_v6_del_cnt); - vty_outln (vty, "Connected %-12d%-12d%-12d", client->ifadd_cnt, 0, + vty_out (vty, "Connected %-12d%-12d%-12d\n", client->ifadd_cnt, 0, client->ifdel_cnt); - vty_outln (vty, "BFD peer %-12d%-12d%-12d", client->bfd_peer_add_cnt, + vty_out (vty, "BFD peer %-12d%-12d%-12d\n", client->bfd_peer_add_cnt, client->bfd_peer_upd8_cnt, client->bfd_peer_del_cnt); - vty_outln (vty, "Interface Up Notifications: %d",client->ifup_cnt); - vty_outln (vty, "Interface Down Notifications: %d",client->ifdown_cnt); + vty_out (vty, "Interface Up Notifications: %d\n",client->ifup_cnt); + vty_out (vty, "Interface Down Notifications: %d\n",client->ifdown_cnt); vty_out (vty, VTYNL); return; @@ -2736,7 +2736,7 @@ zebra_show_client_brief (struct vty *vty, struct zserv *client) char cbuf[ZEBRA_TIME_BUF], rbuf[ZEBRA_TIME_BUF]; char wbuf[ZEBRA_TIME_BUF]; - vty_outln (vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d", + vty_out (vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d\n", zebra_route_string(client->proto), zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF), zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF), @@ -2771,7 +2771,7 @@ DEFUN (show_table, SHOW_STR "default routing table to use for all clients\n") { - vty_outln (vty, "table %d",zebrad.rtm_table_default); + vty_out (vty, "table %d\n",zebrad.rtm_table_default); return CMD_SUCCESS; } @@ -2811,7 +2811,7 @@ DEFUN (ip_forwarding, if (ret == 0) { - vty_outln (vty, "Can't turn on IP forwarding"); + vty_out (vty, "Can't turn on IP forwarding\n"); return CMD_WARNING; } @@ -2833,7 +2833,7 @@ DEFUN (no_ip_forwarding, if (ret != 0) { - vty_outln (vty, "Can't turn off IP forwarding"); + vty_out (vty, "Can't turn off IP forwarding\n"); return CMD_WARNING; } @@ -2848,10 +2848,10 @@ DEFUN (show_zebra, { struct vrf *vrf; - vty_outln (vty, - " Route Route Neighbor LSP LSP"); - vty_outln (vty, - "VRF Installs Removals Updates Installs Removals"); + vty_out (vty, + " Route Route Neighbor LSP LSP\n"); + vty_out (vty, + "VRF Installs Removals Updates Installs Removals\n"); RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { struct zebra_vrf *zvrf = vrf->info; @@ -2892,15 +2892,15 @@ DEFUN (show_zebra_client_summary, struct listnode *node; struct zserv *client; - vty_outln (vty, - "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes "); - vty_outln (vty, - "--------------------------------------------------------------------------------"); + vty_out (vty, + "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes \n"); + vty_out (vty, + "--------------------------------------------------------------------------------\n"); for (ALL_LIST_ELEMENTS_RO (zebrad.client_list, node, client)) zebra_show_client_brief(vty, client); - vty_outln (vty, "Routes column shows (added+updated)/deleted"); + vty_out (vty, "Routes column shows (added+updated)/deleted\n"); return CMD_SUCCESS; } @@ -2909,7 +2909,7 @@ static int config_write_table (struct vty *vty) { if (zebrad.rtm_table_default) - vty_outln (vty, "table %d",zebrad.rtm_table_default); + vty_out (vty, "table %d\n",zebrad.rtm_table_default); return 0; } @@ -2934,9 +2934,9 @@ DEFUN (show_ip_forwarding, ret = ipforward (); if (ret == 0) - vty_outln (vty, "IP forwarding is off"); + vty_out (vty, "IP forwarding is off\n"); else - vty_outln (vty, "IP forwarding is on"); + vty_out (vty, "IP forwarding is on\n"); return CMD_SUCCESS; } @@ -2955,16 +2955,16 @@ DEFUN (show_ipv6_forwarding, switch (ret) { case -1: - vty_outln (vty, "ipv6 forwarding is unknown"); + vty_out (vty, "ipv6 forwarding is unknown\n"); break; case 0: - vty_outln (vty, "ipv6 forwarding is %s", "off"); + vty_out (vty, "ipv6 forwarding is %s\n", "off"); break; case 1: - vty_outln (vty, "ipv6 forwarding is %s", "on"); + vty_out (vty, "ipv6 forwarding is %s\n", "on"); break; default: - vty_outln (vty, "ipv6 forwarding is %s", "off"); + vty_out (vty, "ipv6 forwarding is %s\n", "off"); break; } return CMD_SUCCESS; @@ -2984,7 +2984,7 @@ DEFUN (ipv6_forwarding, if (ret == 0) { - vty_outln (vty, "Can't turn on IPv6 forwarding"); + vty_out (vty, "Can't turn on IPv6 forwarding\n"); return CMD_WARNING; } @@ -3006,7 +3006,7 @@ DEFUN (no_ipv6_forwarding, if (ret != 0) { - vty_outln (vty, "Can't turn off IPv6 forwarding"); + vty_out (vty, "Can't turn off IPv6 forwarding\n"); return CMD_WARNING; } @@ -3021,10 +3021,10 @@ config_write_forwarding (struct vty *vty) router_id_write (vty); if (!ipforward ()) - vty_outln (vty, "no ip forwarding"); + vty_out (vty, "no ip forwarding\n"); if (!ipforward_ipv6 ()) - vty_outln (vty, "no ipv6 forwarding"); - vty_outln (vty, "!"); + vty_out (vty, "no ipv6 forwarding\n"); + vty_out (vty, "!\n"); return 0; } |