inet6.c (83200) | inet6.c (95637) |
---|---|
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: --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * | 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: --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/usr.bin/netstat/inet6.c 83200 2001-09-07 12:00:50Z ru $ | 34 * $FreeBSD: head/usr.bin/netstat/inet6.c 95637 2002-04-28 12:17:27Z markm $ |
35 */ 36 37#ifndef lint 38/* 39static char sccsid[] = "@(#)inet6.c 8.4 (Berkeley) 4/20/94"; 40*/ 41#endif /* not lint */ 42 --- 768 unchanged lines hidden (view full) --- 811 812/* 813 * Dump ICMP6 statistics. 814 */ 815void 816icmp6_stats(u_long off __unused, char *name, int af __unused) 817{ 818 struct icmp6stat icmp6stat; | 35 */ 36 37#ifndef lint 38/* 39static char sccsid[] = "@(#)inet6.c 8.4 (Berkeley) 4/20/94"; 40*/ 41#endif /* not lint */ 42 --- 768 unchanged lines hidden (view full) --- 811 812/* 813 * Dump ICMP6 statistics. 814 */ 815void 816icmp6_stats(u_long off __unused, char *name, int af __unused) 817{ 818 struct icmp6stat icmp6stat; |
819 register int i, first; | 819 int i, first; |
820 int mib[4]; 821 size_t len; 822 823 mib[0] = CTL_NET; 824 mib[1] = PF_INET6; 825 mib[2] = IPPROTO_ICMPV6; 826 mib[3] = ICMPV6CTL_STATS; 827 --- 7 unchanged lines hidden (view full) --- 835 printf(m, (unsigned long long)icmp6stat.f, plural(icmp6stat.f)) 836#define p_5(f, m) printf(m, (unsigned long long)icmp6stat.f) 837 838 p(icp6s_error, "\t%llu call%s to icmp_error\n"); 839 p(icp6s_canterror, 840 "\t%llu error%s not generated because old message was icmp error or so\n"); 841 p(icp6s_toofreq, 842 "\t%llu error%s not generated because rate limitation\n"); | 820 int mib[4]; 821 size_t len; 822 823 mib[0] = CTL_NET; 824 mib[1] = PF_INET6; 825 mib[2] = IPPROTO_ICMPV6; 826 mib[3] = ICMPV6CTL_STATS; 827 --- 7 unchanged lines hidden (view full) --- 835 printf(m, (unsigned long long)icmp6stat.f, plural(icmp6stat.f)) 836#define p_5(f, m) printf(m, (unsigned long long)icmp6stat.f) 837 838 p(icp6s_error, "\t%llu call%s to icmp_error\n"); 839 p(icp6s_canterror, 840 "\t%llu error%s not generated because old message was icmp error or so\n"); 841 p(icp6s_toofreq, 842 "\t%llu error%s not generated because rate limitation\n"); |
843#define NELEM (sizeof(icmp6stat.icp6s_outhist)/sizeof(icmp6stat.icp6s_outhist[0])) | 843#define NELEM (int)(sizeof(icmp6stat.icp6s_outhist)/sizeof(icmp6stat.icp6s_outhist[0])) |
844 for (first = 1, i = 0; i < NELEM; i++) 845 if (icmp6stat.icp6s_outhist[i] != 0) { 846 if (first) { 847 printf("\tOutput histogram:\n"); 848 first = 0; 849 } 850 printf("\t\t%s: %llu\n", icmp6names[i], 851 (unsigned long long)icmp6stat.icp6s_outhist[i]); 852 } 853#undef NELEM 854 p(icp6s_badcode, "\t%llu message%s with bad code fields\n"); 855 p(icp6s_tooshort, "\t%llu message%s < minimum length\n"); 856 p(icp6s_checksum, "\t%llu bad checksum%s\n"); 857 p(icp6s_badlen, "\t%llu message%s with bad length\n"); | 844 for (first = 1, i = 0; i < NELEM; i++) 845 if (icmp6stat.icp6s_outhist[i] != 0) { 846 if (first) { 847 printf("\tOutput histogram:\n"); 848 first = 0; 849 } 850 printf("\t\t%s: %llu\n", icmp6names[i], 851 (unsigned long long)icmp6stat.icp6s_outhist[i]); 852 } 853#undef NELEM 854 p(icp6s_badcode, "\t%llu message%s with bad code fields\n"); 855 p(icp6s_tooshort, "\t%llu message%s < minimum length\n"); 856 p(icp6s_checksum, "\t%llu bad checksum%s\n"); 857 p(icp6s_badlen, "\t%llu message%s with bad length\n"); |
858#define NELEM (sizeof(icmp6stat.icp6s_inhist)/sizeof(icmp6stat.icp6s_inhist[0])) | 858#define NELEM (int)(sizeof(icmp6stat.icp6s_inhist)/sizeof(icmp6stat.icp6s_inhist[0])) |
859 for (first = 1, i = 0; i < NELEM; i++) 860 if (icmp6stat.icp6s_inhist[i] != 0) { 861 if (first) { 862 printf("\tInput histogram:\n"); 863 first = 0; 864 } 865 printf("\t\t%s: %llu\n", icmp6names[i], 866 (unsigned long long)icmp6stat.icp6s_inhist[i]); --- 242 unchanged lines hidden --- | 859 for (first = 1, i = 0; i < NELEM; i++) 860 if (icmp6stat.icp6s_inhist[i] != 0) { 861 if (first) { 862 printf("\tInput histogram:\n"); 863 first = 0; 864 } 865 printf("\t\t%s: %llu\n", icmp6names[i], 866 (unsigned long long)icmp6stat.icp6s_inhist[i]); --- 242 unchanged lines hidden --- |