TianoCore EDK2 master
Loading...
Searching...
No Matches
RedfishRestExProtocol.c
Go to the documentation of this file.
1
12#include <Uefi.h>
14
15EFI_REST_EX_PROTOCOL mRedfishRestExProtocol = {
23};
24
49EFIAPI
52 IN EFI_HTTP_MESSAGE *RequestMessage,
53 OUT EFI_HTTP_MESSAGE *ResponseMessage
54 )
55{
56 EFI_STATUS Status;
57 RESTEX_INSTANCE *Instance;
58 HTTP_IO_RESPONSE_DATA *ResponseData;
59 UINTN TotalReceivedSize;
60 UINTN Index;
61 LIST_ENTRY *ChunkListLink;
62 HTTP_IO_CHUNKS *ThisChunk;
63 BOOLEAN CopyChunkData;
64 BOOLEAN MediaPresent;
65 EFI_HTTP_HEADER *PreservedRequestHeaders;
66 BOOLEAN ItsWrite;
67 BOOLEAN IsGetChunkedTransfer;
68 HTTP_IO_SEND_CHUNK_PROCESS SendChunkProcess;
69 HTTP_IO_SEND_NON_CHUNK_PROCESS SendNonChunkProcess;
70 EFI_HTTP_MESSAGE ChunkTransferRequestMessage;
71
72 Status = EFI_SUCCESS;
73 ResponseData = NULL;
74 IsGetChunkedTransfer = FALSE;
75 SendChunkProcess = HttpIoSendChunkNone;
76 SendNonChunkProcess = HttpIoSendNonChunkNone;
77 ItsWrite = FALSE;
78 PreservedRequestHeaders = NULL;
79
80 //
81 // Validate the parameters
82 //
83 if ((This == NULL) || (RequestMessage == NULL) || (ResponseMessage == NULL)) {
84 return EFI_INVALID_PARAMETER;
85 }
86
87 Instance = RESTEX_INSTANCE_FROM_THIS (This);
88
89 //
90 // Check Media Status.
91 //
92 MediaPresent = TRUE;
93 NetLibDetectMedia (Instance->Service->ControllerHandle, &MediaPresent);
94 if (!MediaPresent) {
95 DEBUG ((DEBUG_REDFISH_NETWORK, "RedfishRestExSendReceive(): No MediaPresent.\n"));
96 return EFI_NO_MEDIA;
97 }
98
99 DEBUG ((DEBUG_REDFISH_NETWORK, "\nRedfishRestExSendReceive():\n"));
100 DEBUG ((DEBUG_REDFISH_NETWORK, "*** Perform HTTP Request Method - %d, URL: %s\n", RequestMessage->Data.Request->Method, RequestMessage->Data.Request->Url));
101
102 if (FixedPcdGetBool (PcdRedfishRestExChunkRequestMode)) {
103 //
104 // Add header "Expect" to server, only for URL write.
105 //
106 Status = RedfishHttpAddExpectation (This, RequestMessage, &PreservedRequestHeaders, &ItsWrite);
107 if (EFI_ERROR (Status)) {
108 return Status;
109 }
110
111 if (ItsWrite == TRUE) {
112 if (RequestMessage->BodyLength > HTTP_IO_MAX_SEND_PAYLOAD) {
113 //
114 // Send chunked transfer.
115 //
116 SendChunkProcess++;
117 CopyMem ((VOID *)&ChunkTransferRequestMessage, (VOID *)RequestMessage, sizeof (EFI_HTTP_MESSAGE));
118 } else {
119 SendNonChunkProcess++;
120 }
121 }
122 }
123
124ReSendRequest:;
125
126 if (FixedPcdGetBool (PcdRedfishRestExChunkRequestMode)) {
127 //
128 // Send the chunked request to REST service.
129 //
130 if (ItsWrite == TRUE) {
131 //
132 // This is write to URI
133 //
134 if (SendChunkProcess > HttpIoSendChunkNone) {
135 //
136 // This is chunk transfer for writing large payload.
137 // Send request header first and then handle the
138 // following request message body using chunk transfer.
139 //
140 do {
142 &(Instance->HttpIo),
143 &SendChunkProcess,
144 &ChunkTransferRequestMessage
145 );
146 if (EFI_ERROR (Status)) {
147 goto ON_EXIT;
148 }
149 } while (SendChunkProcess == HttpIoSendChunkContent || SendChunkProcess == HttpIoSendChunkEndChunk);
150 } else {
151 //
152 // This is the non-chunk transfer, send request header first and then
153 // handle the following request message body using chunk transfer.
154 //
155 Status = HttpIoSendRequest (
156 &(Instance->HttpIo),
157 (SendNonChunkProcess == HttpIoSendNonChunkContent) ? NULL : RequestMessage->Data.Request,
158 (SendNonChunkProcess == HttpIoSendNonChunkContent) ? 0 : RequestMessage->HeaderCount,
159 (SendNonChunkProcess == HttpIoSendNonChunkContent) ? NULL : RequestMessage->Headers,
160 (SendNonChunkProcess == HttpIoSendNonChunkHeaderZeroContent) ? 0 : RequestMessage->BodyLength,
161 (SendNonChunkProcess == HttpIoSendNonChunkHeaderZeroContent) ? NULL : RequestMessage->Body
162 );
163 }
164 } else {
165 //
166 // This is read from URI.
167 //
168 Status = HttpIoSendRequest (
169 &(Instance->HttpIo),
170 RequestMessage->Data.Request,
171 RequestMessage->HeaderCount,
172 RequestMessage->Headers,
173 RequestMessage->BodyLength,
174 RequestMessage->Body
175 );
176 }
177 } else {
178 //
179 // This is normal request to URI.
180 //
181 Status = HttpIoSendRequest (
182 &(Instance->HttpIo),
183 RequestMessage->Data.Request,
184 RequestMessage->HeaderCount,
185 RequestMessage->Headers,
186 RequestMessage->BodyLength,
187 RequestMessage->Body
188 );
189 }
190
191 if (EFI_ERROR (Status)) {
192 //
193 // Communication failure happens. Reset the session.
194 //
195 ResetHttpTslSession (Instance);
196 goto ON_EXIT;
197 }
198
199 //
200 // ResponseMessage->Data.Response is to indicate whether to receive the HTTP header or not.
201 // ResponseMessage->BodyLength/ResponseMessage->Body are to indicate whether to receive the response body or not.
202 // Clean the previous buffers and all of them will be allocated later according to the actual situation.
203 //
204 if (ResponseMessage->Data.Response != NULL) {
205 FreePool (ResponseMessage->Data.Response);
206 ResponseMessage->Data.Response = NULL;
207 }
208
209 ResponseMessage->BodyLength = 0;
210 if (ResponseMessage->Body != NULL) {
211 FreePool (ResponseMessage->Body);
212 ResponseMessage->Body = NULL;
213 }
214
215 //
216 // Use zero BodyLength to only receive the response headers.
217 //
218 ResponseData = AllocateZeroPool (sizeof (HTTP_IO_RESPONSE_DATA));
219 if (ResponseData == NULL) {
220 Status = EFI_OUT_OF_RESOURCES;
221 goto ON_EXIT;
222 }
223
224 DEBUG ((DEBUG_REDFISH_NETWORK, "Receiving HTTP response and headers...\n"));
226 Instance,
228 &(Instance->HttpIo),
229 TRUE,
230 ResponseData
231 )
232 );
233 if (Status == EFI_NOT_READY) {
234 goto ReSendRequest;
235 } else if (Status == EFI_DEVICE_ERROR) {
236 goto ON_EXIT;
237 }
238
239 //
240 // Restore the headers if it ever changed in RedfishHttpAddExpectation().
241 //
242 if (FixedPcdGetBool (PcdRedfishRestExAddingExpect) && (RequestMessage->Headers != PreservedRequestHeaders)) {
243 FreePool (RequestMessage->Headers);
244 RequestMessage->Headers = PreservedRequestHeaders; // Restore headers before we adding "Expect".
245 RequestMessage->HeaderCount--; // Minus one header count for "Expect".
246 }
247
248 DEBUG ((DEBUG_REDFISH_NETWORK, "HTTP Response StatusCode - %d:", ResponseData->Response.StatusCode));
249 if (ResponseData->Response.StatusCode == HTTP_STATUS_200_OK) {
250 DEBUG ((DEBUG_REDFISH_NETWORK, "HTTP_STATUS_200_OK\n"));
251
252 if (FixedPcdGetBool (PcdRedfishRestExChunkRequestMode) && (SendChunkProcess == HttpIoSendChunkHeaderZeroContent)) {
253 DEBUG ((DEBUG_REDFISH_NETWORK, "This is chunk transfer, start to send all chunks - %d.", ResponseData->Response.StatusCode));
254 SendChunkProcess++;
255 goto ReSendRequest;
256 }
257 } else if (ResponseData->Response.StatusCode == HTTP_STATUS_204_NO_CONTENT) {
258 DEBUG ((DEBUG_MANAGEABILITY, "HTTP_STATUS_204_NO_CONTENT\n"));
259
260 if (FixedPcdGetBool (PcdRedfishRestExChunkRequestMode) && (SendChunkProcess == HttpIoSendChunkHeaderZeroContent)) {
261 DEBUG ((DEBUG_MANAGEABILITY, "This is chunk transfer, start to send all chunks - %d.", ResponseData->Response.StatusCode));
262 SendChunkProcess++;
263 goto ReSendRequest;
264 }
265 } else if (ResponseData->Response.StatusCode == HTTP_STATUS_201_CREATED) {
266 DEBUG ((DEBUG_MANAGEABILITY, "HTTP_STATUS_201_CREATED\n"));
267 } else if (ResponseData->Response.StatusCode == HTTP_STATUS_202_ACCEPTED) {
268 DEBUG ((DEBUG_MANAGEABILITY, "HTTP_STATUS_202_ACCEPTED\n"));
269 } else if (ResponseData->Response.StatusCode == HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE) {
270 DEBUG ((DEBUG_REDFISH_NETWORK, "HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE\n"));
271
272 Status = EFI_BAD_BUFFER_SIZE;
273 goto ON_EXIT;
274 } else if (ResponseData->Response.StatusCode == HTTP_STATUS_405_METHOD_NOT_ALLOWED) {
275 DEBUG ((DEBUG_ERROR, "HTTP_STATUS_405_METHOD_NOT_ALLOWED\n"));
276
277 Status = EFI_ACCESS_DENIED;
278 goto ON_EXIT;
279 } else if (ResponseData->Response.StatusCode == HTTP_STATUS_400_BAD_REQUEST) {
280 DEBUG ((DEBUG_REDFISH_NETWORK, "HTTP_STATUS_400_BAD_REQUEST\n"));
281 if (FixedPcdGetBool (PcdRedfishRestExChunkRequestMode) && (SendChunkProcess == HttpIoSendChunkHeaderZeroContent)) {
282 DEBUG ((DEBUG_REDFISH_NETWORK, "Bad request may caused by zero length chunk. Try to send all chunks...\n"));
283 SendChunkProcess++;
284 goto ReSendRequest;
285 }
286 } else if (ResponseData->Response.StatusCode == HTTP_STATUS_100_CONTINUE) {
287 DEBUG ((DEBUG_REDFISH_NETWORK, "HTTP_STATUS_100_CONTINUE\n"));
288 if (FixedPcdGetBool (PcdRedfishRestExChunkRequestMode) && (SendChunkProcess == HttpIoSendChunkHeaderZeroContent)) {
289 //
290 // We get HTTP_STATUS_100_CONTINUE to send the body using chunk transfer.
291 //
292 DEBUG ((DEBUG_REDFISH_NETWORK, "HTTP_STATUS_100_CONTINUE for chunk transfer...\n"));
293 SendChunkProcess++;
294 goto ReSendRequest;
295 }
296
297 if (FixedPcdGetBool (PcdRedfishRestExChunkRequestMode) && (SendNonChunkProcess == HttpIoSendNonChunkHeaderZeroContent)) {
298 DEBUG ((DEBUG_REDFISH_NETWORK, "HTTP_STATUS_100_CONTINUE for non chunk transfer...\n"));
299 SendNonChunkProcess++;
300 goto ReSendRequest;
301 }
302
303 //
304 // It's the REST protocol's responsibility to handle the interim HTTP response (e.g. 100 Continue Informational),
305 // and return the final response content to the caller.
306 //
307 if ((ResponseData->Headers != NULL) && (ResponseData->HeaderCount != 0)) {
308 FreePool (ResponseData->Headers);
309 }
310
311 ZeroMem (ResponseData, sizeof (HTTP_IO_RESPONSE_DATA));
312 Status = HttpIoRecvResponse (
313 &(Instance->HttpIo),
314 TRUE,
315 ResponseData
316 );
317 if (EFI_ERROR (Status)) {
318 goto ON_EXIT;
319 }
320 } else {
321 DEBUG ((DEBUG_ERROR, "This HTTP Status is not handled!\n"));
322 DumpHttpStatusCode (DEBUG_REDFISH_NETWORK, ResponseData->Response.StatusCode);
323 Status = EFI_UNSUPPORTED;
324
325 //
326 // Deliver status code back to caller so caller can handle it.
327 //
328 ResponseMessage->Data.Response = AllocateZeroPool (sizeof (EFI_HTTP_RESPONSE_DATA));
329 if (ResponseMessage->Data.Response == NULL) {
330 Status = EFI_OUT_OF_RESOURCES;
331 goto ON_EXIT;
332 }
333
334 ResponseMessage->Data.Response->StatusCode = ResponseData->Response.StatusCode;
335
336 goto ON_EXIT;
337 }
338
339 //
340 // Ready to return the StatusCode, Header info and BodyLength.
341 //
342 ResponseMessage->Data.Response = AllocateZeroPool (sizeof (EFI_HTTP_RESPONSE_DATA));
343 if (ResponseMessage->Data.Response == NULL) {
344 Status = EFI_OUT_OF_RESOURCES;
345 goto ON_EXIT;
346 }
347
348 ResponseMessage->Data.Response->StatusCode = ResponseData->Response.StatusCode;
349 ResponseMessage->HeaderCount = ResponseData->HeaderCount;
350 ResponseMessage->Headers = ResponseData->Headers;
351
352 //
353 // Get response message body.
354 //
355 if (ResponseMessage->HeaderCount > 0) {
356 Status = HttpIoGetContentLength (ResponseMessage->HeaderCount, ResponseMessage->Headers, &ResponseMessage->BodyLength);
357 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
358 goto ON_EXIT;
359 }
360
361 if (Status == EFI_NOT_FOUND) {
362 ASSERT (ResponseMessage->BodyLength == 0);
363 }
364
365 if (ResponseMessage->BodyLength == 0) {
366 //
367 // Check if Chunked Transfer Coding.
368 //
370 &(Instance->HttpIo),
371 ResponseMessage->HeaderCount,
372 ResponseMessage->Headers,
373 &ChunkListLink,
374 &ResponseMessage->BodyLength
375 );
376 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
377 goto ON_EXIT;
378 }
379
380 if ((Status == EFI_SUCCESS) &&
381 (ChunkListLink != NULL) &&
382 !IsListEmpty (ChunkListLink) &&
383 (ResponseMessage->BodyLength != 0))
384 {
385 IsGetChunkedTransfer = TRUE;
386 //
387 // Copy data to Message body.
388 //
389 CopyChunkData = TRUE;
390 ResponseMessage->Body = AllocateZeroPool (ResponseMessage->BodyLength);
391 if (ResponseMessage->Body == NULL) {
392 Status = EFI_OUT_OF_RESOURCES;
393 CopyChunkData = FALSE;
394 }
395
396 Index = 0;
397 while (!IsListEmpty (ChunkListLink)) {
398 ThisChunk = (HTTP_IO_CHUNKS *)GetFirstNode (ChunkListLink);
399 if (CopyChunkData) {
400 CopyMem (((UINT8 *)ResponseMessage->Body + Index), (UINT8 *)ThisChunk->Data, ThisChunk->Length);
401 Index += ThisChunk->Length;
402 }
403
404 RemoveEntryList (&ThisChunk->NextChunk);
405 FreePool ((VOID *)ThisChunk->Data);
406 FreePool ((VOID *)ThisChunk);
407 }
408
409 FreePool ((VOID *)ChunkListLink);
410 }
411 }
412
413 Status = EFI_SUCCESS;
414 }
415
416 //
417 // Ready to return the Body from REST service if have any.
418 //
419 if ((ResponseMessage->BodyLength > 0) && !IsGetChunkedTransfer) {
420 ResponseData->HeaderCount = 0;
421 ResponseData->Headers = NULL;
422
423 ResponseMessage->Body = AllocateZeroPool (ResponseMessage->BodyLength);
424 if (ResponseMessage->Body == NULL) {
425 Status = EFI_OUT_OF_RESOURCES;
426 goto ON_EXIT;
427 }
428
429 //
430 // Only receive the Body.
431 //
432 TotalReceivedSize = 0;
433 while (TotalReceivedSize < ResponseMessage->BodyLength) {
434 ResponseData->BodyLength = ResponseMessage->BodyLength - TotalReceivedSize;
435 ResponseData->Body = (CHAR8 *)ResponseMessage->Body + TotalReceivedSize;
436 Status = HttpIoRecvResponse (
437 &(Instance->HttpIo),
438 FALSE,
439 ResponseData
440 );
441 if (EFI_ERROR (Status)) {
442 goto ON_EXIT;
443 }
444
445 TotalReceivedSize += ResponseData->BodyLength;
446 }
447
448 DEBUG ((DEBUG_REDFISH_NETWORK, "Total of length of Response :%d\n", TotalReceivedSize));
449 }
450
451 DEBUG ((DEBUG_REDFISH_NETWORK, "RedfishRestExSendReceive()- EFI_STATUS: %r\n", Status));
452
453ON_EXIT:
454
455 if (ResponseData != NULL) {
456 FreePool (ResponseData);
457 }
458
459 return Status;
460}
461
485EFIAPI
488 OUT EFI_TIME *Time
489 )
490{
491 return EFI_UNSUPPORTED;
492}
493
526EFIAPI
529 OUT EFI_REST_EX_SERVICE_INFO **RestExServiceInfo
530 )
531{
532 EFI_TPL OldTpl;
533 RESTEX_INSTANCE *Instance;
534 EFI_REST_EX_SERVICE_INFO *ServiceInfo;
535
536 ServiceInfo = NULL;
537
538 if ((This == NULL) || (RestExServiceInfo == NULL)) {
539 return EFI_INVALID_PARAMETER;
540 }
541
542 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
543
544 Instance = RESTEX_INSTANCE_FROM_THIS (This);
545
546 ServiceInfo = AllocateZeroPool (sizeof (EFI_REST_EX_SERVICE_INFO));
547 if (ServiceInfo == NULL) {
548 return EFI_OUT_OF_RESOURCES;
549 }
550
551 CopyMem (ServiceInfo, &(Instance->Service->RestExServiceInfo), sizeof (EFI_REST_EX_SERVICE_INFO));
552
553 *RestExServiceInfo = ServiceInfo;
554
555 gBS->RestoreTPL (OldTpl);
556
557 return EFI_SUCCESS;
558}
559
587EFIAPI
590 OUT EFI_REST_EX_CONFIG_DATA *RestExConfigData
591 )
592{
593 return EFI_UNSUPPORTED;
594}
595
628EFIAPI
631 IN EFI_REST_EX_CONFIG_DATA RestExConfigData
632 )
633{
634 EFI_STATUS Status;
635 EFI_TPL OldTpl;
636 RESTEX_INSTANCE *Instance;
637
638 EFI_HTTP_CONFIG_DATA *HttpConfigData;
639
640 Status = EFI_SUCCESS;
641 HttpConfigData = NULL;
642
643 if (This == NULL) {
644 return EFI_INVALID_PARAMETER;
645 }
646
647 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
648
649 Instance = RESTEX_INSTANCE_FROM_THIS (This);
650
651 if (RestExConfigData == NULL) {
652 //
653 // Set RestExConfigData to NULL means to put EFI REST EX child instance into the unconfigured state.
654 //
655 HttpIoDestroyIo (&(Instance->HttpIo));
656
657 if (Instance->ConfigData != NULL) {
658 if (((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData.AccessPoint.IPv4Node != NULL) {
659 FreePool (((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData.AccessPoint.IPv4Node);
660 }
661
662 FreePool (Instance->ConfigData);
663 Instance->ConfigData = NULL;
664 }
665
666 Instance->State = RESTEX_STATE_UNCONFIGED;
667 } else {
668 HttpConfigData = &((EFI_REST_EX_HTTP_CONFIG_DATA *)RestExConfigData)->HttpConfigData;
669 Status = Instance->HttpIo.Http->Configure (Instance->HttpIo.Http, HttpConfigData);
670 if (EFI_ERROR (Status)) {
671 goto ON_EXIT;
672 }
673
674 Instance->HttpIo.Timeout = ((EFI_REST_EX_HTTP_CONFIG_DATA *)RestExConfigData)->SendReceiveTimeout;
675
676 Instance->ConfigData = AllocateZeroPool (sizeof (EFI_REST_EX_HTTP_CONFIG_DATA));
677 if (Instance->ConfigData == NULL) {
678 Status = EFI_OUT_OF_RESOURCES;
679 goto ON_EXIT;
680 }
681
682 CopyMem (Instance->ConfigData, RestExConfigData, sizeof (EFI_REST_EX_HTTP_CONFIG_DATA));
683 if (HttpConfigData->LocalAddressIsIPv6 == TRUE) {
684 ((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData.AccessPoint.IPv6Node = AllocateZeroPool (sizeof (EFI_HTTPv6_ACCESS_POINT));
685 if (((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData.AccessPoint.IPv6Node == NULL) {
686 Status = EFI_OUT_OF_RESOURCES;
687 goto ON_EXIT;
688 }
689
690 CopyMem (
691 ((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData.AccessPoint.IPv6Node,
692 HttpConfigData->AccessPoint.IPv6Node,
694 );
695 } else {
696 ((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData.AccessPoint.IPv4Node = AllocateZeroPool (sizeof (EFI_HTTPv4_ACCESS_POINT));
697 if (((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData.AccessPoint.IPv4Node == NULL) {
698 Status = EFI_OUT_OF_RESOURCES;
699 goto ON_EXIT;
700 }
701
702 CopyMem (
703 ((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData.AccessPoint.IPv4Node,
704 HttpConfigData->AccessPoint.IPv4Node,
706 );
707 }
708
709 Instance->State = RESTEX_STATE_CONFIGED;
710 }
711
712ON_EXIT:
713 gBS->RestoreTPL (OldTpl);
714 return Status;
715}
716
749EFIAPI
752 IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL,
753 IN EFI_REST_EX_TOKEN *RestExToken,
754 IN UINTN *TimeOutInMilliSeconds OPTIONAL
755 )
756{
757 return EFI_UNSUPPORTED;
758}
759
787EFIAPI
790 IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL,
791 IN EFI_REST_EX_TOKEN *RestExToken
792 )
793{
794 return EFI_UNSUPPORTED;
795}
UINT64 UINTN
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
Definition: LinkedList.c:403
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
Definition: LinkedList.c:298
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
Definition: LinkedList.c:590
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
HTTP_IO_SEND_NON_CHUNK_PROCESS
Definition: HttpIoLib.h:132
EFI_STATUS HttpIoGetContentLength(IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, OUT UINTN *ContentLength)
Definition: DxeHttpIoLib.c:479
EFI_STATUS HttpIoSendChunkedTransfer(IN HTTP_IO *HttpIo, IN HTTP_IO_SEND_CHUNK_PROCESS *SendChunkProcess, IN EFI_HTTP_MESSAGE *RequestMessage)
Definition: DxeHttpIoLib.c:507
HTTP_IO_SEND_CHUNK_PROCESS
Definition: HttpIoLib.h:121
EFI_STATUS HttpIoGetChunkedTransferContent(IN HTTP_IO *HttpIo, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, OUT LIST_ENTRY **ChunkListHead, OUT UINTN *ContentLength)
Definition: DxeHttpIoLib.c:678
VOID HttpIoDestroyIo(IN HTTP_IO *HttpIo)
Definition: DxeHttpIoLib.c:62
EFI_STATUS HttpIoSendRequest(IN HTTP_IO *HttpIo, IN EFI_HTTP_REQUEST_DATA *Request OPTIONAL, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers OPTIONAL, IN UINTN BodyLength, IN VOID *Body OPTIONAL)
EFI_STATUS HttpIoRecvResponse(IN HTTP_IO *HttpIo, IN BOOLEAN RecvMsgHeader, OUT HTTP_IO_RESPONSE_DATA *ResponseData)
Definition: DxeHttpIoLib.c:366
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI NetLibDetectMedia(IN EFI_HANDLE ServiceHandle, OUT BOOLEAN *MediaPresent)
Definition: DxeNetLib.c:2472
#define FixedPcdGetBool(TokenName)
Definition: PcdLib.h:120
EFI_STATUS DumpHttpStatusCode(IN UINTN ErrorLevel, IN EFI_HTTP_STATUS_CODE HttpStatusCode)
#define DEBUG_REDFISH_NETWORK
Debug error level for Redfish networking function.
EFI_STATUS ResetHttpTslSession(IN RESTEX_INSTANCE *Instance)
EFI_STATUS RedfishCheckHttpReceiveStatus(IN RESTEX_INSTANCE *Instance, IN EFI_STATUS HttpIoReceiveStatus)
EFI_STATUS RedfishHttpAddExpectation(IN EFI_REST_EX_PROTOCOL *This, IN EFI_HTTP_MESSAGE *RequestMessage, IN EFI_HTTP_HEADER **PreservedRequestHeaders, IN BOOLEAN *ItsWrite)
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 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_STATUS EFIAPI RedfishRestExConfigure(IN EFI_REST_EX_PROTOCOL *This, IN EFI_REST_EX_CONFIG_DATA RestExConfigData)
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)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
UINTN EFI_TPL
Definition: UefiBaseType.h:41
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_HTTPv6_ACCESS_POINT * IPv6Node
Definition: Http.h:176
EFI_HTTPv4_ACCESS_POINT * IPv4Node
Definition: Http.h:171
BOOLEAN LocalAddressIsIPv6
Definition: Http.h:164
EFI_HTTP_STATUS_CODE StatusCode
Definition: Http.h:204