TianoCore EDK2 master
|
#include "HttpDriver.h"
Go to the source code of this file.
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.c.
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 EFIAPI HttpTcpNotReady | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID * | Context | ||
) |
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.
Request HttpTcpReceiveNotifyDpc as a DPC at TPL_CALLBACK.
Event | The receive event delivered to TCP for receive. |
Context | Context for the callback. |
Definition at line 271 of file HttpProto.c.
VOID EFIAPI HttpTcpReceiveNotifyDpc | ( | IN VOID * | Context | ) |
The notify function associated with Rx4Token for Tcp4->Receive () or Rx6Token for Tcp6->Receive().
[in] | Context | The context. |
Definition at line 122 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 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.
Request HttpTcpTransmitNotifyDpc as a DPC at TPL_CALLBACK.
Event | The receive event delivered to TCP for transmit. |
Context | Context for the callback. |
Definition at line 103 of file HttpProto.c.
VOID EFIAPI HttpTcpTransmitNotifyDpc | ( | IN VOID * | Context | ) |
The notify function associated with Tx4Token for Tcp4->Transmit() or Tx6Token for Tcp6->Transmit().
[in] | Context | The context. |
Definition at line 42 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.