TianoCore EDK2 master
Loading...
Searching...
No Matches
HttpLib.h
Go to the documentation of this file.
1
11#ifndef _HTTP_LIB_H_
12#define _HTTP_LIB_H_
13
14#include <Protocol/Http.h>
15
33EFIAPI
35 IN CHAR8 *Buffer,
36 IN UINT32 BufferLength,
37 OUT CHAR8 *ResultBuffer,
38 OUT UINT32 *ResultLength
39 );
40
60EFIAPI
62 IN CHAR8 *Url,
63 IN UINT32 Length,
64 IN BOOLEAN IsConnectMethod,
65 OUT VOID **UrlParser
66 );
67
85EFIAPI
87 IN CHAR8 *Url,
88 IN VOID *UrlParser,
89 OUT CHAR8 **HostName
90 );
91
108EFIAPI
110 IN CHAR8 *Url,
111 IN VOID *UrlParser,
112 OUT EFI_IPv4_ADDRESS *Ip4Address
113 );
114
131EFIAPI
133 IN CHAR8 *Url,
134 IN VOID *UrlParser,
135 OUT EFI_IPv6_ADDRESS *Ip6Address
136 );
137
154EFIAPI
156 IN CHAR8 *Url,
157 IN VOID *UrlParser,
158 OUT UINT16 *Port
159 );
160
178EFIAPI
180 IN CHAR8 *Url,
181 IN VOID *UrlParser,
182 OUT CHAR8 **Path
183 );
184
191VOID
192EFIAPI
194 IN VOID *UrlParser
195 );
196
197//
198// HTTP body parser interface.
199//
200
201typedef enum {
202 //
203 // Part of entity data.
204 // Length of entity body in Data.
205 //
206 BodyParseEventOnData,
207 //
208 // End of message body.
209 // Length is 0 and Data points to next byte after the end of the message.
210 //
211 BodyParseEventOnComplete
212} HTTP_BODY_PARSE_EVENT;
213
229typedef
232 IN HTTP_BODY_PARSE_EVENT EventType,
233 IN CHAR8 *Data,
234 IN UINTN Length,
235 IN VOID *Context
236 );
237
260EFIAPI
262 IN EFI_HTTP_METHOD Method,
263 IN EFI_HTTP_STATUS_CODE StatusCode,
264 IN UINTN HeaderCount,
265 IN EFI_HTTP_HEADER *Headers,
267 IN VOID *Context,
268 OUT VOID **MsgParser
269 );
270
287EFIAPI
289 IN OUT VOID *MsgParser,
290 IN UINTN BodyLength,
291 IN CHAR8 *Body
292 );
293
303BOOLEAN
304EFIAPI
306 IN VOID *MsgParser
307 );
308
323EFIAPI
325 IN VOID *MsgParser,
326 OUT UINTN *ContentLength
327 );
328
335VOID
336EFIAPI
338 IN VOID *MsgParser
339 );
340
352EFIAPI
354 IN UINTN HeaderCount,
355 IN EFI_HTTP_HEADER *Headers,
356 IN CHAR8 *FieldName
357 );
358
373EFIAPI
375 IN OUT EFI_HTTP_HEADER *HttpHeader,
376 IN CONST CHAR8 *FieldName,
377 IN CONST CHAR8 *FieldValue
378 );
379
391CHAR8 *
392EFIAPI
394 IN CHAR8 *String,
395 OUT CHAR8 **FieldName,
396 OUT CHAR8 **FieldValue
397 );
398
406VOID
407EFIAPI
409 IN EFI_HTTP_HEADER *HeaderFields,
410 IN UINTN FieldCount
411 );
412
435EFIAPI
437 IN CONST EFI_HTTP_MESSAGE *Message,
438 IN CONST CHAR8 *Url,
439 OUT CHAR8 **RequestMsg,
440 OUT UINTN *RequestMsgSize
441 );
442
456EFIAPI
458 IN UINTN StatusCode
459 );
460
472BOOLEAN
473EFIAPI
475 IN CHAR8 *DeleteList[],
476 IN UINTN DeleteCount,
477 IN CHAR8 *FieldName
478 );
479
480//
481// A wrapper structure to hold the HTTP headers.
482//
483typedef struct {
484 UINTN MaxHeaderCount;
485 UINTN HeaderCount;
486 EFI_HTTP_HEADER *Headers;
488
499 UINTN MaxHeaderCount
500 );
501
508VOID
510 IN HTTP_IO_HEADER *HttpIoHeader
511 );
512
528 IN HTTP_IO_HEADER *HttpIoHeader,
529 IN CHAR8 *FieldName,
530 IN CHAR8 *FieldValue
531 );
532
533#endif
UINT64 UINTN
EFI_STATUS EFIAPI HttpSetFieldNameAndValue(IN OUT EFI_HTTP_HEADER *HttpHeader, IN CONST CHAR8 *FieldName, IN CONST CHAR8 *FieldValue)
Definition: DxeHttpLib.c:1529
EFI_STATUS EFIAPI HttpUrlGetHostName(IN CHAR8 *Url, IN VOID *UrlParser, OUT CHAR8 **HostName)
Definition: DxeHttpLib.c:506
EFI_STATUS EFIAPI HttpInitMsgParser(IN EFI_HTTP_METHOD Method, IN EFI_HTTP_STATUS_CODE StatusCode, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, IN HTTP_BODY_PARSER_CALLBACK Callback, IN VOID *Context, OUT VOID **MsgParser)
Definition: DxeHttpLib.c:1050
VOID HttpIoFreeHeader(IN HTTP_IO_HEADER *HttpIoHeader)
Definition: DxeHttpLib.c:2178
EFI_STATUS EFIAPI UriPercentDecode(IN CHAR8 *Buffer, IN UINT32 BufferLength, OUT CHAR8 *ResultBuffer, OUT UINT32 *ResultLength)
Definition: DxeHttpLib.c:31
EFI_STATUS EFIAPI HttpUrlGetPort(IN CHAR8 *Url, IN VOID *UrlParser, OUT UINT16 *Port)
Definition: DxeHttpLib.c:702
HTTP_IO_HEADER * HttpIoCreateHeader(UINTN MaxHeaderCount)
Definition: DxeHttpLib.c:2150
EFI_HTTP_HEADER *EFIAPI HttpFindHeader(IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, IN CHAR8 *FieldName)
Definition: DxeHttpLib.c:855
EFI_STATUS EFIAPI HttpUrlGetPath(IN CHAR8 *Url, IN VOID *UrlParser, OUT CHAR8 **Path)
Definition: DxeHttpLib.c:786
VOID EFIAPI HttpFreeHeaderFields(IN EFI_HTTP_HEADER *HeaderFields, IN UINTN FieldCount)
Definition: DxeHttpLib.c:1730
CHAR8 *EFIAPI HttpGetFieldNameAndValue(IN CHAR8 *String, OUT CHAR8 **FieldName, OUT CHAR8 **FieldValue)
Definition: DxeHttpLib.c:1585
EFI_STATUS EFIAPI HttpUrlGetIp4(IN CHAR8 *Url, IN VOID *UrlParser, OUT EFI_IPv4_ADDRESS *Ip4Address)
Definition: DxeHttpLib.c:565
EFI_STATUS EFIAPI HttpUrlGetIp6(IN CHAR8 *Url, IN VOID *UrlParser, OUT EFI_IPv6_ADDRESS *Ip6Address)
Definition: DxeHttpLib.c:626
EFI_STATUS EFIAPI HttpGenRequestMessage(IN CONST EFI_HTTP_MESSAGE *Message, IN CONST CHAR8 *Url, OUT CHAR8 **RequestMsg, OUT UINTN *RequestMsgSize)
Definition: DxeHttpLib.c:1775
EFI_STATUS(EFIAPI * HTTP_BODY_PARSER_CALLBACK)(IN HTTP_BODY_PARSE_EVENT EventType, IN CHAR8 *Data, IN UINTN Length, IN VOID *Context)
Definition: HttpLib.h:231
EFI_STATUS EFIAPI HttpParseMessageBody(IN OUT VOID *MsgParser, IN UINTN BodyLength, IN CHAR8 *Body)
Definition: DxeHttpLib.c:1131
EFI_STATUS HttpIoSetHeader(IN HTTP_IO_HEADER *HttpIoHeader, IN CHAR8 *FieldName, IN CHAR8 *FieldValue)
Definition: DxeHttpLib.c:2211
BOOLEAN EFIAPI HttpIsValidHttpHeader(IN CHAR8 *DeleteList[], IN UINTN DeleteCount, IN CHAR8 *FieldName)
Definition: DxeHttpLib.c:2116
EFI_STATUS EFIAPI HttpGetEntityLength(IN VOID *MsgParser, OUT UINTN *ContentLength)
Definition: DxeHttpLib.c:1445
VOID EFIAPI HttpFreeMsgParser(IN VOID *MsgParser)
Definition: DxeHttpLib.c:1474
VOID EFIAPI HttpUrlFreeParser(IN VOID *UrlParser)
Definition: DxeHttpLib.c:836
EFI_STATUS EFIAPI HttpParseUrl(IN CHAR8 *Url, IN UINT32 Length, IN BOOLEAN IsConnectMethod, OUT VOID **UrlParser)
Definition: DxeHttpLib.c:370
BOOLEAN EFIAPI HttpIsMessageComplete(IN VOID *MsgParser)
Definition: DxeHttpLib.c:1411
EFI_HTTP_STATUS_CODE EFIAPI HttpMappingToStatusCode(IN UINTN StatusCode)
Definition: DxeHttpLib.c:2008
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_HTTP_METHOD
Definition: Http.h:43
EFI_HTTP_STATUS_CODE
Definition: Http.h:59
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29