]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/Mtftp4.h
MdePkg FirmwareManagement.h: Fix typo EFI_SECURITY_VIOLATIO
[mirror_edk2.git] / MdePkg / Include / Protocol / Mtftp4.h
... / ...
CommitLineData
1/** @file\r
2 EFI Multicast Trivial File Transfer Protocol Definition\r
3\r
4Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials are licensed and made available under \r
6the terms and conditions of the BSD License that accompanies this distribution. \r
7The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php. \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 @par Revision Reference:\r
14 This Protocol is introduced in UEFI Specification 2.0\r
15\r
16**/\r
17\r
18#ifndef __EFI_MTFTP4_PROTOCOL_H__\r
19#define __EFI_MTFTP4_PROTOCOL_H__\r
20\r
21#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \\r
22 { \\r
23 0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \\r
24 }\r
25\r
26#define EFI_MTFTP4_PROTOCOL_GUID \\r
27 { \\r
28 0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b } \\r
29 }\r
30\r
31typedef struct _EFI_MTFTP4_PROTOCOL EFI_MTFTP4_PROTOCOL;\r
32typedef struct _EFI_MTFTP4_TOKEN EFI_MTFTP4_TOKEN;\r
33\r
34//\r
35//MTFTP4 packet opcode definition\r
36//\r
37#define EFI_MTFTP4_OPCODE_RRQ 1\r
38#define EFI_MTFTP4_OPCODE_WRQ 2\r
39#define EFI_MTFTP4_OPCODE_DATA 3\r
40#define EFI_MTFTP4_OPCODE_ACK 4\r
41#define EFI_MTFTP4_OPCODE_ERROR 5\r
42#define EFI_MTFTP4_OPCODE_OACK 6\r
43#define EFI_MTFTP4_OPCODE_DIR 7\r
44#define EFI_MTFTP4_OPCODE_DATA8 8\r
45#define EFI_MTFTP4_OPCODE_ACK8 9\r
46\r
47//\r
48// MTFTP4 error code definition\r
49//\r
50#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED 0\r
51#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND 1\r
52#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION 2\r
53#define EFI_MTFTP4_ERRORCODE_DISK_FULL 3\r
54#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION 4\r
55#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID 5\r
56#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS 6\r
57#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER 7\r
58#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED 8\r
59\r
60//\r
61// MTFTP4 pacekt definitions\r
62//\r
63#pragma pack(1)\r
64\r
65typedef struct {\r
66 UINT16 OpCode;\r
67 UINT8 Filename[1];\r
68} EFI_MTFTP4_REQ_HEADER;\r
69\r
70typedef struct {\r
71 UINT16 OpCode;\r
72 UINT8 Data[1];\r
73} EFI_MTFTP4_OACK_HEADER;\r
74\r
75typedef struct {\r
76 UINT16 OpCode;\r
77 UINT16 Block;\r
78 UINT8 Data[1];\r
79} EFI_MTFTP4_DATA_HEADER;\r
80\r
81typedef struct {\r
82 UINT16 OpCode;\r
83 UINT16 Block[1];\r
84} EFI_MTFTP4_ACK_HEADER;\r
85\r
86typedef struct {\r
87 UINT16 OpCode;\r
88 UINT64 Block;\r
89 UINT8 Data[1];\r
90} EFI_MTFTP4_DATA8_HEADER;\r
91\r
92typedef struct {\r
93 UINT16 OpCode;\r
94 UINT64 Block[1];\r
95} EFI_MTFTP4_ACK8_HEADER;\r
96\r
97typedef struct {\r
98 UINT16 OpCode;\r
99 UINT16 ErrorCode;\r
100 UINT8 ErrorMessage[1];\r
101} EFI_MTFTP4_ERROR_HEADER;\r
102\r
103typedef union {\r
104 ///\r
105 /// Type of packets as defined by the MTFTPv4 packet opcodes.\r
106 ///\r
107 UINT16 OpCode;\r
108 ///\r
109 /// Read request packet header.\r
110 ///\r
111 EFI_MTFTP4_REQ_HEADER Rrq;\r
112 ///\r
113 /// Write request packet header.\r
114 ///\r
115 EFI_MTFTP4_REQ_HEADER Wrq;\r
116 ///\r
117 /// Option acknowledge packet header.\r
118 ///\r
119 EFI_MTFTP4_OACK_HEADER Oack;\r
120 ///\r
121 /// Data packet header.\r
122 ///\r
123 EFI_MTFTP4_DATA_HEADER Data;\r
124 ///\r
125 /// Acknowledgement packet header.\r
126 ///\r
127 EFI_MTFTP4_ACK_HEADER Ack;\r
128 ///\r
129 /// Data packet header with big block number.\r
130 ///\r
131 EFI_MTFTP4_DATA8_HEADER Data8;\r
132 ///\r
133 /// Acknowledgement header with big block num.\r
134 ///\r
135 EFI_MTFTP4_ACK8_HEADER Ack8;\r
136 ///\r
137 /// Error packet header.\r
138 ///\r
139 EFI_MTFTP4_ERROR_HEADER Error;\r
140} EFI_MTFTP4_PACKET;\r
141\r
142#pragma pack()\r
143\r
144///\r
145/// MTFTP4 option definition.\r
146///\r
147typedef struct {\r
148 UINT8 *OptionStr;\r
149 UINT8 *ValueStr;\r
150} EFI_MTFTP4_OPTION;\r
151\r
152\r
153typedef struct {\r
154 BOOLEAN UseDefaultSetting;\r
155 EFI_IPv4_ADDRESS StationIp;\r
156 EFI_IPv4_ADDRESS SubnetMask;\r
157 UINT16 LocalPort;\r
158 EFI_IPv4_ADDRESS GatewayIp;\r
159 EFI_IPv4_ADDRESS ServerIp;\r
160 UINT16 InitialServerPort;\r
161 UINT16 TryCount;\r
162 UINT16 TimeoutValue;\r
163} EFI_MTFTP4_CONFIG_DATA;\r
164\r
165\r
166typedef struct {\r
167 EFI_MTFTP4_CONFIG_DATA ConfigData;\r
168 UINT8 SupportedOptionCount;\r
169 UINT8 **SupportedOptoins;\r
170 UINT8 UnsupportedOptionCount;\r
171 UINT8 **UnsupportedOptoins;\r
172} EFI_MTFTP4_MODE_DATA;\r
173\r
174\r
175typedef struct {\r
176 EFI_IPv4_ADDRESS GatewayIp;\r
177 EFI_IPv4_ADDRESS ServerIp;\r
178 UINT16 ServerPort;\r
179 UINT16 TryCount;\r
180 UINT16 TimeoutValue;\r
181} EFI_MTFTP4_OVERRIDE_DATA;\r
182\r
183//\r
184// Protocol interfaces definition\r
185//\r
186\r
187/**\r
188 A callback function that is provided by the caller to intercept\r
189 the EFI_MTFTP4_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the\r
190 EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept\r
191 EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to\r
192 EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory().\r
193\r
194 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
195 @param Token The token that the caller provided in the\r
196 EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile()\r
197 or ReadDirectory() function.\r
198 @param PacketLen Indicates the length of the packet.\r
199 @param Packet The pointer to an MTFTPv4 packet.\r
200\r
201 @retval EFI_SUCCESS The operation was successful.\r
202 @retval Others Aborts the transfer process.\r
203\r
204**/\r
205typedef\r
206EFI_STATUS\r
207(EFIAPI *EFI_MTFTP4_CHECK_PACKET)(\r
208 IN EFI_MTFTP4_PROTOCOL *This,\r
209 IN EFI_MTFTP4_TOKEN *Token,\r
210 IN UINT16 PacketLen,\r
211 IN EFI_MTFTP4_PACKET *Paket\r
212 );\r
213\r
214/**\r
215 Timeout callback function.\r
216\r
217 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
218 @param Token The token that is provided in the\r
219 EFI_MTFTP4_PROTOCOL.ReadFile() or\r
220 EFI_MTFTP4_PROTOCOL.WriteFile() or\r
221 EFI_MTFTP4_PROTOCOL.ReadDirectory() functions\r
222 by the caller.\r
223\r
224 @retval EFI_SUCCESS The operation was successful.\r
225 @retval Others Aborts download process.\r
226\r
227**/\r
228typedef\r
229EFI_STATUS\r
230(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK)(\r
231 IN EFI_MTFTP4_PROTOCOL *This,\r
232 IN EFI_MTFTP4_TOKEN *Token\r
233 );\r
234\r
235/**\r
236 A callback function that the caller provides to feed data to the\r
237 EFI_MTFTP4_PROTOCOL.WriteFile() function.\r
238\r
239 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
240 @param Token The token provided in the\r
241 EFI_MTFTP4_PROTOCOL.WriteFile() by the caller.\r
242 @param Length Indicates the length of the raw data wanted on input, and the\r
243 length the data available on output.\r
244 @param Buffer The pointer to the buffer where the data is stored.\r
245\r
246 @retval EFI_SUCCESS The operation was successful.\r
247 @retval Others Aborts session.\r
248\r
249**/\r
250typedef\r
251EFI_STATUS\r
252(EFIAPI *EFI_MTFTP4_PACKET_NEEDED)(\r
253 IN EFI_MTFTP4_PROTOCOL *This,\r
254 IN EFI_MTFTP4_TOKEN *Token,\r
255 IN OUT UINT16 *Length,\r
256 OUT VOID **Buffer\r
257 );\r
258\r
259\r
260/**\r
261 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
262\r
263 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
264 @param ModeData The pointer to storage for the EFI MTFTPv4 Protocol driver mode data.\r
265\r
266 @retval EFI_SUCCESS The configuration data was successfully returned.\r
267 @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.\r
268 @retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.\r
269\r
270**/\r
271typedef\r
272EFI_STATUS\r
273(EFIAPI *EFI_MTFTP4_GET_MODE_DATA)(\r
274 IN EFI_MTFTP4_PROTOCOL *This,\r
275 OUT EFI_MTFTP4_MODE_DATA *ModeData\r
276 );\r
277\r
278\r
279/**\r
280 Initializes, changes, or resets the default operational setting for this\r
281 EFI MTFTPv4 Protocol driver instance.\r
282\r
283 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
284 @param MtftpConfigData The pointer to the configuration data structure.\r
285\r
286 @retval EFI_SUCCESS The EFI MTFTPv4 Protocol driver was configured successfully.\r
287 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
288 @retval EFI_ACCESS_DENIED The EFI configuration could not be changed at this time because\r
289 there is one MTFTP background operation in progress.\r
290 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
291 RARP, etc.) has not finished yet.\r
292 @retval EFI_UNSUPPORTED A configuration protocol (DHCP, BOOTP, RARP, etc.) could not\r
293 be located when clients choose to use the default address\r
294 settings.\r
295 @retval EFI_OUT_OF_RESOURCES The EFI MTFTPv4 Protocol driver instance data could not be\r
296 allocated.\r
297 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI\r
298 MTFTPv4 Protocol driver instance is not configured.\r
299\r
300**/\r
301typedef\r
302EFI_STATUS\r
303(EFIAPI *EFI_MTFTP4_CONFIGURE)(\r
304 IN EFI_MTFTP4_PROTOCOL *This,\r
305 IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL\r
306 );\r
307\r
308\r
309/**\r
310 Gets information about a file from an MTFTPv4 server.\r
311\r
312 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
313 @param OverrideData Data that is used to override the existing parameters. If NULL,\r
314 the default parameters that were set in the\r
315 EFI_MTFTP4_PROTOCOL.Configure() function are used.\r
316 @param Filename The pointer to null-terminated ASCII file name string.\r
317 @param ModeStr The pointer to null-terminated ASCII mode string. If NULL, "octet" will be used.\r
318 @param OptionCount Number of option/value string pairs in OptionList.\r
319 @param OptionList The pointer to array of option/value string pairs. Ignored if\r
320 OptionCount is zero.\r
321 @param PacketLength The number of bytes in the returned packet.\r
322 @param Packet The pointer to the received packet. This buffer must be freed by\r
323 the caller.\r
324\r
325 @retval EFI_SUCCESS An MTFTPv4 OACK packet was received and is in the Packet.\r
326 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
327 - This is NULL.\r
328 - Filename is NULL.\r
329 - OptionCount is not zero and OptionList is NULL.\r
330 - One or more options in OptionList have wrong format.\r
331 - PacketLength is NULL.\r
332 - One or more IPv4 addresses in OverrideData are not valid\r
333 unicast IPv4 addresses if OverrideData is not NULL.\r
334 @retval EFI_UNSUPPORTED One or more options in the OptionList are in the\r
335 unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
336 @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.\r
337 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
338 RARP, etc.) has not finished yet.\r
339 @retval EFI_ACCESS_DENIED The previous operation has not completed yet.\r
340 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
341 @retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received and is in the Packet.\r
342 @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received and the Packet is set to NULL.\r
343 @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received and the Packet is set to NULL.\r
344 @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received and the Packet is set to NULL.\r
345 @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received and the Packet is set to NULL.\r
346 @retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received and is in the Buffer.\r
347 @retval EFI_PROTOCOL_ERROR An unexpected MTFTPv4 packet was received and is in the Packet.\r
348 @retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.\r
349 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
350 @retval EFI_NO_MEDIA There was a media error.\r
351\r
352**/\r
353typedef\r
354EFI_STATUS\r
355(EFIAPI *EFI_MTFTP4_GET_INFO)(\r
356 IN EFI_MTFTP4_PROTOCOL *This,\r
357 IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL,\r
358 IN UINT8 *Filename,\r
359 IN UINT8 *ModeStr OPTIONAL,\r
360 IN UINT8 OptionCount,\r
361 IN EFI_MTFTP4_OPTION *OptionList,\r
362 OUT UINT32 *PacketLength,\r
363 OUT EFI_MTFTP4_PACKET **Packet OPTIONAL\r
364 );\r
365\r
366/**\r
367 Parses the options in an MTFTPv4 OACK packet.\r
368\r
369 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
370 @param PacketLen Length of the OACK packet to be parsed.\r
371 @param Packet The pointer to the OACK packet to be parsed.\r
372 @param OptionCount The pointer to the number of options in following OptionList.\r
373 @param OptionList The pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot\r
374 Service FreePool() to release the OptionList if the options\r
375 in this OptionList are not needed any more.\r
376\r
377 @retval EFI_SUCCESS The OACK packet was valid and the OptionCount and\r
378 OptionList parameters have been updated.\r
379 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
380 - PacketLen is 0.\r
381 - Packet is NULL or Packet is not a valid MTFTPv4 packet.\r
382 - OptionCount is NULL.\r
383 @retval EFI_NOT_FOUND No options were found in the OACK packet.\r
384 @retval EFI_OUT_OF_RESOURCES Storage for the OptionList array cannot be allocated.\r
385 @retval EFI_PROTOCOL_ERROR One or more of the option fields is invalid.\r
386\r
387**/\r
388typedef\r
389EFI_STATUS\r
390(EFIAPI *EFI_MTFTP4_PARSE_OPTIONS)(\r
391 IN EFI_MTFTP4_PROTOCOL *This,\r
392 IN UINT32 PacketLen,\r
393 IN EFI_MTFTP4_PACKET *Packet,\r
394 OUT UINT32 *OptionCount,\r
395 OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL\r
396 );\r
397\r
398\r
399/**\r
400 Downloads a file from an MTFTPv4 server.\r
401\r
402 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
403 @param Token The pointer to the token structure to provide the parameters that are\r
404 used in this operation.\r
405\r
406 @retval EFI_SUCCESS The data file has been transferred successfully.\r
407 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
408 @retval EFI_BUFFER_TOO_SMALL BufferSize is not zero but not large enough to hold the\r
409 downloaded data in downloading process.\r
410 @retval EFI_ABORTED Current operation is aborted by user.\r
411 @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received.\r
412 @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received.\r
413 @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received.\r
414 @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received.\r
415 @retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received.\r
416 @retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.\r
417 @retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received.\r
418 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
419 @retval EFI_NO_MEDIA There was a media error.\r
420\r
421**/\r
422typedef\r
423EFI_STATUS\r
424(EFIAPI *EFI_MTFTP4_READ_FILE)(\r
425 IN EFI_MTFTP4_PROTOCOL *This,\r
426 IN EFI_MTFTP4_TOKEN *Token\r
427 );\r
428\r
429\r
430\r
431/**\r
432 Sends a file to an MTFTPv4 server.\r
433\r
434 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
435 @param Token The pointer to the token structure to provide the parameters that are\r
436 used in this operation.\r
437\r
438 @retval EFI_SUCCESS The upload session has started.\r
439 @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r
440 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
441 @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in\r
442 the unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
443 @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.\r
444 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
445 RARP, etc.) is not finished yet.\r
446 @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.\r
447 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
448 @retval EFI_ACCESS_DENIED The previous operation has not completed yet.\r
449 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
450\r
451**/\r
452typedef\r
453EFI_STATUS\r
454(EFIAPI *EFI_MTFTP4_WRITE_FILE)(\r
455 IN EFI_MTFTP4_PROTOCOL *This,\r
456 IN EFI_MTFTP4_TOKEN *Token\r
457 );\r
458\r
459\r
460/**\r
461 Downloads a data file "directory" from an MTFTPv4 server. May be unsupported in some EFI\r
462 implementations.\r
463\r
464 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
465 @param Token The pointer to the token structure to provide the parameters that are\r
466 used in this operation.\r
467\r
468 @retval EFI_SUCCESS The MTFTPv4 related file "directory" has been downloaded.\r
469 @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r
470 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
471 @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in\r
472 the unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
473 @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.\r
474 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
475 RARP, etc.) is not finished yet.\r
476 @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.\r
477 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
478 @retval EFI_ACCESS_DENIED The previous operation has not completed yet.\r
479 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
480\r
481**/\r
482typedef\r
483EFI_STATUS\r
484(EFIAPI *EFI_MTFTP4_READ_DIRECTORY)(\r
485 IN EFI_MTFTP4_PROTOCOL *This,\r
486 IN EFI_MTFTP4_TOKEN *Token\r
487 );\r
488\r
489/**\r
490 Polls for incoming data packets and processes outgoing data packets.\r
491\r
492 @param This The pointer to the EFI_MTFTP4_PROTOCOL instance.\r
493\r
494 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
495 @retval EFI_NOT_STARTED This EFI MTFTPv4 Protocol instance has not been started.\r
496 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
497 RARP, etc.) is not finished yet.\r
498 @retval EFI_INVALID_PARAMETER This is NULL.\r
499 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
500 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r
501 Consider increasing the polling rate.\r
502\r
503**/\r
504typedef\r
505EFI_STATUS\r
506(EFIAPI *EFI_MTFTP4_POLL)(\r
507 IN EFI_MTFTP4_PROTOCOL *This\r
508 );\r
509\r
510///\r
511/// The EFI_MTFTP4_PROTOCOL is designed to be used by UEFI drivers and applications\r
512/// to transmit and receive data files. The EFI MTFTPv4 Protocol driver uses\r
513/// the underlying EFI UDPv4 Protocol driver and EFI IPv4 Protocol driver.\r
514///\r
515struct _EFI_MTFTP4_PROTOCOL {\r
516 EFI_MTFTP4_GET_MODE_DATA GetModeData;\r
517 EFI_MTFTP4_CONFIGURE Configure;\r
518 EFI_MTFTP4_GET_INFO GetInfo;\r
519 EFI_MTFTP4_PARSE_OPTIONS ParseOptions;\r
520 EFI_MTFTP4_READ_FILE ReadFile;\r
521 EFI_MTFTP4_WRITE_FILE WriteFile;\r
522 EFI_MTFTP4_READ_DIRECTORY ReadDirectory;\r
523 EFI_MTFTP4_POLL Poll;\r
524};\r
525\r
526struct _EFI_MTFTP4_TOKEN {\r
527 ///\r
528 /// The status that is returned to the caller at the end of the operation\r
529 /// to indicate whether this operation completed successfully.\r
530 ///\r
531 EFI_STATUS Status;\r
532 ///\r
533 /// The event that will be signaled when the operation completes. If\r
534 /// set to NULL, the corresponding function will wait until the read or\r
535 /// write operation finishes. The type of Event must be\r
536 /// EVT_NOTIFY_SIGNAL. The Task Priority Level (TPL) of\r
537 /// Event must be lower than or equal to TPL_CALLBACK.\r
538 ///\r
539 EFI_EVENT Event;\r
540 ///\r
541 /// If not NULL, the data that will be used to override the existing configure data.\r
542 ///\r
543 EFI_MTFTP4_OVERRIDE_DATA *OverrideData;\r
544 ///\r
545 /// The pointer to the null-terminated ASCII file name string.\r
546 ///\r
547 UINT8 *Filename;\r
548 ///\r
549 /// The pointer to the null-terminated ASCII mode string. If NULL, "octet" is used.\r
550 ///\r
551 UINT8 *ModeStr;\r
552 ///\r
553 /// Number of option/value string pairs.\r
554 ///\r
555 UINT32 OptionCount;\r
556 ///\r
557 /// The pointer to an array of option/value string pairs. Ignored if OptionCount is zero.\r
558 ///\r
559 EFI_MTFTP4_OPTION *OptionList;\r
560 ///\r
561 /// The size of the data buffer.\r
562 ///\r
563 UINT64 BufferSize;\r
564 ///\r
565 /// The pointer to the data buffer. Data that is downloaded from the\r
566 /// MTFTPv4 server is stored here. Data that is uploaded to the\r
567 /// MTFTPv4 server is read from here. Ignored if BufferSize is zero.\r
568 ///\r
569 VOID *Buffer;\r
570 ///\r
571 /// The pointer to the context that will be used by CheckPacket,\r
572 /// TimeoutCallback and PacketNeeded.\r
573 ///\r
574 VOID *Context;\r
575 ///\r
576 /// The pointer to the callback function to check the contents of the received packet.\r
577 ///\r
578 EFI_MTFTP4_CHECK_PACKET CheckPacket;\r
579 ///\r
580 /// The pointer to the function to be called when a timeout occurs.\r
581 ///\r
582 EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback;\r
583 ///\r
584 /// The pointer to the function to provide the needed packet contents.\r
585 ///\r
586 EFI_MTFTP4_PACKET_NEEDED PacketNeeded;\r
587};\r
588\r
589extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;\r
590extern EFI_GUID gEfiMtftp4ProtocolGuid;\r
591\r
592#endif\r
593\r