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