]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
[Change summary]:
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Impl.h
index 9ed6118cc6f2da9a6b10d6ac42860b6416875b3e..ed066ea8334706b6e0e1618291300e6937347d85 100644 (file)
@@ -6,7 +6,7 @@
   RFC 1534: Interoperation Between DHCP and BOOTP\r
   RFC 3396: Encoding Long Options in DHCP.\r
   \r
-Copyright (c) 2006 - 2008, Intel Corporation.<BR>\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
@@ -22,7 +22,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 \r
 \r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
 \r
 #include <Protocol/Dhcp4.h>\r
 #include <Protocol/Udp4.h>\r
@@ -43,18 +43,18 @@ 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
+\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
+#define DHCP_UNCONFIGED          0\r
+#define DHCP_CONFIGED            1\r
+#define DHCP_DESTORY             2\r
+\r
 \r
 struct _DHCP_PROTOCOL {\r
   UINT32                            Signature;\r
@@ -69,7 +69,7 @@ struct _DHCP_PROTOCOL {
   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
   NET_BUF_QUEUE                     ResponseQueue;\r
 };\r
@@ -108,9 +108,9 @@ 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
-  NET_BUF                       *LastPacket;  // The last sent packet for retransmission\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
   UINT8                         HwLen;\r
@@ -126,6 +126,7 @@ struct _DHCP_SERVICE {
   EFI_EVENT                     Timer;\r
 \r
   UINT32                        PacketToLive; // Retransmission timer for our packets\r
+  UINT32                        LastTimeout;  // Record the init value of PacketToLive every time\r
   INTN                          CurRetry;\r
   INTN                          MaxRetries;\r
   UINT32                        LeaseLife;\r