=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/netstat/inet.c,v retrieving revision 1.115 retrieving revision 1.116 diff -c -r1.115 -r1.116 *** src/usr.bin/netstat/inet.c 2011/03/02 21:51:14 1.115 --- src/usr.bin/netstat/inet.c 2011/03/15 13:10:31 1.116 *************** *** 1,4 **** ! /* $OpenBSD: inet.c,v 1.115 2011/03/02 21:51:14 bluhm Exp $ */ /* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: inet.c,v 1.116 2011/03/15 13:10:31 jsing Exp $ */ /* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */ /* *************** *** 114,119 **** --- 114,120 ---- struct inpcb *head, *next, *prev; struct inpcb inpcb; int istcp, israw, isany; + int addrlen = 22; int first = 1; char *name0; char namebuf[20]; *************** *** 180,195 **** if (aflag) printf(" (including servers)"); putchar('\n'); ! if (Aflag) ! printf("%-*.*s %-7.7s %-6.6s %-6.6s %-18.18s %-18.18s %s\n", ! PLEN, PLEN, "PCB", "Proto", "Recv-Q", ! "Send-Q", "Local Address", ! "Foreign Address", "(state)"); ! else ! printf("%-7.7s %-6.6s %-6.6s %-22.22s %-22.22s %s\n", ! "Proto", "Recv-Q", "Send-Q", ! "Local Address", "Foreign Address", ! "(state)"); first = 0; } if (Aflag) { --- 181,198 ---- if (aflag) printf(" (including servers)"); putchar('\n'); ! if (Aflag) { ! addrlen = 18; ! printf("%-*.*s ", PLEN, PLEN, "PCB"); ! } ! printf("%-7.7s %-6.6s %-6.6s ", ! "Proto", "Recv-Q", "Send-Q"); ! if (Bflag && istcp) ! printf("%-6.6s %-6.6s %-6.6s ", ! "Recv-W", "Send-W", "Cgst-W"); ! printf(" %-*.*s %-*.*s %s\n", ! addrlen, addrlen, "Local Address", ! addrlen, addrlen, "Foreign Address", "(state)"); first = 0; } if (Aflag) { *************** *** 204,211 **** name = namebuf; } else name = name0; ! printf("%-7.7s %6ld %6ld ", name, sockb.so_rcv.sb_cc, ! sockb.so_snd.sb_cc); if (inpcb.inp_flags & INP_IPV6) { inet6print(&inpcb.inp_laddr6, (int)inpcb.inp_lport, name); --- 207,219 ---- name = namebuf; } else name = name0; ! printf("%-7.7s %6lu %6lu ", ! name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); ! if (Bflag && istcp) ! printf("%6lu %6lu %6lu ", tcpcb.rcv_wnd, tcpcb.snd_wnd, ! (tcpcb.t_state == TCPS_ESTABLISHED) ? ! tcpcb.snd_cwnd : 0); ! if (inpcb.inp_flags & INP_IPV6) { inet6print(&inpcb.inp_laddr6, (int)inpcb.inp_lport, name);