]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Impl.h
index 36f3ecb81978155b8fffbaf4217497853dbac477..8c2cd3dae172e6ba092c45bdcbc9583e755e0215 100644 (file)
@@ -5,15 +5,9 @@
   RFC 2132: DHCP Options and BOOTP Vendor Extensions\r
   RFC 1534: Interoperation Between DHCP and BOOTP\r
   RFC 3396: Encoding Long Options in DHCP.\r
-  \r
-Copyright (c) 2006 - 2009, 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
@@ -26,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Protocol/Dhcp4.h>\r
 #include <Protocol/Udp4.h>\r
-\r
+#include <IndustryStandard/Dhcp.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
@@ -43,18 +37,19 @@ typedef struct _DHCP_PROTOCOL DHCP_PROTOCOL;
 #define DHCP_SERVICE_SIGNATURE   SIGNATURE_32 ('D', 'H', 'C', 'P')\r
 #define DHCP_PROTOCOL_SIGNATURE  SIGNATURE_32 ('d', 'h', 'c', 'p')\r
 \r
-typedef enum {\r
-  //\r
-  // The state of the DHCP service. It starts as UNCONFIGED. If\r
-  // and active child configures the service successfully, it\r
-  // goes to CONFIGED. If the active child configures NULL, it\r
-  // goes back to UNCONFIGED. It becomes DESTORY if it is (partly)\r
-  // destoried.\r
-  //\r
-  DHCP_UNCONFIGED         = 0,\r
-  DHCP_CONFIGED,\r
-  DHCP_DESTORY\r
-} DHCP_STATE;\r
+#define DHCP_CHECK_MEDIA_WAITING_TIME    EFI_TIMER_PERIOD_SECONDS(20)\r
+\r
+//\r
+// The state of the DHCP service. It starts as UNCONFIGED. If\r
+// and active child configures the service successfully, it\r
+// goes to CONFIGED. If the active child configures NULL, it\r
+// goes back to UNCONFIGED. It becomes DESTROY if it is (partly)\r
+// destroyed.\r
+//\r
+#define DHCP_UNCONFIGED          0\r
+#define DHCP_CONFIGED            1\r
+#define DHCP_DESTROY             2\r
+\r
 \r
 struct _DHCP_PROTOCOL {\r
   UINT32                            Signature;\r
@@ -63,14 +58,15 @@ struct _DHCP_PROTOCOL {
   EFI_HANDLE                        Handle;\r
   DHCP_SERVICE                      *Service;\r
 \r
-  BOOLEAN                           InDestory;\r
+  BOOLEAN                           InDestroy;\r
 \r
   EFI_EVENT                         CompletionEvent;\r
   EFI_EVENT                         RenewRebindEvent;\r
 \r
   EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN  *Token;\r
-  UDP_IO_PORT                       *UdpIo; // The UDP IO used for TransmitReceive.\r
+  UDP_IO                            *UdpIo; // The UDP IO used for TransmitReceive.\r
   UINT32                            Timeout;\r
+  UINT16                            ElaspedTime;\r
   NET_BUF_QUEUE                     ResponseQueue;\r
 };\r
 \r
@@ -82,8 +78,7 @@ struct _DHCP_SERVICE {
   UINT32                        Signature;\r
   EFI_SERVICE_BINDING_PROTOCOL  ServiceBinding;\r
 \r
-  INTN                          ServiceState; // CONFIGED, UNCONFIGED, and DESTORY\r
-  BOOLEAN                       InDestory;\r
+  INTN                          ServiceState; // CONFIGED, UNCONFIGED, and DESTROY\r
 \r
   EFI_HANDLE                    Controller;\r
   EFI_HANDLE                    Image;\r
@@ -108,8 +103,8 @@ struct _DHCP_SERVICE {
   UINT32                        T2;\r
   INTN                          ExtraRefresh; // This refresh is reqested by user\r
 \r
-  UDP_IO_PORT                   *UdpIo;       // Udp child receiving all DHCP message\r
-  UDP_IO_PORT                   *LeaseIoPort; // Udp child with lease IP\r
+  UDP_IO                        *UdpIo;       // Udp child receiving all DHCP message\r
+  UDP_IO                        *LeaseIoPort; // Udp child with lease IP\r
   EFI_DHCP4_PACKET              *LastPacket;  // The last sent packet for retransmission\r
   EFI_MAC_ADDRESS               Mac;\r
   UINT8                         HwType;\r
@@ -161,7 +156,7 @@ DhcpYieldControl (
 \r
 /**\r
   Complete a Dhcp4 transaction and signal the upper layer.\r
-  \r
+\r
   @param Instance      Dhcp4 instance.\r
 \r
 **/\r
@@ -170,4 +165,42 @@ PxeDhcpDone (
   IN DHCP_PROTOCOL  *Instance\r
   );\r
 \r
+/**\r
+  Free the resource related to the configure parameters.\r
+  DHCP driver will make a copy of the user's configure\r
+  such as the time out value.\r
+\r
+  @param  Config                 The DHCP configure data\r
+\r
+**/\r
+VOID\r
+DhcpCleanConfigure (\r
+  IN OUT EFI_DHCP4_CONFIG_DATA  *Config\r
+  );\r
+\r
+/**\r
+  Callback of Dhcp packet. Does nothing.\r
+\r
+  @param Arg           The context.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+DhcpDummyExtFree (\r
+  IN VOID                   *Arg\r
+  );\r
+\r
+/**\r
+  Set the elapsed time based on the given instance and the pointer to the\r
+  elapsed time option.\r
+\r
+  @param[in]      Elapsed       The pointer to the position to append.\r
+  @param[in]      Instance      The pointer to the Dhcp4 instance.\r
+**/\r
+VOID\r
+SetElapsedTime (\r
+  IN     UINT16                 *Elapsed,\r
+  IN     DHCP_PROTOCOL          *Instance\r
+  );\r
+\r
 #endif\r