]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.h
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcMtftp.h
1 /** @file
2 Mtftp routines for PxeBc.
3
4 Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>
5 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 #define PXE_MTFTP_OPTION_BLKSIZE_INDEX 0
19 #define PXE_MTFTP_OPTION_TIMEOUT_INDEX 1
20 #define PXE_MTFTP_OPTION_TSIZE_INDEX 2
21 #define PXE_MTFTP_OPTION_MULTICAST_INDEX 3
22 #define PXE_MTFTP_OPTION_MAXIMUM_INDEX 4
23
24
25 /**
26 This function is to get size of a file by Tftp.
27
28 @param Private Pointer to PxeBc private data
29 @param Config Pointer to Mtftp configuration data
30 @param Filename Pointer to file name
31 @param BlockSize Pointer to block size
32 @param BufferSize Pointer to buffer size
33
34 @retval EFI_SUCCESS Get the size of file success
35 @retval EFI_NOT_FOUND Parse the tftp ptions failed.
36 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
37 @retval Other Has not get the size of the file.
38
39 **/
40 EFI_STATUS
41 PxeBcTftpGetFileSize (
42 IN PXEBC_PRIVATE_DATA *Private,
43 IN EFI_MTFTP4_CONFIG_DATA *Config,
44 IN UINT8 *Filename,
45 IN UINTN *BlockSize,
46 IN OUT UINT64 *BufferSize
47 );
48
49
50 /**
51 This function is to get data of a file by Tftp.
52
53 @param Private Pointer to PxeBc private data
54 @param Config Pointer to Mtftp configuration data
55 @param Filename Pointer to file name
56 @param BlockSize Pointer to block size
57 @param BufferPtr Pointer to buffer
58 @param BufferSize Pointer to buffer size
59 @param DontUseBuffer Indicate whether with a receive buffer
60
61 @retval EFI_SUCCESS Read the data success from the special file.
62 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
63 @retval other Read data from file failed.
64
65 **/
66 EFI_STATUS
67 PxeBcTftpReadFile (
68 IN PXEBC_PRIVATE_DATA *Private,
69 IN EFI_MTFTP4_CONFIG_DATA *Config,
70 IN UINT8 *Filename,
71 IN UINTN *BlockSize,
72 IN UINT8 *BufferPtr,
73 IN OUT UINT64 *BufferSize,
74 IN BOOLEAN DontUseBuffer
75 );
76
77
78 /**
79 This function is put data of a file by Tftp.
80
81 @param Private Pointer to PxeBc private data
82 @param Config Pointer to Mtftp configuration data
83 @param Filename Pointer to file name
84 @param Overwrite Indicate whether with overwrite attribute
85 @param BlockSize Pointer to block size
86 @param BufferPtr Pointer to buffer
87 @param BufferSize Pointer to buffer size
88
89 @retval EFI_SUCCESS Write the data success into the special file.
90 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
91 @retval other Write data into file failed.
92
93 **/
94 EFI_STATUS
95 PxeBcTftpWriteFile (
96 IN PXEBC_PRIVATE_DATA *Private,
97 IN EFI_MTFTP4_CONFIG_DATA *Config,
98 IN UINT8 *Filename,
99 IN BOOLEAN Overwrite,
100 IN UINTN *BlockSize,
101 IN UINT8 *BufferPtr,
102 IN OUT UINT64 *BufferSize
103 );
104
105
106 /**
107 This function is to get data(file) from a directory(may be a server) by Tftp.
108
109 @param Private Pointer to PxeBc private data.
110 @param Config Pointer to Mtftp configuration data.
111 @param Filename Pointer to file name.
112 @param BlockSize Pointer to block size.
113 @param BufferPtr Pointer to buffer.
114 @param BufferSize Pointer to buffer size.
115 @param DontUseBuffer Indicate whether with a receive buffer.
116
117 @retval EFI_SUCCES Get the data from the file included in directory success.
118 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
119 @retval other Operation failed.
120
121 **/
122 EFI_STATUS
123 PxeBcTftpReadDirectory (
124 IN PXEBC_PRIVATE_DATA *Private,
125 IN EFI_MTFTP4_CONFIG_DATA *Config,
126 IN UINT8 *Filename,
127 IN UINTN *BlockSize,
128 IN UINT8 *BufferPtr,
129 IN OUT UINT64 *BufferSize,
130 IN BOOLEAN DontUseBuffer
131 );
132
133 #endif
134