Commit | Line | Data |
---|---|---|
cf040064 KS |
1 | /* |
2 | * Copyright (c) 1988 Stephen Deering. | |
3 | * Copyright (c) 1992 Regents of the University of California. | |
4 | * All rights reserved. | |
5 | * | |
6 | * This code is derived from software contributed to Berkeley by | |
7 | * Stephen Deering of Stanford University. | |
8 | * | |
9 | * %sccs.include.redist.c% | |
10 | * | |
11 | * @(#)igmp_var.h 7.1 (Berkeley) %G% | |
12 | */ | |
13 | ||
14 | /* | |
15 | * Internet Group Management Protocol (IGMP), | |
16 | * implementation-specific definitions. | |
17 | * | |
18 | * Written by Steve Deering, Stanford, May 1988. | |
19 | * | |
20 | * MULTICAST 1.1 | |
21 | */ | |
22 | ||
23 | struct igmpstat { | |
24 | u_int igps_rcv_total; /* total IGMP messages received */ | |
25 | u_int igps_rcv_tooshort; /* received with too few bytes */ | |
26 | u_int igps_rcv_badsum; /* received with bad checksum */ | |
27 | u_int igps_rcv_queries; /* received membership queries */ | |
28 | u_int igps_rcv_badqueries; /* received invalid queries */ | |
29 | u_int igps_rcv_reports; /* received membership reports */ | |
30 | u_int igps_rcv_badreports; /* received invalid reports */ | |
31 | u_int igps_rcv_ourreports; /* received reports for our groups */ | |
32 | u_int igps_snd_reports; /* sent membership reports */ | |
33 | }; | |
34 | ||
35 | #ifdef KERNEL | |
36 | struct igmpstat igmpstat; | |
37 | ||
38 | /* | |
39 | * Macro to compute a random timer value between 1 and (IGMP_MAX_REPORTING_ | |
40 | * DELAY * countdown frequency). We generate a "random" number by adding | |
41 | * the total number of IP packets received, our primary IP address, and the | |
42 | * multicast address being timed-out. The 4.3 random() routine really | |
43 | * ought to be available in the kernel! | |
44 | */ | |
45 | #define IGMP_RANDOM_DELAY(multiaddr) \ | |
46 | /* struct in_addr multiaddr; */ \ | |
47 | ( (ipstat.ips_total + \ | |
48 | ntohl(IA_SIN(in_ifaddr)->sin_addr.s_addr) + \ | |
49 | ntohl((multiaddr).s_addr) \ | |
50 | ) \ | |
51 | % (IGMP_MAX_HOST_REPORT_DELAY * PR_FASTHZ) + 1 \ | |
52 | ) | |
53 | ||
54 | void igmp_init __P(()); | |
55 | void igmp_input __P((struct mbuf *, struct ifnet *)); | |
56 | void igmp_joingroup __P((struct in_multi *)); | |
57 | void igmp_leavegroup __P((struct in_multi *)); | |
58 | void igmp_fasttimo __P(()); | |
59 | #endif | |
60 |