/** @file\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation\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
operation parameter.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4GetModeData (\r
}\r
\r
Instance = DHCP_INSTANCE_FROM_THIS (This);\r
- \r
+\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
DhcpSb = Instance->Service;\r
\r
@retval EFI_SUCCESS The child is configured.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4Configure (\r
@retval EFI_SUCCESS The DHCP process is started.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4Start (\r
@retval EFI_SUCCESS The DHCP is renewed/rebound.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4RenewRebind (\r
@retval EFI_SUCCESS The lease is released.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4Release (\r
@retval EFI_SUCCESS The DHCP process is stopped.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4Stop (\r
@retval EFI_SUCCESS The packet is build.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4Build (\r
);\r
}\r
\r
-STATIC\r
EFI_STATUS\r
Dhcp4InstanceConfigUdpIo (\r
IN UDP_IO_PORT *UdpIo,\r
return UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfigData);\r
}\r
\r
-STATIC\r
EFI_STATUS\r
Dhcp4InstanceCreateUdpIo (\r
IN DHCP_PROTOCOL *Instance\r
}\r
}\r
\r
-STATIC\r
VOID\r
DhcpDummyExtFree (\r
IN VOID *Arg\r
None\r
\r
--*/\r
-{ \r
+{\r
}\r
\r
VOID\r
}\r
\r
ASSERT (UdpPacket != NULL);\r
- \r
+\r
//\r
// Validate the packet received\r
//\r
if (UdpPacket->TotalSize < sizeof (EFI_DHCP4_HEADER)) {\r
goto RESTART;\r
}\r
- \r
+\r
//\r
// Copy the DHCP message to a continuous memory block, make the buffer size\r
// of the EFI_DHCP4_PACKET a multiple of 4-byte.\r
if (Packet->Length != UdpPacket->TotalSize) {\r
goto RESTART;\r
}\r
- \r
+\r
//\r
// Is this packet the answer to our packet?\r
//\r
if ((Head->OpCode != BOOTP_REPLY) ||\r
(Head->Xid != Token->Packet->Dhcp4.Header.Xid) ||\r
- !NET_MAC_EQUAL (&DhcpSb->Mac, Head->ClientHwAddr, DhcpSb->HwLen)) {\r
+ (CompareMem (DhcpSb->ClientAddressSendOut, Head->ClientHwAddr, Head->HwAddrLen) != 0)) {\r
goto RESTART;\r
}\r
- \r
+\r
//\r
// Validate the options and retrieve the interested options\r
//\r
\r
if (Token->CompletionEvent != NULL) {\r
gBS->SignalEvent (Token->CompletionEvent);\r
- } \r
+ }\r
}\r
\r
\r
/**\r
- Transmit and receive a packet through this DHCP service.\r
- This is unsupported.\r
+ Transmits a DHCP formatted packet and optionally waits for responses.\r
\r
- @param This The DHCP protocol instance\r
- @param Token The transmit and receive instance\r
+ @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+ @param Token Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r
\r
- @retval EFI_UNSUPPORTED It always returns unsupported.\r
+ @retval EFI_SUCCESS The packet was successfully queued for transmission.\r
+ @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+ @retval EFI_NOT_READY The previous call to this function has not finished yet. Try to call\r
+ this function after collection process completes.\r
+ @retval EFI_NO_MAPPING The default station address is not available yet.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
+ @retval Others Some other unexpected error occurred.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4TransmitReceive (\r
goto ON_ERROR;\r
}\r
\r
+ //\r
+ // Save the Client Address is sent out\r
+ //\r
+ CopyMem (&DhcpSb->ClientAddressSendOut[0], &Token->Packet->Dhcp4.Header.ClientHwAddr[0], Token->Packet->Dhcp4.Header.HwAddrLen);\r
+\r
//\r
// Wrap the DHCP packet into a net buffer.\r
//\r
@retval EFI_SUCCESS It always returns EFI_SUCCESS\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
Dhcp4ParseCheckOption (\r
IN UINT8 Tag,\r
@retval EFI_SUCCESS The options are parsed.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EfiDhcp4Parse (\r