]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
9095d37b | 2 | EFI PXE Base Code Protocol definitions, which is used to access PXE-compatible\r |
4ca9b6c4 | 3 | devices for network access and network booting.\r |
d1f95000 | 4 | \r |
9095d37b | 5 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
d3abb40d | 6 | Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r |
f0a704f9 | 7 | Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>\r |
d3abb40d | 8 | \r |
9344f092 | 9 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
9095d37b LG |
10 | \r |
11 | @par Revision Reference:\r | |
12 | This Protocol is introduced in EFI Specification 1.10.\r | |
d1f95000 | 13 | \r |
d1f95000 | 14 | **/\r |
2f88bd3a | 15 | \r |
d1f95000 | 16 | #ifndef __PXE_BASE_CODE_PROTOCOL_H__\r |
17 | #define __PXE_BASE_CODE_PROTOCOL_H__\r | |
18 | \r | |
99e8ed21 | 19 | ///\r |
af2dc6a7 | 20 | /// PXE Base Code protocol.\r |
99e8ed21 | 21 | ///\r |
d1f95000 | 22 | #define EFI_PXE_BASE_CODE_PROTOCOL_GUID \\r |
23 | { \\r | |
24 | 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r | |
25 | }\r | |
26 | \r | |
2f88bd3a | 27 | typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE_PROTOCOL;\r |
a6508c05 | 28 | \r |
99e8ed21 | 29 | ///\r |
30 | /// Protocol defined in EFI1.1.\r | |
9095d37b | 31 | ///\r |
2f88bd3a | 32 | typedef EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;\r |
d1f95000 | 33 | \r |
99e8ed21 | 34 | ///\r |
35 | /// Default IP TTL and ToS.\r | |
36 | ///\r | |
2f88bd3a MK |
37 | #define DEFAULT_TTL 16\r |
38 | #define DEFAULT_ToS 0\r | |
d1f95000 | 39 | \r |
99e8ed21 | 40 | ///\r |
af2dc6a7 | 41 | /// ICMP error format.\r |
99e8ed21 | 42 | ///\r |
d1f95000 | 43 | typedef struct {\r |
2f88bd3a MK |
44 | UINT8 Type;\r |
45 | UINT8 Code;\r | |
46 | UINT16 Checksum;\r | |
d1f95000 | 47 | union {\r |
2f88bd3a MK |
48 | UINT32 reserved;\r |
49 | UINT32 Mtu;\r | |
50 | UINT32 Pointer;\r | |
d1f95000 | 51 | struct {\r |
2f88bd3a MK |
52 | UINT16 Identifier;\r |
53 | UINT16 Sequence;\r | |
d1f95000 | 54 | } Echo;\r |
55 | } u;\r | |
2f88bd3a | 56 | UINT8 Data[494];\r |
d1f95000 | 57 | } EFI_PXE_BASE_CODE_ICMP_ERROR;\r |
58 | \r | |
99e8ed21 | 59 | ///\r |
af2dc6a7 | 60 | /// TFTP error format.\r |
99e8ed21 | 61 | ///\r |
d1f95000 | 62 | typedef struct {\r |
2f88bd3a MK |
63 | UINT8 ErrorCode;\r |
64 | CHAR8 ErrorString[127];\r | |
d1f95000 | 65 | } EFI_PXE_BASE_CODE_TFTP_ERROR;\r |
66 | \r | |
99e8ed21 | 67 | ///\r |
af2dc6a7 | 68 | /// IP Receive Filter definitions.\r |
99e8ed21 | 69 | ///\r |
2f88bd3a | 70 | #define EFI_PXE_BASE_CODE_MAX_IPCNT 8\r |
d1f95000 | 71 | \r |
9319d2c2 | 72 | ///\r |
af2dc6a7 | 73 | /// IP Receive Filter structure.\r |
9319d2c2 | 74 | ///\r |
d1f95000 | 75 | typedef struct {\r |
2f88bd3a MK |
76 | UINT8 Filters;\r |
77 | UINT8 IpCnt;\r | |
78 | UINT16 reserved;\r | |
79 | EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];\r | |
d1f95000 | 80 | } EFI_PXE_BASE_CODE_IP_FILTER;\r |
81 | \r | |
2f88bd3a MK |
82 | #define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001\r |
83 | #define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002\r | |
84 | #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004\r | |
85 | #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008\r | |
d1f95000 | 86 | \r |
99e8ed21 | 87 | ///\r |
af2dc6a7 | 88 | /// ARP cache entries.\r |
99e8ed21 | 89 | ///\r |
d1f95000 | 90 | typedef struct {\r |
2f88bd3a MK |
91 | EFI_IP_ADDRESS IpAddr;\r |
92 | EFI_MAC_ADDRESS MacAddr;\r | |
d1f95000 | 93 | } EFI_PXE_BASE_CODE_ARP_ENTRY;\r |
94 | \r | |
9319d2c2 | 95 | ///\r |
af2dc6a7 | 96 | /// ARP route table entries.\r |
9319d2c2 | 97 | ///\r |
d1f95000 | 98 | typedef struct {\r |
2f88bd3a MK |
99 | EFI_IP_ADDRESS IpAddr;\r |
100 | EFI_IP_ADDRESS SubnetMask;\r | |
101 | EFI_IP_ADDRESS GwAddr;\r | |
d1f95000 | 102 | } EFI_PXE_BASE_CODE_ROUTE_ENTRY;\r |
103 | \r | |
104 | //\r | |
105 | // UDP definitions\r | |
106 | //\r | |
2f88bd3a | 107 | typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;\r |
d1f95000 | 108 | \r |
2f88bd3a MK |
109 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001\r |
110 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002\r | |
111 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004\r | |
112 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008\r | |
113 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010\r | |
114 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020\r | |
d1f95000 | 115 | \r |
116 | //\r | |
117 | // Discover() definitions\r | |
118 | //\r | |
119 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0\r | |
120 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1\r | |
121 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2\r | |
122 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3\r | |
123 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4\r | |
124 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5\r | |
125 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6\r | |
126 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7\r | |
127 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8\r | |
128 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9\r | |
129 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10\r | |
130 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11\r | |
131 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12\r | |
132 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13\r | |
133 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14\r | |
134 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15\r | |
135 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16\r | |
136 | //\r | |
137 | // 17 through 32767 are reserved\r | |
138 | // 32768 through 65279 are for vendor use\r | |
139 | // 65280 through 65534 are reserved\r | |
140 | //\r | |
2f88bd3a | 141 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535\r |
d1f95000 | 142 | \r |
143 | #define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF\r | |
144 | #define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000\r | |
145 | \r | |
5fb89a0b | 146 | //\r |
9095d37b | 147 | // PXE Tag definition that identifies the processor\r |
5fb89a0b | 148 | // and programming environment of the client system.\r |
a2cacc9a HL |
149 | // These identifiers are defined by IETF:\r |
150 | // http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml\r | |
5fb89a0b | 151 | //\r |
152 | #if defined (MDE_CPU_IA32)\r | |
2f88bd3a | 153 | #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0006\r |
5fb89a0b | 154 | #elif defined (MDE_CPU_X64)\r |
2f88bd3a | 155 | #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0007\r |
5fb89a0b | 156 | #elif defined (MDE_CPU_ARM)\r |
2f88bd3a | 157 | #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000A\r |
a2cacc9a | 158 | #elif defined (MDE_CPU_AARCH64)\r |
2f88bd3a | 159 | #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000B\r |
d3abb40d | 160 | #elif defined (MDE_CPU_RISCV64)\r |
2f88bd3a | 161 | #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x001B\r |
f0a704f9 CL |
162 | #elif defined (MDE_CPU_LOONGARCH64)\r |
163 | #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0027\r | |
5fb89a0b | 164 | #endif\r |
165 | \r | |
99e8ed21 | 166 | ///\r |
167 | /// Discover() server list structure.\r | |
168 | ///\r | |
d1f95000 | 169 | typedef struct {\r |
2f88bd3a MK |
170 | UINT16 Type;\r |
171 | BOOLEAN AcceptAnyResponse;\r | |
172 | UINT8 Reserved;\r | |
173 | EFI_IP_ADDRESS IpAddr;\r | |
d1f95000 | 174 | } EFI_PXE_BASE_CODE_SRVLIST;\r |
175 | \r | |
99e8ed21 | 176 | ///\r |
177 | /// Discover() information override structure.\r | |
178 | ///\r | |
d1f95000 | 179 | typedef struct {\r |
2f88bd3a MK |
180 | BOOLEAN UseMCast;\r |
181 | BOOLEAN UseBCast;\r | |
182 | BOOLEAN UseUCast;\r | |
183 | BOOLEAN MustUseList;\r | |
184 | EFI_IP_ADDRESS ServerMCastIp;\r | |
185 | UINT16 IpCnt;\r | |
186 | EFI_PXE_BASE_CODE_SRVLIST SrvList[1];\r | |
d1f95000 | 187 | } EFI_PXE_BASE_CODE_DISCOVER_INFO;\r |
188 | \r | |
99e8ed21 | 189 | ///\r |
af2dc6a7 | 190 | /// TFTP opcode definitions.\r |
99e8ed21 | 191 | ///\r |
d1f95000 | 192 | typedef enum {\r |
193 | EFI_PXE_BASE_CODE_TFTP_FIRST,\r | |
194 | EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,\r | |
195 | EFI_PXE_BASE_CODE_TFTP_READ_FILE,\r | |
196 | EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,\r | |
197 | EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,\r | |
198 | EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,\r | |
199 | EFI_PXE_BASE_CODE_MTFTP_READ_FILE,\r | |
200 | EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,\r | |
201 | EFI_PXE_BASE_CODE_MTFTP_LAST\r | |
202 | } EFI_PXE_BASE_CODE_TFTP_OPCODE;\r | |
203 | \r | |
9319d2c2 LG |
204 | ///\r |
205 | /// MTFTP information. This information is required\r | |
206 | /// to start or join a multicast TFTP session. It is also required to\r | |
207 | /// perform the "get file size" and "read directory" operations of MTFTP.\r | |
208 | ///\r | |
d1f95000 | 209 | typedef struct {\r |
2f88bd3a MK |
210 | EFI_IP_ADDRESS MCastIp;\r |
211 | EFI_PXE_BASE_CODE_UDP_PORT CPort;\r | |
212 | EFI_PXE_BASE_CODE_UDP_PORT SPort;\r | |
213 | UINT16 ListenTimeout;\r | |
214 | UINT16 TransmitTimeout;\r | |
d1f95000 | 215 | } EFI_PXE_BASE_CODE_MTFTP_INFO;\r |
216 | \r | |
3ed785e9 | 217 | ///\r |
af2dc6a7 | 218 | /// DHCPV4 Packet structure.\r |
3ed785e9 | 219 | ///\r |
220 | typedef struct {\r | |
2f88bd3a MK |
221 | UINT8 BootpOpcode;\r |
222 | UINT8 BootpHwType;\r | |
223 | UINT8 BootpHwAddrLen;\r | |
224 | UINT8 BootpGateHops;\r | |
225 | UINT32 BootpIdent;\r | |
226 | UINT16 BootpSeconds;\r | |
227 | UINT16 BootpFlags;\r | |
228 | UINT8 BootpCiAddr[4];\r | |
229 | UINT8 BootpYiAddr[4];\r | |
230 | UINT8 BootpSiAddr[4];\r | |
231 | UINT8 BootpGiAddr[4];\r | |
232 | UINT8 BootpHwAddr[16];\r | |
233 | UINT8 BootpSrvName[64];\r | |
234 | UINT8 BootpBootFile[128];\r | |
235 | UINT32 DhcpMagik;\r | |
236 | UINT8 DhcpOptions[56];\r | |
3ed785e9 | 237 | } EFI_PXE_BASE_CODE_DHCPV4_PACKET;\r |
238 | \r | |
6e19836f | 239 | ///\r |
240 | /// DHCPV6 Packet structure.\r | |
241 | ///\r | |
242 | typedef struct {\r | |
2f88bd3a MK |
243 | UINT32 MessageType : 8;\r |
244 | UINT32 TransactionId : 24;\r | |
245 | UINT8 DhcpOptions[1024];\r | |
6e19836f | 246 | } EFI_PXE_BASE_CODE_DHCPV6_PACKET;\r |
247 | \r | |
9319d2c2 | 248 | ///\r |
af2dc6a7 | 249 | /// Packet structure.\r |
9319d2c2 | 250 | ///\r |
3ed785e9 | 251 | typedef union {\r |
2f88bd3a MK |
252 | UINT8 Raw[1472];\r |
253 | EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;\r | |
254 | EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;\r | |
3ed785e9 | 255 | } EFI_PXE_BASE_CODE_PACKET;\r |
256 | \r | |
d1f95000 | 257 | //\r |
258 | // PXE Base Code Mode structure\r | |
259 | //\r | |
2f88bd3a MK |
260 | #define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8\r |
261 | #define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8\r | |
d1f95000 | 262 | \r |
9319d2c2 | 263 | ///\r |
af2dc6a7 | 264 | /// EFI_PXE_BASE_CODE_MODE.\r |
9095d37b | 265 | /// The data values in this structure are read-only and\r |
9319d2c2 LG |
266 | /// are updated by the code that produces the\r |
267 | /// EFI_PXE_BASE_CODE_PROTOCOL functions.\r | |
268 | ///\r | |
d1f95000 | 269 | typedef struct {\r |
2f88bd3a MK |
270 | BOOLEAN Started;\r |
271 | BOOLEAN Ipv6Available;\r | |
272 | BOOLEAN Ipv6Supported;\r | |
273 | BOOLEAN UsingIpv6;\r | |
274 | BOOLEAN BisSupported;\r | |
275 | BOOLEAN BisDetected;\r | |
276 | BOOLEAN AutoArp;\r | |
277 | BOOLEAN SendGUID;\r | |
278 | BOOLEAN DhcpDiscoverValid;\r | |
279 | BOOLEAN DhcpAckReceived;\r | |
280 | BOOLEAN ProxyOfferReceived;\r | |
281 | BOOLEAN PxeDiscoverValid;\r | |
282 | BOOLEAN PxeReplyReceived;\r | |
283 | BOOLEAN PxeBisReplyReceived;\r | |
284 | BOOLEAN IcmpErrorReceived;\r | |
285 | BOOLEAN TftpErrorReceived;\r | |
286 | BOOLEAN MakeCallbacks;\r | |
287 | UINT8 TTL;\r | |
288 | UINT8 ToS;\r | |
289 | EFI_IP_ADDRESS StationIp;\r | |
290 | EFI_IP_ADDRESS SubnetMask;\r | |
291 | EFI_PXE_BASE_CODE_PACKET DhcpDiscover;\r | |
292 | EFI_PXE_BASE_CODE_PACKET DhcpAck;\r | |
293 | EFI_PXE_BASE_CODE_PACKET ProxyOffer;\r | |
294 | EFI_PXE_BASE_CODE_PACKET PxeDiscover;\r | |
295 | EFI_PXE_BASE_CODE_PACKET PxeReply;\r | |
296 | EFI_PXE_BASE_CODE_PACKET PxeBisReply;\r | |
297 | EFI_PXE_BASE_CODE_IP_FILTER IpFilter;\r | |
298 | UINT32 ArpCacheEntries;\r | |
299 | EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];\r | |
300 | UINT32 RouteTableEntries;\r | |
301 | EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];\r | |
302 | EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;\r | |
303 | EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;\r | |
d1f95000 | 304 | } EFI_PXE_BASE_CODE_MODE;\r |
305 | \r | |
306 | //\r | |
307 | // PXE Base Code Interface Function definitions\r | |
308 | //\r | |
309 | \r | |
9095d37b | 310 | /**\r |
d1f95000 | 311 | Enables the use of the PXE Base Code Protocol functions.\r |
f737cfb9 | 312 | \r |
313 | This function enables the use of the PXE Base Code Protocol functions. If the\r | |
314 | Started field of the EFI_PXE_BASE_CODE_MODE structure is already TRUE, then\r | |
315 | EFI_ALREADY_STARTED will be returned. If UseIpv6 is TRUE, then IPv6 formatted\r | |
316 | addresses will be used in this session. If UseIpv6 is FALSE, then IPv4 formatted\r | |
317 | addresses will be used in this session. If UseIpv6 is TRUE, and the Ipv6Supported\r | |
318 | field of the EFI_PXE_BASE_CODE_MODE structure is FALSE, then EFI_UNSUPPORTED will\r | |
319 | be returned. If there is not enough memory or other resources to start the PXE\r | |
320 | Base Code Protocol, then EFI_OUT_OF_RESOURCES will be returned. Otherwise, the\r | |
321 | PXE Base Code Protocol will be started, and all of the fields of the EFI_PXE_BASE_CODE_MODE\r | |
322 | structure will be initialized as follows:\r | |
323 | StartedSet to TRUE.\r | |
324 | Ipv6SupportedUnchanged.\r | |
325 | Ipv6AvailableUnchanged.\r | |
326 | UsingIpv6Set to UseIpv6.\r | |
327 | BisSupportedUnchanged.\r | |
328 | BisDetectedUnchanged.\r | |
329 | AutoArpSet to TRUE.\r | |
330 | SendGUIDSet to FALSE.\r | |
331 | TTLSet to DEFAULT_TTL.\r | |
332 | ToSSet to DEFAULT_ToS.\r | |
333 | DhcpCompletedSet to FALSE.\r | |
334 | ProxyOfferReceivedSet to FALSE.\r | |
335 | StationIpSet to an address of all zeros.\r | |
336 | SubnetMaskSet to a subnet mask of all zeros.\r | |
337 | DhcpDiscoverZero-filled.\r | |
338 | DhcpAckZero-filled.\r | |
339 | ProxyOfferZero-filled.\r | |
340 | PxeDiscoverValidSet to FALSE.\r | |
341 | PxeDiscoverZero-filled.\r | |
342 | PxeReplyValidSet to FALSE.\r | |
343 | PxeReplyZero-filled.\r | |
344 | PxeBisReplyValidSet to FALSE.\r | |
345 | PxeBisReplyZero-filled.\r | |
346 | IpFilterSet the Filters field to 0 and the IpCnt field to 0.\r | |
347 | ArpCacheEntriesSet to 0.\r | |
348 | ArpCacheZero-filled.\r | |
349 | RouteTableEntriesSet to 0.\r | |
350 | RouteTableZero-filled.\r | |
351 | IcmpErrorReceivedSet to FALSE.\r | |
352 | IcmpErrorZero-filled.\r | |
353 | TftpErroReceivedSet to FALSE.\r | |
354 | TftpErrorZero-filled.\r | |
355 | MakeCallbacksSet to TRUE if the PXE Base Code Callback Protocol is available.\r | |
356 | Set to FALSE if the PXE Base Code Callback Protocol is not available.\r | |
9095d37b | 357 | \r |
af2dc6a7 | 358 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
d1f95000 | 359 | @param UseIpv6 Specifies the type of IP addresses that are to be used during the session\r |
9095d37b LG |
360 | that is being started. Set to TRUE for IPv6 addresses, and FALSE for\r |
361 | IPv4 addresses.\r | |
362 | \r | |
d1f95000 | 363 | @retval EFI_SUCCESS The PXE Base Code Protocol was started.\r |
9095d37b | 364 | @retval EFI_DEVICE_ERROR The network device encountered an error during this oper\r |
d1f95000 | 365 | @retval EFI_UNSUPPORTED UseIpv6 is TRUE, but the Ipv6Supported field of the\r |
9095d37b LG |
366 | EFI_PXE_BASE_CODE_MODE structure is FALSE.\r |
367 | @retval EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state.\r | |
d1f95000 | 368 | @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r |
9095d37b LG |
369 | EFI_PXE_BASE_CODE_PROTOCOL structure.\r |
370 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the\r | |
371 | PXE Base Code Protocol.\r | |
372 | \r | |
d1f95000 | 373 | **/\r |
374 | typedef\r | |
375 | EFI_STATUS\r | |
8b13229b | 376 | (EFIAPI *EFI_PXE_BASE_CODE_START)(\r |
d1f95000 | 377 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
378 | IN BOOLEAN UseIpv6\r | |
379 | );\r | |
380 | \r | |
9095d37b | 381 | /**\r |
d1f95000 | 382 | Disables the use of the PXE Base Code Protocol functions.\r |
f737cfb9 | 383 | \r |
384 | This function stops all activity on the network device. All the resources allocated\r | |
385 | in Start() are released, the Started field of the EFI_PXE_BASE_CODE_MODE structure is\r | |
386 | set to FALSE and EFI_SUCCESS is returned. If the Started field of the EFI_PXE_BASE_CODE_MODE\r | |
387 | structure is already FALSE, then EFI_NOT_STARTED will be returned.\r | |
9095d37b | 388 | \r |
af2dc6a7 | 389 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
9095d37b | 390 | \r |
d1f95000 | 391 | @retval EFI_SUCCESS The PXE Base Code Protocol was stopped.\r |
9095d37b | 392 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is already in the stopped state.\r |
d1f95000 | 393 | @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r |
9095d37b LG |
394 | EFI_PXE_BASE_CODE_PROTOCOL structure.\r |
395 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r | |
396 | \r | |
d1f95000 | 397 | **/\r |
398 | typedef\r | |
399 | EFI_STATUS\r | |
8b13229b | 400 | (EFIAPI *EFI_PXE_BASE_CODE_STOP)(\r |
d1f95000 | 401 | IN EFI_PXE_BASE_CODE_PROTOCOL *This\r |
402 | );\r | |
403 | \r | |
9095d37b | 404 | /**\r |
d1f95000 | 405 | Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6\r |
406 | S.A.R.R (solicit / advertise / request / reply) sequence.\r | |
f737cfb9 | 407 | \r |
408 | This function attempts to complete the DHCP sequence. If this sequence is completed,\r | |
409 | then EFI_SUCCESS is returned, and the DhcpCompleted, ProxyOfferReceived, StationIp,\r | |
410 | SubnetMask, DhcpDiscover, DhcpAck, and ProxyOffer fields of the EFI_PXE_BASE_CODE_MODE\r | |
411 | structure are filled in.\r | |
412 | If SortOffers is TRUE, then the cached DHCP offer packets will be sorted before\r | |
413 | they are tried. If SortOffers is FALSE, then the cached DHCP offer packets will\r | |
414 | be tried in the order in which they are received. Please see the Preboot Execution\r | |
415 | Environment (PXE) Specification for additional details on the implementation of DHCP.\r | |
416 | This function can take at least 31 seconds to timeout and return control to the\r | |
417 | caller. If the DHCP sequence does not complete, then EFI_TIMEOUT will be returned.\r | |
418 | If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r | |
419 | then the DHCP sequence will be stopped and EFI_ABORTED will be returned.\r | |
9095d37b | 420 | \r |
af2dc6a7 | 421 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
d1f95000 | 422 | @param SortOffers TRUE if the offers received should be sorted. Set to FALSE to try the\r |
9095d37b LG |
423 | offers in the order that they are received.\r |
424 | \r | |
d1f95000 | 425 | @retval EFI_SUCCESS Valid DHCP has completed.\r |
426 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
427 | @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r | |
9095d37b LG |
428 | EFI_PXE_BASE_CODE_PROTOCOL structure.\r |
429 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r | |
d1f95000 | 430 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete the DHCP Protocol.\r |
431 | @retval EFI_ABORTED The callback function aborted the DHCP Protocol.\r | |
432 | @retval EFI_TIMEOUT The DHCP Protocol timed out.\r | |
433 | @retval EFI_ICMP_ERROR An ICMP error packet was received during the DHCP session.\r | |
434 | @retval EFI_NO_RESPONSE Valid PXE offer was not received.\r | |
9095d37b | 435 | \r |
d1f95000 | 436 | **/\r |
437 | typedef\r | |
438 | EFI_STATUS\r | |
8b13229b | 439 | (EFIAPI *EFI_PXE_BASE_CODE_DHCP)(\r |
d1f95000 | 440 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
441 | IN BOOLEAN SortOffers\r | |
442 | );\r | |
443 | \r | |
9095d37b | 444 | /**\r |
d1f95000 | 445 | Attempts to complete the PXE Boot Server and/or boot image discovery sequence.\r |
f737cfb9 | 446 | \r |
447 | This function attempts to complete the PXE Boot Server and/or boot image discovery\r | |
448 | sequence. If this sequence is completed, then EFI_SUCCESS is returned, and the\r | |
449 | PxeDiscoverValid, PxeDiscover, PxeReplyReceived, and PxeReply fields of the\r | |
450 | EFI_PXE_BASE_CODE_MODE structure are filled in. If UseBis is TRUE, then the\r | |
451 | PxeBisReplyReceived and PxeBisReply fields of the EFI_PXE_BASE_CODE_MODE structure\r | |
452 | will also be filled in. If UseBis is FALSE, then PxeBisReplyValid will be set to FALSE.\r | |
453 | In the structure referenced by parameter Info, the PXE Boot Server list, SrvList[],\r | |
454 | has two uses: It is the Boot Server IP address list used for unicast discovery\r | |
455 | (if the UseUCast field is TRUE), and it is the list used for Boot Server verification\r | |
456 | (if the MustUseList field is TRUE). Also, if the MustUseList field in that structure\r | |
457 | is TRUE and the AcceptAnyResponse field in the SrvList[] array is TRUE, any Boot\r | |
458 | Server reply of that type will be accepted. If the AcceptAnyResponse field is\r | |
459 | FALSE, only responses from Boot Servers with matching IP addresses will be accepted.\r | |
460 | This function can take at least 10 seconds to timeout and return control to the\r | |
461 | caller. If the Discovery sequence does not complete, then EFI_TIMEOUT will be\r | |
462 | returned. Please see the Preboot Execution Environment (PXE) Specification for\r | |
463 | additional details on the implementation of the Discovery sequence.\r | |
464 | If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r | |
465 | then the Discovery sequence is stopped and EFI_ABORTED will be returned.\r | |
9095d37b | 466 | \r |
af2dc6a7 | 467 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
d1f95000 | 468 | @param Type The type of bootstrap to perform.\r |
af2dc6a7 | 469 | @param Layer The pointer to the boot server layer number to discover, which must be\r |
9095d37b LG |
470 | PXE_BOOT_LAYER_INITIAL when a new server type is being\r |
471 | discovered.\r | |
472 | @param UseBis TRUE if Boot Integrity Services are to be used. FALSE otherwise.\r | |
af2dc6a7 | 473 | @param Info The pointer to a data structure that contains additional information on the\r |
9095d37b LG |
474 | type of discovery operation that is to be performed.\r |
475 | \r | |
d1f95000 | 476 | @retval EFI_SUCCESS The Discovery sequence has been completed.\r |
477 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
9095d37b LG |
478 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r |
479 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r | |
d1f95000 | 480 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete Discovery.\r |
481 | @retval EFI_ABORTED The callback function aborted the Discovery sequence.\r | |
482 | @retval EFI_TIMEOUT The Discovery sequence timed out.\r | |
483 | @retval EFI_ICMP_ERROR An ICMP error packet was received during the PXE discovery\r | |
9095d37b LG |
484 | session.\r |
485 | \r | |
d1f95000 | 486 | **/\r |
487 | typedef\r | |
488 | EFI_STATUS\r | |
8b13229b | 489 | (EFIAPI *EFI_PXE_BASE_CODE_DISCOVER)(\r |
d1f95000 | 490 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
491 | IN UINT16 Type,\r | |
492 | IN UINT16 *Layer,\r | |
493 | IN BOOLEAN UseBis,\r | |
494 | IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL\r | |
495 | );\r | |
496 | \r | |
9095d37b | 497 | /**\r |
d1f95000 | 498 | Used to perform TFTP and MTFTP services.\r |
f737cfb9 | 499 | \r |
500 | This function is used to perform TFTP and MTFTP services. This includes the\r | |
501 | TFTP operations to get the size of a file, read a directory, read a file, and\r | |
502 | write a file. It also includes the MTFTP operations to get the size of a file,\r | |
503 | read a directory, and read a file. The type of operation is specified by Operation.\r | |
504 | If the callback function that is invoked during the TFTP/MTFTP operation does\r | |
505 | not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will\r | |
506 | be returned.\r | |
507 | For read operations, the return data will be placed in the buffer specified by\r | |
508 | BufferPtr. If BufferSize is too small to contain the entire downloaded file,\r | |
509 | then EFI_BUFFER_TOO_SMALL will be returned and BufferSize will be set to zero\r | |
510 | or the size of the requested file (the size of the requested file is only returned\r | |
511 | if the TFTP server supports TFTP options). If BufferSize is large enough for the\r | |
512 | read operation, then BufferSize will be set to the size of the downloaded file,\r | |
513 | and EFI_SUCCESS will be returned. Applications using the PxeBc.Mtftp() services\r | |
514 | should use the get-file-size operations to determine the size of the downloaded\r | |
515 | file prior to using the read-file operations--especially when downloading large\r | |
516 | (greater than 64 MB) files--instead of making two calls to the read-file operation.\r | |
517 | Following this recommendation will save time if the file is larger than expected\r | |
518 | and the TFTP server does not support TFTP option extensions. Without TFTP option\r | |
519 | extension support, the client has to download the entire file, counting and discarding\r | |
520 | the received packets, to determine the file size.\r | |
521 | For write operations, the data to be sent is in the buffer specified by BufferPtr.\r | |
522 | BufferSize specifies the number of bytes to send. If the write operation completes\r | |
523 | successfully, then EFI_SUCCESS will be returned.\r | |
2f5c655a | 524 | For TFTP "get file size" operations, the size of the requested file or directory\r |
f737cfb9 | 525 | is returned in BufferSize, and EFI_SUCCESS will be returned. If the TFTP server\r |
526 | does not support options, the file will be downloaded into a bit bucket and the\r | |
2f5c655a | 527 | length of the downloaded file will be returned. For MTFTP "get file size" operations,\r |
528 | if the MTFTP server does not support the "get file size" option, EFI_UNSUPPORTED\r | |
f737cfb9 | 529 | will be returned.\r |
530 | This function can take up to 10 seconds to timeout and return control to the caller.\r | |
531 | If the TFTP sequence does not complete, EFI_TIMEOUT will be returned.\r | |
532 | If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r | |
533 | then the TFTP sequence is stopped and EFI_ABORTED will be returned.\r | |
534 | The format of the data returned from a TFTP read directory operation is a null-terminated\r | |
535 | filename followed by a null-terminated information string, of the form\r | |
2f5c655a | 536 | "size year-month-day hour:minute:second" (i.e. %d %d-%d-%d %d:%d:%f - note that\r |
f737cfb9 | 537 | the seconds field can be a decimal number), where the date and time are UTC. For\r |
538 | an MTFTP read directory command, there is additionally a null-terminated multicast\r | |
539 | IP address preceding the filename of the form %d.%d.%d.%d for IP v4. The final\r | |
540 | entry is itself null-terminated, so that the final information string is terminated\r | |
541 | with two null octets.\r | |
9095d37b | 542 | \r |
af2dc6a7 | 543 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
d1f95000 | 544 | @param Operation The type of operation to perform.\r |
9095d37b | 545 | @param BufferPtr A pointer to the data buffer.\r |
d1f95000 | 546 | @param Overwrite Only used on write file operations. TRUE if a file on a remote server can\r |
9095d37b | 547 | be overwritten.\r |
d1f95000 | 548 | @param BufferSize For get-file-size operations, *BufferSize returns the size of the\r |
9095d37b | 549 | requested file.\r |
d1f95000 | 550 | @param BlockSize The requested block size to be used during a TFTP transfer.\r |
551 | @param ServerIp The TFTP / MTFTP server IP address.\r | |
552 | @param Filename A Null-terminated ASCII string that specifies a directory name or a file\r | |
9095d37b | 553 | name.\r |
af2dc6a7 | 554 | @param Info The pointer to the MTFTP information.\r |
9095d37b LG |
555 | @param DontUseBuffer Set to FALSE for normal TFTP and MTFTP read file operation.\r |
556 | \r | |
d1f95000 | 557 | @retval EFI_SUCCESS The TFTP/MTFTP operation was completed.\r |
558 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
9095d37b LG |
559 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r |
560 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r | |
561 | @retval EFI_BUFFER_TOO_SMALL The buffer is not large enough to complete the read operation.\r | |
d1f95000 | 562 | @retval EFI_ABORTED The callback function aborted the TFTP/MTFTP operation.\r |
563 | @retval EFI_TIMEOUT The TFTP/MTFTP operation timed out.\r | |
564 | @retval EFI_ICMP_ERROR An ICMP error packet was received during the MTFTP session.\r | |
565 | @retval EFI_TFTP_ERROR A TFTP error packet was received during the MTFTP session.\r | |
9095d37b | 566 | \r |
d1f95000 | 567 | **/\r |
568 | typedef\r | |
569 | EFI_STATUS\r | |
8b13229b | 570 | (EFIAPI *EFI_PXE_BASE_CODE_MTFTP)(\r |
d1f95000 | 571 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
572 | IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,\r | |
573 | IN OUT VOID *BufferPtr OPTIONAL,\r | |
574 | IN BOOLEAN Overwrite,\r | |
575 | IN OUT UINT64 *BufferSize,\r | |
576 | IN UINTN *BlockSize OPTIONAL,\r | |
577 | IN EFI_IP_ADDRESS *ServerIp,\r | |
578 | IN UINT8 *Filename OPTIONAL,\r | |
579 | IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,\r | |
580 | IN BOOLEAN DontUseBuffer\r | |
581 | );\r | |
582 | \r | |
9095d37b | 583 | /**\r |
d1f95000 | 584 | Writes a UDP packet to the network interface.\r |
f737cfb9 | 585 | \r |
586 | This function writes a UDP packet specified by the (optional HeaderPtr and)\r | |
587 | BufferPtr parameters to the network interface. The UDP header is automatically\r | |
588 | built by this routine. It uses the parameters OpFlags, DestIp, DestPort, GatewayIp,\r | |
589 | SrcIp, and SrcPort to build this header. If the packet is successfully built and\r | |
590 | transmitted through the network interface, then EFI_SUCCESS will be returned.\r | |
591 | If a timeout occurs during the transmission of the packet, then EFI_TIMEOUT will\r | |
592 | be returned. If an ICMP error occurs during the transmission of the packet, then\r | |
593 | the IcmpErrorReceived field is set to TRUE, the IcmpError field is filled in and\r | |
594 | EFI_ICMP_ERROR will be returned. If the Callback Protocol does not return\r | |
595 | EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned.\r | |
9095d37b | 596 | \r |
af2dc6a7 | 597 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
9095d37b | 598 | @param OpFlags The UDP operation flags.\r |
d1f95000 | 599 | @param DestIp The destination IP address.\r |
9095d37b LG |
600 | @param DestPort The destination UDP port number.\r |
601 | @param GatewayIp The gateway IP address.\r | |
d1f95000 | 602 | @param SrcIp The source IP address.\r |
603 | @param SrcPort The source UDP port number.\r | |
604 | @param HeaderSize An optional field which may be set to the length of a header at\r | |
9095d37b | 605 | HeaderPtr to be prefixed to the data at BufferPtr.\r |
d1f95000 | 606 | @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r |
9095d37b | 607 | data at BufferPtr.\r |
d1f95000 | 608 | @param BufferSize A pointer to the size of the data at BufferPtr.\r |
609 | @param BufferPtr A pointer to the data to be written.\r | |
9095d37b | 610 | \r |
d1f95000 | 611 | @retval EFI_SUCCESS The UDP Write operation was completed.\r |
612 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
9095d37b LG |
613 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r |
614 | @retval EFI_BAD_BUFFER_SIZE The buffer is too long to be transmitted.\r | |
d1f95000 | 615 | @retval EFI_ABORTED The callback function aborted the UDP Write operation.\r |
616 | @retval EFI_TIMEOUT The UDP Write operation timed out.\r | |
9095d37b LG |
617 | @retval EFI_ICMP_ERROR An ICMP error packet was received during the UDP write session.\r |
618 | \r | |
d1f95000 | 619 | **/\r |
620 | typedef\r | |
621 | EFI_STATUS\r | |
8b13229b | 622 | (EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE)(\r |
d1f95000 | 623 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
624 | IN UINT16 OpFlags,\r | |
625 | IN EFI_IP_ADDRESS *DestIp,\r | |
626 | IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,\r | |
d0e2f823 MK |
627 | IN EFI_IP_ADDRESS *GatewayIp OPTIONAL,\r |
628 | IN EFI_IP_ADDRESS *SrcIp OPTIONAL,\r | |
629 | IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL,\r | |
630 | IN UINTN *HeaderSize OPTIONAL,\r | |
631 | IN VOID *HeaderPtr OPTIONAL,\r | |
d1f95000 | 632 | IN UINTN *BufferSize,\r |
633 | IN VOID *BufferPtr\r | |
634 | );\r | |
635 | \r | |
9095d37b | 636 | /**\r |
d1f95000 | 637 | Reads a UDP packet from the network interface.\r |
f737cfb9 | 638 | \r |
639 | This function reads a UDP packet from a network interface. The data contents\r | |
640 | are returned in (the optional HeaderPtr and) BufferPtr, and the size of the\r | |
af2dc6a7 | 641 | buffer received is returned in BufferSize. If the input BufferSize is smaller\r |
f737cfb9 | 642 | than the UDP packet received (less optional HeaderSize), it will be set to the\r |
643 | required size, and EFI_BUFFER_TOO_SMALL will be returned. In this case, the\r | |
644 | contents of BufferPtr are undefined, and the packet is lost. If a UDP packet is\r | |
645 | successfully received, then EFI_SUCCESS will be returned, and the information\r | |
646 | from the UDP header will be returned in DestIp, DestPort, SrcIp, and SrcPort if\r | |
647 | they are not NULL.\r | |
648 | Depending on the values of OpFlags and the DestIp, DestPort, SrcIp, and SrcPort\r | |
649 | input values, different types of UDP packet receive filtering will be performed.\r | |
650 | The following tables summarize these receive filter operations.\r | |
9095d37b | 651 | \r |
af2dc6a7 | 652 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
9095d37b | 653 | @param OpFlags The UDP operation flags.\r |
d1f95000 | 654 | @param DestIp The destination IP address.\r |
f737cfb9 | 655 | @param DestPort The destination UDP port number.\r |
d1f95000 | 656 | @param SrcIp The source IP address.\r |
657 | @param SrcPort The source UDP port number.\r | |
658 | @param HeaderSize An optional field which may be set to the length of a header at\r | |
9095d37b | 659 | HeaderPtr to be prefixed to the data at BufferPtr.\r |
d1f95000 | 660 | @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r |
9095d37b | 661 | data at BufferPtr.\r |
d1f95000 | 662 | @param BufferSize A pointer to the size of the data at BufferPtr.\r |
663 | @param BufferPtr A pointer to the data to be read.\r | |
9095d37b | 664 | \r |
f737cfb9 | 665 | @retval EFI_SUCCESS The UDP Read operation was completed.\r |
d1f95000 | 666 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r |
9095d37b | 667 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r |
d1f95000 | 668 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r |
669 | @retval EFI_BUFFER_TOO_SMALL The packet is larger than Buffer can hold.\r | |
670 | @retval EFI_ABORTED The callback function aborted the UDP Read operation.\r | |
9095d37b LG |
671 | @retval EFI_TIMEOUT The UDP Read operation timed out.\r |
672 | \r | |
d1f95000 | 673 | **/\r |
674 | typedef\r | |
675 | EFI_STATUS\r | |
8b13229b | 676 | (EFIAPI *EFI_PXE_BASE_CODE_UDP_READ)(\r |
d1f95000 | 677 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
678 | IN UINT16 OpFlags,\r | |
d0e2f823 MK |
679 | IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL,\r |
680 | IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL,\r | |
681 | IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL,\r | |
682 | IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL,\r | |
683 | IN UINTN *HeaderSize OPTIONAL,\r | |
684 | IN VOID *HeaderPtr OPTIONAL,\r | |
d1f95000 | 685 | IN OUT UINTN *BufferSize,\r |
686 | IN VOID *BufferPtr\r | |
687 | );\r | |
688 | \r | |
9095d37b | 689 | /**\r |
d1f95000 | 690 | Updates the IP receive filters of a network device and enables software filtering.\r |
9095d37b | 691 | \r |
f737cfb9 | 692 | The NewFilter field is used to modify the network device's current IP receive\r |
693 | filter settings and to enable a software filter. This function updates the IpFilter\r | |
694 | field of the EFI_PXE_BASE_CODE_MODE structure with the contents of NewIpFilter.\r | |
695 | The software filter is used when the USE_FILTER in OpFlags is set to UdpRead().\r | |
696 | The current hardware filter remains in effect no matter what the settings of OpFlags\r | |
697 | are, so that the meaning of ANY_DEST_IP set in OpFlags to UdpRead() is from those\r | |
2f5c655a | 698 | packets whose reception is enabled in hardware - physical NIC address (unicast),\r |
f737cfb9 | 699 | broadcast address, logical address or addresses (multicast), or all (promiscuous).\r |
700 | UdpRead() does not modify the IP filter settings.\r | |
701 | Dhcp(), Discover(), and Mtftp() set the IP filter, and return with the IP receive\r | |
702 | filter list emptied and the filter set to EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP.\r | |
703 | If an application or driver wishes to preserve the IP receive filter settings,\r | |
704 | it will have to preserve the IP receive filter settings before these calls, and\r | |
705 | use SetIpFilter() to restore them after the calls. If incompatible filtering is\r | |
af2dc6a7 | 706 | requested (for example, PROMISCUOUS with anything else), or if the device does not\r |
f737cfb9 | 707 | support a requested filter setting and it cannot be accommodated in software\r |
708 | (for example, PROMISCUOUS not supported), EFI_INVALID_PARAMETER will be returned.\r | |
709 | The IPlist field is used to enable IPs other than the StationIP. They may be\r | |
710 | multicast or unicast. If IPcnt is set as well as EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP,\r | |
711 | then both the StationIP and the IPs from the IPlist will be used.\r | |
9095d37b | 712 | \r |
af2dc6a7 | 713 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
714 | @param NewFilter The pointer to the new set of IP receive filters.\r | |
9095d37b | 715 | \r |
d1f95000 | 716 | @retval EFI_SUCCESS The IP receive filter settings were updated.\r |
717 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
9095d37b LG |
718 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r |
719 | \r | |
d1f95000 | 720 | **/\r |
721 | typedef\r | |
722 | EFI_STATUS\r | |
8b13229b | 723 | (EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER)(\r |
d1f95000 | 724 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
725 | IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter\r | |
726 | );\r | |
727 | \r | |
9095d37b | 728 | /**\r |
d1f95000 | 729 | Uses the ARP protocol to resolve a MAC address.\r |
9095d37b | 730 | \r |
f737cfb9 | 731 | This function uses the ARP protocol to resolve a MAC address. The UsingIpv6 field\r |
732 | of the EFI_PXE_BASE_CODE_MODE structure is used to determine if IPv4 or IPv6\r | |
733 | addresses are being used. The IP address specified by IpAddr is used to resolve\r | |
734 | a MAC address. If the ARP protocol succeeds in resolving the specified address,\r | |
735 | then the ArpCacheEntries and ArpCache fields of the EFI_PXE_BASE_CODE_MODE structure\r | |
736 | are updated, and EFI_SUCCESS is returned. If MacAddr is not NULL, the resolved\r | |
737 | MAC address is placed there as well.\r | |
738 | If the PXE Base Code protocol is in the stopped state, then EFI_NOT_STARTED is\r | |
739 | returned. If the ARP protocol encounters a timeout condition while attempting\r | |
740 | to resolve an address, then EFI_TIMEOUT is returned. If the Callback Protocol\r | |
741 | does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED is\r | |
742 | returned.\r | |
9095d37b | 743 | \r |
af2dc6a7 | 744 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
745 | @param IpAddr The pointer to the IP address that is used to resolve a MAC address.\r | |
d1f95000 | 746 | @param MacAddr If not NULL, a pointer to the MAC address that was resolved with the\r |
9095d37b LG |
747 | ARP protocol.\r |
748 | \r | |
d1f95000 | 749 | @retval EFI_SUCCESS The IP or MAC address was resolved.\r |
750 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
9095d37b LG |
751 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r |
752 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r | |
d1f95000 | 753 | @retval EFI_ABORTED The callback function aborted the ARP Protocol.\r |
754 | @retval EFI_TIMEOUT The ARP Protocol encountered a timeout condition.\r | |
9095d37b | 755 | \r |
d1f95000 | 756 | **/\r |
757 | typedef\r | |
758 | EFI_STATUS\r | |
8b13229b | 759 | (EFIAPI *EFI_PXE_BASE_CODE_ARP)(\r |
d1f95000 | 760 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
761 | IN EFI_IP_ADDRESS *IpAddr,\r | |
762 | IN EFI_MAC_ADDRESS *MacAddr OPTIONAL\r | |
763 | );\r | |
764 | \r | |
9095d37b | 765 | /**\r |
d1f95000 | 766 | Updates the parameters that affect the operation of the PXE Base Code Protocol.\r |
9095d37b | 767 | \r |
f737cfb9 | 768 | This function sets parameters that affect the operation of the PXE Base Code Protocol.\r |
769 | The parameter specified by NewAutoArp is used to control the generation of ARP\r | |
770 | protocol packets. If NewAutoArp is TRUE, then ARP Protocol packets will be generated\r | |
771 | as required by the PXE Base Code Protocol. If NewAutoArp is FALSE, then no ARP\r | |
772 | Protocol packets will be generated. In this case, the only mappings that are\r | |
773 | available are those stored in the ArpCache of the EFI_PXE_BASE_CODE_MODE structure.\r | |
774 | If there are not enough mappings in the ArpCache to perform a PXE Base Code Protocol\r | |
775 | service, then the service will fail. This function updates the AutoArp field of\r | |
776 | the EFI_PXE_BASE_CODE_MODE structure to NewAutoArp.\r | |
777 | The SetParameters() call must be invoked after a Callback Protocol is installed\r | |
778 | to enable the use of callbacks.\r | |
9095d37b | 779 | \r |
af2dc6a7 | 780 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
d1f95000 | 781 | @param NewAutoArp If not NULL, a pointer to a value that specifies whether to replace the\r |
9095d37b | 782 | current value of AutoARP.\r |
d1f95000 | 783 | @param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the\r |
9095d37b | 784 | current value of SendGUID.\r |
d1f95000 | 785 | @param NewTTL If not NULL, a pointer to be used in place of the current value of TTL,\r |
9095d37b | 786 | the "time to live" field of the IP header.\r |
d1f95000 | 787 | @param NewToS If not NULL, a pointer to be used in place of the current value of ToS,\r |
9095d37b | 788 | the "type of service" field of the IP header.\r |
d1f95000 | 789 | @param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the\r |
9095d37b LG |
790 | current value of the MakeCallback field of the Mode structure.\r |
791 | \r | |
d1f95000 | 792 | @retval EFI_SUCCESS The new parameters values were updated.\r |
793 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
9095d37b LG |
794 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r |
795 | \r | |
d1f95000 | 796 | **/\r |
797 | typedef\r | |
798 | EFI_STATUS\r | |
8b13229b | 799 | (EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS)(\r |
d1f95000 | 800 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
d0e2f823 MK |
801 | IN BOOLEAN *NewAutoArp OPTIONAL,\r |
802 | IN BOOLEAN *NewSendGUID OPTIONAL,\r | |
803 | IN UINT8 *NewTTL OPTIONAL,\r | |
804 | IN UINT8 *NewToS OPTIONAL,\r | |
d1f95000 | 805 | IN BOOLEAN *NewMakeCallback OPTIONAL\r |
806 | );\r | |
807 | \r | |
9095d37b | 808 | /**\r |
d1f95000 | 809 | Updates the station IP address and/or subnet mask values of a network device.\r |
9095d37b | 810 | \r |
f737cfb9 | 811 | This function updates the station IP address and/or subnet mask values of a network\r |
812 | device.\r | |
813 | The NewStationIp field is used to modify the network device's current IP address.\r | |
814 | If NewStationIP is NULL, then the current IP address will not be modified. Otherwise,\r | |
815 | this function updates the StationIp field of the EFI_PXE_BASE_CODE_MODE structure\r | |
816 | with NewStationIp.\r | |
817 | The NewSubnetMask field is used to modify the network device's current subnet\r | |
818 | mask. If NewSubnetMask is NULL, then the current subnet mask will not be modified.\r | |
819 | Otherwise, this function updates the SubnetMask field of the EFI_PXE_BASE_CODE_MODE\r | |
820 | structure with NewSubnetMask.\r | |
9095d37b | 821 | \r |
af2dc6a7 | 822 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
9095d37b LG |
823 | @param NewStationIp The pointer to the new IP address to be used by the network device.\r |
824 | @param NewSubnetMask The pointer to the new subnet mask to be used by the network device.\r | |
825 | \r | |
d1f95000 | 826 | @retval EFI_SUCCESS The new station IP address and/or subnet mask were updated.\r |
827 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
9095d37b LG |
828 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r |
829 | \r | |
d1f95000 | 830 | **/\r |
831 | typedef\r | |
832 | EFI_STATUS\r | |
8b13229b | 833 | (EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP)(\r |
d1f95000 | 834 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
d0e2f823 | 835 | IN EFI_IP_ADDRESS *NewStationIp OPTIONAL,\r |
d1f95000 | 836 | IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL\r |
837 | );\r | |
838 | \r | |
9095d37b | 839 | /**\r |
d1f95000 | 840 | Updates the contents of the cached DHCP and Discover packets.\r |
9095d37b | 841 | \r |
f737cfb9 | 842 | The pointers to the new packets are used to update the contents of the cached\r |
843 | packets in the EFI_PXE_BASE_CODE_MODE structure.\r | |
9095d37b | 844 | \r |
af2dc6a7 | 845 | @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r |
846 | @param NewDhcpDiscoverValid The pointer to a value that will replace the current\r | |
9095d37b | 847 | DhcpDiscoverValid field.\r |
af2dc6a7 | 848 | @param NewDhcpAckReceived The pointer to a value that will replace the current\r |
9095d37b | 849 | DhcpAckReceived field.\r |
af2dc6a7 | 850 | @param NewProxyOfferReceived The pointer to a value that will replace the current\r |
9095d37b LG |
851 | ProxyOfferReceived field.\r |
852 | @param NewPxeDiscoverValid The pointer to a value that will replace the current\r | |
853 | ProxyOfferReceived field.\r | |
af2dc6a7 | 854 | @param NewPxeReplyReceived The pointer to a value that will replace the current\r |
9095d37b | 855 | PxeReplyReceived field.\r |
af2dc6a7 | 856 | @param NewPxeBisReplyReceived The pointer to a value that will replace the current\r |
9095d37b LG |
857 | PxeBisReplyReceived field.\r |
858 | @param NewDhcpDiscover The pointer to the new cached DHCP Discover packet contents.\r | |
af2dc6a7 | 859 | @param NewDhcpAck The pointer to the new cached DHCP Ack packet contents.\r |
860 | @param NewProxyOffer The pointer to the new cached Proxy Offer packet contents.\r | |
861 | @param NewPxeDiscover The pointer to the new cached PXE Discover packet contents.\r | |
862 | @param NewPxeReply The pointer to the new cached PXE Reply packet contents.\r | |
863 | @param NewPxeBisReply The pointer to the new cached PXE BIS Reply packet contents.\r | |
9095d37b | 864 | \r |
d1f95000 | 865 | @retval EFI_SUCCESS The cached packet contents were updated.\r |
866 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
867 | @retval EFI_INVALID_PARAMETER This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.\r | |
9095d37b | 868 | \r |
d1f95000 | 869 | **/\r |
870 | typedef\r | |
871 | EFI_STATUS\r | |
8b13229b | 872 | (EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS)(\r |
d1f95000 | 873 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r |
d0e2f823 MK |
874 | BOOLEAN *NewDhcpDiscoverValid OPTIONAL,\r |
875 | BOOLEAN *NewDhcpAckReceived OPTIONAL,\r | |
876 | BOOLEAN *NewProxyOfferReceived OPTIONAL,\r | |
877 | BOOLEAN *NewPxeDiscoverValid OPTIONAL,\r | |
878 | BOOLEAN *NewPxeReplyReceived OPTIONAL,\r | |
879 | BOOLEAN *NewPxeBisReplyReceived OPTIONAL,\r | |
880 | IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover OPTIONAL,\r | |
881 | IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck OPTIONAL,\r | |
882 | IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer OPTIONAL,\r | |
883 | IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover OPTIONAL,\r | |
884 | IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply OPTIONAL,\r | |
d1f95000 | 885 | IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL\r |
886 | );\r | |
887 | \r | |
888 | //\r | |
889 | // PXE Base Code Protocol structure\r | |
890 | //\r | |
2f88bd3a | 891 | #define EFI_PXE_BASE_CODE_PROTOCOL_REVISION 0x00010000\r |
a6508c05 | 892 | \r |
893 | //\r | |
894 | // Revision defined in EFI1.1\r | |
9095d37b | 895 | //\r |
a6508c05 | 896 | #define EFI_PXE_BASE_CODE_INTERFACE_REVISION EFI_PXE_BASE_CODE_PROTOCOL_REVISION\r |
d1f95000 | 897 | \r |
44717a39 | 898 | ///\r |
899 | /// The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices.\r | |
900 | /// An EFI_PXE_BASE_CODE_PROTOCOL will be layered on top of an\r | |
901 | /// EFI_MANAGED_NETWORK_PROTOCOL protocol in order to perform packet level transactions.\r | |
902 | /// The EFI_PXE_BASE_CODE_PROTOCOL handle also supports the\r | |
903 | /// EFI_LOAD_FILE_PROTOCOL protocol. This provides a clean way to obtain control from the\r | |
904 | /// boot manager if the boot path is from the remote device.\r | |
905 | ///\r | |
d1f95000 | 906 | struct _EFI_PXE_BASE_CODE_PROTOCOL {\r |
1f08a159 | 907 | ///\r |
9095d37b LG |
908 | /// The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must\r |
909 | /// be backwards compatible. If a future version is not backwards compatible\r | |
1f08a159 | 910 | /// it is not the same GUID.\r |
911 | ///\r | |
2f88bd3a MK |
912 | UINT64 Revision;\r |
913 | EFI_PXE_BASE_CODE_START Start;\r | |
914 | EFI_PXE_BASE_CODE_STOP Stop;\r | |
915 | EFI_PXE_BASE_CODE_DHCP Dhcp;\r | |
916 | EFI_PXE_BASE_CODE_DISCOVER Discover;\r | |
917 | EFI_PXE_BASE_CODE_MTFTP Mtftp;\r | |
918 | EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;\r | |
919 | EFI_PXE_BASE_CODE_UDP_READ UdpRead;\r | |
920 | EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;\r | |
921 | EFI_PXE_BASE_CODE_ARP Arp;\r | |
922 | EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;\r | |
923 | EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;\r | |
924 | EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;\r | |
44717a39 | 925 | ///\r |
af2dc6a7 | 926 | /// The pointer to the EFI_PXE_BASE_CODE_MODE data for this device.\r |
44717a39 | 927 | ///\r |
2f88bd3a | 928 | EFI_PXE_BASE_CODE_MODE *Mode;\r |
d1f95000 | 929 | };\r |
930 | \r | |
2f88bd3a | 931 | extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;\r |
d1f95000 | 932 | \r |
9095d37b | 933 | #endif\r |