--- /dev/null
+/** @file\r
+ This file defines the EFI Domain Name Service Binding Protocol interface. It is split\r
+ into the following two main sections:\r
+ DNSv4 Service Binding Protocol (DNSv4SB)\r
+ DNSv4 Protocol (DNSv4)\r
+\r
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ @par Revision Reference:\r
+ This Protocol is introduced in UEFI Specification 2.5\r
+\r
+**/\r
+\r
+#ifndef __EFI_DNS4_PROTOCOL_H__\r
+#define __EFI_DNS4_PROTOCOL_H__\r
+\r
+#define EFI_DNS4_SERVICE_BINDING_PROTOCOL_GUID \\r
+ { \\r
+ 0xb625b186, 0xe063, 0x44f7, {0x89, 0x5, 0x6a, 0x74, 0xdc, 0x6f, 0x52, 0xb4 } \\r
+ }\r
+\r
+#define EFI_DNS4_PROTOCOL_GUID \\r
+ { \\r
+ 0xae3d28cc, 0xe05b, 0x4fa1, {0xa0, 0x11, 0x7e, 0xb5, 0x5a, 0x3f, 0x14, 0x1 } \\r
+ }\r
+\r
+typedef struct _EFI_DNS4_PROTOCOL EFI_DNS4_PROTOCOL;\r
+\r
+///\r
+/// EFI_DNS4_CONFIG_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Count of the DNS servers. When used with GetModeData(), \r
+ /// this field is the count of originally configured servers when \r
+ /// Configure() was called for this instance. When used with \r
+ /// Configure() this is the count of caller-supplied servers. If the \r
+ /// DnsServerListCount is zero, the DNS server configuration \r
+ /// will be retrieved from DHCP server automatically.\r
+ ///\r
+ UINTN DnsServerListCount;\r
+ ///\r
+ /// Pointer to DNS server list containing DnsServerListCount entries or NULL \r
+ /// if DnsServerListCountis 0. For Configure(), this will be NULL when there are \r
+ /// no caller supplied server addresses, and, the DNS instance will retrieve \r
+ /// DNS server from DHCP Server. The provided DNS server list is \r
+ /// recommended to be filled up in the sequence of preference. When \r
+ /// used with GetModeData(), the buffer containing the list will \r
+ /// be allocated by the driver implementing this protocol and must be \r
+ /// freed by the caller. When used with Configure(), the buffer \r
+ /// containing the list will be allocated and released by the caller.\r
+ ///\r
+ EFI_IPv4_ADDRESS *DnsServerList;\r
+ ///\r
+ /// Set to TRUE to use the default IP address/subnet mask and default routing table.\r
+ ///\r
+ BOOLEAN UseDefaultSetting;\r
+ ///\r
+ /// If TRUE, enable DNS cache function for this DNS instance. If FALSE, all DNS\r
+ /// query will not lookup local DNS cache.\r
+ ///\r
+ BOOLEAN EnableDnsCache;\r
+ ///\r
+ /// Use the protocol number defined in "Links to UEFI-Related \r
+ /// Documents"(http://uefi.org/uefi) under the heading "IANA \r
+ /// Protocol Numbers". Only TCP or UDP are supported, and other \r
+ /// protocol values are invalid. An implementation can choose to \r
+ /// support only UDP, or both TCP and UDP.\r
+ ///\r
+ UINT8 Protocol;\r
+ ///\r
+ /// If UseDefaultSetting is FALSE indicates the station address to use.\r
+ ///\r
+ EFI_IPv4_ADDRESS StationIp;\r
+ ///\r
+ /// If UseDefaultSetting is FALSE indicates the subnet mask to use.\r
+ ///\r
+ EFI_IPv4_ADDRESS SubnetMask;\r
+ ///\r
+ /// Local port number. Set to zero to use the automatically assigned port number.\r
+ ///\r
+ UINT16 LocalPort;\r
+ ///\r
+ /// Retry number if no response received after RetryInterval.\r
+ ///\r
+ UINT32 RetryCount;\r
+ ///\r
+ /// Minimum interval of retry is 2 second. If the retry interval is less than 2\r
+ /// seconds, then use the 2 seconds.\r
+ ///\r
+ UINT32 RetryInterval;\r
+} EFI_DNS4_CONFIG_DATA;\r
+\r
+\r
+///\r
+/// EFI_DNS4_CACHE_ENTRY\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Host name.\r
+ ///\r
+ CHAR16 *HostName;\r
+ ///\r
+ /// IP address of this host.\r
+ ///\r
+ EFI_IPv4_ADDRESS *IpAddress;\r
+ ///\r
+ /// Time in second unit that this entry will remain in DNS cache. A value of zero\r
+ /// means that this entry is permanent. A nonzero value will override the existing\r
+ /// one if this entry to be added is dynamic entry. Implementations may set its\r
+ /// default timeout value for the dynamically created DNS cache entry after one DNS\r
+ /// resolve succeeds.\r
+ ///\r
+ UINT32 Timeout;\r
+} EFI_DNS4_CACHE_ENTRY;\r
+\r
+///\r
+/// EFI_DNS4_MODE_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// The configuration data of this instance.\r
+ ///\r
+ EFI_DNS4_CONFIG_DATA DnsConfigData;\r
+ ///\r
+ /// Number of configured DNS server. Each DNS instance has its own DNS server\r
+ /// configuration.\r
+ ///\r
+ UINT32 DnsServerCount;\r
+ ///\r
+ /// Pointer to common list of addresses of all configured DNS server \r
+ /// used by EFI_DNS4_PROTOCOL instances. List will include \r
+ /// DNS servers configured by this or any other EFI_DNS4_PROTOCOL instance. \r
+ /// The storage for this list is allocated by the driver publishing this \r
+ /// protocol, and must be freed by the caller.\r
+ ///\r
+ EFI_IPv4_ADDRESS *DnsServerList;\r
+ ///\r
+ /// Number of DNS Cache entries. The DNS Cache is shared among all DNS instances.\r
+ ///\r
+ UINT32 DnsCacheCount;\r
+ ///\r
+ /// Pointer to a buffer containing DnsCacheCount DNS Cache \r
+ /// entry structures. The storage for this list is allocated by the driver \r
+ /// publishing this protocol and must be freed by caller.\r
+ ///\r
+ EFI_DNS4_CACHE_ENTRY *DnsCacheList;\r
+} EFI_DNS4_MODE_DATA;\r
+\r
+///\r
+/// DNS_HOST_TO_ADDR_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Number of the returned IP addresses.\r
+ ///\r
+ UINT32 IpCount;\r
+ ///\r
+ /// Pointer to the all the returned IP addresses.\r
+ ///\r
+ EFI_IPv4_ADDRESS *IpList;\r
+} DNS_HOST_TO_ADDR_DATA;\r
+\r
+///\r
+/// DNS_ADDR_TO_HOST_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Pointer to the primary name for this host address. It's the caller's\r
+ /// responsibility to free the response memory.\r
+ ///\r
+ CHAR16 *HostName;\r
+} DNS_ADDR_TO_HOST_DATA;\r
+\r
+///\r
+/// DNS_RESOURCE_RECORD\r
+///\r
+typedef struct {\r
+ ///\r
+ /// The Owner name.\r
+ ///\r
+ CHAR8 *QName;\r
+ ///\r
+ /// The Type Code of this RR.\r
+ ///\r
+ UINT16 QType;\r
+ ///\r
+ /// The CLASS code of this RR.\r
+ ///\r
+ UINT16 QClass;\r
+ ///\r
+ /// 32 bit integer which specify the time interval that the resource record may be\r
+ /// cached before the source of the information should again be consulted. Zero means\r
+ /// this RR can not be cached.\r
+ ///\r
+ UINT32 TTL;\r
+ ///\r
+ /// 16 big integer which specify the length of RData.\r
+ ///\r
+ UINT16 DataLength;\r
+ ///\r
+ /// A string of octets that describe the resource, the format of this information\r
+ /// varies according to QType and QClass difference.\r
+ ///\r
+ CHAR8 *RData;\r
+} DNS_RESOURCE_RECORD;\r
+\r
+///\r
+/// DNS_GENERAL_LOOKUP_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Number of returned matching RRs.\r
+ ///\r
+ UINTN RRCount;\r
+ ///\r
+ /// Pointer to the all the returned matching RRs. It's caller responsibility to free\r
+ /// the allocated memory to hold the returned RRs.\r
+ ///\r
+ DNS_RESOURCE_RECORD *RRList;\r
+} DNS_GENERAL_LOOKUP_DATA;\r
+\r
+///\r
+/// EFI_DNS4_COMPLETION_TOKEN\r
+///\r
+typedef struct {\r
+ ///\r
+ /// This Event will be signaled after the Status field is updated by the EFI DNS\r
+ /// protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.\r
+ ///\r
+ EFI_EVENT Event;\r
+ ///\r
+ /// Will be set to one of the following values:\r
+ /// EFI_SUCCESS: The host name to address translation completed successfully.\r
+ /// EFI_NOT_FOUND: No matching Resource Record (RR) is found.\r
+ /// EFI_TIMEOUT: No DNS server reachable, or RetryCount was exhausted without\r
+ /// response from all specified DNS servers.\r
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r
+ /// EFI_NO_MEDIA: There was a media error.\r
+ ///\r
+ EFI_STATUS Status;\r
+ ///\r
+ /// Retry number if no response received after RetryInterval. If zero, use the\r
+ /// parameter configured through Dns.Configure() interface.\r
+ ///\r
+ UINT32 RetryCount;\r
+ ///\r
+ /// Minimum interval of retry is 2 second. If the retry interval is less than 2\r
+ /// seconds, then use the 2 seconds. If zero, use the parameter configured through\r
+ /// Dns.Configure() interface.\r
+ UINT32 RetryInterval;\r
+ ///\r
+ /// DNSv4 completion token data\r
+ ///\r
+ union {\r
+ ///\r
+ /// When the Token is used for host name to address translation, H2AData is a pointer\r
+ /// to the DNS_HOST_TO_ADDR_DATA.\r
+ ///\r
+ DNS_HOST_TO_ADDR_DATA *H2AData;\r
+ ///\r
+ /// When the Token is used for host address to host name translation, A2HData is a\r
+ /// pointer to the DNS_ADDR_TO_HOST_DATA.\r
+ ///\r
+ DNS_ADDR_TO_HOST_DATA *A2HData;\r
+ ///\r
+ /// When the Token is used for a general lookup function, GLookupDATA is a pointer to\r
+ /// the DNS_GENERAL_LOOKUP_DATA.\r
+ ///\r
+ DNS_GENERAL_LOOKUP_DATA *GLookupData;\r
+ } RspData;\r
+} EFI_DNS4_COMPLETION_TOKEN;\r
+\r
+/**\r
+ Retrieve mode data of this DNS instance.\r
+\r
+ This function is used to retrieve DNS mode data for this DNS instance.\r
+\r
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
+ @param[out] DnsModeData Point to the mode data.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data\r
+ is available because this instance has not been\r
+ configured.\r
+ @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS4_GET_MODE_DATA) (\r
+ IN EFI_DNS4_PROTOCOL *This,\r
+ OUT EFI_DNS4_MODE_DATA *DnsModeData\r
+ );\r
+\r
+/**\r
+ Configure this DNS instance.\r
+\r
+ This function is used to configure DNS mode data for this DNS instance.\r
+\r
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
+ @param[in] DnsConfigData Point to the Configuration data.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_UNSUPPORTED The designated protocol is not supported.\r
+ @retval EFI_INVALID_PARAMTER Thisis NULL.\r
+ The StationIp address provided in DnsConfigData is not a \r
+ valid unicast.\r
+ DnsServerList is NULL while DnsServerListCount\r
+ is not ZERO.\r
+ DnsServerListCount is ZERO while DnsServerList\r
+ is not NULL\r
+ @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be\r
+ allocated.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
+ EFI DNSv4 Protocol instance is not configured.\r
+ @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
+ reconfigure the instance the caller must call Configure() \r
+ with NULL first to return driver to unconfigured state.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS4_CONFIGURE) (\r
+ IN EFI_DNS4_PROTOCOL *This,\r
+ IN EFI_DNS4_CONFIG_DATA *DnsConfigData\r
+ );\r
+\r
+/**\r
+ Host name to host address translation.\r
+\r
+ The HostNameToIp () function is used to translate the host name to host IP address. A\r
+ type A query is used to get the one or more IP addresses for this host.\r
+\r
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
+ @param[in] Hostname Host name.\r
+ @param[in] Token Point to the completion token to translate host name\r
+ to host address.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ Token.Event is NULL.\r
+ HostName is NULL. HostName string is unsupported format.\r
+ @retval EFI_NO_MAPPING There's no source address is available for use.\r
+ @retval EFI_NOT_STARTED This instance has not been started.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS4_HOST_NAME_TO_IP) (\r
+ IN EFI_DNS4_PROTOCOL *This,\r
+ IN CHAR16 *HostName,\r
+ IN EFI_DNS4_COMPLETION_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ IPv4 address to host name translation also known as Reverse DNS lookup.\r
+\r
+ The IpToHostName() function is used to translate the host address to host name. A type PTR \r
+ query is used to get the primary name of the host. Support of this function is optional.\r
+\r
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
+ @param[in] IpAddress Ip Address.\r
+ @param[in] Token Point to the completion token to translate host\r
+ address to host name.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_UNSUPPORTED This function is not supported.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ Token.Event is NULL.\r
+ IpAddress is not valid IP address .\r
+ @retval EFI_NO_MAPPING There's no source address is available for use.\r
+ @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
+ @retval EFI_NOT_STARTED This instance has not been started.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS4_IP_TO_HOST_NAME) (\r
+ IN EFI_DNS4_PROTOCOL *This,\r
+ IN EFI_IPv4_ADDRESS IpAddress,\r
+ IN EFI_DNS4_COMPLETION_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ Retrieve arbitrary information from the DNS server. \r
+\r
+ This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r
+ supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r
+ RR content (e.g., TTL) was returned. The caller need parse the returned RR to get\r
+ required information. The function is optional.\r
+\r
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
+ @param[in] QName Pointer to Query Name.\r
+ @param[in] QType Query Type.\r
+ @param[in] QClass Query Name.\r
+ @param[in] Token Point to the completion token to retrieve arbitrary\r
+ information.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_UNSUPPORTED This function is not supported. Or the requested\r
+ QType is not supported\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ Token.Event is NULL.\r
+ QName is NULL.\r
+ @retval EFI_NO_MAPPING There's no source address is available for use.\r
+ @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS4_GENERAL_LOOKUP) (\r
+ IN EFI_DNS4_PROTOCOL *This,\r
+ IN CHAR8 *QName,\r
+ IN UINT16 QType,\r
+ IN UINT16 QClass,\r
+ IN EFI_DNS4_COMPLETION_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ This function is to update the DNS Cache.\r
+\r
+ The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache\r
+ can be normally dynamically updated after the DNS resolve succeeds. This function\r
+ provided capability to manually add/delete/modify the DNS cache.\r
+\r
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
+ @param[in] DeleteFlag If FALSE, this function is to add one entry to the\r
+ DNS Cahce. If TRUE, this function will delete\r
+ matching DNS Cache entry.\r
+ @param[in] Override If TRUE, the maching DNS cache entry will be\r
+ overwritten with the supplied parameter. If FALSE,\r
+ EFI_ACCESS_DENIED will be returned if the entry to\r
+ be added is already existed.\r
+ @param[in] DnsCacheEntry Pointer to DNS Cache entry.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ DnsCacheEntry.HostName is NULL.\r
+ DnsCacheEntry.IpAddress is NULL.\r
+ DnsCacheEntry.Timeout is zero.\r
+ @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is\r
+ not TRUE.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS4_UPDATE_DNS_CACHE) (\r
+ IN EFI_DNS4_PROTOCOL *This,\r
+ IN BOOLEAN DeleteFlag,\r
+ IN BOOLEAN Override,\r
+ IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry\r
+ );\r
+\r
+/**\r
+ Polls for incoming data packets and processes outgoing data packets.\r
+\r
+ The Poll() function can be used by network drivers and applications to increase the\r
+ rate that data packets are moved between the communications device and the transmit\r
+ and receive queues.\r
+ In some systems, the periodic timer event in the managed network driver may not poll\r
+ the underlying communications device fast enough to transmit and/or receive all data\r
+ packets without missing incoming packets or dropping outgoing packets. Drivers and\r
+ applications that are experiencing packet loss should try calling the Poll()\r
+ function more often.\r
+\r
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
+\r
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
+ @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive\r
+ queue. Consider increasing the polling rate.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS4_POLL) (\r
+ IN EFI_DNS4_PROTOCOL *This\r
+ );\r
+\r
+/**\r
+ Abort an asynchronous DNS operation, including translation between IP and Host, and\r
+ general look up behavior.\r
+\r
+ The Cancel() function is used to abort a pending resolution request. After calling\r
+ this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be\r
+ signaled. If the token is not in one of the queues, which usually means that the\r
+ asynchronous operation has completed, this function will not signal the token and\r
+ EFI_NOT_FOUND is returned.\r
+\r
+ @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
+ @param[in] Token Pointer to a token that has been issued by\r
+ EFI_DNS4_PROTOCOL.HostNameToIp (),\r
+ EFI_DNS4_PROTOCOL.IpToHostName() or\r
+ EFI_DNS4_PROTOCOL.GeneralLookup().\r
+ If NULL, all pending tokens are aborted.\r
+\r
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
+ @retval EFI_NOT_STARTED This EFI DNS4 Protocol instance has not been started.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS\r
+ operation was not found in the transmit queue. It\r
+ was either completed or was not issued by\r
+ HostNameToIp(), IpToHostName() or GeneralLookup().\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS4_CANCEL) (\r
+ IN EFI_DNS4_PROTOCOL *This,\r
+ IN EFI_DNS4_COMPLETION_TOKEN *Token\r
+ );\r
+\r
+///\r
+/// The EFI_DNS4_Protocol provides the function to get the host name and address\r
+/// mapping, also provides pass through interface to retrieve arbitrary information\r
+/// from DNS.\r
+///\r
+struct _EFI_DNS4_PROTOCOL {\r
+ EFI_DNS4_GET_MODE_DATA GetModeData;\r
+ EFI_DNS4_CONFIGURE Configure;\r
+ EFI_DNS4_HOST_NAME_TO_IP HostNameToIp;\r
+ EFI_DNS4_IP_TO_HOST_NAME IpToHostName;\r
+ EFI_DNS4_GENERAL_LOOKUP GeneralLookUp;\r
+ EFI_DNS4_UPDATE_DNS_CACHE UpdateDnsCache;\r
+ EFI_DNS4_POLL Poll;\r
+ EFI_DNS4_CANCEL Cancel;\r
+};\r
+\r
+extern EFI_GUID gEfiDns4ServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiDns4ProtocolGuid;\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ This file defines the EFI DNSv6 (Domain Name Service version 6) Protocol. It is split\r
+ into the following two main sections:\r
+ DNSv6 Service Binding Protocol (DNSv6SB)\r
+ DNSv6 Protocol (DNSv6)\r
+\r
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ @par Revision Reference:\r
+ This Protocol is introduced in UEFI Specification 2.5\r
+\r
+**/\r
+\r
+#ifndef __EFI_DNS6_PROTOCOL_H__\r
+#define __EFI_DNS6_PROTOCOL_H__\r
+\r
+#define EFI_DNS6_SERVICE_BINDING_PROTOCOL_GUID \\r
+ { \\r
+ 0x7f1647c8, 0xb76e, 0x44b2, {0xa5, 0x65, 0xf7, 0xf, 0xf1, 0x9c, 0xd1, 0x9e } \\r
+ }\r
+\r
+#define EFI_DNS6_PROTOCOL_GUID \\r
+ { \\r
+ 0xca37bc1f, 0xa327, 0x4ae9, {0x82, 0x8a, 0x8c, 0x40, 0xd8, 0x50, 0x6a, 0x17 } \\r
+ }\r
+\r
+typedef struct _EFI_DNS6_PROTOCOL EFI_DNS6_PROTOCOL;\r
+\r
+///\r
+/// EFI_DNS6_CONFIG_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// If TRUE, enable DNS cache function for this DNS instance. If FALSE, all DNS query\r
+ /// will not lookup local DNS cache.\r
+ ///\r
+ BOOLEAN EnableDnsCache;\r
+ ///\r
+ /// Use the protocol number defined in\r
+ /// http://www.iana.org/assignments/protocol-numbers. Beside TCP/UDP, Other protocol\r
+ /// is invalid value. An implementation can choose to support UDP, or both TCP and UDP.\r
+ ///\r
+ UINT8 Protocol;\r
+ ///\r
+ /// The local IP address to use. Set to zero to let the underlying IPv6 \r
+ /// driver choose a source address. If not zero it must be one of the \r
+ /// configured IP addresses in the underlying IPv6 driver.\r
+ ///\r
+ EFI_IPv6_ADDRESS StationIp;\r
+ ///\r
+ /// Local port number. Set to zero to use the automatically assigned port number.\r
+ ///\r
+ UINT16 LocalPort;\r
+ ///\r
+ /// Count of the DNS servers. When used with GetModeData(), \r
+ /// this field is the count of originally configured servers when \r
+ /// Configure() was called for this instance. When used with \r
+ /// Configure() this is the count of caller-supplied servers. If the \r
+ /// DnsServerListCount is zero, the DNS server configuration \r
+ /// will be retrieved from DHCP server automatically.\r
+ ///\r
+ UINT32 DnsServerCount;\r
+ ///\r
+ /// Pointer to DNS server list containing DnsServerListCount\r
+ /// entries or NULL if DnsServerListCount is 0. For Configure(), \r
+ /// this will be NULL when there are no caller supplied server addresses \r
+ /// and the DNS instance will retrieve DNS server from DHCP Server. \r
+ /// The provided DNS server list is recommended to be filled up in the sequence \r
+ /// of preference. When used with GetModeData(), the buffer containing the list \r
+ /// will be allocated by the driver implementing this protocol and must be \r
+ /// freed by the caller. When used with Configure(), the buffer \r
+ /// containing the list will be allocated and released by the caller.\r
+ ///\r
+ EFI_IPv6_ADDRESS *DnsServerList;\r
+ ///\r
+ /// Retry number if no response received after RetryInterval.\r
+ ///\r
+ UINT32 RetryCount;\r
+ ///\r
+ /// Minimum interval of retry is 2 second. If the retry interval is less than 2\r
+ /// seconds, then use the 2 seconds.\r
+ UINT32 RetryInterval;\r
+} EFI_DNS6_CONFIG_DATA;\r
+\r
+///\r
+/// EFI_DNS6_CACHE_ENTRY\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Host name. This should be interpreted as Unicode characters.\r
+ ///\r
+ CHAR16 *HostName;\r
+ ///\r
+ /// IP address of this host.\r
+ ///\r
+ EFI_IPv6_ADDRESS *IpAddress;\r
+ ///\r
+ /// Time in second unit that this entry will remain in DNS cache. A value of zero means\r
+ /// that this entry is permanent. A nonzero value will override the existing one if\r
+ /// this entry to be added is dynamic entry. Implementations may set its default\r
+ /// timeout value for the dynamically created DNS cache entry after one DNS resolve\r
+ /// succeeds.\r
+ UINT32 Timeout;\r
+} EFI_DNS6_CACHE_ENTRY;\r
+\r
+///\r
+/// EFI_DNS6_MODE_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// The configuration data of this instance.\r
+ ///\r
+ EFI_DNS6_CONFIG_DATA DnsConfigData;\r
+ ///\r
+ /// Number of configured DNS6 servers.\r
+ ///\r
+ UINT32 DnsServerCount;\r
+ ///\r
+ /// Pointer to common list of addresses of all configured DNS server used by EFI_DNS6_PROTOCOL \r
+ /// instances. List will include DNS servers configured by this or any other EFI_DNS6_PROTOCOL \r
+ /// instance. The storage for this list is allocated by the driver publishing this protocol, \r
+ /// and must be freed by the caller.\r
+ ///\r
+ EFI_IPv6_ADDRESS *DnsServerList;\r
+ ///\r
+ /// Number of DNS Cache entries. The DNS Cache is shared among all DNS instances.\r
+ ///\r
+ UINT32 DnsCacheCount;\r
+ ///\r
+ /// Pointer to a buffer containing DnsCacheCount DNS Cache \r
+ /// entry structures. The storage for thislist is allocated by the driver \r
+ /// publishing this protocol and must be freed by caller.\r
+ ///\r
+ EFI_DNS6_CACHE_ENTRY *DnsCacheList;\r
+} EFI_DNS6_MODE_DATA;\r
+\r
+///\r
+/// DNS6_HOST_TO_ADDR_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Number of the returned IP address.\r
+ ///\r
+ UINT32 IpCount;\r
+ ///\r
+ /// Pointer to the all the returned IP address.\r
+ ///\r
+ EFI_IPv6_ADDRESS *IpList;\r
+} DNS6_HOST_TO_ADDR_DATA;\r
+\r
+///\r
+/// DNS6_ADDR_TO_HOST_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Pointer to the primary name for this host address. It's the caller's\r
+ /// responsibility to free the response memory.\r
+ ///\r
+ CHAR16 *HostName;\r
+} DNS6_ADDR_TO_HOST_DATA;\r
+\r
+///\r
+/// DNS6_RESOURCE_RECORD\r
+///\r
+typedef struct {\r
+ ///\r
+ /// The Owner name.\r
+ ///\r
+ CHAR8 *QName;\r
+ ///\r
+ /// The Type Code of this RR.\r
+ ///\r
+ UINT16 QType;\r
+ ///\r
+ /// The CLASS code of this RR.\r
+ ///\r
+ UINT16 QClass;\r
+ ///\r
+ /// 32 bit integer which specify the time interval that the resource record may be\r
+ /// cached before the source of the information should again be consulted. Zero means\r
+ /// this RR cannot be cached.\r
+ ///\r
+ UINT32 TTL;\r
+ ///\r
+ /// 16 big integer which specify the length of RData.\r
+ ///\r
+ UINT16 DataLength;\r
+ ///\r
+ /// A string of octets that describe the resource, the format of this information\r
+ /// varies according to QType and QClass difference.\r
+ ///\r
+ CHAR8 *RData;\r
+} DNS6_RESOURCE_RECORD;\r
+\r
+///\r
+/// DNS6_GENERAL_LOOKUP_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Number of returned matching RRs.\r
+ ///\r
+ UINTN RRCount;\r
+ ///\r
+ /// Pointer to the all the returned matching RRs. It's caller responsibility to free\r
+ /// the allocated memory to hold the returned RRs.\r
+ ///\r
+ DNS6_RESOURCE_RECORD *RRList;\r
+} DNS6_GENERAL_LOOKUP_DATA;\r
+\r
+///\r
+/// EFI_DNS6_COMPLETION_TOKEN\r
+///\r
+typedef struct {\r
+ ///\r
+ /// This Event will be signaled after the Status field is updated by the EFI DNSv6\r
+ /// protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.\r
+ ///\r
+ EFI_EVENT Event;\r
+ ///\r
+ /// Will be set to one of the following values:\r
+ /// EFI_SUCCESS: The host name to address translation completed successfully.\r
+ /// EFI_NOT_FOUND: No matching Resource Record (RR) is found.\r
+ /// EFI_TIMEOUT: No DNS server reachable, or RetryCount was exhausted without\r
+ /// response from all specified DNS servers.\r
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r
+ /// EFI_NO_MEDIA: There was a media error.\r
+ ///\r
+ EFI_STATUS Status;\r
+ ///\r
+ /// The parameter configured through DNSv6.Configure() interface. Retry number if no\r
+ /// response received after RetryInterval.\r
+ ///\r
+ UINT32 RetryCount;\r
+ ///\r
+ /// The parameter configured through DNSv6.Configure() interface. Minimum interval of\r
+ /// retry is 2 seconds. If the retry interval is less than 2 seconds, then use the 2\r
+ /// seconds.\r
+ ///\r
+ UINT32 RetryInterval;\r
+ ///\r
+ /// DNSv6 completion token data\r
+ ///\r
+ union {\r
+ ///\r
+ /// When the Token is used for host name to address translation, H2AData is a pointer\r
+ /// to the DNS6_HOST_TO_ADDR_DATA.\r
+ ///\r
+ DNS6_HOST_TO_ADDR_DATA *H2AData;\r
+ ///\r
+ /// When the Token is used for host address to host name translation, A2HData is a\r
+ /// pointer to the DNS6_ADDR_TO_HOST_DATA.\r
+ ///\r
+ DNS6_ADDR_TO_HOST_DATA *A2HData;\r
+ ///\r
+ /// When the Token is used for a general lookup function, GLookupDATA is a pointer to\r
+ /// the DNS6_GENERAL_LOOKUP_DATA.\r
+ ///\r
+ DNS6_GENERAL_LOOKUP_DATA *GLookupData;\r
+ } RspData;\r
+} EFI_DNS6_COMPLETION_TOKEN;\r
+\r
+/**\r
+ Retrieve mode data of this DNS instance.\r
+\r
+ This function is used to retrieve DNS mode data for this DNS instance.\r
+\r
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
+ @param[out] DnsModeData Pointer to the caller-allocated storage for the \r
+ EFI_DNS6_MODE_DATA data.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data\r
+ is available because this instance has not been\r
+ configured.\r
+ @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.\r
+ @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * EFI_DNS6_GET_MODE_DATA)(\r
+ IN EFI_DNS6_PROTOCOL *This,\r
+ OUT EFI_DNS6_MODE_DATA *DnsModeData\r
+ );\r
+\r
+/**\r
+ Configure this DNS instance.\r
+\r
+ The Configure() function is used to set and change the configuration data for this\r
+ EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.\r
+\r
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
+ @param[in] DnsConfigData Pointer to the configuration data structure. All associated \r
+ storage to be allocated and released by caller.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_INVALID_PARAMTER This is NULL.\r
+ The StationIp address provided in DnsConfigData is not a valid unicast.\r
+ DnsServerList is NULL while DnsServerList Count is not ZERO.\r
+ DnsServerList Count is ZERO while DnsServerList is not NULL.\r
+ @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be allocated.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
+ EFI DNSv6 Protocol instance is not configured.\r
+ @retval EFI_UNSUPPORTED The designated protocol is not supported.\r
+ @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
+ reconfigure the instance the caller must call Configure() with \r
+ NULL first to return driver to unconfigured state.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * EFI_DNS6_CONFIGURE)(\r
+ IN EFI_DNS6_PROTOCOL *This,\r
+ IN EFI_DNS6_CONFIG_DATA *DnsConfigData\r
+ );\r
+\r
+/**\r
+ Host name to host address translation.\r
+\r
+ The HostNameToIp () function is used to translate the host name to host IP address. A\r
+ type A query is used to get the one or more IPv6 addresses for this host.\r
+\r
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
+ @param[in] Hostname Host name.\r
+ @param[in] Token Point to the completion token to translate host name\r
+ to host address.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ Token.Event is NULL.\r
+ HostName is NULL or buffer contained unsupported characters.\r
+ @retval EFI_NO_MAPPING There's no source address is available for use.\r
+ @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
+ @retval EFI_NOT_STARTED This instance has not been started.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS6_HOST_NAME_TO_IP) (\r
+ IN EFI_DNS6_PROTOCOL *This,\r
+ IN CHAR16 *HostName,\r
+ IN EFI_DNS6_COMPLETION_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ Host address to host name translation.\r
+\r
+ The IpToHostName () function is used to translate the host address to host name. A\r
+ type PTR query is used to get the primary name of the host. Implementation can choose\r
+ to support this function or not.\r
+\r
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
+ @param[in] IpAddress Ip Address.\r
+ @param[in] Token Point to the completion token to translate host\r
+ address to host name.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_UNSUPPORTED This function is not supported.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ Token.Event is NULL.\r
+ IpAddress is not valid IP address.\r
+ @retval EFI_NO_MAPPING There's no source address is available for use.\r
+ @retval EFI_NOT_STARTED This instance has not been started.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS6_IP_TO_HOST_NAME) (\r
+ IN EFI_DNS6_PROTOCOL *This,\r
+ IN EFI_IPv6_ADDRESS IpAddress,\r
+ IN EFI_DNS6_COMPLETION_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ This function provides capability to retrieve arbitrary information from the DNS\r
+ server.\r
+\r
+ This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r
+ supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r
+ RR content (e.g., TTL) was returned. The caller need parse the returned RR to get\r
+ required information. The function is optional. Implementation can choose to support\r
+ it or not.\r
+\r
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
+ @param[in] QName Pointer to Query Name.\r
+ @param[in] QType Query Type.\r
+ @param[in] QClass Query Name.\r
+ @param[in] Token Point to the completion token to retrieve arbitrary\r
+ information.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_UNSUPPORTED This function is not supported. Or the requested\r
+ QType is not supported\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ Token.Event is NULL.\r
+ QName is NULL.\r
+ @retval EFI_NO_MAPPING There's no source address is available for use.\r
+ @retval EFI_NOT_STARTED This instance has not been started.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS6_GENERAL_LOOKUP) (\r
+ IN EFI_DNS6_PROTOCOL *This,\r
+ IN CHAR8 *QName,\r
+ IN UINT16 QType,\r
+ IN UINT16 QClass,\r
+ IN EFI_DNS6_COMPLETION_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ This function is to update the DNS Cache.\r
+\r
+ The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache\r
+ can be normally dynamically updated after the DNS resolve succeeds. This function\r
+ provided capability to manually add/delete/modify the DNS cache.\r
+\r
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
+ @param[in] DeleteFlag If FALSE, this function is to add one entry to the\r
+ DNS Cahce. If TRUE, this function will delete\r
+ matching DNS Cache entry.\r
+ @param[in] Override If TRUE, the maching DNS cache entry will be\r
+ overwritten with the supplied parameter. If FALSE,\r
+ EFI_ACCESS_DENIED will be returned if the entry to\r
+ be added is already existed.\r
+ @param[in] DnsCacheEntry Pointer to DNS Cache entry.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ DnsCacheEntry.HostName is NULL.\r
+ DnsCacheEntry.IpAddress is NULL.\r
+ DnsCacheEntry.Timeout is zero.\r
+ @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is\r
+ not TRUE.\r
+ @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS6_UPDATE_DNS_CACHE) (\r
+ IN EFI_DNS6_PROTOCOL *This,\r
+ IN BOOLEAN DeleteFlag,\r
+ IN BOOLEAN Override,\r
+ IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry\r
+ );\r
+\r
+/**\r
+ Polls for incoming data packets and processes outgoing data packets.\r
+\r
+ The Poll() function can be used by network drivers and applications to increase the\r
+ rate that data packets are moved between the communications device and the transmit\r
+ and receive queues.\r
+\r
+ In some systems, the periodic timer event in the managed network driver may not poll\r
+ the underlying communications device fast enough to transmit and/or receive all data\r
+ packets without missing incoming packets or dropping outgoing packets. Drivers and\r
+ applications that are experiencing packet loss should try calling the Poll()\r
+ function more often.\r
+\r
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
+\r
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
+ @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_NO_MAPPING There is no source address is available for use.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+ @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive\r
+ queue. Consider increasing the polling rate.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS6_POLL) (\r
+ IN EFI_DNS6_PROTOCOL *This\r
+ );\r
+\r
+/**\r
+ Abort an asynchronous DNS operation, including translation between IP and Host, and\r
+ general look up behavior.\r
+\r
+ The Cancel() function is used to abort a pending resolution request. After calling\r
+ this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be\r
+ signaled. If the token is not in one of the queues, which usually means that the\r
+ asynchronous operation has completed, this function will not signal the token and\r
+ EFI_NOT_FOUND is returned.\r
+\r
+ @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
+ @param[in] Token Pointer to a token that has been issued by\r
+ EFI_DNS6_PROTOCOL.HostNameToIp (),\r
+ EFI_DNS6_PROTOCOL.IpToHostName() or\r
+ EFI_DNS6_PROTOCOL.GeneralLookup().\r
+ If NULL, all pending tokens are aborted.\r
+\r
+ @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
+ @retval EFI_NOT_STARTED This EFI DNS6 Protocol instance has not been started.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_NO_MAPPING There's no source address is available for use.\r
+ @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS\r
+ operation was not found in the transmit queue. It\r
+ was either completed or was not issued by\r
+ HostNameToIp(), IpToHostName() or GeneralLookup().\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DNS6_CANCEL) (\r
+ IN EFI_DNS6_PROTOCOL *This,\r
+ IN EFI_DNS6_COMPLETION_TOKEN *Token\r
+ );\r
+\r
+///\r
+/// The EFI_DNS6_PROTOCOL provides the function to get the host name and address\r
+/// mapping, also provide pass through interface to retrieve arbitrary information from\r
+/// DNSv6.\r
+///\r
+struct _EFI_DNS6_PROTOCOL {\r
+ EFI_DNS6_GET_MODE_DATA GetModeData;\r
+ EFI_DNS6_CONFIGURE Configure;\r
+ EFI_DNS6_HOST_NAME_TO_IP HostNameToIp;\r
+ EFI_DNS6_IP_TO_HOST_NAME IpToHostName;\r
+ EFI_DNS6_GENERAL_LOOKUP GeneralLookUp;\r
+ EFI_DNS6_UPDATE_DNS_CACHE UpdateDnsCache;\r
+ EFI_DNS6_POLL Poll;\r
+ EFI_DNS6_CANCEL Cancel;\r
+};\r
+\r
+extern EFI_GUID gEfiDns6ServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiDns6ProtocolGuid;\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ This file defines the EFI HTTP Protocol interface. It is split into\r
+ the following two main sections:\r
+ HTTP Service Binding Protocol (HTTPSB)\r
+ HTTP Protocol (HTTP)\r
+\r
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ @par Revision Reference:\r
+ This Protocol is introduced in UEFI Specification 2.5\r
+\r
+**/\r
+\r
+#ifndef __EFI_HTTP_PROTOCOL_H__\r
+#define __EFI_HTTP_PROTOCOL_H__\r
+\r
+#define EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID \\r
+ { \\r
+ 0xbdc8e6af, 0xd9bc, 0x4379, {0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 0x1c } \\r
+ }\r
+\r
+#define EFI_HTTP_PROTOCOL_GUID \\r
+ { \\r
+ 0x7a59b29b, 0x910b, 0x4171, {0x82, 0x42, 0xa8, 0x5a, 0x0d, 0xf2, 0x5b, 0x5b } \\r
+ }\r
+\r
+typedef struct _EFI_HTTP_PROTOCOL EFI_HTTP_PROTOCOL;\r
+\r
+///\r
+/// EFI_HTTP_VERSION\r
+///\r
+typedef enum {\r
+ HttpVersion10,\r
+ HttpVersion11,\r
+ HttpVersionUnsupported\r
+} EFI_HTTP_VERSION;\r
+\r
+///\r
+/// EFI_HTTP_METHOD\r
+///\r
+typedef enum {\r
+ HttpMethodGet,\r
+ HttpMethodPost,\r
+ HttpMethodPatch,\r
+ HttpMethodOptions,\r
+ HttpMethodConnect,\r
+ HttpMethodHead,\r
+ HttpMethodPut,\r
+ HttpMethodDelete,\r
+ HttpMethodTrace\r
+} EFI_HTTP_METHOD;\r
+\r
+///\r
+/// EFI_HTTP_STATUS_CODE\r
+///\r
+typedef enum {\r
+ HTTP_STATUS_UNSUPPORTED_STATUS = 0,\r
+ HTTP_STATUS_100_CONTINUE,\r
+ HTTP_STATUS_101_SWITCHING_PROTOCOLS,\r
+ HTTP_STATUS_200_OK,\r
+ HTTP_STATUS_201_CREATED,\r
+ HTTP_STATUS_202_ACCEPTED,\r
+ HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION,\r
+ HTTP_STATUS_204_NO_CONTENT,\r
+ HTTP_STATUS_205_RESET_CONTENT,\r
+ HTTP_STATUS_206_PARTIAL_CONTENT,\r
+ HTTP_STATUS_300_MULTIPLE_CHIOCES,\r
+ HTTP_STATUS_301_MOVED_PERMANENTLY,\r
+ HTTP_STATUS_302_FOUND,\r
+ HTTP_STATUS_303_SEE_OTHER,\r
+ HTTP_STATUS_304_NOT_MODIFIED,\r
+ HTTP_STATUS_305_USE_PROXY,\r
+ HTTP_STATUS_307_TEMPORARY_REDIRECT,\r
+ HTTP_STATUS_400_BAD_REQUEST,\r
+ HTTP_STATUS_401_UNAUTHORIZED,\r
+ HTTP_STATUS_402_PAYMENT_REQUIRED,\r
+ HTTP_STATUS_403_FORBIDDEN,\r
+ HTTP_STATUS_404_NOT_FOUND,\r
+ HTTP_STATUS_405_METHOD_NOT_ALLOWED,\r
+ HTTP_STATUS_406_NOT_ACCEPTABLE,\r
+ HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED,\r
+ HTTP_STATUS_408_REQUEST_TIME_OUT,\r
+ HTTP_STATUS_409_CONFLICT,\r
+ HTTP_STATUS_410_GONE,\r
+ HTTP_STATUS_411_LENGTH_REQUIRED,\r
+ HTTP_STATUS_412_PRECONDITION_FAILED,\r
+ HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE,\r
+ HTTP_STATUS_414_REQUEST_URI_TOO_LARGE,\r
+ HTTP_STATUS_415_UNSUPPORETD_MEDIA_TYPE,\r
+ HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED,\r
+ HTTP_STATUS_417_EXPECTATION_FAILED,\r
+ HTTP_STATUS_500_INTERNAL_SERVER_ERROR,\r
+ HTTP_STATUS_501_NOT_IMIPLEMENTED,\r
+ HTTP_STATUS_502_BAD_GATEWAY,\r
+ HTTP_STATUS_503_SERVICE_UNAVAILABLE,\r
+ HTTP_STATUS_504_GATEWAY_TIME_OUT,\r
+ HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED\r
+} EFI_HTTP_STATUS_CODE;\r
+\r
+///\r
+/// EFI_HTTPv4_ACCESS_POINT\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Set to TRUE to instruct the EFI HTTP instance to use the default address\r
+ /// information in every TCP connection made by this instance. In addition, when set\r
+ /// to TRUE, LocalAddress, LocalSubnet, and LocalPort are ignored.\r
+ ///\r
+ BOOLEAN UseDefaultAddress;\r
+ ///\r
+ /// If UseDefaultAddress is set to FALSE, this defines the local IP address to be\r
+ /// used in every TCP connection opened by this instance.\r
+ ///\r
+ EFI_IPv4_ADDRESS LocalAddress;\r
+ ///\r
+ /// If UseDefaultAddress is set to FALSE, this defines the local subnet to be used\r
+ /// in every TCP connection opened by this instance.\r
+ ///\r
+ EFI_IPv4_ADDRESS LocalSubnet;\r
+ ///\r
+ /// If UseDefaultAddress is set to FALSE, this defines the local port to be used in\r
+ /// every TCP connection opened by this instance.\r
+ ///\r
+ UINT16 LocalPort;\r
+} EFI_HTTPv4_ACCESS_POINT;\r
+\r
+///\r
+/// EFI_HTTPv6_ACCESS_POINT\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Local IP address to be used in every TCP connection opened by this instance.\r
+ ///\r
+ EFI_IPv6_ADDRESS LocalAddress;\r
+ ///\r
+ /// Local port to be used in every TCP connection opened by this instance.\r
+ ///\r
+ UINT16 LocalPort;\r
+} EFI_HTTPv6_ACCESS_POINT;\r
+\r
+///\r
+/// EFI_HTTP_CONFIG_DATA_ACCESS_POINT\r
+///\r
+\r
+\r
+typedef struct {\r
+ ///\r
+ /// HTTP version that this instance will support.\r
+ ///\r
+ EFI_HTTP_VERSION HttpVersion;\r
+ ///\r
+ /// Time out (in milliseconds) when blocking for requests.\r
+ ///\r
+ UINT32 TimeOutMillisec;\r
+ ///\r
+ /// Defines behavior of EFI DNS and TCP protocols consumed by this instance. If\r
+ /// FALSE, this instance will use EFI_DNS4_PROTOCOL and EFI_TCP4_PROTOCOL. If TRUE,\r
+ /// this instance will use EFI_DNS6_PROTOCOL and EFI_TCP6_PROTOCOL.\r
+ ///\r
+ BOOLEAN LocalAddressIsIPv6;\r
+\r
+ union {\r
+ ///\r
+ /// When LocalAddressIsIPv6 is FALSE, this points to the local address, subnet, and\r
+ /// port used by the underlying TCP protocol.\r
+ ///\r
+ EFI_HTTPv4_ACCESS_POINT *IPv4Node;\r
+ ///\r
+ /// When LocalAddressIsIPv6 is TRUE, this points to the local IPv6 address and port\r
+ /// used by the underlying TCP protocol.\r
+ ///\r
+ EFI_HTTPv6_ACCESS_POINT *IPv6Node;\r
+ } AccessPoint;\r
+} EFI_HTTP_CONFIG_DATA;\r
+\r
+///\r
+/// EFI_HTTP_REQUEST_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// The HTTP method (e.g. GET, POST) for this HTTP Request.\r
+ ///\r
+ EFI_HTTP_METHOD Method;\r
+ ///\r
+ /// The URI of a remote host. From the information in this field, the HTTP instance\r
+ /// will be able to determine whether to use HTTP or HTTPS and will also be able to\r
+ /// determine the port number to use. If no port number is specified, port 80 (HTTP)\r
+ /// is assumed. See RFC 3986 for more details on URI syntax.\r
+ ///\r
+ CHAR16 *Url;\r
+} EFI_HTTP_REQUEST_DATA;\r
+\r
+///\r
+/// EFI_HTTP_RESPONSE_DATA\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Response status code returned by the remote host.\r
+ ///\r
+ EFI_HTTP_STATUS_CODE StatusCode;\r
+} EFI_HTTP_RESPONSE_DATA;\r
+\r
+///\r
+/// EFI_HTTP_HEADER\r
+///\r
+typedef struct {\r
+ ///\r
+ /// Null terminated string which describes a field name. See RFC 2616 Section 14 for\r
+ /// detailed information about field names.\r
+ ///\r
+ CHAR8 *FieldName;\r
+ ///\r
+ /// Null terminated string which describes the corresponding field value. See RFC 2616\r
+ /// Section 14 for detailed information about field values.\r
+ ///\r
+ CHAR8 *FieldValue;\r
+} EFI_HTTP_HEADER;\r
+\r
+///\r
+/// EFI_HTTP_MESSAGE\r
+///\r
+typedef struct {\r
+ ///\r
+ /// HTTP message data.\r
+ ///\r
+ union {\r
+ ///\r
+ /// When the token is used to send a HTTP request, Request is a pointer to storage that\r
+ /// contains such data as URL and HTTP method.\r
+ ///\r
+ EFI_HTTP_REQUEST_DATA *Request;\r
+ ///\r
+ /// When used to await a response, Response points to storage containing HTTP response\r
+ /// status code.\r
+ ///\r
+ EFI_HTTP_RESPONSE_DATA *Response;\r
+ } Data;\r
+ ///\r
+ /// Number of HTTP header structures in Headers list. On request, this count is\r
+ /// provided by the caller. On response, this count is provided by the HTTP driver.\r
+ ///\r
+ UINTN HeaderCount;\r
+ ///\r
+ /// Array containing list of HTTP headers. On request, this array is populated by the\r
+ /// caller. On response, this array is allocated and populated by the HTTP driver. It\r
+ /// is the responsibility of the caller to free this memory on both request and\r
+ /// response.\r
+ ///\r
+ EFI_HTTP_HEADER *Headers;\r
+ ///\r
+ /// Length in bytes of the HTTP body. This can be zero depending on the HttpMethod type.\r
+ ///\r
+ UINTN BodyLength;\r
+ ///\r
+ /// Body associated with the HTTP request or response. This can be NULL depending on\r
+ /// the HttpMethod type.\r
+ ///\r
+ VOID *Body;\r
+} EFI_HTTP_MESSAGE;\r
+\r
+\r
+///\r
+/// EFI_HTTP_TOKEN\r
+///\r
+typedef struct {\r
+ ///\r
+ /// This Event will be signaled after the Status field is updated by the EFI HTTP\r
+ /// Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL. The Task Priority\r
+ /// Level (TPL) of Event must be lower than or equal to TPL_CALLBACK.\r
+ ///\r
+ EFI_EVENT Event;\r
+ ///\r
+ /// Status will be set to one of the following value if the HTTP request is\r
+ /// successfully sent or if an unexpected error occurs:\r
+ /// EFI_SUCCESS: The HTTP request was successfully sent to the remote host.\r
+ /// EFI_ABORTED: The HTTP request was cancelled by the caller and removed from\r
+ /// the transmit queue.\r
+ /// EFI_TIMEOUT: The HTTP request timed out before reaching the remote host.\r
+ /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r
+ ///\r
+ EFI_STATUS Status;\r
+ ///\r
+ /// Pointer to storage containing HTTP message data.\r
+ ///\r
+ EFI_HTTP_MESSAGE *Message;\r
+} EFI_HTTP_TOKEN;\r
+\r
+/**\r
+ Returns the operational parameters for the current HTTP child instance.\r
+\r
+ The GetModeData() function is used to read the current mode data (operational\r
+ parameters) for this HTTP protocol instance.\r
+\r
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r
+ @param[out] HttpConfigData Point to buffer for operational parameters of this\r
+ HTTP instance.\r
+\r
+ @retval EFI_SUCCESS Operation succeeded.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * EFI_HTTP_GET_MODE_DATA)(\r
+ IN EFI_HTTP_PROTOCOL *This,\r
+ OUT EFI_HTTP_CONFIG_DATA *HttpConfigData\r
+ );\r
+\r
+/**\r
+ Initialize or brutally reset the operational parameters for this EFI HTTP instance.\r
+\r
+ The Configure() function does the following:\r
+ When HttpConfigData is not NULL Initialize this EFI HTTP instance by configuring\r
+ timeout, local address, port, etc.\r
+ When HttpConfigData is NULL, reset this EFI HTTP instance by closing all active\r
+ connections with remote hosts, canceling all asynchronous tokens, and flush request\r
+ and response buffers without informing the appropriate hosts.\r
+\r
+ Except for GetModeData() and Configure(), No other EFI HTTP function can be executed\r
+ by this instance until the Configure() function is executed and returns successfully.\r
+\r
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r
+ @param[in] HttpConfigData Pointer to the configure data to configure the instance.\r
+\r
+ @retval EFI_SUCCESS Operation succeeded.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ HttpConfigData->LocalAddressIsIPv6 is FALSE and\r
+ HttpConfigData->IPv4Node is NULL.\r
+ HttpConfigData->LocalAddressIsIPv6 is TRUE and\r
+ HttpConfigData->IPv6Node is NULL.\r
+ @retval EFI_ALREADY_STARTED Reinitialize this HTTP instance without calling\r
+ Configure() with NULL to reset it.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when\r
+ executing Configure().\r
+ @retval EFI_UNSUPPORTED One or more options in ConfigData are not supported\r
+ in the implementation.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * EFI_HTTP_CONFIGURE)(\r
+ IN EFI_HTTP_PROTOCOL *This,\r
+ IN EFI_HTTP_CONFIG_DATA *HttpConfigData\r
+ );\r
+\r
+/**\r
+ The Request() function queues an HTTP request to this HTTP instance, \r
+ similar to Transmit() function in the EFI TCP driver. When the HTTP request is sent\r
+ successfully, or if there is an error, Status in token will be updated and Event will\r
+ be signaled.\r
+\r
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r
+ @param[in] Token Pointer to storage containing HTTP request token.\r
+\r
+ @retval EFI_SUCCESS Outgoing data was processed.\r
+ @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+ @retval EFI_TIMEOUT Data was dropped out of the transmit or receive queue.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ Token->Message is NULL.\r
+ Token->Message->Body is not NULL,\r
+ Token->Message->BodyLength is non-zero, and\r
+ Token->Message->Data is NULL, but a previous call to\r
+ Request()has not been completed successfully.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HTTP_REQUEST) (\r
+ IN EFI_HTTP_PROTOCOL *This,\r
+ IN EFI_HTTP_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ Abort an asynchronous HTTP request or response token.\r
+\r
+ The Cancel() function aborts a pending HTTP request or response transaction. If\r
+ Token is not NULL and the token is in transmit or receive queues when it is being\r
+ cancelled, its Token->Status will be set to EFI_ABORTED and then Token->Event will\r
+ be signaled. If the token is not in one of the queues, which usually means that the\r
+ asynchronous operation has completed, EFI_NOT_FOUND is returned. If Token is NULL,\r
+ all asynchronous tokens issued by Request() or Response() will be aborted.\r
+\r
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r
+ @param[in] Token Point to storage containing HTTP request or response\r
+ token.\r
+\r
+ @retval EFI_SUCCESS Request and Response queues are successfully flushed.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_NOT_STARTED This instance hasn't been configured.\r
+ @retval EFI_NO_MAPPING When using the default address, configuration (DHCP,\r
+ BOOTP, RARP, etc.) hasn't finished yet.\r
+ @retval EFI_NOT_FOUND The asynchronous request or response token is not\r
+ found.\r
+ @retval EFI_UNSUPPORTED The implementation does not support this function.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HTTP_CANCEL)(\r
+ IN EFI_HTTP_PROTOCOL *This,\r
+ IN EFI_HTTP_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ The Response() function queues an HTTP response to this HTTP instance, similar to\r
+ Receive() function in the EFI TCP driver. When the HTTP request is sent successfully,\r
+ or if there is an error, Status in token will be updated and Event will be signaled.\r
+\r
+ The HTTP driver will queue a receive token to the underlying TCP instance. When data\r
+ is received in the underlying TCP instance, the data will be parsed and Token will\r
+ be populated with the response data. If the data received from the remote host\r
+ contains an incomplete or invalid HTTP header, the HTTP driver will continue waiting\r
+ (asynchronously) for more data to be sent from the remote host before signaling\r
+ Event in Token.\r
+\r
+ It is the responsibility of the caller to allocate a buffer for Body and specify the\r
+ size in BodyLength. If the remote host provides a response that contains a content\r
+ body, up to BodyLength bytes will be copied from the receive buffer into Body and\r
+ BodyLength will be updated with the amount of bytes received and copied to Body. This\r
+ allows the client to download a large file in chunks instead of into one contiguous\r
+ block of memory. Similar to HTTP request, if Body is not NULL and BodyLength is\r
+ non-zero and all other fields are NULL or 0, the HTTP driver will queue a receive\r
+ token to underlying TCP instance. If data arrives in the receive buffer, up to\r
+ BodyLength bytes of data will be copied to Body. The HTTP driver will then update\r
+ BodyLength with the amount of bytes received and copied to Body.\r
+\r
+ If the HTTP driver does not have an open underlying TCP connection with the host\r
+ specified in the response URL, Request() will return EFI_ACCESS_DENIED. This is\r
+ consistent with RFC 2616 recommendation that HTTP clients should attempt to maintain\r
+ an open TCP connection between client and host.\r
+\r
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r
+ @param[in] Token Pointer to storage containing HTTP response token.\r
+\r
+ @retval EFI_SUCCESS Allocation succeeded.\r
+ @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been\r
+ initialized.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+ This is NULL.\r
+ Token->Message->Headers is NULL.\r
+ Token->Message is NULL.\r
+ Token->Message->Body is not NULL,\r
+ Token->Message->BodyLength is non-zero, and\r
+ Token->Message->Data is NULL, but a previous call to\r
+ Response() has not been completed successfully.\r
+ @retval EFI_ACCESS_DENIED An open TCP connection is not present with the host\r
+ specified by response URL.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HTTP_RESPONSE) (\r
+ IN EFI_HTTP_PROTOCOL *This,\r
+ IN EFI_HTTP_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ The Poll() function can be used by network drivers and applications to increase the\r
+ rate that data packets are moved between the communication devices and the transmit\r
+ and receive queues.\r
+\r
+ In some systems, the periodic timer event in the managed network driver may not poll\r
+ the underlying communications device fast enough to transmit and/or receive all data\r
+ packets without missing incoming packets or dropping outgoing packets. Drivers and\r
+ applications that are experiencing packet loss should try calling the Poll() function\r
+ more often.\r
+\r
+ @param[in] This Pointer to EFI_HTTP_PROTOCOL instance.\r
+\r
+ @retval EFI_SUCCESS Incoming or outgoing data was processed..\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_NOT_READY No incoming or outgoing data is processed.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HTTP_POLL) (\r
+ IN EFI_HTTP_PROTOCOL *This\r
+ );\r
+\r
+///\r
+/// The EFI HTTP protocol is designed to be used by EFI drivers and applications to\r
+/// create and transmit HTTP Requests, as well as handle HTTP responses that are\r
+/// returned by a remote host. This EFI protocol uses and relies on an underlying EFI\r
+/// TCP protocol.\r
+///\r
+struct _EFI_HTTP_PROTOCOL {\r
+ EFI_HTTP_GET_MODE_DATA GetModeData;\r
+ EFI_HTTP_CONFIGURE Configure;\r
+ EFI_HTTP_REQUEST Request;\r
+ EFI_HTTP_CANCEL Cancel;\r
+ EFI_HTTP_RESPONSE Response;\r
+ EFI_HTTP_POLL Poll;\r
+};\r
+\r
+extern EFI_GUID gEfiHttpServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiHttpProtocolGuid;\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ This file provides a definition of the EFI IPv4 Configuration II\r
+ Protocol.\r
+\r
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at<BR>\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+@par Revision Reference:\r
+This Protocol is introduced in UEFI Specification 2.5\r
+\r
+**/\r
+#ifndef __EFI_IP4CONFIG2_PROTOCOL_H__\r
+#define __EFI_IP4CONFIG2_PROTOCOL_H__\r
+\r
+#include <Protocol/Ip4.h>\r
+\r
+#define EFI_IP4_CONFIG2_PROTOCOL_GUID \\r
+ { \\r
+ 0x5b446ed1, 0xe30b, 0x4faa, {0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \\r
+ }\r
+\r
+typedef struct _EFI_IP4_CONFIG2_PROTOCOL EFI_IP4_CONFIG2_PROTOCOL;\r
+\r
+\r
+///\r
+/// EFI_IP4_CONFIG2_DATA_TYPE\r
+///\r
+typedef enum {\r
+ ///\r
+ /// The interface information of the communication device this EFI \r
+ /// IPv4 Configuration II Protocol instance manages. This type of \r
+ /// data is read only. The corresponding Data is of type \r
+ /// EFI_IP4_CONFIG2_INTERFACE_INFO.\r
+ ///\r
+ Ip4Config2DataTypeInterfaceInfo,\r
+ ///\r
+ /// The general configuration policy for the EFI IPv4 network stack \r
+ /// running on the communication device this EFI IPv4 \r
+ /// Configuration II Protocol instance manages. The policy will \r
+ /// affect other configuration settings. The corresponding Data is of \r
+ /// type EFI_IP4_CONFIG2_POLICY.\r
+ ///\r
+ Ip4Config2DataTypePolicy,\r
+ ///\r
+ /// The station addresses set manually for the EFI IPv4 network \r
+ /// stack. It is only configurable when the policy is \r
+ /// Ip4Config2PolicyStatic. The corresponding Data is of \r
+ /// type EFI_IP4_CONFIG2_MANUAL_ADDRESS.\r
+ ///\r
+ Ip4Config2DataTypeManualAddress,\r
+ ///\r
+ /// The gateway addresses set manually for the EFI IPv4 network \r
+ /// stack running on the communication device this EFI IPv4 \r
+ /// Configuration II Protocol manages. It is not configurable when \r
+ /// the policy is Ip4Config2PolicyDhcp. The gateway \r
+ /// addresses must be unicast IPv4 addresses. The corresponding \r
+ /// Data is a pointer to an array of EFI_IPv4_ADDRESS instances.\r
+ ///\r
+ Ip4Config2DataTypeGateway,\r
+ ///\r
+ /// The DNS server list for the EFI IPv4 network stack running on \r
+ /// the communication device this EFI IPv4 Configuration II \r
+ /// Protocol manages. It is not configurable when the policy is \r
+ /// Ip4Config2PolicyDhcp. The DNS server addresses must be \r
+ /// unicast IPv4 addresses. The corresponding Data is a pointer to \r
+ /// an array of EFI_IPv4_ADDRESS instances.\r
+ ///\r
+ Ip4Config2DataTypeDnsServer,\r
+ Ip4Config2DataTypeMaximum\r
+} EFI_IP4_CONFIG2_DATA_TYPE;\r
+\r
+///\r
+/// EFI_IP4_CONFIG2_INTERFACE_INFO\r
+///\r
+typedef struct {\r
+ ///\r
+ /// The name of the interface. It is a NULL-terminated Unicode string.\r
+ ///\r
+ CHAR16 Name[32];\r
+ ///\r
+ /// The interface type of the network interface. See RFC 1700, \r
+ /// section "Number Hardware Type".\r
+ ///\r
+ UINT8 IfType;\r
+ ///\r
+ /// The size, in bytes, of the network interface's hardware address.\r
+ ///\r
+ UINT32 HwAddressSize;\r
+ ///\r
+ /// The hardware address for the network interface.\r
+ ///\r
+ EFI_MAC_ADDRESS HwAddress;\r
+ ///\r
+ /// The station IPv4 address of this EFI IPv4 network stack.\r
+ ///\r
+ EFI_IPv4_ADDRESS StationAddress;\r
+ ///\r
+ /// The subnet address mask that is associated with the station address.\r
+ ///\r
+ EFI_IPv4_ADDRESS SubnetMask;\r
+ ///\r
+ /// Size of the following RouteTable, in bytes. May be zero.\r
+ ///\r
+ UINT32 RouteTableSize;\r
+ ///\r
+ /// The route table of the IPv4 network stack runs on this interface. \r
+ /// Set to NULL if RouteTableSize is zero. Type EFI_IP4_ROUTE_TABLE is defined in \r
+ /// EFI_IP4_PROTOCOL.GetModeData().\r
+ ///\r
+ EFI_IP4_ROUTE_TABLE *RouteTable OPTIONAL;\r
+} EFI_IP4_CONFIG2_INTERFACE_INFO;\r
+\r
+///\r
+/// EFI_IP4_CONFIG2_POLICY\r
+///\r
+typedef enum {\r
+ ///\r
+ /// Under this policy, the Ip4Config2DataTypeManualAddress, \r
+ /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration \r
+ /// data are required to be set manually. The EFI IPv4 Protocol will get all \r
+ /// required configuration such as IPv4 address, subnet mask and \r
+ /// gateway settings from the EFI IPv4 Configuration II protocol.\r
+ ///\r
+ Ip4Config2PolicyStatic,\r
+ ///\r
+ /// Under this policy, the Ip4Config2DataTypeManualAddress, \r
+ /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration data are \r
+ /// not allowed to set via SetData(). All of these configurations are retrieved from DHCP \r
+ /// server or other auto-configuration mechanism.\r
+ ///\r
+ Ip4Config2PolicyDhcp,\r
+ Ip4Config2PolicyMax\r
+} EFI_IP4_CONFIG2_POLICY;\r
+\r
+///\r
+/// EFI_IP4_CONFIG2_MANUAL_ADDRESS\r
+///\r
+typedef struct {\r
+ /// \r
+ /// The IPv4 unicast address.\r
+ ///\r
+ EFI_IPv4_ADDRESS Address;\r
+ ///\r
+ /// The subnet mask. \r
+ ///\r
+ EFI_IPv4_ADDRESS SubnetMask;\r
+} EFI_IP4_CONFIG2_MANUAL_ADDRESS;\r
+\r
+/**\r
+ Set the configuration for the EFI IPv4 network stack running on the communication device this EFI \r
+ IPv4 Configuration II Protocol instance manages.\r
+\r
+ This function is used to set the configuration data of type DataType for the EFI IPv4 network stack \r
+ running on the communication device this EFI IPv4 Configuration II Protocol instance manages.\r
+ The successfully configured data is valid after system reset or power-off.\r
+ The DataSize is used to calculate the count of structure instances in the Data for some \r
+ DataType that multiple structure instances are allowed.\r
+ This function is always non-blocking. When setting some typeof configuration data, an \r
+ asynchronous process is invoked to check the correctness of the data, such as doing address conflict \r
+ detection on the manually set local IPv4 address. EFI_NOT_READY is returned immediately to \r
+ indicate that such an asynchronous process is invoked and the process is not finished yet. The caller \r
+ willing to get the result of the asynchronous process is required to call RegisterDataNotify()\r
+ to register an event on the specified configuration data. Once the event is signaled, the caller can call \r
+ GetData()to get back the configuration data in order to know the result. For other types of \r
+ configuration data that do not require an asynchronous configuration process, the result of the \r
+ operation is immediately returned. \r
+\r
+ @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance. \r
+ @param[in] DataType The type of data to set.\r
+ @param[in] DataSize Size of the buffer pointed to by Data in bytes.\r
+ @param[in] Data The data buffer to set. The type ofthe data buffer is associated \r
+ with the DataType. \r
+\r
+ @retval EFI_SUCCESS The specified configuration data for the EFI IPv4 network stack is set \r
+ successfully.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
+ This is NULL.\r
+ Data is NULL.\r
+ One or more fields in Data do not match the requirement of the data type \r
+ indicated by DataType.\r
+ @retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified configuration \r
+ data can not be set under the current policy.\r
+ @retval EFI_ACCESS_DENIED Another set operation on the specified configuration data is already in process.\r
+ @retval EFI_NOT_READY An asynchronous process is invoked to set the specified configuration data and \r
+ the process is not finished yet.\r
+ @retval EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type indicated by DataType. \r
+ @retval EFI_UNSUPPORTED This DataType is not supported.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
+ @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG2_SET_DATA) (\r
+ IN EFI_IP4_CONFIG2_PROTOCOL *This,\r
+ IN EFI_IP4_CONFIG2_DATA_TYPE DataType,\r
+ IN UINTN DataSize,\r
+ IN VOID *Data\r
+ );\r
+\r
+/**\r
+ Get the configuration data for the EFI IPv4 network stack running on the communication device this \r
+ EFI IPv4 Configuration II Protocol instance manages.\r
+\r
+ This function returns the configuration data of type DataType for the EFI IPv4 network stack \r
+ running on the communication device this EFI IPv4 Configuration II Protocol instance manages.\r
+ The caller is responsible for allocating the buffer usedto return the specified configuration data and \r
+ the required size will be returned to the caller if the size of the buffer is too small.\r
+ EFI_NOT_READY is returned if the specified configuration data is not ready due to an already in \r
+ progress asynchronous configuration process. The caller can call RegisterDataNotify() to \r
+ register an event on the specified configuration data. Once the asynchronous configuration process is \r
+ finished, the event will be signaled and a subsequent GetData() call will return the specified \r
+ configuration data.\r
+\r
+ @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance. \r
+ @param[in] DataType The type of data to get.\r
+ @param[out] DataSize On input, in bytes, the size of Data. On output, in bytes, the size \r
+ of buffer required to store the specified configuration data. \r
+ @param[in] Data The data buffer in which the configuration data is returned. The \r
+ type of the data buffer is associated with the DataType. Ignored \r
+ if DataSize is 0. \r
+\r
+ @retval EFI_SUCCESS The specified configuration data is got successfully.\r
+ @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:\r
+ This is NULL.\r
+ DataSize is NULL.\r
+ Data is NULL if *DataSizeis not zero.\r
+ @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified configuration data \r
+ and the required size is returned in DataSize.\r
+ @retval EFI_NOT_READY The specified configuration data is not ready due to an already in \r
+ progress asynchronous configuration process.\r
+ @retval EFI_NOT_FOUND The specified configuration data is not found.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG2_GET_DATA) (\r
+ IN EFI_IP4_CONFIG2_PROTOCOL *This,\r
+ IN EFI_IP4_CONFIG2_DATA_TYPE DataType,\r
+ IN OUT UINTN *DataSize,\r
+ IN VOID *Data OPTIONAL\r
+ );\r
+\r
+/**\r
+ Register an event that is to be signaled whenever a configuration process on the specified \r
+ configuration data is done.\r
+\r
+ This function registers an event that is to be signaled whenever a configuration process on the \r
+ specified configuration data is done. An event can be registered for different DataType\r
+ simultaneously and the caller is responsible for determining which type of configuration data causes \r
+ the signaling of the event in such case.\r
+\r
+ @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance. \r
+ @param[in] DataType The type of data to unregister the event for.\r
+ @param[in] Event The event to register.\r
+\r
+ @retval EFI_SUCCESS The notification event for the specified configuration data is \r
+ registered.\r
+ @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.\r
+ @retval EFI_UNSUPPORTED The configuration data type specified by DataType is not supported.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
+ @retval EFI_ACCESS_DENIED The Event is already registered for the DataType.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG2_REGISTER_NOTIFY) (\r
+ IN EFI_IP4_CONFIG2_PROTOCOL *This,\r
+ IN EFI_IP4_CONFIG2_DATA_TYPE DataType,\r
+ IN EFI_EVENT Event\r
+ );\r
+\r
+/**\r
+ Remove a previously registered event for the specified configuration data.\r
+\r
+ This function removes a previously registeredevent for the specified configuration data.\r
+\r
+ @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance. \r
+ @param[in] DataType The type of data to remove the previously registered event for.\r
+ @param[in] Event The event to unregister.\r
+\r
+ @retval EFI_SUCCESS The event registered for the specified configuration data is removed.\r
+ @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.\r
+ @retval EFI_NOT_FOUND The Eventhas not been registered for the specified DataType.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG2_UNREGISTER_NOTIFY) (\r
+ IN EFI_IP4_CONFIG2_PROTOCOL *This,\r
+ IN EFI_IP4_CONFIG2_DATA_TYPE DataType,\r
+ IN EFI_EVENT Event\r
+ );\r
+\r
+///\r
+/// The EFI_IP4_CONFIG2_PROTOCOL is designed to be the central repository for the common \r
+/// configurations and the administrator configurable settings for the EFI IPv4 network stack.\r
+/// An EFI IPv4 Configuration II Protocol instance will be installed on each communication device that \r
+/// the EFI IPv4 network stack runs on.\r
+///\r
+struct _EFI_IP4_CONFIG2_PROTOCOL {\r
+ EFI_IP4_CONFIG2_SET_DATA SetData;\r
+ EFI_IP4_CONFIG2_GET_DATA GetData;\r
+ EFI_IP4_CONFIG2_REGISTER_NOTIFY RegisterDataNotify;\r
+ EFI_IP4_CONFIG2_UNREGISTER_NOTIFY UnregisterDataNotify;\r
+};\r
+\r
+extern EFI_GUID gEfiIp4Config2ProtocolGuid;\r
+\r
+#endif\r
+\r
\r
## Include/Protocol/Pkcs7Verify.h\r
gEfiPkcs7VerifyProtocolGuid = { 0x47889fb2, 0xd671, 0x4fab, { 0xa0, 0xca, 0xdf, 0x0e, 0x44, 0xdf, 0x70, 0xd6 }}\r
+ \r
+ ## Include/Protocol/Ip4Config2.h\r
+ gEfiIp4Config2ProtocolGuid = { 0x5b446ed1, 0xe30b, 0x4faa, {0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 }}\r
+ \r
+ ## Include/Protocol/Dns4.h\r
+ gEfiDns4ServiceBindingProtocolGuid = { 0xb625b186, 0xe063, 0x44f7, { 0x89, 0x5, 0x6a, 0x74, 0xdc, 0x6f, 0x52, 0xb4 }}\r
+\r
+ ## Include/Protocol/Dns4.h\r
+ gEfiDns4ProtocolGuid = { 0xae3d28cc, 0xe05b, 0x4fa1, { 0xa0, 0x11, 0x7e, 0xb5, 0x5a, 0x3f, 0x14, 0x1 }}\r
+\r
+ ## Include/Protocol/Dns6.h\r
+ gEfiDns6ServiceBindingProtocolGuid = { 0x7f1647c8, 0xb76e, 0x44b2, { 0xa5, 0x65, 0xf7, 0xf, 0xf1, 0x9c, 0xd1, 0x9e }}\r
+\r
+ ## Include/Protocol/Dns6.h\r
+ gEfiDns6ProtocolGuid = { 0xca37bc1f, 0xa327, 0x4ae9, { 0x82, 0x8a, 0x8c, 0x40, 0xd8, 0x50, 0x6a, 0x17 }}\r
+\r
+ ## Include/Protocol/Http.h\r
+ gEfiHttpServiceBindingProtocolGuid = { 0xbdc8e6af, 0xd9bc, 0x4379, {0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 0x1c }}\r
+ \r
+ ## Include/Protocol/Http.h\r
+ gEfiHttpProtocolGuid = { 0x7a59b29b, 0x910b, 0x4171, {0x82, 0x42, 0xa8, 0x5a, 0x0d, 0xf2, 0x5b, 0x5b }}\r
\r
#\r
# [Error.gEfiMdePkgTokenSpaceGuid]\r