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