]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.h
2ef04506264b10c35abbd37539259e18107bd0c3
[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 This function is to get data of a file by Tftp.
54
55 @param Private Pointer to PxeBc private data
56 @param Config Pointer to Mtftp configuration data
57 @param Filename Pointer to file name
58 @param BlockSize Pointer to block size
59 @param BufferPtr Pointer to buffer
60 @param BufferSize Pointer to buffer size
61 @param DontUseBuffer Indicate whether with a receive buffer
62
63 @retval EFI_SUCCESS Read the data success from the special file.
64 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
65 @retval other Read data from file failed.
66
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 This function is put data of a file by Tftp.
82
83 @param Private Pointer to PxeBc private data
84 @param Config Pointer to Mtftp configuration data
85 @param Filename Pointer to file name
86 @param Overwrite Indicate whether with overwrite attribute
87 @param BlockSize Pointer to block size
88 @param BufferPtr Pointer to buffer
89 @param BufferSize Pointer to buffer size
90
91 @retval EFI_SUCCESS Write the data success into the special file.
92 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
93 @retval other Write data into file failed.
94
95 **/
96 EFI_STATUS
97 PxeBcTftpWriteFile (
98 IN PXEBC_PRIVATE_DATA *Private,
99 IN EFI_MTFTP4_CONFIG_DATA *Config,
100 IN UINT8 *Filename,
101 IN BOOLEAN Overwrite,
102 IN UINTN *BlockSize,
103 IN UINT8 *BufferPtr,
104 IN OUT UINT64 *BufferSize
105 );
106
107
108 /**
109 This function is to get data(file) from a directory(may be a server) by Tftp.
110
111 @param Private Pointer to PxeBc private data.
112 @param Config Pointer to Mtftp configuration data.
113 @param Filename Pointer to file name.
114 @param BlockSize Pointer to block size.
115 @param BufferPtr Pointer to buffer.
116 @param BufferSize Pointer to buffer size.
117 @param DontUseBuffer Indicate whether with a receive buffer.
118
119 @retval EFI_SUCCES Get the data from the file included in directory success.
120 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
121 @retval other Operation failed.
122
123 **/
124 EFI_STATUS
125 PxeBcTftpReadDirectory (
126 IN PXEBC_PRIVATE_DATA *Private,
127 IN EFI_MTFTP4_CONFIG_DATA *Config,
128 IN UINT8 *Filename,
129 IN UINTN *BlockSize,
130 IN UINT8 *BufferPtr,
131 IN OUT UINT64 *BufferSize,
132 IN BOOLEAN DontUseBuffer
133 );
134
135 #endif
136