]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Rest.h
MdePkg/SmBios.h: Add new defines for SMBIOS record type 43
[mirror_edk2.git] / MdePkg / Include / Protocol / Rest.h
CommitLineData
b46daf26
HW
1/** @file\r
2 This file defines the EFI REST Protocol interface.\r
3\r
4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 @par Revision Reference:\r
14 This Protocol is introduced in UEFI Specification 2.5\r
15\r
16**/\r
17\r
18#ifndef __EFI_REST_PROTOCOL_H__\r
19#define __EFI_REST_PROTOCOL_H__\r
20\r
21#include <Protocol/Http.h>\r
22\r
23#define EFI_REST_PROTOCOL_GUID \\r
24 { \\r
25 0x0db48a36, 0x4e54, 0xea9c, {0x9b, 0x09, 0x1e, 0xa5, 0xbe, 0x3a, 0x66, 0x0b } \\r
26 }\r
27\r
28typedef struct _EFI_REST_PROTOCOL EFI_REST_PROTOCOL;\r
29\r
30/**\r
31 Provides a simple HTTP-like interface to send and receive resources from a REST\r
32 service.\r
33\r
34 The SendReceive() function sends an HTTP request to this REST service, and returns a\r
35 response when the data is retrieved from the service. RequestMessage contains the HTTP\r
36 request to the REST resource identified by RequestMessage.Request.Url. The\r
37 ResponseMessage is the returned HTTP response for that request, including any HTTP\r
38 status.\r
39\r
40 @param[in] This Pointer to EFI_REST_PROTOCOL instance for a particular\r
41 REST service.\r
42 @param[in] RequestMessage Pointer to the HTTP request data for this resource.\r
43 @param[out] ResponseMessage Pointer to the HTTP response data obtained for this\r
44 requested.\r
45\r
46 @retval EFI_SUCCESS Operation succeeded.\r
47 @retval EFI_INVALID_PARAMETER This, RequestMessage, or ResponseMessage are NULL.\r
48 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
49**/\r
50typedef\r
51EFI_STATUS\r
52(EFIAPI *EFI_REST_SEND_RECEIVE) (\r
53 IN EFI_REST_PROTOCOL *This,\r
54 IN EFI_HTTP_MESSAGE *RequestMessage,\r
55 OUT EFI_HTTP_MESSAGE *ResponseMessage\r
56 );\r
57\r
58/**\r
59 The GetServiceTime() function is an optional interface to obtain the current time from\r
60 this REST service instance. If this REST service does not support retrieving the time,\r
61 this function returns EFI_UNSUPPORTED.\r
62\r
63 @param[in] This Pointer to EFI_REST_PROTOCOL instance.\r
64 @param[out] Time A pointer to storage to receive a snapshot of the\r
65 current time of the REST service.\r
66\r
67 @retval EFI_SUCCESS Operation succeeded\r
68 @retval EFI_INVALID_PARAMETER This or Time are NULL.\r
69 @retval EFI_UNSUPPORTED The RESTful service does not support returning the\r
70 time.\r
71 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
72**/\r
73typedef\r
74EFI_STATUS\r
75(EFIAPI *EFI_REST_GET_TIME) (\r
76 IN EFI_REST_PROTOCOL *This,\r
77 OUT EFI_TIME *Time\r
78 );\r
79\r
80///\r
81/// The EFI REST protocol is designed to be used by EFI drivers and applications to send\r
82/// and receive resources from a RESTful service. This protocol abstracts REST\r
83/// (Representational State Transfer) client functionality. This EFI protocol could be\r
84/// implemented to use an underlying EFI HTTP protocol, or it could rely on other\r
85/// interfaces that abstract HTTP access to the resources.\r
86///\r
87struct _EFI_REST_PROTOCOL {\r
88 EFI_REST_SEND_RECEIVE SendReceive;\r
89 EFI_REST_GET_TIME GetServiceTime;\r
90};\r
91\r
92extern EFI_GUID gEfiRestProtocolGuid;\r
93\r
94#endif\r