TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | _HTTP_SERVICE |
struct | HTTP_TCP_TOKEN_WRAP |
struct | TLS_CONFIG_DATA |
struct | HTTP_CALLBACK_DATA |
struct | _HTTP_PROTOCOL |
struct | HTTP_TOKEN_WRAP |
Macros | |
#define | DEF_BUF_LEN 2048 |
#define | HTTP_SERVICE_SIGNATURE SIGNATURE_32('H', 't', 't', 'S') |
#define | HTTP_SERVICE_FROM_PROTOCOL(a) |
#define | HTTP_STATE_UNCONFIGED 0 |
#define | HTTP_STATE_HTTP_CONFIGED 1 |
#define | HTTP_STATE_TCP_CONFIGED 2 |
#define | HTTP_STATE_TCP_UNCONFIGED 3 |
#define | HTTP_STATE_TCP_CONNECTED 4 |
#define | HTTP_STATE_TCP_CLOSED 5 |
#define | HTTP_TOS_DEAULT 8 |
#define | HTTP_TTL_DEAULT 255 |
#define | HTTP_BUFFER_SIZE_DEAULT 0x200000 |
#define | HTTP_MAX_SYN_BACK_LOG 5 |
#define | HTTP_CONNECTION_TIMEOUT 60 |
#define | HTTP_DATA_RETRIES 12 |
#define | HTTP_FIN_TIMEOUT 2 |
#define | HTTP_KEEP_ALIVE_PROBES 6 |
#define | HTTP_KEEP_ALIVE_TIME 7200 |
#define | HTTP_KEEP_ALIVE_INTERVAL 30 |
#define | HTTP_URL_BUFFER_LEN 4096 |
#define | HTTP_PROTOCOL_SIGNATURE SIGNATURE_32('H', 't', 't', 'P') |
#define | HTTP_INSTANCE_FROM_PROTOCOL(a) |
Typedefs | |
typedef struct _HTTP_SERVICE | HTTP_SERVICE |
typedef struct _HTTP_PROTOCOL | HTTP_PROTOCOL |
The header files of miscellaneous routines for HttpDxe driver.
Copyright (c) 2015, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HttpProto.h.
#define DEF_BUF_LEN 2048 |
Definition at line 14 of file HttpProto.h.
#define HTTP_BUFFER_SIZE_DEAULT 0x200000 |
Definition at line 41 of file HttpProto.h.
#define HTTP_CONNECTION_TIMEOUT 60 |
Definition at line 43 of file HttpProto.h.
#define HTTP_DATA_RETRIES 12 |
Definition at line 44 of file HttpProto.h.
#define HTTP_FIN_TIMEOUT 2 |
Definition at line 45 of file HttpProto.h.
#define HTTP_INSTANCE_FROM_PROTOCOL | ( | a | ) |
Definition at line 211 of file HttpProto.h.
#define HTTP_KEEP_ALIVE_INTERVAL 30 |
Definition at line 48 of file HttpProto.h.
#define HTTP_KEEP_ALIVE_PROBES 6 |
Definition at line 46 of file HttpProto.h.
#define HTTP_KEEP_ALIVE_TIME 7200 |
Definition at line 47 of file HttpProto.h.
#define HTTP_MAX_SYN_BACK_LOG 5 |
Definition at line 42 of file HttpProto.h.
#define HTTP_PROTOCOL_SIGNATURE SIGNATURE_32('H', 't', 't', 'P') |
Definition at line 209 of file HttpProto.h.
#define HTTP_SERVICE_FROM_PROTOCOL | ( | a | ) |
Definition at line 18 of file HttpProto.h.
#define HTTP_SERVICE_SIGNATURE SIGNATURE_32('H', 't', 't', 'S') |
Definition at line 16 of file HttpProto.h.
#define HTTP_STATE_HTTP_CONFIGED 1 |
Definition at line 30 of file HttpProto.h.
#define HTTP_STATE_TCP_CLOSED 5 |
Definition at line 34 of file HttpProto.h.
#define HTTP_STATE_TCP_CONFIGED 2 |
Definition at line 31 of file HttpProto.h.
#define HTTP_STATE_TCP_CONNECTED 4 |
Definition at line 33 of file HttpProto.h.
#define HTTP_STATE_TCP_UNCONFIGED 3 |
Definition at line 32 of file HttpProto.h.
#define HTTP_STATE_UNCONFIGED 0 |
Definition at line 29 of file HttpProto.h.
#define HTTP_TOS_DEAULT 8 |
Definition at line 39 of file HttpProto.h.
#define HTTP_TTL_DEAULT 255 |
Definition at line 40 of file HttpProto.h.
#define HTTP_URL_BUFFER_LEN 4096 |
Definition at line 50 of file HttpProto.h.
VOID HttpCleanProtocol | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Clean up the HTTP child, release all the resources used by it.
[in] | HttpInstance | The HTTP child to clean up. |
Definition at line 820 of file HttpProto.c.
EFI_STATUS HttpCloseConnection | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Close existing TCP connection.
[in] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | The TCP connection is closed. |
Others | Other error as indicated. |
Definition at line 1001 of file HttpProto.c.
VOID HttpCloseTcpConnCloseEvent | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Close events in the TCP connection token and TCP close token.
[in] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
Definition at line 374 of file HttpProto.c.
VOID HttpCloseTcpRxEvent | ( | IN HTTP_TOKEN_WRAP * | Wrap | ) |
Close Events for Tcp Receive Tokens for HTTP body and HTTP header.
[in] | Wrap | Pointer to HTTP token's wrap data. |
Definition at line 576 of file HttpProto.c.
The common notify function used in HTTP driver.
[in] | Event | The event signaled. |
[in] | Context | The context. |
Definition at line 22 of file HttpProto.c.
EFI_STATUS HttpConfigureTcp4 | ( | IN HTTP_PROTOCOL * | HttpInstance, |
IN HTTP_TOKEN_WRAP * | Wrap | ||
) |
Configure TCP4 protocol child.
[in] | HttpInstance | The HTTP instance private data. |
[in] | Wrap | The HTTP token's wrap data. |
EFI_SUCCESS | The TCP4 protocol child is configured. |
Others | Other error as indicated. |
Definition at line 1048 of file HttpProto.c.
EFI_STATUS HttpConfigureTcp6 | ( | IN HTTP_PROTOCOL * | HttpInstance, |
IN HTTP_TOKEN_WRAP * | Wrap | ||
) |
Configure TCP6 protocol child.
[in] | HttpInstance | The HTTP instance private data. |
[in] | Wrap | The HTTP token's wrap data. |
EFI_SUCCESS | The TCP6 protocol child is configured. |
Others | Other error as indicated. |
Definition at line 1137 of file HttpProto.c.
EFI_STATUS HttpConnectTcp4 | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Check existing TCP connection, if in error state, recover TCP4 connection. Then, connect one TLS session if required.
[in] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | The TCP connection is established. |
EFI_NOT_READY | TCP4 protocol child is not created or configured. |
Others | Other error as indicated. |
Definition at line 1221 of file HttpProto.c.
EFI_STATUS HttpConnectTcp6 | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Check existing TCP connection, if in error state, recover TCP6 connection. Then, connect one TLS session if required.
[in] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | The TCP connection is established. |
EFI_NOT_READY | TCP6 protocol child is not created or configured. |
Others | Other error as indicated. |
Definition at line 1313 of file HttpProto.c.
EFI_STATUS HttpCreateConnection | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Establish TCP connection with HTTP server.
[in] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | The TCP connection is established. |
Others | Other error as indicated. |
Definition at line 943 of file HttpProto.c.
EFI_STATUS HttpCreateTcpConnCloseEvent | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Create events for the TCP connection token and TCP close token.
[in] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
EFI_SUCCESS | The events are created successfully. |
others | Other error as indicated. |
Definition at line 292 of file HttpProto.c.
EFI_STATUS HttpCreateTcpRxEvent | ( | IN HTTP_TOKEN_WRAP * | Wrap | ) |
Create event for the TCP receive token which is used to receive HTTP body.
[in] | Wrap | Point to HTTP token's wrap data. |
EFI_SUCCESS | The events is created successfully. |
others | Other error as indicated. |
Definition at line 524 of file HttpProto.c.
EFI_STATUS HttpCreateTcpRxEventForHeader | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Create event for the TCP receive token which is used to receive HTTP header.
[in] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
EFI_SUCCESS | The events is created successfully. |
others | Other error as indicated. |
Definition at line 473 of file HttpProto.c.
EFI_STATUS HttpCreateTcpTxEvent | ( | IN HTTP_TOKEN_WRAP * | Wrap | ) |
Create event for the TCP transmit token.
[in] | Wrap | Point to HTTP token's wrap data. |
EFI_SUCCESS | The events is created successfully. |
others | Other error as indicated. |
Definition at line 413 of file HttpProto.c.
EFI_STATUS HttpInitProtocol | ( | IN OUT HTTP_PROTOCOL * | HttpInstance, |
IN BOOLEAN | IpVersion | ||
) |
Initialize the HTTP_PROTOCOL structure to the unconfigured state.
[in,out] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
[in] | IpVersion | Indicate us TCP4 protocol or TCP6 protocol. |
EFI_SUCCESS | HTTP_PROTOCOL structure is initialized successfully. |
Others | Other error as indicated. |
Definition at line 617 of file HttpProto.c.
EFI_STATUS HttpInitSession | ( | IN HTTP_PROTOCOL * | HttpInstance, |
IN HTTP_TOKEN_WRAP * | Wrap, | ||
IN BOOLEAN | Configure, | ||
IN BOOLEAN | TlsConfigure | ||
) |
Initialize Http session.
[in] | HttpInstance | The HTTP instance private data. |
[in] | Wrap | The HTTP token's wrap data. |
[in] | Configure | The Flag indicates whether need to initialize session. |
[in] | TlsConfigure | The Flag indicates whether it's the new Tls session. |
EFI_SUCCESS | The initialization of session is done. |
Others | Other error as indicated. |
Definition at line 1407 of file HttpProto.c.
VOID HttpNotify | ( | IN EDKII_HTTP_CALLBACK_EVENT | Event, |
IN EFI_STATUS | EventStatus | ||
) |
Send Events via EDKII_HTTP_CALLBACK_PROTOCOL.
[in] | Event | The event that occurs in the current state. |
[in] | EventStatus | The Status of Event, EFI_SUCCESS or other errors. |
Definition at line 2213 of file HttpProto.c.
EFI_STATUS HttpResponseWorker | ( | IN HTTP_TOKEN_WRAP * | Wrap | ) |
The work function of EfiHttpResponse().
[in] | Wrap | Pointer to HTTP token's wrap data. |
EFI_SUCCESS | Allocation succeeded. |
EFI_OUT_OF_RESOURCES | Failed to complete the operation due to lack of resources. |
EFI_NOT_READY | Can't find a corresponding TxToken. |
The work function of EfiHttpResponse().
[in] | Wrap | Pointer to HTTP token's wrap data. |
EFI_SUCCESS | Allocation succeeded. |
EFI_OUT_OF_RESOURCES | Failed to complete the operation due to lack of resources. |
EFI_NOT_READY | Can't find a corresponding Tx4Token/Tx6Token or the EFI_HTTP_UTILITIES_PROTOCOL is not available. |
Definition at line 966 of file HttpImpl.c.
EFI_STATUS EFIAPI HttpTcpNotReady | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID * | Context | ||
) |
Check whether the HTTP message associated with TxToken or Tx6Token is already sent out.
[in] | Map | The container of TxToken. |
[in] | Item | Current item to check against. |
[in] | Context | The Token to check against. |
EFI_NOT_READY | The HTTP message is still queued in the list. |
EFI_SUCCESS | The HTTP message has been sent out. |
Check whether the HTTP message associated with Tx4Token or Tx6Token is already sent out.
[in] | Map | The container of Tx4Token or Tx6Token. |
[in] | Item | Current item to check against. |
[in] | Context | The Token to check against. |
EFI_NOT_READY | The HTTP message is still queued in the list. |
EFI_SUCCESS | The HTTP message has been sent out. |
Definition at line 1691 of file HttpProto.c.
EFI_STATUS EFIAPI HttpTcpReceive | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID * | Context | ||
) |
Receive the HTTP response by processing the associated HTTP token.
[in] | Map | The container of Rx4Token or Rx6Token. |
[in] | Item | Current item to check against. |
[in] | Context | The Token to check against. |
EFI_SUCCESS | The HTTP response is queued into TCP receive queue. |
Others | Other error as indicated. |
Definition at line 1797 of file HttpProto.c.
EFI_STATUS HttpTcpReceiveBody | ( | IN HTTP_TOKEN_WRAP * | Wrap, |
IN EFI_HTTP_MESSAGE * | HttpMsg | ||
) |
Receive the HTTP body by processing the associated HTTP token.
[in] | Wrap | The HTTP token's wrap data. |
[in] | HttpMsg | The HTTP message data. |
EFI_SUCCESS | The HTTP body is received. |
Others | Other error as indicated. |
Definition at line 2087 of file HttpProto.c.
EFI_STATUS HttpTcpReceiveHeader | ( | IN HTTP_PROTOCOL * | HttpInstance, |
IN OUT UINTN * | SizeofHeaders, | ||
IN OUT UINTN * | BufferSize, | ||
IN EFI_EVENT | Timeout | ||
) |
Receive the HTTP header by processing the associated HTTP token.
[in] | HttpInstance | The HTTP instance private data. |
[in,out] | SizeofHeaders | The HTTP header length. |
[in,out] | BufferSize | The size of buffer to cache the header message. |
[in] | Timeout | The time to wait for receiving the header packet. |
EFI_SUCCESS | The HTTP header is received. |
Others | Other errors as indicated. |
Definition at line 1822 of file HttpProto.c.
VOID HttpTcpTokenCleanup | ( | IN HTTP_TOKEN_WRAP * | Wrap | ) |
Clean up Tcp Tokens while the Tcp transmission error occurs.
[in] | Wrap | Pointer to HTTP token's wrap data. |
Definition at line 2147 of file HttpProto.c.
EFI_STATUS EFIAPI HttpTcpTransmit | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID * | Context | ||
) |
Transmit the HTTP or HTTPS message by processing the associated HTTP token.
[in] | Map | The container of TxToken or Tx6Token. |
[in] | Item | Current item to check against. |
[in] | Context | The Token to check against. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
EFI_SUCCESS | The HTTP message is queued into TCP transmit queue. |
Transmit the HTTP or HTTPS message by processing the associated HTTP token.
[in] | Map | The container of Tx4Token or Tx6Token. |
[in] | Item | Current item to check against. |
[in] | Context | The Token to check against. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
EFI_SUCCESS | The HTTP message is queued into TCP transmit queue. |
Definition at line 1722 of file HttpProto.c.
EFI_STATUS EFIAPI HttpTokenExist | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID * | Context | ||
) |
Check whether the user's token or event has already been enqueue on HTTP Tx or Rx Token list.
[in] | Map | The container of either user's transmit or receive token. |
[in] | Item | Current item to check against. |
[in] | Context | The Token to check against. |
EFI_ACCESS_DENIED | The token or event has already been enqueued in IP |
EFI_SUCCESS | The current item isn't the same token/event as the context. |
Definition at line 1659 of file HttpProto.c.
EFI_STATUS HttpTransmitTcp | ( | IN HTTP_PROTOCOL * | HttpInstance, |
IN HTTP_TOKEN_WRAP * | Wrap, | ||
IN UINT8 * | TxString, | ||
IN UINTN | TxStringLen | ||
) |
Send the HTTP or HTTPS message through TCP4 or TCP6.
[in] | HttpInstance | The HTTP instance private data. |
[in] | Wrap | The HTTP token's wrap data. |
[in] | TxString | Buffer containing the HTTP message string. |
[in] | TxStringLen | Length of the HTTP message string in bytes. |
EFI_SUCCESS | The HTTP message is queued into TCP transmit queue. |
Others | Other error as indicated. |
Definition at line 1483 of file HttpProto.c.