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