TianoCore EDK2 master
Loading...
Searching...
No Matches
RedfishDiscoverInternal.h
Go to the documentation of this file.
1
12#ifndef EFI_REDFISH_DISCOVER_INTERNAL_H_
13#define EFI_REDFISH_DISCOVER_INTERNAL_H_
14
15#include <Uefi.h>
16
21#include <Protocol/Smbios.h>
22#include <Protocol/Tcp4.h>
23#include <Protocol/Tcp6.h>
24
25#include <Library/BaseLib.h>
27#include <Library/DebugLib.h>
29#include <Library/NetLib.h>
30#include <Library/PrintLib.h>
32#include <Library/RestExLib.h>
33#include <Library/UefiLib.h>
36
38
39#define REDFISH_DISCOVER_VERSION 0x00010000
40#define EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_TPL TPL_NOTIFY
41
42#define MAC_COMPARE(This, Target) (CompareMem ((VOID *)&(This)->MacAddress, &(Target)->MacAddress, (This)->HwAddressSize) == 0)
43#define VALID_TCP6(Target, This) ((Target)->IsIpv6 && ((This)->NetworkProtocolType == ProtocolTypeTcp6))
44#define VALID_TCP4(Target, This) (!(Target)->IsIpv6 && ((This)->NetworkProtocolType == ProtocolTypeTcp4))
45#define REDFISH_HI_ITERFACE_SPECIFIC_DATA_LENGTH_OFFSET ((UINT16)(UINTN)(&((SMBIOS_TABLE_TYPE42 *)0)->InterfaceTypeSpecificDataLength))
46#define REDFISH_HI_PROTOCOL_HOSTNAME_LENGTH_OFFSET ((UINT16)(UINTN)(&((REDFISH_OVER_IP_PROTOCOL_DATA *)0)->RedfishServiceHostnameLength))
47
48//
49// GUID definitions
50//
51
52#define EFI_REDFISH_DISCOVER_TCP4_INSTANCE_GUID \
53 { \
54 0xfbab97a4, 0x4c6a, 0xf8e8, { 0xf2, 0x25, 0x42, 0x8a, 0x80, 0x3f, 0xb6, 0xaa } \
55 }
56
57#define EFI_REDFISH_DISCOVER_TCP6_INSTANCE_GUID \
58 { \
59 0xbe513b6d, 0x41c1, 0x96Ed, { 0x8d, 0xaf, 0x3e, 0x89, 0xc5, 0xf5, 0x02, 0x25 } \
60 }
61
62#define EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_GUID \
63 { \
64 0xc44a6076, 0xd42a, 0x4d54, { 0x85, 0x6d, 0x98, 0x8a, 0x85, 0x8f, 0xa1, 0x11 } \
65 }
66
69extern EFI_UNICODE_STRING_TABLE *gRedfishDiscoverControllerNameTable;
70
71//
72// Enumeration of network protocols
73// required for the Redfish service discovery.
74//
75typedef enum {
79 MaxProtocolType
81
82//
83// Network protocol information installed on
84// the network interface.
85//
86typedef struct {
93
94//
95// Internal structure used to maintain network
96// interface properties.
97//
98typedef struct {
104 CHAR16 *StrMacAddr;
109 UINT16 VlanId;
112 //
113 // Network interface protocol and REST EX info.
114 //
119 //
120 // EFI_REDFISH_DISCOVER_PROTOCOL instance installed
121 // on this network interface.
122 //
126
127//
128// Redfish Discover Instance signature
129//
130
131#define EFI_REDFISH_DISCOVER_DATA_SIGNATURE SIGNATURE_32 ('E', 'R', 'D', 'D')
132
133#define EFI_REDFISH_DISOVER_DATA_FROM_DISCOVER_PROTOCOL(a) \
134 CR (a, EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_INTERNAL, RedfishDiscoverProtocol, EFI_REDFISH_DISCOVER_DATA_SIGNATURE)
135
136//
137// Internal structure used to maintain REST EX properties.
138//
139typedef struct {
141 UINT32 Signature;
147 UINT32 RestExId;
153
162typedef
165 IN EFI_HANDLE ImageHandle,
167 );
168
169//
170// The require network protocol matrix.
171//
172typedef struct {
175 CHAR16 *ProtocolName;
181
182//
183// Link list of Redfish discover instance.
184//
185typedef struct {
189
190//
191// Internal structure of Redfish discover instance.
192//
193typedef struct {
198 EFI_REDFISH_DISCOVER_FLAG DiscoverFlags;
202 //
203 // Below for Host interface discovery.
204 //
211
233 IN UINTN *RedfishVersion OPTIONAL,
234 IN CHAR8 *RedfishLocation OPTIONAL,
235 IN CHAR8 *Uuid OPTIONAL,
236 IN CHAR8 *Os OPTIONAL,
237 IN CHAR8 *OsVer OPTIONAL,
238 IN CHAR8 *Product OPTIONAL,
239 IN CHAR8 *ProductVer OPTIONAL,
240 IN BOOLEAN UseHttps
241 );
242
258 IN EFI_SMBIOS_PROTOCOL *Smbios,
259 OUT REDFISH_INTERFACE_DATA **DeviceDescriptor,
261 );
262
263extern EFI_GUID gRedfishDiscoverTcp4Instance;
264extern EFI_GUID gRedfishDiscoverTcp6Instance;
265extern EFI_GUID gRedfishDiscoverRestEXInstance;
266#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_REDFISH_DISCOVER_GET_SUBNET_INFO)(IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *Instance)
EFI_STATUS AddAndSignalNewRedfishService(IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE *Instance, IN UINTN *RedfishVersion OPTIONAL, IN CHAR8 *RedfishLocation OPTIONAL, IN CHAR8 *Uuid OPTIONAL, IN CHAR8 *Os OPTIONAL, IN CHAR8 *OsVer OPTIONAL, IN CHAR8 *Product OPTIONAL, IN CHAR8 *ProductVer OPTIONAL, IN BOOLEAN UseHttps)
EFI_COMPONENT_NAME_PROTOCOL gRedfishDiscoverComponentName
NETWORK_INTERFACE_PROTOCOL_TYPE
@ ProtocolTypeTcp4
Network protocol TCPv4.
@ ProtocolTypeTcp6
Network protocol TCCv6.
@ ProtocolTypeRestEx
REST EX over network protocol.
EFI_COMPONENT_NAME2_PROTOCOL gRedfishDiscoverComponentName2
EFI_STATUS RedfishGetHostInterfaceProtocolData(IN EFI_SMBIOS_PROTOCOL *Smbios, OUT REDFISH_INTERFACE_DATA **DeviceDescriptor, OUT REDFISH_OVER_IP_PROTOCOL_DATA **ProtocolData)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_MAC_ADDRESS MacAddress
MAC address of network interface.
UINT32 SubnetAddrInfoIPv6Number
IPv6 address info number.
REDFISH_DISCOVER_NETWORK_INTERFACE_PROTOCOL NetworkInterfaceProtocolInfo
Network interface protocol information.
EFI_HANDLE RestExHandle
REST EX handle associated with this network interface.
CHAR16 * StrMacAddr
String to MAC address of network interface.
EFI_IP_ADDRESS SubnetMask
Subnet mask (IPv4 only)
EFI_HANDLE OpenDriverControllerHandle
The controller handle to open network protocol.
BOOLEAN GotSubnetInfo
Indicates sub net information is retrieved.
UINTN HwAddressSize
The size of network interface hardware address.
EFI_HANDLE OpenDriverAgentHandle
The agent to open network protocol.
EFI_IP6_ADDRESS_INFO * SubnetAddrInfoIPv6
IPv6 address info.
EFI_HANDLE OpenDriverControllerHandle
The controller handle to open network protocol.
EFI_HANDLE OpenDriverAgentHandle
The agent to open network protocol.
UINT32 RestExId
The identifier installed on REST EX controller handle.
EFI_REDFISH_DISCOVER_NETWORK_INTERFACE * NetworkInterfaceInstances
EFI_REDFISH_DISCOVER_PROTOCOL RedfishDiscoverProtocol
EFI_REDFISH_DISCOVER_PROTOCOL protocol.
EFI_HANDLE RestExControllerHandle
The controller handle which provide REST EX protocol.
UINTN NumberOfNetworkInterfaces
Number of network interfaces can do Redfish service discovery.
EFI_HANDLE RestExChildHandle
The child handle created through REST EX Service Protocol.
EFI_REST_EX_PROTOCOL * RestExProtocolInterface
Pointer to EFI_REST_EX_PROTOCOL.
BOOLEAN HostIntfValidation
Indicates whether to validate Redfish Host interface.
EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL * NetworkInterface
EFI_REDFISH_DISCOVERED_TOKEN * DiscoverToken
Token used to signal when Redfish service is discovered.
EFI_REDFISH_DISCOVER_FLAG DiscoverFlags
EFI_REDFISH_DISCOVER_FLAG.
EFI_IP_ADDRESS TargetIpAddress
Target IP address reported in Redfish Host interface.
UINT8 HostAddrFormat
Unknown=00h, Ipv4=01h, Ipv6=02h.
EFI_IP_ADDRESS HostIpAddress
Host IP address reported in Redfish Host interface.
EFI_IP_ADDRESS HostSubnetMask
Host subnet mask address reported in Redfish Host interface.
EFI_REDFISH_DISCOVERED_INSTANCE * Instance
Pointer to EFI_REDFISH_DISCOVERED_INSTANCE.
Definition: Base.h:213
VOID * NetworkProtocolInterface
The protocol interface of network protocol.
EFI_HANDLE ProtocolControllerHandle
The controller handle on network protocol.
UINT32 ProtocolDiscoverId
The identifier installed on network protocol handle.
EFI_GUID ProtocolServiceGuid
Network protocol service GUID.
EFI_GUID * RequiredProtocolGuid
Network protocol interface GUID.
EFI_GUID * DiscoveredProtocolGuid
Protocol interface GUID use to install identifier.
EFI_REDFISH_DISCOVER_GET_SUBNET_INFO GetSubnetInfo
Function of getting subnet information.
EFI_GUID * RequiredServiceBindingProtocolGuid
Network protocol service GUID.
Device descriptor data formated based on Device Type.