]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h
NetworkPkg/UefiPxeBcDxe: Correct comments to align with the input parameter.
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcMtftp.h
1 /** @file
2 Functions declaration related with Mtftp for UefiPxeBc Driver.
3
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __EFI_PXEBC_MTFTP_H__
17 #define __EFI_PXEBC_MTFTP_H__
18
19 #define PXE_MTFTP_OPTION_BLKSIZE_INDEX 0
20 #define PXE_MTFTP_OPTION_TIMEOUT_INDEX 1
21 #define PXE_MTFTP_OPTION_TSIZE_INDEX 2
22 #define PXE_MTFTP_OPTION_MULTICAST_INDEX 3
23 #define PXE_MTFTP_OPTION_WINDOWSIZE_INDEX 4
24 #define PXE_MTFTP_OPTION_MAXIMUM_INDEX 5
25 #define PXE_MTFTP_OPTBUF_MAXNUM_INDEX 128
26
27 #define PXE_MTFTP_ERROR_STRING_LENGTH 127 // refer to definition of struct EFI_PXE_BASE_CODE_TFTP_ERROR.
28 #define PXE_MTFTP_DEFAULT_BLOCK_SIZE 512 // refer to rfc-1350.
29
30
31 /**
32 This function is wrapper to get the file size using TFTP.
33
34 @param[in] Private Pointer to PxeBc private data.
35 @param[in] Config Pointer to configure data.
36 @param[in] Filename Pointer to boot file name.
37 @param[in] BlockSize Pointer to required block size.
38 @param[in] WindowSize Pointer to required window size.
39 @param[in, out] BufferSize Pointer to buffer size.
40
41 @retval EFI_SUCCESS Successfully obtained the size of file.
42 @retval EFI_NOT_FOUND Parse the tftp ptions failed.
43 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
44 @retval Others Did not obtain the size of the file.
45
46 **/
47 EFI_STATUS
48 PxeBcTftpGetFileSize (
49 IN PXEBC_PRIVATE_DATA *Private,
50 IN VOID *Config,
51 IN UINT8 *Filename,
52 IN UINTN *BlockSize,
53 IN UINTN *WindowSize,
54 IN OUT UINT64 *BufferSize
55 );
56
57
58 /**
59 This function is a wrapper to get a file using TFTP.
60
61 @param[in] Private Pointer to PxeBc private data.
62 @param[in] Config Pointer to config data.
63 @param[in] Filename Pointer to boot file name.
64 @param[in] BlockSize Pointer to required block size.
65 @param[in] WindowSize Pointer to required window size.
66 @param[in] BufferPtr Pointer to buffer.
67 @param[in, out] BufferSize Pointer to buffer size.
68 @param[in] DontUseBuffer Indicates whether to use a receive buffer.
69
70 @retval EFI_SUCCESS Successfully read the data from the special file.
71 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
72 @retval Others Read data from file failed.
73
74 **/
75 EFI_STATUS
76 PxeBcTftpReadFile (
77 IN PXEBC_PRIVATE_DATA *Private,
78 IN VOID *Config,
79 IN UINT8 *Filename,
80 IN UINTN *BlockSize,
81 IN UINTN *WindowSize,
82 IN UINT8 *BufferPtr,
83 IN OUT UINT64 *BufferSize,
84 IN BOOLEAN DontUseBuffer
85 );
86
87
88 /**
89 This function is a wrapper to put file with TFTP.
90
91 @param[in] Private Pointer to PxeBc private data.
92 @param[in] Config Pointer to config data.
93 @param[in] Filename Pointer to boot file name.
94 @param[in] Overwrite Indicates whether to use an overwrite attribute.
95 @param[in] BlockSize Pointer to required block size.
96 @param[in] BufferPtr Pointer to buffer.
97 @param[in, out] BufferSize Pointer to buffer size.
98
99 @retval EFI_SUCCESS Successfully wrote the data into the special file.
100 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
101 @retval other Write data into file failed.
102
103 **/
104 EFI_STATUS
105 PxeBcTftpWriteFile (
106 IN PXEBC_PRIVATE_DATA *Private,
107 IN VOID *Config,
108 IN UINT8 *Filename,
109 IN BOOLEAN Overwrite,
110 IN UINTN *BlockSize,
111 IN UINT8 *BufferPtr,
112 IN OUT UINT64 *BufferSize
113 );
114
115
116 /**
117 This function is a wrapper to get the data (file) from a directory using TFTP.
118
119 @param[in] Private Pointer to PxeBc private data.
120 @param[in] Config Pointer to config data.
121 @param[in] Filename Pointer to boot file name.
122 @param[in] BlockSize Pointer to required block size.
123 @param[in] WindowSize Pointer to required window size.
124 @param[in] BufferPtr Pointer to buffer.
125 @param[in, out] BufferSize Pointer to buffer size.
126 @param[in] DontUseBuffer Indicates whether with a receive buffer.
127
128 @retval EFI_SUCCES Successfully obtained the data from the file included in directory.
129 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
130 @retval Others Operation failed.
131
132 **/
133 EFI_STATUS
134 PxeBcTftpReadDirectory (
135 IN PXEBC_PRIVATE_DATA *Private,
136 IN VOID *Config,
137 IN UINT8 *Filename,
138 IN UINTN *BlockSize,
139 IN UINTN *WindowSize,
140 IN UINT8 *BufferPtr,
141 IN OUT UINT64 *BufferSize,
142 IN BOOLEAN DontUseBuffer
143 );
144 #endif