iPXE
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Http.h File Reference

This file defines the EFI HTTP Protocol interface. More...

Go to the source code of this file.

Data Structures

struct  EFI_HTTPv4_ACCESS_POINT
 EFI_HTTPv4_ACCESS_POINT. More...
 
struct  EFI_HTTPv6_ACCESS_POINT
 EFI_HTTPv6_ACCESS_POINT. More...
 
struct  EFI_HTTP_CONFIG_DATA
 EFI_HTTP_CONFIG_DATA_ACCESS_POINT. More...
 
struct  EFI_HTTP_REQUEST_DATA
 EFI_HTTP_REQUEST_DATA. More...
 
struct  EFI_HTTP_RESPONSE_DATA
 EFI_HTTP_RESPONSE_DATA. More...
 
struct  EFI_HTTP_HEADER
 EFI_HTTP_HEADER. More...
 
struct  EFI_HTTP_MESSAGE
 EFI_HTTP_MESSAGE. More...
 
struct  EFI_HTTP_TOKEN
 EFI_HTTP_TOKEN. More...
 
struct  _EFI_HTTP_PROTOCOL
 The EFI HTTP protocol is designed to be used by EFI drivers and applications to create and transmit HTTP Requests, as well as handle HTTP responses that are returned by a remote host. More...
 

Macros

#define EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID
 
#define EFI_HTTP_PROTOCOL_GUID
 

Typedefs

typedef struct _EFI_HTTP_PROTOCOL EFI_HTTP_PROTOCOL
 
typedef EFI_STATUS(EFIAPIEFI_HTTP_GET_MODE_DATA) (IN EFI_HTTP_PROTOCOL *This, OUT EFI_HTTP_CONFIG_DATA *HttpConfigData)
 Returns the operational parameters for the current HTTP child instance. More...
 
typedef EFI_STATUS(EFIAPIEFI_HTTP_CONFIGURE) (IN EFI_HTTP_PROTOCOL *This, IN EFI_HTTP_CONFIG_DATA *HttpConfigData OPTIONAL)
 Initialize or brutally reset the operational parameters for this EFI HTTP instance. More...
 
typedef EFI_STATUS(EFIAPIEFI_HTTP_REQUEST) (IN EFI_HTTP_PROTOCOL *This, IN EFI_HTTP_TOKEN *Token)
 The Request() function queues an HTTP request to this HTTP instance, similar to Transmit() function in the EFI TCP driver. More...
 
typedef EFI_STATUS(EFIAPIEFI_HTTP_CANCEL) (IN EFI_HTTP_PROTOCOL *This, IN EFI_HTTP_TOKEN *Token)
 Abort an asynchronous HTTP request or response token. More...
 
typedef EFI_STATUS(EFIAPIEFI_HTTP_RESPONSE) (IN EFI_HTTP_PROTOCOL *This, IN EFI_HTTP_TOKEN *Token)
 The Response() function queues an HTTP response to this HTTP instance, similar to Receive() function in the EFI TCP driver. More...
 
typedef EFI_STATUS(EFIAPIEFI_HTTP_POLL) (IN EFI_HTTP_PROTOCOL *This)
 The Poll() function can be used by network drivers and applications to increase the rate that data packets are moved between the communication devices and the transmit and receive queues. More...
 

Enumerations

enum  EFI_HTTP_VERSION { HttpVersion10, HttpVersion11, HttpVersionUnsupported }
 EFI_HTTP_VERSION. More...
 
enum  EFI_HTTP_METHOD {
  HttpMethodGet, HttpMethodPost, HttpMethodPatch, HttpMethodOptions,
  HttpMethodConnect, HttpMethodHead, HttpMethodPut, HttpMethodDelete,
  HttpMethodTrace, HttpMethodMax
}
 EFI_HTTP_METHOD. More...
 
