X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkModulePkg%2FUniversal%2FNetwork%2FPxeBc%2FDxe%2Fpxe_bc_dhcp.c;h=101c030bc84ba468afd4d0cd7d5cf91942d75589;hp=79bce9d4d8a76eacb2f532c8af00b939940c28be;hb=3aaddf9276ccf00b4b6349dfce058e3ae287dd3a;hpb=0cc82df1ebcd09622a38bb03a40aff49bf5363a7 diff --git a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c index 79bce9d4d8..101c030bc8 100644 --- a/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c +++ b/EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c @@ -1,17 +1,17 @@ /*++ -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: pxe_bc_dhcp.c - + Abstract: DHCP and PXE discovery protocol implementations. @@ -43,13 +43,6 @@ typedef union { UINT8 *BytePtr; } UNION_PTR; -// -// 1 for Itanium-based, 0 for IA32 -// -#define IA64SZ ((sizeof (UINTN) / sizeof (UINT32)) - 1) - -#define SYS_ARCH (SYS_ARCH_EFI32 - (SYS_ARCH_EFI32 - IA64) * IA64SZ) - #pragma pack(1) // // option structure for DHCPREQUEST at end of DISCOVER options @@ -218,7 +211,7 @@ OptionsStrucInit ( CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMajor, "yyy", sizeof ("yyy")); CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMinor, "xxx", sizeof ("xxx")); DHCPOpStart.End[0] = OP_END; -}; +} /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ @@ -406,6 +399,7 @@ STATIC UINT8 OurDhcpOptions[MAX_OUR_OPT] = { #pragma pack() /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +STATIC CHAR8 * PxeBcLibGetSmbiosString ( IN SMBIOS_STRUCTURE_POINTER *Smbios, @@ -417,7 +411,7 @@ Routine description: Arguments: Smbios - Pointer to SMBIOS structure - StringNumber - String number to return. 0 is used to skip all strings and + StringNumber - String number to return. 0 is used to skip all strings and point to the next SMBIOS structure. Returns: @@ -862,6 +856,7 @@ DecodeOptions ( } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +STATIC VOID Parse ( DHCP_RECEIVE_BUFFER *RxBufPtr, @@ -965,6 +960,7 @@ CopyParse ( } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +STATIC BOOLEAN AckEdit ( DHCP_RECEIVE_BUFFER *DhcpRxBuf @@ -991,6 +987,7 @@ AckEdit ( // // if a discover type packet, make sure all required fields are present // +STATIC BOOLEAN DHCPOfferAckEdit ( DHCP_RECEIVE_BUFFER *DhcpRxBuf @@ -1133,6 +1130,7 @@ DHCPOfferAckEdit ( } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +STATIC BOOLEAN DHCPAckEdit ( DHCP_RECEIVE_BUFFER *RxBufPtr @@ -1146,6 +1144,7 @@ DHCPAckEdit ( // // get an offer/ack // +STATIC EFI_STATUS GetOfferAck ( PXE_BASECODE_DEVICE *Private, @@ -1166,11 +1165,11 @@ Parameters: Private := Pointer to PxeBc interface ExtraEdit := Pointer to extra option checking function OpFlags := UdpRead() option flags - ServerIpPtr := - ServerPortPtr := - ClientIpPtr := - ClientPortPtr := - DhcpRxBuf := + ServerIpPtr := + ServerPortPtr := + ClientIpPtr := + ClientPortPtr := + DhcpRxBuf := TimeoutEvent := Returns: @@ -1256,6 +1255,7 @@ Returns: // // get DHCPOFFER's // +STATIC EFI_STATUS GetOffers ( PXE_BASECODE_DEVICE *Private @@ -2153,6 +2153,7 @@ DoDhcpDora ( // // determine if the server ip is in the ip list // +STATIC BOOLEAN InServerList ( EFI_IP_ADDRESS *ServerIpPtr, @@ -2179,6 +2180,7 @@ InServerList ( } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +STATIC BOOLEAN ExtractBootServerList ( UINT16 Type, @@ -2216,6 +2218,7 @@ ExtractBootServerList ( } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +STATIC VOID FreeMem ( PXE_BASECODE_DEVICE *Private @@ -2233,6 +2236,7 @@ FreeMem ( } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +STATIC BOOLEAN GetMem ( PXE_BASECODE_DEVICE *Private @@ -2305,7 +2309,7 @@ Routine description: Parameters: This := Pointer to PxeBc interface - SortOffers := + SortOffers := Returns: --*/ @@ -2450,6 +2454,7 @@ VerifyCredentialOption ( } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +STATIC EFI_STATUS DoDiscover ( PXE_BASECODE_DEVICE *Private, @@ -2461,12 +2466,12 @@ DoDiscover ( PXE_SERVER_LISTS *ServerListPtr ) /*++ -Routine description: +Routine description: This function tries to complete the PXE Bootserver and/or boot image discovery sequence. When this command completes successfully, the PXEdiscover and PXEreply fields in the BC instance data structure are updated. If the Info pointer is set to NULL, the discovery information - in the DHCPack and ProxyOffer packets must be valid and will be used. + in the DHCPack and ProxyOffer packets must be valid and will be used. If Info is not set to NULL, the discovery methods in the Info field must be set and will be used. When discovering any layer number other than zero (the credential flag does not count), only unicast discovery @@ -2474,12 +2479,12 @@ Routine description: Parameters: Private := Pointer to PxeBc interface - OpFlags := - Type := - LayerPtr := - UseBis := - DestPtr := - ServerListPtr := + OpFlags := + Type := + LayerPtr := + UseBis := + DestPtr := + ServerListPtr := Returns: --*/ @@ -2766,12 +2771,12 @@ Routine Description: Parameters: Private := Pointer to PxeBc interface - Type := - LayerPtr := - UseBis := - DiscoverInfoPtr := - McastServerListPtr := - ServerListPtr := + Type := + LayerPtr := + UseBis := + DiscoverInfoPtr := + McastServerListPtr := + ServerListPtr := Returns: --*/ @@ -2902,11 +2907,11 @@ BcDiscover ( Routine description: Parameters: - This := - Type := - LayerPtr := - UseBis := - DiscoverInfoPtr := + This := + Type := + LayerPtr := + UseBis := + DiscoverInfoPtr := Returns: --*/ @@ -3217,13 +3222,11 @@ Returns: { EFI_PXE_BASE_CODE_MODE *PxebcMode; EFI_STATUS Status; - EFI_STATUS StatCode; PXE_BASECODE_DEVICE *Private; // // Lock the instance data and make sure started // - StatCode = EFI_SUCCESS; if (This == NULL) { DEBUG ((EFI_D_ERROR, "BC *This pointer == NULL"));