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