TianoCore EDK2 master
Loading...
Searching...
No Matches
PxeBcMtftp.c File Reference
#include "PxeBcImpl.h"

Go to the source code of this file.

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 UINTN *WindowSize, 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 UINTN *WindowSize, 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 UINTN *WindowSize, 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 UINTN *WindowSize, 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 UINTN *WindowSize, 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 UINTN *WindowSize, 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 UINTN *WindowSize, IN OUT UINT64 *BufferSize)
 
EFI_STATUS PxeBcTftpReadFile (IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINTN *WindowSize, 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 UINTN *WindowSize, 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 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PxeBcMtftp.c.

Function Documentation

◆ PxeBcMtftp4CheckPacket()

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]ThisPointer to EFI_MTFTP4_PROTOCOL.
[in]TokenPointer to EFI_MTFTP4_TOKEN.
[in]PacketLenLength of EFI_MTFTP4_PACKET.
[in]PacketPointer to EFI_MTFTP4_PACKET to be checked.
Return values
EFI_SUCCESSThe current operation succeeded.
EFI_ABORTEDAbort the current transfer process.

Definition at line 518 of file PxeBcMtftp.c.

◆ PxeBcMtftp4GetFileSize()

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

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

Parameters
[in]PrivatePointer to PxeBc private data.
[in]ConfigPointer to EFI_MTFTP4_CONFIG_DATA.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in,out]BufferSizePointer to buffer size.
Return values
EFI_SUCCESSSuccessfully obtained the size of file.
EFI_NOT_FOUNDParse the tftp options failed.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersDid not obtain the size of the file.

Definition at line 592 of file PxeBcMtftp.c.

◆ PxeBcMtftp4ReadDirectory()

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

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

Parameters
[in]PrivatePointer to PxeBc private data.
[in]ConfigPointer to EFI_MTFTP4_CONFIG_DATA.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
[in]DontUseBufferIndicates whether to use a receive buffer.
Return values
EFI_SUCCESSSuccessfully obtained the data from the file included in the directory.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersOperation failed.

Definition at line 902 of file PxeBcMtftp.c.

◆ PxeBcMtftp4ReadFile()

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

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

Parameters
[in]PrivatePointer to PxeBc private data.
[in]ConfigPointer to EFI_MTFTP4_CONFIG_DATA.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
[in]DontUseBufferIndicates whether to use a receive buffer.
Return values
EFI_SUCCESSSuccessfully read the data from the special file.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersRead data from file failed.

Definition at line 736 of file PxeBcMtftp.c.

◆ PxeBcMtftp4WriteFile()

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]PrivatePointer to PxeBc private data.
[in]ConfigPointer to EFI_MTFTP4_CONFIG_DATA.
[in]FilenamePointer to boot file name.
[in]OverwriteIndicates whether to use the overwrite attribute.
[in]BlockSizePointer to required block size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
Return values
EFI_SUCCESSSuccessfully write the data into the special file.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
otherWrite data into file failed.

Definition at line 827 of file PxeBcMtftp.c.

◆ PxeBcMtftp6CheckPacket()

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]ThisPointer to EFI_MTFTP6_PROTOCOL.
[in]TokenPointer to EFI_MTFTP6_TOKEN.
[in]PacketLenLength of EFI_MTFTP6_PACKET.
[in]PacketPointer to EFI_MTFTP6_PACKET to be checked.
Return values
EFI_SUCCESSThe current operation succeeded.
EFI_ABORTEDAbort the current transfer process.

Definition at line 40 of file PxeBcMtftp.c.

◆ PxeBcMtftp6GetFileSize()

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

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

Parameters
[in]PrivatePointer to PxeBc private data.
[in]ConfigPointer to EFI_MTFTP6_CONFIG_DATA.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in,out]BufferSizePointer to buffer size.
Return values
EFI_SUCCESSSuccessfully obtained the size of file.
EFI_NOT_FOUNDParse the tftp options failed.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersHas not obtained the size of the file.

Definition at line 114 of file PxeBcMtftp.c.

◆ PxeBcMtftp6ReadDirectory()

