TianoCore EDK2 master
Loading...
Searching...
No Matches
Mtftp4.h
Go to the documentation of this file.
1
12#ifndef __EFI_MTFTP4_PROTOCOL_H__
13#define __EFI_MTFTP4_PROTOCOL_H__
14
15#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \
16 { \
17 0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \
18 }
19
20#define EFI_MTFTP4_PROTOCOL_GUID \
21 { \
22 0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b } \
23 }
24
27
28//
29// MTFTP4 packet opcode definition
30//
31#define EFI_MTFTP4_OPCODE_RRQ 1
32#define EFI_MTFTP4_OPCODE_WRQ 2
33#define EFI_MTFTP4_OPCODE_DATA 3
34#define EFI_MTFTP4_OPCODE_ACK 4
35#define EFI_MTFTP4_OPCODE_ERROR 5
36#define EFI_MTFTP4_OPCODE_OACK 6
37#define EFI_MTFTP4_OPCODE_DIR 7
38#define EFI_MTFTP4_OPCODE_DATA8 8
39#define EFI_MTFTP4_OPCODE_ACK8 9
40
41//
42// MTFTP4 error code definition
43//
44#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED 0
45#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND 1
46#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION 2
47#define EFI_MTFTP4_ERRORCODE_DISK_FULL 3
48#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION 4
49#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID 5
50#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS 6
51#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER 7
52#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED 8
53
54//
55// MTFTP4 pacekt definitions
56//
57#pragma pack(1)
58
59typedef struct {
60 UINT16 OpCode;
61 UINT8 Filename[1];
63
64typedef struct {
65 UINT16 OpCode;
66 UINT8 Data[1];
68
69typedef struct {
70 UINT16 OpCode;
71 UINT16 Block;
72 UINT8 Data[1];
74
75typedef struct {
76 UINT16 OpCode;
77 UINT16 Block[1];
79
80typedef struct {
81 UINT16 OpCode;
82 UINT64 Block;
83 UINT8 Data[1];
85
86typedef struct {
87 UINT16 OpCode;
88 UINT64 Block[1];
90
91typedef struct {
92 UINT16 OpCode;
93 UINT16 ErrorCode;
94 UINT8 ErrorMessage[1];
96
97typedef union {
101 UINT16 OpCode;
135
136#pragma pack()
137
141typedef struct {
142 UINT8 *OptionStr;
143 UINT8 *ValueStr;
145
146typedef struct {
147 BOOLEAN UseDefaultSetting;
148 EFI_IPv4_ADDRESS StationIp;
149 EFI_IPv4_ADDRESS SubnetMask;
150 UINT16 LocalPort;
151 EFI_IPv4_ADDRESS GatewayIp;
152 EFI_IPv4_ADDRESS ServerIp;
153 UINT16 InitialServerPort;
154 UINT16 TryCount;
155 UINT16 TimeoutValue;
157
158typedef struct {
159 EFI_MTFTP4_CONFIG_DATA ConfigData;
160 UINT8 SupportedOptionCount;
161 UINT8 **SupportedOptoins;
162 UINT8 UnsupportedOptionCount;
163 UINT8 **UnsupportedOptoins;
165
166typedef struct {
167 EFI_IPv4_ADDRESS GatewayIp;
168 EFI_IPv4_ADDRESS ServerIp;
169 UINT16 ServerPort;
170 UINT16 TryCount;
171 UINT16 TimeoutValue;
173
174//
175// Protocol interfaces definition
176//
177
196typedef
200 IN EFI_MTFTP4_TOKEN *Token,
201 IN UINT16 PacketLen,
202 IN EFI_MTFTP4_PACKET *Paket
203 );
204
219typedef
223 IN EFI_MTFTP4_TOKEN *Token
224 );
225
241typedef
245 IN EFI_MTFTP4_TOKEN *Token,
246 IN OUT UINT16 *Length,
247 OUT VOID **Buffer
248 );
249
261typedef
265 OUT EFI_MTFTP4_MODE_DATA *ModeData
266 );
267
290typedef
292(EFIAPI *EFI_MTFTP4_CONFIGURE)(
294 IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL
295 );
296
341typedef
343(EFIAPI *EFI_MTFTP4_GET_INFO)(
346 IN UINT8 *Filename,
347 IN UINT8 *ModeStr OPTIONAL,
348 IN UINT8 OptionCount,
349 IN EFI_MTFTP4_OPTION *OptionList,
350 OUT UINT32 *PacketLength,
352 );
353
376typedef
380 IN UINT32 PacketLen,
381 IN EFI_MTFTP4_PACKET *Packet,
382 OUT UINT32 *OptionCount,
383 OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL
384 );
385
409typedef
411(EFIAPI *EFI_MTFTP4_READ_FILE)(
413 IN EFI_MTFTP4_TOKEN *Token
414 );
415
437typedef
439(EFIAPI *EFI_MTFTP4_WRITE_FILE)(
441 IN EFI_MTFTP4_TOKEN *Token
442 );
443
466typedef
470 IN EFI_MTFTP4_TOKEN *Token
471 );
472
488typedef
490(EFIAPI *EFI_MTFTP4_POLL)(
492 );
493
500 EFI_MTFTP4_GET_MODE_DATA GetModeData;
501 EFI_MTFTP4_CONFIGURE Configure;
502 EFI_MTFTP4_GET_INFO GetInfo;
503 EFI_MTFTP4_PARSE_OPTIONS ParseOptions;
504 EFI_MTFTP4_READ_FILE ReadFile;
505 EFI_MTFTP4_WRITE_FILE WriteFile;
506 EFI_MTFTP4_READ_DIRECTORY ReadDirectory;
507 EFI_MTFTP4_POLL Poll;
508};
509
531 UINT8 *Filename;
535 UINT8 *ModeStr;
553 VOID *Buffer;
558 VOID *Context;
571};
572
573extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;
574extern EFI_GUID gEfiMtftp4ProtocolGuid;
575
576#endif
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_MTFTP4_CHECK_PACKET)(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token, IN UINT16 PacketLen, IN EFI_MTFTP4_PACKET *Paket)
Definition: Mtftp4.h:198
EFI_STATUS(EFIAPI * EFI_MTFTP4_TIMEOUT_CALLBACK)(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token)
Definition: Mtftp4.h:221
EFI_STATUS(EFIAPI * EFI_MTFTP4_READ_DIRECTORY)(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token)
Definition: Mtftp4.h:468
EFI_STATUS(EFIAPI * EFI_MTFTP4_PARSE_OPTIONS)(IN EFI_MTFTP4_PROTOCOL *This, IN UINT32 PacketLen, IN EFI_MTFTP4_PACKET *Packet, OUT UINT32 *OptionCount, OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL)
Definition: Mtftp4.h:378
EFI_STATUS(EFIAPI * EFI_MTFTP4_READ_FILE)(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token)
Definition: Mtftp4.h:411
EFI_STATUS(EFIAPI * EFI_MTFTP4_WRITE_FILE)(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token)
Definition: Mtftp4.h:439
EFI_STATUS(EFIAPI * EFI_MTFTP4_GET_MODE_DATA)(IN EFI_MTFTP4_PROTOCOL *This, OUT EFI_MTFTP4_MODE_DATA *ModeData)
Definition: Mtftp4.h:263
EFI_STATUS(EFIAPI * EFI_MTFTP4_CONFIGURE)(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL)
Definition: Mtftp4.h:292
EFI_STATUS(EFIAPI * EFI_MTFTP4_POLL)(IN EFI_MTFTP4_PROTOCOL *This)
Definition: Mtftp4.h:490
EFI_STATUS(EFIAPI * EFI_MTFTP4_GET_INFO)(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL, IN UINT8 *Filename, IN UINT8 *ModeStr OPTIONAL, IN UINT8 OptionCount, IN EFI_MTFTP4_OPTION *OptionList, OUT UINT32 *PacketLength, OUT EFI_MTFTP4_PACKET **Packet OPTIONAL)
Definition: Mtftp4.h:343
EFI_STATUS(EFIAPI * EFI_MTFTP4_PACKET_NEEDED)(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token, IN OUT UINT16 *Length, OUT VOID **Buffer)
Definition: Mtftp4.h:243
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
EFI_MTFTP4_CHECK_PACKET CheckPacket
Definition: Mtftp4.h:562
EFI_STATUS Status
Definition: Mtftp4.h:515
UINT32 OptionCount
Definition: Mtftp4.h:539
UINT64 BufferSize
Definition: Mtftp4.h:547
UINT8 * ModeStr
Definition: Mtftp4.h:535
EFI_MTFTP4_PACKET_NEEDED PacketNeeded
Definition: Mtftp4.h:570
VOID * Context
Definition: Mtftp4.h:558
VOID * Buffer
Definition: Mtftp4.h:553
EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback
Definition: Mtftp4.h:566
EFI_MTFTP4_OVERRIDE_DATA * OverrideData
Definition: Mtftp4.h:527
EFI_EVENT Event
Definition: Mtftp4.h:523
EFI_MTFTP4_OPTION * OptionList
Definition: Mtftp4.h:543
UINT8 * Filename
Definition: Mtftp4.h:531
Definition: Base.h:213
EFI_MTFTP4_DATA8_HEADER Data8
Definition: Mtftp4.h:125
EFI_MTFTP4_REQ_HEADER Rrq
Definition: Mtftp4.h:105
EFI_MTFTP4_OACK_HEADER Oack
Definition: Mtftp4.h:113
EFI_MTFTP4_ACK8_HEADER Ack8
Definition: Mtftp4.h:129
EFI_MTFTP4_DATA_HEADER Data
Definition: Mtftp4.h:117
UINT16 OpCode
Definition: Mtftp4.h:101
EFI_MTFTP4_ACK_HEADER Ack
Definition: Mtftp4.h:121
EFI_MTFTP4_REQ_HEADER Wrq
Definition: Mtftp4.h:109
EFI_MTFTP4_ERROR_HEADER Error
Definition: Mtftp4.h:133