]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Rest.h
MdePkg: Replace BSD License with BSD+Patent License
[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
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
b46daf26
HW
6\r
7 @par Revision Reference:\r
8 This Protocol is introduced in UEFI Specification 2.5\r
9\r
10**/\r
11\r
12#ifndef __EFI_REST_PROTOCOL_H__\r
13#define __EFI_REST_PROTOCOL_H__\r
14\r
15#include <Protocol/Http.h>\r
16\r
17#define EFI_REST_PROTOCOL_GUID \\r
18 { \\r
19 0x0db48a36, 0x4e54, 0xea9c, {0x9b, 0x09, 0x1e, 0xa5, 0xbe, 0x3a, 0x66, 0x0b } \\r
20 }\r
21\r
22typedef struct _EFI_REST_PROTOCOL EFI_REST_PROTOCOL;\r
23\r
24/**\r
25 Provides a simple HTTP-like interface to send and receive resources from a REST\r
26 service.\r
27\r
28 The SendReceive() function sends an HTTP request to this REST service, and returns a\r
29 response when the data is retrieved from the service. RequestMessage contains the HTTP\r
30 request to the REST resource identified by RequestMessage.Request.Url. The\r
31 ResponseMessage is the returned HTTP response for that request, including any HTTP\r
32 status.\r
33\r
34 @param[in] This Pointer to EFI_REST_PROTOCOL instance for a particular\r
35 REST service.\r
36 @param[in] RequestMessage Pointer to the HTTP request data for this resource.\r
37 @param[out] ResponseMessage Pointer to the HTTP response data obtained for this\r
38 requested.\r
39\r
40 @retval EFI_SUCCESS Operation succeeded.\r
41 @retval EFI_INVALID_PARAMETER This, RequestMessage, or ResponseMessage are NULL.\r
42 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
43**/\r
44typedef\r
45EFI_STATUS\r
46(EFIAPI *EFI_REST_SEND_RECEIVE) (\r
47 IN EFI_REST_PROTOCOL *This,\r
48 IN EFI_HTTP_MESSAGE *RequestMessage,\r
49 OUT EFI_HTTP_MESSAGE *ResponseMessage\r
50 );\r
51\r
52/**\r
53 The GetServiceTime() function is an optional interface to obtain the current time from\r
54 this REST service instance. If this REST service does not support retrieving the time,\r
55 this function returns EFI_UNSUPPORTED.\r
56\r
57 @param[in] This Pointer to EFI_REST_PROTOCOL instance.\r
58 @param[out] Time A pointer to storage to receive a snapshot of the\r
59 current time of the REST service.\r
60\r
61 @retval EFI_SUCCESS Operation succeeded\r
62 @retval EFI_INVALID_PARAMETER This or Time are NULL.\r
63 @retval EFI_UNSUPPORTED The RESTful service does not support returning the\r
64 time.\r
65 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
66**/\r
67typedef\r
68EFI_STATUS\r
69(EFIAPI *EFI_REST_GET_TIME) (\r
70 IN EFI_REST_PROTOCOL *This,\r
71 OUT EFI_TIME *Time\r
72 );\r
73\r
74///\r
75/// The EFI REST protocol is designed to be used by EFI drivers and applications to send\r
76/// and receive resources from a RESTful service. This protocol abstracts REST\r
77/// (Representational State Transfer) client functionality. This EFI protocol could be\r
78/// implemented to use an underlying EFI HTTP protocol, or it could rely on other\r
79/// interfaces that abstract HTTP access to the resources.\r
80///\r
81struct _EFI_REST_PROTOCOL {\r
82 EFI_REST_SEND_RECEIVE SendReceive;\r
83 EFI_REST_GET_TIME GetServiceTime;\r
84};\r
85\r
86extern EFI_GUID gEfiRestProtocolGuid;\r
87\r
88#endif\r