21UINTN mNumNetworkInterface = 0;
22UINTN mNumRestExInstance = 0;
26EFI_GUID mRedfishDiscoverTcp4InstanceGuid = EFI_REDFISH_DISCOVER_TCP4_INSTANCE_GUID;
27EFI_GUID mRedfishDiscoverTcp6InstanceGuid = EFI_REDFISH_DISCOVER_TCP6_INSTANCE_GUID;
28EFI_GUID mRedfishDiscoverRestExInstanceGuid = EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_GUID;
47 L
"TCP4 Service Binding Protocol",
48 &gEfiTcp4ProtocolGuid,
49 &gEfiTcp4ServiceBindingProtocolGuid,
50 &mRedfishDiscoverTcp4InstanceGuid,
55 L
"TCP6 Service Binding Protocol",
56 &gEfiTcp6ProtocolGuid,
57 &gEfiTcp6ServiceBindingProtocolGuid,
58 &mRedfishDiscoverTcp6InstanceGuid,
63 L
"REST EX Service Binding Protocol",
64 &gEfiRestExProtocolGuid,
65 &gEfiRestExServiceBindingProtocolGuid,
66 &mRedfishDiscoverRestExInstanceGuid,
91 Instance->NetworkInterface->OpenDriverControllerHandle,
93 FixedPcdGetBool (PcdRedfishDiscoverAccessModeInBand) ? EfiRestExServiceInBandAccess : EfiRestExServiceOutOfBandAccess,
95 EfiRestExServiceRedfish,
96 &Token->DiscoverList.RedfishInstances->Information.RedfishRestExHandle
117 IN EFI_REDFISH_DISCOVER_FLAG DiscoverFlags
129 if ((ThisInstance->
Owner == ImageHandle) &&
167 UINT8 SubnetMaskIndex;
170 BOOLEAN GotPrefixLength;
172 if (Instance ==
NULL) {
173 return EFI_INVALID_PARAMETER;
176 Tcp4 = (
EFI_TCP4_PROTOCOL *)Instance->NetworkInterfaceProtocolInfo.NetworkProtocolInterface;
181 Tcp4CfgData.AccessPoint.UseDefaultAddress =
TRUE;
182 Tcp4CfgData.AccessPoint.RemoteAddress.Addr[0] = 127;
183 Tcp4CfgData.AccessPoint.RemoteAddress.Addr[1] = 0;
184 Tcp4CfgData.AccessPoint.RemoteAddress.Addr[2] = 0;
185 Tcp4CfgData.AccessPoint.RemoteAddress.Addr[3] = 1;
186 Tcp4CfgData.AccessPoint.RemotePort = 80;
187 Tcp4CfgData.AccessPoint.ActiveFlag =
TRUE;
189 Tcp4CfgData.ControlOption = &Tcp4Option;
190 Tcp4Option.ReceiveBufferSize = 65535;
191 Tcp4Option.SendBufferSize = 65535;
192 Tcp4Option.MaxSynBackLog = 5;
193 Tcp4Option.ConnectionTimeout = 60;
194 Tcp4Option.DataRetries = 12;
195 Tcp4Option.FinTimeout = 2;
196 Tcp4Option.KeepAliveProbes = 6;
197 Tcp4Option.KeepAliveTime = 7200;
198 Tcp4Option.KeepAliveInterval = 30;
199 Tcp4Option.EnableNagle =
TRUE;
200 Status = Tcp4->Configure (Tcp4, &Tcp4CfgData);
201 if (EFI_ERROR (Status)) {
202 if (Status == EFI_NO_MAPPING) {
206 DEBUG ((DEBUG_ERROR,
"%a: Can't get subnet information: %r\n", __func__, Status));
211 if (EFI_ERROR (Status)) {
212 DEBUG ((DEBUG_ERROR,
"%a: Can't get IP mode data information: %r\n", __func__, Status));
224 GotPrefixLength =
FALSE;
227 while (GotPrefixLength ==
FALSE && SubnetMaskIndex < 4) {
229 while (BitMask != 0) {
230 if ((Instance->SubnetMask.v4.Addr[SubnetMaskIndex] & BitMask) != 0) {
233 GotPrefixLength =
TRUE;
237 BitMask = BitMask >> 1;
243 Instance->SubnetPrefixLength = PrefixLength;
266 if (Instance ==
NULL) {
267 return EFI_INVALID_PARAMETER;
270 Tcp6 = (
EFI_TCP6_PROTOCOL *)Instance->NetworkInterfaceProtocolInfo.NetworkProtocolInterface;
274 if (EFI_ERROR (Status)) {
275 DEBUG ((DEBUG_ERROR,
"%a: Can't get IP mode data information: %r\n", __func__, Status));
280 DEBUG ((DEBUG_MANAGEABILITY,
"%a: No IPv6 address configured.\n", __func__));
281 Instance->SubnetAddrInfoIPv6Number = 0;
285 if (Instance->SubnetAddrInfoIPv6 !=
NULL) {
286 FreePool (Instance->SubnetAddrInfoIPv6);
287 Instance->SubnetAddrInfoIPv6 =
NULL;
291 if (Instance->SubnetAddrInfoIPv6 ==
NULL) {
292 DEBUG ((DEBUG_ERROR,
"%a: Failed to allocate memory for IPv6 subnet address information\n", __func__));
293 return EFI_OUT_OF_RESOURCES;
296 Instance->SubnetAddrInfoIPv6Number = IpModedata.
AddressCount;
299 (VOID *)Instance->SubnetAddrInfoIPv6,
326 if (
IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) {
332 if ((MAC_COMPARE (ThisNetworkInterface, TargetNetworkInterface)) &&
333 (VALID_TCP6 (TargetNetworkInterface, ThisNetworkInterface) ||
334 VALID_TCP4 (TargetNetworkInterface, ThisNetworkInterface)))
336 return ThisNetworkInterface;
339 if (
IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInterface->
Entry)) {
365 if (
IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) {
372 return ThisNetworkInterface;
375 if (
IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInterface->
Entry)) {
399 IN EFI_REDFISH_DISCOVER_FLAG Flags
404 if (
IsListEmpty (&mEfiRedfishDiscoverNetworkInterface) && (TargetNetworkInterface ==
NULL)) {
405 return EFI_UNSUPPORTED;
408 if (TargetNetworkInterface ==
NULL) {
414 if (MAC_COMPARE (ThisNetworkInterface, TargetNetworkInterface)) {
418 if (
IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInterface->
Entry)) {
419 return EFI_UNSUPPORTED;
433 return EFI_UNSUPPORTED;
452 if (
IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) {
459 if (
IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInterface->
Entry)) {
500 IN UINT32 NetworkProtocolType,
505 return IpType != REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4;
509 return IpType != REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6;
532 CHAR8 UuidStr[
sizeof "00000000-0000-0000-0000-000000000000" + 1];
533 CHAR16 Ipv6Str[
sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" + 1];
534 CHAR8 RedfishServiceLocateStr[
sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" + 1];
536 UINTN MacCompareStatus;
540 DeviceDescriptor =
NULL;
542 if (mSmbios ==
NULL) {
543 Status =
gBS->LocateProtocol (&gEfiSmbiosProtocolGuid,
NULL, (VOID **)&mSmbios);
544 if (EFI_ERROR (Status)) {
550 if (EFI_ERROR (Status) || (Data ==
NULL) || (DeviceDescriptor ==
NULL)) {
551 DEBUG ((DEBUG_ERROR,
"%a: RedfishGetHostInterfaceProtocolData is failed.\n", __func__));
555 if (
FilterProtocol (Instance->NetworkInterface->NetworkProtocolType, Data->HostIpAddressFormat)) {
556 return EFI_UNSUPPORTED;
564 if (DeviceDescriptor->
DeviceType == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) {
566 }
else if (DeviceDescriptor->
DeviceType == REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2) {
569 return EFI_UNSUPPORTED;
572 if (MacCompareStatus != 0) {
573 DEBUG ((DEBUG_MANAGEABILITY,
"%a: MAC address is not matched.\n", __func__));
576 " NetworkInterface: %02x %02x %02x %02x %02x %02x.\n",
577 Instance->NetworkInterface->MacAddress.Addr[0],
578 Instance->NetworkInterface->MacAddress.Addr[1],
579 Instance->NetworkInterface->MacAddress.Addr[2],
580 Instance->NetworkInterface->MacAddress.Addr[3],
581 Instance->NetworkInterface->MacAddress.Addr[4],
582 Instance->NetworkInterface->MacAddress.Addr[5]
586 " Redfish Host interface: %02x %02x %02x %02x %02x %02x.\n",
594 return EFI_UNSUPPORTED;
597 Instance->HostAddrFormat = Data->HostIpAddressFormat;
598 if (Data->HostIpAddressFormat == REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4) {
599 IP4_COPY_ADDRESS ((VOID *)&Instance->HostIpAddress.v4, (VOID *)Data->HostIpAddress);
600 IP4_COPY_ADDRESS ((VOID *)&Instance->HostSubnetMask.v4, (VOID *)Data->HostIpMask);
602 if (EFI_IP4_EQUAL (&Instance->HostIpAddress.v4, &mZeroIp4Addr)) {
603 DEBUG ((DEBUG_ERROR,
"%a: invalid host IP address: ", __func__));
608 Instance->HostAddrFormat = REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_UNKNOWN;
611 if (!IP4_IS_VALID_NETMASK (NTOHL (EFI_IP4 (Instance->HostSubnetMask.v4)))) {
612 DEBUG ((DEBUG_ERROR,
"%a: invalid subnet mask address: ", __func__));
617 Instance->HostAddrFormat = REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_UNKNOWN;
619 }
else if (Data->HostIpAddressFormat == REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6) {
620 IP6_COPY_ADDRESS ((VOID *)&Instance->HostIpAddress.v6, (VOID *)Data->HostIpAddress);
623 if (Data->RedfishServiceIpAddressFormat == REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4) {
624 IP4_COPY_ADDRESS ((VOID *)&Instance->TargetIpAddress.v4, (VOID *)Data->RedfishServiceIpAddress);
626 if (EFI_IP4_EQUAL (&Instance->TargetIpAddress.v4, &mZeroIp4Addr)) {
627 DEBUG ((DEBUG_ERROR,
"%a: invalid service IP address: ", __func__));
631 IP6_COPY_ADDRESS ((VOID *)&Instance->TargetIpAddress.v6, (VOID *)Data->RedfishServiceIpAddress);
634 if (Instance->HostIntfValidation) {
635 DEBUG ((DEBUG_ERROR,
"%a:Send UPnP unicast SSDP to validate this Redfish Host Interface is not supported.\n", __func__));
636 Status = EFI_UNSUPPORTED;
643 if (Data->RedfishServiceIpPort == 443) {
645 DEBUG ((DEBUG_MANAGEABILITY,
"Redfish service port: 443\n"));
647 DEBUG ((DEBUG_MANAGEABILITY,
"Redfish service port: 80\n"));
655 if (Data->RedfishServiceIpAddressFormat == REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6) {
657 if ((Data->RedfishServiceIpPort == 0) || (IsHttps ==
TRUE)) {
659 RedfishServiceLocateStr,
660 sizeof (RedfishServiceLocateStr),
666 RedfishServiceLocateStr,
667 sizeof (RedfishServiceLocateStr),
670 Data->RedfishServiceIpPort
674 if ((Data->RedfishServiceIpPort == 0) || (IsHttps ==
TRUE)) {
676 RedfishServiceLocateStr,
677 sizeof (RedfishServiceLocateStr),
679 Data->RedfishServiceIpAddress[0],
680 Data->RedfishServiceIpAddress[1],
681 Data->RedfishServiceIpAddress[2],
682 Data->RedfishServiceIpAddress[3]
686 RedfishServiceLocateStr,
687 sizeof (RedfishServiceLocateStr),
689 Data->RedfishServiceIpAddress[0],
690 Data->RedfishServiceIpAddress[1],
691 Data->RedfishServiceIpAddress[2],
692 Data->RedfishServiceIpAddress[3],
693 Data->RedfishServiceIpPort
701 RedfishServiceLocateStr,
727 if (Information->Location !=
NULL) {
729 Information->Location =
NULL;
732 if (Information->Uuid !=
NULL) {
734 Information->Uuid =
NULL;
737 if (Information->Os !=
NULL) {
739 Information->Os =
NULL;
742 if (Information->OsVersion !=
NULL) {
744 Information->OsVersion =
NULL;
747 if (Information->Product !=
NULL) {
749 Information->Product =
NULL;
752 if (Information->ProductVer !=
NULL) {
754 Information->ProductVer =
NULL;
777 IN UINTN *RedfishVersion OPTIONAL,
778 IN CONST CHAR8 *RedfishLocation OPTIONAL,
781 IN CONST CHAR8 *OsVer OPTIONAL,
782 IN CONST CHAR8 *Product OPTIONAL,
783 IN CONST CHAR8 *ProductVer OPTIONAL
786 UINTN AllocationSize;
788 if (RedfishVersion !=
NULL) {
789 Information->RedfishVersion = *RedfishVersion;
790 DEBUG ((DEBUG_MANAGEABILITY,
"Redfish service version: %d.\n", Information->RedfishVersion));
793 if (RedfishLocation !=
NULL) {
794 AllocationSize =
AsciiStrSize (RedfishLocation) *
sizeof (CHAR16);
797 AllocationSize += 2 *
sizeof (CHAR16);
801 if (Information->Location !=
NULL) {
808 DEBUG ((DEBUG_MANAGEABILITY,
"Redfish service location: %s.\n", Information->Location));
812 "%a: Can not allocate memory for Redfish service location: %a.\n",
822 if (Information->Uuid !=
NULL) {
824 DEBUG ((DEBUG_MANAGEABILITY,
"Service UUID: %s.\n", Information->Uuid));
828 "%a: Can not allocate memory for Service UUID: %a.\n",
838 if (Information->Os !=
NULL) {
843 "%a: Can not allocate memory for Redfish service OS: %a.\n",
851 AllocationSize =
AsciiStrSize (OsVer) *
sizeof (CHAR16);
853 if (Information->OsVersion !=
NULL) {
857 "Redfish service OS: %s, Version:%s.\n",
859 Information->OsVersion
864 "%a: Can not allocate memory for Redfish OS Version:%a.\n",
871 if (Product !=
NULL) {
872 AllocationSize =
AsciiStrSize (Product) *
sizeof (CHAR16);
874 if (Information->Product !=
NULL) {
879 "%a: Can not allocate memory for Redfish service product: %a.\n",
886 if (ProductVer !=
NULL) {
887 AllocationSize =
AsciiStrSize (ProductVer) *
sizeof (CHAR16);
888 Information->ProductVer =
AllocatePool (AllocationSize);
889 if (Information->ProductVer !=
NULL) {
893 "Redfish service product: %s, Version:%s.\n",
894 Information->Product,
895 Information->ProductVer
900 "%a: Can not allocate memory for Redfish service product Version: %a.\n",
927 IN UINTN *RedfishVersion OPTIONAL,
928 IN CHAR8 *RedfishLocation OPTIONAL,
929 IN CHAR8 *Uuid OPTIONAL,
930 IN CHAR8 *Os OPTIONAL,
931 IN CHAR8 *OsVer OPTIONAL,
932 IN CHAR8 *Product OPTIONAL,
933 IN CHAR8 *ProductVer OPTIONAL,
939 BOOLEAN RestExOpened;
940 BOOLEAN DeleteRestEx;
952 RestExOpened =
FALSE;
953 DeleteRestEx =
FALSE;
955 DEBUG ((DEBUG_MANAGEABILITY,
"%a:Add this instance to Redfish instance list.\n", __func__));
962 DiscoveredList =
NULL;
963 DiscoveredInstance =
NULL;
964 RestExHttpConfigData =
NULL;
966 NetworkInterface = Instance->NetworkInterface;
980 (VOID *)&Instance->TargetIpAddress.v4,
985 DiscoveredInstance = DiscoveredList->
Instance;
987 (Char16Uuid !=
NULL))
990 DiscoveredInstance = DiscoveredList->
Instance;
991 DEBUG ((DEBUG_MANAGEABILITY,
"*** This Redfish Service information refresh ***\n"));
998 (VOID *)&Instance->TargetIpAddress.v6,
1003 DiscoveredInstance = DiscoveredList->
Instance;
1012 DiscoveredInstance = DiscoveredList->
Instance;
1026 if (Char16Uuid !=
NULL) {
1030 if (NewFound || InfoRefresh) {
1033 if (DiscoveredList ==
NULL) {
1034 return EFI_OUT_OF_RESOURCES;
1039 if (DiscoveredInstance ==
NULL) {
1041 return EFI_OUT_OF_RESOURCES;
1047 DEBUG ((DEBUG_MANAGEABILITY,
"*** Redfish Service Information ***\n"));
1063 if (RedfishLocation ==
NULL) {
1071 DiscoveredList->
Instance = DiscoveredInstance;
1077 if (DiscoveredList !=
NULL) {
1078 DEBUG ((DEBUG_MANAGEABILITY,
"*** This Redfish Service was already found ***\n"));
1082 DEBUG ((DEBUG_MANAGEABILITY,
"Service UUID: unknown.\n"));
1088 if (NewFound || InfoRefresh) {
1092 Instance->DiscoverToken->DiscoverList.NumberOfServiceFound = 1;
1093 Instance->DiscoverToken->DiscoverList.RedfishInstances = DiscoveredInstance;
1097 if (EFI_ERROR (Status)) {
1098 DEBUG ((DEBUG_ERROR,
"%a:Can't create REST EX child instance.\n", __func__));
1102 Status =
gBS->OpenProtocol (
1104 Instance->DiscoverToken->DiscoverList.RedfishInstances->Information.RedfishRestExHandle,
1105 &gEfiRestExProtocolGuid,
1107 Instance->NetworkInterface->OpenDriverAgentHandle,
1108 Instance->NetworkInterface->OpenDriverControllerHandle,
1109 EFI_OPEN_PROTOCOL_BY_DRIVER
1111 if (EFI_ERROR (Status)) {
1112 DeleteRestEx =
TRUE;
1116 RestExOpened =
TRUE;
1118 if (RestExHttpConfigData ==
NULL) {
1119 Status = EFI_OUT_OF_RESOURCES;
1120 DeleteRestEx =
TRUE;
1121 goto EXIT_FREE_CONFIG_DATA;
1124 RestExHttpConfigData->SendReceiveTimeout =
PcdGet32 (PcdRedfishSendReceiveTimeout);
1125 RestExHttpConfigData->HttpConfigData.
HttpVersion = HttpVersion11;
1129 if (RestExHttpConfigData->HttpConfigData.AccessPoint.
IPv6Node ==
NULL) {
1130 Status = EFI_OUT_OF_RESOURCES;
1131 goto EXIT_FREE_CONFIG_DATA;
1134 if (Instance->HostAddrFormat == REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6) {
1135 IP6_COPY_ADDRESS (&RestExHttpConfigData->HttpConfigData.AccessPoint.
IPv6Node->
LocalAddress, &Instance->HostIpAddress.v6);
1139 if (RestExHttpConfigData->HttpConfigData.AccessPoint.
IPv4Node ==
NULL) {
1140 Status = EFI_OUT_OF_RESOURCES;
1141 goto EXIT_FREE_CONFIG_DATA;
1144 if (Instance->HostAddrFormat == REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4) {
1146 IP4_COPY_ADDRESS (&RestExHttpConfigData->HttpConfigData.AccessPoint.
IPv4Node->
LocalAddress, &Instance->HostIpAddress.v4);
1147 IP4_COPY_ADDRESS (&RestExHttpConfigData->HttpConfigData.AccessPoint.
IPv4Node->
LocalSubnet, &Instance->HostSubnetMask.v4);
1153 Status = RestEx->Configure (
1155 (EFI_REST_EX_CONFIG_DATA)(UINT8 *)RestExHttpConfigData
1157 if (EFI_ERROR (Status)) {
1158 DEBUG ((DEBUG_ERROR,
"%a: REST EX is not configured..\n", __func__));
1159 DeleteRestEx =
TRUE;
1162 DEBUG ((DEBUG_MANAGEABILITY,
"%a: REST EX is configured..\n", __func__));
1169 gBS->CloseProtocol (
1170 Instance->DiscoverToken->DiscoverList.RedfishInstances->Information.RedfishRestExHandle,
1171 &gEfiRestExProtocolGuid,
1172 Instance->NetworkInterface->OpenDriverAgentHandle,
1173 Instance->NetworkInterface->OpenDriverControllerHandle
1175 RestExOpened =
FALSE;
1179 Status =
gBS->SignalEvent (Instance->DiscoverToken->Event);
1180 if (EFI_ERROR (Status)) {
1181 DEBUG ((DEBUG_ERROR,
"%a:No event to signal!\n", __func__));
1186 if ((RestExHttpConfigData !=
NULL) && (RestExHttpConfigData->HttpConfigData.AccessPoint.
IPv4Node !=
NULL)) {
1190EXIT_FREE_CONFIG_DATA:;
1191 if (RestExHttpConfigData !=
NULL) {
1192 FreePool ((VOID *)RestExHttpConfigData);
1196 gBS->CloseProtocol (
1197 Instance->DiscoverToken->DiscoverList.RedfishInstances->Information.RedfishRestExHandle,
1198 &gEfiRestExProtocolGuid,
1199 Instance->NetworkInterface->OpenDriverAgentHandle,
1200 Instance->NetworkInterface->OpenDriverControllerHandle
1205 if (DeleteRestEx && RestExOpened) {
1206 gBS->CloseProtocol (
1207 Instance->DiscoverToken->DiscoverList.RedfishInstances->Information.RedfishRestExHandle,
1208 &gEfiRestExProtocolGuid,
1209 Instance->NetworkInterface->OpenDriverAgentHandle,
1210 Instance->NetworkInterface->OpenDriverControllerHandle
1235 UINT32 ProtocolType;
1236 UINT32 IPv6InfoIndex;
1240 if (Instance->GotSubnetInfo) {
1244 ProtocolType = Instance->NetworkProtocolType;
1245 if ((mRequiredProtocol[ProtocolType].GetSubnetInfo !=
NULL) && (Instance->GotSubnetInfo ==
FALSE)) {
1250 if (EFI_ERROR (Status)) {
1251 DEBUG ((DEBUG_ERROR,
"%a:Failed to get Subnet information.\n", __func__));
1254 DEBUG ((DEBUG_MANAGEABILITY,
"%a:MAC address: %s\n", __func__, Instance->StrMacAddr));
1256 if (Instance->SubnetAddrInfoIPv6Number == 0) {
1257 DEBUG ((DEBUG_WARN,
"%a: There is no Subnet information for IPv6 network interface.\n", __func__));
1258 return EFI_NOT_FOUND;
1261 ThisSubnetAddrInfoIPv6 = Instance->SubnetAddrInfoIPv6;
1262 IP6_COPY_ADDRESS (&Instance->SubnetAddr.v6, &ThisSubnetAddrInfoIPv6->
Address);
1263 Instance->SubnetPrefixLength = ThisSubnetAddrInfoIPv6->
PrefixLength;
1265 DEBUG_MANAGEABILITY,
1266 " IPv6 Subnet ID:%d, Prefix length: %d.\n",
1267 ThisSubnetAddrInfoIPv6->
Address.Addr[7] + (UINT16)ThisSubnetAddrInfoIPv6->
Address.Addr[6] * 256,
1275 ThisSubnetAddrInfoIPv6++;
1276 for (IPv6InfoIndex = 0; IPv6InfoIndex < Instance->SubnetAddrInfoIPv6Number - 1; IPv6InfoIndex++) {
1281 if (NewNetworkInterface !=
NULL) {
1283 IP6_COPY_ADDRESS (&NewNetworkInterface->SubnetAddr.v6, &ThisSubnetAddrInfoIPv6->
Address);
1284 NewNetworkInterface->SubnetPrefixLength = ThisSubnetAddrInfoIPv6->
PrefixLength;
1285 NewNetworkInterface->GotSubnetInfo =
TRUE;
1286 InsertTailList (&mEfiRedfishDiscoverNetworkInterface, &NewNetworkInterface->Entry);
1287 ThisSubnetAddrInfoIPv6++;
1288 mNumNetworkInterface++;
1290 DEBUG_MANAGEABILITY,
1291 " IPv6 Subnet ID:%d, Prefix length: %d.\n",
1292 ThisSubnetAddrInfoIPv6->
Address.Addr[7] + (UINT16)ThisSubnetAddrInfoIPv6->
Address.Addr[6] * 256,
1297 return EFI_OUT_OF_RESOURCES;
1302 DEBUG_MANAGEABILITY,
1303 " IPv4 Subnet:%d.%d.%d.%d Subnet mask: %d.%d.%d.%d.\n",
1304 Instance->SubnetAddr.v4.Addr[0],
1305 Instance->SubnetAddr.v4.Addr[1],
1306 Instance->SubnetAddr.v4.Addr[2],
1307 Instance->SubnetAddr.v4.Addr[3],
1308 Instance->SubnetMask.v4.Addr[0],
1309 Instance->SubnetMask.v4.Addr[1],
1310 Instance->SubnetMask.v4.Addr[2],
1311 Instance->SubnetMask.v4.Addr[3]
1317 Instance->GotSubnetInfo =
TRUE;
1352 DEBUG ((DEBUG_MANAGEABILITY,
"%a: Entry.\n", __func__));
1354 if ((This ==
NULL) || (NetworkIntfInstances ==
NULL) || (NumberOfNetworkIntfs ==
NULL) ||
1355 (ImageHandle ==
NULL))
1357 return EFI_INVALID_PARAMETER;
1360 *NumberOfNetworkIntfs = 0;
1361 *NetworkIntfInstances =
NULL;
1364 return EFI_NOT_FOUND;
1367 RestExInstance = EFI_REDFISH_DISOVER_DATA_FROM_DISCOVER_PROTOCOL (This);
1378 if (ThisNetworkInterface ==
NULL) {
1379 return EFI_OUT_OF_RESOURCES;
1382 *NetworkIntfInstances = ThisNetworkInterface;
1399 if (!EFI_ERROR (Status)) {
1400 if (!ThisNetworkInterface->
IsIpv6) {
1401 IP4_COPY_ADDRESS (&ThisNetworkInterface->
SubnetId.v4, &ThisNetworkInterfaceIntn->
SubnetAddr.v4);
1403 IP6_COPY_ADDRESS (&ThisNetworkInterface->
SubnetId.v6, &ThisNetworkInterfaceIntn->
SubnetAddr.v6);
1409 ThisNetworkInterface->
VlanId = ThisNetworkInterfaceIntn->
VlanId;
1411 if (
IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInterfaceIntn->
Entry)) {
1416 ThisNetworkInterface++;
1454 IN EFI_REDFISH_DISCOVER_FLAG Flags,
1460 BOOLEAN NewInstance;
1461 UINTN NumNetworkInterfaces;
1462 UINTN NetworkInterfacesIndex;
1465 DEBUG ((DEBUG_MANAGEABILITY,
"%a:Entry.\n", __func__));
1471 DEBUG ((DEBUG_ERROR,
"%a:Invalid parameters.\n", __func__));
1472 return EFI_INVALID_PARAMETER;
1479 return EFI_UNSUPPORTED;
1482 if (TargetNetworkInterface !=
NULL) {
1484 if (TargetNetworkInterfaceInternal ==
NULL) {
1485 DEBUG ((DEBUG_ERROR,
"%a:No network interface on platform.\n", __func__));
1486 return EFI_UNSUPPORTED;
1489 NumNetworkInterfaces = 1;
1493 if (NumNetworkInterfaces == 0) {
1494 DEBUG ((DEBUG_ERROR,
"%a:No network interface on platform.\n", __func__));
1495 return EFI_UNSUPPORTED;
1499 for (NetworkInterfacesIndex = 0; NetworkInterfacesIndex < NumNetworkInterfaces; NetworkInterfacesIndex++) {
1501 NewInstance =
FALSE;
1503 if (Instance ==
NULL) {
1504 DEBUG ((DEBUG_MANAGEABILITY,
"%a:Create new EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE.\n", __func__));
1506 if (Instance ==
NULL) {
1507 DEBUG ((DEBUG_ERROR,
"%a:Memory allocation fail.\n", __func__));
1508 return EFI_OUT_OF_RESOURCES;
1512 Instance->
Owner = ImageHandle;
1513 Instance->
DiscoverFlags = Flags & ~EFI_REDFISH_DISCOVER_VALIDATION;
1520 if (EFI_ERROR (Status1)) {
1527 DEBUG ((DEBUG_ERROR,
"%a: Get subnet information fail.\n", __func__));
1537 DEBUG ((DEBUG_MANAGEABILITY,
"%a:Acquire Redfish service on network interface MAC address:%s.\n", __func__, TargetNetworkInterfaceInternal->
StrMacAddr));
1539 DEBUG ((DEBUG_MANAGEABILITY,
"%a:WARNING: No MAC address on this network interface.\n", __func__));
1544 DEBUG ((DEBUG_MANAGEABILITY,
"%a:Redfish HOST interface discovery.\n", __func__));
1554 DEBUG ((DEBUG_ERROR,
"%a:Redfish service discovery through SSDP is not supported\n", __func__));
1555 return EFI_UNSUPPORTED;
1557 if (EFI_ERROR (Status1)) {
1562 DEBUG ((DEBUG_MANAGEABILITY,
"%a:Something wrong on Redfish service discovery Status1=%r.\n", __func__, Status1));
1570 if (TargetNetworkInterface ==
NULL) {
1598 DEBUG ((DEBUG_MANAGEABILITY,
"%a: Entry.\n", __func__));
1603 return EFI_UNSUPPORTED;
1624 BOOLEAN AnyFailRelease;
1628 DEBUG ((DEBUG_MANAGEABILITY,
"%a: Entry.\n", __func__));
1631 DEBUG ((DEBUG_ERROR,
"%a:No any discovered Redfish service.\n", __func__));
1632 return EFI_NOT_FOUND;
1635 AnyFailRelease =
FALSE;
1636 ThisRedfishInstance = InstanceList->RedfishInstances;
1637 for (NumService = 0; NumService < InstanceList->NumberOfServiceFound; NumService++) {
1640 if (DiscoveredRedfishInstance->
Instance == ThisRedfishInstance) {
1643 FreePool ((VOID *)ThisRedfishInstance);
1654 AnyFailRelease =
TRUE;
1662 if (AnyFailRelease) {
1663 return EFI_NOT_FOUND;
1684 IN UINT32 NetworkProtocolType,
1685 OUT BOOLEAN *IsNewInstance,
1690 UINTN HwAddressSize;
1695 NewNetworkInterface =
NULL;
1696 *IsNewInstance =
TRUE;
1702 if (ThisNetworkInterface !=
NULL) {
1707 NewNetworkInterface = ThisNetworkInterface;
1708 *IsNewInstance =
FALSE;
1712 if (
IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInterface->
Entry)) {
1713 NewNetworkInterface =
NULL;
1722 if (NewNetworkInterface ==
NULL) {
1727 if (NewNetworkInterface ==
NULL) {
1728 return EFI_OUT_OF_RESOURCES;
1737 *NetworkInterface = NewNetworkInterface;
1756 Status =
gBS->UninstallProtocolInterface (
1757 ThisNetworkInterface->OpenDriverControllerHandle,
1759 &ThisNetworkInterface->NetworkInterfaceProtocolInfo.ProtocolDiscoverId
1762 mNumNetworkInterface--;
1790 for (Index = 0; Index < ListCount; Index++) {
1791 Status =
gBS->OpenProtocol (
1793 mRequiredProtocol[Index].RequiredServiceBindingProtocolGuid,
1795 This->DriverBindingHandle,
1797 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
1799 if (EFI_ERROR (Status)) {
1800 return EFI_UNSUPPORTED;
1803 Status =
gBS->OpenProtocol (
1805 mRequiredProtocol[Index].DiscoveredProtocolGuid,
1807 This->DriverBindingHandle,
1809 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1811 if (!EFI_ERROR (Status)) {
1813 return EFI_UNSUPPORTED;
1817 DEBUG ((DEBUG_MANAGEABILITY,
"%a: all required protocols are found on this controller handle: %p.\n", __func__, ControllerHandle));
1844 VOID *TempInterface;
1846 UINT32 *ProtocolDiscoverIdPtr;
1852 BOOLEAN NewNetworkInterfaceInstalled;
1856 NewNetworkInterfaceInstalled =
FALSE;
1858 RestExInstance =
NULL;
1860 for (Index = 0; Index < ListCount; Index++) {
1861 Status =
gBS->OpenProtocol (
1864 mRequiredProtocol[Index].DiscoveredProtocolGuid,
1866 This->DriverBindingHandle,
1868 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1870 if (!EFI_ERROR (Status)) {
1874 Status =
gBS->OpenProtocol (
1876 mRequiredProtocol[Index].RequiredServiceBindingProtocolGuid,
1878 This->DriverBindingHandle,
1880 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1882 if (EFI_ERROR (Status)) {
1887 OldTpl =
gBS->RaiseTPL (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_TPL);
1889 if (EFI_ERROR (Status)) {
1890 gBS->RestoreTPL (OldTpl);
1904 NewNetworkInterfaceInstalled =
TRUE;
1907 mNumNetworkInterface++;
1910 gBS->RestoreTPL (OldTpl);
1917 if (RestExInstance ==
NULL) {
1918 return EFI_OUT_OF_RESOURCES;
1926 mNumRestExInstance++;
1927 ProtocolDiscoverIdPtr = &RestExInstance->
RestExId;
1934 Status =
gBS->InstallProtocolInterface (
1936 mRequiredProtocol[Index].DiscoveredProtocolGuid,
1938 ProtocolDiscoverIdPtr
1940 if (EFI_ERROR (Status)) {
1951 HandleOfProtocolInterfacePtr
1953 if (!EFI_ERROR (Status)) {
1954 Status =
gBS->OpenProtocol (
1955 *HandleOfProtocolInterfacePtr,
1956 mRequiredProtocol[Index].RequiredProtocolGuid,
1958 OpenDriverAgentHandle,
1959 OpenDriverControllerHandle,
1960 EFI_OPEN_PROTOCOL_BY_DRIVER
1962 if (!EFI_ERROR (Status)) {
1968 if (!NewNetworkInterfaceInstalled) {
1970 if (NetworkInterface ==
NULL) {
1971 DEBUG ((DEBUG_ERROR,
"%a: Can't find network interface by ControllerHandle\n", __func__));
1976 NewNetworkInterfaceInstalled =
FALSE;
1979 RestExInstance->
Signature = EFI_REDFISH_DISCOVER_DATA_SIGNATURE;
1986 Status =
gBS->InstallProtocolInterface (
1988 &gEfiRedfishDiscoverProtocolGuid,
1992 if (EFI_ERROR (Status)) {
1993 DEBUG ((DEBUG_ERROR,
"%a: Fail to install EFI_REDFISH_DISCOVER_PROTOCOL\n", __func__));
1996 DEBUG ((DEBUG_MANAGEABILITY,
"%a: Not REST EX, continue with next\n", __func__));
2005 return EFI_DEVICE_ERROR;
2035 Status =
gBS->CloseProtocol (
2037 ThisRequiredProtocol->RequiredProtocolGuid,
2039 DriverControllerHandle
2041 if (!EFI_ERROR (Status)) {
2044 ThisBindingProtocol->ImageHandle,
2045 ThisRequiredProtocol->RequiredServiceBindingProtocolGuid,
2079 Status =
gBS->HandleProtocol (
2081 mRequiredProtocol[Index].RequiredProtocolGuid,
2084 if (!EFI_ERROR (Status)) {
2086 if (
IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) {
2087 return EFI_NOT_FOUND;
2090 OldTpl =
gBS->RaiseTPL (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_TPL);
2099 ThisBindingProtocol,
2101 &mRequiredProtocol[Index],
2105 if (!EFI_ERROR (Status)) {
2109 gBS->RestoreTPL (OldTpl);
2115 if (DiscoverProtocolHandle !=
NULL) {
2116 Status =
gBS->HandleProtocol (
2117 DiscoverProtocolHandle,
2118 &gEfiRedfishDiscoverProtocolGuid,
2119 (VOID **)&RedfishDiscoverProtocol
2121 if (!EFI_ERROR (Status)) {
2122 RestExInstance = EFI_REDFISH_DISOVER_DATA_FROM_DISCOVER_PROTOCOL (RedfishDiscoverProtocol);
2126 RedfishDiscoverProtocol->AbortAcquireRedfishService (
2127 RedfishDiscoverProtocol,
2131 gBS->DisconnectController (DiscoverProtocolHandle,
NULL,
NULL);
2132 Status =
gBS->UninstallProtocolInterface (
2133 DiscoverProtocolHandle,
2134 &gEfiRedfishDiscoverProtocolGuid,
2143 if (
IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInterface->
Entry)) {
2150 gBS->RestoreTPL (OldTpl);
2152 if (
IsListEmpty (&mEfiRedfishDiscoverRestExInstance)) {
2153 return EFI_NOT_FOUND;
2156 OldTpl =
gBS->RaiseTPL (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_TPL);
2162 ThisBindingProtocol,
2164 &mRequiredProtocol[Index],
2170 mNumRestExInstance--;
2171 gBS->RestoreTPL (OldTpl);
2175 if (
IsNodeAtEnd (&mEfiRedfishDiscoverRestExInstance, &RestExInstance->
Entry)) {
2182 gBS->RestoreTPL (OldTpl);
2187 return EFI_NOT_FOUND;
2286 DEBUG ((DEBUG_MANAGEABILITY,
"%a:Entry.\n", __func__));
2332 REDFISH_DISCOVER_VERSION,
2366 &gRedfishDiscoverDriverBinding,
2399 while (!
IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) {
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
BOOLEAN EFIAPI IsNodeAtEnd(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
RETURN_STATUS EFIAPI AsciiStrToUnicodeStrS(IN CONST CHAR8 *Source, OUT CHAR16 *Destination, IN UINTN DestMax)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI AsciiSPrintUnicodeFormat(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
UINTN EFIAPI UnicodeSPrintAsciiFormat(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
UINTN EFIAPI AsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
#define DEBUG(Expression)
EFI_STATUS EFIAPI NetLibGetMacAddress(IN EFI_HANDLE ServiceHandle, OUT EFI_MAC_ADDRESS *MacAddress, OUT UINTN *AddressSize)
EFI_STATUS EFIAPI NetLibGetMacString(IN EFI_HANDLE ServiceHandle, IN EFI_HANDLE ImageHandle OPTIONAL, OUT CHAR16 **MacString)
EFI_STATUS EFIAPI NetLibCreateServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN OUT EFI_HANDLE *ChildHandle)
EFI_STATUS EFIAPI NetLibDestroyServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN EFI_HANDLE ChildHandle)
EFI_STATUS EFIAPI NetLibIp6ToStr(IN EFI_IPv6_ADDRESS *Ip6Address, OUT CHAR16 *String, IN UINTN StringSize)
UINT16 EFIAPI NetLibGetVlanId(IN EFI_HANDLE ServiceHandle)
#define FixedPcdGetBool(TokenName)
#define PcdGet32(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_STATUS DumpIpv4Address(IN UINTN ErrorLevel, IN EFI_IPv4_ADDRESS *Ipv4Address)
#define EFI_REDFISH_DISCOVER_HOST_INTERFACE
Discover Redfish server reported in SMBIOS 42h.
#define EFI_REDFISH_DISCOVER_VALIDATION
Validate Redfish service for host interface instance.
#define EFI_REDFISH_DISCOVER_SSDP
Discover Redfish server using UPnP Http search method.
EFI_STATUS DestroyRedfishNetworkInterface(IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *ThisNetworkInterface)
EFI_STATUS EFIAPI Tcp6GetSubnetInfo(IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *Instance)
EFI_STATUS EFIAPI RedfishServiceAbortAcquire(IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface OPTIONAL)
STATIC VOID InitInformationData(IN EFI_REDFISH_DISCOVERED_INFORMATION *Information, IN BOOLEAN IsIpv6, IN UINTN *RedfishVersion OPTIONAL, IN CONST CHAR8 *RedfishLocation OPTIONAL, IN CONST CHAR8 *Uuid OPTIONAL, IN CONST CHAR8 *Os OPTIONAL, IN CONST CHAR8 *OsVer OPTIONAL, IN CONST CHAR8 *Product OPTIONAL, IN CONST CHAR8 *ProductVer OPTIONAL)
EFI_STATUS EFIAPI RedfishDiscoverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS CloseProtocolService(IN EFI_DRIVER_BINDING_PROTOCOL *ThisBindingProtocol, IN EFI_HANDLE ControllerHandle, IN REDFISH_DISCOVER_REQUIRED_PROTOCOL *ThisRequiredProtocol, IN EFI_HANDLE DriverAgentHandle, IN EFI_HANDLE DriverControllerHandle)
EFI_STATUS EFIAPI RedfishServiceGetNetworkInterface(IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_HANDLE ImageHandle, OUT UINTN *NumberOfNetworkIntfs, OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE **NetworkIntfInstances)
EFI_STATUS ValidateTargetNetworkInterface(IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface, IN EFI_REDFISH_DISCOVER_FLAG Flags)
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
BOOLEAN CheckIsIpVersion6(IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *ThisNetworkInterface)
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_STATUS CreateRedfishDiscoverNetworkInterface(IN EFI_HANDLE ControllerHandle, IN UINT32 NetworkProtocolType, OUT BOOLEAN *IsNewInstance, OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL **NetworkInterface)
STATIC VOID FreeInformationData(IN EFI_REDFISH_DISCOVERED_INFORMATION *Information)
EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE * GetInstanceByOwner(IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *TargetNetworkInterface, IN EFI_REDFISH_DISCOVER_FLAG DiscoverFlags)
EFI_STATUS BuildupNetworkInterface(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle)
EFI_STATUS TestForRequiredProtocols(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle)
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_STATUS NetworkInterfaceGetSubnetInfo(IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *Instance, IN EFI_HANDLE ImageHandle)
EFI_STATUS DiscoverRedfishHostInterface(IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE *Instance)
UINTN NumberOfNetworkInterface(VOID)
EFI_STATUS EFIAPI RedfishServiceAcquireService(IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface, IN EFI_REDFISH_DISCOVER_FLAG Flags, IN EFI_REDFISH_DISCOVERED_TOKEN *Token)
EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL * GetTargetNetworkInterfaceInternalByController(IN EFI_HANDLE ControllerHandle)
EFI_STATUS EFIAPI RedfishServiceReleaseService(IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_REDFISH_DISCOVERED_LIST *InstanceList)
STATIC BOOLEAN FilterProtocol(IN UINT32 NetworkProtocolType, IN UINT8 IpType)
EFI_STATUS EFIAPI Tcp4GetSubnetInfo(IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *Instance)
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS StopServiceOnNetworkInterface(IN EFI_DRIVER_BINDING_PROTOCOL *ThisBindingProtocol, IN EFI_HANDLE ControllerHandle)
EFI_STATUS CreateRestExInstance(IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE *Instance, IN EFI_REDFISH_DISCOVERED_TOKEN *Token)
EFI_STATUS EFIAPI RedfishDiscoverUnload(IN EFI_HANDLE ImageHandle)
EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL * GetTargetNetworkInterfaceInternal(IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface)
@ ProtocolTypeTcp4
Network protocol TCPv4.
@ ProtocolTypeTcp6
Network protocol TCCv6.
@ ProtocolTypeRestEx
REST EX over network protocol.
EFI_STATUS RedfishGetHostInterfaceProtocolData(IN EFI_SMBIOS_PROTOCOL *Smbios, OUT REDFISH_INTERFACE_DATA **DeviceDescriptor, OUT REDFISH_OVER_IP_PROTOCOL_DATA **ProtocolData)
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gRedfishDiscoverComponentName
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gRedfishDiscoverComponentName2
EFI_STATUS RestExLibCreateChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_REST_EX_SERVICE_ACCESS_MODE AccessMode, IN EFI_REST_EX_CONFIG_TYPE ConfigType, IN EFI_REST_EX_SERVICE_TYPE ServiceType, OUT EFI_HANDLE *ChildInstanceHandle)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
EFI_HTTP_VERSION HttpVersion
EFI_HTTPv6_ACCESS_POINT * IPv6Node
EFI_HTTPv4_ACCESS_POINT * IPv4Node
BOOLEAN LocalAddressIsIPv6
EFI_IPv4_ADDRESS LocalSubnet
EFI_IPv4_ADDRESS LocalAddress
BOOLEAN UseDefaultAddress
EFI_IPv6_ADDRESS LocalAddress
EFI_IPv4_ADDRESS SubnetMask
EFI_IPv4_ADDRESS StationAddress
EFI_IP4_CONFIG_DATA ConfigData
UINT8 PrefixLength
The length of the prefix associated with the Address.
EFI_IPv6_ADDRESS Address
The IPv6 address.
EFI_IP6_ADDRESS_INFO * AddressList
EFI_IP_ADDRESS SubnetAddr
Subnet ID.
UINT8 SubnetPrefixLength
Subnet prefix.
UINT32 NetworkProtocolType
EFI_MAC_ADDRESS MacAddress
MAC address of network interface.
LIST_ENTRY Entry
Link list entry.
REDFISH_DISCOVER_NETWORK_INTERFACE_PROTOCOL NetworkInterfaceProtocolInfo
Network interface protocol information.
EFI_HANDLE EfiRedfishDiscoverProtocolHandle
CHAR16 * StrMacAddr
String to MAC address of network interface.
EFI_HANDLE OpenDriverControllerHandle
The controller handle to open network protocol.
UINTN HwAddressSize
The size of network interface hardware address.
EFI_HANDLE OpenDriverAgentHandle
The agent to open network protocol.
UINT8 SubnetPrefixLength
Subnet prefix-length for IPv4 and IPv6.
EFI_IP_ADDRESS SubnetId
Subnet ID.
EFI_MAC_ADDRESS MacAddress
MAC address of network interfase to discover Redfish service.
BOOLEAN IsIpv6
Indicates it's IP versino 6.
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.
LIST_ENTRY Entry
Link list entry.
EFI_HANDLE RestExChildHandle
The child handle created through REST EX Service Protocol.
UINT32 Signature
Instance signature.
EFI_REST_EX_PROTOCOL * RestExProtocolInterface
Pointer to EFI_REST_EX_PROTOCOL.
EFI_IP_ADDRESS RedfishHostIpAddress
IP address of Redfish service.
BOOLEAN UseHttps
Using HTTPS.
CHAR16 * Uuid
Redfish service UUID.
EFI_REDFISH_DISCOVERED_INFORMATION Information
Redfish service discovered.
EFI_STATUS Status
Status of Redfish service discovery.
BOOLEAN HostIntfValidation
Indicates whether to validate Redfish Host interface.
EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL * NetworkInterface
LIST_ENTRY Entry
Link list entry.
EFI_REDFISH_DISCOVERED_TOKEN * DiscoverToken
Token used to signal when Redfish service is discovered.
EFI_REDFISH_DISCOVER_FLAG DiscoverFlags
EFI_REDFISH_DISCOVER_FLAG.
LIST_ENTRY NextInstance
Next list.
EFI_REDFISH_DISCOVERED_INSTANCE * Instance
Pointer to EFI_REDFISH_DISCOVERED_INSTANCE.
UINT8 MacAddress[6]
The MAC address of the PCI/PCIe network device.
VOID * NetworkProtocolInterface
The protocol interface of network protocol.
EFI_GUID ProtocolGuid
Network protocol GUID.
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.
DEVICE_DESCRITOR DeviceDescriptor
The Device descriptor.
UINT8 DeviceType
The Device Type of the interface.
UINT8 MacAddress[6]
The MAC address of the PCI/PCIe network device.
PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2 PciPcieDeviceV2
Device type PCI/PCIe V2 device discriptor.
USB_INTERFACE_DEVICE_DESCRIPTOR_V2 UsbDeviceV2
Device type USB V2 device discriptor.