NetworkPkg/HttpDxe/HttpProto.h File Reference


Data Structures

struct  _HTTP_SERVICE
struct  HTTP_TCP_TOKEN_WRAP
struct  _HTTP_PROTOCOL
struct  HTTP_TOKEN_WRAP

Defines

#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   65535
#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

Functions

VOID EFIAPI HttpCommonNotify (IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS HttpCreateTcp4ConnCloseEvent (IN HTTP_PROTOCOL *HttpInstance)
VOID HttpCloseTcp4ConnCloseEvent (IN HTTP_PROTOCOL *HttpInstance)
EFI_STATUS HttpCreateTcp4TxEvent (IN HTTP_TOKEN_WRAP *Wrap)
EFI_STATUS HttpCreateTcp4RxEventForHeader (IN HTTP_PROTOCOL *HttpInstance)
EFI_STATUS HttpCreateTcp4RxEvent (IN HTTP_TOKEN_WRAP *Wrap)
EFI_STATUS HttpInitProtocol (IN HTTP_SERVICE *HttpSb, IN OUT HTTP_PROTOCOL *HttpInstance)
VOID HttpCleanProtocol (IN HTTP_PROTOCOL *HttpInstance)
EFI_STATUS HttpCreateConnection (IN HTTP_PROTOCOL *HttpInstance)
EFI_STATUS HttpCloseConnection (IN HTTP_PROTOCOL *HttpInstance)
EFI_STATUS HttpConfigureTcp4 (IN HTTP_PROTOCOL *HttpInstance, IN HTTP_TOKEN_WRAP *Wrap)
EFI_STATUS HttpConnectTcp4 (IN HTTP_PROTOCOL *HttpInstance)
EFI_STATUS HttpTransmitTcp4 (IN HTTP_PROTOCOL *HttpInstance, IN HTTP_TOKEN_WRAP *Wrap, IN UINT8 *TxString, IN UINTN TxStringLen)
EFI_HTTP_STATUS_CODE HttpMappingToStatusCode (IN UINTN StatusCode)
EFI_STATUS EFIAPI HttpTokenExist (IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Context)
EFI_STATUS EFIAPI HttpTcpNotReady (IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Context)
EFI_STATUS EFIAPI HttpTcpTransmit (IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Context)
EFI_STATUS EFIAPI HttpTcpReceive (IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Context)
CHAR8 * HttpGenRequestString (IN HTTP_PROTOCOL *HttpInstance, IN EFI_HTTP_MESSAGE *Message, IN CHAR8 *Url)
EFI_STATUS HttpResponseWorker (IN HTTP_TOKEN_WRAP *Wrap)

Detailed Description

The header files of miscellaneous routines for HttpDxe driver.

Copyright (c) 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

#define DEF_BUF_LEN   2048

Referenced by HttpResponseWorker().

#define HTTP_BUFFER_SIZE_DEAULT   65535

Referenced by HttpConfigureTcp4().

#define HTTP_CONNECTION_TIMEOUT   60

Referenced by HttpConfigureTcp4().

#define HTTP_DATA_RETRIES   12

Referenced by HttpConfigureTcp4().

#define HTTP_FIN_TIMEOUT   2

Referenced by HttpConfigureTcp4().

#define HTTP_INSTANCE_FROM_PROTOCOL (  ) 

#define HTTP_KEEP_ALIVE_INTERVAL   30

Referenced by HttpConfigureTcp4().

#define HTTP_KEEP_ALIVE_PROBES   6

Referenced by HttpConfigureTcp4().

#define HTTP_KEEP_ALIVE_TIME   7200

Referenced by HttpConfigureTcp4().

#define HTTP_MAX_SYN_BACK_LOG   5

Referenced by HttpConfigureTcp4().

#define HTTP_PROTOCOL_SIGNATURE   SIGNATURE_32('H', 't', 't', 'P')

#define HTTP_SERVICE_FROM_PROTOCOL (  ) 

#define HTTP_SERVICE_SIGNATURE   SIGNATURE_32('H', 't', 't', 'S')

Referenced by HttpCreateService().

#define HTTP_STATE_HTTP_CONFIGED   1

#define HTTP_STATE_TCP_CLOSED   5

Referenced by HttpCloseConnection().

#define HTTP_STATE_TCP_CONFIGED   2

#define HTTP_STATE_TCP_CONNECTED   4

#define HTTP_STATE_TCP_UNCONFIGED   3

#define HTTP_STATE_UNCONFIGED   0

Referenced by EfiHttpConfigure().

#define HTTP_TOS_DEAULT   8

Referenced by HttpConfigureTcp4().

#define HTTP_TTL_DEAULT   255

Referenced by HttpConfigureTcp4().

#define HTTP_URL_BUFFER_LEN   4096

Referenced by EfiHttpRequest(), and HttpInitProtocol().


Typedef Documentation

typedef struct _HTTP_PROTOCOL HTTP_PROTOCOL

typedef struct _HTTP_SERVICE HTTP_SERVICE


Function Documentation

VOID HttpCleanProtocol ( IN HTTP_PROTOCOL HttpInstance  ) 

Clean up the HTTP child, release all the resources used by it.

Parameters:
[in] HttpInstance The HTTP child to clean up.

References HttpCloseConnection(), and HttpCloseTcp4ConnCloseEvent().

Referenced by EfiHttpConfigure(), HttpServiceBindingCreateChild(), and HttpServiceBindingDestroyChild().

EFI_STATUS HttpCloseConnection ( IN HTTP_PROTOCOL HttpInstance  ) 

Close existing TCP connection.

Parameters:
[in] HttpInstance The HTTP instance private data.
Return values:
EFI_SUCCESS The TCP connection is closed.
Others Other error as indicated.

References HTTP_STATE_TCP_CLOSED, and HTTP_STATE_TCP_CONNECTED.

Referenced by EfiHttpRequest(), HttpCleanProtocol(), and HttpConnectTcp4().

VOID HttpCloseTcp4ConnCloseEvent ( IN HTTP_PROTOCOL HttpInstance  ) 

Close events in the TCP4 connection token and TCP4 close token.

Parameters:
[in] HttpInstance Pointer to HTTP_PROTOCOL structure.

Referenced by EfiHttpRequest(), HttpCleanProtocol(), and HttpCreateTcp4ConnCloseEvent().

VOID EFIAPI HttpCommonNotify ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

The common notify function used in HTTP driver.

Parameters:
[in] Event The event signaled.
[in] Context The context.

Referenced by HttpCreateTcp4ConnCloseEvent(), HttpCreateTcp4RxEventForHeader(), and HttpDns4().

EFI_STATUS HttpConfigureTcp4 ( IN HTTP_PROTOCOL HttpInstance,
IN HTTP_TOKEN_WRAP Wrap 
)

Configure TCP4 protocol child.

Parameters:
[in] HttpInstance The HTTP instance private data.
[in] Wrap The HTTP token's wrap data.
Return values:
EFI_SUCCESS The TCP4 protocol child is configured.
Others Other error as indicated.

References HTTP_BUFFER_SIZE_DEAULT, HTTP_CONNECTION_TIMEOUT, HTTP_DATA_RETRIES, HTTP_FIN_TIMEOUT, HTTP_KEEP_ALIVE_INTERVAL, HTTP_KEEP_ALIVE_PROBES, HTTP_KEEP_ALIVE_TIME, HTTP_MAX_SYN_BACK_LOG, HTTP_STATE_TCP_CONFIGED, HTTP_TOS_DEAULT, HTTP_TTL_DEAULT, HttpCreateTcp4ConnCloseEvent(), and HttpCreateTcp4TxEvent().

Referenced by EfiHttpRequest().

EFI_STATUS HttpConnectTcp4 ( IN HTTP_PROTOCOL HttpInstance  ) 

Check existing TCP connection, if in error state, receover TCP4 connection.

Parameters:
[in] HttpInstance The HTTP instance private data.
Return values:
EFI_SUCCESS The TCP connection is established.
EFI_NOT_READY TCP4 protocol child is not created or configured.
Others Other error as indicated.

References HTTP_STATE_TCP_CONFIGED, HttpCloseConnection(), and HttpCreateConnection().

Referenced by EfiHttpRequest().

EFI_STATUS HttpCreateConnection ( IN HTTP_PROTOCOL HttpInstance  ) 

Establish TCP connection with HTTP server.

Parameters:
[in] HttpInstance The HTTP instance private data.
Return values:
EFI_SUCCESS The TCP connection is established.
Others Other error as indicated.

References HTTP_STATE_TCP_CONNECTED.

Referenced by HttpConnectTcp4().

EFI_STATUS HttpCreateTcp4ConnCloseEvent ( IN HTTP_PROTOCOL HttpInstance  ) 

Create events for the TCP4 connection token and TCP4 close token.

Parameters:
[in] HttpInstance Pointer to HTTP_PROTOCOL structure.
Return values:
EFI_SUCCESS The events are created successfully.
others Other error as indicated.

References HttpCloseTcp4ConnCloseEvent(), and HttpCommonNotify().

Referenced by HttpConfigureTcp4().

EFI_STATUS HttpCreateTcp4RxEvent ( IN HTTP_TOKEN_WRAP Wrap  ) 

Create event for the TCP4 receive token which is used to receive HTTP body.

Parameters:
[in] Wrap Point to HTTP token's wrap data.
Return values:
EFI_SUCCESS The events is created successfully.
others Other error as indicated.

References HttpTcpReceiveNotify(), HTTP_TCP_TOKEN_WRAP::RxData, and HTTP_TCP_TOKEN_WRAP::RxToken.

Referenced by EfiHttpResponse().

EFI_STATUS HttpCreateTcp4RxEventForHeader ( IN HTTP_PROTOCOL HttpInstance  ) 

Create event for the TCP4 receive token which is used to receive HTTP header.

Parameters:
[in] HttpInstance Pointer to HTTP_PROTOCOL structure.
Return values:
EFI_SUCCESS The events is created successfully.
others Other error as indicated.

References HttpCommonNotify().

Referenced by HttpResponseWorker().

EFI_STATUS HttpCreateTcp4TxEvent ( IN HTTP_TOKEN_WRAP Wrap  ) 

Create event for the TCP4 transmit token.

Parameters:
[in] Wrap Point to HTTP token's wrap data.
Return values:
EFI_SUCCESS The events is created successfully.
others Other error as indicated.

References HttpTcpTransmitNotify(), HTTP_TCP_TOKEN_WRAP::TxData, and HTTP_TCP_TOKEN_WRAP::TxToken.

Referenced by EfiHttpRequest(), and HttpConfigureTcp4().

CHAR8* HttpGenRequestString ( IN HTTP_PROTOCOL HttpInstance,
IN EFI_HTTP_MESSAGE *  Message,
IN CHAR8 *  Url 
)

Generate HTTP request string.

Parameters:
[in] HttpInstance Pointer to HTTP_PROTOCOL structure.
[in] Message Pointer to storage containing HTTP message data.
[in] Url The URL of a remote host.
Returns:
Pointer to the created HTTP request string.

NULL if any error occured.

References HTTP_GET_STR, HTTP_HEAD_STR, HTTP_MAXIMUM_METHOD_LEN, HTTP_VERSION_CRLF_STR, and mHttpUtilities.

Referenced by EfiHttpRequest(), and HttpTcpTransmit().

EFI_STATUS HttpInitProtocol ( IN HTTP_SERVICE HttpSb,
IN OUT HTTP_PROTOCOL HttpInstance 
)

Intiialize the HTTP_PROTOCOL structure to the unconfigured state.

Parameters:
[in] HttpSb The HTTP service private instance.
[in,out] HttpInstance Pointer to HTTP_PROTOCOL structure.
Return values:
EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
Others Other error as indicated.

References HTTP_PROTOCOL_SIGNATURE, HTTP_URL_BUFFER_LEN, and mEfiHttpTemplate.

Referenced by EfiHttpConfigure(), and HttpServiceBindingCreateChild().

EFI_HTTP_STATUS_CODE HttpMappingToStatusCode ( IN UINTN  StatusCode  ) 

Translate the status code in HTTP message to EFI_HTTP_STATUS_CODE defined in UEFI 2.5 specification.

Parameters:
[in] StatusCode The status code value in HTTP message.
Returns:
Value defined in EFI_HTTP_STATUS_CODE .

Referenced by HttpResponseWorker().

EFI_STATUS HttpResponseWorker ( IN HTTP_TOKEN_WRAP Wrap  ) 

The work function of EfiHttpResponse().

Parameters:
[in] Wrap Pointer to HTTP token's wrap data.
Return values:
EFI_SUCCESS Allocation succeeded.
EFI_OUT_OF_RESOURCES Failed to complete the opration due to lack of resources.
EFI_NOT_READY Can't find a corresponding TxToken.
The work function of EfiHttpResponse().

Parameters:
[in] Wrap Pointer to HTTP token's wrap data.
Return values:
EFI_SUCCESS Allocation succeeded.
EFI_OUT_OF_RESOURCES Failed to complete the opration due to lack of resources.
EFI_NOT_READY Can't find a corresponding TxToken or the EFI_HTTP_UTILITIES_PROTOCOL is not available.

References _HTTP_PROTOCOL::CacheBody, _HTTP_PROTOCOL::CacheLen, _HTTP_PROTOCOL::CacheOffset, DEF_BUF_LEN, HTTP_CRLF_STR, HTTP_END_OF_HDR_STR, HTTP_VERSION_STR, HttpBodyParserCallback(), HttpCreateTcp4RxEventForHeader(), HttpMappingToStatusCode(), HTTP_TOKEN_WRAP::HttpToken, _HTTP_PROTOCOL::IsRxDone, mHttpUtilities, _HTTP_PROTOCOL::MsgParser, _HTTP_PROTOCOL::NextMsg, _HTTP_PROTOCOL::RxToken, _HTTP_PROTOCOL::Tcp4, and _HTTP_PROTOCOL::TxTokens.

Referenced by EfiHttpResponse(), and HttpTcpReceive().

EFI_STATUS EFIAPI HttpTcpNotReady ( IN NET_MAP *  Map,
IN NET_MAP_ITEM *  Item,
IN VOID *  Context 
)

Check whether the HTTP message associated with TxToken is already sent out.

Parameters:
[in] Map The container of TxToken.
[in] Item Current item to check against.
[in] Context The Token to check againist.
Return values:
EFI_NOT_READY The HTTP message is still queued in the list.
EFI_SUCCESS The HTTP message has been sent out.

References HTTP_TCP_TOKEN_WRAP::IsTxDone, and HTTP_TOKEN_WRAP::TcpWrap.

Referenced by EfiHttpRequest().

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.

Parameters:
[in] Map The container of RxToken.
[in] Item Current item to check against.
[in] Context The Token to check againist.
Return values:
EFI_SUCCESS The HTTP response is queued into TCP receive queue.
Others Other error as indicated.

References HttpResponseWorker().

Referenced by HttpTcpReceiveNotifyDpc().

EFI_STATUS EFIAPI HttpTcpTransmit ( IN NET_MAP *  Map,
IN NET_MAP_ITEM *  Item,
IN VOID *  Context 
)

Transmit the HTTP mssage by processing the associated HTTP token.

Parameters:
[in] Map The container of TxToken.
[in] Item Current item to check against.
[in] Context The Token to check againist.
Return values:
EFI_OUT_OF_RESOURCES Failed to allocate resources.
EFI_SUCCESS The HTTP message is queued into TCP transmit queue.

References HttpGenRequestString(), HTTP_TOKEN_WRAP::HttpInstance, HTTP_TOKEN_WRAP::HttpToken, HttpTransmitTcp4(), HTTP_TCP_TOKEN_WRAP::IsTxDone, and HTTP_TOKEN_WRAP::TcpWrap.

Referenced by HttpTcpTransmitNotifyDpc().

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 TxToken or RxToken list.

Parameters:
[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 againist.
Return values:
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.

Referenced by EfiHttpRequest(), and EfiHttpResponse().

EFI_STATUS HttpTransmitTcp4 ( IN HTTP_PROTOCOL HttpInstance,
IN HTTP_TOKEN_WRAP Wrap,
IN UINT8 *  TxString,
IN UINTN  TxStringLen 
)

Send the HTTP message through TCP4.

Parameters:
[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.
Return values:
EFI_SUCCESS The HTTP message is queued into TCP transmit queue.
Others Other error as indicated.

Referenced by EfiHttpRequest(), and HttpTcpTransmit().


Generated on Mon Sep 28 08:49:05 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1