13LIST_ENTRY mIp6ConfigInstanceList = { &mIp6ConfigInstanceList, &mIp6ConfigInstanceList };
72 if (IpSb->LinkLocalOk) {
76 (UINT32)IP6_INFINIT_LIFETIME,
77 (UINT32)IP6_INFINIT_LIFETIME,
78 IP6_LINK_LOCAL_PREFIX_LENGTH,
83 if (!
IsListEmpty (&IpSb->DefaultInterface->AddressList) && (IpSb->DefaultInterface->AddressCount > 0)) {
91 NET_LIST_FOR_EACH (Entry, &IpSb->DefaultInterface->AddressList) {
92 AddrInfo = NET_LIST_USER_STRUCT_S (Entry,
IP6_ADDRESS_INFO, Link, IP6_ADDR_INFO_SIGNATURE);
94 NET_LIST_FOR_EACH (Entry2, &IpSb->Children) {
95 Instance = NET_LIST_USER_STRUCT_S (Entry2,
IP6_PROTOCOL, Link, IP6_PROTOCOL_SIGNATURE);
96 if ((Instance->State == IP6_STATE_CONFIGED) && EFI_IP6_EQUAL (&Instance->ConfigData.
StationAddress, &AddrInfo->Address)) {
111 &IpSb->DefaultInterface->AddressList,
112 &IpSb->DefaultInterface->AddressCount,
117 if ((IpSb->Controller !=
NULL) && Recovery) {
125 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
129 IpIf = NET_LIST_USER_STRUCT_S (Entry,
IP6_INTERFACE, Link, IP6_INTERFACE_SIGNATURE);
131 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DelayJoinList) {
139 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DupAddrDetectList) {
140 DadEntry = NET_LIST_USER_STRUCT_S (Entry2,
IP6_DAD_ENTRY, Link, IP6_DAD_ENTRY_SIGNATURE);
155 IpSb->RouterAdvertiseReceived =
FALSE;
156 IpSb->SolicitTimer = IP6_MAX_RTR_SOLICITATIONS;
160 IpSb->Ticks = (UINT32)IP6_GET_TICKS (IP6_ONE_SECOND_IN_MS);
178 IN BOOLEAN OtherInfoOnly
194 if (Instance->Dhcp6Handle !=
NULL) {
198 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
200 Instance->OtherInfoOnly = OtherInfoOnly;
205 &gEfiDhcp6ServiceBindingProtocolGuid,
206 &Instance->Dhcp6Handle
209 if (Status == EFI_UNSUPPORTED) {
213 if (Instance->Dhcp6SbNotifyEvent ==
NULL) {
215 &gEfiDhcp6ServiceBindingProtocolGuid,
219 &Instance->Registration
224 if (EFI_ERROR (Status)) {
228 if (Instance->Dhcp6SbNotifyEvent !=
NULL) {
229 gBS->CloseEvent (Instance->Dhcp6SbNotifyEvent);
232 Status =
gBS->OpenProtocol (
233 Instance->Dhcp6Handle,
234 &gEfiDhcp6ProtocolGuid,
235 (VOID **)&Instance->Dhcp6,
238 EFI_OPEN_PROTOCOL_BY_DRIVER
242 Dhcp6 = Instance->Dhcp6;
243 Dhcp6->Configure (Dhcp6,
NULL);
250 Oro->
OpCode = HTONS (DHCP6_OPT_ORO);
251 Oro->
OpLen = HTONS (2);
252 *((UINT16 *)&Oro->
Data[0]) = HTONS (DHCP6_OPT_DNS_SERVERS);
257 if (!OtherInfoOnly) {
272 Status = Dhcp6->Configure (Dhcp6, &Dhcp6CfgData);
274 if (!EFI_ERROR (Status)) {
275 if (IpSb->LinkLocalOk) {
276 Status = Dhcp6->Start (Dhcp6);
278 IpSb->Dhcp6NeedStart =
TRUE;
286 InfoReqReXmit.
Irt = 4;
287 InfoReqReXmit.
Mrc = 64;
288 InfoReqReXmit.
Mrt = 60;
289 InfoReqReXmit.
Mrd = 0;
291 if (IpSb->LinkLocalOk) {
292 Status = Dhcp6->InfoRequest (
299 Instance->Dhcp6Event,
304 IpSb->Dhcp6NeedInfoRequest =
TRUE;
364 Status =
gRT->GetVariable (
366 &gEfiIp6ConfigProtocolGuid,
372 if (Status == EFI_BUFFER_TOO_SMALL) {
377 if (Variable ==
NULL) {
378 return EFI_OUT_OF_RESOURCES;
381 Status =
gRT->GetVariable (
383 &gEfiIp6ConfigProtocolGuid,
388 if (EFI_ERROR (Status) || ((UINT16)(~
NetblockChecksum ((UINT8 *)Variable, (UINT32)VarSize)) != 0)) {
398 Instance->IaId = Variable->IaId;
400 for (Index = 0; Index < Variable->DataRecordCount; Index++) {
401 CopyMem (&DataRecord, &Variable->DataRecord[Index], sizeof (DataRecord));
403 DataItem = &Instance->DataItem[DataRecord.DataType];
404 if (DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED) &&
405 (DataItem->DataSize != DataRecord.DataSize)
414 if (!DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED)) {
419 if (DataRecord.DataSize > VarSize - DataRecord.Offset) {
423 DataItem->Data.Ptr =
AllocatePool (DataRecord.DataSize);
424 if (DataItem->Data.Ptr ==
NULL) {
432 Data = (CHAR8 *)Variable + DataRecord.Offset;
433 CopyMem (DataItem->Data.Ptr, Data, DataRecord.DataSize);
435 DataItem->DataSize = DataRecord.DataSize;
449 if (Variable !=
NULL) {
459 &gEfiIp6ConfigProtocolGuid,
460 IP6_CONFIG_VARIABLE_ATTRIBUTE,
465 return EFI_NOT_FOUND;
495 DataItem = &Instance->DataItem[Index];
496 if (!DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_VOLATILE) && !EFI_ERROR (DataItem->Status)) {
502 if (Variable ==
NULL) {
503 return EFI_OUT_OF_RESOURCES;
506 Variable->IaId = Instance->IaId;
507 Heap = (CHAR8 *)Variable + VarSize;
508 Variable->DataRecordCount = 0;
511 DataItem = &Instance->DataItem[Index];
512 if (!DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_VOLATILE) && !EFI_ERROR (DataItem->Status)) {
513 Heap -= DataItem->DataSize;
514 CopyMem (Heap, DataItem->Data.Ptr, DataItem->DataSize);
516 DataRecord = &Variable->DataRecord[Variable->DataRecordCount];
518 DataRecord->DataSize = (UINT32)DataItem->DataSize;
519 DataRecord->Offset = (UINT16)(Heap - (CHAR8 *)Variable);
521 Variable->DataRecordCount++;
525 Variable->Checksum = 0;
526 Variable->Checksum = (UINT16) ~
NetblockChecksum ((UINT8 *)Variable, (UINT32)VarSize);
528 Status =
gRT->SetVariable (
530 &gEfiIp6ConfigProtocolGuid,
531 IP6_CONFIG_VARIABLE_ATTRIBUTE,
562 IN VOID *Data OPTIONAL
572 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
584 if (*DataSize < Length) {
586 return EFI_BUFFER_TOO_SMALL;
647 return EFI_BAD_BUFFER_SIZE;
651 OldIfId = DataItem->Data.AltIfId;
654 CopyMem (OldIfId, NewIfId, DataSize);
688 return EFI_BAD_BUFFER_SIZE;
694 return EFI_INVALID_PARAMETER;
697 if (NewPolicy == Instance->Policy) {
705 if (DataItem->Data.Ptr !=
NULL) {
709 DataItem->Data.Ptr =
NULL;
710 DataItem->DataSize = 0;
711 DataItem->Status = EFI_NOT_FOUND;
715 if (DataItem->Data.Ptr !=
NULL) {
719 DataItem->Data.Ptr =
NULL;
720 DataItem->DataSize = 0;
721 DataItem->Status = EFI_NOT_FOUND;
725 DataItem->Data.Ptr =
NULL;
726 DataItem->DataSize = 0;
727 DataItem->Status = EFI_NOT_FOUND;
735 if (Instance->Dhcp6Handle !=
NULL) {
740 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
743 Instance->Policy = NewPolicy;
775 return EFI_BAD_BUFFER_SIZE;
800 IN BOOLEAN IsDadPassed,
815 NET_CHECK_SIGNATURE (Instance, IP6_CONFIG_INSTANCE_SIGNATURE);
819 if (Item->DataSize == 0) {
827 ManualAddr = Item->Data.ManualAddress + Index;
828 if (EFI_IP6_EQUAL (TargetAddress, &ManualAddr->
Address)) {
848 if (DadFailCount != 0) {
855 if (Item->DataSize == 0) {
859 Item->Data.Ptr =
NULL;
860 Item->Status = EFI_NOT_FOUND;
867 ASSERT (PassedAddr !=
NULL);
869 Item->Data.Ptr = PassedAddr;
879 ASSERT ((
UINTN)PassedAddr - (
UINTN)Item->Data.Ptr == Item->DataSize);
903 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
940 UINTN NewAddressCount;
947 UINT32 CurrentSourceCount;
960 CurrentAddrInfo =
NULL;
974 return EFI_BAD_BUFFER_SIZE;
978 return EFI_WRITE_PROTECTED;
981 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
985 if ((Data !=
NULL) && (DataSize != 0)) {
989 for (Index1 = 0; Index1 < NewAddressCount; Index1++, NewAddress++) {
999 return EFI_INVALID_PARAMETER;
1002 TmpAddress = NewAddress + 1;
1003 for (Index2 = Index1 + 1; Index2 < NewAddressCount; Index2++, TmpAddress++) {
1007 if (EFI_IP6_EQUAL (&TmpAddress->
Address, &NewAddress->
Address)) {
1008 return EFI_INVALID_PARAMETER;
1017 CurrentSourceCount = 0;
1019 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
1020 IpIf = NET_LIST_USER_STRUCT_S (Entry,
IP6_INTERFACE, Link, IP6_INTERFACE_SIGNATURE);
1022 NET_LIST_FOR_EACH (Entry2, &IpIf->AddressList) {
1023 CurrentAddrInfo = NET_LIST_USER_STRUCT_S (Entry2,
IP6_ADDRESS_INFO, Link, IP6_ADDR_INFO_SIGNATURE);
1031 CurrentSourceCount++;
1039 if (NewAddress ==
NULL) {
1042 return EFI_OUT_OF_RESOURCES;
1049 if (DataItem->Data.Ptr !=
NULL) {
1053 DataItem->Data.Ptr = NewAddress;
1054 DataItem->DataSize = DataSize;
1055 DataItem->Status = EFI_NOT_READY;
1062 for (Index1 = 0; Index1 < NewAddressCount; Index1++, NewAddress++) {
1064 ASSERT (CurrentAddrInfo !=
NULL);
1072 &CurrentSourceCount,
1073 &CurrentAddrInfo->Address,
1082 NewAddress->
PrefixLength = CurrentAddrInfo->PrefixLength;
1088 if (NewAddress->
PrefixLength != CurrentAddrInfo->PrefixLength) {
1096 CurrentAddrInfo->PrefixLength,
1097 &CurrentAddrInfo->Address
1099 if (PrefixEntry !=
NULL) {
1106 CurrentAddrInfo->PrefixLength = NewAddress->
PrefixLength;
1119 if (PrefixEntry ==
NULL) {
1123 (UINT32)IP6_INFINIT_LIFETIME,
1124 (UINT32)IP6_INFINIT_LIFETIME,
1130 CurrentAddrInfo->IsAnycast = NewAddress->
IsAnycast;
1146 IpSb->DefaultInterface,
1150 (UINT32)IP6_INFINIT_LIFETIME,
1151 (UINT32)IP6_INFINIT_LIFETIME,
1162 IpIf = IpSb->DefaultInterface;
1167 CurrentAddrInfo = NET_LIST_HEAD (&CurrentSourceList,
IP6_ADDRESS_INFO, Link);
1176 &IpIf->AddressCount,
1177 &CurrentAddrInfo->Address,
1188 CurrentAddrInfo->PrefixLength,
1189 &CurrentAddrInfo->Address
1191 if (PrefixEntry !=
NULL) {
1200 if (DataItem->Status == EFI_NOT_READY) {
1206 Status = EFI_NOT_READY;
1215 Status = EFI_ABORTED;
1221 if (DataItem->Data.Ptr !=
NULL) {
1225 DataItem->Data.Ptr =
NULL;
1226 DataItem->DataSize = 0;
1227 DataItem->Status = EFI_NOT_FOUND;
1234 if (IpSb->LinkLocalOk) {
1238 (UINT32)IP6_INFINIT_LIFETIME,
1239 (UINT32)IP6_INFINIT_LIFETIME,
1240 IP6_LINK_LOCAL_PREFIX_LENGTH,
1241 &IpSb->LinkLocalAddr
1247 &IpSb->DefaultInterface->AddressList,
1248 &IpSb->DefaultInterface->AddressCount,
1253 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
1257 IpIf = NET_LIST_USER_STRUCT_S (Entry,
IP6_INTERFACE, Link, IP6_INTERFACE_SIGNATURE);
1259 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DelayJoinList) {
1267 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DupAddrDetectList) {
1268 DadEntry = NET_LIST_USER_STRUCT_S (Entry2,
IP6_DAD_ENTRY, Link, IP6_DAD_ENTRY_SIGNATURE);
1316 UINTN OldGatewayCount;
1317 UINTN NewGatewayCount;
1328 DefaultRouter =
NULL;
1334 return EFI_BAD_BUFFER_SIZE;
1338 return EFI_WRITE_PROTECTED;
1341 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
1343 OldGateway = Item->Data.Gateway;
1346 for (Index1 = 0; Index1 < OldGatewayCount; Index1++) {
1351 if (DefaultRouter !=
NULL) {
1357 if ((Data !=
NULL) && (DataSize != 0)) {
1360 for (Index1 = 0; Index1 < NewGatewayCount; Index1++) {
1362 return EFI_INVALID_PARAMETER;
1365 for (Index2 = Index1 + 1; Index2 < NewGatewayCount; Index2++) {
1366 if (EFI_IP6_EQUAL (NewGateway + Index1, NewGateway + Index2)) {
1367 return EFI_INVALID_PARAMETER;
1372 if (NewGatewayCount != OldGatewayCount) {
1375 return EFI_OUT_OF_RESOURCES;
1381 for (Index1 = 0; Index1 < NewGatewayCount; Index1++) {
1383 if (DefaultRouter ==
NULL) {
1389 if (!OneRemoved && !OneAdded) {
1394 if (Item->Data.Ptr !=
NULL) {
1398 Item->Data.Ptr = Tmp;
1401 CopyMem (Item->Data.Ptr, Data, DataSize);
1402 Item->DataSize = DataSize;
1410 if (Item->Data.Ptr !=
NULL) {
1414 Item->Data.Ptr =
NULL;
1416 Item->Status = EFI_NOT_FOUND;
1467 return EFI_BAD_BUFFER_SIZE;
1471 return EFI_WRITE_PROTECTED;
1476 if ((Data !=
NULL) && (DataSize != 0)) {
1478 OldDns = Item->Data.DnsServers;
1483 if (NewDnsCount != OldDnsCount) {
1486 return EFI_OUT_OF_RESOURCES;
1492 for (NewIndex = 0; NewIndex < NewDnsCount; NewIndex++) {
1501 return EFI_INVALID_PARAMETER;
1512 for (OldIndex = 0; OldIndex < OldDnsCount; OldIndex++) {
1513 if (EFI_IP6_EQUAL (NewDns + NewIndex, OldDns + OldIndex)) {
1521 if (OldIndex == OldDnsCount) {
1526 if (!OneAdded && (DataSize == Item->DataSize)) {
1534 if (Item->Data.Ptr !=
NULL) {
1538 Item->Data.Ptr = Tmp;
1541 CopyMem (Item->Data.Ptr, Data, DataSize);
1542 Item->DataSize = DataSize;
1549 if (Item->Data.Ptr !=
NULL) {
1553 Item->Data.Ptr =
NULL;
1555 Item->Status = EFI_NOT_FOUND;
1577 sizeof (IfInfo->Name),
1579 IpSb->Ip6ConfigInstance.IfIndex
1582 IfInfo->IfType = IpSb->SnpMode.IfType;
1583 IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
1584 CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress, IfInfo->HwAddressSize);
1622 Status = Dhcp6->Parse (Dhcp6, Reply, &OptCount,
NULL);
1623 if (Status != EFI_BUFFER_TOO_SMALL) {
1624 return EFI_NOT_READY;
1628 if (OptList ==
NULL) {
1629 return EFI_NOT_READY;
1632 Status = Dhcp6->Parse (Dhcp6, Reply, &OptCount, OptList);
1633 if (EFI_ERROR (Status)) {
1634 Status = EFI_NOT_READY;
1640 for (Index = 0; Index < OptCount; Index++) {
1646 CopyMem (&OpCode, &OptList[Index]->OpCode,
sizeof (OpCode));
1647 OpCode = NTOHS (OpCode);
1649 if (OpCode == DHCP6_OPT_DNS_SERVERS) {
1650 CopyMem (&Length, &OptList[Index]->OpLen,
sizeof (Length));
1651 Length = NTOHS (Length);
1657 Status = EFI_NOT_READY;
1667 Status = EFI_NOT_READY;
1676 if (Item->DataSize != Length) {
1677 if (Item->Data.Ptr !=
NULL) {
1682 ASSERT (Item->Data.Ptr !=
NULL);
1685 CopyMem (Item->Data.Ptr, OptList[Index]->
Data, Length);
1686 Item->DataSize = Length;
1716 IN BOOLEAN IsDadPassed,
1724 NET_CHECK_SIGNATURE (Instance, IP6_CONFIG_INSTANCE_SIGNATURE);
1733 if (Instance->FailedIaAddressCount > 0 ) {
1734 Instance->FailedIaAddressCount--;
1740 IP6_COPY_ADDRESS (Instance->DeclineAddress + Instance->DeclineAddressCount, TargetAddress);
1741 Instance->DeclineAddressCount++;
1744 if (Instance->FailedIaAddressCount == Instance->DeclineAddressCount) {
1748 if (Instance->DeclineAddressCount != 0) {
1752 if (Instance->Dhcp6 !=
NULL) {
1753 Instance->Dhcp6->Decline (
1755 Instance->DeclineAddressCount,
1756 Instance->DeclineAddress
1761 if (Instance->DeclineAddress !=
NULL) {
1762 FreePool (Instance->DeclineAddress);
1765 Instance->DeclineAddress =
NULL;
1766 Instance->DeclineAddressCount = 0;
1808 Dhcp6 = Instance->Dhcp6;
1810 Status = Dhcp6->GetModeData (Dhcp6, &Dhcp6ModeData,
NULL);
1811 if (EFI_ERROR (Status)) {
1815 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
1816 IpIf = IpSb->DefaultInterface;
1817 Ia = Dhcp6ModeData.
Ia;
1820 if (Instance->DeclineAddress !=
NULL) {
1821 FreePool (Instance->DeclineAddress);
1825 if (Instance->DeclineAddress ==
NULL) {
1830 Instance->DeclineAddressCount = 0;
1854 ASSERT (AddrInfo !=
NULL);
1858 &IpIf->AddressCount,
1860 AddrInfo->PrefixLength
1864 if (Instance->FailedIaAddressCount > 0) {
1865 Instance->FailedIaAddressCount--;
1997 if ((This ==
NULL) || ((Data ==
NULL) && (DataSize != 0)) || ((Data !=
NULL) && (DataSize == 0))) {
1998 return EFI_INVALID_PARAMETER;
2002 return EFI_UNSUPPORTED;
2005 Instance = IP6_CONFIG_INSTANCE_FROM_PROTOCOL (This);
2006 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
2007 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
2009 if (IpSb->LinkLocalDadFail) {
2010 return EFI_DEVICE_ERROR;
2013 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
2015 Status = Instance->DataItem[DataType].Status;
2016 if (Status != EFI_NOT_READY) {
2017 if (Instance->DataItem[DataType].SetData ==
NULL) {
2021 Status = EFI_WRITE_PROTECTED;
2023 Status = Instance->DataItem[DataType].SetData (Instance, DataSize, Data);
2024 if (!EFI_ERROR (Status)) {
2030 }
else if (Status == EFI_ABORTED) {
2043 Status = EFI_ACCESS_DENIED;
2046 gBS->RestoreTPL (OldTpl);
2095 IN VOID *Data OPTIONAL
2103 if ((This ==
NULL) || (DataSize ==
NULL) || ((*DataSize != 0) && (Data ==
NULL))) {
2104 return EFI_INVALID_PARAMETER;
2108 return EFI_NOT_FOUND;
2111 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
2113 Instance = IP6_CONFIG_INSTANCE_FROM_PROTOCOL (This);
2114 DataItem = &Instance->DataItem[DataType];
2116 Status = Instance->DataItem[DataType].Status;
2117 if (!EFI_ERROR (Status)) {
2118 if (DataItem->GetData !=
NULL) {
2119 Status = DataItem->GetData (Instance, DataSize, Data);
2120 }
else if (*DataSize < Instance->DataItem[DataType].DataSize) {
2124 *DataSize = Instance->DataItem[DataType].DataSize;
2125 Status = EFI_BUFFER_TOO_SMALL;
2127 *DataSize = Instance->DataItem[DataType].DataSize;
2128 CopyMem (Data, Instance->DataItem[DataType].Data.Ptr, *DataSize);
2132 gBS->RestoreTPL (OldTpl);
2173 if ((This ==
NULL) || (Event ==
NULL)) {
2174 return EFI_INVALID_PARAMETER;
2178 return EFI_UNSUPPORTED;
2181 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
2183 Instance = IP6_CONFIG_INSTANCE_FROM_PROTOCOL (This);
2184 EventMap = &Instance->DataItem[DataType].EventMap;
2193 if (EFI_ERROR (Status)) {
2194 Status = EFI_OUT_OF_RESOURCES;
2197 Status = EFI_ACCESS_DENIED;
2200 gBS->RestoreTPL (OldTpl);
2233 if ((This ==
NULL) || (Event ==
NULL)) {
2234 return EFI_INVALID_PARAMETER;
2238 return EFI_NOT_FOUND;
2241 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
2243 Instance = IP6_CONFIG_INSTANCE_FROM_PROTOCOL (This);
2245 Item =
NetMapFindKey (&Instance->DataItem[DataType].EventMap, Event);
2250 Status = EFI_NOT_FOUND;
2253 gBS->RestoreTPL (OldTpl);
2282 if (EFI_ERROR (Status)) {
2283 DEBUG ((DEBUG_ERROR,
"%a failed to generate random number: %r\n", __func__, Status));
2287 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
2289 Instance->Signature = IP6_CONFIG_INSTANCE_SIGNATURE;
2295 NET_LIST_FOR_EACH (Entry, &mIp6ConfigInstanceList) {
2296 TmpInstance = NET_LIST_USER_STRUCT_S (Entry,
IP6_CONFIG_INSTANCE, Link, IP6_CONFIG_INSTANCE_SIGNATURE);
2298 if (TmpInstance->IfIndex > IfIndex) {
2308 Instance->IfIndex = IfIndex;
2315 NetMapInit (&Instance->DataItem[Index].EventMap);
2330 DataItem->Data.Ptr = &Instance->InterfaceInfo;
2331 DataItem->DataSize =
sizeof (Instance->InterfaceInfo);
2332 SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED | DATA_ATTRIB_VOLATILE);
2337 DataItem->Data.Ptr = &Instance->AltIfId;
2338 DataItem->DataSize =
sizeof (Instance->AltIfId);
2339 DataItem->Status = EFI_NOT_FOUND;
2340 SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED);
2344 DataItem->Data.Ptr = &Instance->Policy;
2345 DataItem->DataSize =
sizeof (Instance->Policy);
2347 SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED);
2351 DataItem->Data.Ptr = &Instance->DadXmits;
2352 DataItem->DataSize =
sizeof (Instance->DadXmits);
2353 Instance->DadXmits.DupAddrDetectTransmits = IP6_CONFIG_DEFAULT_DAD_XMITS;
2354 SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED);
2358 DataItem->Status = EFI_NOT_FOUND;
2362 DataItem->Status = EFI_NOT_FOUND;
2366 DataItem->Status = EFI_NOT_FOUND;
2371 Status =
gBS->CreateEvent (
2376 &Instance->Dhcp6Event
2380 Instance->Configured =
TRUE;
2386 if (Status == EFI_NOT_FOUND) {
2391 Instance->IaId = Random;
2393 for (Index = 0; Index < IpSb->SnpMode.
HwAddressSize; Index++) {
2394 Instance->IaId |= (IpSb->SnpMode.
CurrentAddress.Addr[Index] << ((Index << 3) & 31));
2398 }
else if (EFI_ERROR (Status)) {
2427 if (Instance->DeclineAddress !=
NULL) {
2428 FreePool (Instance->DeclineAddress);
2431 if (!Instance->Configured) {
2435 if (Instance->Dhcp6Handle !=
NULL) {
2442 if (Instance->Dhcp6Event !=
NULL) {
2443 gBS->CloseEvent (Instance->Dhcp6Event);
2450 DataItem = &Instance->DataItem[Index];
2452 if (!DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED)) {
2453 if (DataItem->Data.Ptr !=
NULL) {
2457 DataItem->Data.Ptr =
NULL;
2458 DataItem->DataSize = 0;
2461 NetMapClean (&Instance->DataItem[Index].EventMap);
2487 Dhcp6 = Instance->Dhcp6;
2488 ASSERT (Dhcp6 !=
NULL);
2490 Dhcp6->Stop (Dhcp6);
2491 Dhcp6->Configure (Dhcp6,
NULL);
2492 Instance->Dhcp6 =
NULL;
2494 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
2499 Status =
gBS->CloseProtocol (
2500 Instance->Dhcp6Handle,
2501 &gEfiDhcp6ProtocolGuid,
2505 if (EFI_ERROR (Status)) {
2512 &gEfiDhcp6ServiceBindingProtocolGuid,
2513 Instance->Dhcp6Handle
2516 Instance->Dhcp6Handle =
NULL;
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define EFI_DHCP6_IA_TYPE_NA
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STATUS Ip6RemoveAddr(IN IP6_SERVICE *IpSb OPTIONAL, IN OUT LIST_ENTRY *AddressList, IN OUT UINT32 *AddressCount, IN EFI_IPv6_ADDRESS *Prefix OPTIONAL, IN UINT8 PrefixLength)
BOOLEAN Ip6IsOneOfSetAddress(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Address, OUT IP6_INTERFACE **Interface OPTIONAL, OUT IP6_ADDRESS_INFO **AddressInfo OPTIONAL)
EFI_STATUS Ip6BuildEfiAddressList(IN IP6_SERVICE *IpSb, OUT UINT32 *AddressCount, OUT EFI_IP6_ADDRESS_INFO **AddressList OPTIONAL)
@ Ip6ConfigDataTypeDupAddrDetectTransmits
@ Ip6ConfigDataTypeMaximum
@ Ip6ConfigDataTypeGateway
@ Ip6ConfigDataTypeAltInterfaceId
@ Ip6ConfigDataTypeManualAddress
@ Ip6ConfigDataTypeInterfaceInfo
@ Ip6ConfigDataTypePolicy
@ Ip6ConfigDataTypeDnsServer
@ Ip6ConfigPolicyAutomatic
EFI_STATUS Ip6ConfigSetManualAddress(IN IP6_CONFIG_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS Ip6ConfigSetPolicy(IN IP6_CONFIG_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
VOID Ip6ConfigInitIfInfo(IN IP6_SERVICE *IpSb, OUT EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo)
EFI_STATUS Ip6ConfigGetIfInfo(IN IP6_CONFIG_INSTANCE *Instance, IN OUT UINTN *DataSize, IN VOID *Data OPTIONAL)
EFI_STATUS Ip6ConfigSetDadXmits(IN IP6_CONFIG_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS Ip6ConfigSetAltIfId(IN IP6_CONFIG_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS EFIAPI EfiIp6ConfigSetData(IN EFI_IP6_CONFIG_PROTOCOL *This, IN EFI_IP6_CONFIG_DATA_TYPE DataType, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS Ip6ConfigSetGateway(IN IP6_CONFIG_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS EFIAPI Ip6ConfigOnDhcp6Reply(IN EFI_DHCP6_PROTOCOL *This, IN VOID *Context, IN EFI_DHCP6_PACKET *Packet)
EFI_STATUS Ip6ConfigParseDhcpReply(IN EFI_DHCP6_PROTOCOL *Dhcp6, IN OUT IP6_CONFIG_INSTANCE *Instance, IN EFI_DHCP6_PACKET *Reply)
EFI_STATUS EFIAPI EfiIp6ConfigRegisterDataNotify(IN EFI_IP6_CONFIG_PROTOCOL *This, IN EFI_IP6_CONFIG_DATA_TYPE DataType, IN EFI_EVENT Event)
EFI_STATUS Ip6ConfigSetDnsServer(IN IP6_CONFIG_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
VOID EFIAPI Ip6ConfigOnDhcp6SbInstalled(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI EfiIp6ConfigUnregisterDataNotify(IN EFI_IP6_CONFIG_PROTOCOL *This, IN EFI_IP6_CONFIG_DATA_TYPE DataType, IN EFI_EVENT Event)
EFI_STATUS EFIAPI EfiIp6ConfigGetData(IN EFI_IP6_CONFIG_PROTOCOL *This, IN EFI_IP6_CONFIG_DATA_TYPE DataType, IN OUT UINTN *DataSize, IN VOID *Data OPTIONAL)
VOID Ip6ConfigCleanInstance(IN OUT IP6_CONFIG_INSTANCE *Instance)
EFI_STATUS Ip6ConfigStartStatefulAutoConfig(IN IP6_CONFIG_INSTANCE *Instance, IN BOOLEAN OtherInfoOnly)
EFI_STATUS EFIAPI Ip6ConfigSignalEvent(IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Arg)
EFI_STATUS Ip6ConfigInitInstance(OUT IP6_CONFIG_INSTANCE *Instance)
EFI_STATUS Ip6ConfigDestroyDhcp6(IN OUT IP6_CONFIG_INSTANCE *Instance)
VOID EFIAPI Ip6ConfigOnDhcp6Event(IN EFI_EVENT Event, IN VOID *Context)
VOID Ip6ConfigOnPolicyChanged(IN IP6_SERVICE *IpSb, IN EFI_IP6_CONFIG_POLICY NewPolicy)
VOID Ip6ManualAddrDadCallback(IN BOOLEAN IsDadPassed, IN EFI_IPv6_ADDRESS *TargetAddress, IN VOID *Context)
EFI_STATUS Ip6ConfigWriteConfigData(IN CHAR16 *VarName, IN IP6_CONFIG_INSTANCE *Instance)
EFI_STATUS Ip6ConfigReadConfigData(IN CHAR16 *VarName, IN OUT IP6_CONFIG_INSTANCE *Instance)
VOID Ip6ConfigSetStatefulAddrCallback(IN BOOLEAN IsDadPassed, IN EFI_IPv6_ADDRESS *TargetAddress, IN VOID *Context)
EFI_STATUS Ip6ConfigFormInit(IN OUT IP6_CONFIG_INSTANCE *Instance)
VOID Ip6ConfigFormUnload(IN OUT IP6_CONFIG_INSTANCE *Instance)
EFI_STATUS Ip6SetAddress(IN IP6_INTERFACE *Interface, IN EFI_IPv6_ADDRESS *Ip6Addr, IN BOOLEAN IsAnycast, IN UINT8 PrefixLength, IN UINT32 ValidLifetime, IN UINT32 PreferredLifetime, IN IP6_DAD_CALLBACK DadCallback OPTIONAL, IN VOID *Context OPTIONAL)
IP6_DEFAULT_ROUTER * Ip6CreateDefaultRouter(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip6Address, IN UINT16 RouterLifetime)
VOID Ip6DestroyDefaultRouter(IN IP6_SERVICE *IpSb, IN IP6_DEFAULT_ROUTER *DefaultRouter)
VOID Ip6OnDADFinished(IN BOOLEAN IsDadPassed, IN IP6_INTERFACE *IpIf, IN IP6_DAD_ENTRY *DadEntry)
IP6_PREFIX_LIST_ENTRY * Ip6FindPrefixListEntry(IN IP6_SERVICE *IpSb, IN BOOLEAN OnLinkOrAuto, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *Prefix)
VOID Ip6CleanDefaultRouterList(IN IP6_SERVICE *IpSb)
VOID Ip6CleanPrefixListTable(IN IP6_SERVICE *IpSb, IN LIST_ENTRY *ListHead)
VOID Ip6DestroyPrefixListEntry(IN IP6_SERVICE *IpSb, IN IP6_PREFIX_LIST_ENTRY *PrefixEntry, IN BOOLEAN OnLinkOrAuto, IN BOOLEAN ImmediateDelete)
IP6_DEFAULT_ROUTER * Ip6FindDefaultRouter(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip6Address)
IP6_PREFIX_LIST_ENTRY * Ip6CreatePrefixListEntry(IN IP6_SERVICE *IpSb, IN BOOLEAN OnLinkOrAuto, IN UINT32 ValidLifetime, IN UINT32 PreferredLifetime, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *Prefix)
EFI_STATUS Ip6BuildEfiRouteTable(IN IP6_ROUTE_TABLE *RouteTable, OUT UINT32 *EfiRouteCount, OUT EFI_IP6_ROUTE_TABLE **EfiRouteTable OPTIONAL)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
EFI_RUNTIME_SERVICES * gRT
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
UINT16 EFIAPI NetblockChecksum(IN UINT8 *Bulk, IN UINT32 Len)
BOOLEAN EFIAPI NetIp6IsValidUnicast(IN EFI_IPv6_ADDRESS *Ip6)
VOID EFIAPI NetMapClean(IN OUT NET_MAP *Map)
EFI_STATUS EFIAPI NetLibCreateServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN OUT EFI_HANDLE *ChildHandle)
NET_MAP_ITEM *EFIAPI NetMapFindKey(IN NET_MAP *Map, IN VOID *Key)
BOOLEAN EFIAPI NetIp6IsLinkLocalAddr(IN EFI_IPv6_ADDRESS *Ip6)
EFI_STATUS EFIAPI NetLibDestroyServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN EFI_HANDLE ChildHandle)
VOID EFIAPI NetMapInit(IN OUT NET_MAP *Map)
BOOLEAN EFIAPI NetMapIsEmpty(IN NET_MAP *Map)
EFI_STATUS EFIAPI PseudoRandomU32(OUT UINT32 *Output)
VOID *EFIAPI NetMapRemoveItem(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, OUT VOID **Value OPTIONAL)
VOID *EFIAPI NetMapRemoveHead(IN OUT NET_MAP *Map, OUT VOID **Value OPTIONAL)
EFI_STATUS EFIAPI NetMapInsertTail(IN OUT NET_MAP *Map, IN VOID *Key, IN VOID *Value OPTIONAL)
EFI_STATUS EFIAPI NetMapIterate(IN NET_MAP *Map, IN NET_MAP_CALLBACK CallBack, IN VOID *Arg OPTIONAL)
VOID EFIAPI NetListInsertBefore(IN OUT LIST_ENTRY *PostEntry, IN OUT LIST_ENTRY *NewEntry)
UINTN EFIAPI NetMapGetCount(IN NET_MAP *Map)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
IPv6_ADDRESS EFI_IPv6_ADDRESS
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
BOOLEAN ReconfigureAccept
EFI_DHCP6_IA_DESCRIPTOR IaDescriptor
EFI_DHCP6_RETRANSMISSION * SolicitRetransmission
EFI_DHCP6_CALLBACK Dhcp6Callback
EFI_DHCP6_PACKET_OPTION ** OptionList
EFI_IPv6_ADDRESS IpAddress
UINT16 Type
Type for an IA.
UINT32 IaId
The identifier for an IA.
EFI_DHCP6_PACKET * ReplyPacket
EFI_DHCP6_IA_ADDRESS IaAddress[1]
EFI_DHCP6_DUID * ClientId
EFI_IPv6_ADDRESS StationAddress
UINT32 DupAddrDetectTransmits
The number of consecutive Neighbor Solicitation messages sent.
EFI_IP6_ROUTE_TABLE * RouteTable
EFI_IP6_ADDRESS_INFO * AddressInfo
UINT8 PrefixLength
The length, in bits, of the prefix associated with this Address.
EFI_IPv6_ADDRESS Address
The IPv6 unicast address.
BOOLEAN IsAnycast
Set to TRUE if Address is anycast.
EFI_MAC_ADDRESS CurrentAddress