=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/netstat/Attic/atalk.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/netstat/Attic/atalk.c 2005/03/30 06:45:34 1.14 --- src/usr.bin/netstat/Attic/atalk.c 2007/12/14 18:35:46 1.15 *************** *** 1,4 **** ! /* $OpenBSD: atalk.c,v 1.14 2005/03/30 06:45:34 deraadt Exp $ */ /* $NetBSD: atalk.c,v 1.2 1997/05/22 17:21:26 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: atalk.c,v 1.15 2007/12/14 18:35:46 deraadt Exp $ */ /* $NetBSD: atalk.c,v 1.2 1997/05/22 17:21:26 christos Exp $ */ /* *************** *** 34,40 **** #if 0 static char sccsid[] = "from @(#)atalk.c 1.1 (Whistle) 6/6/96"; #else ! static char rcsid[] = "$OpenBSD: atalk.c,v 1.14 2005/03/30 06:45:34 deraadt Exp $"; #endif #endif /* not lint */ --- 34,40 ---- #if 0 static char sccsid[] = "from @(#)atalk.c 1.1 (Whistle) 6/6/96"; #else ! static char rcsid[] = "$OpenBSD: atalk.c,v 1.15 2007/12/14 18:35:46 deraadt Exp $"; #endif #endif /* not lint */ *************** *** 44,49 **** --- 44,50 ---- #include #include #include + #include #include #include *************** *** 305,318 **** * Dump DDP statistics structure. */ void ! ddp_stats(u_long off, char *name) { struct ddpstat ddpstat; ! if (off == 0) return; ! if (kread(off, &ddpstat, sizeof(ddpstat)) < 0) ! return; printf("%s:\n", name); p(ddps_short, "\t%ld packet%s with short headers\n"); p(ddps_long, "\t%ld packet%s with long headers\n"); --- 306,324 ---- * Dump DDP statistics structure. */ void ! ddp_stats(char *name) { struct ddpstat ddpstat; + int mib[] = { CTL_NET, AF_APPLETALK, ATPROTO_DDP, DDPCTL_STATS }; + size_t len = sizeof(ddpstat); ! if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), ! &ddpstat, &len, NULL, 0) == -1) { ! if (errno != ENOPROTOOPT) ! warn(name); return; ! } ! printf("%s:\n", name); p(ddps_short, "\t%ld packet%s with short headers\n"); p(ddps_long, "\t%ld packet%s with long headers\n");