version 1.14, 2005/03/30 06:45:34 |
version 1.15, 2007/12/14 18:35:46 |
|
|
#include <sys/socketvar.h> |
#include <sys/socketvar.h> |
#include <sys/mbuf.h> |
#include <sys/mbuf.h> |
#include <sys/protosw.h> |
#include <sys/protosw.h> |
|
#include <sys/sysctl.h> |
#include <netdb.h> |
#include <netdb.h> |
|
|
#include <net/route.h> |
#include <net/route.h> |
|
|
* Dump DDP statistics structure. |
* Dump DDP statistics structure. |
*/ |
*/ |
void |
void |
ddp_stats(u_long off, char *name) |
ddp_stats(char *name) |
{ |
{ |
struct ddpstat ddpstat; |
struct ddpstat ddpstat; |
|
int mib[] = { CTL_NET, AF_APPLETALK, ATPROTO_DDP, DDPCTL_STATS }; |
|
size_t len = sizeof(ddpstat); |
|
|
if (off == 0) |
if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), |
|
&ddpstat, &len, NULL, 0) == -1) { |
|
if (errno != ENOPROTOOPT) |
|
warn(name); |
return; |
return; |
if (kread(off, &ddpstat, sizeof(ddpstat)) < 0) |
} |
return; |
|
printf("%s:\n", name); |
printf("%s:\n", name); |
p(ddps_short, "\t%ld packet%s with short headers\n"); |
p(ddps_short, "\t%ld packet%s with short headers\n"); |
p(ddps_long, "\t%ld packet%s with long headers\n"); |
p(ddps_long, "\t%ld packet%s with long headers\n"); |