mrinfo.c revision 1.1 1 1.1 mycroft /*
2 1.1 mycroft * This tool requests configuration info from a multicast router
3 1.1 mycroft * and prints the reply (if any). Invoke it as:
4 1.1 mycroft *
5 1.1 mycroft * mrinfo router-name-or-address
6 1.1 mycroft *
7 1.1 mycroft * Written Wed Mar 24 1993 by Van Jacobson (adapted from the
8 1.1 mycroft * multicast mapper written by Pavel Curtis).
9 1.1 mycroft *
10 1.1 mycroft * The lawyers insist we include the following UC copyright notice.
11 1.1 mycroft * The mapper from which this is derived contained a Xerox copyright
12 1.1 mycroft * notice which follows the UC one. Try not to get depressed noting
13 1.1 mycroft * that the legal gibberish is larger than the program.
14 1.1 mycroft *
15 1.1 mycroft * Copyright (c) 1993 Regents of the University of California.
16 1.1 mycroft * All rights reserved.
17 1.1 mycroft *
18 1.1 mycroft * Redistribution and use in source and binary forms, with or without
19 1.1 mycroft * modification, are permitted provided that the following conditions
20 1.1 mycroft * are met:
21 1.1 mycroft * 1. Redistributions of source code must retain the above copyright
22 1.1 mycroft * notice, this list of conditions and the following disclaimer.
23 1.1 mycroft * 2. Redistributions in binary form must reproduce the above copyright
24 1.1 mycroft * notice, this list of conditions and the following disclaimer in the
25 1.1 mycroft * documentation and/or other materials provided with the distribution.
26 1.1 mycroft * 3. All advertising materials mentioning features or use of this software
27 1.1 mycroft * must display the following acknowledgement:
28 1.1 mycroft * This product includes software developed by the Computer Systems
29 1.1 mycroft * Engineering Group at Lawrence Berkeley Laboratory.
30 1.1 mycroft * 4. Neither the name of the University nor of the Laboratory may be used
31 1.1 mycroft * to endorse or promote products derived from this software without
32 1.1 mycroft * specific prior written permission.
33 1.1 mycroft *
34 1.1 mycroft * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
35 1.1 mycroft * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 1.1 mycroft * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 1.1 mycroft * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
38 1.1 mycroft * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 1.1 mycroft * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
40 1.1 mycroft * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41 1.1 mycroft * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42 1.1 mycroft * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
43 1.1 mycroft * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 1.1 mycroft * SUCH DAMAGE.
45 1.1 mycroft * ---------------------------------
46 1.1 mycroft * Copyright (c) Xerox Corporation 1992. All rights reserved.
47 1.1 mycroft *
48 1.1 mycroft * License is granted to copy, to use, and to make and to use derivative works
49 1.1 mycroft * for research and evaluation purposes, provided that Xerox is acknowledged
50 1.1 mycroft * in all documentation pertaining to any such copy or derivative work. Xerox
51 1.1 mycroft * grants no other licenses expressed or implied. The Xerox trade name should
52 1.1 mycroft * not be used in any advertising without its written permission.
53 1.1 mycroft *
54 1.1 mycroft * XEROX CORPORATION MAKES NO REPRESENTATIONS CONCERNING EITHER THE
55 1.1 mycroft * MERCHANTABILITY OF THIS SOFTWARE OR THE SUITABILITY OF THIS SOFTWARE FOR
56 1.1 mycroft * ANY PARTICULAR PURPOSE. The software is provided "as is" without express
57 1.1 mycroft * or implied warranty of any kind.
58 1.1 mycroft *
59 1.1 mycroft * These notices must be retained in any copies of any part of this software.
60 1.1 mycroft */
61 1.1 mycroft
62 1.1 mycroft #ifndef lint
63 1.1 mycroft static char rcsid[] =
64 1.1 mycroft "@(#) $Id: mrinfo.c,v 1.1 1995/06/01 05:19:13 mycroft Exp $";
65 1.1 mycroft /* original rcsid:
66 1.1 mycroft "@(#) Header: mrinfo.c,v 1.6 93/04/08 15:14:16 van Exp (LBL)";
67 1.1 mycroft */
68 1.1 mycroft #endif
69 1.1 mycroft
70 1.1 mycroft #include <netdb.h>
71 1.1 mycroft #include <sys/time.h>
72 1.1 mycroft #include "defs.h"
73 1.1 mycroft #include <arpa/inet.h>
74 1.1 mycroft
75 1.1 mycroft #define DEFAULT_TIMEOUT 4 /* How long to wait before retrying requests */
76 1.1 mycroft #define DEFAULT_RETRIES 3 /* How many times to ask each router */
77 1.1 mycroft
78 1.1 mycroft u_int32_t our_addr, target_addr = 0; /* in NET order */
79 1.1 mycroft int debug = 0;
80 1.1 mycroft int nflag = 0;
81 1.1 mycroft int retries = DEFAULT_RETRIES;
82 1.1 mycroft int timeout = DEFAULT_TIMEOUT;
83 1.1 mycroft int target_level;
84 1.1 mycroft vifi_t numvifs; /* to keep loader happy */
85 1.1 mycroft /* (see COPY_TABLES macro called in kern.c) */
86 1.1 mycroft
87 1.1 mycroft char *
88 1.1 mycroft inet_name(addr)
89 1.1 mycroft u_int32_t addr;
90 1.1 mycroft {
91 1.1 mycroft struct hostent *e;
92 1.1 mycroft struct in_addr in;
93 1.1 mycroft
94 1.1 mycroft if (addr == 0)
95 1.1 mycroft return "local";
96 1.1 mycroft
97 1.1 mycroft if (nflag ||
98 1.1 mycroft (e = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET)) == NULL) {
99 1.1 mycroft in.s_addr = addr;
100 1.1 mycroft return (inet_ntoa(in));
101 1.1 mycroft }
102 1.1 mycroft return (e->h_name);
103 1.1 mycroft }
104 1.1 mycroft
105 1.1 mycroft /*
106 1.1 mycroft * Log errors and other messages to stderr, according to the severity of the
107 1.1 mycroft * message and the current debug level. For errors of severity LOG_ERR or
108 1.1 mycroft * worse, terminate the program.
109 1.1 mycroft */
110 1.1 mycroft void
111 1.1 mycroft log(severity, syserr, format, a, b, c, d, e)
112 1.1 mycroft int severity, syserr;
113 1.1 mycroft char *format;
114 1.1 mycroft int a, b, c, d, e;
115 1.1 mycroft {
116 1.1 mycroft char fmt[100];
117 1.1 mycroft
118 1.1 mycroft switch (debug) {
119 1.1 mycroft case 0:
120 1.1 mycroft if (severity > LOG_WARNING)
121 1.1 mycroft return;
122 1.1 mycroft case 1:
123 1.1 mycroft if (severity > LOG_NOTICE)
124 1.1 mycroft return;
125 1.1 mycroft case 2:
126 1.1 mycroft if (severity > LOG_INFO)
127 1.1 mycroft return;
128 1.1 mycroft default:
129 1.1 mycroft fmt[0] = '\0';
130 1.1 mycroft if (severity == LOG_WARNING)
131 1.1 mycroft strcat(fmt, "warning - ");
132 1.1 mycroft strncat(fmt, format, 80);
133 1.1 mycroft fprintf(stderr, fmt, a, b, c, d, e);
134 1.1 mycroft if (syserr == 0)
135 1.1 mycroft fprintf(stderr, "\n");
136 1.1 mycroft else if (syserr < sys_nerr)
137 1.1 mycroft fprintf(stderr, ": %s\n", sys_errlist[syserr]);
138 1.1 mycroft else
139 1.1 mycroft fprintf(stderr, ": errno %d\n", syserr);
140 1.1 mycroft }
141 1.1 mycroft
142 1.1 mycroft if (severity <= LOG_ERR)
143 1.1 mycroft exit(-1);
144 1.1 mycroft }
145 1.1 mycroft
146 1.1 mycroft /*
147 1.1 mycroft * Send a neighbors-list request.
148 1.1 mycroft */
149 1.1 mycroft void
150 1.1 mycroft ask(dst)
151 1.1 mycroft u_int32_t dst;
152 1.1 mycroft {
153 1.1 mycroft send_igmp(our_addr, dst, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS,
154 1.1 mycroft htonl(MROUTED_LEVEL), 0);
155 1.1 mycroft }
156 1.1 mycroft
157 1.1 mycroft void
158 1.1 mycroft ask2(dst)
159 1.1 mycroft u_int32_t dst;
160 1.1 mycroft {
161 1.1 mycroft send_igmp(our_addr, dst, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS2,
162 1.1 mycroft htonl(MROUTED_LEVEL), 0);
163 1.1 mycroft }
164 1.1 mycroft
165 1.1 mycroft /*
166 1.1 mycroft * Process an incoming neighbor-list message.
167 1.1 mycroft */
168 1.1 mycroft void
169 1.1 mycroft accept_neighbors(src, dst, p, datalen)
170 1.1 mycroft u_int32_t src, dst;
171 1.1 mycroft u_char *p;
172 1.1 mycroft int datalen;
173 1.1 mycroft {
174 1.1 mycroft u_char *ep = p + datalen;
175 1.1 mycroft #define GET_ADDR(a) (a = ((u_int32_t)*p++ << 24), a += ((u_int32_t)*p++ << 16),\
176 1.1 mycroft a += ((u_int32_t)*p++ << 8), a += *p++)
177 1.1 mycroft
178 1.1 mycroft printf("%s (%s):\n", inet_fmt(src, s1), inet_name(src));
179 1.1 mycroft while (p < ep) {
180 1.1 mycroft register u_int32_t laddr;
181 1.1 mycroft register u_char metric;
182 1.1 mycroft register u_char thresh;
183 1.1 mycroft register int ncount;
184 1.1 mycroft
185 1.1 mycroft GET_ADDR(laddr);
186 1.1 mycroft laddr = htonl(laddr);
187 1.1 mycroft metric = *p++;
188 1.1 mycroft thresh = *p++;
189 1.1 mycroft ncount = *p++;
190 1.1 mycroft while (--ncount >= 0) {
191 1.1 mycroft register u_int32_t neighbor;
192 1.1 mycroft GET_ADDR(neighbor);
193 1.1 mycroft neighbor = htonl(neighbor);
194 1.1 mycroft printf(" %s -> ", inet_fmt(laddr, s1));
195 1.1 mycroft printf("%s (%s) [%d/%d]\n", inet_fmt(neighbor, s1),
196 1.1 mycroft inet_name(neighbor), metric, thresh);
197 1.1 mycroft }
198 1.1 mycroft }
199 1.1 mycroft }
200 1.1 mycroft
201 1.1 mycroft void
202 1.1 mycroft accept_neighbors2(src, dst, p, datalen)
203 1.1 mycroft u_int32_t src, dst;
204 1.1 mycroft u_char *p;
205 1.1 mycroft int datalen;
206 1.1 mycroft {
207 1.1 mycroft u_char *ep = p + datalen;
208 1.1 mycroft u_int broken_cisco = ((target_level & 0xffff) == 0x020a); /* 10.2 */
209 1.1 mycroft /* well, only possibly_broken_cisco, but that's too long to type. */
210 1.1 mycroft
211 1.1 mycroft printf("%s (%s) [version %d.%d]:\n", inet_fmt(src, s1), inet_name(src),
212 1.1 mycroft target_level & 0xff, (target_level >> 8) & 0xff);
213 1.1 mycroft
214 1.1 mycroft while (p < ep) {
215 1.1 mycroft register u_char metric;
216 1.1 mycroft register u_char thresh;
217 1.1 mycroft register u_char flags;
218 1.1 mycroft register int ncount;
219 1.1 mycroft register u_int32_t laddr = *(u_int32_t*)p;
220 1.1 mycroft
221 1.1 mycroft p += 4;
222 1.1 mycroft metric = *p++;
223 1.1 mycroft thresh = *p++;
224 1.1 mycroft flags = *p++;
225 1.1 mycroft ncount = *p++;
226 1.1 mycroft if (broken_cisco && ncount == 0) /* dumb Ciscos */
227 1.1 mycroft ncount = 1;
228 1.1 mycroft if (broken_cisco && ncount > 15) /* dumb Ciscos */
229 1.1 mycroft ncount = ncount & 0xf;
230 1.1 mycroft while (--ncount >= 0 && p < ep) {
231 1.1 mycroft register u_int32_t neighbor = *(u_int32_t*)p;
232 1.1 mycroft p += 4;
233 1.1 mycroft printf(" %s -> ", inet_fmt(laddr, s1));
234 1.1 mycroft printf("%s (%s) [%d/%d", inet_fmt(neighbor, s1),
235 1.1 mycroft inet_name(neighbor), metric, thresh);
236 1.1 mycroft if (flags & DVMRP_NF_TUNNEL)
237 1.1 mycroft printf("/tunnel");
238 1.1 mycroft if (flags & DVMRP_NF_SRCRT)
239 1.1 mycroft printf("/srcrt");
240 1.1 mycroft if (flags & DVMRP_NF_PIM)
241 1.1 mycroft printf("/pim");
242 1.1 mycroft if (flags & DVMRP_NF_QUERIER)
243 1.1 mycroft printf("/querier");
244 1.1 mycroft if (flags & DVMRP_NF_DISABLED)
245 1.1 mycroft printf("/disabled");
246 1.1 mycroft if (flags & DVMRP_NF_DOWN)
247 1.1 mycroft printf("/down");
248 1.1 mycroft if (flags & DVMRP_NF_LEAF)
249 1.1 mycroft printf("/leaf");
250 1.1 mycroft printf("]\n");
251 1.1 mycroft }
252 1.1 mycroft }
253 1.1 mycroft }
254 1.1 mycroft
255 1.1 mycroft int
256 1.1 mycroft get_number(var, deflt, pargv, pargc)
257 1.1 mycroft int *var, *pargc, deflt;
258 1.1 mycroft char ***pargv;
259 1.1 mycroft {
260 1.1 mycroft if ((*pargv)[0][2] == '\0') { /* Get the value from the next
261 1.1 mycroft * argument */
262 1.1 mycroft if (*pargc > 1 && isdigit((*pargv)[1][0])) {
263 1.1 mycroft (*pargv)++, (*pargc)--;
264 1.1 mycroft *var = atoi((*pargv)[0]);
265 1.1 mycroft return 1;
266 1.1 mycroft } else if (deflt >= 0) {
267 1.1 mycroft *var = deflt;
268 1.1 mycroft return 1;
269 1.1 mycroft } else
270 1.1 mycroft return 0;
271 1.1 mycroft } else { /* Get value from the rest of this argument */
272 1.1 mycroft if (isdigit((*pargv)[0][2])) {
273 1.1 mycroft *var = atoi((*pargv)[0] + 2);
274 1.1 mycroft return 1;
275 1.1 mycroft } else {
276 1.1 mycroft return 0;
277 1.1 mycroft }
278 1.1 mycroft }
279 1.1 mycroft }
280 1.1 mycroft
281 1.1 mycroft u_int32_t
282 1.1 mycroft host_addr(name)
283 1.1 mycroft char *name;
284 1.1 mycroft {
285 1.1 mycroft struct hostent *e;
286 1.1 mycroft u_int32_t addr;
287 1.1 mycroft
288 1.1 mycroft addr = inet_addr(name);
289 1.1 mycroft if ((int)addr == -1) {
290 1.1 mycroft e = gethostbyname(name);
291 1.1 mycroft if (e == NULL || e->h_length != sizeof(addr))
292 1.1 mycroft return (0);
293 1.1 mycroft memcpy(&addr, e->h_addr_list[0], e->h_length);
294 1.1 mycroft }
295 1.1 mycroft return(addr);
296 1.1 mycroft }
297 1.1 mycroft
298 1.1 mycroft void
299 1.1 mycroft usage()
300 1.1 mycroft {
301 1.1 mycroft fprintf(stderr,
302 1.1 mycroft "Usage: mrinfo [-n] [-t timeout] [-r retries] [router]\n");
303 1.1 mycroft exit(1);
304 1.1 mycroft }
305 1.1 mycroft
306 1.1 mycroft int
307 1.1 mycroft main(argc, argv)
308 1.1 mycroft int argc;
309 1.1 mycroft char *argv[];
310 1.1 mycroft {
311 1.1 mycroft setlinebuf(stderr);
312 1.1 mycroft
313 1.1 mycroft if (geteuid() != 0) {
314 1.1 mycroft fprintf(stderr, "mrinfo: must be root\n");
315 1.1 mycroft exit(1);
316 1.1 mycroft }
317 1.1 mycroft argv++, argc--;
318 1.1 mycroft while (argc > 0 && argv[0][0] == '-') {
319 1.1 mycroft switch (argv[0][1]) {
320 1.1 mycroft case 'd':
321 1.1 mycroft if (!get_number(&debug, DEFAULT_DEBUG, &argv, &argc))
322 1.1 mycroft usage();
323 1.1 mycroft break;
324 1.1 mycroft case 'n':
325 1.1 mycroft ++nflag;
326 1.1 mycroft break;
327 1.1 mycroft case 'r':
328 1.1 mycroft if (!get_number(&retries, -1, &argv, &argc))
329 1.1 mycroft usage();
330 1.1 mycroft break;
331 1.1 mycroft case 't':
332 1.1 mycroft if (!get_number(&timeout, -1, &argv, &argc))
333 1.1 mycroft usage();
334 1.1 mycroft break;
335 1.1 mycroft default:
336 1.1 mycroft usage();
337 1.1 mycroft }
338 1.1 mycroft argv++, argc--;
339 1.1 mycroft }
340 1.1 mycroft if (argc > 1)
341 1.1 mycroft usage();
342 1.1 mycroft if (argc == 1)
343 1.1 mycroft target_addr = host_addr(argv[0]);
344 1.1 mycroft else
345 1.1 mycroft target_addr = host_addr("127.0.0.1");
346 1.1 mycroft
347 1.1 mycroft if (target_addr == 0) {
348 1.1 mycroft fprintf(stderr, "mrinfo: %s: no such host\n", argv[0]);
349 1.1 mycroft exit(1);
350 1.1 mycroft }
351 1.1 mycroft if (debug)
352 1.1 mycroft fprintf(stderr, "Debug level %u\n", debug);
353 1.1 mycroft
354 1.1 mycroft init_igmp();
355 1.1 mycroft
356 1.1 mycroft { /* Find a good local address for us. */
357 1.1 mycroft int udp;
358 1.1 mycroft struct sockaddr_in addr;
359 1.1 mycroft int addrlen = sizeof(addr);
360 1.1 mycroft
361 1.1 mycroft addr.sin_family = AF_INET;
362 1.1 mycroft #if (defined(BSD) && (BSD >= 199103))
363 1.1 mycroft addr.sin_len = sizeof addr;
364 1.1 mycroft #endif
365 1.1 mycroft addr.sin_addr.s_addr = target_addr;
366 1.1 mycroft addr.sin_port = htons(2000); /* any port over 1024 will
367 1.1 mycroft * do... */
368 1.1 mycroft if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
369 1.1 mycroft || connect(udp, (struct sockaddr *) & addr, sizeof(addr)) < 0
370 1.1 mycroft || getsockname(udp, (struct sockaddr *) & addr, &addrlen) < 0) {
371 1.1 mycroft perror("Determining local address");
372 1.1 mycroft exit(-1);
373 1.1 mycroft }
374 1.1 mycroft close(udp);
375 1.1 mycroft our_addr = addr.sin_addr.s_addr;
376 1.1 mycroft }
377 1.1 mycroft
378 1.1 mycroft ask(target_addr);
379 1.1 mycroft
380 1.1 mycroft /* Main receive loop */
381 1.1 mycroft for (;;) {
382 1.1 mycroft fd_set fds;
383 1.1 mycroft struct timeval tv;
384 1.1 mycroft int count, recvlen, dummy = 0;
385 1.1 mycroft register u_int32_t src, dst, group;
386 1.1 mycroft struct ip *ip;
387 1.1 mycroft struct igmp *igmp;
388 1.1 mycroft int ipdatalen, iphdrlen, igmpdatalen;
389 1.1 mycroft
390 1.1 mycroft FD_ZERO(&fds);
391 1.1 mycroft FD_SET(igmp_socket, &fds);
392 1.1 mycroft
393 1.1 mycroft tv.tv_sec = timeout;
394 1.1 mycroft tv.tv_usec = 0;
395 1.1 mycroft
396 1.1 mycroft count = select(igmp_socket + 1, &fds, 0, 0, &tv);
397 1.1 mycroft
398 1.1 mycroft if (count < 0) {
399 1.1 mycroft if (errno != EINTR)
400 1.1 mycroft perror("select");
401 1.1 mycroft continue;
402 1.1 mycroft } else if (count == 0) {
403 1.1 mycroft log(LOG_DEBUG, 0, "Timed out receiving neighbor lists");
404 1.1 mycroft if (--retries < 0)
405 1.1 mycroft exit(1);
406 1.1 mycroft if (target_level == 0)
407 1.1 mycroft ask(target_addr);
408 1.1 mycroft else
409 1.1 mycroft ask2(target_addr);
410 1.1 mycroft continue;
411 1.1 mycroft }
412 1.1 mycroft recvlen = recvfrom(igmp_socket, recv_buf, RECV_BUF_SIZE,
413 1.1 mycroft 0, NULL, &dummy);
414 1.1 mycroft if (recvlen <= 0) {
415 1.1 mycroft if (recvlen && errno != EINTR)
416 1.1 mycroft perror("recvfrom");
417 1.1 mycroft continue;
418 1.1 mycroft }
419 1.1 mycroft
420 1.1 mycroft if (recvlen < sizeof(struct ip)) {
421 1.1 mycroft log(LOG_WARNING, 0,
422 1.1 mycroft "packet too short (%u bytes) for IP header",
423 1.1 mycroft recvlen);
424 1.1 mycroft continue;
425 1.1 mycroft }
426 1.1 mycroft ip = (struct ip *) recv_buf;
427 1.1 mycroft if (ip->ip_p == 0)
428 1.1 mycroft continue; /* Request to install cache entry */
429 1.1 mycroft src = ip->ip_src.s_addr;
430 1.1 mycroft dst = ip->ip_dst.s_addr;
431 1.1 mycroft iphdrlen = ip->ip_hl << 2;
432 1.1 mycroft ipdatalen = ip->ip_len;
433 1.1 mycroft if (iphdrlen + ipdatalen != recvlen) {
434 1.1 mycroft log(LOG_WARNING, 0,
435 1.1 mycroft "packet shorter (%u bytes) than hdr+data length (%u+%u)",
436 1.1 mycroft recvlen, iphdrlen, ipdatalen);
437 1.1 mycroft continue;
438 1.1 mycroft }
439 1.1 mycroft igmp = (struct igmp *) (recv_buf + iphdrlen);
440 1.1 mycroft group = igmp->igmp_group.s_addr;
441 1.1 mycroft igmpdatalen = ipdatalen - IGMP_MINLEN;
442 1.1 mycroft if (igmpdatalen < 0) {
443 1.1 mycroft log(LOG_WARNING, 0,
444 1.1 mycroft "IP data field too short (%u bytes) for IGMP, from %s",
445 1.1 mycroft ipdatalen, inet_fmt(src, s1));
446 1.1 mycroft continue;
447 1.1 mycroft }
448 1.1 mycroft if (igmp->igmp_type != IGMP_DVMRP)
449 1.1 mycroft continue;
450 1.1 mycroft
451 1.1 mycroft switch (igmp->igmp_code) {
452 1.1 mycroft case DVMRP_NEIGHBORS:
453 1.1 mycroft case DVMRP_NEIGHBORS2:
454 1.1 mycroft if (src != target_addr) {
455 1.1 mycroft fprintf(stderr, "mrinfo: got reply from %s",
456 1.1 mycroft inet_fmt(src, s1));
457 1.1 mycroft fprintf(stderr, " instead of %s\n",
458 1.1 mycroft inet_fmt(target_addr, s1));
459 1.1 mycroft /*continue;*/
460 1.1 mycroft }
461 1.1 mycroft break;
462 1.1 mycroft default:
463 1.1 mycroft continue; /* ignore all other DVMRP messages */
464 1.1 mycroft }
465 1.1 mycroft
466 1.1 mycroft switch (igmp->igmp_code) {
467 1.1 mycroft
468 1.1 mycroft case DVMRP_NEIGHBORS:
469 1.1 mycroft if (group) {
470 1.1 mycroft /* knows about DVMRP_NEIGHBORS2 msg */
471 1.1 mycroft if (target_level == 0) {
472 1.1 mycroft target_level = ntohl(group);
473 1.1 mycroft ask2(target_addr);
474 1.1 mycroft }
475 1.1 mycroft } else {
476 1.1 mycroft accept_neighbors(src, dst, (char *)(igmp + 1),
477 1.1 mycroft igmpdatalen);
478 1.1 mycroft exit(0);
479 1.1 mycroft }
480 1.1 mycroft break;
481 1.1 mycroft
482 1.1 mycroft case DVMRP_NEIGHBORS2:
483 1.1 mycroft accept_neighbors2(src, dst, (char *)(igmp + 1),
484 1.1 mycroft igmpdatalen);
485 1.1 mycroft exit(0);
486 1.1 mycroft }
487 1.1 mycroft }
488 1.1 mycroft }
489 1.1 mycroft
490 1.1 mycroft /* dummies */
491 1.1 mycroft void accept_probe()
492 1.1 mycroft {
493 1.1 mycroft }
494 1.1 mycroft void accept_group_report()
495 1.1 mycroft {
496 1.1 mycroft }
497 1.1 mycroft void accept_neighbor_request2()
498 1.1 mycroft {
499 1.1 mycroft }
500 1.1 mycroft void accept_report()
501 1.1 mycroft {
502 1.1 mycroft }
503 1.1 mycroft void accept_neighbor_request()
504 1.1 mycroft {
505 1.1 mycroft }
506 1.1 mycroft void accept_prune()
507 1.1 mycroft {
508 1.1 mycroft }
509 1.1 mycroft void accept_graft()
510 1.1 mycroft {
511 1.1 mycroft }
512 1.1 mycroft void accept_g_ack()
513 1.1 mycroft {
514 1.1 mycroft }
515 1.1 mycroft void add_table_entry()
516 1.1 mycroft {
517 1.1 mycroft }
518 1.1 mycroft void check_vif_state()
519 1.1 mycroft {
520 1.1 mycroft }
521 1.1 mycroft void accept_leave_message()
522 1.1 mycroft {
523 1.1 mycroft }
524 1.1 mycroft void accept_mtrace()
525 1.1 mycroft {
526 1.1 mycroft }
527 1.1 mycroft void accept_membership_query()
528 1.1 mycroft {
529 1.1 mycroft }
530