]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.h
NetworkPkg: Remove some clarification from IScsiDxe.inf
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcMtftp.h
CommitLineData
30368135 1/** @file\r
f737cfb9 2 Mtftp routines for PxeBc.\r
d1102dba
LG
3\r
4Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials\r
30368135 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
30368135 13**/\r
14\r
15#ifndef __EFI_PXEBC_MTFTP_H__\r
16#define __EFI_PXEBC_MTFTP_H__\r
17\r
f6b7393c 18#define PXE_MTFTP_OPTION_BLKSIZE_INDEX 0\r
19#define PXE_MTFTP_OPTION_TIMEOUT_INDEX 1\r
20#define PXE_MTFTP_OPTION_TSIZE_INDEX 2\r
21#define PXE_MTFTP_OPTION_MULTICAST_INDEX 3\r
22#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 4\r
30368135 23\r
a361d391 24#define PXE_MTFTP_ERROR_STRING_LENGTH 127\r
206b5f51 25#define PXE_MTFTP_OPTBUF_MAXNUM_INDEX 128\r
a361d391 26\r
30368135 27\r
28/**\r
29 This function is to get size of a file by Tftp.\r
d1102dba 30\r
30368135 31 @param Private Pointer to PxeBc private data\r
32 @param Config Pointer to Mtftp configuration data\r
33 @param Filename Pointer to file name\r
34 @param BlockSize Pointer to block size\r
35 @param BufferSize Pointer to buffer size\r
36\r
f737cfb9 37 @retval EFI_SUCCESS Get the size of file success\r
38 @retval EFI_NOT_FOUND Parse the tftp ptions failed.\r
39 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r
40 @retval Other Has not get the size of the file.\r
d1102dba 41\r
30368135 42**/\r
43EFI_STATUS\r
44PxeBcTftpGetFileSize (\r
45 IN PXEBC_PRIVATE_DATA *Private,\r
46 IN EFI_MTFTP4_CONFIG_DATA *Config,\r
47 IN UINT8 *Filename,\r
48 IN UINTN *BlockSize,\r
49 IN OUT UINT64 *BufferSize\r
d59b8b55 50 );\r
30368135 51\r
52\r
53/**\r
54 This function is to get data of a file by Tftp.\r
55\r
56 @param Private Pointer to PxeBc private data\r
57 @param Config Pointer to Mtftp configuration data\r
58 @param Filename Pointer to file name\r
59 @param BlockSize Pointer to block size\r
60 @param BufferPtr Pointer to buffer\r
61 @param BufferSize Pointer to buffer size\r
62 @param DontUseBuffer Indicate whether with a receive buffer\r
63\r
f737cfb9 64 @retval EFI_SUCCESS Read the data success from the special file.\r
65 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r
66 @retval other Read data from file failed.\r
d1102dba 67\r
30368135 68**/\r
69EFI_STATUS\r
70PxeBcTftpReadFile (\r
71 IN PXEBC_PRIVATE_DATA *Private,\r
72 IN EFI_MTFTP4_CONFIG_DATA *Config,\r
73 IN UINT8 *Filename,\r
74 IN UINTN *BlockSize,\r
75 IN UINT8 *BufferPtr,\r
76 IN OUT UINT64 *BufferSize,\r
77 IN BOOLEAN DontUseBuffer\r
d59b8b55 78 );\r
30368135 79\r
80\r
81/**\r
82 This function is put data of a file by Tftp.\r
83\r
84 @param Private Pointer to PxeBc private data\r
85 @param Config Pointer to Mtftp configuration data\r
86 @param Filename Pointer to file name\r
87 @param Overwrite Indicate whether with overwrite attribute\r
88 @param BlockSize Pointer to block size\r
89 @param BufferPtr Pointer to buffer\r
90 @param BufferSize Pointer to buffer size\r
91\r
f737cfb9 92 @retval EFI_SUCCESS Write the data success into the special file.\r
93 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r
94 @retval other Write data into file failed.\r
d1102dba 95\r
30368135 96**/\r
97EFI_STATUS\r
98PxeBcTftpWriteFile (\r
99 IN PXEBC_PRIVATE_DATA *Private,\r
100 IN EFI_MTFTP4_CONFIG_DATA *Config,\r
101 IN UINT8 *Filename,\r
102 IN BOOLEAN Overwrite,\r
103 IN UINTN *BlockSize,\r
104 IN UINT8 *BufferPtr,\r
105 IN OUT UINT64 *BufferSize\r
d59b8b55 106 );\r
30368135 107\r
108\r
109/**\r
f737cfb9 110 This function is to get data(file) from a directory(may be a server) by Tftp.\r
111\r
112 @param Private Pointer to PxeBc private data.\r
113 @param Config Pointer to Mtftp configuration data.\r
114 @param Filename Pointer to file name.\r
115 @param BlockSize Pointer to block size.\r
116 @param BufferPtr Pointer to buffer.\r
117 @param BufferSize Pointer to buffer size.\r
118 @param DontUseBuffer Indicate whether with a receive buffer.\r
119\r
d1102dba 120 @retval EFI_SUCCES Get the data from the file included in directory success.\r
f737cfb9 121 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r
122 @retval other Operation failed.\r
d1102dba 123\r
30368135 124**/\r
125EFI_STATUS\r
126PxeBcTftpReadDirectory (\r
127 IN PXEBC_PRIVATE_DATA *Private,\r
128 IN EFI_MTFTP4_CONFIG_DATA *Config,\r
129 IN UINT8 *Filename,\r
130 IN UINTN *BlockSize,\r
131 IN UINT8 *BufferPtr,\r
132 IN OUT UINT64 *BufferSize,\r
133 IN BOOLEAN DontUseBuffer\r
d59b8b55 134 );\r
30368135 135\r
136#endif\r
137\r