]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h
Clean up the private GUID definition in module Level.
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcMtftp.h
1 /** @file
2 Functions declaration related with Mtftp for UefiPxeBc Driver.
3
4 Copyright (c) 2007 - 2010, 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_MAXIMUM_INDEX 4
24
25 #define PXE_MTFTP_ERROR_STRING_LENGTH 127 // refer to definition of struct EFI_PXE_BASE_CODE_TFTP_ERROR.
26 #define PXE_MTFTP_DEFAULT_BLOCK_SIZE 512 // refer to rfc-1350.
27
28
29 /**
30 This function is wrapper to get the file size using TFTP.
31
32 @param[in] Private Pointer to PxeBc private data.
33 @param[in] Config Pointer to configure data.
34 @param[in] Filename Pointer to boot file name.
35 @param[in] BlockSize Pointer to required block size.
36 @param[in, out] BufferSize Pointer to buffer size.
37
38 @retval EFI_SUCCESS Successfully obtained the size of file.
39 @retval EFI_NOT_FOUND Parse the tftp ptions failed.
40 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
41 @retval Others Did not obtain the size of the file.
42
43 **/
44 EFI_STATUS
45 PxeBcTftpGetFileSize (
46 IN PXEBC_PRIVATE_DATA *Private,
47 IN VOID *Config,
48 IN UINT8 *Filename,
49 IN UINTN *BlockSize,
50 IN OUT UINT64 *BufferSize
51 );
52
53
54 /**
55 This function is a wrapper to get a file using TFTP.
56
57 @param[in] Private Pointer to PxeBc private data.
58 @param[in] Config Pointer to config data.
59 @param[in] Filename Pointer to boot file name.
60 @param[in] BlockSize Pointer to required block size.
61 @param[in] BufferPtr Pointer to buffer.
62 @param[in, out] BufferSize Pointer to buffer size.
63 @param[in] DontUseBuffer Indicates whether to use a receive buffer.
64
65 @retval EFI_SUCCESS Successfully read the data from the special file.
66 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
67 @retval Others Read data from file failed.
68
69 **/
70 EFI_STATUS
71 PxeBcTftpReadFile (
72 IN PXEBC_PRIVATE_DATA *Private,
73 IN VOID *Config,
74 IN UINT8 *Filename,
75 IN UINTN *BlockSize,
76 IN UINT8 *BufferPtr,
77 IN OUT UINT64 *BufferSize,
78 IN BOOLEAN DontUseBuffer
79 );
80
81
82 /**
83 This function is a wrapper to put file with TFTP.
84
85 @param[in] Private Pointer to PxeBc private data.
86 @param[in] Config Pointer to config data.
87 @param[in] Filename Pointer to boot file name.
88 @param[in] Overwrite Indicates whether to use an overwrite attribute.
89 @param[in] BlockSize Pointer to required block size.
90 @param[in] BufferPtr Pointer to buffer.
91 @param[in, out] BufferSize Pointer to buffer size.
92
93 @retval EFI_SUCCESS Successfully wrote the data into the special file.
94 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
95 @retval other Write data into file failed.
96
97 **/
98 EFI_STATUS
99 PxeBcTftpWriteFile (
100 IN PXEBC_PRIVATE_DATA *Private,
101 IN VOID *Config,
102 IN UINT8 *Filename,
103 IN BOOLEAN Overwrite,
104 IN UINTN *BlockSize,
105 IN UINT8 *BufferPtr,
106 IN OUT UINT64 *BufferSize
107 );
108
109
110 /**
111 This function is a wrapper to get the data (file) from a directory using TFTP.
112
113 @param[in] Private Pointer to PxeBc private data.
114 @param[in] Config Pointer to config data.
115 @param[in] Filename Pointer to boot file name.
116 @param[in] BlockSize Pointer to required block size.
117 @param[in] BufferPtr Pointer to buffer.
118 @param[in, out] BufferSize Pointer to buffer size.
119 @param[in] DontUseBuffer Indicates whether with a receive buffer.
120
121 @retval EFI_SUCCES Successfully obtained the data from the file included in directory.
122 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
123 @retval Others Operation failed.
124
125 **/
126 EFI_STATUS
127 PxeBcTftpReadDirectory (
128 IN PXEBC_PRIVATE_DATA *Private,
129 IN VOID *Config,
130 IN UINT8 *Filename,
131 IN UINTN *BlockSize,
132 IN UINT8 *BufferPtr,
133 IN OUT UINT64 *BufferSize,
134 IN BOOLEAN DontUseBuffer
135 );
136 #endif