2 Mtftp routines for PxeBc.
4 Copyright (c) 2007, Intel Corporation.<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __EFI_PXEBC_MTFTP_H__
16 #define __EFI_PXEBC_MTFTP_H__
19 PXE_MTFTP_OPTION_BLKSIZE_INDEX
,
20 PXE_MTFTP_OPTION_TIMEOUT_INDEX
,
21 PXE_MTFTP_OPTION_TSIZE_INDEX
,
22 PXE_MTFTP_OPTION_MULTICAST_INDEX
,
23 PXE_MTFTP_OPTION_MAXIMUM_INDEX
24 } PXE_MTFTP_OPTION_ENUM_TYPES
;
28 This function is to get size of a file by Tftp.
30 @param Private Pointer to PxeBc private data
31 @param Config Pointer to Mtftp configuration data
32 @param Filename Pointer to file name
33 @param BlockSize Pointer to block size
34 @param BufferSize Pointer to buffer size
36 @retval EFI_SUCCESS Get the size of file success
37 @retval EFI_NOT_FOUND Parse the tftp ptions failed.
38 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
39 @retval Other Has not get the size of the file.
43 PxeBcTftpGetFileSize (
44 IN PXEBC_PRIVATE_DATA
*Private
,
45 IN EFI_MTFTP4_CONFIG_DATA
*Config
,
48 IN OUT UINT64
*BufferSize
54 This function is to get data of a file by Tftp.
56 @param Private Pointer to PxeBc private data
57 @param Config Pointer to Mtftp configuration data
58 @param Filename Pointer to file name
59 @param BlockSize Pointer to block size
60 @param BufferPtr Pointer to buffer
61 @param BufferSize Pointer to buffer size
62 @param DontUseBuffer Indicate whether with a receive buffer
64 @retval EFI_SUCCESS Read the data success from the special file.
65 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
66 @retval other Read data from file failed.
70 IN PXEBC_PRIVATE_DATA
*Private
,
71 IN EFI_MTFTP4_CONFIG_DATA
*Config
,
75 IN OUT UINT64
*BufferSize
,
76 IN BOOLEAN DontUseBuffer
82 This function is put data of a file by Tftp.
84 @param Private Pointer to PxeBc private data
85 @param Config Pointer to Mtftp configuration data
86 @param Filename Pointer to file name
87 @param Overwrite Indicate whether with overwrite attribute
88 @param BlockSize Pointer to block size
89 @param BufferPtr Pointer to buffer
90 @param BufferSize Pointer to buffer size
92 @retval EFI_SUCCESS Write the data success into the special file.
93 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
94 @retval other Write data into file failed.
99 IN PXEBC_PRIVATE_DATA
*Private
,
100 IN EFI_MTFTP4_CONFIG_DATA
*Config
,
102 IN BOOLEAN Overwrite
,
105 IN OUT UINT64
*BufferSize
111 This function is to get data(file) from a directory(may be a server) by Tftp.
113 @param Private Pointer to PxeBc private data.
114 @param Config Pointer to Mtftp configuration data.
115 @param Filename Pointer to file name.
116 @param BlockSize Pointer to block size.
117 @param BufferPtr Pointer to buffer.
118 @param BufferSize Pointer to buffer size.
119 @param DontUseBuffer Indicate whether with a receive buffer.
121 @retval EFI_SUCCES Get the data from the file included in directory success.
122 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
123 @retval other Operation failed.
127 PxeBcTftpReadDirectory (
128 IN PXEBC_PRIVATE_DATA
*Private
,
129 IN EFI_MTFTP4_CONFIG_DATA
*Config
,
133 IN OUT UINT64
*BufferSize
,
134 IN BOOLEAN DontUseBuffer