RedfishPkg/RedfishRestExDxe: Implement EDKII_HTTP_CALLBACK_PROTOCOL

Implement EDKII_HTTP_CALLBACK_PROTOCOL that listens to
HttpEventTlsConfigured event for reconfiguring TLS configuration
data.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
This commit is contained in:
Abner Chang
2024-01-05 09:39:41 +08:00
committed by mergify[bot]
parent 8466480965
commit 0a12d8bd55
3 changed files with 95 additions and 10 deletions

View File

@@ -4,6 +4,7 @@
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -32,6 +33,8 @@
#include <Protocol/DriverBinding.h>
#include <Protocol/RestEx.h>
#include <Protocol/ServiceBinding.h>
#include <Protocol/HttpCallback.h>
#include <Protocol/Tls.h>
///
/// Protocol instances
@@ -67,6 +70,9 @@ typedef struct _RESTEX_INSTANCE RESTEX_INSTANCE;
#define RESTEX_INSTANCE_FROM_THIS(a) \
CR (a, RESTEX_INSTANCE, RestEx, RESTEX_INSTANCE_SIGNATURE)
#define RESTEX_INSTANCE_FROM_HTTP_CALLBACK(a) \
CR (a, RESTEX_INSTANCE, HttpCallbakFunction, RESTEX_INSTANCE_SIGNATURE)
#define RESTEX_STATE_UNCONFIGED 0
#define RESTEX_STATE_CONFIGED 1
@@ -94,25 +100,31 @@ struct _RESTEX_SERVICE {
#define RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY 0x00000002
struct _RESTEX_INSTANCE {
UINT32 Signature;
LIST_ENTRY Link;
UINT32 Signature;
LIST_ENTRY Link;
EFI_REST_EX_PROTOCOL RestEx;
EFI_REST_EX_PROTOCOL RestEx;
INTN State;
BOOLEAN InDestroy;
INTN State;
BOOLEAN InDestroy;
RESTEX_SERVICE *Service;
EFI_HANDLE ChildHandle;
RESTEX_SERVICE *Service;
EFI_HANDLE ChildHandle;
EFI_REST_EX_CONFIG_DATA ConfigData;
EFI_REST_EX_CONFIG_DATA ConfigData;
//
// HTTP_IO to access the HTTP service
//
HTTP_IO HttpIo;
HTTP_IO HttpIo;
UINT32 Flags;
//
// EDKII_HTTP_CALLBACK_PROTOCOL that listens to
// HttpEventInitSession event.
//
EDKII_HTTP_CALLBACK_PROTOCOL HttpCallbakFunction;
UINT32 Flags;
};
typedef struct {