enum  EFI_HTTP_STATUS_CODE {
  HTTP_STATUS_UNSUPPORTED_STATUS = 0, HTTP_STATUS_100_CONTINUE, HTTP_STATUS_101_SWITCHING_PROTOCOLS, HTTP_STATUS_200_OK,
  HTTP_STATUS_201_CREATED, HTTP_STATUS_202_ACCEPTED, HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION, HTTP_STATUS_204_NO_CONTENT,
  HTTP_STATUS_205_RESET_CONTENT, HTTP_STATUS_206_PARTIAL_CONTENT, HTTP_STATUS_300_MULTIPLE_CHOICES, HTTP_STATUS_301_MOVED_PERMANENTLY,
  HTTP_STATUS_302_FOUND, HTTP_STATUS_303_SEE_OTHER, HTTP_STATUS_304_NOT_MODIFIED, HTTP_STATUS_305_USE_PROXY,
  HTTP_STATUS_307_TEMPORARY_REDIRECT, HTTP_STATUS_400_BAD_REQUEST, HTTP_STATUS_401_UNAUTHORIZED, HTTP_STATUS_402_PAYMENT_REQUIRED,
  HTTP_STATUS_403_FORBIDDEN, HTTP_STATUS_404_NOT_FOUND, HTTP_STATUS_405_METHOD_NOT_ALLOWED, HTTP_STATUS_406_NOT_ACCEPTABLE,
  HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED, HTTP_STATUS_408_REQUEST_TIME_OUT, HTTP_STATUS_409_CONFLICT, HTTP_STATUS_410_GONE,
  HTTP_STATUS_411_LENGTH_REQUIRED, HTTP_STATUS_412_PRECONDITION_FAILED, HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE, HTTP_STATUS_414_REQUEST_URI_TOO_LARGE,
  HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE, HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED, HTTP_STATUS_417_EXPECTATION_FAILED, HTTP_STATUS_500_INTERNAL_SERVER_ERROR,
  HTTP_STATUS_501_NOT_IMPLEMENTED, HTTP_STATUS_502_BAD_GATEWAY, HTTP_STATUS_503_SERVICE_UNAVAILABLE, HTTP_STATUS_504_GATEWAY_TIME_OUT,
  HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED, HTTP_STATUS_308_PERMANENT_REDIRECT
}
 EFI_HTTP_STATUS_CODE. More...
 

Functions

 FILE_LICENCE (BSD2_PATENT)
 

Variables

EFI_GUID gEfiHttpServiceBindingProtocolGuid
 
EFI_GUID gEfiHttpProtocolGuid
 

Detailed Description

This file defines the EFI HTTP Protocol interface.

It is split into the following two main sections: HTTP Service Binding Protocol (HTTPSB) HTTP Protocol (HTTP)

Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
This Protocol is introduced in UEFI Specification 2.5

Definition in file Http.h.

Macro Definition Documentation

◆ EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID

#define EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID
Value:
{ \
0xbdc8e6af, 0xd9bc, 0x4379, {0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 0x1c } \
}

Definition at line 21 of file Http.h.

◆ EFI_HTTP_PROTOCOL_GUID

#define EFI_HTTP_PROTOCOL_GUID
Value:
{ \
0x7a59b29b, 0x910b, 0x4171, {0x82, 0x42, 0xa8, 0x5a, 0x0d, 0xf2, 0x5b, 0x5b } \
}

Definition at line 26 of file Http.h.

Typedef Documentation

◆ EFI_HTTP_PROTOCOL

Definition at line 31 of file Http.h.

◆ EFI_HTTP_GET_MODE_DATA

typedef EFI_STATUS(EFIAPI * EFI_HTTP_GET_MODE_DATA) (IN EFI_HTTP_PROTOCOL *This, OUT EFI_HTTP_CONFIG_DATA *HttpConfigData)

Returns the operational parameters for the current HTTP child instance.

The GetModeData() function is used to read the current mode data (operational parameters) for this HTTP protocol instance.

