Date: Sat, 20 Jun 2009 08:30:16 GMT From: Gabor Pali <pgj@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 164750 for review Message-ID: <200906200830.n5K8UGIx062830@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=164750 Change 164750 by pgj@petymeg-current on 2009/06/20 08:30:12 nettop: improve display Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/usr.bin/nettop/main.c#3 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/usr.bin/nettop/main.c#3 (text+ko) ==== @@ -61,7 +61,6 @@ struct socket_type *stp; struct addr_type *atp, *laddr, *faddr; int row; - char buf1[32], buf2[32]; attron(A_STANDOUT); mvprintw(0, 0, "Very Simple Network Monitor (Press Q to quit)"); @@ -93,26 +92,23 @@ attron(A_BOLD); mvprintw(15, 0, "Active Internet connections (including servers)"); mvprintw(16, 0, - "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s (state)", + "%-5.5s %-6.6s %-6.6s %-17.17s %-6.6s %-17.17s %-6.6s (state)", "Proto", "Recv-Q", "Send-Q", - "Local Address", "Foreign Address"); + "Local Address", "Port", "Foreign Address", "Port"); attroff(A_BOLD); netstat_sti_alloc(inet, &stip); for (stp = netstat_sti_first(stip), row = 17; stp != NULL && row < 25; stp = netstat_sti_next(stip), row++) { laddr = netstat_st_get_address(stp, 0); faddr = netstat_st_get_address(stp, 1); - sprintf(buf1, "%s:%s", - netstat_at_get_name(laddr), - netstat_at_get_portname(laddr)); - sprintf(buf2, "%s:%s", - netstat_at_get_name(faddr), - netstat_at_get_portname(faddr)); mvprintw(row, 0, - "%-5.5s %6u %6u %-18.18s %-18.18s %s", + "%-5.5s %6u %6u %-17.17s %-6.6s %-17.17s %-6.6s %s", netstat_st_get_extname(stp), netstat_st_get_rcv_cc(stp), netstat_st_get_snd_cc(stp), - buf1, buf2, + netstat_at_get_name(laddr), + netstat_at_get_portname(laddr), + netstat_at_get_name(faddr), + netstat_at_get_portname(faddr), netstat_st_get_tcpstate(stp)); netstat_at_free(laddr); netstat_at_free(faddr);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906200830.n5K8UGIx062830>