/*++\r
\r
-Copyright (c) 2006, 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
-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, 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
+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
\r
Module Name:\r
pxe_bc_dhcp.c\r
- \r
+\r
Abstract:\r
DHCP and PXE discovery protocol implementations.\r
\r
--*/\r
\r
\r
-#include "bc.h"\r
+#include "Bc.h"\r
\r
STATIC EFI_PXE_BASE_CODE_UDP_PORT DhcpServerPort = DHCP_SERVER_PORT;\r
STATIC EFI_PXE_BASE_CODE_UDP_PORT DHCPClientPort = DHCP_CLIENT_PORT;\r
UINT8 *BytePtr;\r
} UNION_PTR;\r
\r
-//\r
-// 1 for Itanium-based, 0 for IA32\r
-//\r
-#define IA64SZ ((sizeof (UINTN) / sizeof (UINT32)) - 1)\r
-\r
-#define SYS_ARCH (SYS_ARCH_EFI32 - (SYS_ARCH_EFI32 - IA64) * IA64SZ)\r
-\r
#pragma pack(1)\r
//\r
// option structure for DHCPREQUEST at end of DISCOVER options\r
CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMajor, "yyy", sizeof ("yyy"));\r
CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMinor, "xxx", sizeof ("xxx"));\r
DHCPOpStart.End[0] = OP_END;\r
-};\r
+}\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
\r
#pragma pack()\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
CHAR8 *\r
PxeBcLibGetSmbiosString (\r
IN SMBIOS_STRUCTURE_POINTER *Smbios,\r
\r
Arguments:\r
Smbios - Pointer to SMBIOS structure\r
- StringNumber - String number to return. 0 is used to skip all strings and \r
+ StringNumber - String number to return. 0 is used to skip all strings and\r
point to the next SMBIOS structure.\r
\r
Returns:\r
}\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
VOID\r
Parse (\r
DHCP_RECEIVE_BUFFER *RxBufPtr,\r
}\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
BOOLEAN\r
AckEdit (\r
DHCP_RECEIVE_BUFFER *DhcpRxBuf\r
//\r
// if a discover type packet, make sure all required fields are present\r
//\r
+STATIC\r
BOOLEAN\r
DHCPOfferAckEdit (\r
DHCP_RECEIVE_BUFFER *DhcpRxBuf\r
}\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
BOOLEAN\r
DHCPAckEdit (\r
DHCP_RECEIVE_BUFFER *RxBufPtr\r
//\r
// get an offer/ack\r
//\r
+STATIC\r
EFI_STATUS\r
GetOfferAck (\r
PXE_BASECODE_DEVICE *Private,\r
Private := Pointer to PxeBc interface\r
ExtraEdit := Pointer to extra option checking function\r
OpFlags := UdpRead() option flags\r
- ServerIpPtr := \r
- ServerPortPtr := \r
- ClientIpPtr := \r
- ClientPortPtr := \r
- DhcpRxBuf := \r
+ ServerIpPtr :=\r
+ ServerPortPtr :=\r
+ ClientIpPtr :=\r
+ ClientPortPtr :=\r
+ DhcpRxBuf :=\r
TimeoutEvent :=\r
\r
Returns:\r
//\r
// get DHCPOFFER's\r
//\r
+STATIC\r
EFI_STATUS\r
GetOffers (\r
PXE_BASECODE_DEVICE *Private\r
// now look for DHCP onlys and a Proxy\r
//\r
for (Index = 0; Index < NumOffers; ++Index) {\r
- INT8 Index2;\r
+ UINT8 Index2;\r
\r
//\r
// ignore proxies, bootps, non DHCP onlys, and bootable DHCPS\r
//\r
// determine if the server ip is in the ip list\r
//\r
+STATIC\r
BOOLEAN\r
InServerList (\r
EFI_IP_ADDRESS *ServerIpPtr,\r
}\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
BOOLEAN\r
ExtractBootServerList (\r
UINT16 Type,\r
}\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
VOID\r
FreeMem (\r
PXE_BASECODE_DEVICE *Private\r
}\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
BOOLEAN\r
GetMem (\r
PXE_BASECODE_DEVICE *Private\r
\r
Parameters:\r
This := Pointer to PxeBc interface\r
- SortOffers := \r
+ SortOffers :=\r
\r
Returns:\r
--*/\r
}\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
EFI_STATUS\r
DoDiscover (\r
PXE_BASECODE_DEVICE *Private,\r
PXE_SERVER_LISTS *ServerListPtr\r
)\r
/*++\r
-Routine description: \r
+Routine description:\r
This function tries to complete the PXE Bootserver and/or boot image\r
discovery sequence. When this command completes successfully, the\r
PXEdiscover and PXEreply fields in the BC instance data structure are\r
updated. If the Info pointer is set to NULL, the discovery information\r
- in the DHCPack and ProxyOffer packets must be valid and will be used. \r
+ in the DHCPack and ProxyOffer packets must be valid and will be used.\r
If Info is not set to NULL, the discovery methods in the Info field\r
must be set and will be used. When discovering any layer number other\r
than zero (the credential flag does not count), only unicast discovery\r
\r
Parameters:\r
Private := Pointer to PxeBc interface\r
- OpFlags := \r
- Type := \r
- LayerPtr := \r
- UseBis := \r
- DestPtr := \r
- ServerListPtr := \r
+ OpFlags :=\r
+ Type :=\r
+ LayerPtr :=\r
+ UseBis :=\r
+ DestPtr :=\r
+ ServerListPtr :=\r
\r
Returns:\r
--*/\r
\r
Parameters:\r
Private := Pointer to PxeBc interface\r
- Type := \r
- LayerPtr := \r
- UseBis := \r
- DiscoverInfoPtr := \r
- McastServerListPtr := \r
- ServerListPtr := \r
+ Type :=\r
+ LayerPtr :=\r
+ UseBis :=\r
+ DiscoverInfoPtr :=\r
+ McastServerListPtr :=\r
+ ServerListPtr :=\r
\r
Returns:\r
--*/\r
Routine description:\r
\r
Parameters:\r
- This := \r
- Type := \r
- LayerPtr := \r
- UseBis := \r
- DiscoverInfoPtr := \r
+ This :=\r
+ Type :=\r
+ LayerPtr :=\r
+ UseBis :=\r
+ DiscoverInfoPtr :=\r
\r
Returns:\r
--*/\r
{\r
EFI_PXE_BASE_CODE_MODE *PxebcMode;\r
EFI_STATUS Status;\r
- EFI_STATUS StatCode;\r
PXE_BASECODE_DEVICE *Private;\r
\r
//\r
// Lock the instance data and make sure started\r
//\r
- StatCode = EFI_SUCCESS;\r
\r
if (This == NULL) {\r
DEBUG ((EFI_D_ERROR, "BC *This pointer == NULL"));\r