NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h File Reference


Data Structures

struct  _MTFTP6_GETINFO_CONTEXT
struct  _MTFTP6_INSTANCE
struct  _MTFTP6_SERVICE
struct  MTFTP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT

Defines

#define MTFTP6_SERVICE_SIGNATURE   SIGNATURE_32 ('M', 'F', '6', 'S')
#define MTFTP6_INSTANCE_SIGNATURE   SIGNATURE_32 ('M', 'F', '6', 'I')
#define MTFTP6_DEFAULT_SERVER_CMD_PORT   69
#define MTFTP6_DEFAULT_TIMEOUT   3
#define MTFTP6_GET_MAPPING_TIMEOUT   3
#define MTFTP6_DEFAULT_MAX_RETRY   5
#define MTFTP6_DEFAULT_BLK_SIZE   512
#define MTFTP6_TICK_PER_SECOND   10000000U
#define MTFTP6_SERVICE_FROM_THIS(a)   CR (a, MTFTP6_SERVICE, ServiceBinding, MTFTP6_SERVICE_SIGNATURE)
#define MTFTP6_INSTANCE_FROM_THIS(a)   CR (a, MTFTP6_INSTANCE, Mtftp6, MTFTP6_INSTANCE_SIGNATURE)

Typedefs

typedef struct _MTFTP6_SERVICE MTFTP6_SERVICE
typedef struct _MTFTP6_INSTANCE MTFTP6_INSTANCE
typedef struct
_MTFTP6_GETINFO_CONTEXT 
MTFTP6_GETINFO_CONTEXT

Functions

EFI_STATUS EFIAPI EfiMtftp6GetModeData (IN EFI_MTFTP6_PROTOCOL *This, OUT EFI_MTFTP6_MODE_DATA *ModeData)
EFI_STATUS EFIAPI EfiMtftp6Configure (IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_CONFIG_DATA *MtftpConfigData)
EFI_STATUS EFIAPI EfiMtftp6GetInfo (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)
EFI_STATUS EFIAPI EfiMtftp6ParseOptions (IN EFI_MTFTP6_PROTOCOL *This, IN UINT32 PacketLen, IN EFI_MTFTP6_PACKET *Packet, OUT UINT32 *OptionCount, OUT EFI_MTFTP6_OPTION **OptionList)
EFI_STATUS EFIAPI EfiMtftp6ReadFile (IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token)
EFI_STATUS EFIAPI EfiMtftp6WriteFile (IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token)
EFI_STATUS EFIAPI EfiMtftp6ReadDirectory (IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token)
EFI_STATUS EFIAPI EfiMtftp6Poll (IN EFI_MTFTP6_PROTOCOL *This)

Variables

EFI_MTFTP6_PROTOCOL gMtftp6ProtocolTemplate

Detailed Description

Mtftp6 internal data structure and definition declaration.

Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

#define MTFTP6_DEFAULT_BLK_SIZE   512

Referenced by Mtftp6OperationStart().

#define MTFTP6_DEFAULT_MAX_RETRY   5

Referenced by Mtftp6OperationStart().

#define MTFTP6_DEFAULT_SERVER_CMD_PORT   69

Referenced by Mtftp6OperationStart().

#define MTFTP6_DEFAULT_TIMEOUT   3

Referenced by Mtftp6OperationStart().

#define MTFTP6_GET_MAPPING_TIMEOUT   3

Referenced by Mtftp6GetMapping().

#define MTFTP6_INSTANCE_FROM_THIS (  )     CR (a, MTFTP6_INSTANCE, Mtftp6, MTFTP6_INSTANCE_SIGNATURE)

#define MTFTP6_INSTANCE_SIGNATURE   SIGNATURE_32 ('M', 'F', '6', 'I')

#define MTFTP6_SERVICE_FROM_THIS (  )     CR (a, MTFTP6_SERVICE, ServiceBinding, MTFTP6_SERVICE_SIGNATURE)

#define MTFTP6_SERVICE_SIGNATURE   SIGNATURE_32 ('M', 'F', '6', 'S')

Referenced by Mtftp6CreateService().

#define MTFTP6_TICK_PER_SECOND   10000000U

Referenced by Mtftp6GetMapping().


Typedef Documentation


Function Documentation

EFI_STATUS EFIAPI EfiMtftp6Configure ( IN EFI_MTFTP6_PROTOCOL *  This,
IN EFI_MTFTP6_CONFIG_DATA *  MtftpConfigData 
)

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. Note: It does not match the UEFI 2.3 Specification.
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. Note: It does not match the UEFI 2.3 Specification.
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. Note: It is not defined in the UEFI 2.3 Specification.
EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI MTFTPv6 Protocol driver instance is not configured. Note: It is not defined in the UEFI 2.3 Specification.