Parameters
[in]ThisPointer to EFI_HTTP_PROTOCOL instance.
[out]HttpConfigDataPoint to buffer for operational parameters of this HTTP instance. It is the responsibility of the caller to allocate the memory for HttpConfigData and HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact, it is recommended to allocate sufficient memory to record IPv6Node since it is big enough for all possibilities.
Return values
EFI_SUCCESSOperation succeeded.
EFI_INVALID_PARAMETERThis is NULL. HttpConfigData is NULL. HttpConfigData->AccessPoint.IPv4Node or HttpConfigData->AccessPoint.IPv6Node is NULL.
EFI_NOT_STARTEDThis EFI HTTP Protocol instance has not been started.

Definition at line 317 of file Http.h.

◆ EFI_HTTP_CONFIGURE

typedef EFI_STATUS(EFIAPI * EFI_HTTP_CONFIGURE) (IN EFI_HTTP_PROTOCOL *This, IN EFI_HTTP_CONFIG_DATA *HttpConfigData OPTIONAL)

Initialize or brutally reset the operational parameters for this EFI HTTP instance.

The Configure() function does the following: When HttpConfigData is not NULL Initialize this EFI HTTP instance by configuring timeout, local address, port, etc. When HttpConfigData is NULL, reset this EFI HTTP instance by closing all active connections with remote hosts, canceling all asynchronous tokens, and flush request and response buffers without informing the appropriate hosts.

No other EFI HTTP function can be executed by this instance until the Configure() function is executed and returns successfully.

Parameters
[in]ThisPointer to EFI_HTTP_PROTOCOL instance.
[in]HttpConfigDataPointer to the configure data to configure the instance.
Return values
EFI_SUCCESSOperation succeeded.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: This is NULL. HttpConfigData->LocalAddressIsIPv6 is FALSE and HttpConfigData->AccessPoint.IPv4Node is NULL. HttpConfigData->LocalAddressIsIPv6 is TRUE and HttpConfigData->AccessPoint.IPv6Node is NULL.
EFI_ALREADY_STARTEDReinitialize this HTTP instance without calling Configure() with NULL to reset it.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
EFI_OUT_OF_RESOURCESCould not allocate enough system resources when executing Configure().
EFI_UNSUPPORTEDOne or more options in ConfigData are not supported in the implementation.

Definition at line 355 of file Http.h.

◆ EFI_HTTP_REQUEST

typedef EFI_STATUS(EFIAPI * EFI_HTTP_REQUEST) (IN EFI_HTTP_PROTOCOL *This, IN EFI_HTTP_TOKEN *Token)

The Request() function queues an HTTP request to this HTTP instance, similar to Transmit() function in the EFI TCP driver.

When the HTTP request is sent successfully, or if there is an error, Status in token will be updated and Event will be signaled.

Parameters
[in]ThisPointer to EFI_HTTP_PROTOCOL instance.
[in]TokenPointer to storage containing HTTP request token.
Return values
EFI_SUCCESSOutgoing data was processed.
EFI_NOT_STARTEDThis EFI HTTP Protocol instance has not been started.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
EFI_TIMEOUTData was dropped out of the transmit or receive queue.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: This is NULL. Token is NULL. Token->Message is NULL. Token->Message->Body is not NULL, Token->Message->BodyLength is non-zero, and Token->Message->Data is NULL, but a previous call to Request()has not been completed successfully.
EFI_OUT_OF_RESOURCESCould not allocate enough system resources.
EFI_UNSUPPORTEDThe HTTP method is not supported in current implementation.

Definition at line 386 of file Http.h.

◆ EFI_HTTP_CANCEL

typedef EFI_STATUS(EFIAPI * EFI_HTTP_CANCEL) (IN EFI_HTTP_PROTOCOL *This, IN EFI_HTTP_TOKEN *Token)

Abort an asynchronous HTTP request or response token.

