]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/Udp6Dxe/Udp6Impl.h
1. Fix a bug : netboot6 client hangs if DHCPv6 Advertisement received without netboot...
[mirror_edk2.git] / NetworkPkg / Udp6Dxe / Udp6Impl.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 Udp6 driver's whole implementation and internal data structures.\r
3\r
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
5\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _UDP6_IMPL_H_\r
17#define _UDP6_IMPL_H_\r
18\r
19#include <Uefi.h>\r
20\r
21#include <Protocol/Ip6.h>\r
22#include <Protocol/Udp6.h>\r
23\r
24#include <Library/IpIoLib.h>\r
25#include <Library/DebugLib.h>\r
26#include <Library/UefiRuntimeServicesTableLib.h>\r
27#include <Library/UefiBootServicesTableLib.h>\r
28#include <Library/BaseLib.h>\r
29#include <Library/UefiLib.h>\r
30#include <Library/BaseMemoryLib.h>\r
31#include <Library/MemoryAllocationLib.h>\r
32#include <Library/DpcLib.h>\r
33\r
34#include "Udp6Driver.h"\r
35\r
36extern EFI_COMPONENT_NAME2_PROTOCOL gUdp6ComponentName2;\r
37extern EFI_COMPONENT_NAME_PROTOCOL gUdp6ComponentName;\r
38extern EFI_SERVICE_BINDING_PROTOCOL mUdp6ServiceBinding;\r
39extern EFI_UDP6_PROTOCOL mUdp6Protocol;\r
40extern UINT16 mUdp6RandomPort;\r
41\r
42//\r
43// Define time out 50 milliseconds\r
44//\r
45#define UDP6_TIMEOUT_INTERVAL (50 * TICKS_PER_MS)\r
46#define UDP6_HEADER_SIZE sizeof (EFI_UDP_HEADER)\r
47#define UDP6_MAX_DATA_SIZE 65507\r
48#define UDP6_PORT_KNOWN 1024\r
49\r
50#define UDP6_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'p', '6')\r
51#define UDP6_INSTANCE_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'p', 'S')\r
52\r
53#define UDP6_SERVICE_DATA_FROM_THIS(a) \\r
54 CR ( \\r
55 (a), \\r
56 UDP6_SERVICE_DATA, \\r
57 ServiceBinding, \\r
58 UDP6_SERVICE_DATA_SIGNATURE \\r
59 )\r
60\r
61#define UDP6_INSTANCE_DATA_FROM_THIS(a) \\r
62 CR ( \\r
63 (a), \\r
64 UDP6_INSTANCE_DATA, \\r
65 Udp6Proto, \\r
66 UDP6_INSTANCE_DATA_SIGNATURE \\r
67 )\r
68//\r
69// Udp6 service contest data\r
70//\r
71typedef struct _UDP6_SERVICE_DATA {\r
72 UINT32 Signature;\r
73 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
74 EFI_HANDLE ImageHandle;\r
75 EFI_HANDLE ControllerHandle;\r
76 LIST_ENTRY ChildrenList;\r
77 UINTN ChildrenNumber;\r
78 IP_IO *IpIo;\r
79 EFI_EVENT TimeoutEvent;\r
80 CHAR16 *MacString;\r
81} UDP6_SERVICE_DATA;\r
82\r
83typedef struct _UDP6_INSTANCE_DATA {\r
84 UINT32 Signature;\r
85 LIST_ENTRY Link;\r
86 UDP6_SERVICE_DATA *Udp6Service;\r
87 EFI_UDP6_PROTOCOL Udp6Proto;\r
88 EFI_UDP6_CONFIG_DATA ConfigData;\r
89 EFI_HANDLE ChildHandle;\r
90 BOOLEAN Configured;\r
91 BOOLEAN IsNoMapping;\r
92 NET_MAP TxTokens;\r
93 NET_MAP RxTokens;\r
94 NET_MAP McastIps;\r
95 LIST_ENTRY RcvdDgramQue;\r
96 LIST_ENTRY DeliveredDgramQue;\r
97 UINT16 HeadSum;\r
98 EFI_STATUS IcmpError;\r
99 IP_IO_IP_INFO *IpInfo;\r
100 BOOLEAN Destroyed;\r
101} UDP6_INSTANCE_DATA;\r
102\r
103typedef struct _UDP6_RXDATA_WRAP {\r
104 LIST_ENTRY Link;\r
105 NET_BUF *Packet;\r
106 UINT32 TimeoutTick;\r
107 EFI_UDP6_RECEIVE_DATA RxData;\r
108} UDP6_RXDATA_WRAP;\r
109\r
110/**\r
111 Clean the Udp service context data.\r
112\r
113 @param[in, out] Udp6Service Pointer to the UDP6_SERVICE_DATA.\r
114\r
115**/\r
116VOID\r
117Udp6CleanService (\r
118 IN OUT UDP6_SERVICE_DATA *Udp6Service\r
119 );\r
120\r
121/**\r
122 Create the Udp service context data.\r
123\r
124 @param[in] Udp6Service Pointer to the UDP6_SERVICE_DATA.\r
125 @param[in] ImageHandle The image handle of this udp6 driver.\r
126 @param[in] ControllerHandle The controller handle this udp6 driver binds on.\r
127\r
128 @retval EFI_SUCCESS The udp6 service context data was created and\r
129 initialized.\r
130 @retval EFI_OUT_OF_RESOURCES Cannot allocate memory.\r
131 @retval Others An error condition occurred.\r
132\r
133**/\r
134EFI_STATUS\r
135Udp6CreateService (\r
136 IN UDP6_SERVICE_DATA *Udp6Service,\r
137 IN EFI_HANDLE ImageHandle,\r
138 IN EFI_HANDLE ControllerHandle\r
139 );\r
140\r
141/**\r
142 Set the Udp6 variable data.\r
143\r
144 @param[in] Udp6Service Udp6 service data.\r
145\r
146 @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the\r
147 variable.\r
148 @retval other Set variable failed.\r
149\r
150**/\r
151EFI_STATUS\r
152Udp6SetVariableData (\r
153 IN UDP6_SERVICE_DATA *Udp6Service\r
154 );\r
155\r
156/**\r
157 This function cleans the udp instance.\r
158\r
159 @param[in, out] Instance Pointer to the UDP6_INSTANCE_DATA to clean.\r
160\r
161**/\r
162VOID\r
163Udp6CleanInstance (\r
164 IN OUT UDP6_INSTANCE_DATA *Instance\r
165 );\r
166\r
167/**\r
168 Clear the variable and free the resource.\r
169\r
170 @param[in, out] Udp6Service Udp6 service data.\r
171\r
172**/\r
173VOID\r
174Udp6ClearVariableData (\r
175 IN OUT UDP6_SERVICE_DATA *Udp6Service\r
176 );\r
177\r
178/**\r
179 This function intializes the new created udp instance.\r
180\r
181 @param[in] Udp6Service Pointer to the UDP6_SERVICE_DATA.\r
182 @param[in, out] Instance Pointer to the un-initialized UDP6_INSTANCE_DATA.\r
183\r
184**/\r
185VOID\r
186Udp6InitInstance (\r
187 IN UDP6_SERVICE_DATA *Udp6Service,\r
188 IN OUT UDP6_INSTANCE_DATA *Instance\r
189 );\r
190\r
191/**\r
192 This function reports the received ICMP error.\r
193\r
194 @param[in] Instance Pointer to the udp instance context data.\r
195\r
196**/\r
197VOID\r
198Udp6ReportIcmpError (\r
199 IN UDP6_INSTANCE_DATA *Instance\r
200 );\r
201\r
202/**\r
203 This function copies the current operational settings of this EFI UDPv6 Protocol\r
204 instance into user-supplied buffers. This function is used optionally to retrieve\r
205 the operational mode data of underlying networks or drivers.\r
206\r
207 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.\r
208 @param[out] Udp6ConfigData The buffer in which the current UDP configuration\r
209 data is returned. This parameter is optional and\r
210 may be NULL.\r
211 @param[out] Ip6ModeData The buffer in which the current EFI IPv6 Protocol\r
212 mode data is returned. This parameter is optional\r
213 and may be NULL.\r
214 @param[out] MnpConfigData The buffer in which the current managed network\r
215 configuration data is returned. This parameter\r
216 is optional and may be NULL.\r
217 @param[out] SnpModeData The buffer in which the simple network mode data\r
218 is returned. This parameter is optional and may be NULL.\r
219\r
220 @retval EFI_SUCCESS The mode data was read.\r
221 @retval EFI_NOT_STARTED When Udp6ConfigData is queried, no configuration\r
222 data is available because this instance has not\r
223 been started.\r
224 @retval EFI_INVALID_PARAMETER This is NULL.\r
225\r
226**/\r
227EFI_STATUS\r
228EFIAPI\r
229Udp6GetModeData (\r
230 IN EFI_UDP6_PROTOCOL *This,\r
231 OUT EFI_UDP6_CONFIG_DATA *Udp6ConfigData OPTIONAL,\r
232 OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,\r
233 OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r
234 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r
235 );\r
236\r
237/**\r
238 This function is used to do the following:\r
239 Initialize and start this instance of the EFI UDPv6 Protocol.\r
240 Change the filtering rules and operational parameters.\r
241 Reset this instance of the EFI UDPv6 Protocol.\r
242\r
243 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.\r
244 @param[in] UdpConfigData Pointer to the buffer to set the configuration\r
245 data. This parameter is optional and may be NULL.\r
246\r
247 @retval EFI_SUCCESS The configuration settings were set, changed, or\r
248 reset successfully.\r
249 @retval EFI_NO_MAPPING When the UdpConifgData.UseAnyStationAddress is set\r
250 to true and there is no address available for IP6\r
251 driver to binding source address to this\r
252 instance.\r
253 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r
254 This is NULL.\r
255 UdpConfigData.StationAddress is not a valid\r
256 unicast IPv6 address.\r
257 UdpConfigData.RemoteAddress is not a valid unicast\r
258 IPv6 address, if it is not zero.\r
259 @retval EFI_ALREADY_STARTED The EFI UDPv6 Protocol instance is already\r
260 started/configured and must be stopped/reset\r
261 before it can be reconfigured. Only TrafficClass,\r
262 HopLimit, ReceiveTimeout, and TransmitTimeout can\r
263 be reconfigured without stopping the current\r
264 instance of the EFI UDPv6 Protocol.\r
265 @retval EFI_ACCESS_DENIED UdpConfigData.AllowDuplicatePort is FALSE, and\r
266 UdpConfigData.StationPort is already used by another\r
267 instance.\r
268 @retval EFI_OUT_OF_RESOURCES The EFI UDPv6 Protocol driver cannot allocate\r
269 memory for this EFI UDPv6 Protocol instance.\r
270 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred, and\r
271 this instance was not opened.\r
272\r
273**/\r
274EFI_STATUS\r
275EFIAPI\r
276Udp6Configure (\r
277 IN EFI_UDP6_PROTOCOL *This,\r
278 IN EFI_UDP6_CONFIG_DATA *UdpConfigData OPTIONAL\r
279 );\r
280\r
281/**\r
282 This function places a sending request to this instance of the EFI UDPv6 Protocol,\r
283 alongside the transmit data that was filled by the user.\r
284\r
285 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.\r
286 @param[in] Token Pointer to the completion token that will be\r
287 placed into the transmit queue.\r
288\r
289 @retval EFI_SUCCESS The data has been queued for transmission.\r
290 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been\r
291 started.\r
292 @retval EFI_NO_MAPPING The under-layer IPv6 driver was responsible for\r
293 choosing a source address for this instance, but\r
294 no source address was available for use.\r
295 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
296 This is NULL. Token is NULL. Token.Event is NULL.\r
297 Token.Packet.TxData is NULL.\r
298 Token.Packet.TxData.FragmentCount is zero.\r
299 Token.Packet.TxData.DataLength is not equal to the\r
300 sum of fragment lengths.\r
301 One or more of the\r
302 Token.Packet.TxData.FragmentTable[]\r
303 .FragmentLength fields is zero.\r
304 One or more of the\r
305 Token.Packet.TxData.FragmentTable[]\r
306 .FragmentBuffer fields is NULL.\r
307 One or more of the\r
308 Token.Packet.TxData.UdpSessionData.\r
309 DestinationAddres are not valid unicast IPv6\r
310 addresses, if the UdpSessionData is not NULL.\r
311 Token.Packet.TxData.UdpSessionData.\r
312 DestinationAddres is NULL\r
313 Token.Packet.TxData.UdpSessionData.\r
314 DestinatioPort is zero.\r
315 Token.Packet.TxData.UdpSessionData is\r
316 NULL and this instance's\r
317 UdpConfigData.RemoteAddress is unspecified.\r
318 @retval EFI_ACCESS_DENIED The transmit completion token with the same\r
319 Token.Event is already in the transmit queue.\r
320 @retval EFI_NOT_READY The completion token could not be queued because\r
321 the transmit queue is full.\r
322 @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.\r
323 @retval EFI_NOT_FOUND There is no route to the destination network or\r
324 address.\r
325 @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP\r
326 packet size. Or the length of the IP header + UDP\r
327 header + data length is greater than MTU if\r
328 DoNotFragment is TRUE.\r
329\r
330**/\r
331EFI_STATUS\r
332EFIAPI\r
333Udp6Transmit (\r
334 IN EFI_UDP6_PROTOCOL *This,\r
335 IN EFI_UDP6_COMPLETION_TOKEN *Token\r
336 );\r
337\r
338/**\r
339 This function places a completion token into the receive packet queue. This function\r
340 is always asynchronous.\r
341\r
342 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.\r
343 @param[in] Token Pointer to a token that is associated with the\r
344 receive data descriptor.\r
345\r
346 @retval EFI_SUCCESS The receive completion token is cached.\r
347 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been\r
348 started.\r
349 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP,\r
350 BOOTP, RARP, etc.) is not finished yet.\r
351 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
352 This is NULL.\r
353 Token is NULL.\r
354 Token.Event is NULL.\r
355 @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued\r
356 due to a lack of system resources (usually\r
357 memory).\r
358 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
359 The EFI UDPv6 Protocol instance has been reset to\r
360 startup defaults.\r
361 @retval EFI_ACCESS_DENIED A receive completion token with the same\r
362 Token.Event is already in the receive queue.\r
363 @retval EFI_NOT_READY The receive request could not be queued because\r
364 the receive queue is full.\r
365\r
366**/\r
367EFI_STATUS\r
368EFIAPI\r
369Udp6Receive (\r
370 IN EFI_UDP6_PROTOCOL *This,\r
371 IN EFI_UDP6_COMPLETION_TOKEN *Token\r
372 );\r
373\r
374/**\r
375 This function is used to abort a pending transmit or receive request.\r
376\r
377 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.\r
378 @param[in] Token Pointer to a token that has been issued by\r
379 EFI_UDP6_PROTOCOL.Transmit() or\r
380 EFI_UDP6_PROTOCOL.Receive(). This parameter is\r
381 optional and may be NULL.\r
382\r
383 @retval EFI_SUCCESS The asynchronous I/O request is aborted and\r
384 Token.Event is signaled. When Token is NULL, all\r
385 pending requests are aborted and their events are\r
386 signaled.\r
387 @retval EFI_INVALID_PARAMETER This is NULL.\r
388 @retval EFI_NOT_STARTED This instance has not been started.\r
389 @retval EFI_NO_MAPPING When using the default address, configuration\r
390 (DHCP, BOOTP, RARP, etc.) is not finished yet.\r
391 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O\r
392 request is not found in the transmit or receive\r
393 queue. It either completed or was not issued by\r
394 Transmit() or Receive().\r
395\r
396**/\r
397EFI_STATUS\r
398EFIAPI\r
399Udp6Cancel (\r
400 IN EFI_UDP6_PROTOCOL *This,\r
401 IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL\r
402 );\r
403\r
404/**\r
405 This function can be used by network drivers and applications to increase the rate that\r
406 data packets are moved between the communications device and the transmit/receive queues.\r
407\r
408 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.\r
409\r
410 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
411 @retval EFI_INVALID_PARAMETER This is NULL.\r
412 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
413 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or\r
414 receive queue.\r
415\r
416**/\r
417EFI_STATUS\r
418EFIAPI\r
419Udp6Poll (\r
420 IN EFI_UDP6_PROTOCOL *This\r
421 );\r
422\r
423/**\r
424 This function is used to enable and disable the multicast group filtering.\r
425\r
426 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.\r
427 @param[in] JoinFlag Set to TRUE to join a multicast group. Set to\r
428 FALSE to leave one or all multicast groups.\r
429 @param[in] MulticastAddress Pointer to multicast group address to join or\r
430 leave. This parameter is optional and may be NULL.\r
431\r
432 @retval EFI_SUCCESS The operation completed successfully.\r
433 @retval EFI_NOT_STARTED The EFI UDPv6 Protocol instance has not been\r
434 started.\r
435 @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.\r
436 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
437 This is NULL. JoinFlag is TRUE and\r
438 MulticastAddress is NULL. JoinFlag is TRUE and\r
439 *MulticastAddress is not a valid multicast\r
440 address.\r
441 @retval EFI_ALREADY_STARTED The group address is already in the group table\r
442 (when JoinFlag is TRUE).\r
443 @retval EFI_NOT_FOUND The group address is not in the group table (when\r
444 JoinFlag is FALSE).\r
445 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
446\r
447**/\r
448EFI_STATUS\r
449EFIAPI\r
450Udp6Groups (\r
451 IN EFI_UDP6_PROTOCOL *This,\r
452 IN BOOLEAN JoinFlag,\r
453 IN EFI_IPv6_ADDRESS *MulticastAddress OPTIONAL\r
454 );\r
455\r
456/**\r
457 This function tries to bind the udp instance according to the configured port\r
458 allocation stragety.\r
459\r
460 @param[in] InstanceList Pointer to the head of the list linking the udp\r
461 instances.\r
462 @param[in] ConfigData Pointer to the ConfigData of the instance to be\r
463 bound.\r
464\r
465 @retval EFI_SUCCESS The bound operation completed successfully.\r
466 @retval EFI_ACCESS_DENIED The <Address, Port> specified by the ConfigData is\r
467 already used by another instance.\r
468 @retval EFI_OUT_OF_RESOURCES No available port resources.\r
469\r
470**/\r
471EFI_STATUS\r
472Udp6Bind (\r
473 IN LIST_ENTRY *InstanceList,\r
474 IN EFI_UDP6_CONFIG_DATA *ConfigData\r
475 );\r
476\r
477/**\r
478 This function builds the Ip6 configdata from the Udp6ConfigData.\r
479\r
480 @param[in] Udp6ConfigData Pointer to the EFI_UDP6_CONFIG_DATA.\r
481 @param[in, out] Ip6ConfigData Pointer to the EFI_IP6_CONFIG_DATA.\r
482\r
483**/\r
484VOID\r
485Udp6BuildIp6ConfigData (\r
486 IN EFI_UDP6_CONFIG_DATA *Udp6ConfigData,\r
487 IN OUT EFI_IP6_CONFIG_DATA *Ip6ConfigData\r
488 );\r
489\r
490/**\r
491 This function checks whether the specified Token duplicates with the one in the Map.\r
492\r
493 @param[in] Map Pointer to the NET_MAP.\r
494 @param[in] Item Pointer to the NET_MAP_ITEM contain the pointer to\r
495 the Token.\r
496 @param[in] Context Pointer to the Token to be checked.\r
497\r
498 @retval EFI_SUCCESS The Token specified by Context differs from the\r
499 one in the Item.\r
500 @retval EFI_ACCESS_DENIED The Token duplicates with the one in the Item.\r
501\r
502**/\r
503EFI_STATUS\r
504EFIAPI\r
505Udp6TokenExist (\r
506 IN NET_MAP *Map,\r
507 IN NET_MAP_ITEM *Item,\r
508 IN VOID *Context\r
509 );\r
510\r
511/**\r
512 This function removes the specified Token from the TokenMap.\r
513\r
514 @param[in] TokenMap Pointer to the NET_MAP containing the tokens.\r
515 @param[in] Token Pointer to the Token to be removed.\r
516\r
517 @retval EFI_SUCCESS The specified Token is removed from the TokenMap.\r
518 @retval EFI_NOT_FOUND The specified Token is not found in the TokenMap.\r
519\r
520**/\r
521EFI_STATUS\r
522Udp6RemoveToken (\r
523 IN NET_MAP *TokenMap,\r
524 IN EFI_UDP6_COMPLETION_TOKEN *Token\r
525 );\r
526\r
527/**\r
528 This function is used to check whether the NewConfigData has any un-reconfigurable\r
529 parameters changed compared to the OldConfigData.\r
530\r
531 @param[in] OldConfigData Pointer to the current ConfigData the udp instance\r
532 uses.\r
533 @param[in] NewConfigData Pointer to the new ConfigData.\r
534\r
535 @retval TRUE The instance is reconfigurable according to NewConfigData.\r
536 @retval FALSE The instance is not reconfigurable according to NewConfigData.\r
537\r
538**/\r
539BOOLEAN\r
540Udp6IsReconfigurable (\r
541 IN EFI_UDP6_CONFIG_DATA *OldConfigData,\r
542 IN EFI_UDP6_CONFIG_DATA *NewConfigData\r
543 );\r
544\r
545/**\r
546 This function removes the multicast group specified by Arg from the Map.\r
547\r
548 @param[in] Map Pointer to the NET_MAP.\r
549 @param[in] Item Pointer to the NET_MAP_ITEM.\r
550 @param[in] Arg Pointer to the Arg. It is the pointer to a\r
551 multicast IPv6 Address. This parameter is\r
552 optional and may be NULL.\r
553\r
554 @retval EFI_SUCCESS The multicast address is removed.\r
555 @retval EFI_ABORTED The specified multicast address is removed, and the\r
556 Arg is not NULL.\r
557\r
558**/\r
559EFI_STATUS\r
560EFIAPI\r
561Udp6LeaveGroup (\r
562 IN NET_MAP *Map,\r
563 IN NET_MAP_ITEM *Item,\r
564 IN VOID *Arg OPTIONAL\r
565 );\r
566\r
567/**\r
568 This function validates the TxToken, it returns the error code according to the spec.\r
569\r
570 @param[in] Instance Pointer to the udp instance context data.\r
571 @param[in] TxToken Pointer to the token to be checked.\r
572\r
573 @retval EFI_SUCCESS The TxToken is valid.\r
574 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
575 Token.Event is NULL.\r
576 Token.Packet.TxData is NULL.\r
577 Token.Packet.TxData.FragmentCount is zero.\r
578 Token.Packet.TxData.DataLength is not equal to the\r
579 sum of fragment lengths.\r
580 One or more of the\r
581 Token.Packet.TxData.FragmentTable[].FragmentLength\r
582 fields is zero.\r
583 One or more of the\r
584 Token.Packet.TxData.FragmentTable[].FragmentBuffer\r
585 fields is NULL.\r
586 UdpSessionData.DestinationAddress are not valid\r
587 unicast IPv6 addresses if the UdpSessionData is\r
588 not NULL.\r
589 UdpSessionData.DestinationPort and\r
590 ConfigData.RemotePort are all zero if the\r
591 UdpSessionData is not NULL.\r
592 @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP\r
593 packet size.\r
594\r
595**/\r
596EFI_STATUS\r
597Udp6ValidateTxToken (\r
598 IN UDP6_INSTANCE_DATA *Instance,\r
599 IN EFI_UDP6_COMPLETION_TOKEN *TxToken\r
600 );\r
601\r
602/**\r
603 This function is a dummy ext-free function for the NET_BUF created for the output\r
604 udp datagram.\r
605\r
606 @param[in] Context Pointer to the context data.\r
607\r
608**/\r
609VOID\r
610EFIAPI\r
611Udp6NetVectorExtFree (\r
612 IN VOID *Context\r
613 );\r
614\r
615/**\r
616 This function calculates the checksum for the Packet, utilizing the pre-calculated\r
617 pseudo header to reduce overhead.\r
618\r
619 @param[in] Packet Pointer to the NET_BUF contains the udp datagram.\r
620 @param[in] HeadSum Checksum of the pseudo header execpt the length\r
621 field.\r
622\r
623 @return The 16-bit checksum of this udp datagram.\r
624\r
625**/\r
626UINT16\r
627Udp6Checksum (\r
628 IN NET_BUF *Packet,\r
629 IN UINT16 HeadSum\r
630 );\r
631\r
632/**\r
633 This function delivers the received datagrams to the specified instance.\r
634\r
635 @param[in] Instance Pointer to the instance context data.\r
636\r
637**/\r
638VOID\r
639Udp6InstanceDeliverDgram (\r
640 IN UDP6_INSTANCE_DATA *Instance\r
641 );\r
642\r
643/**\r
644 Cancel Udp6 tokens from the Udp6 instance.\r
645\r
646 @param[in] Instance Pointer to the udp instance context data.\r
647 @param[in] Token Pointer to the token to be canceled. If NULL, all\r
648 tokens in this instance will be cancelled.\r
649 This parameter is optional and may be NULL.\r
650\r
651 @retval EFI_SUCCESS The Token is cancelled.\r
652 @retval EFI_NOT_FOUND The Token is not found.\r
653\r
654**/\r
655EFI_STATUS\r
656Udp6InstanceCancelToken (\r
657 IN UDP6_INSTANCE_DATA *Instance,\r
658 IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL\r
659 );\r
660\r
661/**\r
662 This function removes all the Wrap datas in the RcvdDgramQue.\r
663\r
664 @param[in] Instance Pointer to the Udp6 Instance.\r
665\r
666**/\r
667VOID\r
668Udp6FlushRcvdDgram (\r
669 IN UDP6_INSTANCE_DATA *Instance\r
670 );\r
671\r
672#endif\r
673\r