inet6.c (cfe30d02adda7c3b5c76156ac52d50d8cab325d9) inet6.c (a786f679811e7e2732a81269c8f6ee92e87c8ff9)
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:

--- 362 unchanged lines hidden (view full) ---

371 memset(&zerostat, 0, len);
372 if (sysctlbyname("net.inet6.ip6.stats", &ip6stat, &len,
373 zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
374 if (errno != ENOENT)
375 warn("sysctl: net.inet6.ip6.stats");
376 return;
377 }
378 } else
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:

--- 362 unchanged lines hidden (view full) ---

371 memset(&zerostat, 0, len);
372 if (sysctlbyname("net.inet6.ip6.stats", &ip6stat, &len,
373 zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
374 if (errno != ENOENT)
375 warn("sysctl: net.inet6.ip6.stats");
376 return;
377 }
378 } else
379 kread(off, &ip6stat, len);
379 kread_counters(off, &ip6stat, len);
380
381 printf("%s:\n", name);
382
383#define p(f, m) if (ip6stat.f || sflag <= 1) \
384 printf(m, (uintmax_t)ip6stat.f, plural(ip6stat.f))
385#define p1a(f, m) if (ip6stat.f || sflag <= 1) \
386 printf(m, (uintmax_t)ip6stat.f)
387

--- 465 unchanged lines hidden (view full) ---

853 memset(&zerostat, 0, len);
854 if (sysctlbyname("net.inet6.icmp6.stats", &icmp6stat, &len,
855 zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
856 if (errno != ENOENT)
857 warn("sysctl: net.inet6.icmp6.stats");
858 return;
859 }
860 } else
380
381 printf("%s:\n", name);
382
383#define p(f, m) if (ip6stat.f || sflag <= 1) \
384 printf(m, (uintmax_t)ip6stat.f, plural(ip6stat.f))
385#define p1a(f, m) if (ip6stat.f || sflag <= 1) \
386 printf(m, (uintmax_t)ip6stat.f)
387

--- 465 unchanged lines hidden (view full) ---

853 memset(&zerostat, 0, len);
854 if (sysctlbyname("net.inet6.icmp6.stats", &icmp6stat, &len,
855 zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
856 if (errno != ENOENT)
857 warn("sysctl: net.inet6.icmp6.stats");
858 return;
859 }
860 } else
861 kread(off, &icmp6stat, len);
861 kread_counters(off, &icmp6stat, len);
862
863 printf("%s:\n", name);
864
865#define p(f, m) if (icmp6stat.f || sflag <= 1) \
866 printf(m, (uintmax_t)icmp6stat.f, plural(icmp6stat.f))
867#define p_5(f, m) if (icmp6stat.f || sflag <= 1) \
868 printf(m, (uintmax_t)icmp6stat.f)
869

--- 177 unchanged lines hidden (view full) ---

1047 memset(&zerostat, 0, len);
1048 if (sysctlbyname("net.inet6.ip6.rip6stats", &rip6stat, &len,
1049 zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
1050 if (errno != ENOENT)
1051 warn("sysctl: net.inet6.ip6.rip6stats");
1052 return;
1053 }
1054 } else
862
863 printf("%s:\n", name);
864
865#define p(f, m) if (icmp6stat.f || sflag <= 1) \
866 printf(m, (uintmax_t)icmp6stat.f, plural(icmp6stat.f))
867#define p_5(f, m) if (icmp6stat.f || sflag <= 1) \
868 printf(m, (uintmax_t)icmp6stat.f)
869

--- 177 unchanged lines hidden (view full) ---

1047 memset(&zerostat, 0, len);
1048 if (sysctlbyname("net.inet6.ip6.rip6stats", &rip6stat, &len,
1049 zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
1050 if (errno != ENOENT)
1051 warn("sysctl: net.inet6.ip6.rip6stats");
1052 return;
1053 }
1054 } else
1055 kread(off, &rip6stat, len);
1055 kread_counters(off, &rip6stat, len);
1056
1057 printf("%s:\n", name);
1058
1059#define p(f, m) if (rip6stat.f || sflag <= 1) \
1060 printf(m, (uintmax_t)rip6stat.f, plural(rip6stat.f))
1061 p(rip6s_ipackets, "\t%ju message%s received\n");
1062 p(rip6s_isum, "\t%ju checksum calculation%s on inbound\n");
1063 p(rip6s_badsum, "\t%ju message%s with bad checksum\n");

--- 94 unchanged lines hidden ---
1056
1057 printf("%s:\n", name);
1058
1059#define p(f, m) if (rip6stat.f || sflag <= 1) \
1060 printf(m, (uintmax_t)rip6stat.f, plural(rip6stat.f))
1061 p(rip6s_ipackets, "\t%ju message%s received\n");
1062 p(rip6s_isum, "\t%ju checksum calculation%s on inbound\n");
1063 p(rip6s_badsum, "\t%ju message%s with bad checksum\n");

--- 94 unchanged lines hidden ---