EFI_STATUS PxeBcMtftp6ReadDirectory ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_MTFTP6_CONFIG_DATA Config,
IN UINT8 *  Filename,
IN UINTN BlockSize,
IN UINTN WindowSize,
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]PrivatePointer to PxeBc private data.
[in]ConfigPointer to EFI_MTFTP6_CONFIG_DATA.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
[in]DontUseBufferIndicates whether to use a receive buffer.
Return values
EFI_SUCCESSSuccessfully obtained the data from the file included in directory.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersOperation failed.

Definition at line 424 of file PxeBcMtftp.c.

◆ PxeBcMtftp6ReadFile()

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

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

Parameters
[in]PrivatePointer to PxeBc private data.
[in]ConfigPointer to EFI_MTFTP6_CONFIG_DATA.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
[in]DontUseBufferIndicates whether with a receive buffer.
Return values
EFI_SUCCESSSuccessfully read the data from the special file.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersRead data from file failed.

Definition at line 258 of file PxeBcMtftp.c.

◆ PxeBcMtftp6WriteFile()

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]PrivatePointer to PxeBc private data.
[in]ConfigPointer to EFI_MTFTP6_CONFIG_DATA.
[in]FilenamePointer to boot file name.
[in]OverwriteIndicate whether with overwrite attribute.
[in]BlockSizePointer to required block size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
Return values
EFI_SUCCESSSuccessfully wrote the data into a special file.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
otherWrite data into file failed.

Definition at line 349 of file PxeBcMtftp.c.

◆ PxeBcTftpGetFileSize()

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

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

Parameters
[in]PrivatePointer to PxeBc private data.
[in]ConfigPointer to configure data.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in,out]BufferSizePointer to buffer size.
Return values
EFI_SUCCESSSuccessfully obtained the size of file.
EFI_NOT_FOUNDParse the tftp options failed.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersDid not obtain the size of the file.

Definition at line 993 of file PxeBcMtftp.c.

◆ PxeBcTftpReadDirectory()

EFI_STATUS PxeBcTftpReadDirectory ( IN PXEBC_PRIVATE_DATA Private,
IN VOID *  Config,
IN UINT8 *  Filename,
IN UINTN BlockSize,
IN UINTN WindowSize,
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]PrivatePointer to PxeBc private data.
[in]ConfigPointer to config data.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
[in]DontUseBufferIndicatse whether to use a receive buffer.
Return values
EFI_SUCCESSSuccessfully obtained the data from the file included in the directory.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersOperation failed.

Definition at line 1145 of file PxeBcMtftp.c.

◆ PxeBcTftpReadFile()

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

This function is a wrapper to get file using TFTP.

Parameters
[in]PrivatePointer to PxeBc private data.
[in]ConfigPointer to config data.
[in]FilenamePointer to boot file name.
[in]BlockSizePointer to required block size.
[in]WindowSizePointer to required window size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
[in]DontUseBufferIndicates whether to use a receive buffer.
Return values
EFI_SUCCESSSuccessfully read the data from the special file.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
OthersRead data from file failed.

Definition at line 1041 of file PxeBcMtftp.c.

◆ PxeBcTftpWriteFile()

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]PrivatePointer to PxeBc private data.
[in]ConfigPointer to config data.
[in]FilenamePointer to boot file name.
[in]OverwriteIndicate whether with overwrite attribute.
[in]BlockSizePointer to required block size.
[in]BufferPtrPointer to buffer.
[in,out]BufferSizePointer to buffer size.
Return values
EFI_SUCCESSSuccessfully wrote the data into a special file.
EFI_DEVICE_ERRORThe network device encountered an error during this operation.
otherWrite data into file failed.

Definition at line 1094 of file PxeBcMtftp.c.

Variable Documentation

◆ mMtftpOptions

CHAR8* mMtftpOptions[PXE_MTFTP_OPTION_MAXIMUM_INDEX]
Initial value:
= {
"blksize",
"timeout",
"tsize",
"multicast",
"windowsize"
}

Definition at line 12 of file PxeBcMtftp.c.