|
typedef struct _EFI_MTFTP6_PROTOCOL | EFI_MTFTP6_PROTOCOL |
|
typedef struct _EFI_MTFTP6_TOKEN | EFI_MTFTP6_TOKEN |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_CHECK_PACKET )(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token, IN UINT16 PacketLen, IN EFI_MTFTP6_PACKET *Packet) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_TIMEOUT_CALLBACK )(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_PACKET_NEEDED )(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token, IN OUT UINT16 *Length, OUT VOID **Buffer) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_GET_MODE_DATA )(IN EFI_MTFTP6_PROTOCOL *This, OUT EFI_MTFTP6_MODE_DATA *ModeData) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_CONFIGURE )(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_CONFIG_DATA *MtftpConfigData) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_GET_INFO )(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_OVERRIDE_DATA *OverrideData, IN UINT8 *Filename, IN UINT8 *ModeStr, IN UINT8 OptionCount, IN EFI_MTFTP6_OPTION *OptionList, OUT UINT32 *PacketLength, OUT EFI_MTFTP6_PACKET **Packet) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_PARSE_OPTIONS )(IN EFI_MTFTP6_PROTOCOL *This, IN UINT32 PacketLen, IN EFI_MTFTP6_PACKET *Packet, OUT UINT32 *OptionCount, OUT EFI_MTFTP6_OPTION **OptionList) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_READ_FILE )(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_WRITE_FILE )(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_READ_DIRECTORY )(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token) |
|
typedef EFI_STATUS(EFIAPI * | EFI_MTFTP6_POLL )(IN EFI_MTFTP6_PROTOCOL *This) |
|
UEFI Multicast Trivial File Transfer Protocol v6 Definition, which is built upon the EFI UDPv6 Protocol and provides basic services for client-side unicast and/or multicast TFTP operations.
Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
- Revision Reference:
- This Protocol is introduced in UEFI Specification 2.2
Initializes, changes, or resets the default operational setting for this EFI MTFTPv6 Protocol driver instance.
The Configure() function is used to set and change the configuration data for this EFI MTFTPv6 Protocol driver instance. The configuration data can be reset to startup defaults by calling Configure() with MtftpConfigData set to NULL. Whenever the instance is reset, any pending operation is aborted. By changing the EFI MTFTPv6 Protocol driver instance configuration data, the client can connect to different MTFTPv6 servers. The configuration parameters in MtftpConfigData are used as the default parameters in later MTFTPv6 operations and can be overridden in later operations.
- Parameters
-
[in] | This | Pointer to the EFI_MTFTP6_PROTOCOL instance. |
[in] | MtftpConfigData | Pointer to the configuration data structure. |
- Return values
-
EFI_SUCCESS | The EFI MTFTPv6 Protocol instance was configured successfully. |
EFI_INVALID_PARAMETER | One or more following conditions are TRUE:
- This is NULL.
- MtftpConfigData.StationIp is neither zero nor one of the configured IP addresses in the underlying IPv6 driver.
- MtftpCofigData.ServerIp is not a valid IPv6 unicast address.
|
EFI_ACCESS_DENIED | - The configuration could not be changed at this time because there is some MTFTP background operation in progress.
- MtftpCofigData.LocalPort is already in use.
|
EFI_NO_MAPPING | The underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use. |
EFI_OUT_OF_RESOURCES | The EFI MTFTPv6 Protocol driver instance data could not be allocated. |
EFI_DEVICE_ERROR | An unexpected system or network error occurred. The EFI MTFTPv6 Protocol driver instance is not configured. |
Get information about a file from an MTFTPv6 server.
The GetInfo() function assembles an MTFTPv6 request packet with options, sends it to the MTFTPv6 server, and may return an MTFTPv6 OACK, MTFTPv6 ERROR, or ICMP ERROR packet. Retries occur only if no response packets are received from the MTFTPv6 server before the timeout expires.
- Parameters
-
[in] | This | Pointer to the EFI_MTFTP6_PROTOCOL instance. |
[in] | OverrideData | Data that is used to override the existing parameters. If NULL, the default parameters that were set in the EFI_MTFTP6_PROTOCOL.Configure() function are used. |
[in] | Filename | Pointer to null-terminated ASCII file name string. |
[in] | ModeStr | Pointer to null-terminated ASCII mode string. If NULL, octet will be used |
[in] | OptionCount | Number of option/value string pairs in OptionList. |
[in] | OptionList | Pointer to array of option/value string pairs. Ignored if OptionCount is zero. |
[out] | PacketLength | The number of bytes in the returned packet. |
[out] | Packet | The pointer to the received packet. This buffer must be freed by the caller. |
- Return values
-
EFI_SUCCESS | An MTFTPv6 OACK packet was received and is in the Packet. |
EFI_INVALID_PARAMETER | One or more of the following conditions is TRUE:
- This is NULL.
- Filename is NULL
- OptionCount is not zero and OptionList is NULL.
- One or more options in OptionList have wrong format.
- PacketLength is NULL.
- OverrideData.ServerIp is not valid unicast IPv6 addresses.
|
EFI_UNSUPPORTED | One or more options in the OptionList are unsupported by this implementation. |
EFI_NOT_STARTED | The EFI MTFTPv6 Protocol driver has not been started. |
EFI_NO_MAPPING | The underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use. |
EFI_ACCESS_DENIED | The previous operation has not completed yet. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_TFTP_ERROR | An MTFTPv6 ERROR packet was received and is in the Packet. |
EFI_NETWORK_UNREACHABLE | An ICMP network unreachable error packet was received and the Packet is set to NULL. |
EFI_HOST_UNREACHABLE | An ICMP host unreachable error packet was received and the Packet is set to NULL. |
EFI_PROTOCOL_UNREACHABLE | An ICMP protocol unreachable error packet was received and the Packet is set to NULL. |
EFI_PORT_UNREACHABLE | An ICMP port unreachable error packet was received and the Packet is set to NULL. |
EFI_ICMP_ERROR | Some other ICMP ERROR packet was received and the Packet is set to NULL. |
EFI_PROTOCOL_ERROR | An unexpected MTFTPv6 packet was received and is in the Packet. |
EFI_TIMEOUT | No responses were received from the MTFTPv6 server. |
EFI_DEVICE_ERROR | An unexpected network error or system error occurred. |
EFI_NO_MEDIA | There was a media error. |
Download a data file directory from an MTFTPv6 server. May be unsupported in some implementations.
The ReadDirectory() function is used to return a list of files on the MTFTPv6 server that are logically (or operationally) related to Token.Filename. The directory request packet that is sent to the server is built with the option list that was provided by caller, if present.
The file information that the server returns is put into either of the following locations:
- A fixed buffer that is pointed to by Token.Buffer
- A download service function that is pointed to by Token.CheckPacket
If both Token.Buffer and Token.CheckPacket are used, then Token.CheckPacket will be called first. If the call is successful, the packet will be stored in Token.Buffer.
The returned directory listing in the Token.Buffer or EFI_MTFTP6_PACKET consists of a list of two or three variable-length ASCII strings, each terminated by a null character, for each file in the directory. If the multicast option is involved, the first field of each directory entry is the static multicast IP address and UDP port number that is associated with the file name. The format of the field is ip:ip:ip:ip:port. If the multicast option is not involved, this field and its terminating null character are not present.
The next field of each directory entry is the file name and the last field is the file information string. The information string contains the file size and the create/modify timestamp. The format of the information string is filesize yyyy-mm-dd hh:mm:ss:ffff. The timestamp is Coordinated Universal Time (UTC; also known as Greenwich Mean Time [GMT]).
- Parameters
-
[in] | This | Pointer to the EFI_MTFTP6_PROTOCOL instance. |
[in] | Token | Pointer to the token structure to provide the parameters that are used in this operation. |
- Return values
-
EFI_SUCCESS | The MTFTPv6 related file "directory" has been downloaded. |
EFI_UNSUPPORTED | The EFI MTFTPv6 Protocol driver does not support this function. |
EFI_INVALID_PARAMETER | One or more of the following conditions is TRUE:
- This is NULL.
- Token is NULL.
- Token.Filename is NULL.
- Token.OptionCount is not zero and Token.OptionList is NULL.
- One or more options in Token.OptionList have wrong format.
- Token.Buffer and Token.CheckPacket are both NULL.
- Token.OverrideData.ServerIp is not valid unicast IPv6 addresses.
|
EFI_UNSUPPORTED | One or more options in the Token.OptionList are not supported by this implementation. |
EFI_NOT_STARTED | The EFI MTFTPv6 Protocol driver has not been started. |
EFI_NO_MAPPING | The underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use. |
EFI_ALREADY_STARTED | This Token is already being used in another MTFTPv6 session. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_ACCESS_DENIED | The previous operation has not completed yet. |
EFI_DEVICE_ERROR | An unexpected network error or system error occurred. |
Download a file from an MTFTPv6 server.
The ReadFile() function is used to initialize and start an MTFTPv6 download process and optionally wait for completion. When the download operation completes, whether successfully or not, the Token.Status field is updated by the EFI MTFTPv6 Protocol driver and then Token.Event is signaled if it is not NULL.
Data can be downloaded from the MTFTPv6 server into either of the following locations:
- A fixed buffer that is pointed to by Token.Buffer
- A download service function that is pointed to by Token.CheckPacket
If both Token.Buffer and Token.CheckPacket are used, then Token.CheckPacket will be called first. If the call is successful, the packet will be stored in Token.Buffer.
- Parameters
-
[in] | This | Pointer to the EFI_MTFTP6_PROTOCOL instance. |
[in] | Token | Pointer to the token structure to provide the parameters that are used in this operation. |
- Return values
-
EFI_SUCCESS | The data file has been transferred successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_BUFFER_TOO_SMALL | BufferSize is not zero but not large enough to hold the downloaded data in downloading process. |
EFI_ABORTED | Current operation is aborted by user. |
EFI_NETWORK_UNREACHABLE | An ICMP network unreachable error packet was received. |
EFI_HOST_UNREACHABLE | An ICMP host unreachable error packet was received. |
EFI_PROTOCOL_UNREACHABLE | An ICMP protocol unreachable error packet was received. |
EFI_PORT_UNREACHABLE | An ICMP port unreachable error packet was received. |
EFI_ICMP_ERROR | An ICMP ERROR packet was received. |
EFI_TIMEOUT | No responses were received from the MTFTPv6 server. |
EFI_TFTP_ERROR | An MTFTPv6 ERROR packet was received. |
EFI_DEVICE_ERROR | An unexpected network error or system error occurred. |
EFI_NO_MEDIA | There was a media error. |
Send a file to an MTFTPv6 server. May be unsupported in some implementations.
The WriteFile() function is used to initialize an uploading operation with the given option list and optionally wait for completion. If one or more of the options is not supported by the server, the unsupported options are ignored and a standard TFTP process starts instead. When the upload process completes, whether successfully or not, Token.Event is signaled, and the EFI MTFTPv6 Protocol driver updates Token.Status.
The caller can supply the data to be uploaded in the following two modes:
- Through the user-provided buffer
- Through a callback function
With the user-provided buffer, the Token.BufferSize field indicates the length of the buffer, and the driver will upload the data in the buffer. With an EFI_MTFTP6_PACKET_NEEDED callback function, the driver will call this callback function to get more data from the user to upload. See the definition of EFI_MTFTP6_PACKET_NEEDED for more information. These two modes cannot be used at the same time. The callback function will be ignored if the user provides the buffer.
- Parameters
-
[in] | This | Pointer to the EFI_MTFTP6_PROTOCOL instance. |
[in] | Token | Pointer to the token structure to provide the parameters that are used in this operation. |
- Return values
-
EFI_SUCCESS | The upload session has started. |
EFI_UNSUPPORTED | The operation is not supported by this implementation. |
EFI_INVALID_PARAMETER | One or more of the following conditions is TRUE:
- This is NULL.
- Token is NULL.
- Token.Filename is NULL.
- Token.OptionCount is not zero and Token.OptionList is NULL.
- One or more options in Token.OptionList have wrong format.
- Token.Buffer and Token.PacketNeeded are both NULL.
- Token.OverrideData.ServerIp is not valid unicast IPv6 addresses.
|
EFI_UNSUPPORTED | One or more options in the Token.OptionList are not supported by this implementation. |
EFI_NOT_STARTED | The EFI MTFTPv6 Protocol driver has not been started. |
EFI_NO_MAPPING | The underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use. |
EFI_ALREADY_STARTED | This Token is already being used in another MTFTPv6 session. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_ACCESS_DENIED | The previous operation has not completed yet. |
EFI_DEVICE_ERROR | An unexpected network error or system error occurred. |