NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c File Reference


Functions

EFI_STATUS EFIAPI PxeBcMtftp6CheckPacket (IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token, IN UINT16 PacketLen, IN EFI_MTFTP6_PACKET *Packet)
EFI_STATUS PxeBcMtftp6GetFileSize (IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP6_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN OUT UINT64 *BufferSize)
EFI_STATUS PxeBcMtftp6ReadFile (IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP6_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer)
EFI_STATUS PxeBcMtftp6WriteFile (IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP6_CONFIG_DATA *Config, IN UINT8 *Filename, IN BOOLEAN Overwrite, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize)
EFI_STATUS PxeBcMtftp6ReadDirectory (IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP6_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer)
EFI_STATUS EFIAPI PxeBcMtftp4CheckPacket (IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token, IN UINT16 PacketLen, IN EFI_MTFTP4_PACKET *Packet)
EFI_STATUS PxeBcMtftp4GetFileSize (IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP4_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN OUT UINT64 *BufferSize)
EFI_STATUS PxeBcMtftp4ReadFile (IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP4_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer)
EFI_STATUS PxeBcMtftp4WriteFile (IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP4_CONFIG_DATA *Config, IN UINT8 *Filename, IN BOOLEAN Overwrite, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize)
EFI_STATUS PxeBcMtftp4ReadDirectory (IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP4_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer)
EFI_STATUS PxeBcTftpGetFileSize (IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN OUT UINT64 *BufferSize)
EFI_STATUS PxeBcTftpReadFile (IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer)
EFI_STATUS PxeBcTftpWriteFile (IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN BOOLEAN Overwrite, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize)
EFI_STATUS PxeBcTftpReadDirectory (IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer)

Variables

CHAR8 * mMtftpOptions [PXE_MTFTP_OPTION_MAXIMUM_INDEX]

Detailed Description

Functions implementation related with Mtftp for UefiPxeBc Driver.

Copyright (c) 2007 - 2015, 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.


Function Documentation

EFI_STATUS EFIAPI PxeBcMtftp4CheckPacket ( IN EFI_MTFTP4_PROTOCOL *  This,
IN EFI_MTFTP4_TOKEN *  Token,
IN UINT16  PacketLen,
IN EFI_MTFTP4_PACKET *  Packet 
)

This is a callback function when packets are received or transmitted in Mtftp driver.

A callback function that is provided by the caller to intercept the EFI_MTFTP6_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory().

Parameters:
[in] This Pointer to EFI_MTFTP4_PROTOCOL.
[in] Token Pointer to EFI_MTFTP4_TOKEN.
[in] PacketLen Length of EFI_MTFTP4_PACKET.
[in] Packet Pointer to EFI_MTFTP4_PACKET to be checked.
Return values:
EFI_SUCCESS The current operation succeeeded.
EFI_ABORTED Abort the current transfer process.

References _PXEBC_PRIVATE_DATA::Function, _PXEBC_PRIVATE_DATA::Mode, PXE_MTFTP_ERROR_STRING_LENGTH, and _PXEBC_PRIVATE_DATA::PxeBcCallback.

Referenced by PxeBcMtftp4ReadDirectory(), PxeBcMtftp4ReadFile(), and PxeBcMtftp4WriteFile().

EFI_STATUS PxeBcMtftp4GetFileSize ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP4_CONFIG_DATA *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN OUT UINT64 *  BufferSize 
)

This function is to get size of a file using Tftp.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to EFI_MTFTP4_CONFIG_DATA.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in,out] BufferSize Pointer to buffer size.
Return values:
EFI_SUCCESS Successfully obtained the size of file.
EFI_NOT_FOUND Parse the tftp options failed.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Did not obtain the size of the file.

References mMtftpOptions, PXE_MTFTP_ERROR_STRING_LENGTH, PXE_MTFTP_OPTBUF_MAXNUM_INDEX, PXE_MTFTP_OPTION_BLKSIZE_INDEX, PXE_MTFTP_OPTION_TSIZE_INDEX, PXEBC_BS_DOWNLOAD_PORT, and PxeBcUintnToAscDec().

Referenced by PxeBcTftpGetFileSize().

EFI_STATUS PxeBcMtftp4ReadDirectory ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP4_CONFIG_DATA *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize,
IN BOOLEAN  DontUseBuffer 
)

This function is to get data (file) from a directory using Tftp.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to EFI_MTFTP4_CONFIG_DATA.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
[in] DontUseBuffer Indicates whether to use a receive buffer.
Return values:
EFI_SUCCES Successfully obtained the data from the file included in the directory.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Operation failed.

References mMtftpOptions, PXE_MTFTP_OPTBUF_MAXNUM_INDEX, PXE_MTFTP_OPTION_BLKSIZE_INDEX, PXEBC_BS_DOWNLOAD_PORT, PxeBcMtftp4CheckPacket(), and PxeBcUintnToAscDec().

