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
53 This function is to get data of a file by Tftp.
55 @param Private Pointer to PxeBc private data
56 @param Config Pointer to Mtftp configuration data
57 @param Filename Pointer to file name
58 @param BlockSize Pointer to block size
59 @param BufferPtr Pointer to buffer
60 @param BufferSize Pointer to buffer size
61 @param DontUseBuffer Indicate whether with a receive buffer
63 @retval EFI_SUCCESS Read the data success from the special file.
64 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
65 @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
81 This function is put data of a file by Tftp.
83 @param Private Pointer to PxeBc private data
84 @param Config Pointer to Mtftp configuration data
85 @param Filename Pointer to file name
86 @param Overwrite Indicate whether with overwrite attribute
87 @param BlockSize Pointer to block size
88 @param BufferPtr Pointer to buffer
89 @param BufferSize Pointer to buffer size
91 @retval EFI_SUCCESS Write the data success into the special file.
92 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
93 @retval other Write data into file failed.
98 IN PXEBC_PRIVATE_DATA
*Private
,
99 IN EFI_MTFTP4_CONFIG_DATA
*Config
,
101 IN BOOLEAN Overwrite
,
104 IN OUT UINT64
*BufferSize
109 This function is to get data(file) from a directory(may be a server) by Tftp.
111 @param Private Pointer to PxeBc private data.
112 @param Config Pointer to Mtftp configuration data.
113 @param Filename Pointer to file name.
114 @param BlockSize Pointer to block size.
115 @param BufferPtr Pointer to buffer.
116 @param BufferSize Pointer to buffer size.
117 @param DontUseBuffer Indicate whether with a receive buffer.
119 @retval EFI_SUCCES Get the data from the file included in directory success.
120 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
121 @retval other Operation failed.
125 PxeBcTftpReadDirectory (
126 IN PXEBC_PRIVATE_DATA
*Private
,
127 IN EFI_MTFTP4_CONFIG_DATA
*Config
,
131 IN OUT UINT64
*BufferSize
,
132 IN BOOLEAN DontUseBuffer