From 8d7c364efc5831515aedce128911f89eb807c5b1 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Mon, 20 Dec 2004 11:03:16 +0000 Subject: [PATCH] Remove the userland visible part of the socket generation counting. As a side issue, the CPU used for processing a PCB isn't shown anymore, since this is currently not included by the userland sockets. --- sys/kern/uipc_usrreq.c | 27 +------------- sys/netinet/in_pcb.c | 28 +------------- sys/netinet/in_pcb.h | 10 +---- sys/netinet/tcp_subr.c | 28 +------------- sys/sys/unpcb.h | 9 +---- usr.bin/netstat/inet.c | 80 ++++++++++++++-------------------------- usr.bin/netstat/unix.c | 35 +++++------------- usr.bin/systat/netstat.c | 75 +++++++++++++++++-------------------- 8 files changed, 80 insertions(+), 212 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 21bfbb1105..0361221d64 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -32,7 +32,7 @@ * * From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94 * $FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.54.2.10 2003/03/04 17:28:09 nectar Exp $ - * $DragonFly: src/sys/kern/uipc_usrreq.c,v 1.17 2004/11/12 00:09:24 dillon Exp $ + * $DragonFly: src/sys/kern/uipc_usrreq.c,v 1.18 2004/12/20 11:03:16 joerg Exp $ */ #include @@ -798,7 +798,6 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) int error, i, n; struct unpcb *unp, **unp_list; unp_gen_t gencnt; - struct xunpgen xug; struct unp_head *head; head = ((intptr_t)arg1 == SOCK_DGRAM ? &unp_dhead : &unp_shead); @@ -811,8 +810,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = unp_count; - req->oldidx = 2 * (sizeof xug) - + (n + n/8) * sizeof(struct xunpcb); + req->oldidx = (n + n/8) * sizeof(struct xunpcb); return 0; } @@ -825,14 +823,6 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) gencnt = unp_gencnt; n = unp_count; - xug.xug_len = sizeof xug; - xug.xug_count = n; - xug.xug_gen = gencnt; - xug.xug_sogen = so_gencnt; - error = SYSCTL_OUT(req, &xug, sizeof xug); - if (error) - return error; - unp_list = malloc(n * sizeof *unp_list, M_TEMP, M_WAITOK); if (unp_list == 0) return ENOMEM; @@ -867,19 +857,6 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) error = SYSCTL_OUT(req, &xu, sizeof xu); } } - if (!error) { - /* - * Give the user an updated idea of our state. - * If the generation differs from what we told - * her before, she knows that something happened - * while we were processing this request, and it - * might be necessary to retry. - */ - xug.xug_gen = unp_gencnt; - xug.xug_sogen = so_gencnt; - xug.xug_count = unp_count; - error = SYSCTL_OUT(req, &xug, sizeof xug); - } free(unp_list, M_TEMP); return error; } diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 6db4d50e0f..29471ff794 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -82,7 +82,7 @@ * * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95 * $FreeBSD: src/sys/netinet/in_pcb.c,v 1.59.2.27 2004/01/02 04:06:42 ambrisko Exp $ - * $DragonFly: src/sys/netinet/in_pcb.c,v 1.27 2004/12/03 20:29:53 joerg Exp $ + * $DragonFly: src/sys/netinet/in_pcb.c,v 1.28 2004/12/20 11:03:16 joerg Exp $ */ #include "opt_ipsec.h" @@ -1175,7 +1175,6 @@ in_pcblist_global(SYSCTL_HANDLER_ARGS) struct inpcbinfo *pcbinfo = arg1; struct inpcb *inp, *marker; struct xinpcb xi; - struct xinpgen xig; int error, i, n; inp_gen_t gencnt; @@ -1185,8 +1184,7 @@ in_pcblist_global(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = pcbinfo->ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + req->oldidx = (n + n/8 + 10) * sizeof(struct xinpcb); return 0; } @@ -1199,15 +1197,6 @@ in_pcblist_global(SYSCTL_HANDLER_ARGS) gencnt = pcbinfo->ipi_gencnt; n = pcbinfo->ipi_count; - xig.xig_len = sizeof xig; - xig.xig_count = n; - xig.xig_gen = gencnt; - xig.xig_sogen = so_gencnt; - xig.xig_cpu = 0; - error = SYSCTL_OUT(req, &xig, sizeof xig); - if (error) - return error; - marker = malloc(sizeof(struct inpcb), M_TEMP, M_WAITOK|M_ZERO); marker->inp_flags |= INP_PLACEMARKER; @@ -1240,19 +1229,6 @@ in_pcblist_global(SYSCTL_HANDLER_ARGS) ++i; } } - if (error == 0) { - /* - * Give the user an updated idea of our state. - * If the generation differs from what we told - * her before, she knows that something happened - * while we were processing this request, and it - * might be necessary to retry. - */ - xig.xig_gen = pcbinfo->ipi_gencnt; - xig.xig_sogen = so_gencnt; - xig.xig_count = pcbinfo->ipi_count; - error = SYSCTL_OUT(req, &xig, sizeof xig); - } free(marker, M_TEMP); return(error); } diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 9282a46596..125d8c93b6 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -82,7 +82,7 @@ * * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/in_pcb.h,v 1.32.2.7 2003/01/24 05:11:34 sam Exp $ - * $DragonFly: src/sys/netinet/in_pcb.h,v 1.17 2004/12/03 20:29:53 joerg Exp $ + * $DragonFly: src/sys/netinet/in_pcb.h,v 1.18 2004/12/20 11:03:16 joerg Exp $ */ #ifndef _NETINET_IN_PCB_H_ @@ -276,14 +276,6 @@ struct xinpcb { struct xsocket xi_socket; u_quad_t xi_alignment_hack; }; - -struct xinpgen { - size_t xig_len; /* length of this structure */ - u_int xig_count; /* number of PCBs at this time */ - inp_gen_t xig_gen; /* generation count at this time */ - so_gen_t xig_sogen; /* socket generation count at this time */ - int xig_cpu; /* cpu containing additional info */ -}; #endif /* _SYS_SOCKETVAR_H_ */ struct inpcbport { diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index e47300d370..57617efe3e 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -82,7 +82,7 @@ * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.73.2.31 2003/01/24 05:11:34 sam Exp $ - * $DragonFly: src/sys/netinet/tcp_subr.c,v 1.41 2004/12/16 03:37:30 dillon Exp $ + * $DragonFly: src/sys/netinet/tcp_subr.c,v 1.42 2004/12/20 11:03:16 joerg Exp $ */ #include "opt_compat.h" @@ -1096,7 +1096,6 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) struct inpcb *marker; struct inpcb *inp; inp_gen_t gencnt; - struct xinpgen xig; globaldata_t gd; int origcpu, ccpu; @@ -1112,8 +1111,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) gd = globaldata_find(ccpu); n += tcbinfo[gd->gd_cpuid].ipi_count; } - req->oldidx = 2 * ncpus * (sizeof xig) + - (n + n/8) * sizeof(struct xtcpcb); + req->oldidx = (n + n/8 + 10) * sizeof(struct xtcpcb); return (0); } @@ -1149,15 +1147,6 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) gencnt = tcbinfo[cpu_id].ipi_gencnt; n = tcbinfo[cpu_id].ipi_count; - xig.xig_len = sizeof xig; - xig.xig_count = n; - xig.xig_gen = gencnt; - xig.xig_sogen = so_gencnt; - xig.xig_cpu = cpu_id; - error = SYSCTL_OUT(req, &xig, sizeof xig); - if (error != 0) - break; - LIST_INSERT_HEAD(&tcbinfo[cpu_id].pcblisthead, marker, inp_list); i = 0; while ((inp = LIST_NEXT(marker, inp_list)) != NULL && i < n) { @@ -1199,19 +1188,6 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) ++i; } } - if (error == 0) { - /* - * Give the user an updated idea of our state. - * If the generation differs from what we told - * her before, she knows that something happened - * while we were processing this request, and it - * might be necessary to retry. - */ - xig.xig_gen = tcbinfo[cpu_id].ipi_gencnt; - xig.xig_sogen = so_gencnt; - xig.xig_count = tcbinfo[cpu_id].ipi_count; - error = SYSCTL_OUT(req, &xig, sizeof xig); - } } /* diff --git a/sys/sys/unpcb.h b/sys/sys/unpcb.h index 812517afc3..938a086dc9 100644 --- a/sys/sys/unpcb.h +++ b/sys/sys/unpcb.h @@ -32,7 +32,7 @@ * * @(#)unpcb.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/sys/sys/unpcb.h,v 1.9.2.1 2002/03/09 05:22:23 dd Exp $ - * $DragonFly: src/sys/sys/unpcb.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/sys/unpcb.h,v 1.3 2004/12/20 11:03:16 joerg Exp $ */ #ifndef _SYS_UNPCB_H_ @@ -123,13 +123,6 @@ struct xunpcb { struct xsocket xu_socket; u_quad_t xu_alignment_hack; }; - -struct xunpgen { - size_t xug_len; - u_int xug_count; - unp_gen_t xug_gen; - so_gen_t xug_sogen; -}; #endif /* _SYS_SOCKETVAR_H_ */ #endif /* _SYS_UNPCB_H_ */ diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 91ef9eb185..2a532b9e07 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -32,7 +32,7 @@ * * @(#)inet.c 8.5 (Berkeley) 5/24/95 * $FreeBSD: src/usr.bin/netstat/inet.c,v 1.37.2.11 2003/11/27 14:46:49 ru Exp $ - * $DragonFly: src/usr.bin/netstat/inet.c,v 1.15 2004/08/30 18:06:49 eirikn Exp $ + * $DragonFly: src/usr.bin/netstat/inet.c,v 1.16 2004/12/20 11:03:16 joerg Exp $ */ #include @@ -92,16 +92,15 @@ static int udp_done, tcp_done; */ static int ppr_first = 1; -static void outputpcb(int proto, const char *name, int cpu, struct inpcb *inp, struct xsocket *so, struct tcpcb *tp); +static void outputpcb(int proto, const char *name, struct inpcb *inp, struct xsocket *so, struct tcpcb *tp); void protopr(u_long proto, char *name, int af) { int istcp; int i; - char *buf; + void *buf; const char *mibvar; - struct xinpgen *xig, *oxig; size_t len; istcp = 0; @@ -138,6 +137,8 @@ protopr(u_long proto, char *name, int af) warn("sysctl: %s", mibvar); return; } + if (len == 0) + return; if ((buf = malloc(len)) == 0) { warn("malloc %lu bytes", (u_long)len); return; @@ -148,55 +149,30 @@ protopr(u_long proto, char *name, int af) return; } - oxig = (struct xinpgen *)buf; - while ((char *)(oxig + 1) - (char *)buf < len) { - if (oxig->xig_len == 0) - break; - xig = (void *)((char *)oxig + oxig->xig_len); - for (i = 0; i < oxig->xig_count; ++i) { - if (istcp) { - struct xtcpcb *tcp = (void *)xig; - if (xig->xig_len < sizeof(struct xtcpcb)) - break; - outputpcb(proto, name, oxig->xig_cpu, - &tcp->xt_inp, &tcp->xt_socket, - &tcp->xt_tp); - } else { - struct xinpcb *in = (void *)xig; - if (xig->xig_len < sizeof(struct xinpcb)) - break; - outputpcb(proto, name, oxig->xig_cpu, - &in->xi_inp, &in->xi_socket, - NULL); - } - xig = (void *)((char *)xig + xig->xig_len); + if (istcp) { + struct xtcpcb *tcp = buf; + len /= sizeof(*tcp); + for (i = 0; i < len; i++) { + if (tcp[i].xt_len != sizeof(*tcp)) + break; + outputpcb(proto, name, &tcp[i].xt_inp, + &tcp[i].xt_socket, &tcp[i].xt_tp); } - /* - * the terminating xig tells if anything has changed. - * Just ignore it and skip to the starting xig for the next - * cpu (if any). - */ - oxig = (void *)((char *)xig + xig->xig_len); - } -#if 0 - if (xig != oxig && xig->xig_gen != oxig->xig_gen) { - if (oxig->xig_count > xig->xig_count) { - printf("Some %s sockets may have been deleted.\n", - name); - } else if (oxig->xig_count < xig->xig_count) { - printf("Some %s sockets may have been created.\n", - name); - } else { - printf("Some %s sockets may have been created or deleted", - name); + } else { + struct xinpcb *in = buf; + len /= sizeof(*in); + for (i = 0; i < len; i++) { + if (in[i].xi_len != sizeof(*in)) + break; + outputpcb(proto, name, &in[i].xi_inp, + &in[i].xi_socket, NULL); } } -#endif free(buf); } static void -outputpcb(int proto, const char *name, int cpu, struct inpcb *inp, struct xsocket *so, struct tcpcb *tp) +outputpcb(int proto, const char *name, struct inpcb *inp, struct xsocket *so, struct tcpcb *tp) { const char *vchar; @@ -245,13 +221,13 @@ outputpcb(int proto, const char *name, int cpu, struct inpcb *inp, struct xsocke if (Aflag) printf("%-8.8s ", "Socket"); if (Lflag) { - printf("%3s %-5.5s %-14.14s %-22.22s\n", - "Cpu", "Proto", "Listen", "Local Address"); + printf("%-5.5s %-14.14s %-22.22s\n", + "Proto", "Listen", "Local Address"); } else { printf((Aflag && !Wflag) ? - "%3s %-5.5s %-6.6s %-6.6s %-17.17s %-17.17s %s\n" : - "%3s %-5.5s %-6.6s %-6.6s %-21.21s %-21.21s %s\n", - "Cpu", "Proto", "Recv-Q", "Send-Q", + "%-5.5s %-6.6s %-6.6s %-17.17s %-17.17s %s\n" : + "%-5.5s %-6.6s %-6.6s %-21.21s %-21.21s %s\n", + "Proto", "Recv-Q", "Send-Q", "Local Address", "Foreign Address", "(state)"); } @@ -272,7 +248,7 @@ outputpcb(int proto, const char *name, int cpu, struct inpcb *inp, struct xsocke #endif vchar = ((inp->inp_vflag & INP_IPV4) != 0) ? "4 " : " "; - printf("%3d %-3.3s%-2.2s ", cpu, name, vchar); + printf("%-3.3s%-2.2s ", name, vchar); if (Lflag) { char buf[15]; diff --git a/usr.bin/netstat/unix.c b/usr.bin/netstat/unix.c index 52f7a9d8de..28af5d8133 100644 --- a/usr.bin/netstat/unix.c +++ b/usr.bin/netstat/unix.c @@ -32,7 +32,7 @@ * * @(#)unix.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/netstat/unix.c,v 1.12.2.2 2001/08/10 09:07:09 ru Exp $ - * $DragonFly: src/usr.bin/netstat/unix.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/netstat/unix.c,v 1.3 2004/12/20 11:03:16 joerg Exp $ */ /* @@ -68,9 +68,8 @@ unixpr(void) { char *buf; int type; - size_t len; + size_t i, len; struct xsocket *so; - struct xunpgen *xug, *oxug; struct xunpcb *xunp; char mibvar[sizeof "net.local.seqpacket.pcblist"]; @@ -93,29 +92,15 @@ unixpr(void) return; } - oxug = xug = (struct xunpgen *)buf; - for (xug = (struct xunpgen *)((char *)xug + xug->xug_len); - xug->xug_len > sizeof(struct xunpgen); - xug = (struct xunpgen *)((char *)xug + xug->xug_len)) { - xunp = (struct xunpcb *)xug; - so = &xunp->xu_socket; - - /* Ignore PCBs which were freed during copyout. */ - if (xunp->xu_unp.unp_gencnt > oxug->xug_gen) - continue; - unixdomainpr(xunp, so); - } - if (xug != oxug && xug->xug_gen != oxug->xug_gen) { - if (oxug->xug_count > xug->xug_count) { - printf("Some %s sockets may have been deleted.\n", - socktype[type]); - } else if (oxug->xug_count < xug->xug_count) { - printf("Some %s sockets may have been created.\n", - socktype[type]); - } else { - printf("Some %s sockets may have been created or deleted", - socktype[type]); + xunp = buf; + len /= sizeof(*xunp); + for (i = 0; i < len; i++) { + if (xunp[i].xu_len != sizeof(*xunp)) { + warnx("sysctl: ABI mismatch"); + free(buf); + return; } + unixdomainpr(&xunp[i], &xunp[i].xu_socket); } free(buf); } diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index 6e18896cfd..d7ef17f35f 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -32,7 +32,7 @@ * * @(#)netstat.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/netstat.c,v 1.13 1999/08/30 08:18:08 peter Exp $ - * $DragonFly: src/usr.bin/systat/netstat.c,v 1.7 2004/11/13 13:57:36 joerg Exp $ + * $DragonFly: src/usr.bin/systat/netstat.c,v 1.8 2004/12/20 11:03:16 joerg Exp $ */ /* @@ -75,7 +75,7 @@ #include "systat.h" #include "extern.h" -static void enter(struct inpcb *, struct xsocket *, int, const char *, int); +static void enter(struct inpcb *, struct xsocket *, int, const char *); static char *inetname(struct in_addr); static void inetprint(struct in_addr *, int, const char *); @@ -105,7 +105,6 @@ struct netinfo { long ni_fport; /* foreign port */ long ni_rcvcc; /* rcv buffer character count */ long ni_sndcc; /* snd buffer character count */ - int ni_cpuid; /* cpu id */ }; static struct { @@ -115,7 +114,6 @@ static struct { static int aflag = 0; static int nflag = 0; static int lastrow = 1; -static int showcpu; void closenetstat(WINDOW *w) @@ -141,56 +139,43 @@ closenetstat(WINDOW *w) int initnetstat(void) { - int ncpu; - size_t len; - - len = sizeof(ncpu); - if (sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0) == -1) { - warn("cannot determine number of CPUs, assuming SMP"); - showcpu = 1; - } else if (ncpu != 1) { - showcpu = 1; - } - netcb.ni_forw = netcb.ni_prev = (struct netinfo *)&netcb; protos = TCP|UDP; return(1); } static void -enter_tcp(struct xinpgen *xig, int cpu) +enter_tcp(void *xig) { struct xtcpcb *xtcp = (struct xtcpcb *)xig; struct xsocket *xso; int state; - if (xig->xig_len < sizeof(*xtcp)) + if (xtcp->xt_len < sizeof(*xtcp)) return; xso = &xtcp->xt_socket; state = xtcp->xt_tp.t_state; - enter(&xtcp->xt_inp, xso, state, "tcp", cpu); + enter(&xtcp->xt_inp, xso, state, "tcp"); } static void -enter_udp(struct xinpgen *xig, int cpu) +enter_udp(void *xig) { struct xinpcb *xinp = (struct xinpcb *)xig; struct xsocket *xso; - if (xig->xig_len < sizeof(*xinp)) + if (xinp->xi_len < sizeof(*xinp)) return; xso = &xinp->xi_socket; - enter(&xinp->xi_inp, xso, 0, "udp", cpu); + enter(&xinp->xi_inp, xso, 0, "udp"); } static void -fetchnetstat_proto(void (*enter_proto)(struct xinpgen *, int), +fetchnetstat_proto(void (*enter_proto)(void *), const char *mibvar) { - struct xinpgen *xig, *oxig, *end; - char *buf; - size_t i; - int len; + char *buf, *buf2; + size_t i, len, elem_len; if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) { if (errno != ENOENT) @@ -206,15 +191,29 @@ fetchnetstat_proto(void (*enter_proto)(struct xinpgen *, int), free(buf); return; } - oxig = (struct xinpgen *)buf; - end = (struct xinpgen *)(buf + len); - while (oxig + 1 < end && oxig->xig_len > 0) { - xig = (struct xinpgen *)((char *)oxig + oxig->xig_len); - for (i = 0; i < oxig->xig_count; ++i) { - enter_proto(xig, oxig->xig_cpu); - xig = (void *)((char *)xig + xig->xig_len); + + /* + * XXX this is better with a single PCB type + */ + if (len == 0) { + free(buf); + return; + } + if (len < sizeof(size_t)) { + warnx("sysctl: short read"); + free(buf); + return; + } + elem_len = *(size_t *)buf; + len /= elem_len; + buf2 = buf; + for (i = 0; i < len; i++, buf2 += elem_len) { + if (*(size_t *)(buf2) != elem_len) { + warn("sysctl: inconsistent PCB len"); + free(buf); + return; } - oxig = (struct xinpgen *)((char *)xig + xig->xig_len); + enter_proto(buf2); } free(buf); } @@ -233,8 +232,7 @@ fetchnetstat(void) } static void -enter(struct inpcb *inp, struct xsocket *so, int state, const char *proto, - int cpu) +enter(struct inpcb *inp, struct xsocket *so, int state, const char *proto) { register struct netinfo *p; @@ -287,7 +285,6 @@ enter(struct inpcb *inp, struct xsocket *so, int state, const char *proto, p->ni_rcvcc = so->so_rcv.sb_cc; p->ni_sndcc = so->so_snd.sb_cc; p->ni_state = state; - p->ni_cpuid = cpu; p->ni_seen = 1; } @@ -307,8 +304,6 @@ labelnetstat(void) wmove(wnd, 0, 0); wclrtobot(wnd); mvwaddstr(wnd, 0, LADDR, "Local Address"); mvwaddstr(wnd, 0, FADDR, "Foreign Address"); - if (showcpu) - mvwaddstr(wnd, 0, CPUID, "Cpu"); mvwaddstr(wnd, 0, PROTO, "Proto"); mvwaddstr(wnd, 0, RCVCC, "Recv-Q"); mvwaddstr(wnd, 0, SNDCC, "Send-Q"); @@ -369,8 +364,6 @@ shownetstat(void) inetprint(&p->ni_faddr, p->ni_fport, p->ni_proto); p->ni_flags &= ~NIF_FACHG; } - if (showcpu) - mvwprintw(wnd, p->ni_line, CPUID, "%d", p->ni_cpuid); mvwaddstr(wnd, p->ni_line, PROTO, p->ni_proto); mvwprintw(wnd, p->ni_line, RCVCC, "%6d", p->ni_rcvcc); mvwprintw(wnd, p->ni_line, SNDCC, "%6d", p->ni_sndcc); -- 2.41.0