TianoCore EDK2 master
Loading...
Searching...
No Matches
RedfishRestExDriver.h
Go to the documentation of this file.
1
13#ifndef EFI_REDFISH_RESTEX_DRIVER_H_
14#define EFI_REDFISH_RESTEX_DRIVER_H_
15
19#include <Library/BaseLib.h>
21#include <Library/DebugLib.h>
23#include <Library/HttpIoLib.h>
25#include <Library/NetLib.h>
26#include <Library/UefiLib.h>
29
34#include <Protocol/RestEx.h>
37#include <Protocol/Tls.h>
38
44extern EFI_UNICODE_STRING_TABLE *gRedfishRestExControllerNameTable;
45
46extern EFI_DRIVER_BINDING_PROTOCOL gRedfishRestExDriverBinding;
47extern EFI_SERVICE_BINDING_PROTOCOL mRedfishRestExServiceBinding;
48extern EFI_REST_EX_PROTOCOL mRedfishRestExProtocol;
53
58
62#define REDFISH_RESTEX_DRIVER_VERSION 0x0100
63
64#define RESTEX_SERVICE_SIGNATURE SIGNATURE_32 ('R', 'E', 'S', 'S')
65#define RESTEX_INSTANCE_SIGNATURE SIGNATURE_32 ('R', 'E', 'I', 'S')
66
67#define RESTEX_SERVICE_FROM_THIS(a) \
68 CR (a, RESTEX_SERVICE, ServiceBinding, RESTEX_SERVICE_SIGNATURE)
69
70#define RESTEX_INSTANCE_FROM_THIS(a) \
71 CR (a, RESTEX_INSTANCE, RestEx, RESTEX_INSTANCE_SIGNATURE)
72
73#define RESTEX_INSTANCE_FROM_HTTP_CALLBACK(a) \
74 CR (a, RESTEX_INSTANCE, HttpCallbakFunction, RESTEX_INSTANCE_SIGNATURE)
75
76#define RESTEX_STATE_UNCONFIGED 0
77#define RESTEX_STATE_CONFIGED 1
78
80 UINT32 Signature;
81 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
82
83 UINT16 RestExChildrenNum;
84 LIST_ENTRY RestExChildrenList;
85
86 EFI_HANDLE ControllerHandle;
87 EFI_HANDLE ImageHandle;
88
89 //
90 // Use to establish the parent-child relationship.
91 //
92 EFI_HANDLE HttpChildHandle;
93
94 UINT32 *Id;
95
96 EFI_REST_EX_SERVICE_INFO RestExServiceInfo;
97};
98
99#define RESTEX_INSTANCE_FLAGS_TLS_RETRY 0x00000001
100#define RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY 0x00000002
101
103 UINT32 Signature;
104 LIST_ENTRY Link;
105
107
108 INTN State;
109 BOOLEAN InDestroy;
110
111 RESTEX_SERVICE *Service;
112 EFI_HANDLE ChildHandle;
113
114 EFI_REST_EX_CONFIG_DATA ConfigData;
115
116 //
117 // HTTP_IO to access the HTTP service
118 //
119 HTTP_IO HttpIo;
120
121 //
122 // EDKII_HTTP_CALLBACK_PROTOCOL that listens to
123 // HttpEventInitSession event.
124 //
125 EDKII_HTTP_CALLBACK_PROTOCOL HttpCallbakFunction;
126
127 UINT32 Flags;
128};
129
130typedef struct {
131 EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
132 UINTN NumberOfChildren;
133 EFI_HANDLE *ChildHandleBuffer;
135
156EFIAPI
159 IN EFI_HTTP_MESSAGE *RequestMessage,
160 OUT EFI_HTTP_MESSAGE *ResponseMessage
161 );
162
186EFIAPI
189 OUT EFI_TIME *Time
190 );
191
224EFIAPI
227 OUT EFI_REST_EX_SERVICE_INFO **RestExServiceInfo
228 );
229
257EFIAPI
260 OUT EFI_REST_EX_CONFIG_DATA *RestExConfigData
261 );
262
295EFIAPI
298 IN EFI_REST_EX_CONFIG_DATA RestExConfigData
299 );
300
333EFIAPI
336 IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL,
337 IN EFI_REST_EX_TOKEN *RestExToken,
338 IN UINTN *TimeOutInMilliSeconds OPTIONAL
339 );
340
368EFIAPI
371 IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL,
372 IN EFI_REST_EX_TOKEN *RestExToken
373 );
374
387 IN RESTEX_INSTANCE *Instance
388 );
389
401EFIAPI
403 IN LIST_ENTRY *Entry,
404 IN VOID *Context
405 );
406
413VOID
415 IN RESTEX_INSTANCE *Instance
416 );
417
430 IN RESTEX_SERVICE *Service,
431 OUT RESTEX_INSTANCE **Instance
432 );
433
440VOID
442 IN RESTEX_SERVICE *RestExSb
443 );
444
460 IN EFI_HANDLE Controller,
461 IN EFI_HANDLE Image,
462 OUT RESTEX_SERVICE **Service
463 );
464
477EFIAPI
479 IN EFI_HANDLE ImageHandle,
480 IN EFI_SYSTEM_TABLE *SystemTable
481 );
482
526EFIAPI
529 IN EFI_HANDLE ControllerHandle,
530 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
531 );
532
569EFIAPI
572 IN EFI_HANDLE ControllerHandle,
573 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
574 );
575
603EFIAPI
606 IN EFI_HANDLE ControllerHandle,
607 IN UINTN NumberOfChildren,
608 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
609 );
610
631EFIAPI
634 IN EFI_HANDLE *ChildHandle
635 );
636
656EFIAPI
659 IN EFI_HANDLE ChildHandle
660 );
661
662#endif
UINT64 UINTN
INT64 INTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS RestExCreateService(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, OUT RESTEX_SERVICE **Service)
EFI_STATUS EFIAPI RedfishRestExDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_COMPONENT_NAME_PROTOCOL gRedfishRestExComponentName
EFI_STATUS RestExCreateInstance(IN RESTEX_SERVICE *Service, OUT RESTEX_INSTANCE **Instance)
EFI_STATUS EFIAPI RedfishRestExEventService(IN EFI_REST_EX_PROTOCOL *This, IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL, IN EFI_REST_EX_TOKEN *RestExToken)
EFI_STATUS EFIAPI RedfishRestExDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI RedfishRestExServiceBindingCreateChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE *ChildHandle)
EFI_STATUS EFIAPI RestExDestroyChildEntryInHandleBuffer(IN LIST_ENTRY *Entry, IN VOID *Context)
VOID RestExDestroyService(IN RESTEX_SERVICE *RestExSb)
EFI_STATUS EFIAPI RedfishRestExDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI RedfishRestExSendReceive(IN EFI_REST_EX_PROTOCOL *This, IN EFI_HTTP_MESSAGE *RequestMessage, OUT EFI_HTTP_MESSAGE *ResponseMessage)
EFI_STATUS EFIAPI RedfishRestExGetServiceTime(IN EFI_REST_EX_PROTOCOL *This, OUT EFI_TIME *Time)
EFI_COMPONENT_NAME2_PROTOCOL gRedfishRestExComponentName2
EFI_STATUS EFIAPI RedfishRestExConfigure(IN EFI_REST_EX_PROTOCOL *This, IN EFI_REST_EX_CONFIG_DATA RestExConfigData)
VOID RestExDestroyInstance(IN RESTEX_INSTANCE *Instance)
EFI_STATUS EFIAPI RedfishRestExServiceBindingDestroyChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)
EFI_STATUS EFIAPI RedfishRestExGetModeData(IN EFI_REST_EX_PROTOCOL *This, OUT EFI_REST_EX_CONFIG_DATA *RestExConfigData)
EFI_STATUS EFIAPI RedfishRestExGetService(IN EFI_REST_EX_PROTOCOL *This, OUT EFI_REST_EX_SERVICE_INFO **RestExServiceInfo)
EFI_STATUS EFIAPI RedfishRestExAyncSendReceive(IN EFI_REST_EX_PROTOCOL *This, IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL, IN EFI_REST_EX_TOKEN *RestExToken, IN UINTN *TimeOutInMilliSeconds OPTIONAL)
EFI_STATUS ResetHttpTslSession(IN RESTEX_INSTANCE *Instance)
EFI_STATUS EFIAPI RedfishRestExDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33