The Cancel() function aborts a pending HTTP request or response transaction. If Token is not NULL and the token is in transmit or receive queues when it is being cancelled, its Token->Status will be set to EFI_ABORTED and then Token->Event will be signaled. If the token is not in one of the queues, which usually means that the asynchronous operation has completed, EFI_NOT_FOUND is returned. If Token is NULL, all asynchronous tokens issued by Request() or Response() will be aborted.

Parameters
[in]ThisPointer to EFI_HTTP_PROTOCOL instance.
[in]TokenPoint to storage containing HTTP request or response token.
Return values
EFI_SUCCESSRequest and Response queues are successfully flushed.
EFI_INVALID_PARAMETERThis is NULL.
EFI_NOT_STARTEDThis instance hasn't been configured.
EFI_NOT_FOUNDThe asynchronous request or response token is not found.
EFI_UNSUPPORTEDThe implementation does not support this function.

Definition at line 414 of file Http.h.

◆ EFI_HTTP_RESPONSE

typedef EFI_STATUS(EFIAPI * EFI_HTTP_RESPONSE) (IN EFI_HTTP_PROTOCOL *This, IN EFI_HTTP_TOKEN *Token)

The Response() function queues an HTTP response to this HTTP instance, similar to Receive() function in the EFI TCP driver.

When the HTTP Response is received successfully, or if there is an error, Status in token will be updated and Event will be signaled.

The HTTP driver will queue a receive token to the underlying TCP instance. When data is received in the underlying TCP instance, the data will be parsed and Token will be populated with the response data. If the data received from the remote host contains an incomplete or invalid HTTP header, the HTTP driver will continue waiting (asynchronously) for more data to be sent from the remote host before signaling Event in Token.

It is the responsibility of the caller to allocate a buffer for Body and specify the size in BodyLength. If the remote host provides a response that contains a content body, up to BodyLength bytes will be copied from the receive buffer into Body and BodyLength will be updated with the amount of bytes received and copied to Body. This allows the client to download a large file in chunks instead of into one contiguous block of memory. Similar to HTTP request, if Body is not NULL and BodyLength is non-zero and all other fields are NULL or 0, the HTTP driver will queue a receive token to underlying TCP instance. If data arrives in the receive buffer, up to BodyLength bytes of data will be copied to Body. The HTTP driver will then update BodyLength with the amount of bytes received and copied to Body.

If the HTTP driver does not have an open underlying TCP connection with the host specified in the response URL, Request() will return EFI_ACCESS_DENIED. This is consistent with RFC 2616 recommendation that HTTP clients should attempt to maintain an open TCP connection between client and host.

Parameters
[in]ThisPointer to EFI_HTTP_PROTOCOL instance.
[in]TokenPointer to storage containing HTTP response token.
Return values
EFI_SUCCESSAllocation succeeded.
EFI_NOT_STARTEDThis EFI HTTP Protocol instance has not been initialized.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: This is NULL. Token is NULL. Token->Message->Headers is NULL. Token->Message is NULL. Token->Message->Body is not NULL, Token->Message->BodyLength is non-zero, and Token->Message->Data is NULL, but a previous call to Response() has not been completed successfully.
EFI_OUT_OF_RESOURCESCould not allocate enough system resources.
EFI_ACCESS_DENIEDAn open TCP connection is not present with the host specified by response URL.

Definition at line 468 of file Http.h.

◆ EFI_HTTP_POLL

typedef EFI_STATUS(EFIAPI * EFI_HTTP_POLL) (IN EFI_HTTP_PROTOCOL *This)

The Poll() function can be used by network drivers and applications to increase the rate that data packets are moved between the communication devices and the transmit and receive queues.

In some systems, the periodic timer event in the managed network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets without missing incoming packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should try calling the Poll() function more often.

