X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FUdp4Dxe%2FUdp4Impl.h;h=a5dd1ecabe5fb45b9042865c5d28e16df0097cfd;hp=986768344cf23e6c60ccd9205ffa855591b8abdd;hb=c0fd7f734e2d33e22215899b40a47b843129541d;hpb=3e8c18da0441069591e5aa218f378001b29512dd diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h index 986768344c..a5dd1ecabe 100644 --- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h +++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h @@ -1,21 +1,15 @@ /** @file EFI UDPv4 protocol implementation. - -Copyright (c) 2006 - 2007, Intel Corporation.
-All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef _UDP4_IMPL_H_ #define _UDP4_IMPL_H_ -#include +#include #include #include @@ -30,21 +24,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include +#include #include "Udp4Driver.h" extern EFI_COMPONENT_NAME_PROTOCOL gUdp4ComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gUdp4ComponentName2; +extern EFI_UNICODE_STRING_TABLE *gUdpControllerNameTable; extern EFI_SERVICE_BINDING_PROTOCOL mUdp4ServiceBinding; extern EFI_UDP4_PROTOCOL mUdp4Protocol; extern UINT16 mUdp4RandomPort; #define ICMP_ERROR_PACKET_LENGTH 8 -#define UDP4_TIMEOUT_INTERVAL (10 * TICKS_PER_MS) // 10 milliseconds +#define UDP4_TIMEOUT_INTERVAL (50 * TICKS_PER_MS) // 50 milliseconds -#define UDP4_HEADER_SIZE sizeof (EFI_UDP4_HEADER) +#define UDP4_HEADER_SIZE sizeof (EFI_UDP_HEADER) #define UDP4_MAX_DATA_SIZE 65507 #define UDP4_PORT_KNOWN 1024 @@ -69,8 +66,6 @@ typedef struct _UDP4_SERVICE_DATA_ { IP_IO *IpIo; EFI_EVENT TimeoutEvent; - - CHAR16 *MacString; } UDP4_SERVICE_DATA; #define UDP4_INSTANCE_DATA_SIGNATURE SIGNATURE_32('U', 'd', 'p', 'I') @@ -108,7 +103,7 @@ typedef struct _UDP4_INSTANCE_DATA_ { IP_IO_IP_INFO *IpInfo; - BOOLEAN Destroyed; + BOOLEAN InDestroy; } UDP4_INSTANCE_DATA; typedef struct _UDP4_RXDATA_WRAP_ { @@ -118,6 +113,12 @@ typedef struct _UDP4_RXDATA_WRAP_ { EFI_UDP4_RECEIVE_DATA RxData; } UDP4_RXDATA_WRAP; +typedef struct { + EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding; + UINTN NumberOfChildren; + EFI_HANDLE *ChildHandleBuffer; +} UDP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT; + /** Reads the current operational settings. @@ -126,11 +127,11 @@ typedef struct _UDP4_RXDATA_WRAP_ { optionally to retrieve the operational mode data of underlying networks or drivers. - @param This Pointer to the EFI_UDP4_PROTOCOL instance. - @param Udp4ConfigData Pointer to the buffer to receive the current configuration data. - @param Ip4ModeData Pointer to the EFI IPv4 Protocol mode data structure. - @param MnpConfigData Pointer to the managed network configuration data structure. - @param SnpModeData Pointer to the simple network mode data structure. + @param[in] This Pointer to the EFI_UDP4_PROTOCOL instance. + @param[out] Udp4ConfigData Pointer to the buffer to receive the current configuration data. + @param[out] Ip4ModeData Pointer to the EFI IPv4 Protocol mode data structure. + @param[out] MnpConfigData Pointer to the managed network configuration data structure. + @param[out] SnpModeData Pointer to the simple network mode data structure. @retval EFI_SUCCESS The mode data was read. @retval EFI_NOT_STARTED When Udp4ConfigData is queried, no configuration data is @@ -151,7 +152,7 @@ Udp4GetModeData ( /** Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv4 Protocol. - + The Configure() function is used to do the following: * Initialize and start this instance of the EFI UDPv4 Protocol. * Change the filtering rules and operational parameters. @@ -178,7 +179,7 @@ Udp4GetModeData ( @retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this EFI UDPv4 Protocol instance. @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance - was not opened. + was not opened. **/ EFI_STATUS @@ -190,7 +191,7 @@ Udp4Configure ( /** Joins and leaves multicast groups. - + The Groups() function is used to enable and disable the multicast group filtering. If the JoinFlag is FALSE and the MulticastAddress is NULL, then all currently joined groups are left. @@ -227,7 +228,7 @@ Udp4Groups ( /** Adds and deletes routing table entries. - + The Routes() function adds a route to or deletes a route from the routing table. Routes are determined by comparing the SubnetAddress with the destination IP address and arithmetically AND-ing it with the SubnetMask. The gateway address @@ -275,7 +276,7 @@ Udp4Routes ( /** Queues outgoing data packets into the transmit queue. - + The Transmit() function places a sending request to this instance of the EFI UDPv4 Protocol, alongside the transmit data that was filled by the user. Whenever the packet in the token is sent out or some errors occur, the Token.Event will @@ -312,7 +313,7 @@ Udp4Transmit ( /** Places an asynchronous receive request into the receiving queue. - + The Receive() function places a completion token into the receive packet queue. This function is always asynchronous. The caller must fill in the Token.Event field in the completion token, and this @@ -348,7 +349,7 @@ Udp4Receive ( /** Aborts an asynchronous transmit or receive request. - + The Cancel() function is used to abort a pending transmit or receive request. If the token is in the transmit or receive request queues, after calling this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be @@ -383,7 +384,7 @@ Udp4Cancel ( /** Polls for incoming data packets and processes outgoing data packets. - + The Poll() function can be used by network drivers and applications to increase the rate that data packets are moved between the communications device and the transmit and receive queues. @@ -410,14 +411,14 @@ Udp4Poll ( /** Create the Udp service context data. - @param Udp4Service Pointer to the UDP4_SERVICE_DATA. - @param ImageHandle The image handle of this udp4 driver. - @param ControllerHandle The controller handle this udp4 driver binds on. + @param[in, out] Udp4Service Pointer to the UDP4_SERVICE_DATA. + @param[in] ImageHandle The image handle of this udp4 driver. + @param[in] ControllerHandle The controller handle this udp4 driver binds on. - @retval EFI_SUCCESS The udp4 service context data is created and - initialized. - @retval EFI_OUT_OF_RESOURCES Cannot allocate memory. - @retval other Other error occurs. + @retval EFI_SUCCESS The udp4 service context data is created and + initialized. + @retval EFI_OUT_OF_RESOURCES Cannot allocate memory. + @retval other Other error occurs. **/ EFI_STATUS @@ -441,8 +442,8 @@ Udp4CleanService ( /** This function intializes the new created udp instance. - @param Udp4Service Pointer to the UDP4_SERVICE_DATA. - @param Instance Pointer to the un-initialized UDP4_INSTANCE_DATA. + @param[in] Udp4Service Pointer to the UDP4_SERVICE_DATA. + @param[in, out] Instance Pointer to the un-initialized UDP4_INSTANCE_DATA. **/ VOID @@ -466,9 +467,9 @@ Udp4CleanInstance ( This function tries to bind the udp instance according to the configured port allocation strategy. - @param InstanceList Pointer to the head of the list linking the udp + @param[in] InstanceList Pointer to the head of the list linking the udp instances. - @param ConfigData Pointer to the ConfigData of the instance to be + @param[in, out] ConfigData Pointer to the ConfigData of the instance to be bound. ConfigData->StationPort will be assigned with an available port value on success. @@ -561,6 +562,7 @@ Udp4ValidateTxToken ( **/ EFI_STATUS +EFIAPI Udp4TokenExist ( IN NET_MAP *Map, IN NET_MAP_ITEM *Item, @@ -587,8 +589,8 @@ Udp4Checksum ( /** This function removes the specified Token from the TokenMap. - @param TokenMap Pointer to the NET_MAP containing the tokens. - @param Token Pointer to the Token to be removed. + @param[in, out] TokenMap Pointer to the NET_MAP containing the tokens. + @param[in] Token Pointer to the Token to be removed. @retval EFI_SUCCESS The specified Token is removed from the TokenMap. @retval EFI_NOT_FOUND The specified Token is not found in the TokenMap. @@ -603,9 +605,9 @@ Udp4RemoveToken ( /** This function removes the multicast group specified by Arg from the Map. - @param Map Pointer to the NET_MAP. - @param Item Pointer to the NET_MAP_ITEM. - @param Arg Pointer to the Arg, it's the pointer to a + @param[in, out] Map Pointer to the NET_MAP. + @param[in] Item Pointer to the NET_MAP_ITEM. + @param[in] Arg Pointer to the Arg, it's the pointer to a multicast IPv4 Address. @retval EFI_SUCCESS The multicast address is removed. @@ -614,6 +616,7 @@ Udp4RemoveToken ( **/ EFI_STATUS +EFIAPI Udp4LeaveGroup ( IN OUT NET_MAP *Map, IN NET_MAP_ITEM *Item, @@ -678,36 +681,9 @@ Udp4ReportIcmpError ( **/ VOID +EFIAPI Udp4NetVectorExtFree ( VOID *Context ); -/** - Set the Udp4 variable data. - - @param Udp4Service Udp4 service data. - - @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the - variable. - @retval EFI_SUCCESS Set variable successfully. - @retval other Set variable failed. - -**/ -EFI_STATUS -Udp4SetVariableData ( - IN UDP4_SERVICE_DATA *Udp4Service - ); - -/** - Clear the variable and free the resource. - - @param[[in] Udp4Service Udp4 service data. - -**/ -VOID -Udp4ClearVariableData ( - IN UDP4_SERVICE_DATA *Udp4Service - ); - #endif -