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