References _MTFTP6_INSTANCE::Config, _MTFTP6_SERVICE::Controller, _MTFTP6_INSTANCE::Handle, _MTFTP6_SERVICE::Image, MTFTP6_INSTANCE_FROM_THIS, Mtftp6ConfigDummyUdpIo(), Mtftp6OperationClean(), _MTFTP6_INSTANCE::Service, and _MTFTP6_INSTANCE::UdpIo.

EFI_STATUS EFIAPI EfiMtftp6GetInfo ( 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 
)

Get the information of the download from the 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. Note: It does not match the UEFI 2.3 Specification.
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 a valid unicast IPv6 address.
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. Note: It is not defined in the UEFI 2.3 Specification.
EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received, and the Packet is set to NULL. Note: It is not defined in the UEFI 2.3 Specification.
EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received, and the Packet is set to NULL. Note: It is not defined in the UEFI 2.3 Specification.
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. Note: It does not match the UEFI 2.3 Specification.
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.
Get the information of the download from the 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. Note: It does not match the UEFI 2.3 Specification.
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. Note: It is not defined in UEFI 2.3 Specification.
EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received and the Packet is set to NULL. Note: It is not defined in the UEFI 2.3 Specification.
EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received and the Packet is set to NULL. Note: It is not defined in the UEFI 2.3 Specification.
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. Note: It does not match the UEFI 2.3 Specification.
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.

References Mtftp6CheckPacket(), Mtftp6OperationStart(), _MTFTP6_GETINFO_CONTEXT::Packet, _MTFTP6_GETINFO_CONTEXT::PacketLen, and _MTFTP6_GETINFO_CONTEXT::Status.

EFI_STATUS EFIAPI EfiMtftp6GetModeData ( IN EFI_MTFTP6_PROTOCOL *  This,
OUT EFI_MTFTP6_MODE_DATA *  ModeData 
)

Returns the current operating mode data for the MTFTP6 instance.

The GetModeData() function returns the current operating mode and cached data packet for the MTFTP6 instance.

