]>
Commit | Line | Data |
---|---|---|
badd7e61 | 1 | /** @file\r |
2 | EFI FTPv4 (File Transfer Protocol version 4) Protocol Definition\r | |
9095d37b | 3 | The EFI FTPv4 Protocol is used to locate communication devices that are\r |
badd7e61 | 4 | supported by an EFI FTPv4 Protocol driver and to create and destroy instances\r |
5 | of the EFI FTPv4 Protocol child protocol driver that can use the underlying\r | |
6 | communication device.\r | |
7 | The definitions in this file are defined in UEFI Specification 2.3, which have\r | |
8 | not been verified by one implementation yet.\r | |
9 | \r | |
9095d37b | 10 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 11 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
badd7e61 | 12 | \r |
9095d37b | 13 | @par Revision Reference:\r |
5899caf0 | 14 | This Protocol is introduced in UEFI Specification 2.2\r |
15 | \r | |
badd7e61 | 16 | **/\r |
17 | \r | |
18 | #ifndef __EFI_FTP4_PROTOCOL_H__\r | |
19 | #define __EFI_FTP4_PROTOCOL_H__\r | |
20 | \r | |
21 | \r | |
22 | #define EFI_FTP4_SERVICE_BINDING_PROTOCOL_GUID \\r | |
23 | { \\r | |
24 | 0xfaaecb1, 0x226e, 0x4782, {0xaa, 0xce, 0x7d, 0xb9, 0xbc, 0xbf, 0x4d, 0xaf } \\r | |
25 | }\r | |
26 | \r | |
27 | #define EFI_FTP4_PROTOCOL_GUID \\r | |
28 | { \\r | |
29 | 0xeb338826, 0x681b, 0x4295, {0xb3, 0x56, 0x2b, 0x36, 0x4c, 0x75, 0x7b, 0x9 } \\r | |
30 | }\r | |
31 | \r | |
32 | typedef struct _EFI_FTP4_PROTOCOL EFI_FTP4_PROTOCOL;\r | |
33 | \r | |
34 | ///\r | |
35 | /// EFI_FTP4_CONNECTION_TOKEN\r | |
36 | ///\r | |
37 | typedef struct {\r | |
9095d37b LG |
38 | ///\r |
39 | /// The Event to signal after the connection is established and Status field is updated\r | |
40 | /// by the EFI FTP v4 Protocol driver. The type of Event must be\r | |
41 | /// EVENT_NOTIFY_SIGNAL, and its Task Priority Level (TPL) must be lower than or\r | |
42 | /// equal to TPL_CALLBACK. If it is set to NULL, this function will not return until the\r | |
badd7e61 | 43 | /// function completes.\r |
9095d37b LG |
44 | ///\r |
45 | EFI_EVENT Event;\r | |
badd7e61 | 46 | ///\r |
47 | /// The variable to receive the result of the completed operation.\r | |
48 | /// EFI_SUCCESS: The FTP connection is established successfully\r | |
9095d37b LG |
49 | /// EFI_ACCESS_DENIED: The FTP server denied the access the user's request to access it.\r |
50 | /// EFI_CONNECTION_RESET: The connect fails because the connection is reset either by instance\r | |
badd7e61 | 51 | /// itself or communication peer.\r |
9095d37b | 52 | /// EFI_TIMEOUT: The connection establishment timer expired and no more specific\r |
badd7e61 | 53 | /// information is available.\r |
9095d37b LG |
54 | /// EFI_NETWORK_UNREACHABLE: The active open fails because an ICMP network unreachable error is\r |
55 | /// received.\r | |
56 | /// EFI_HOST_UNREACHABLE: The active open fails because an ICMP host unreachable error is\r | |
57 | /// received.\r | |
58 | /// EFI_PROTOCOL_UNREACHABLE: The active open fails because an ICMP protocol unreachable error is\r | |
badd7e61 | 59 | /// received.\r |
9095d37b | 60 | /// EFI_PORT_UNREACHABLE: The connection establishment timer times out and an ICMP port\r |
badd7e61 | 61 | /// unreachable error is received.\r |
9095d37b | 62 | /// EFI_ICMP_ERROR: The connection establishment timer timeout and some other ICMP\r |
badd7e61 | 63 | /// error is received.\r |
64 | /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r | |
9095d37b | 65 | ///\r |
badd7e61 | 66 | EFI_STATUS Status;\r |
67 | } EFI_FTP4_CONNECTION_TOKEN;\r | |
68 | \r | |
69 | ///\r | |
9095d37b | 70 | /// EFI_FTP4_CONFIG_DATA\r |
badd7e61 | 71 | ///\r |
72 | typedef struct {\r | |
9095d37b LG |
73 | ///\r |
74 | /// Pointer to a ASCII string that contains user name. The caller is\r | |
badd7e61 | 75 | /// responsible for freeing Username after GetModeData() is called.\r |
9095d37b | 76 | ///\r |
badd7e61 | 77 | UINT8 *Username;\r |
9095d37b LG |
78 | ///\r |
79 | /// Pointer to a ASCII string that contains password. The caller is\r | |
badd7e61 | 80 | /// responsible for freeing Password after GetModeData() is called.\r |
9095d37b | 81 | ///\r |
badd7e61 | 82 | UINT8 *Password;\r |
9095d37b LG |
83 | ///\r |
84 | /// Set it to TRUE to initiate an active data connection. Set it to\r | |
badd7e61 | 85 | /// FALSE to initiate a passive data connection.\r |
9095d37b | 86 | ///\r |
badd7e61 | 87 | BOOLEAN Active;\r |
9095d37b | 88 | ///\r |
badd7e61 | 89 | /// Boolean value indicating if default network settting used.\r |
9095d37b | 90 | ///\r |
badd7e61 | 91 | BOOLEAN UseDefaultSetting;\r |
9095d37b | 92 | ///\r |
badd7e61 | 93 | /// IP address of station if UseDefaultSetting is FALSE.\r |
9095d37b | 94 | ///\r |
badd7e61 | 95 | EFI_IPv4_ADDRESS StationIp;\r |
9095d37b | 96 | ///\r |
badd7e61 | 97 | /// Subnet mask of station if UseDefaultSetting is FALSE.\r |
9095d37b | 98 | ///\r |
badd7e61 | 99 | EFI_IPv4_ADDRESS SubnetMask;\r |
9095d37b | 100 | ///\r |
badd7e61 | 101 | /// IP address of gateway if UseDefaultSetting is FALSE.\r |
9095d37b | 102 | ///\r |
badd7e61 | 103 | EFI_IPv4_ADDRESS GatewayIp;\r |
9095d37b | 104 | ///\r |
badd7e61 | 105 | /// IP address of FTPv4 server.\r |
9095d37b | 106 | ///\r |
badd7e61 | 107 | EFI_IPv4_ADDRESS ServerIp;\r |
9095d37b LG |
108 | ///\r |
109 | /// FTPv4 server port number of control connection, and the default\r | |
badd7e61 | 110 | /// value is 21 as convention.\r |
9095d37b | 111 | ///\r |
badd7e61 | 112 | UINT16 ServerPort;\r |
9095d37b LG |
113 | ///\r |
114 | /// FTPv4 server port number of data connection. If it is zero, use\r | |
115 | /// (ServerPort - 1) by convention.\r | |
116 | ///\r | |
badd7e61 | 117 | UINT16 AltDataPort;\r |
9095d37b LG |
118 | ///\r |
119 | /// A byte indicate the representation type. The right 4 bit is used for\r | |
badd7e61 | 120 | /// first parameter, the left 4 bit is use for second parameter\r |
121 | /// - For the first parameter, 0x0 = image, 0x1 = EBCDIC, 0x2 = ASCII, 0x3 = local\r | |
9095d37b | 122 | /// - For the second parameter, 0x0 = Non-print, 0x1 = Telnet format effectors, 0x2 =\r |
badd7e61 | 123 | /// Carriage Control.\r |
124 | /// - If it is a local type, the second parameter is the local byte byte size.\r | |
125 | /// - If it is a image type, the second parameter is undefined.\r | |
9095d37b | 126 | ///\r |
badd7e61 | 127 | UINT8 RepType;\r |
9095d37b | 128 | ///\r |
badd7e61 | 129 | /// Defines the file structure in FTP used. 0x00 = file, 0x01 = record, 0x02 = page.\r |
9095d37b | 130 | ///\r |
badd7e61 | 131 | UINT8 FileStruct;\r |
9095d37b | 132 | ///\r |
badd7e61 | 133 | /// Defines the transifer mode used in FTP. 0x00 = stream, 0x01 = Block, 0x02 = Compressed.\r |
9095d37b | 134 | ///\r |
badd7e61 | 135 | UINT8 TransMode;\r |
136 | } EFI_FTP4_CONFIG_DATA;\r | |
137 | \r | |
138 | typedef struct _EFI_FTP4_COMMAND_TOKEN EFI_FTP4_COMMAND_TOKEN;\r | |
139 | \r | |
140 | /**\r | |
141 | Callback function when process inbound or outbound data.\r | |
142 | \r | |
143 | If it is receiving function that leads to inbound data, the callback function\r | |
144 | is called when data buffer is full. Then, old data in the data buffer should be\r | |
145 | flushed and new data is stored from the beginning of data buffer.\r | |
9095d37b LG |
146 | If it is a transmit function that lead to outbound data and the size of\r |
147 | Data in daata buffer has been transmitted, this callback function is called to\r | |
148 | supply additional data to be transmitted.\r | |
badd7e61 | 149 | \r |
150 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
151 | @param[in] Token Pointer to the token structure to provide the parameters that\r | |
152 | are used in this operation.\r | |
153 | @return User defined Status.\r | |
154 | \r | |
155 | **/\r | |
156 | typedef\r | |
9095d37b LG |
157 | EFI_STATUS\r |
158 | (EFIAPI *EFI_FTP4_DATA_CALLBACK)(\r | |
badd7e61 | 159 | IN EFI_FTP4_PROTOCOL *This,\r |
160 | IN EFI_FTP4_COMMAND_TOKEN *Token\r | |
161 | );\r | |
162 | \r | |
163 | ///\r | |
164 | /// EFI_FTP4_COMMAND_TOKEN\r | |
165 | ///\r | |
166 | struct _EFI_FTP4_COMMAND_TOKEN {\r | |
9095d37b LG |
167 | ///\r |
168 | /// The Event to signal after request is finished and Status field\r | |
169 | /// is updated by the EFI FTP v4 Protocol driver. The type of Event\r | |
170 | /// must be EVT_NOTIFY_SIGNAL, and its Task Priority Level\r | |
171 | /// (TPL) must be lower than or equal to TPL_CALLBACK. If it is\r | |
172 | /// set to NULL, related function must wait until the function\r | |
badd7e61 | 173 | /// completes.\r |
9095d37b LG |
174 | ///\r |
175 | EFI_EVENT Event;\r | |
176 | ///\r | |
177 | /// Pointer to a null-terminated ASCII name string.\r | |
178 | ///\r | |
badd7e61 | 179 | UINT8 *Pathname;\r |
9095d37b | 180 | ///\r |
badd7e61 | 181 | /// The size of data buffer in bytes.\r |
9095d37b LG |
182 | ///\r |
183 | UINT64 DataBufferSize;\r | |
184 | ///\r | |
185 | /// Pointer to the data buffer. Data downloaded from FTP server\r | |
badd7e61 | 186 | /// through connection is downloaded here.\r |
9095d37b | 187 | ///\r |
badd7e61 | 188 | VOID *DataBuffer;\r |
9095d37b LG |
189 | ///\r |
190 | /// Pointer to a callback function. If it is receiving function that leads\r | |
191 | /// to inbound data, the callback function is called when databuffer is\r | |
192 | /// full. Then, old data in the data buffer should be flushed and new\r | |
193 | /// data is stored from the beginning of data buffer. If it is a transmit\r | |
194 | /// function that lead to outbound data and DataBufferSize of\r | |
195 | /// Data in DataBuffer has been transmitted, this callback\r | |
196 | /// function is called to supply additional data to be transmitted. The\r | |
197 | /// size of additional data to be transmitted is indicated in\r | |
198 | /// DataBufferSize, again. If there is no data remained,\r | |
badd7e61 | 199 | /// DataBufferSize should be set to 0.\r |
9095d37b | 200 | ///\r |
354a75f9 | 201 | EFI_FTP4_DATA_CALLBACK DataCallback;\r |
9095d37b | 202 | ///\r |
badd7e61 | 203 | /// Pointer to the parameter for DataCallback.\r |
9095d37b | 204 | ///\r |
badd7e61 | 205 | VOID *Context;\r |
9095d37b | 206 | ///\r |
badd7e61 | 207 | /// The variable to receive the result of the completed operation.\r |
208 | /// EFI_SUCCESS: The FTP command is completed successfully.\r | |
209 | /// EFI_ACCESS_DENIED: The FTP server denied the access to the requested file.\r | |
210 | /// EFI_CONNECTION_RESET: The connect fails because the connection is reset either\r | |
211 | /// by instance itself or communication peer.\r | |
9095d37b | 212 | /// EFI_TIMEOUT: The connection establishment timer expired and no more\r |
badd7e61 | 213 | /// specific information is available.\r |
214 | /// EFI_NETWORK_UNREACHABLE: The active open fails because an ICMP network unreachable\r | |
9095d37b | 215 | /// error is received.\r |
badd7e61 | 216 | /// EFI_HOST_UNREACHABLE: The active open fails because an ICMP host unreachable\r |
9095d37b | 217 | /// error is received.\r |
badd7e61 | 218 | /// EFI_PROTOCOL_UNREACHABLE: The active open fails because an ICMP protocol unreachable\r |
219 | /// error is received.\r | |
220 | /// EFI_PORT_UNREACHABLE: The connection establishment timer times out and an ICMP port\r | |
221 | /// unreachable error is received.\r | |
222 | /// EFI_ICMP_ERROR: The connection establishment timer timeout and some other ICMP\r | |
223 | /// error is received.\r | |
224 | /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r | |
225 | ///\r | |
226 | EFI_STATUS Status;\r | |
227 | };\r | |
228 | \r | |
229 | /**\r | |
230 | Gets the current operational settings.\r | |
231 | \r | |
232 | The GetModeData() function reads the current operational settings of this\r | |
9095d37b | 233 | EFI FTPv4 Protocol driver instance. EFI_FTP4_CONFIG_DATA is defined in the\r |
badd7e61 | 234 | EFI_FTP4_PROTOCOL.Configure.\r |
235 | \r | |
236 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
9095d37b | 237 | @param[out] ModeData Pointer to storage for the EFI FTPv4 Protocol driver\r |
badd7e61 | 238 | mode data. The string buffers for Username and Password\r |
239 | in EFI_FTP4_CONFIG_DATA are allocated by the function,\r | |
9095d37b | 240 | and the caller should take the responsibility to free the\r |
badd7e61 | 241 | buffer later.\r |
242 | \r | |
243 | @retval EFI_SUCCESS This function is called successfully.\r | |
244 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
245 | - This is NULL.\r | |
246 | - ModeData is NULL.\r | |
247 | @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started\r | |
248 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r | |
249 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
250 | \r | |
251 | **/\r | |
9095d37b LG |
252 | typedef\r |
253 | EFI_STATUS\r | |
badd7e61 | 254 | (EFIAPI *EFI_FTP4_GET_MODE_DATA)(\r |
255 | IN EFI_FTP4_PROTOCOL *This,\r | |
256 | OUT EFI_FTP4_CONFIG_DATA *ModeData\r | |
257 | );\r | |
258 | \r | |
259 | /**\r | |
260 | Disconnecting a FTP connection gracefully.\r | |
261 | \r | |
262 | The Connect() function will initiate a connection request to the remote FTP server\r | |
9095d37b | 263 | with the corresponding connection token. If this function returns EFI_SUCCESS, the\r |
badd7e61 | 264 | connection sequence is initiated successfully. If the connection succeeds or faild\r |
265 | due to any error, the Token->Event will be signaled and Token->Status will be updated\r | |
266 | accordingly.\r | |
267 | \r | |
268 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
269 | @param[in] Token Pointer to the token used to establish control connection.\r | |
270 | \r | |
271 | @retval EFI_SUCCESS The connection sequence is successfully initiated.\r | |
272 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
273 | - This is NULL.\r | |
274 | - Token is NULL.\r | |
275 | - Token->Event is NULL.\r | |
276 | @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r | |
9095d37b | 277 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r |
badd7e61 | 278 | RARP, etc.) is not finished yet.\r |
279 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r | |
280 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
281 | \r | |
282 | **/\r | |
283 | typedef\r | |
284 | EFI_STATUS\r | |
285 | (EFIAPI *EFI_FTP4_CONNECT)(\r | |
286 | IN EFI_FTP4_PROTOCOL *This,\r | |
287 | IN EFI_FTP4_CONNECTION_TOKEN *Token\r | |
288 | );\r | |
289 | \r | |
290 | /**\r | |
291 | Disconnecting a FTP connection gracefully.\r | |
292 | \r | |
293 | The Close() function will initiate a close request to the remote FTP server with the\r | |
9095d37b | 294 | corresponding connection token. If this function returns EFI_SUCCESS, the control\r |
badd7e61 | 295 | connection with the remote FTP server is closed.\r |
296 | \r | |
297 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
298 | @param[in] Token Pointer to the token used to close control connection.\r | |
299 | \r | |
300 | @retval EFI_SUCCESS The close request is successfully initiated.\r | |
301 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
302 | - This is NULL.\r | |
303 | - Token is NULL.\r | |
304 | - Token->Event is NULL.\r | |
305 | @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r | |
9095d37b | 306 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r |
badd7e61 | 307 | RARP, etc.) is not finished yet.\r |
308 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r | |
309 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
310 | \r | |
311 | **/\r | |
312 | typedef\r | |
313 | EFI_STATUS\r | |
314 | (EFIAPI *EFI_FTP4_CLOSE)(\r | |
315 | IN EFI_FTP4_PROTOCOL *This,\r | |
316 | IN EFI_FTP4_CONNECTION_TOKEN *Token\r | |
317 | );\r | |
318 | \r | |
319 | /**\r | |
320 | Sets or clears the operational parameters for the FTP child driver.\r | |
321 | \r | |
9095d37b | 322 | The Configure() function will configure the connected FTP session with the\r |
badd7e61 | 323 | configuration setting specified in FtpConfigData. The configuration data can\r |
324 | be reset by calling Configure() with FtpConfigData set to NULL.\r | |
325 | \r | |
326 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
9095d37b | 327 | @param[in] FtpConfigData Pointer to configuration data that will be assigned to\r |
badd7e61 | 328 | the FTP child driver instance. If NULL, the FTP child\r |
9095d37b | 329 | driver instance is reset to startup defaults and all\r |
badd7e61 | 330 | pending transmit and receive requests are flushed.\r |
331 | \r | |
332 | @retval EFI_SUCCESS The FTPv4 driver was configured successfully.\r | |
333 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r | |
334 | - This is NULL.\r | |
335 | - FtpConfigData.RepType is invalid.\r | |
336 | - FtpConfigData.FileStruct is invalid.\r | |
337 | - FtpConfigData.TransMode is invalid.\r | |
338 | - IP address in FtpConfigData is invalid.\r | |
9095d37b | 339 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r |
badd7e61 | 340 | RARP, etc.) is not finished yet.\r |
341 | @retval EFI_UNSUPPORTED One or more of the configuration parameters are not supported\r | |
9095d37b LG |
342 | by this implementation.\r |
343 | @retval EFI_OUT_OF_RESOURCES The EFI FTPv4 Protocol driver instance data could not be\r | |
badd7e61 | 344 | allocated.\r |
9095d37b | 345 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI FTPv4\r |
badd7e61 | 346 | Protocol driver instance is not configured.\r |
347 | \r | |
348 | **/\r | |
349 | typedef\r | |
350 | EFI_STATUS\r | |
351 | (EFIAPI *EFI_FTP4_CONFIGURE)(\r | |
352 | IN EFI_FTP4_PROTOCOL *This,\r | |
353 | IN EFI_FTP4_CONFIG_DATA *FtpConfigData OPTIONAL\r | |
354 | );\r | |
355 | \r | |
356 | \r | |
357 | /**\r | |
9095d37b | 358 | Downloads a file from an FTPv4 server.\r |
badd7e61 | 359 | \r |
360 | The ReadFile() function is used to initialize and start an FTPv4 download process\r | |
361 | and optionally wait for completion. When the download operation completes, whether\r | |
9095d37b | 362 | successfully or not, the Token.Status field is updated by the EFI FTPv4 Protocol\r |
badd7e61 | 363 | driver and then Token.Event is signaled (if it is not NULL).\r |
364 | \r | |
365 | Data will be downloaded from the FTPv4 server into Token.DataBuffer. If the file size\r | |
9095d37b | 366 | is larger than Token.DataBufferSize, Token.DataCallback will be called to allow for\r |
badd7e61 | 367 | processing data and then new data will be placed at the beginning of Token.DataBuffer.\r |
368 | \r | |
369 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
370 | @param[in] Token Pointer to the token structure to provide the parameters that\r | |
371 | are used in this operation.\r | |
372 | \r | |
373 | @retval EFI_SUCCESS The data file is being downloaded successfully.\r | |
374 | @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.\r | |
375 | - This is NULL.\r | |
376 | - Token is NULL.\r | |
377 | - Token.Pathname is NULL.\r | |
378 | - Token. DataBuffer is NULL.\r | |
379 | - Token. DataBufferSize is 0.\r | |
380 | @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r | |
9095d37b | 381 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r |
badd7e61 | 382 | RARP, etc.) is not finished yet.\r |
383 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
384 | @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r | |
385 | \r | |
386 | **/\r | |
9095d37b LG |
387 | typedef\r |
388 | EFI_STATUS\r | |
badd7e61 | 389 | (EFIAPI *EFI_FTP4_READ_FILE)(\r |
390 | IN EFI_FTP4_PROTOCOL *This,\r | |
391 | IN EFI_FTP4_COMMAND_TOKEN *Token\r | |
392 | );\r | |
393 | \r | |
394 | /**\r | |
9095d37b | 395 | Uploads a file from an FTPv4 server.\r |
badd7e61 | 396 | \r |
397 | The WriteFile() function is used to initialize and start an FTPv4 upload process and\r | |
398 | optionally wait for completion. When the upload operation completes, whether successfully\r | |
399 | or not, the Token.Status field is updated by the EFI FTPv4 Protocol driver and then\r | |
400 | Token.Event is signaled (if it is not NULL). Data to be uploaded to server is stored\r | |
9095d37b | 401 | into Token.DataBuffer. Token.DataBufferSize is the number bytes to be transferred.\r |
badd7e61 | 402 | If the file size is larger than Token.DataBufferSize, Token.DataCallback will be called\r |
9095d37b | 403 | to allow for processing data and then new data will be placed at the beginning of\r |
badd7e61 | 404 | Token.DataBuffer. Token.DataBufferSize is updated to reflect the actual number of bytes\r |
405 | to be transferred. Token.DataBufferSize is set to 0 by the call back to indicate the\r | |
406 | completion of data transfer.\r | |
407 | \r | |
408 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
409 | @param[in] Token Pointer to the token structure to provide the parameters that\r | |
410 | are used in this operation.\r | |
411 | \r | |
412 | @retval EFI_SUCCESS TThe data file is being uploaded successfully.\r | |
413 | @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r | |
414 | @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.\r | |
415 | - This is NULL.\r | |
416 | - Token is NULL.\r | |
417 | - Token.Pathname is NULL.\r | |
418 | - Token. DataBuffer is NULL.\r | |
419 | - Token. DataBufferSize is 0.\r | |
420 | @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r | |
9095d37b | 421 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r |
badd7e61 | 422 | RARP, etc.) is not finished yet.\r |
423 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
424 | @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r | |
425 | \r | |
426 | **/\r | |
9095d37b LG |
427 | typedef\r |
428 | EFI_STATUS\r | |
badd7e61 | 429 | (EFIAPI *EFI_FTP4_WRITE_FILE)(\r |
430 | IN EFI_FTP4_PROTOCOL *This,\r | |
431 | IN EFI_FTP4_COMMAND_TOKEN *Token\r | |
432 | );\r | |
433 | \r | |
434 | /**\r | |
9095d37b | 435 | Download a data file "directory" from a FTPv4 server. May be unsupported in some EFI\r |
badd7e61 | 436 | implementations.\r |
437 | \r | |
438 | The ReadDirectory() function is used to return a list of files on the FTPv4 server that\r | |
439 | logically (or operationally) related to Token.Pathname, and optionally wait for completion.\r | |
9095d37b | 440 | When the download operation completes, whether successfully or not, the Token.Status field\r |
badd7e61 | 441 | is updated by the EFI FTPv4 Protocol driver and then Token.Event is signaled (if it is not\r |
442 | NULL). Data will be downloaded from the FTPv4 server into Token.DataBuffer. If the file size\r | |
443 | is larger than Token.DataBufferSize, Token.DataCallback will be called to allow for processing\r | |
9095d37b | 444 | data and then new data will be placed at the beginning of Token.DataBuffer.\r |
badd7e61 | 445 | \r |
446 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
447 | @param[in] Token Pointer to the token structure to provide the parameters that\r | |
448 | are used in this operation.\r | |
449 | \r | |
450 | @retval EFI_SUCCESS The file list information is being downloaded successfully.\r | |
451 | @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r | |
452 | @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.\r | |
453 | - This is NULL.\r | |
454 | - Token is NULL.\r | |
455 | - Token. DataBuffer is NULL.\r | |
456 | - Token. DataBufferSize is 0.\r | |
457 | @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r | |
9095d37b | 458 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r |
badd7e61 | 459 | RARP, etc.) is not finished yet.\r |
460 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
461 | @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r | |
462 | \r | |
463 | **/\r | |
464 | typedef\r | |
465 | EFI_STATUS\r | |
466 | (EFIAPI *EFI_FTP4_READ_DIRECTORY)(\r | |
467 | IN EFI_FTP4_PROTOCOL *This,\r | |
468 | IN EFI_FTP4_COMMAND_TOKEN *Token\r | |
469 | );\r | |
470 | \r | |
471 | /**\r | |
9095d37b | 472 | Polls for incoming data packets and processes outgoing data packets.\r |
badd7e61 | 473 | \r |
474 | The Poll() function can be used by network drivers and applications to increase the\r | |
475 | rate that data packets are moved between the communications device and the transmit\r | |
476 | and receive queues. In some systems, the periodic timer event in the managed network\r | |
9095d37b | 477 | driver may not poll the underlying communications device fast enough to transmit\r |
badd7e61 | 478 | and/or receive all data packets without missing incoming packets or dropping outgoing\r |
479 | packets. Drivers and applications that are experiencing packet loss should try calling\r | |
9095d37b | 480 | the Poll() function more often.\r |
badd7e61 | 481 | \r |
482 | @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r | |
483 | \r | |
484 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
485 | @retval EFI_NOT_STARTED This EFI FTPv4 Protocol instance has not been started.\r | |
486 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
487 | @retval EFI_DEVICE_ERROR EapAuthType An unexpected system or network error occurred.\r | |
488 | @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r | |
489 | Consider increasing the polling rate.\r | |
490 | \r | |
491 | **/\r | |
492 | typedef\r | |
493 | EFI_STATUS\r | |
494 | (EFIAPI *EFI_FTP4_POLL)(\r | |
495 | IN EFI_FTP4_PROTOCOL *This\r | |
496 | );\r | |
497 | \r | |
498 | ///\r | |
9095d37b LG |
499 | /// EFI_FTP4_PROTOCOL\r |
500 | /// provides basic services for client-side FTP (File Transfer Protocol)\r | |
badd7e61 | 501 | /// operations.\r |
502 | ///\r | |
503 | struct _EFI_FTP4_PROTOCOL {\r | |
504 | EFI_FTP4_GET_MODE_DATA GetModeData;\r | |
505 | EFI_FTP4_CONNECT Connect;\r | |
506 | EFI_FTP4_CLOSE Close;\r | |
507 | EFI_FTP4_CONFIGURE Configure;\r | |
508 | EFI_FTP4_READ_FILE ReadFile;\r | |
509 | EFI_FTP4_WRITE_FILE WriteFile;\r | |
510 | EFI_FTP4_READ_DIRECTORY ReadDirectory;\r | |
511 | EFI_FTP4_POLL Poll;\r | |
512 | };\r | |
513 | \r | |
514 | extern EFI_GUID gEfiFtp4ServiceBindingProtocolGuid;\r | |
515 | extern EFI_GUID gEfiFtp4ProtocolGuid;\r | |
516 | \r | |
517 | #endif\r | |
518 | \r |