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