]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | EFI PXE Base Code Protocol definitions.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation \r | |
5 | All rights reserved. This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | Module Name: PxeBaseCode.h\r | |
14 | \r | |
15 | **/\r | |
16 | #ifndef __PXE_BASE_CODE_PROTOCOL_H__\r | |
17 | #define __PXE_BASE_CODE_PROTOCOL_H__\r | |
18 | \r | |
19 | //\r | |
20 | // PXE Base Code protocol\r | |
21 | //\r | |
22 | #define EFI_PXE_BASE_CODE_PROTOCOL_GUID \\r | |
23 | { \\r | |
24 | 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r | |
25 | }\r | |
26 | \r | |
27 | typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE_PROTOCOL;\r | |
28 | \r | |
29 | //\r | |
30 | // Default IP TTL and ToS.\r | |
31 | //\r | |
32 | #define DEFAULT_TTL 16\r | |
33 | #define DEFAULT_ToS 0\r | |
34 | \r | |
35 | //\r | |
36 | // ICMP error format\r | |
37 | //\r | |
38 | typedef struct {\r | |
39 | UINT8 Type;\r | |
40 | UINT8 Code;\r | |
41 | UINT16 Checksum;\r | |
42 | union {\r | |
43 | UINT32 reserved;\r | |
44 | UINT32 Mtu;\r | |
45 | UINT32 Pointer;\r | |
46 | struct {\r | |
47 | UINT16 Identifier;\r | |
48 | UINT16 Sequence;\r | |
49 | } Echo;\r | |
50 | } u;\r | |
51 | UINT8 Data[494];\r | |
52 | } EFI_PXE_BASE_CODE_ICMP_ERROR;\r | |
53 | \r | |
54 | //\r | |
55 | // TFTP error format\r | |
56 | //\r | |
57 | typedef struct {\r | |
58 | UINT8 ErrorCode;\r | |
59 | CHAR8 ErrorString[127];\r | |
60 | } EFI_PXE_BASE_CODE_TFTP_ERROR;\r | |
61 | \r | |
62 | //\r | |
63 | // IP Receive Filter definitions\r | |
64 | //\r | |
65 | #define EFI_PXE_BASE_CODE_MAX_IPCNT 8\r | |
66 | \r | |
67 | typedef struct {\r | |
68 | UINT8 Filters;\r | |
69 | UINT8 IpCnt;\r | |
70 | UINT16 reserved;\r | |
71 | EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];\r | |
72 | } EFI_PXE_BASE_CODE_IP_FILTER;\r | |
73 | \r | |
74 | #define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001\r | |
75 | #define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002\r | |
76 | #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004\r | |
77 | #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008\r | |
78 | \r | |
79 | //\r | |
80 | // ARP Cache definitions\r | |
81 | //\r | |
82 | typedef struct {\r | |
83 | EFI_IP_ADDRESS IpAddr;\r | |
84 | EFI_MAC_ADDRESS MacAddr;\r | |
85 | } EFI_PXE_BASE_CODE_ARP_ENTRY;\r | |
86 | \r | |
87 | typedef struct {\r | |
88 | EFI_IP_ADDRESS IpAddr;\r | |
89 | EFI_IP_ADDRESS SubnetMask;\r | |
90 | EFI_IP_ADDRESS GwAddr;\r | |
91 | } EFI_PXE_BASE_CODE_ROUTE_ENTRY;\r | |
92 | \r | |
93 | //\r | |
94 | // UDP definitions\r | |
95 | //\r | |
96 | typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;\r | |
97 | \r | |
98 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001\r | |
99 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002\r | |
100 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004\r | |
101 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008\r | |
102 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010\r | |
103 | #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020\r | |
104 | \r | |
105 | //\r | |
106 | // Discover() definitions\r | |
107 | //\r | |
108 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0\r | |
109 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1\r | |
110 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2\r | |
111 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3\r | |
112 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4\r | |
113 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5\r | |
114 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6\r | |
115 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7\r | |
116 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8\r | |
117 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9\r | |
118 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10\r | |
119 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11\r | |
120 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12\r | |
121 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13\r | |
122 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14\r | |
123 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15\r | |
124 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16\r | |
125 | //\r | |
126 | // 17 through 32767 are reserved\r | |
127 | // 32768 through 65279 are for vendor use\r | |
128 | // 65280 through 65534 are reserved\r | |
129 | //\r | |
130 | #define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535\r | |
131 | \r | |
132 | #define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF\r | |
133 | #define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000\r | |
134 | \r | |
135 | //\r | |
136 | // Discover() server list structure.\r | |
137 | //\r | |
138 | typedef struct {\r | |
139 | UINT16 Type;\r | |
140 | BOOLEAN AcceptAnyResponse;\r | |
141 | UINT8 Reserved;\r | |
142 | EFI_IP_ADDRESS IpAddr;\r | |
143 | } EFI_PXE_BASE_CODE_SRVLIST;\r | |
144 | \r | |
145 | //\r | |
146 | // Discover() information override structure.\r | |
147 | //\r | |
148 | typedef struct {\r | |
149 | BOOLEAN UseMCast;\r | |
150 | BOOLEAN UseBCast;\r | |
151 | BOOLEAN UseUCast;\r | |
152 | BOOLEAN MustUseList;\r | |
153 | EFI_IP_ADDRESS ServerMCastIp;\r | |
154 | UINT16 IpCnt;\r | |
155 | EFI_PXE_BASE_CODE_SRVLIST SrvList[1];\r | |
156 | } EFI_PXE_BASE_CODE_DISCOVER_INFO;\r | |
157 | \r | |
158 | //\r | |
159 | // Mtftp() definitions\r | |
160 | //\r | |
161 | typedef enum {\r | |
162 | EFI_PXE_BASE_CODE_TFTP_FIRST,\r | |
163 | EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,\r | |
164 | EFI_PXE_BASE_CODE_TFTP_READ_FILE,\r | |
165 | EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,\r | |
166 | EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,\r | |
167 | EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,\r | |
168 | EFI_PXE_BASE_CODE_MTFTP_READ_FILE,\r | |
169 | EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,\r | |
170 | EFI_PXE_BASE_CODE_MTFTP_LAST\r | |
171 | } EFI_PXE_BASE_CODE_TFTP_OPCODE;\r | |
172 | \r | |
173 | typedef struct {\r | |
174 | EFI_IP_ADDRESS MCastIp;\r | |
175 | EFI_PXE_BASE_CODE_UDP_PORT CPort;\r | |
176 | EFI_PXE_BASE_CODE_UDP_PORT SPort;\r | |
177 | UINT16 ListenTimeout;\r | |
178 | UINT16 TransmitTimeout;\r | |
179 | } EFI_PXE_BASE_CODE_MTFTP_INFO;\r | |
180 | \r | |
181 | //\r | |
182 | // PXE Base Code Mode structure\r | |
183 | //\r | |
184 | #define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8\r | |
185 | #define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8\r | |
186 | \r | |
187 | typedef struct {\r | |
188 | BOOLEAN Started;\r | |
189 | BOOLEAN Ipv6Available;\r | |
190 | BOOLEAN Ipv6Supported;\r | |
191 | BOOLEAN UsingIpv6;\r | |
192 | BOOLEAN BisSupported;\r | |
193 | BOOLEAN BisDetected;\r | |
194 | BOOLEAN AutoArp;\r | |
195 | BOOLEAN SendGUID;\r | |
196 | BOOLEAN DhcpDiscoverValid;\r | |
197 | BOOLEAN DhcpAckReceived;\r | |
198 | BOOLEAN ProxyOfferReceived;\r | |
199 | BOOLEAN PxeDiscoverValid;\r | |
200 | BOOLEAN PxeReplyReceived;\r | |
201 | BOOLEAN PxeBisReplyReceived;\r | |
202 | BOOLEAN IcmpErrorReceived;\r | |
203 | BOOLEAN TftpErrorReceived;\r | |
204 | BOOLEAN MakeCallbacks;\r | |
205 | UINT8 TTL;\r | |
206 | UINT8 ToS;\r | |
207 | EFI_IP_ADDRESS StationIp;\r | |
208 | EFI_IP_ADDRESS SubnetMask;\r | |
209 | EFI_PXE_BASE_CODE_PACKET DhcpDiscover;\r | |
210 | EFI_PXE_BASE_CODE_PACKET DhcpAck;\r | |
211 | EFI_PXE_BASE_CODE_PACKET ProxyOffer;\r | |
212 | EFI_PXE_BASE_CODE_PACKET PxeDiscover;\r | |
213 | EFI_PXE_BASE_CODE_PACKET PxeReply;\r | |
214 | EFI_PXE_BASE_CODE_PACKET PxeBisReply;\r | |
215 | EFI_PXE_BASE_CODE_IP_FILTER IpFilter;\r | |
216 | UINT32 ArpCacheEntries;\r | |
217 | EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];\r | |
218 | UINT32 RouteTableEntries;\r | |
219 | EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];\r | |
220 | EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;\r | |
221 | EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;\r | |
222 | } EFI_PXE_BASE_CODE_MODE;\r | |
223 | \r | |
224 | //\r | |
225 | // PXE Base Code Interface Function definitions\r | |
226 | //\r | |
227 | \r | |
228 | /** \r | |
229 | Enables the use of the PXE Base Code Protocol functions.\r | |
230 | \r | |
231 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
232 | @param UseIpv6 Specifies the type of IP addresses that are to be used during the session\r | |
233 | that is being started. Set to TRUE for IPv6 addresses, and FALSE for \r | |
234 | IPv4 addresses. \r | |
235 | \r | |
236 | @retval EFI_SUCCESS The PXE Base Code Protocol was started.\r | |
237 | @retval EFI_DEVICE_ERROR The network device encountered an error during this oper \r | |
238 | @retval EFI_UNSUPPORTED UseIpv6 is TRUE, but the Ipv6Supported field of the\r | |
239 | EFI_PXE_BASE_CODE_MODE structure is FALSE. \r | |
240 | @retval EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state. \r | |
241 | @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r | |
242 | EFI_PXE_BASE_CODE_PROTOCOL structure. \r | |
243 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the \r | |
244 | PXE Base Code Protocol. \r | |
245 | \r | |
246 | **/\r | |
247 | typedef\r | |
248 | EFI_STATUS\r | |
249 | (EFIAPI *EFI_PXE_BASE_CODE_START) (\r | |
250 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
251 | IN BOOLEAN UseIpv6\r | |
252 | );\r | |
253 | \r | |
254 | /** \r | |
255 | Disables the use of the PXE Base Code Protocol functions.\r | |
256 | \r | |
257 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
258 | \r | |
259 | @retval EFI_SUCCESS The PXE Base Code Protocol was stopped.\r | |
260 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is already in the stopped state. \r | |
261 | @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r | |
262 | EFI_PXE_BASE_CODE_PROTOCOL structure. \r | |
263 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r | |
264 | \r | |
265 | **/\r | |
266 | typedef\r | |
267 | EFI_STATUS\r | |
268 | (EFIAPI *EFI_PXE_BASE_CODE_STOP) (\r | |
269 | IN EFI_PXE_BASE_CODE_PROTOCOL *This\r | |
270 | );\r | |
271 | \r | |
272 | /** \r | |
273 | Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6\r | |
274 | S.A.R.R (solicit / advertise / request / reply) sequence.\r | |
275 | \r | |
276 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
277 | @param SortOffers TRUE if the offers received should be sorted. Set to FALSE to try the\r | |
278 | offers in the order that they are received. \r | |
279 | \r | |
280 | @retval EFI_SUCCESS Valid DHCP has completed.\r | |
281 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
282 | @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r | |
283 | EFI_PXE_BASE_CODE_PROTOCOL structure. \r | |
284 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r | |
285 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete the DHCP Protocol.\r | |
286 | @retval EFI_ABORTED The callback function aborted the DHCP Protocol.\r | |
287 | @retval EFI_TIMEOUT The DHCP Protocol timed out.\r | |
288 | @retval EFI_ICMP_ERROR An ICMP error packet was received during the DHCP session.\r | |
289 | @retval EFI_NO_RESPONSE Valid PXE offer was not received.\r | |
290 | \r | |
291 | **/\r | |
292 | typedef\r | |
293 | EFI_STATUS\r | |
294 | (EFIAPI *EFI_PXE_BASE_CODE_DHCP) (\r | |
295 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
296 | IN BOOLEAN SortOffers\r | |
297 | );\r | |
298 | \r | |
299 | /** \r | |
300 | Attempts to complete the PXE Boot Server and/or boot image discovery sequence.\r | |
301 | \r | |
302 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
303 | @param Type The type of bootstrap to perform.\r | |
304 | @param Layer Pointer to the boot server layer number to discover, which must be\r | |
305 | PXE_BOOT_LAYER_INITIAL when a new server type is being \r | |
306 | discovered. \r | |
307 | @param UseBis TRUE if Boot Integrity Services are to be used. FALSE otherwise. \r | |
308 | @param Info Pointer to a data structure that contains additional information on the\r | |
309 | type of discovery operation that is to be performed. \r | |
310 | \r | |
311 | @retval EFI_SUCCESS The Discovery sequence has been completed.\r | |
312 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
313 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r | |
314 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r | |
315 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete Discovery.\r | |
316 | @retval EFI_ABORTED The callback function aborted the Discovery sequence.\r | |
317 | @retval EFI_TIMEOUT The Discovery sequence timed out.\r | |
318 | @retval EFI_ICMP_ERROR An ICMP error packet was received during the PXE discovery\r | |
319 | session. \r | |
320 | \r | |
321 | **/\r | |
322 | typedef\r | |
323 | EFI_STATUS\r | |
324 | (EFIAPI *EFI_PXE_BASE_CODE_DISCOVER) (\r | |
325 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
326 | IN UINT16 Type,\r | |
327 | IN UINT16 *Layer,\r | |
328 | IN BOOLEAN UseBis,\r | |
329 | IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL\r | |
330 | );\r | |
331 | \r | |
332 | /** \r | |
333 | Used to perform TFTP and MTFTP services.\r | |
334 | \r | |
335 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
336 | @param Operation The type of operation to perform.\r | |
337 | @param BufferPtr A pointer to the data buffer. \r | |
338 | @param Overwrite Only used on write file operations. TRUE if a file on a remote server can\r | |
339 | be overwritten. \r | |
340 | @param BufferSize For get-file-size operations, *BufferSize returns the size of the\r | |
341 | requested file. \r | |
342 | @param BlockSize The requested block size to be used during a TFTP transfer.\r | |
343 | @param ServerIp The TFTP / MTFTP server IP address.\r | |
344 | @param Filename A Null-terminated ASCII string that specifies a directory name or a file\r | |
345 | name. \r | |
346 | @param Info Pointer to the MTFTP information.\r | |
347 | @param DontUseBuffer Set to FALSE for normal TFTP and MTFTP read file operation. \r | |
348 | \r | |
349 | @retval EFI_SUCCESS The TFTP/MTFTP operation was completed.\r | |
350 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
351 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r | |
352 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r | |
353 | @retval EFI_BUFFER_TOO_SMALL The buffer is not large enough to complete the read operation. \r | |
354 | @retval EFI_ABORTED The callback function aborted the TFTP/MTFTP operation.\r | |
355 | @retval EFI_TIMEOUT The TFTP/MTFTP operation timed out.\r | |
356 | @retval EFI_ICMP_ERROR An ICMP error packet was received during the MTFTP session.\r | |
357 | @retval EFI_TFTP_ERROR A TFTP error packet was received during the MTFTP session.\r | |
358 | \r | |
359 | **/\r | |
360 | typedef\r | |
361 | EFI_STATUS\r | |
362 | (EFIAPI *EFI_PXE_BASE_CODE_MTFTP) (\r | |
363 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
364 | IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,\r | |
365 | IN OUT VOID *BufferPtr OPTIONAL,\r | |
366 | IN BOOLEAN Overwrite,\r | |
367 | IN OUT UINT64 *BufferSize,\r | |
368 | IN UINTN *BlockSize OPTIONAL,\r | |
369 | IN EFI_IP_ADDRESS *ServerIp,\r | |
370 | IN UINT8 *Filename OPTIONAL,\r | |
371 | IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,\r | |
372 | IN BOOLEAN DontUseBuffer\r | |
373 | );\r | |
374 | \r | |
375 | /** \r | |
376 | Writes a UDP packet to the network interface.\r | |
377 | \r | |
378 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
379 | @param OpFlags The UDP operation flags. \r | |
380 | @param DestIp The destination IP address.\r | |
381 | @param DestPort The destination UDP port number. \r | |
382 | @param GatewayIp The gateway IP address. \r | |
383 | @param SrcIp The source IP address.\r | |
384 | @param SrcPort The source UDP port number.\r | |
385 | @param HeaderSize An optional field which may be set to the length of a header at\r | |
386 | HeaderPtr to be prefixed to the data at BufferPtr. \r | |
387 | @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r | |
388 | data at BufferPtr. \r | |
389 | @param BufferSize A pointer to the size of the data at BufferPtr.\r | |
390 | @param BufferPtr A pointer to the data to be written.\r | |
391 | \r | |
392 | @retval EFI_SUCCESS The UDP Write operation was completed.\r | |
393 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
394 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r | |
395 | @retval EFI_BAD_BUFFER_SIZE The buffer is too long to be transmitted. \r | |
396 | @retval EFI_ABORTED The callback function aborted the UDP Write operation.\r | |
397 | @retval EFI_TIMEOUT The UDP Write operation timed out.\r | |
398 | @retval EFI_ICMP_ERROR An ICMP error packet was received during the UDP write session. \r | |
399 | \r | |
400 | **/\r | |
401 | typedef\r | |
402 | EFI_STATUS\r | |
403 | (EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE) (\r | |
404 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
405 | IN UINT16 OpFlags,\r | |
406 | IN EFI_IP_ADDRESS *DestIp,\r | |
407 | IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,\r | |
408 | IN EFI_IP_ADDRESS *GatewayIp, OPTIONAL\r | |
409 | IN EFI_IP_ADDRESS *SrcIp, OPTIONAL\r | |
410 | IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL\r | |
411 | IN UINTN *HeaderSize, OPTIONAL\r | |
412 | IN VOID *HeaderPtr, OPTIONAL\r | |
413 | IN UINTN *BufferSize,\r | |
414 | IN VOID *BufferPtr\r | |
415 | );\r | |
416 | \r | |
417 | /** \r | |
418 | Reads a UDP packet from the network interface.\r | |
419 | \r | |
420 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
421 | @param OpFlags The UDP operation flags. \r | |
422 | @param DestIp The destination IP address.\r | |
423 | @param DestPort The destination UDP port number. \r | |
424 | @param GatewayIp The gateway IP address. \r | |
425 | @param SrcIp The source IP address.\r | |
426 | @param SrcPort The source UDP port number.\r | |
427 | @param HeaderSize An optional field which may be set to the length of a header at\r | |
428 | HeaderPtr to be prefixed to the data at BufferPtr. \r | |
429 | @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r | |
430 | data at BufferPtr. \r | |
431 | @param BufferSize A pointer to the size of the data at BufferPtr.\r | |
432 | @param BufferPtr A pointer to the data to be read.\r | |
433 | \r | |
434 | @retval EFI_SUCCESS The UDP Write operation was completed.\r | |
435 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
436 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r | |
437 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r | |
438 | @retval EFI_BUFFER_TOO_SMALL The packet is larger than Buffer can hold.\r | |
439 | @retval EFI_ABORTED The callback function aborted the UDP Read operation.\r | |
440 | @retval EFI_TIMEOUT The UDP Read operation timed out. \r | |
441 | \r | |
442 | **/\r | |
443 | typedef\r | |
444 | EFI_STATUS\r | |
445 | (EFIAPI *EFI_PXE_BASE_CODE_UDP_READ) (\r | |
446 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
447 | IN UINT16 OpFlags,\r | |
448 | IN OUT EFI_IP_ADDRESS *DestIp, OPTIONAL\r | |
449 | IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, OPTIONAL\r | |
450 | IN OUT EFI_IP_ADDRESS *SrcIp, OPTIONAL\r | |
451 | IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL\r | |
452 | IN UINTN *HeaderSize, OPTIONAL\r | |
453 | IN VOID *HeaderPtr, OPTIONAL\r | |
454 | IN OUT UINTN *BufferSize,\r | |
455 | IN VOID *BufferPtr\r | |
456 | );\r | |
457 | \r | |
458 | /** \r | |
459 | Updates the IP receive filters of a network device and enables software filtering.\r | |
460 | \r | |
461 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
462 | @param NewFilter Pointer to the new set of IP receive filters.\r | |
463 | \r | |
464 | @retval EFI_SUCCESS The IP receive filter settings were updated.\r | |
465 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
466 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r | |
467 | \r | |
468 | **/\r | |
469 | typedef\r | |
470 | EFI_STATUS\r | |
471 | (EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER) (\r | |
472 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
473 | IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter\r | |
474 | );\r | |
475 | \r | |
476 | /** \r | |
477 | Uses the ARP protocol to resolve a MAC address.\r | |
478 | \r | |
479 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
480 | @param IpAddr Pointer to the IP address that is used to resolve a MAC address.\r | |
481 | @param MacAddr If not NULL, a pointer to the MAC address that was resolved with the\r | |
482 | ARP protocol. \r | |
483 | \r | |
484 | @retval EFI_SUCCESS The IP or MAC address was resolved.\r | |
485 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
486 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r | |
487 | @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r | |
488 | @retval EFI_ABORTED The callback function aborted the ARP Protocol.\r | |
489 | @retval EFI_TIMEOUT The ARP Protocol encountered a timeout condition.\r | |
490 | \r | |
491 | **/\r | |
492 | typedef\r | |
493 | EFI_STATUS\r | |
494 | (EFIAPI *EFI_PXE_BASE_CODE_ARP) (\r | |
495 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
496 | IN EFI_IP_ADDRESS *IpAddr,\r | |
497 | IN EFI_MAC_ADDRESS *MacAddr OPTIONAL\r | |
498 | );\r | |
499 | \r | |
500 | /** \r | |
501 | Updates the parameters that affect the operation of the PXE Base Code Protocol.\r | |
502 | \r | |
503 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
504 | @param NewAutoArp If not NULL, a pointer to a value that specifies whether to replace the\r | |
505 | current value of AutoARP. \r | |
506 | @param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the\r | |
507 | current value of SendGUID. \r | |
508 | @param NewTTL If not NULL, a pointer to be used in place of the current value of TTL,\r | |
511710d6 | 509 | the "time to live" field of the IP header. \r |
878ddf1f | 510 | @param NewToS If not NULL, a pointer to be used in place of the current value of ToS,\r |
511710d6 | 511 | the "type of service" field of the IP header. \r |
878ddf1f | 512 | @param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the\r |
513 | current value of the MakeCallback field of the Mode structure. \r | |
514 | \r | |
515 | @retval EFI_SUCCESS The new parameters values were updated.\r | |
516 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
517 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r | |
518 | \r | |
519 | **/\r | |
520 | typedef\r | |
521 | EFI_STATUS\r | |
522 | (EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS) (\r | |
523 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
524 | IN BOOLEAN *NewAutoArp, OPTIONAL\r | |
525 | IN BOOLEAN *NewSendGUID, OPTIONAL\r | |
526 | IN UINT8 *NewTTL, OPTIONAL\r | |
527 | IN UINT8 *NewToS, OPTIONAL\r | |
528 | IN BOOLEAN *NewMakeCallback OPTIONAL\r | |
529 | );\r | |
530 | \r | |
531 | /** \r | |
532 | Updates the station IP address and/or subnet mask values of a network device.\r | |
533 | \r | |
534 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
535 | @param NewStationIp Pointer to the new IP address to be used by the network device. \r | |
536 | @param NewSubnetMask Pointer to the new subnet mask to be used by the network device. \r | |
537 | \r | |
538 | @retval EFI_SUCCESS The new station IP address and/or subnet mask were updated.\r | |
539 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
540 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r | |
541 | \r | |
542 | **/\r | |
543 | typedef\r | |
544 | EFI_STATUS\r | |
545 | (EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP) (\r | |
546 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
547 | IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL\r | |
548 | IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL\r | |
549 | );\r | |
550 | \r | |
551 | /** \r | |
552 | Updates the contents of the cached DHCP and Discover packets.\r | |
553 | \r | |
554 | @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r | |
555 | @param NewDhcpDiscoverValid Pointer to a value that will replace the current\r | |
556 | DhcpDiscoverValid field. \r | |
557 | @param NewDhcpAckReceived Pointer to a value that will replace the current\r | |
558 | DhcpAckReceived field. \r | |
559 | @param NewProxyOfferReceived Pointer to a value that will replace the current\r | |
560 | ProxyOfferReceived field. \r | |
561 | @param NewPxeDiscoverValid Pointer to a value that will replace the current \r | |
562 | ProxyOfferReceived field. \r | |
563 | @param NewPxeReplyReceived Pointer to a value that will replace the current\r | |
564 | PxeReplyReceived field. \r | |
565 | @param NewPxeBisReplyReceived Pointer to a value that will replace the current\r | |
566 | PxeBisReplyReceived field. \r | |
567 | @param NewDhcpDiscover Pointer to the new cached DHCP Discover packet contents. \r | |
568 | @param NewDhcpAck Pointer to the new cached DHCP Ack packet contents.\r | |
569 | @param NewProxyOffer Pointer to the new cached Proxy Offer packet contents.\r | |
570 | @param NewPxeDiscover Pointer to the new cached PXE Discover packet contents.\r | |
571 | @param NewPxeReply Pointer to the new cached PXE Reply packet contents.\r | |
572 | @param NewPxeBisReply Pointer to the new cached PXE BIS Reply packet contents.\r | |
573 | \r | |
574 | @retval EFI_SUCCESS The cached packet contents were updated.\r | |
575 | @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r | |
576 | @retval EFI_INVALID_PARAMETER This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.\r | |
577 | \r | |
578 | **/\r | |
579 | typedef\r | |
580 | EFI_STATUS\r | |
581 | (EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS) (\r | |
582 | IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r | |
583 | BOOLEAN *NewDhcpDiscoverValid, OPTIONAL\r | |
584 | BOOLEAN *NewDhcpAckReceived, OPTIONAL\r | |
585 | BOOLEAN *NewProxyOfferReceived, OPTIONAL\r | |
586 | BOOLEAN *NewPxeDiscoverValid, OPTIONAL\r | |
587 | BOOLEAN *NewPxeReplyReceived, OPTIONAL\r | |
588 | BOOLEAN *NewPxeBisReplyReceived, OPTIONAL\r | |
589 | IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, OPTIONAL\r | |
590 | IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, OPTIONAL\r | |
591 | IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, OPTIONAL\r | |
592 | IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, OPTIONAL\r | |
593 | IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, OPTIONAL\r | |
594 | IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL\r | |
595 | );\r | |
596 | \r | |
597 | //\r | |
598 | // PXE Base Code Protocol structure\r | |
599 | //\r | |
600 | #define EFI_PXE_BASE_CODE_INTERFACE_REVISION 0x00010000\r | |
601 | #define EFI_PXE_BASE_CODE_PROTOCOL_REVISION EFI_PXE_BASE_CODE_INTERFACE_REVISION\r | |
602 | \r | |
603 | struct _EFI_PXE_BASE_CODE_PROTOCOL {\r | |
604 | UINT64 Revision;\r | |
605 | EFI_PXE_BASE_CODE_START Start;\r | |
606 | EFI_PXE_BASE_CODE_STOP Stop;\r | |
607 | EFI_PXE_BASE_CODE_DHCP Dhcp;\r | |
608 | EFI_PXE_BASE_CODE_DISCOVER Discover;\r | |
609 | EFI_PXE_BASE_CODE_MTFTP Mtftp;\r | |
610 | EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;\r | |
611 | EFI_PXE_BASE_CODE_UDP_READ UdpRead;\r | |
612 | EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;\r | |
613 | EFI_PXE_BASE_CODE_ARP Arp;\r | |
614 | EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;\r | |
615 | EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;\r | |
616 | EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;\r | |
617 | EFI_PXE_BASE_CODE_MODE *Mode;\r | |
618 | };\r | |
619 | \r | |
620 | extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;\r | |
621 | \r | |
622 | #endif \r |