inet6.c (160787) | inet6.c (166952) |
---|---|
1/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */ 2/* 3 * Copyright (c) 1983, 1988, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 25 unchanged lines hidden (view full) --- 34 35#if 0 36#ifndef lint 37static char sccsid[] = "@(#)inet6.c 8.4 (Berkeley) 4/20/94"; 38#endif /* not lint */ 39#endif 40 41#include <sys/cdefs.h> | 1/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */ 2/* 3 * Copyright (c) 1983, 1988, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 25 unchanged lines hidden (view full) --- 34 35#if 0 36#ifndef lint 37static char sccsid[] = "@(#)inet6.c 8.4 (Berkeley) 4/20/94"; 38#endif /* not lint */ 39#endif 40 41#include <sys/cdefs.h> |
42__FBSDID("$FreeBSD: head/usr.bin/netstat/inet6.c 160787 2006-07-28 16:09:19Z yar $"); | 42__FBSDID("$FreeBSD: head/usr.bin/netstat/inet6.c 166952 2007-02-24 21:58:30Z bms $"); |
43 44#ifdef INET6 45#include <sys/param.h> 46#include <sys/socket.h> 47#include <sys/socketvar.h> 48#include <sys/ioctl.h> 49#include <sys/mbuf.h> 50#include <sys/protosw.h> --- 10 unchanged lines hidden (view full) --- 61#include <netinet6/in6_var.h> 62#include <netinet6/ip6_var.h> 63#include <netinet6/pim6_var.h> 64#include <netinet6/raw_ip6.h> 65 66#include <arpa/inet.h> 67#include <netdb.h> 68 | 43 44#ifdef INET6 45#include <sys/param.h> 46#include <sys/socket.h> 47#include <sys/socketvar.h> 48#include <sys/ioctl.h> 49#include <sys/mbuf.h> 50#include <sys/protosw.h> --- 10 unchanged lines hidden (view full) --- 61#include <netinet6/in6_var.h> 62#include <netinet6/ip6_var.h> 63#include <netinet6/pim6_var.h> 64#include <netinet6/raw_ip6.h> 65 66#include <arpa/inet.h> 67#include <netdb.h> 68 |
69#include <err.h> |
|
69#include <stdint.h> 70#include <stdio.h> 71#include <errno.h> 72#include <string.h> 73#include <unistd.h> 74#include "netstat.h" 75 76struct socket sockb; --- 913 unchanged lines hidden (view full) --- 990} 991 992/* 993 * Dump PIM statistics structure. 994 */ 995void 996pim6_stats(u_long off __unused, const char *name, int af1 __unused) 997{ | 70#include <stdint.h> 71#include <stdio.h> 72#include <errno.h> 73#include <string.h> 74#include <unistd.h> 75#include "netstat.h" 76 77struct socket sockb; --- 913 unchanged lines hidden (view full) --- 991} 992 993/* 994 * Dump PIM statistics structure. 995 */ 996void 997pim6_stats(u_long off __unused, const char *name, int af1 __unused) 998{ |
998 struct pim6stat pim6stat; | 999 struct pim6stat pim6stat, zerostat; 1000 size_t len = sizeof pim6stat; |
999 | 1001 |
1000 if (off == 0) | 1002 /* TODO put back the KVM functionality for -M switch ie coredumps. */ 1003 if (zflag) 1004 memset(&zerostat, 0, len); 1005 if (sysctlbyname("net.inet6.pim.stats", &pim6stat, &len, 1006 zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { 1007 if (errno != ENOENT) 1008 warn("sysctl: net.inet6.pim.stats"); |
1001 return; | 1009 return; |
1002 if (kread(off, (char *)&pim6stat, sizeof(pim6stat))) 1003 return; | 1010 } |
1004 printf("%s:\n", name); 1005 1006#define p(f, m) if (pim6stat.f || sflag <= 1) \ 1007 printf(m, (uintmax_t)pim6stat.f, plural(pim6stat.f)) 1008 p(pim6s_rcv_total, "\t%ju message%s received\n"); 1009 p(pim6s_rcv_tooshort, "\t%ju message%s received with too few bytes\n"); 1010 p(pim6s_rcv_badsum, "\t%ju message%s received with bad checksum\n"); 1011 p(pim6s_rcv_badversion, "\t%ju message%s received with bad version\n"); --- 130 unchanged lines hidden --- | 1011 printf("%s:\n", name); 1012 1013#define p(f, m) if (pim6stat.f || sflag <= 1) \ 1014 printf(m, (uintmax_t)pim6stat.f, plural(pim6stat.f)) 1015 p(pim6s_rcv_total, "\t%ju message%s received\n"); 1016 p(pim6s_rcv_tooshort, "\t%ju message%s received with too few bytes\n"); 1017 p(pim6s_rcv_badsum, "\t%ju message%s received with bad checksum\n"); 1018 p(pim6s_rcv_badversion, "\t%ju message%s received with bad version\n"); --- 130 unchanged lines hidden --- |