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