Referenced by PxeBcTftpReadDirectory().

EFI_STATUS PxeBcMtftp4ReadFile ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP4_CONFIG_DATA *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize,
IN BOOLEAN  DontUseBuffer 
)

This function is to read the data of a file using Tftp.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to EFI_MTFTP4_CONFIG_DATA.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
[in] DontUseBuffer Indicates whether to use a receive buffer.
Return values:
EFI_SUCCESS Successfully read the data from the special file.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Read data from file failed.

References mMtftpOptions, PXE_MTFTP_OPTBUF_MAXNUM_INDEX, PXE_MTFTP_OPTION_BLKSIZE_INDEX, PXEBC_BS_DOWNLOAD_PORT, PxeBcMtftp4CheckPacket(), and PxeBcUintnToAscDec().

Referenced by PxeBcTftpReadFile().

EFI_STATUS PxeBcMtftp4WriteFile ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP4_CONFIG_DATA *  Config,
IN UINT8 *  Filename,
IN BOOLEAN  Overwrite,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize 
)

This function is to write the data of a file using Tftp.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to EFI_MTFTP4_CONFIG_DATA.
[in] Filename Pointer to boot file name.
[in] Overwrite Indicates whether to use the overwrite attribute.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
Return values:
EFI_SUCCESS Successfully write the data into the special file.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
other Write data into file failed.

References mMtftpOptions, PXE_MTFTP_OPTBUF_MAXNUM_INDEX, PXE_MTFTP_OPTION_BLKSIZE_INDEX, PXEBC_BS_DOWNLOAD_PORT, PxeBcMtftp4CheckPacket(), and PxeBcUintnToAscDec().

Referenced by PxeBcTftpWriteFile().

EFI_STATUS EFIAPI PxeBcMtftp6CheckPacket ( IN EFI_MTFTP6_PROTOCOL *  This,
IN EFI_MTFTP6_TOKEN *  Token,
IN UINT16  PacketLen,
IN EFI_MTFTP6_PACKET *  Packet 
)

This is a callback function when packets are received or transmitted in Mtftp driver.

A callback function that is provided by the caller to intercept the EFI_MTFTP6_OPCODE_DATA or EFI_MTFTP6_OPCODE_DATA8 packets processed in the EFI_MTFTP6_PROTOCOL.ReadFile() function, and alternatively to intercept EFI_MTFTP6_OPCODE_OACK or EFI_MTFTP6_OPCODE_ERROR packets during a call to EFI_MTFTP6_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory().

Parameters:
[in] This Pointer to EFI_MTFTP6_PROTOCOL.
[in] Token Pointer to EFI_MTFTP6_TOKEN.
[in] PacketLen Length of EFI_MTFTP6_PACKET.
[in] Packet Pointer to EFI_MTFTP6_PACKET to be checked.
Return values:
EFI_SUCCESS The current operation succeeded.
EFI_ABORTED Abort the current transfer process.

References _PXEBC_PRIVATE_DATA::Function, _PXEBC_PRIVATE_DATA::Mode, PXE_MTFTP_ERROR_STRING_LENGTH, and _PXEBC_PRIVATE_DATA::PxeBcCallback.

Referenced by PxeBcMtftp6ReadDirectory(), PxeBcMtftp6ReadFile(), and PxeBcMtftp6WriteFile().

EFI_STATUS PxeBcMtftp6GetFileSize ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP6_CONFIG_DATA *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN OUT UINT64 *  BufferSize 
)

This function is to get the size of a file using Tftp.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to EFI_MTFTP6_CONFIG_DATA.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in,out] BufferSize Pointer to buffer size.
Return values:
EFI_SUCCESS Sucessfully obtained the size of file.
EFI_NOT_FOUND Parse the tftp ptions failed.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Has not obtained the size of the file.

References mMtftpOptions, PXE_MTFTP_ERROR_STRING_LENGTH, PXE_MTFTP_OPTBUF_MAXNUM_INDEX, PXE_MTFTP_OPTION_BLKSIZE_INDEX, PXE_MTFTP_OPTION_TSIZE_INDEX, PXEBC_BS_DOWNLOAD_PORT, and PxeBcUintnToAscDec().

Referenced by PxeBcTftpGetFileSize().

EFI_STATUS PxeBcMtftp6ReadDirectory ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP6_CONFIG_DATA *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize,
IN BOOLEAN  DontUseBuffer 
)

This function is to read the data (file) from a directory using Tftp.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to EFI_MTFTP6_CONFIG_DATA.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
[in] DontUseBuffer Indicates whether to use a receive buffer.
Return values:
EFI_SUCCESS Successfully obtained the data from the file included in directory.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Operation failed.

References mMtftpOptions, PXE_MTFTP_OPTBUF_MAXNUM_INDEX, PXE_MTFTP_OPTION_BLKSIZE_INDEX, PXEBC_BS_DOWNLOAD_PORT, PxeBcMtftp6CheckPacket(), and PxeBcUintnToAscDec().

