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