Parameters:
[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
[out] ModeData The buffer in which the EFI MTFTPv6 Protocol driver mode data is returned.
Return values:
EFI_SUCCESS The configuration data was returned successfully.
EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
EFI_INVALID_PARAMETER This is NULL, or ModeData is NULL.
Returns the current operating mode data for the MTFTP6 instance.

The GetModeData() function returns the current operating mode and cached data packet for the MTFTP6 instance.

Parameters:
[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
[out] ModeData The buffer in which the EFI MTFTPv6 Protocol driver mode data is returned.
Return values:
EFI_SUCCESS The configuration data was returned successfully.
EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.

References _MTFTP6_INSTANCE::Config, mMtftp6SupportedOptions, MTFTP6_INSTANCE_FROM_THIS, and MTFTP6_SUPPORTED_OPTIONS_NUM.

EFI_STATUS EFIAPI EfiMtftp6ParseOptions ( IN EFI_MTFTP6_PROTOCOL *  This,
IN UINT32  PacketLen,
IN EFI_MTFTP6_PACKET *  Packet,
OUT UINT32 *  OptionCount,
OUT EFI_MTFTP6_OPTION **  OptionList 
)

Parse the options in an MTFTPv6 OACK packet.

The ParseOptions() function parses the option fields in an MTFTPv6 OACK packet and returns the number of options that were found, and optionally, a list of pointers to the options in the packet. If one or more of the option fields are not valid, then EFI_PROTOCOL_ERROR is returned and OptionCount and *OptionList stop at the last valid option.

Parameters:
[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
[in] PacketLen Length of the OACK packet to be parsed.
[in] Packet Pointer to the OACK packet to be parsed.
[out] OptionCount Pointer to the number of options in the following OptionList.
[out] OptionList Pointer to EFI_MTFTP6_OPTION storage. Each pointer in the OptionList points to the corresponding MTFTP option buffer in the Packet. Call the EFI Boot Service FreePool() to release the OptionList if the options in this OptionList are not needed any more.
Return values:
EFI_SUCCESS The OACK packet was valid and the OptionCount, and OptionList parameters have been updated.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
  • PacketLen is 0.
  • Packet is NULL or Packet is not a valid MTFTPv6 packet.
  • OptionCount is NULL.
EFI_NOT_FOUND No options were found in the OACK packet.
EFI_OUT_OF_RESOURCES Storage for the OptionList array can not be allocated.
EFI_PROTOCOL_ERROR One or more of the option fields is invalid.
Parse the options in an MTFTPv6 OACK packet.

The ParseOptions() function parses the option fields in an MTFTPv6 OACK packet and returns the number of options that were found, and optionally, a list of pointers to the options in the packet. If one or more of the option fields are not valid, then EFI_PROTOCOL_ERROR is returned and OptionCount and *OptionList stop at the last valid option.

Parameters:
[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.
[in] PacketLen Length of the OACK packet to be parsed.
[in] Packet Pointer to the OACK packet to be parsed.
[out] OptionCount Pointer to the number of options in the following OptionList.
[out] OptionList Pointer to EFI_MTFTP6_OPTION storage. Each pointer in the OptionList points to the corresponding MTFTP option buffer in the Packet. Call the EFI Boot Service FreePool() to release the OptionList if the options in this OptionList are not needed anymore.
Return values:
EFI_SUCCESS The OACK packet was valid and the OptionCount and OptionList parameters have been updated.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
  • PacketLen is 0.
  • Packet is NULL or Packet is not a valid MTFTPv6 packet.
  • OptionCount is NULL.
EFI_NOT_FOUND No options were found in the OACK packet.
EFI_OUT_OF_RESOURCES Storage for the OptionList array can not be allocated.
EFI_PROTOCOL_ERROR One or more of the option fields is invalid.

References Mtftp6ParseStart().

EFI_STATUS EFIAPI EfiMtftp6Poll ( IN EFI_MTFTP6_PROTOCOL *  This  ) 

Polls for incoming data packets and processes outgoing data packets.

The Poll() function can be used by network drivers and applications to increase the rate that data packets are moved between the communications device and the transmit and receive queues.In some systems, the periodic timer event in the managed network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets without missing incoming packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should try calling the Poll() function more often.

Parameters:
[in] This The MTFTP6 protocol instance.
Return values:
EFI_SUCCESS Incoming or outgoing data was processed.
EFI_NOT_STARTED This EFI MTFTPv6 Protocol instance has not been started.
EFI_INVALID_PARAMETER This is NULL.
EFI_DEVICE_ERROR An unexpected system or network error occurred.
EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue. Consider increasing the polling rate.
Polls for incoming data packets and processes outgoing data packets.

The Poll() function can be used by network drivers and applications to increase the rate that data packets are moved between the communications device and the transmit and receive queues. In some systems, the periodic timer event in the managed network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets without missing incoming packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should try calling the Poll() function more often.

Parameters:
[in] This The MTFTP6 protocol instance.
Return values:
EFI_SUCCESS Incoming or outgoing data was processed.
EFI_NOT_STARTED This EFI MTFTPv6 Protocol instance has not been started.
EFI_INVALID_PARAMETER This is NULL.
EFI_DEVICE_ERROR An unexpected system or network error occurred.
EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue. Consider increasing the polling rate.

References _MTFTP6_INSTANCE::Config, MTFTP6_INSTANCE_FROM_THIS, and _MTFTP6_INSTANCE::UdpIo.

EFI_STATUS EFIAPI EfiMtftp6ReadDirectory ( IN EFI_MTFTP6_PROTOCOL *  This,
IN EFI_MTFTP6_TOKEN *  Token 
)

Download a data file directory from an MTFTPv6 server.

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.

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 data file directory from an MTFTPv6 server.

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 the 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.

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.

References Mtftp6OperationStart().

EFI_STATUS EFIAPI EfiMtftp6ReadFile ( IN EFI_MTFTP6_PROTOCOL *  This,
IN EFI_MTFTP6_TOKEN *  Token 
)

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. Note: It does not match the UEFI 2.3 Specification.
EFI_ABORTED Current operation is aborted by user.
EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received. Note: It is not defined in the UEFI 2.3 Specification.
EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received. Note: It is not defined in the UEFI 2.3 Specification.
EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received. Note: It is not defined in the UEFI 2.3 Specification.
EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received. Note: It is not defined in the UEFI 2.3 Specification.
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.
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. Note: It does not match the UEFI 2.3 Specification.
EFI_ABORTED Current operation is aborted by user.
EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received. Note: It is not defined in the UEFI 2.3 Specification.
EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received. Note: It is not defined in the UEFI 2.3 Specification.
EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received. Note: It is not defined in the UEFI 2.3 Specification.
EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received. Note: It is not defined in the UEFI 2.3 Specification.
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.

References Mtftp6OperationStart().

EFI_STATUS EFIAPI EfiMtftp6WriteFile ( IN EFI_MTFTP6_PROTOCOL *  This,
IN EFI_MTFTP6_TOKEN *  Token 
)

Send a file to an MTFTPv6 server.

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.

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.
Send a file to an MTFTPv6 server.

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.

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 a valid unicast IPv6 address.
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.

References Mtftp6OperationStart().


Variable Documentation

EFI_MTFTP6_PROTOCOL gMtftp6ProtocolTemplate

Referenced by Mtftp6CreateInstance().


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1