/** @file\r
-\r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+ EFI DHCP protocol implementation.\r
+ RFCs supported are:\r
+ RFC 2131: Dynamic Host Configuration Protocol\r
+ 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 - 2010, Intel Corporation. All rights reserved.<BR>\r
+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
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
\r
-Module Name:\r
-\r
- Dhcp4Impl.h\r
-\r
-Abstract:\r
-\r
- EFI DHCP protocol implementation\r
- RFCs supported are:\r
- RFC 2131: Dynamic Host Configuration Protocol\r
- 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
-\r
**/\r
\r
#ifndef __EFI_DHCP4_IMPL_H__\r
\r
\r
\r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
\r
#include <Protocol/Dhcp4.h>\r
#include <Protocol/Udp4.h>\r
#include "Dhcp4Option.h"\r
#include "Dhcp4Io.h"\r
\r
-enum {\r
- DHCP_SERVICE_SIGNATURE = EFI_SIGNATURE_32 ('D', 'H', 'C', 'P'),\r
- DHCP_PROTOCOL_SIGNATURE = EFI_SIGNATURE_32 ('d', 'h', 'c', 'p'),\r
+#define DHCP_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'H', 'C', 'P')\r
+#define DHCP_PROTOCOL_SIGNATURE SIGNATURE_32 ('d', 'h', 'c', 'p')\r
+\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
- // 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
-};\r
\r
struct _DHCP_PROTOCOL {\r
UINT32 Signature;\r
EFI_DHCP4_PROTOCOL Dhcp4Protocol;\r
- NET_LIST_ENTRY Link;\r
+ LIST_ENTRY Link;\r
EFI_HANDLE Handle;\r
DHCP_SERVICE *Service;\r
\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
NET_BUF_QUEUE ResponseQueue;\r
};\r
EFI_HANDLE Controller;\r
EFI_HANDLE Image;\r
\r
- NET_LIST_ENTRY Children;\r
+ LIST_ENTRY Children;\r
UINTN NumChildren;\r
\r
INTN DhcpState;\r
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
+ UINT8 ClientAddressSendOut[16];\r
\r
DHCP_PROTOCOL *ActiveChild;\r
EFI_DHCP4_CONFIG_DATA ActiveConfig;\r
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
-\r
- UINT32 WaitOffer; // Time to collect the offers\r
UINT32 LeaseLife;\r
};\r
\r
\r
extern EFI_DHCP4_PROTOCOL mDhcp4ProtocolTemplate;\r
\r
+/**\r
+ Give up the control of the DHCP service to let other child\r
+ resume. Don't change the service's DHCP state and the Client\r
+ address and option list configure as required by RFC2131.\r
+\r
+ @param DhcpSb The DHCP service instance.\r
+\r
+**/\r
VOID\r
DhcpYieldControl (\r
- IN DHCP_SERVICE *DhcpSb\r
+ IN DHCP_SERVICE *DhcpSb\r
);\r
\r
+/**\r
+ Complete a Dhcp4 transaction and signal the upper layer.\r
+\r
+ @param Instance Dhcp4 instance.\r
+\r
+**/\r
VOID\r
PxeDhcpDone (\r
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
#endif\r