Deleted Added
sdiff udiff text old ( 166952 ) new ( 171465 )
full compact
1/*
2 * Copyright (C) 1998 WIDE Project.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 *
66 * @(#)mroute.c 8.2 (Berkeley) 4/28/95
67 */
68
69#include <sys/cdefs.h>
70__FBSDID("$FreeBSD: head/usr.bin/netstat/mroute6.c 171465 2007-07-16 17:15:55Z jhb $");
71
72#ifdef INET6
73#include <sys/param.h>
74#include <sys/queue.h>
75#include <sys/socket.h>
76#include <sys/socketvar.h>
77#include <sys/sysctl.h>
78#include <sys/protosw.h>

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

111 int i;
112 int banner_printed;
113 int saved_numeric_addr;
114 mifi_t maxmif = 0;
115 long int waitings;
116 size_t len;
117
118 len = sizeof(mif6table);
119 if (live) {
120 if (sysctlbyname("net.inet6.ip6.mif6table", mif6table, &len,
121 NULL, 0) < 0) {
122 warn("sysctl: net.inet6.ip6.mif6table");
123 return;
124 }
125 } else
126 kread(mifaddr, (char *)mif6table, sizeof(mif6table));
127
128 saved_numeric_addr = numeric_addr;
129 numeric_addr = 1;
130 banner_printed = 0;
131
132 for (mifi = 0, mifp = mif6table; mifi < MAXMIFS; ++mifi, ++mifp) {
133 struct ifnet ifnet;
134 char ifname[IFNAMSIZ];

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

154
155 printf(" %9ju %9ju\n", (uintmax_t)mifp->m6_pkt_in,
156 (uintmax_t)mifp->m6_pkt_out);
157 }
158 if (!banner_printed)
159 printf("\nIPv6 Multicast Interface Table is empty\n");
160
161 len = sizeof(mf6ctable);
162 if (live) {
163 if (sysctlbyname("net.inet6.ip6.mf6ctable", mf6ctable, &len,
164 NULL, 0) < 0) {
165 warn("sysctl: net.inet6.ip6.mf6ctable");
166 return;
167 }
168 } else
169 kread(mfcaddr, (char *)mf6ctable, sizeof(mf6ctable));
170
171 banner_printed = 0;
172
173 for (i = 0; i < MF6CTBLSIZ; ++i) {
174 mfcp = mf6ctable[i];
175 while(mfcp) {
176 kread((u_long)mfcp, (char *)&mfc, sizeof(mfc));
177 if (!banner_printed) {

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

218}
219
220void
221mrt6_stats(u_long mstaddr)
222{
223 struct mrt6stat mrtstat;
224 size_t len = sizeof mrtstat;
225
226 if (live) {
227 if (sysctlbyname("net.inet6.ip6.mrt6stat", &mrtstat, &len,
228 NULL, 0) < 0) {
229 warn("sysctl: net.inet6.ip6.mrt6stat");
230 return;
231 }
232 } else
233 kread(mstaddr, (char *)&mrtstat, sizeof(mrtstat));
234
235 printf("IPv6 multicast forwarding:\n");
236
237#define p(f, m) if (mrtstat.f || sflag <= 1) \
238 printf(m, (uintmax_t)mrtstat.f, plural(mrtstat.f))
239#define p2(f, m) if (mrtstat.f || sflag <= 1) \
240 printf(m, (uintmax_t)mrtstat.f, plurales(mrtstat.f))
241
242 p(mrt6s_mfc_lookups, "\t%ju multicast forwarding cache lookup%s\n");

--- 19 unchanged lines hidden ---