TianoCore EDK2 master
Loading...
Searching...
No Matches
HttpIoLib.h
Go to the documentation of this file.
1
9#ifndef HTTP_IO_LIB_H_
10#define HTTP_IO_LIB_H_
11
13
14#include <Library/DpcLib.h>
15#include <Library/HttpLib.h>
16#include <Library/NetLib.h>
17
18#define HTTP_IO_MAX_SEND_PAYLOAD 1024
19#define HTTP_IO_CHUNK_SIZE_STRING_LEN 50
20#define HTTP_IO_CHUNKED_TRANSFER_CODING_DATA_LENGTH 256
21
25typedef enum {
26 HttpIoRequest,
27 HttpIoResponse
29
40typedef
42(EFIAPI *HTTP_IO_CALLBACK)(
43 IN HTTP_IO_CALLBACK_EVENT EventType,
44 IN EFI_HTTP_MESSAGE *Message,
45 IN VOID *Context
46 );
47
51typedef struct {
53 UINTN HeaderCount;
54 EFI_HTTP_HEADER *Headers;
55 UINTN BodyLength;
56 CHAR8 *Body;
57 EFI_STATUS Status;
59
63typedef struct {
64 EFI_HTTP_VERSION HttpVersion;
67 BOOLEAN UseDefaultAddress;
68 EFI_IPv4_ADDRESS LocalIp;
69 EFI_IPv4_ADDRESS SubnetMask;
70 UINT16 LocalPort;
72
76typedef struct {
77 EFI_HTTP_VERSION HttpVersion;
79 BOOLEAN UseDefaultAddress;
80 EFI_IPv6_ADDRESS LocalIp;
81 UINT16 LocalPort;
83
87typedef union {
91
95typedef struct {
96 UINT8 IpVersion;
97 EFI_HANDLE Image;
98 EFI_HANDLE Controller;
99 EFI_HANDLE Handle;
100
101 EFI_HTTP_PROTOCOL *Http;
102
103 HTTP_IO_CALLBACK Callback;
104 VOID *Context;
105
106 EFI_HTTP_TOKEN ReqToken;
107 EFI_HTTP_MESSAGE ReqMessage;
108 EFI_HTTP_TOKEN RspToken;
109 EFI_HTTP_MESSAGE RspMessage;
110
111 BOOLEAN IsTxDone;
112 BOOLEAN IsRxDone;
113
114 EFI_EVENT TimeoutEvent;
115 UINT32 Timeout;
116} HTTP_IO;
117
121typedef enum {
122 HttpIoSendChunkNone = 0,
123 HttpIoSendChunkHeaderZeroContent,
124 HttpIoSendChunkContent,
125 HttpIoSendChunkEndChunk,
126 HttpIoSendChunkFinish
128
132typedef enum {
133 HttpIoSendNonChunkNone = 0,
134 HttpIoSendNonChunkHeaderZeroContent,
135 HttpIoSendNonChunkContent,
136 HttpIoSendNonChunkFinish
138
142typedef struct {
143 LIST_ENTRY NextChunk;
144 UINTN Length;
145 CHAR8 *Data;
147
154VOID
155EFIAPI
157 IN VOID *Context
158 );
159
167VOID
168EFIAPI
170 IN EFI_EVENT Event,
171 IN VOID *Context
172 );
173
180VOID
182 IN HTTP_IO *HttpIo
183 );
184
208 IN EFI_HANDLE Image,
209 IN EFI_HANDLE Controller,
210 IN UINT8 IpVersion,
211 IN HTTP_IO_CONFIG_DATA *ConfigData,
212 IN HTTP_IO_CALLBACK Callback,
213 IN VOID *Context,
214 OUT HTTP_IO *HttpIo
215 );
216
236 IN HTTP_IO *HttpIo,
237 IN EFI_HTTP_REQUEST_DATA *Request OPTIONAL,
238 IN UINTN HeaderCount,
239 IN EFI_HTTP_HEADER *Headers OPTIONAL,
240 IN UINTN BodyLength,
241 IN VOID *Body OPTIONAL
242 );
243
261 IN HTTP_IO *HttpIo,
262 IN BOOLEAN RecvMsgHeader,
263 OUT HTTP_IO_RESPONSE_DATA *ResponseData
264 );
265
279 IN UINTN HeaderCount,
280 IN EFI_HTTP_HEADER *Headers,
281 OUT UINTN *ContentLength
282 );
283
304 IN HTTP_IO *HttpIo,
305 IN UINTN HeaderCount,
306 IN EFI_HTTP_HEADER *Headers,
307 OUT LIST_ENTRY **ChunkListHead,
308 OUT UINTN *ContentLength
309 );
310
324 IN HTTP_IO *HttpIo,
325 IN HTTP_IO_SEND_CHUNK_PROCESS *SendChunkProcess,
326 IN EFI_HTTP_MESSAGE *RequestMessage
327 );
328
329#endif
UINT64 UINTN
VOID EFIAPI HttpIoNotifyDpc(IN VOID *Context)
Definition: DxeHttpIoLib.c:28
EFI_STATUS(EFIAPI * HTTP_IO_CALLBACK)(IN HTTP_IO_CALLBACK_EVENT EventType, IN EFI_HTTP_MESSAGE *Message, IN VOID *Context)
Definition: HttpIoLib.h:42
EFI_STATUS HttpIoCreateIo(IN EFI_HANDLE Image, IN EFI_HANDLE Controller, IN UINT8 IpVersion, IN HTTP_IO_CONFIG_DATA *ConfigData, IN HTTP_IO_CALLBACK Callback, IN VOID *Context, OUT HTTP_IO *HttpIo)
HTTP_IO_SEND_NON_CHUNK_PROCESS
Definition: HttpIoLib.h:132
EFI_STATUS HttpIoGetContentLength(IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, OUT UINTN *ContentLength)
Definition: DxeHttpIoLib.c:479
EFI_STATUS HttpIoSendChunkedTransfer(IN HTTP_IO *HttpIo, IN HTTP_IO_SEND_CHUNK_PROCESS *SendChunkProcess, IN EFI_HTTP_MESSAGE *RequestMessage)
Definition: DxeHttpIoLib.c:507
HTTP_IO_SEND_CHUNK_PROCESS
Definition: HttpIoLib.h:121
EFI_STATUS HttpIoGetChunkedTransferContent(IN HTTP_IO *HttpIo, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, OUT LIST_ENTRY **ChunkListHead, OUT UINTN *ContentLength)
Definition: DxeHttpIoLib.c:678
VOID HttpIoDestroyIo(IN HTTP_IO *HttpIo)
Definition: DxeHttpIoLib.c:62
EFI_STATUS HttpIoSendRequest(IN HTTP_IO *HttpIo, IN EFI_HTTP_REQUEST_DATA *Request OPTIONAL, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers OPTIONAL, IN UINTN BodyLength, IN VOID *Body OPTIONAL)
VOID EFIAPI HttpIoNotify(IN EFI_EVENT Event, IN VOID *Context)
Definition: DxeHttpIoLib.c:44
EFI_STATUS HttpIoRecvResponse(IN HTTP_IO *HttpIo, IN BOOLEAN RecvMsgHeader, OUT HTTP_IO_RESPONSE_DATA *ResponseData)
Definition: DxeHttpIoLib.c:366
HTTP_IO_CALLBACK_EVENT
Definition: HttpIoLib.h:25
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_HTTP_VERSION
Definition: Http.h:34
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
UINT32 ResponseTimeOut
In milliseconds.
Definition: HttpIoLib.h:66
UINT32 RequestTimeOut
In milliseconds.
Definition: HttpIoLib.h:65
UINT32 RequestTimeOut
In milliseconds.
Definition: HttpIoLib.h:78