]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/UefiPxeBcDxe/PxeBcBoot.h
Fix bugs in PXE driver when using option 43 for boot server list and boot menu prompt.
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcBoot.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 Boot functions declaration for UefiPxeBc Driver.\r
3\r
9063c328 4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
a3bcde70
HT
5\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef __EFI_PXEBC_BOOT_H__\r
17#define __EFI_PXEBC_BOOT_H__\r
18\r
19#define PXEBC_DISPLAY_MAX_LINE 70\r
20#define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8\r
21#define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4\r
22\r
23#define PXEBC_IS_SIZE_OVERFLOWED(x) ((sizeof (UINTN) < sizeof (UINT64)) && ((x) > 0xFFFFFFFF))\r
24\r
25\r
26/**\r
27 Extract the discover information and boot server entry from the\r
28 cached packets if unspecified.\r
29\r
30 @param[in] Private Pointer to PxeBc private data.\r
31 @param[in] Type The type of bootstrap to perform.\r
9063c328 32 @param[in, out] DiscoverInfo Pointer to EFI_PXE_BASE_CODE_DISCOVER_INFO.\r
a3bcde70
HT
33 @param[out] BootEntry Pointer to PXEBC_BOOT_SVR_ENTRY.\r
34 @param[out] SrvList Pointer to EFI_PXE_BASE_CODE_SRVLIST.\r
35\r
36 @retval EFI_SUCCESS Successfully extracted the information.\r
37 @retval EFI_DEVICE_ERROR Failed to extract the information.\r
38\r
39**/\r
40EFI_STATUS\r
41PxeBcExtractDiscoverInfo (\r
42 IN PXEBC_PRIVATE_DATA *Private,\r
43 IN UINT16 Type,\r
9063c328 44 IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO **DiscoverInfo,\r
a3bcde70
HT
45 OUT PXEBC_BOOT_SVR_ENTRY **BootEntry,\r
46 OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList\r
47 );\r
48\r
49\r
50/**\r
51 Build the discover packet and send out for boot.\r
52\r
53 @param[in] Private Pointer to PxeBc private data.\r
54 @param[in] Type PxeBc option boot item type.\r
55 @param[in] Layer Pointer to option boot item layer.\r
56 @param[in] UseBis Use BIS or not.\r
57 @param[in] DestIp Pointer to the server address.\r
58 @param[in] IpCount The total count of the server address.\r
59 @param[in] SrvList Pointer to the server address list.\r
60\r
61 @retval EFI_SUCCESS Successfully discovered boot file.\r
62 @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.\r
63 @retval EFI_NOT_FOUND Can't get the PXE reply packet.\r
64 @retval Others Failed to discover boot file.\r
65\r
66**/\r
67EFI_STATUS\r
68PxeBcDiscoverBootServer (\r
69 IN PXEBC_PRIVATE_DATA *Private,\r
70 IN UINT16 Type,\r
71 IN UINT16 *Layer,\r
72 IN BOOLEAN UseBis,\r
73 IN EFI_IP_ADDRESS *DestIp,\r
74 IN UINT16 IpCount,\r
75 IN EFI_PXE_BASE_CODE_SRVLIST *SrvList\r
76 );\r
77\r
78\r
79/**\r
80 Load boot file into user buffer.\r
81\r
82 @param[in] Private Pointer to PxeBc private data.\r
83 @param[in, out] BufferSize Size of user buffer for input;\r
84 required buffer size for output.\r
85 @param[in] Buffer Pointer to user buffer.\r
86\r
87 @retval EFI_SUCCESS Successfully obtained all the boot information.\r
88 @retval EFI_BUFFER_TOO_SMALL The buffer size is not enough for boot file.\r
89 @retval EFI_ABORTED User cancelled the current operation.\r
90 @retval Others Failed to parse out the boot information.\r
91\r
92**/\r
93EFI_STATUS\r
94PxeBcLoadBootFile (\r
95 IN PXEBC_PRIVATE_DATA *Private,\r
96 IN OUT UINTN *BufferSize,\r
97 IN VOID *Buffer OPTIONAL\r
98 );\r
99\r
100#endif\r