3 Copyright (c) 2005 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 #ifndef __EFI_IP4_IGMP_H__
23 #define __EFI_IP4_IGMP_H__
35 /// The status of multicast group. It isn't necessary to maintain
36 /// explicit state of host state diagram. A group with non-zero
37 /// DelayTime is in "delaying member" state. otherwise, it is in
38 /// "idle member" state.
50 /// The IGMP status. Each IP4 service instance has a IGMP_SERVICE_DATA
51 /// attached. The Igmpv1QuerySeen remember whether the server on this
52 /// connected network is v1 or v2.
63 IGMP_MEMBERSHIP_QUERY
= 0x11,
64 IGMP_V1_MEMBERSHIP_REPORT
= 0x12,
65 IGMP_V2_MEMBERSHIP_REPORT
= 0x16,
66 IGMP_LEAVE_GROUP
= 0x17,
68 IGMP_V1ROUTER_PRESENT
= 400,
69 IGMP_UNSOLICIATED_REPORT
= 10
73 Init the IGMP control data of the IP4 service instance, configure
74 MNP to receive ALL SYSTEM multicast.
76 @param IpSb The IP4 service whose IGMP is to be initialized.
78 @retval EFI_SUCCESS IGMP of the IpSb is successfully initialized.
79 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to initialize IGMP.
80 @retval Others Failed to initialize the IGMP of IpSb.
85 IN OUT IP4_SERVICE
*IpSb
89 Join the multicast group on behalf of this IP4 child
91 @param IpInstance The IP4 child that wants to join the group
92 @param Address The group to join
94 @retval EFI_SUCCESS Successfully join the multicast group
95 @retval EFI_OUT_OF_RESOURCES Failed to allocate resources
96 @retval Others Failed to join the multicast group.
101 IN IP4_PROTOCOL
*IpInstance
,
106 Leave the IP4 multicast group on behalf of IpInstance.
108 @param IpInstance The IP4 child that wants to leave the group
110 @param Address The group address to leave
112 @retval EFI_NOT_FOUND The IP4 service instance isn't in the group
113 @retval EFI_SUCCESS Successfully leave the multicast group.
114 @retval Others Failed to leave the multicast group.
119 IN IP4_PROTOCOL
*IpInstance
,
124 Handle the received IGMP message for the IP4 service instance.
126 @param IpSb The IP4 service instance that received the message
127 @param Head The IP4 header of the received message
128 @param Packet The IGMP message, without IP4 header
130 @retval EFI_INVALID_PARAMETER The IGMP message is malformated.
131 @retval EFI_SUCCESS The IGMP message is successfully processed.
136 IN IP4_SERVICE
*IpSb
,
142 The periodical timer function for IGMP. It does the following
144 1. Decrease the Igmpv1QuerySeen to make it possible to refresh
145 the IGMP server type.
146 2. Decrease the report timer for each IGMP group in "delaying
149 @param IpSb The IP4 service instance that is ticking
160 Add a group address to the array of group addresses.
161 The caller should make sure that no duplicated address
162 existed in the array. Although the function doesn't
163 assume the byte order of the both Source and Addr, the
164 network byte order is used by the caller.
166 @param Source The array of group addresses to add to
167 @param Count The number of group addresses in the Source
168 @param Addr The IP4 multicast address to add
170 @return NULL if failed to allocate memory for the new groups,
171 otherwise the new combined group addresses.
182 Remove a group address from the array of group addresses.
183 Although the function doesn't assume the byte order of the
184 both Groups and Addr, the network byte order is used by
187 @param Groups The array of group addresses to remove from
188 @param Count The number of group addresses in the Groups
189 @param Addr The IP4 multicast address to remove
191 @return The nubmer of group addresses in the Groups after remove.
192 It is Count if the Addr isn't in the Groups.
197 IN OUT IP4_ADDR
*Groups
,
203 Find the IGMP_GROUP structure which contains the status of multicast
204 group Address in this IGMP control block
206 @param IgmpCtrl The IGMP control block to search from
207 @param Address The multicast address to search
209 @return NULL if the multicast address isn't in the IGMP control block. Otherwise
210 the point to the IGMP_GROUP which contains the status of multicast group
216 IN IGMP_SERVICE_DATA
*IgmpCtrl
,