Referenced by PxeBcTftpReadDirectory().

EFI_STATUS PxeBcMtftp6ReadFile ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP6_CONFIG_DATA *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize,
IN BOOLEAN  DontUseBuffer 
)

This function is to get data of a file using Tftp.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to EFI_MTFTP6_CONFIG_DATA.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
[in] DontUseBuffer Indicates whether with a receive buffer.
Return values:
EFI_SUCCESS Successfully read the data from the special file.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Read data from file failed.

References mMtftpOptions, PXE_MTFTP_OPTBUF_MAXNUM_INDEX, PXE_MTFTP_OPTION_BLKSIZE_INDEX, PXEBC_BS_DOWNLOAD_PORT, PxeBcMtftp6CheckPacket(), and PxeBcUintnToAscDec().

Referenced by PxeBcTftpReadFile().

EFI_STATUS PxeBcMtftp6WriteFile ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP6_CONFIG_DATA *  Config,
IN UINT8 *  Filename,
IN BOOLEAN  Overwrite,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize 
)

This function is used to write the data of a file using Tftp.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to EFI_MTFTP6_CONFIG_DATA.
[in] Filename Pointer to boot file name.
[in] Overwrite Indicate whether with overwrite attribute.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
Return values:
EFI_SUCCESS Successfully wrote the data into a special file.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
other Write data into file failed.

References mMtftpOptions, PXE_MTFTP_OPTBUF_MAXNUM_INDEX, PXE_MTFTP_OPTION_BLKSIZE_INDEX, PXEBC_BS_DOWNLOAD_PORT, PxeBcMtftp6CheckPacket(), and PxeBcUintnToAscDec().

Referenced by PxeBcTftpWriteFile().

EFI_STATUS PxeBcTftpGetFileSize ( IN PXEBC_PRIVATE_DATA Private,
IN VOID *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN OUT UINT64 *  BufferSize 
)

This function is wrapper to get the file size using TFTP.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to configure data.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in,out] BufferSize Pointer to buffer size.
Return values:
EFI_SUCCESS Successfully obtained the size of file.
EFI_NOT_FOUND Parse the tftp options failed.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Did not obtain the size of the file.

References PxeBcMtftp4GetFileSize(), and PxeBcMtftp6GetFileSize().

Referenced by EfiPxeBcMtftp().

EFI_STATUS PxeBcTftpReadDirectory ( IN PXEBC_PRIVATE_DATA Private,
IN VOID *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize,
IN BOOLEAN  DontUseBuffer 
)

This function is a wrapper to get the data (file) from a directory using TFTP.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to config data.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
[in] DontUseBuffer Indicatse whether to use a receive buffer.
Return values:
EFI_SUCCES Successfully obtained the data from the file included in the directory.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Operation failed.

References PxeBcMtftp4ReadDirectory(), and PxeBcMtftp6ReadDirectory().

Referenced by EfiPxeBcMtftp().

EFI_STATUS PxeBcTftpReadFile ( IN PXEBC_PRIVATE_DATA Private,
IN VOID *  Config,
IN UINT8 *  Filename,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize,
IN BOOLEAN  DontUseBuffer 
)

This function is a wrapper to get file using TFTP.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to config data.
[in] Filename Pointer to boot file name.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
[in] DontUseBuffer Indicates whether to use a receive buffer.
Return values:
EFI_SUCCESS Sucessfully read the data from the special file.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
Others Read data from file failed.

References PxeBcMtftp4ReadFile(), and PxeBcMtftp6ReadFile().

Referenced by EfiPxeBcMtftp().

EFI_STATUS PxeBcTftpWriteFile ( IN PXEBC_PRIVATE_DATA Private,
IN VOID *  Config,
IN UINT8 *  Filename,
IN BOOLEAN  Overwrite,
IN UINTN *  BlockSize,
IN UINT8 *  BufferPtr,
IN OUT UINT64 *  BufferSize 
)

This function is a wrapper to write file using TFTP.

Parameters:
[in] Private Pointer to PxeBc private data.
[in] Config Pointer to config data.
[in] Filename Pointer to boot file name.
[in] Overwrite Indicate whether with overwrite attribute.
[in] BlockSize Pointer to required block size.
[in] BufferPtr Pointer to buffer.
[in,out] BufferSize Pointer to buffer size.
Return values:
EFI_SUCCESS Successfully wrote the data into a special file.
EFI_DEVICE_ERROR The network device encountered an error during this operation.
other Write data into file failed.

References PxeBcMtftp4WriteFile(), and PxeBcMtftp6WriteFile().

Referenced by EfiPxeBcMtftp().


Variable Documentation

CHAR8* mMtftpOptions[PXE_MTFTP_OPTION_MAXIMUM_INDEX]


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