31 if (EFI_ERROR (Status)) {
32 DEBUG ((DEBUG_ERROR,
"%a failed to generate random number: %r\n", __func__, Status));
36 Random = (Random / 4294967295UL) * IP6_RANDOM_FACTOR_SCALE;
37 Random = Random + IP6_MIN_RANDOM_FACTOR_SCALED;
38 IpSb->ReachableTime = (IpSb->BaseReachableTime * Random) / IP6_RANDOM_FACTOR_SCALE;
58 OUT UINT32 *NeighborCount,
69 NET_CHECK_SIGNATURE (IpInstance, IP6_PROTOCOL_SIGNATURE);
70 ASSERT (NeighborCount !=
NULL && NeighborCache !=
NULL);
72 IpSb = IpInstance->Service;
75 NET_LIST_FOR_EACH (Entry, &IpSb->NeighborTable) {
84 if (NeighborCacheTmp ==
NULL) {
85 return EFI_OUT_OF_RESOURCES;
88 *NeighborCount = Count;
91 NET_LIST_FOR_EACH (Entry, &IpSb->NeighborTable) {
94 EfiNeighborCache = NeighborCacheTmp + Count;
96 EfiNeighborCache->
State = Neighbor->State;
97 IP6_COPY_ADDRESS (&EfiNeighborCache->
Neighbor, &Neighbor->Neighbor);
98 IP6_COPY_LINK_ADDRESS (&EfiNeighborCache->
LinkAddress, &Neighbor->LinkAddress);
103 ASSERT (*NeighborCount == Count);
104 *NeighborCache = NeighborCacheTmp;
124 OUT UINT32 *PrefixCount,
135 NET_CHECK_SIGNATURE (IpInstance, IP6_PROTOCOL_SIGNATURE);
136 ASSERT (PrefixCount !=
NULL && PrefixTable !=
NULL);
138 IpSb = IpInstance->Service;
141 NET_LIST_FOR_EACH (Entry, &IpSb->OnlinkPrefix) {
150 if (PrefixTableTmp ==
NULL) {
151 return EFI_OUT_OF_RESOURCES;
154 *PrefixCount = Count;
157 NET_LIST_FOR_EACH (Entry, &IpSb->OnlinkPrefix) {
159 EfiPrefix = PrefixTableTmp + Count;
160 IP6_COPY_ADDRESS (&EfiPrefix->
Address, &PrefixList->Prefix);
166 ASSERT (*PrefixCount == Count);
167 *PrefixTable = PrefixTableTmp;
193 IN BOOLEAN OnLinkOrAuto,
194 IN UINT32 ValidLifetime,
195 IN UINT32 PreferredLifetime,
196 IN UINT8 PrefixLength,
206 if ((Prefix ==
NULL) || (PreferredLifetime > ValidLifetime) || (PrefixLength > IP6_PREFIX_MAX)) {
210 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
218 if (PrefixEntry !=
NULL) {
219 PrefixEntry->RefCnt++;
224 if (PrefixEntry ==
NULL) {
228 PrefixEntry->RefCnt = 1;
229 PrefixEntry->ValidLifetime = ValidLifetime;
230 PrefixEntry->PreferredLifetime = PreferredLifetime;
231 PrefixEntry->PrefixLength = PrefixLength;
232 IP6_COPY_ADDRESS (&PrefixEntry->Prefix, Prefix);
234 ListHead = OnLinkOrAuto ? &IpSb->OnlinkPrefix : &IpSb->AutonomousPrefix;
241 if (RtEntry ==
NULL) {
246 RtEntry->Flag = IP6_DIRECT_ROUTE;
247 InsertHeadList (&IpSb->RouteTable->RouteArea[PrefixLength], &RtEntry->Link);
248 IpSb->RouteTable->TotalNum++;
255 NET_LIST_FOR_EACH (Entry, ListHead) {
258 if (TmpPrefixEntry->PrefixLength < PrefixEntry->PrefixLength) {
284 IN BOOLEAN OnLinkOrAuto,
285 IN BOOLEAN ImmediateDelete
292 if ((!ImmediateDelete) && (PrefixEntry->RefCnt > 0) && ((--PrefixEntry->RefCnt) > 0)) {
303 &PrefixEntry->Prefix,
304 PrefixEntry->PrefixLength,
307 }
while (Status != EFI_NOT_FOUND);
312 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
313 IpIf = NET_LIST_USER_STRUCT_S (Entry,
IP6_INTERFACE, Link, IP6_INTERFACE_SIGNATURE);
315 Ip6RemoveAddr (IpSb, &IpIf->AddressList, &IpIf->AddressCount, &PrefixEntry->Prefix, PrefixEntry->PrefixLength);
339 IN BOOLEAN OnLinkOrAuto,
340 IN UINT8 PrefixLength,
348 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
349 ASSERT (Prefix !=
NULL);
352 ListHead = &IpSb->OnlinkPrefix;
354 ListHead = &IpSb->AutonomousPrefix;
357 NET_LIST_FOR_EACH (Entry, ListHead) {
359 if (PrefixLength != 255) {
363 if ((PrefixList->PrefixLength == PrefixLength) &&
373 if (
NetIp6IsNetEqual (&PrefixList->Prefix, Prefix, PrefixList->PrefixLength)) {
399 OnLink = (BOOLEAN)(ListHead == &IpSb->OnlinkPrefix);
429 if ((ArpQue ==
NULL) || (ArpQue->Interface ==
NULL)) {
433 IpSb = ArpQue->Interface->Service;
434 if ((IpSb ==
NULL) || (IpSb->Signature != IP6_SERVICE_SIGNATURE)) {
443 if (NET_MAC_EQUAL (&ArpQue->LinkAddress, &mZeroMacAddress, IpSb->SnpMode.
HwAddressSize)) {
452 NET_LIST_FOR_EACH_SAFE (Entry, Next, &ArpQue->Frames) {
456 IP6_COPY_LINK_ADDRESS (&Token->DstMac, &ArpQue->LinkAddress);
467 Status = IpSb->Mnp->Transmit (IpSb->Mnp, &Token->MnpToken);
468 if (EFI_ERROR (Status)) {
470 Token->CallBack (Token->Packet, Status, 0, Token->Context);
486 ArpQue->Ticks = (UINT32)IP6_GET_TICKS (IP6_DELAY_FIRST_PROBE_TIME);
507 IN IP6_ARP_CALLBACK CallBack,
515 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
516 ASSERT (Ip6Address !=
NULL);
524 Entry->IsRouter =
FALSE;
525 Entry->ArpFree =
FALSE;
526 Entry->Dynamic =
FALSE;
528 Entry->Transmit = IP6_MAX_MULTICAST_SOLICIT + 1;
529 Entry->CallBack = CallBack;
530 Entry->Interface =
NULL;
534 IP6_COPY_ADDRESS (&Entry->Neighbor, Ip6Address);
536 if (LinkAddress !=
NULL) {
537 IP6_COPY_LINK_ADDRESS (&Entry->LinkAddress, LinkAddress);
539 IP6_COPY_LINK_ADDRESS (&Entry->LinkAddress, &mZeroMacAddress);
548 if (DefaultRouter !=
NULL) {
549 DefaultRouter->NeighborCache = Entry;
575 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
576 ASSERT (Ip6Address !=
NULL);
578 NET_LIST_FOR_EACH_SAFE (Entry, Next, &IpSb->NeighborTable) {
580 if (EFI_IP6_EQUAL (Ip6Address, &Neighbor->Neighbor)) {
616 IN BOOLEAN SendIcmpError,
619 IN IP6_FRAME_TO_CANCEL FrameToCancel OPTIONAL,
620 IN VOID *Context OPTIONAL
632 if (FullFree && (FrameToCancel !=
NULL)) {
633 return EFI_INVALID_PARAMETER;
636 NET_LIST_FOR_EACH_SAFE (Entry, Next, &NeighborCache->Frames) {
639 if (SendIcmpError && !IP6_IS_MULTICAST (&TxToken->Packet->Ip.Ip6->DestinationAddress)) {
644 &TxToken->Packet->Ip.Ip6->SourceAddress,
646 ICMP_V6_ADDR_UNREACHABLE,
651 if ((FrameToCancel ==
NULL) || FrameToCancel (TxToken, Context)) {
653 TxToken->CallBack (TxToken->Packet, IoStatus, 0, TxToken->Context);
658 if (NeighborCache->ArpFree &&
IsListEmpty (&NeighborCache->Frames)) {
660 NeighborCache->ArpFree =
FALSE;
664 if (NeighborCache->IsRouter) {
666 if (DefaultRouter !=
NULL) {
694 IN UINT16 RouterLifetime
700 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
701 ASSERT (Ip6Address !=
NULL);
709 Entry->Lifetime = RouterLifetime;
711 IP6_COPY_ADDRESS (&Entry->Router, Ip6Address);
717 if (RtEntry ==
NULL) {
723 IpSb->RouteTable->TotalNum++;
752 Status =
Ip6DelRoute (IpSb->RouteTable,
NULL, 0, &DefaultRouter->Router);
753 }
while (Status != EFI_NOT_FOUND);
796 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
797 ASSERT (Ip6Address !=
NULL);
799 NET_LIST_FOR_EACH (Entry, &IpSb->DefaultRouterList) {
801 if (EFI_IP6_EQUAL (Ip6Address, &DefaultRouter->Router)) {
802 return DefaultRouter;
819 IN BOOLEAN IsDadPassed,
832 IpSb = IpIf->Service;
833 AddrInfo = DadEntry->AddressInfo;
840 ASSERT (!IpSb->LinkLocalOk);
842 IP6_COPY_ADDRESS (&IpSb->LinkLocalAddr, &AddrInfo->Address);
843 IpSb->LinkLocalOk =
TRUE;
844 IpIf->Configured =
TRUE;
849 Dhcp6 = IpSb->Ip6ConfigInstance.Dhcp6;
851 if (IpSb->Dhcp6NeedStart) {
852 Dhcp6->Start (Dhcp6);
853 IpSb->Dhcp6NeedStart =
FALSE;
856 if (IpSb->Dhcp6NeedInfoRequest) {
862 Oro->
OpCode = HTONS (DHCP6_OPT_ORO);
863 Oro->
OpLen = HTONS (2);
864 *((UINT16 *)&Oro->
Data[0]) = HTONS (DHCP6_OPT_DNS_SERVERS);
866 InfoReqReXmit.
Irt = 4;
867 InfoReqReXmit.
Mrc = 64;
868 InfoReqReXmit.
Mrt = 60;
869 InfoReqReXmit.
Mrd = 0;
878 IpSb->Ip6ConfigInstance.Dhcp6Event,
880 &IpSb->Ip6ConfigInstance
890 (UINT32)IP6_INFINIT_LIFETIME,
891 (UINT32)IP6_INFINIT_LIFETIME,
892 IP6_LINK_LOCAL_PREFIX_LENGTH,
907 AddrInfo->ValidLifetime,
908 AddrInfo->PreferredLifetime,
909 AddrInfo->PrefixLength,
913 IpIf->Configured =
TRUE;
922 if (DadEntry->Callback !=
NULL) {
923 DadEntry->Callback (IsDadPassed, &AddrInfo->Address, DadEntry->Context);
938 IpSb->LinkLocalDadFail =
TRUE;
939 IpSb->Mnp->Configure (IpSb->Mnp,
NULL);
977 IN IP6_DAD_CALLBACK Callback OPTIONAL,
978 IN VOID *Context OPTIONAL
988 NET_CHECK_SIGNATURE (IpIf, IP6_INTERFACE_SIGNATURE);
989 ASSERT (AddressInfo !=
NULL);
992 if (EFI_ERROR (Status)) {
993 DEBUG ((DEBUG_ERROR,
"%a failed to generate random number: %r\n", __func__, Status));
1005 IpSb = IpIf->Service;
1006 DadXmits = &IpSb->Ip6ConfigInstance.DadXmits;
1012 if (Entry ==
NULL) {
1013 return EFI_OUT_OF_RESOURCES;
1024 Status =
Ip6JoinGroup (IpSb, IpIf, &Entry->Destination);
1025 if (EFI_ERROR (Status)) {
1030 Entry->Signature = IP6_DAD_ENTRY_SIGNATURE;
1032 Entry->Transmit = 0;
1035 Entry->RetransTick = (MaxDelayTick * ((Random % 5) + 1)) / 5;
1036 Entry->AddressInfo = AddressInfo;
1037 Entry->Callback = Callback;
1038 Entry->Context = Context;
1041 if (Entry->MaxTransmit == 0) {
1076 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
1079 NET_LIST_FOR_EACH (Entry2, &IpIf->DupAddrDetectList) {
1080 DupAddrDetect = NET_LIST_USER_STRUCT_S (Entry2,
IP6_DAD_ENTRY, Link, IP6_DAD_ENTRY_SIGNATURE);
1081 AddrInfo = DupAddrDetect->AddressInfo;
1082 if (EFI_IP6_EQUAL (&AddrInfo->Address, Target)) {
1083 if (Interface !=
NULL) {
1087 return DupAddrDetect;
1129 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
1132 if ((IpIf ==
NULL) && (IpSb->DefaultInterface !=
NULL)) {
1133 IpIf = IpSb->DefaultInterface;
1141 if (SourceLinkAddress !=
NULL) {
1146 if (Packet ==
NULL) {
1147 return EFI_OUT_OF_RESOURCES;
1153 Head.FlowLabelL = 0;
1154 Head.FlowLabelH = 0;
1155 Head.PayloadLength = HTONS (PayloadLen);
1156 Head.NextHeader = IP6_ICMP;
1157 Head.HopLimit = IP6_HOP_LIMIT;
1159 if (SourceAddress !=
NULL) {
1160 IP6_COPY_ADDRESS (&Head.SourceAddress, SourceAddress);
1165 if (DestinationAddress !=
NULL) {
1166 IP6_COPY_ADDRESS (&Head.DestinationAddress, DestinationAddress);
1178 ASSERT (IcmpHead !=
NULL);
1180 IcmpHead->Head.Type = ICMP_V6_ROUTER_SOLICIT;
1181 IcmpHead->Head.Code = 0;
1183 LinkLayerOption =
NULL;
1184 if (SourceLinkAddress !=
NULL) {
1190 ASSERT (LinkLayerOption !=
NULL);
1191 LinkLayerOption->Type = Ip6OptionEtherSource;
1193 CopyMem (LinkLayerOption->EtherAddr, SourceLinkAddress, 6);
1231 IN BOOLEAN IsRouter,
1232 IN BOOLEAN Override,
1233 IN BOOLEAN Solicited
1243 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
1251 ASSERT (DestinationAddress !=
NULL && TargetIp6Address !=
NULL && TargetLinkAddress !=
NULL);
1260 if (Packet ==
NULL) {
1261 return EFI_OUT_OF_RESOURCES;
1267 Head.FlowLabelL = 0;
1268 Head.FlowLabelH = 0;
1269 Head.PayloadLength = HTONS (PayloadLen);
1270 Head.NextHeader = IP6_ICMP;
1271 Head.HopLimit = IP6_HOP_LIMIT;
1273 IP6_COPY_ADDRESS (&Head.SourceAddress, SourceAddress);
1274 IP6_COPY_ADDRESS (&Head.DestinationAddress, DestinationAddress);
1284 ASSERT (IcmpHead !=
NULL);
1286 IcmpHead->Head.Type = ICMP_V6_NEIGHBOR_ADVERTISE;
1287 IcmpHead->Head.Code = 0;
1290 IcmpHead->Fourth |= IP6_IS_ROUTER_FLAG;
1294 IcmpHead->Fourth |= IP6_SOLICITED_FLAG;
1298 IcmpHead->Fourth |= IP6_OVERRIDE_FLAG;
1302 ASSERT (Target !=
NULL);
1303 IP6_COPY_ADDRESS (Target, TargetIp6Address);
1310 ASSERT (LinkLayerOption !=
NULL);
1311 LinkLayerOption->Type = Ip6OptionEtherTarget;
1312 LinkLayerOption->Length = 1;
1313 CopyMem (LinkLayerOption->EtherAddr, TargetLinkAddress, 6);
1360 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
1361 if ((DestinationAddress ==
NULL) || (TargetIp6Address ==
NULL)) {
1362 return EFI_INVALID_PARAMETER;
1379 if (SourceLinkAddress ==
NULL) {
1380 return EFI_INVALID_PARAMETER;
1391 if (Packet ==
NULL) {
1392 return EFI_OUT_OF_RESOURCES;
1398 Head.FlowLabelL = 0;
1399 Head.FlowLabelH = 0;
1400 Head.PayloadLength = HTONS (PayloadLen);
1401 Head.NextHeader = IP6_ICMP;
1402 Head.HopLimit = IP6_HOP_LIMIT;
1404 if (SourceAddress !=
NULL) {
1405 IP6_COPY_ADDRESS (&Head.SourceAddress, SourceAddress);
1410 IP6_COPY_ADDRESS (&Head.DestinationAddress, DestinationAddress);
1418 ASSERT (IcmpHead !=
NULL);
1420 IcmpHead->Head.Type = ICMP_V6_NEIGHBOR_SOLICIT;
1421 IcmpHead->Head.Code = 0;
1424 ASSERT (Target !=
NULL);
1425 IP6_COPY_ADDRESS (Target, TargetIp6Address);
1427 LinkLayerOption =
NULL;
1437 ASSERT (LinkLayerOption !=
NULL);
1438 LinkLayerOption->Type = Ip6OptionEtherSource;
1439 LinkLayerOption->Length = 1;
1440 CopyMem (LinkLayerOption->EtherAddr, SourceLinkAddress, 6);
1449 if (Neighbor ==
NULL) {
1451 ASSERT (Neighbor !=
NULL);
1487 BOOLEAN IsMaintained;
1492 BOOLEAN UpdateCache;
1500 NetbufCopy (Packet, 0,
sizeof (Icmp), (UINT8 *)&Icmp);
1501 NetbufCopy (Packet,
sizeof (Icmp),
sizeof (Target), Target.Addr);
1510 Status = EFI_INVALID_PARAMETER;
1512 if ((Head->HopLimit != IP6_HOP_LIMIT) || (Icmp.Head.Code != 0) || !
NetIp6IsValidUnicast (&Target)) {
1520 if (Head->PayloadLength < IP6_ND_LENGTH) {
1523 OptionLen = (UINT16)(Head->PayloadLength - IP6_ND_LENGTH);
1524 if (OptionLen != 0) {
1526 ASSERT (Option !=
NULL);
1547 (UINT8 *)&LinkLayerOption
1553 if (LinkLayerOption.Type == Ip6OptionEtherSource) {
1570 if (IsDAD && IsUnicast) {
1579 if (!IsDAD && !IsMaintained) {
1587 if (IsUnicast && !IsMaintained) {
1595 if (IsDAD && !IsMaintained) {
1597 if (DupAddrDetect !=
NULL) {
1601 if (IpSb->RecvRequest.MnpToken.Packet.RxData ==
NULL) {
1605 MacAddress = IpSb->RecvRequest.MnpToken.Packet.RxData->SourceAddress;
1606 if (MacAddress !=
NULL) {
1609 &IpSb->SnpMode.CurrentAddress,
1610 IpSb->SnpMode.HwAddressSize
1618 Status = EFI_ICMP_ERROR;
1623 DupAddrDetect->Receive++;
1638 UpdateCache =
FALSE;
1640 if (Neighbor ==
NULL) {
1642 if (Neighbor ==
NULL) {
1643 Status = EFI_OUT_OF_RESOURCES;
1649 if (
CompareMem (Neighbor->LinkAddress.Addr, LinkLayerOption.EtherAddr, 6) != 0) {
1656 Neighbor->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
1657 CopyMem (Neighbor->LinkAddress.Addr, LinkLayerOption.EtherAddr, 6);
1661 Neighbor->CallBack ((VOID *)Neighbor);
1671 if (IsDAD && IsMaintained) {
1676 IP6_COPY_ADDRESS (&Dest, &Head->SourceAddress);
1684 &IpSb->SnpMode.CurrentAddress,
1730 NetbufCopy (Packet, 0,
sizeof (Icmp), (UINT8 *)&Icmp);
1731 NetbufCopy (Packet,
sizeof (Icmp),
sizeof (Target), Target.Addr);
1736 Status = EFI_INVALID_PARAMETER;
1743 if ((Head->HopLimit != IP6_HOP_LIMIT) || (Icmp.Head.Code != 0) || !
NetIp6IsValidUnicast (&Target)) {
1752 if (Head->PayloadLength < IP6_ND_LENGTH) {
1755 OptionLen = (UINT16)(Head->PayloadLength - IP6_ND_LENGTH);
1756 if (OptionLen != 0) {
1758 ASSERT (Option !=
NULL);
1773 if ((Icmp.Fourth & IP6_SOLICITED_FLAG) == IP6_SOLICITED_FLAG) {
1777 if (IP6_IS_MULTICAST (&Head->DestinationAddress) && Solicited) {
1785 if (DupAddrDetect !=
NULL) {
1791 return EFI_ICMP_ERROR;
1799 if (Neighbor ==
NULL) {
1808 if ((Icmp.Fourth & IP6_IS_ROUTER_FLAG) == IP6_IS_ROUTER_FLAG) {
1812 if ((Icmp.Fourth & IP6_OVERRIDE_FLAG) == IP6_OVERRIDE_FLAG) {
1824 (UINT8 *)&LinkLayerOption
1827 if (LinkLayerOption.Type == Ip6OptionEtherTarget) {
1834 Compare =
CompareMem (Neighbor->LinkAddress.Addr, LinkLayerOption.EtherAddr, 6);
1837 if (!Neighbor->IsRouter && IsRouter) {
1839 if (DefaultRouter !=
NULL) {
1840 DefaultRouter->NeighborCache = Neighbor;
1857 CopyMem (Neighbor->LinkAddress.Addr, LinkLayerOption.EtherAddr, 6);
1860 Neighbor->Ticks = IP6_GET_TICKS (IpSb->ReachableTime);
1863 Neighbor->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
1867 Neighbor->CallBack ((VOID *)Neighbor);
1870 Neighbor->IsRouter = IsRouter;
1872 if (!Override && (Compare != 0)) {
1881 Neighbor->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
1885 CopyMem (Neighbor->LinkAddress.Addr, LinkLayerOption.EtherAddr, 6);
1893 Neighbor->Ticks = IP6_GET_TICKS (IpSb->ReachableTime);
1897 Neighbor->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
1906 if (Neighbor->IsRouter && !IsRouter) {
1908 if (DefaultRouter !=
NULL) {
1913 Neighbor->IsRouter = IsRouter;
1918 Neighbor->CallBack ((VOID *)Neighbor);
1950 UINT32 ReachableTime;
1951 UINT32 RetransTimer;
1952 UINT16 RouterLifetime;
1975 Status = EFI_INVALID_PARAMETER;
1984 NetbufCopy (Packet, 0,
sizeof (Icmp), (UINT8 *)&Icmp);
2003 if ((Head->HopLimit != IP6_HOP_LIMIT) || (Icmp.Head.Code != 0) ||
2004 (Head->PayloadLength < IP6_RA_LENGTH))
2012 OptionLen = (UINT16)(Head->PayloadLength - IP6_RA_LENGTH);
2013 if (OptionLen != 0) {
2015 ASSERT (Option !=
NULL);
2028 Fourth = NTOHL (Icmp.Fourth);
2029 CopyMem (&RouterLifetime, &Fourth,
sizeof (UINT16));
2037 if (DefaultRouter ==
NULL) {
2038 if (RouterLifetime != 0) {
2040 if (DefaultRouter ==
NULL) {
2041 Status = EFI_OUT_OF_RESOURCES;
2046 if (RouterLifetime != 0) {
2047 DefaultRouter->Lifetime = RouterLifetime;
2051 if (DefaultRouter->NeighborCache ==
NULL) {
2063 CurHopLimit = *((UINT8 *)&Fourth + 3);
2064 if (CurHopLimit != 0) {
2065 IpSb->CurHopLimit = CurHopLimit;
2070 if ((*((UINT8 *)&Fourth + 2) & IP6_M_ADDR_CONFIG_FLAG) == IP6_M_ADDR_CONFIG_FLAG) {
2073 if ((*((UINT8 *)&Fourth + 2) & IP6_O_CONFIG_FLAG) == IP6_O_CONFIG_FLAG) {
2078 if (Mflag || Oflag) {
2088 NetbufCopy (Packet,
sizeof (Icmp),
sizeof (UINT32), (UINT8 *)&ReachableTime);
2089 NetbufCopy (Packet,
sizeof (Icmp) +
sizeof (UINT32),
sizeof (UINT32), (UINT8 *)&RetransTimer);
2090 ReachableTime = NTOHL (ReachableTime);
2091 RetransTimer = NTOHL (RetransTimer);
2093 if ((ReachableTime != 0) && (ReachableTime != IpSb->BaseReachableTime)) {
2098 IpSb->BaseReachableTime = ReachableTime;
2100 if (EFI_ERROR (Status)) {
2105 if (RetransTimer != 0) {
2106 IpSb->RetransTimer = RetransTimer;
2113 if (NeighborCache !=
NULL) {
2114 NeighborCache->IsRouter =
TRUE;
2120 IpSb->RouterAdvertiseReceived =
TRUE;
2129 while (Offset < (UINT32)Head->PayloadLength) {
2130 NetbufCopy (Packet, Offset,
sizeof (UINT8), &Type);
2132 case Ip6OptionEtherSource:
2141 ASSERT (LinkLayerOption.Length != 0);
2142 ASSERT (Offset + (UINT32)LinkLayerOption.Length * 8 <= (UINT32)Head->PayloadLength);
2145 CopyMem (&LinkLayerAddress, LinkLayerOption.EtherAddr, 6);
2147 if (NeighborCache ==
NULL) {
2151 &Head->SourceAddress,
2154 if (NeighborCache ==
NULL) {
2155 Status = EFI_OUT_OF_RESOURCES;
2159 NeighborCache->IsRouter =
TRUE;
2161 NeighborCache->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
2163 Result =
CompareMem (&LinkLayerAddress, &NeighborCache->LinkAddress, 6);
2171 CopyMem (&NeighborCache->LinkAddress, &LinkLayerAddress, 6);
2173 NeighborCache->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
2180 NeighborCache->CallBack ((VOID *)NeighborCache);
2187 Offset += (UINT32)LinkLayerOption.Length * 8;
2189 case Ip6OptionPrefixInfo:
2195 ASSERT (PrefixOption.Length == 4);
2196 ASSERT (Offset + (UINT32)PrefixOption.Length * 8 <= (UINT32)Head->PayloadLength);
2198 PrefixOption.ValidLifetime = NTOHL (PrefixOption.ValidLifetime);
2199 PrefixOption.PreferredLifetime = NTOHL (PrefixOption.PreferredLifetime);
2205 if ((PrefixOption.Reserved1 & IP6_ON_LINK_FLAG) == IP6_ON_LINK_FLAG) {
2210 if ((PrefixOption.Reserved1 & IP6_AUTO_CONFIG_FLAG) == IP6_AUTO_CONFIG_FLAG) {
2217 if ((PrefixOption.PrefixLength == IP6_LINK_LOCAL_PREFIX_LENGTH) &&
2232 PrefixOption.PrefixLength,
2233 &PrefixOption.Prefix
2239 if ((PrefixList ==
NULL) && (PrefixOption.ValidLifetime != 0)) {
2243 PrefixOption.ValidLifetime,
2244 PrefixOption.PreferredLifetime,
2245 PrefixOption.PrefixLength,
2246 &PrefixOption.Prefix
2248 if (PrefixList ==
NULL) {
2249 Status = EFI_OUT_OF_RESOURCES;
2252 }
else if (PrefixList !=
NULL) {
2253 if (PrefixOption.ValidLifetime != 0) {
2254 PrefixList->ValidLifetime = PrefixOption.ValidLifetime;
2267 if (Autonomous && (PrefixOption.PreferredLifetime <= PrefixOption.ValidLifetime)) {
2271 PrefixOption.PrefixLength,
2272 &PrefixOption.Prefix
2279 if ((PrefixList ==
NULL) &&
2280 (PrefixOption.ValidLifetime != 0) &&
2281 (PrefixOption.PrefixLength + IpSb->InterfaceIdLen * 8 == 128)
2287 CopyMem (&StatelessAddress, &PrefixOption.Prefix, sizeof (UINT64));
2288 CopyMem (&StatelessAddress.Addr[8], IpSb->InterfaceId, sizeof (UINT64));
2299 IpSb->DefaultInterface,
2302 PrefixOption.PrefixLength,
2303 PrefixOption.ValidLifetime,
2304 PrefixOption.PreferredLifetime,
2308 if (EFI_ERROR (Status)) {
2320 PrefixOption.ValidLifetime,
2321 PrefixOption.PreferredLifetime,
2322 PrefixOption.PrefixLength,
2323 &PrefixOption.Prefix
2325 if (PrefixList ==
NULL) {
2326 Status = EFI_OUT_OF_RESOURCES;
2329 }
else if (PrefixList !=
NULL) {
2334 PrefixList->PreferredLifetime = PrefixOption.PreferredLifetime;
2335 if ((PrefixOption.ValidLifetime > 7200) ||
2336 (PrefixOption.ValidLifetime > PrefixList->ValidLifetime))
2343 PrefixList->ValidLifetime = PrefixOption.ValidLifetime;
2344 }
else if (PrefixList->ValidLifetime <= 7200) {
2355 PrefixList->ValidLifetime = 7200;
2368 ASSERT (MTUOption.Length == 1);
2369 ASSERT (Offset + (UINT32)MTUOption.Length * 8 <= (UINT32)Head->PayloadLength);
2383 NetbufCopy (Packet, Offset +
sizeof (UINT8),
sizeof (UINT8), &Length);
2385 ASSERT (Length != 0);
2387 Offset += (UINT32)Length * 8;
2439 Status = EFI_INVALID_PARAMETER;
2456 if ((Head->HopLimit != IP6_HOP_LIMIT) || (Icmp->Head.Code != 0) ||
2457 (Head->PayloadLength < IP6_REDITECT_LENGTH))
2479 OptionLen = (UINT16)(Head->PayloadLength - IP6_REDITECT_LENGTH);
2480 if (OptionLen != 0) {
2482 ASSERT (Option !=
NULL);
2490 IcmpDest = Target + 1;
2496 if (IP6_IS_MULTICAST (IcmpDest)) {
2505 IsRouter = (BOOLEAN) !EFI_IP6_EQUAL (Target, IcmpDest);
2514 Length = Packet->TotalSize - 40;
2515 Option = (UINT8 *)(IcmpDest + 1);
2516 LinkLayerOption =
NULL;
2517 while (Length > 0) {
2519 case Ip6OptionEtherTarget:
2522 OptLen = LinkLayerOption->Length;
2534 OptLen = *(Option + 1);
2545 Length -= 8 * OptLen;
2546 Option += 8 * OptLen;
2557 RouteCache =
Ip6FindRouteCache (IpSb->RouteTable, IcmpDest, &Head->DestinationAddress);
2558 if (RouteCache !=
NULL) {
2559 if (!EFI_IP6_EQUAL (&RouteCache->NextHop, &Head->SourceAddress)) {
2570 IP6_COPY_ADDRESS (&RouteCache->NextHop, Target);
2574 RouteEntry->Flag = RouteEntry->Flag | IP6_DIRECT_ROUTE;
2581 if (RouteEntry ==
NULL) {
2583 if (RouteEntry ==
NULL) {
2584 Status = EFI_OUT_OF_RESOURCES;
2590 RouteEntry->Flag = IP6_DIRECT_ROUTE;
2598 &Head->DestinationAddress,
2602 if (RouteCache ==
NULL) {
2603 Status = EFI_OUT_OF_RESOURCES;
2610 Index = IP6_ROUTE_CACHE_HASH (IcmpDest, &Head->DestinationAddress);
2611 InsertHeadList (&IpSb->RouteTable->Cache.CacheBucket[Index], &RouteCache->Link);
2619 if (LinkLayerOption !=
NULL) {
2620 if (NeighborCache ==
NULL) {
2625 CopyMem (&Mac, LinkLayerOption->EtherAddr, 6);
2627 if (NeighborCache ==
NULL) {
2637 NeighborCache->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
2639 Result =
CompareMem (LinkLayerOption->EtherAddr, &NeighborCache->LinkAddress, 6);
2647 CopyMem (&NeighborCache->LinkAddress, LinkLayerOption->EtherAddr, 6);
2649 NeighborCache->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
2656 NeighborCache->CallBack ((VOID *)NeighborCache);
2664 if ((NeighborCache !=
NULL) && IsRouter) {
2668 NeighborCache->IsRouter =
TRUE;
2714 if (Neighbor !=
NULL) {
2716 return EFI_ACCESS_DENIED;
2718 if (TargetLinkAddress !=
NULL) {
2719 IP6_COPY_LINK_ADDRESS (&Neighbor->LinkAddress, TargetLinkAddress);
2723 if (TargetLinkAddress ==
NULL) {
2724 return EFI_NOT_FOUND;
2728 if (Neighbor ==
NULL) {
2729 return EFI_OUT_OF_RESOURCES;
2736 Neighbor->Ticks = IP6_GET_TICKS (Timeout / TICKS_PER_MS);
2737 Neighbor->Dynamic =
TRUE;
2739 Neighbor->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
2776 if (Neighbor ==
NULL) {
2777 return EFI_NOT_FOUND;
2816 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
2826 !IpSb->RouterAdvertiseReceived &&
2827 (IpSb->SolicitTimer > 0)
2830 if ((IpSb->Ticks == 0) || (--IpSb->Ticks == 0)) {
2832 if (!EFI_ERROR (Status)) {
2833 IpSb->SolicitTimer--;
2834 IpSb->Ticks = (UINT32)IP6_GET_TICKS (IP6_RTR_SOLICITATION_INTERVAL);
2839 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
2845 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DelayJoinList) {
2852 DelayNode->Interface,
2853 DelayNode->AddressInfo,
2854 DelayNode->DadCallback,
2869 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DupAddrDetectList) {
2870 DupAddrDetect = NET_LIST_USER_STRUCT (Entry2,
IP6_DAD_ENTRY, Link);
2872 if ((DupAddrDetect->RetransTick == 0) || (--DupAddrDetect->RetransTick == 0)) {
2876 if (DupAddrDetect->Transmit < DupAddrDetect->MaxTransmit) {
2885 &DupAddrDetect->Destination,
2886 &DupAddrDetect->AddressInfo->Address,
2889 if (EFI_ERROR (Status)) {
2893 DupAddrDetect->Transmit++;
2894 DupAddrDetect->RetransTick = IP6_GET_TICKS (IpSb->RetransTimer);
2901 if ((DupAddrDetect->Receive == 0) ||
2902 (DupAddrDetect->Transmit <= DupAddrDetect->Receive))
2916 NET_LIST_FOR_EACH_SAFE (Entry, Next, &IpSb->NeighborTable) {
2919 switch (NeighborCache->State) {
2921 if (NeighborCache->Ticks > 0) {
2922 --NeighborCache->Ticks;
2929 if (NeighborCache->Ticks == 0) {
2930 if (NeighborCache->Transmit > 1) {
2938 if (EFI_ERROR (Status)) {
2946 &NeighborCache->Neighbor,
2949 if (EFI_ERROR (Status)) {
2957 if (NeighborCache->Transmit > 0) {
2958 --NeighborCache->Transmit;
2959 NeighborCache->Ticks = IP6_GET_TICKS (IpSb->RetransTimer);
2963 if (NeighborCache->Transmit == 0) {
2976 if (EFI_ERROR (Status)) {
2988 if (!NeighborCache->Dynamic && (NeighborCache->Ticks == IP6_INFINIT_LIFETIME)) {
2992 if ((NeighborCache->Ticks == 0) || (--NeighborCache->Ticks == 0)) {
2993 if (NeighborCache->Dynamic) {
3007 if (EFI_ERROR (Status)) {
3012 NeighborCache->Ticks = (UINT32)IP6_INFINIT_LIFETIME;
3019 if ((NeighborCache->Ticks == 0) || (--NeighborCache->Ticks == 0)) {
3021 NeighborCache->Ticks = IP6_GET_TICKS (IpSb->RetransTimer);
3022 NeighborCache->Transmit = IP6_MAX_UNICAST_SOLICIT + 1;
3027 if (EFI_ERROR (Status)) {
3034 &NeighborCache->Neighbor,
3035 &NeighborCache->Neighbor,
3038 if (EFI_ERROR (Status)) {
3042 NeighborCache->Transmit--;
3048 if (NeighborCache->Ticks > 0) {
3049 --NeighborCache->Ticks;
3056 if (NeighborCache->Ticks == 0) {
3057 if (NeighborCache->Transmit > 1) {
3064 if (EFI_ERROR (Status)) {
3071 &NeighborCache->Neighbor,
3072 &NeighborCache->Neighbor,
3075 if (EFI_ERROR (Status)) {
3083 if (NeighborCache->Transmit > 0) {
3084 --NeighborCache->Transmit;
3085 NeighborCache->Ticks = IP6_GET_TICKS (IpSb->RetransTimer);
3089 if (NeighborCache->Transmit == 0) {
3102 if (EFI_ERROR (Status)) {
3138 NET_LIST_FOR_EACH_SAFE (Entry, Next, &IpSb->DefaultRouterList) {
3140 if (DefaultRouter->Lifetime != IP6_INF_ROUTER_LIFETIME) {
3141 if ((DefaultRouter->Lifetime == 0) || (--DefaultRouter->Lifetime == 0)) {
3150 NET_LIST_FOR_EACH_SAFE (Entry, Next, &IpSb->AutonomousPrefix) {
3152 if (PrefixOption->ValidLifetime != (UINT32)IP6_INFINIT_LIFETIME) {
3153 if ((PrefixOption->ValidLifetime > 0) && (--PrefixOption->ValidLifetime > 0)) {
3154 if ((PrefixOption->PreferredLifetime != (UINT32)IP6_INFINIT_LIFETIME) &&
3155 (PrefixOption->PreferredLifetime > 0)
3158 --PrefixOption->PreferredLifetime;
3166 NET_LIST_FOR_EACH_SAFE (Entry, Next, &IpSb->OnlinkPrefix) {
3168 if (PrefixOption->ValidLifetime != (UINT32)IP6_INFINIT_LIFETIME) {
3169 if ((PrefixOption->ValidLifetime == 0) || (--PrefixOption->ValidLifetime == 0)) {
3181 for (Index = 0; Index < IP6_ROUTE_CACHE_HASH_SIZE; Index++) {
3184 if (Entry ==
NULL) {
3190 ASSERT (IpSb->RouteTable->Cache.CacheNum[Index] > 0);
3191 IpSb->RouteTable->Cache.CacheNum[Index]--;
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
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)
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)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ICMP_V6_DEST_UNREACHABLE
VOID Ip6CreateSNMulticastAddr(IN EFI_IPv6_ADDRESS *Ip6Addr, OUT EFI_IPv6_ADDRESS *MulticastAddr)
EFI_STATUS Ip6SetToAllNodeMulticast(IN BOOLEAN Router, IN UINT8 Scope, OUT EFI_IPv6_ADDRESS *Ip6Addr)
BOOLEAN Ip6IsSNMulticastAddr(IN EFI_IPv6_ADDRESS *Ip6)
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)
VOID Ip6AddAddr(IN OUT IP6_INTERFACE *IpIf, IN IP6_ADDRESS_INFO *AddrInfo)
BOOLEAN Ip6IsOneOfSetAddress(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Address, OUT IP6_INTERFACE **Interface OPTIONAL, OUT IP6_ADDRESS_INFO **AddressInfo OPTIONAL)
@ Ip6ConfigPolicyAutomatic
EFI_STATUS EFIAPI Ip6ConfigOnDhcp6Reply(IN EFI_DHCP6_PROTOCOL *This, IN VOID *Context, IN EFI_DHCP6_PACKET *Packet)
EFI_STATUS Ip6ConfigStartStatefulAutoConfig(IN IP6_CONFIG_INSTANCE *Instance, IN BOOLEAN OtherInfoOnly)
EFI_STATUS Ip6SendIcmpError(IN IP6_SERVICE *IpSb, IN NET_BUF *Packet, IN EFI_IPv6_ADDRESS *SourceAddress OPTIONAL, IN EFI_IPv6_ADDRESS *DestinationAddress, IN UINT8 Type, IN UINT8 Code, IN UINT32 *Pointer OPTIONAL)
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)
VOID Ip6FreeLinkTxToken(IN IP6_LINK_TX_TOKEN *Token)
EFI_STATUS Ip6LeaveGroup(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Address)
EFI_STATUS Ip6JoinGroup(IN IP6_SERVICE *IpSb, IN IP6_INTERFACE *Interface, IN EFI_IPv6_ADDRESS *Address)
IP6_DEFAULT_ROUTER * Ip6CreateDefaultRouter(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip6Address, IN UINT16 RouterLifetime)
EFI_STATUS Ip6ProcessRedirect(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
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)
EFI_STATUS Ip6SendNeighborSolicit(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *SourceAddress, IN EFI_IPv6_ADDRESS *DestinationAddress, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *SourceLinkAddress OPTIONAL)
VOID Ip6CleanPrefixListTable(IN IP6_SERVICE *IpSb, IN LIST_ENTRY *ListHead)
EFI_STATUS Ip6UpdateReachableTime(IN OUT IP6_SERVICE *IpSb)
VOID Ip6DestroyPrefixListEntry(IN IP6_SERVICE *IpSb, IN IP6_PREFIX_LIST_ENTRY *PrefixEntry, IN BOOLEAN OnLinkOrAuto, IN BOOLEAN ImmediateDelete)
EFI_STATUS Ip6SendRouterSolicit(IN IP6_SERVICE *IpSb, IN IP6_INTERFACE *Interface OPTIONAL, IN EFI_IPv6_ADDRESS *SourceAddress OPTIONAL, IN EFI_IPv6_ADDRESS *DestinationAddress OPTIONAL, IN EFI_MAC_ADDRESS *SourceLinkAddress OPTIONAL)
EFI_STATUS Ip6SendNeighborAdvertise(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *SourceAddress, IN EFI_IPv6_ADDRESS *DestinationAddress, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *TargetLinkAddress, IN BOOLEAN IsRouter, IN BOOLEAN Override, IN BOOLEAN Solicited)
IP6_DEFAULT_ROUTER * Ip6FindDefaultRouter(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip6Address)
IP6_DAD_ENTRY * Ip6FindDADEntry(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Target, OUT IP6_INTERFACE **Interface OPTIONAL)
EFI_STATUS Ip6AddNeighbor(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL, IN UINT32 Timeout, IN BOOLEAN Override)
EFI_STATUS Ip6ProcessNeighborAdvertise(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
VOID Ip6OnArpResolved(IN VOID *Context)
EFI_STATUS Ip6InitDADProcess(IN IP6_INTERFACE *IpIf, IN IP6_ADDRESS_INFO *AddressInfo, IN IP6_DAD_CALLBACK Callback OPTIONAL, IN VOID *Context OPTIONAL)
EFI_STATUS Ip6DelNeighbor(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL, IN UINT32 Timeout, IN BOOLEAN Override)
EFI_STATUS Ip6ProcessNeighborSolicit(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
VOID Ip6NdTimerTicking(IN IP6_SERVICE *IpSb)
VOID EFIAPI Ip6NdFasterTimerTicking(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS Ip6BuildPrefixTable(IN IP6_PROTOCOL *IpInstance, OUT UINT32 *PrefixCount, OUT EFI_IP6_ADDRESS_INFO **PrefixTable)
EFI_STATUS Ip6ProcessRouterAdvertise(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
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)
IP6_NEIGHBOR_ENTRY * Ip6CreateNeighborEntry(IN IP6_SERVICE *IpSb, IN IP6_ARP_CALLBACK CallBack, IN EFI_IPv6_ADDRESS *Ip6Address, IN EFI_MAC_ADDRESS *LinkAddress OPTIONAL)
EFI_STATUS Ip6FreeNeighborEntry(IN IP6_SERVICE *IpSb, IN IP6_NEIGHBOR_ENTRY *NeighborCache, IN BOOLEAN SendIcmpError, IN BOOLEAN FullFree, IN EFI_STATUS IoStatus, IN IP6_FRAME_TO_CANCEL FrameToCancel OPTIONAL, IN VOID *Context OPTIONAL)
EFI_STATUS Ip6BuildEfiNeighborCache(IN IP6_PROTOCOL *IpInstance, OUT UINT32 *NeighborCount, OUT EFI_IP6_NEIGHBOR_CACHE **NeighborCache)
IP6_NEIGHBOR_ENTRY * Ip6FindNeighborEntry(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip6Address)
@ IP6_MAX_RTR_SOLICITATION_DELAY
1000 milliseconds
BOOLEAN Ip6IsNDOptionValid(IN UINT8 *Option, IN UINT16 OptionLen)
EFI_STATUS Ip6Output(IN IP6_SERVICE *IpSb, IN IP6_INTERFACE *Interface OPTIONAL, IN IP6_PROTOCOL *IpInstance OPTIONAL, IN NET_BUF *Packet, IN EFI_IP6_HEADER *Head, IN UINT8 *ExtHdrs, IN UINT32 ExtHdrsLen, IN IP6_FRAME_CALLBACK Callback, IN VOID *Context)
EFI_STATUS Ip6SelectSourceAddress(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Destination, OUT EFI_IPv6_ADDRESS *Source)
VOID Ip6SysPacketSent(NET_BUF *Packet, EFI_STATUS IoStatus, UINT32 LinkFlag, VOID *Context)
VOID Ip6FreeRouteCacheEntry(IN OUT IP6_ROUTE_CACHE_ENTRY *RtCacheEntry)
IP6_ROUTE_ENTRY * Ip6CreateRouteEntry(IN EFI_IPv6_ADDRESS *Destination OPTIONAL, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL)
IP6_ROUTE_ENTRY * Ip6FindRouteEntry(IN IP6_ROUTE_TABLE *RtTable, IN EFI_IPv6_ADDRESS *Destination OPTIONAL, IN EFI_IPv6_ADDRESS *NextHop OPTIONAL)
IP6_ROUTE_CACHE_ENTRY * Ip6FindRouteCache(IN IP6_ROUTE_TABLE *RtTable, IN EFI_IPv6_ADDRESS *Dest, IN EFI_IPv6_ADDRESS *Src)
EFI_STATUS Ip6DelRoute(IN OUT IP6_ROUTE_TABLE *RtTable, IN EFI_IPv6_ADDRESS *Destination, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *GatewayAddress)
IP6_ROUTE_CACHE_ENTRY * Ip6CreateRouteCacheEntry(IN EFI_IPv6_ADDRESS *Dst, IN EFI_IPv6_ADDRESS *Src, IN EFI_IPv6_ADDRESS *GateWay, IN UINTN Tag)
#define IP6_ROUTE_CACHE_MAX
#define DEBUG(Expression)
VOID EFIAPI NetbufFree(IN NET_BUF *Nbuf)
VOID EFIAPI NetbufReserve(IN OUT NET_BUF *Nbuf, IN UINT32 Len)
LIST_ENTRY *EFIAPI NetListRemoveTail(IN OUT LIST_ENTRY *Head)
BOOLEAN EFIAPI NetIp6IsValidUnicast(IN EFI_IPv6_ADDRESS *Ip6)
UINT32 EFIAPI NetbufCopy(IN NET_BUF *Nbuf, IN UINT32 Offset, IN UINT32 Len, IN UINT8 *Dest)
BOOLEAN EFIAPI NetIp6IsNetEqual(EFI_IPv6_ADDRESS *Ip1, EFI_IPv6_ADDRESS *Ip2, UINT8 PrefixLength)
BOOLEAN EFIAPI NetIp6IsLinkLocalAddr(IN EFI_IPv6_ADDRESS *Ip6)
NET_BUF *EFIAPI NetbufAlloc(IN UINT32 Len)
BOOLEAN EFIAPI NetIp6IsUnspecifiedAddr(IN EFI_IPv6_ADDRESS *Ip6)
UINT8 *EFIAPI NetbufAllocSpace(IN OUT NET_BUF *Nbuf, IN UINT32 Len, IN BOOLEAN FromHead)
EFI_STATUS EFIAPI PseudoRandomU32(OUT UINT32 *Output)
UINT8 *EFIAPI NetbufGetByte(IN NET_BUF *Nbuf, IN UINT32 Offset, OUT UINT32 *Index OPTIONAL)
VOID EFIAPI NetListInsertBefore(IN OUT LIST_ENTRY *PostEntry, IN OUT LIST_ENTRY *NewEntry)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID EFIAPI Exit(IN EFI_STATUS Status)
IPv6_ADDRESS EFI_IPv6_ADDRESS
UINT32 DelayTime
in tick per 50 milliseconds
UINT8 PrefixLength
The length of the prefix associated with the Address.
EFI_IPv6_ADDRESS Address
The IPv6 address.
UINT32 DupAddrDetectTransmits
The number of consecutive Neighbor Solicitation messages sent.
EFI_IP6_NEIGHBOR_STATE State
State of this neighbor cache entry.
EFI_MAC_ADDRESS LinkAddress
Link-layer address of the neighbor.
EFI_IPv6_ADDRESS Neighbor
The on-link unicast/anycast IP address of the neighbor.
EFI_MAC_ADDRESS CurrentAddress