Deleted Added
full compact
ifmcstat.c (70520) ifmcstat.c (72084)
1/*
2 * Copyright (C) 1995, 1996, 1997, and 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

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Copyright (C) 1995, 1996, 1997, and 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

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/usr.sbin/ifmcstat/ifmcstat.c 70520 2000-12-30 20:56:04Z phk $
29 * $FreeBSD: head/usr.sbin/ifmcstat/ifmcstat.c 72084 2001-02-06 10:12:15Z phk $
30 */
31
32#include <stdio.h>
33#include <stdlib.h>
34#include <fcntl.h>
35#include <kvm.h>
36#include <nlist.h>
37#include <string.h>

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

198 struct ifmultiaddr ifm, *ifmp = 0;
199 struct sockaddr_in6 sin6;
200 struct in6_multi in6m;
201 struct sockaddr_dl sdl;
202 int in6_multilist_done = 0;
203
204 KREAD(ifap0, &ifa, struct ifaddr);
205 KREAD(ifa.ifa_ifp, &ifnet, struct ifnet);
30 */
31
32#include <stdio.h>
33#include <stdlib.h>
34#include <fcntl.h>
35#include <kvm.h>
36#include <nlist.h>
37#include <string.h>

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

198 struct ifmultiaddr ifm, *ifmp = 0;
199 struct sockaddr_in6 sin6;
200 struct in6_multi in6m;
201 struct sockaddr_dl sdl;
202 int in6_multilist_done = 0;
203
204 KREAD(ifap0, &ifa, struct ifaddr);
205 KREAD(ifa.ifa_ifp, &ifnet, struct ifnet);
206 if (LIST_FIRST(&ifnet.if_multiaddrs))
207 ifmp = LIST_FIRST(&ifnet.if_multiaddrs);
206 if (TAILQ_FIRST(&ifnet.if_multiaddrs))
207 ifmp = TAILQ_FIRST(&ifnet.if_multiaddrs);
208 while (ifmp) {
209 KREAD(ifmp, &ifm, struct ifmultiaddr);
210 if (ifm.ifma_addr == NULL)
211 goto nextmulti;
212 KREAD(ifm.ifma_addr, &sa, struct sockaddr);
213 if (sa.sa_family != AF_INET6)
214 goto nextmulti;
215 (void)in6_multientry((struct in6_multi *)
216 ifm.ifma_protospec);
217 if (ifm.ifma_lladdr == 0)
218 goto nextmulti;
219 KREAD(ifm.ifma_lladdr, &sdl, struct sockaddr_dl);
220 printf("\t\t\tmcast-macaddr %s multicnt %d\n",
221 ether_ntoa((struct ether_addr *)LLADDR(&sdl)),
222 ifm.ifma_refcount);
223 nextmulti:
208 while (ifmp) {
209 KREAD(ifmp, &ifm, struct ifmultiaddr);
210 if (ifm.ifma_addr == NULL)
211 goto nextmulti;
212 KREAD(ifm.ifma_addr, &sa, struct sockaddr);
213 if (sa.sa_family != AF_INET6)
214 goto nextmulti;
215 (void)in6_multientry((struct in6_multi *)
216 ifm.ifma_protospec);
217 if (ifm.ifma_lladdr == 0)
218 goto nextmulti;
219 KREAD(ifm.ifma_lladdr, &sdl, struct sockaddr_dl);
220 printf("\t\t\tmcast-macaddr %s multicnt %d\n",
221 ether_ntoa((struct ether_addr *)LLADDR(&sdl)),
222 ifm.ifma_refcount);
223 nextmulti:
224 ifmp = LIST_NEXT(&ifm, ifma_link);
224 ifmp = TAILQ_NEXT(&ifm, ifma_link);
225 }
226 }
227#ifdef N_IN6_MK
228 if (nl[N_IN6_MK].n_value != 0) {
229 LIST_HEAD(in6_mktype, multi6_kludge) in6_mk;
230 struct multi6_kludge *mkp, mk;
231 char *nam;
232

--- 38 unchanged lines hidden ---
225 }
226 }
227#ifdef N_IN6_MK
228 if (nl[N_IN6_MK].n_value != 0) {
229 LIST_HEAD(in6_mktype, multi6_kludge) in6_mk;
230 struct multi6_kludge *mkp, mk;
231 char *nam;
232

--- 38 unchanged lines hidden ---