]>
git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h
2 Functions declaration related with Mtftp for UefiPxeBc Driver.
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __EFI_PXEBC_MTFTP_H__
11 #define __EFI_PXEBC_MTFTP_H__
13 #define PXE_MTFTP_OPTION_BLKSIZE_INDEX 0
14 #define PXE_MTFTP_OPTION_TIMEOUT_INDEX 1
15 #define PXE_MTFTP_OPTION_TSIZE_INDEX 2
16 #define PXE_MTFTP_OPTION_MULTICAST_INDEX 3
17 #define PXE_MTFTP_OPTION_WINDOWSIZE_INDEX 4
18 #define PXE_MTFTP_OPTION_MAXIMUM_INDEX 5
19 #define PXE_MTFTP_OPTBUF_MAXNUM_INDEX 128
21 #define PXE_MTFTP_ERROR_STRING_LENGTH 127 // refer to definition of struct EFI_PXE_BASE_CODE_TFTP_ERROR.
22 #define PXE_MTFTP_DEFAULT_BLOCK_SIZE 512 // refer to rfc-1350.
25 This function is wrapper to get the file size using TFTP.
27 @param[in] Private Pointer to PxeBc private data.
28 @param[in] Config Pointer to configure data.
29 @param[in] Filename Pointer to boot file name.
30 @param[in] BlockSize Pointer to required block size.
31 @param[in] WindowSize Pointer to required window size.
32 @param[in, out] BufferSize Pointer to buffer size.
34 @retval EFI_SUCCESS Successfully obtained the size of file.
35 @retval EFI_NOT_FOUND Parse the tftp options failed.
36 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
37 @retval Others Did not obtain the size of the file.
41 PxeBcTftpGetFileSize (
42 IN PXEBC_PRIVATE_DATA
*Private
,
47 IN OUT UINT64
*BufferSize
51 This function is a wrapper to get a file using TFTP.
53 @param[in] Private Pointer to PxeBc private data.
54 @param[in] Config Pointer to config data.
55 @param[in] Filename Pointer to boot file name.
56 @param[in] BlockSize Pointer to required block size.
57 @param[in] WindowSize Pointer to required window size.
58 @param[in] BufferPtr Pointer to buffer.
59 @param[in, out] BufferSize Pointer to buffer size.
60 @param[in] DontUseBuffer Indicates whether to use a receive buffer.
62 @retval EFI_SUCCESS Successfully read the data from the special file.
63 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
64 @retval Others Read data from file failed.
69 IN PXEBC_PRIVATE_DATA
*Private
,
75 IN OUT UINT64
*BufferSize
,
76 IN BOOLEAN DontUseBuffer
80 This function is a wrapper to put file with TFTP.
82 @param[in] Private Pointer to PxeBc private data.
83 @param[in] Config Pointer to config data.
84 @param[in] Filename Pointer to boot file name.
85 @param[in] Overwrite Indicates whether to use an overwrite attribute.
86 @param[in] BlockSize Pointer to required block size.
87 @param[in] BufferPtr Pointer to buffer.
88 @param[in, out] BufferSize Pointer to buffer size.
90 @retval EFI_SUCCESS Successfully wrote the data into the special file.
91 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
92 @retval other Write data into file failed.
97 IN PXEBC_PRIVATE_DATA
*Private
,
100 IN BOOLEAN Overwrite
,
103 IN OUT UINT64
*BufferSize
107 This function is a wrapper to get the data (file) from a directory using TFTP.
109 @param[in] Private Pointer to PxeBc private data.
110 @param[in] Config Pointer to config data.
111 @param[in] Filename Pointer to boot file name.
112 @param[in] BlockSize Pointer to required block size.
113 @param[in] WindowSize Pointer to required window size.
114 @param[in] BufferPtr Pointer to buffer.
115 @param[in, out] BufferSize Pointer to buffer size.
116 @param[in] DontUseBuffer Indicates whether with a receive buffer.
118 @retval EFI_SUCCESS Successfully obtained the data from the file included in directory.
119 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
120 @retval Others Operation failed.
124 PxeBcTftpReadDirectory (
125 IN PXEBC_PRIVATE_DATA
*Private
,
129 IN UINTN
*WindowSize
,
131 IN OUT UINT64
*BufferSize
,
132 IN BOOLEAN DontUseBuffer