Parameters
[in]ThisPointer to EFI_HTTP_PROTOCOL instance.
Return values
EFI_SUCCESSIncoming or outgoing data was processed..
EFI_DEVICE_ERRORAn unexpected system or network error occurred
EFI_INVALID_PARAMETERThis is NULL.
EFI_NOT_READYNo incoming or outgoing data is processed.
EFI_NOT_STARTEDThis EFI HTTP Protocol instance has not been started.

Definition at line 494 of file Http.h.

Enumeration Type Documentation

◆ EFI_HTTP_VERSION

EFI_HTTP_VERSION.

Enumerator
HttpVersion10 
HttpVersion11 
HttpVersionUnsupported 

Definition at line 36 of file Http.h.

36  {
EFI_HTTP_VERSION
EFI_HTTP_VERSION.
Definition: Http.h:36

◆ EFI_HTTP_METHOD

EFI_HTTP_METHOD.

Enumerator
HttpMethodGet 
HttpMethodPost 
HttpMethodPatch 
HttpMethodOptions 
HttpMethodConnect 
HttpMethodHead 
HttpMethodPut 
HttpMethodDelete 
HttpMethodTrace 
HttpMethodMax 

Definition at line 45 of file Http.h.

◆ EFI_HTTP_STATUS_CODE

EFI_HTTP_STATUS_CODE.

Enumerator
HTTP_STATUS_UNSUPPORTED_STATUS 
HTTP_STATUS_100_CONTINUE 
HTTP_STATUS_101_SWITCHING_PROTOCOLS 
HTTP_STATUS_200_OK 
HTTP_STATUS_201_CREATED 
HTTP_STATUS_202_ACCEPTED 
HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION 
HTTP_STATUS_204_NO_CONTENT 
HTTP_STATUS_205_RESET_CONTENT 
HTTP_STATUS_206_PARTIAL_CONTENT 
HTTP_STATUS_300_MULTIPLE_CHOICES 
HTTP_STATUS_301_MOVED_PERMANENTLY 
HTTP_STATUS_302_FOUND 
HTTP_STATUS_303_SEE_OTHER 
HTTP_STATUS_304_NOT_MODIFIED 
HTTP_STATUS_305_USE_PROXY 
HTTP_STATUS_307_TEMPORARY_REDIRECT 
HTTP_STATUS_400_BAD_REQUEST 
HTTP_STATUS_401_UNAUTHORIZED 
HTTP_STATUS_402_PAYMENT_REQUIRED 
HTTP_STATUS_403_FORBIDDEN 
HTTP_STATUS_404_NOT_FOUND 
HTTP_STATUS_405_METHOD_NOT_ALLOWED 
HTTP_STATUS_406_NOT_ACCEPTABLE 
HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED 
HTTP_STATUS_408_REQUEST_TIME_OUT 
HTTP_STATUS_409_CONFLICT 
HTTP_STATUS_410_GONE 
HTTP_STATUS_411_LENGTH_REQUIRED 
HTTP_STATUS_412_PRECONDITION_FAILED 
HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE 
HTTP_STATUS_414_REQUEST_URI_TOO_LARGE 
HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE 
HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED 
HTTP_STATUS_417_EXPECTATION_FAILED 
HTTP_STATUS_500_INTERNAL_SERVER_ERROR 
HTTP_STATUS_501_NOT_IMPLEMENTED 
HTTP_STATUS_502_BAD_GATEWAY 
HTTP_STATUS_503_SERVICE_UNAVAILABLE 
HTTP_STATUS_504_GATEWAY_TIME_OUT 
HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED 
HTTP_STATUS_308_PERMANENT_REDIRECT 

Definition at line 61 of file Http.h.

61  {
EFI_HTTP_STATUS_CODE
EFI_HTTP_STATUS_CODE.
Definition: Http.h:61

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( BSD2_PATENT  )

Variable Documentation

◆ gEfiHttpServiceBindingProtocolGuid

EFI_GUID gEfiHttpServiceBindingProtocolGuid

◆ gEfiHttpProtocolGuid

EFI_GUID gEfiHttpProtocolGuid