X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=NetworkPkg%2FUefiPxeBcDxe%2FPxeBcDhcp4.h;h=742fdde5e772c5990a537a952cbba5fc1a2786c6;hb=a4c35479b79457f8419f0e83c4d60122269ffc64;hp=8e4e101806b4e8875b3e9082b2a9de164f4f4b6c;hpb=cd9944d72a2b51004efecdcf024a173721f1b3d1;p=mirror_edk2.git diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h index 8e4e101806..742fdde5e7 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h @@ -1,7 +1,7 @@ /** @file Functions declaration related with DHCPv4 for UefiPxeBc Driver. - Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, 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 @@ -18,7 +18,7 @@ #define PXEBC_DHCP4_OPTION_MAX_NUM 16 #define PXEBC_DHCP4_OPTION_MAX_SIZE 312 -#define PXEBC_DHCP4_PACKET_MAX_SIZE 1472 +#define PXEBC_DHCP4_PACKET_MAX_SIZE (sizeof (EFI_PXE_BASE_CODE_PACKET)) #define PXEBC_DHCP4_S_PORT 67 #define PXEBC_DHCP4_C_PORT 68 #define PXEBC_BS_DOWNLOAD_PORT 69 @@ -28,46 +28,6 @@ #define PXEBC_DHCP4_MSG_TYPE_REQUEST 3 #define PXEBC_DHCP4_MAGIC 0x63538263 // network byte order -// -// Dhcp Options -// -#define PXEBC_DHCP4_TAG_PAD 0 // Pad Option -#define PXEBC_DHCP4_TAG_EOP 255 // End Option -#define PXEBC_DHCP4_TAG_NETMASK 1 // Subnet Mask -#define PXEBC_DHCP4_TAG_TIME_OFFSET 2 // Time Offset from UTC -#define PXEBC_DHCP4_TAG_ROUTER 3 // Router option, -#define PXEBC_DHCP4_TAG_TIME_SERVER 4 // Time Server -#define PXEBC_DHCP4_TAG_NAME_SERVER 5 // Name Server -#define PXEBC_DHCP4_TAG_DNS_SERVER 6 // Domain Name Server -#define PXEBC_DHCP4_TAG_HOSTNAME 12 // Host Name -#define PXEBC_DHCP4_TAG_BOOTFILE_LEN 13 // Boot File Size -#define PXEBC_DHCP4_TAG_DUMP 14 // Merit Dump File -#define PXEBC_DHCP4_TAG_DOMAINNAME 15 // Domain Name -#define PXEBC_DHCP4_TAG_ROOTPATH 17 // Root path -#define PXEBC_DHCP4_TAG_EXTEND_PATH 18 // Extensions Path -#define PXEBC_DHCP4_TAG_EMTU 22 // Maximum Datagram Reassembly Size -#define PXEBC_DHCP4_TAG_TTL 23 // Default IP Time-to-live -#define PXEBC_DHCP4_TAG_BROADCAST 28 // Broadcast Address -#define PXEBC_DHCP4_TAG_NIS_DOMAIN 40 // Network Information Service Domain -#define PXEBC_DHCP4_TAG_NIS_SERVER 41 // Network Information Servers -#define PXEBC_DHCP4_TAG_NTP_SERVER 42 // Network Time Protocol Servers -#define PXEBC_DHCP4_TAG_VENDOR 43 // Vendor Specific Information -#define PXEBC_DHCP4_TAG_REQUEST_IP 50 // Requested IP Address -#define PXEBC_DHCP4_TAG_LEASE 51 // IP Address Lease Time -#define PXEBC_DHCP4_TAG_OVERLOAD 52 // Option Overload -#define PXEBC_DHCP4_TAG_MSG_TYPE 53 // DHCP Message Type -#define PXEBC_DHCP4_TAG_SERVER_ID 54 // Server Identifier -#define PXEBC_DHCP4_TAG_PARA_LIST 55 // Parameter Request List -#define PXEBC_DHCP4_TAG_MAXMSG 57 // Maximum DHCP Message Size -#define PXEBC_DHCP4_TAG_T1 58 // Renewal (T1) Time Value -#define PXEBC_DHCP4_TAG_T2 59 // Rebinding (T2) Time Value -#define PXEBC_DHCP4_TAG_CLASS_ID 60 // Vendor class identifier -#define PXEBC_DHCP4_TAG_CLIENT_ID 61 // Client-identifier -#define PXEBC_DHCP4_TAG_TFTP 66 // TFTP server name -#define PXEBC_DHCP4_TAG_BOOTFILE 67 // Bootfile name -#define PXEBC_PXE_DHCP4_TAG_ARCH 93 -#define PXEBC_PXE_DHCP4_TAG_UNDI 94 -#define PXEBC_PXE_DHCP4_TAG_UUID 97 // // Sub-Options in Dhcp Vendor Option // @@ -148,7 +108,7 @@ typedef enum { #define IS_VALID_BOOT_SERVERS(x) \ ((((x)[0]) & BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS)) \ - == BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS)) + == BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS)) #define IS_VALID_BOOT_PROMPT(x) \ ((((x)[0]) & BIT (PXEBC_VENDOR_TAG_MENU_PROMPT)) \ @@ -303,10 +263,12 @@ typedef struct { UINT8 CredTypeLen; } PXEBC_VENDOR_OPTION; +#define PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP4_PACKET, Dhcp4) + PXEBC_DHCP4_PACKET_MAX_SIZE) + typedef union { EFI_DHCP4_PACKET Offer; EFI_DHCP4_PACKET Ack; - UINT8 Buffer[PXEBC_DHCP4_PACKET_MAX_SIZE]; + UINT8 Buffer[PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE]; } PXEBC_DHCP4_PACKET; typedef struct { @@ -374,6 +336,20 @@ PxeBcDhcp4Discover ( IN EFI_PXE_BASE_CODE_SRVLIST *SrvList ); +/** + Switch the Ip4 policy to static. + + @param[in] Private The pointer to PXEBC_PRIVATE_DATA. + + @retval EFI_SUCCESS The policy is already configured to static. + @retval Others Other error as indicated.. + +**/ +EFI_STATUS +PxeBcSetIp4Policy ( + IN PXEBC_PRIVATE_DATA *Private + ); + /** Start the D.O.R.A DHCPv4 process to acquire the IPv4 address and other PXE boot information.