53 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
56 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
147 if (IpVersion == IP_VERSION_4) {
148 ServiceBindingGuid = &gEfiIp4ServiceBindingProtocolGuid;
149 IpProtocolGuid = &gEfiIp4ProtocolGuid;
150 }
else if (IpVersion == IP_VERSION_6) {
151 ServiceBindingGuid = &gEfiIp6ServiceBindingProtocolGuid;
152 IpProtocolGuid = &gEfiIp6ProtocolGuid;
154 return EFI_UNSUPPORTED;
166 if (EFI_ERROR (Status)) {
173 Status =
gBS->OpenProtocol (
179 EFI_OPEN_PROTOCOL_BY_DRIVER
181 if (EFI_ERROR (Status)) {
223 if (IpVersion == IP_VERSION_4) {
224 ServiceBindingGuid = &gEfiIp4ServiceBindingProtocolGuid;
225 IpProtocolGuid = &gEfiIp4ProtocolGuid;
226 }
else if (IpVersion == IP_VERSION_6) {
227 ServiceBindingGuid = &gEfiIp6ServiceBindingProtocolGuid;
228 IpProtocolGuid = &gEfiIp6ProtocolGuid;
230 return EFI_UNSUPPORTED;
236 Status =
gBS->CloseProtocol (
242 if (EFI_ERROR (Status)) {
284 ASSERT (IpIo !=
NULL);
285 ASSERT (Pkt !=
NULL);
286 ASSERT (Session !=
NULL);
287 ASSERT (IpIo->IpVersion == IP_VERSION_4);
303 Type = IcmpHdr->Head.Type;
304 Code = IcmpHdr->Head.Code;
310 case ICMP_TYPE_UNREACH:
312 case ICMP_CODE_UNREACH_NET:
313 case ICMP_CODE_UNREACH_HOST:
314 case ICMP_CODE_UNREACH_PROTOCOL:
315 case ICMP_CODE_UNREACH_PORT:
316 case ICMP_CODE_UNREACH_SRCFAIL:
321 case ICMP_CODE_UNREACH_NEEDFRAG:
322 IcmpErr = ICMP_ERR_MSGSIZE;
326 case ICMP_CODE_UNREACH_NET_UNKNOWN:
327 case ICMP_CODE_UNREACH_NET_PROHIB:
328 case ICMP_CODE_UNREACH_TOSNET:
333 case ICMP_CODE_UNREACH_HOST_UNKNOWN:
334 case ICMP_CODE_UNREACH_ISOLATED:
335 case ICMP_CODE_UNREACH_HOST_PROHIB:
336 case ICMP_CODE_UNREACH_TOSHOST:
337 IcmpErr = ICMP_ERR_UNREACH_HOST;
347 case ICMP_TYPE_TIMXCEED:
352 IcmpErr = (UINT8)(Code + ICMP_ERR_TIMXCEED_INTRANS);
356 case ICMP_TYPE_PARAMPROB:
361 IcmpErr = ICMP_ERR_PARAMPROB;
365 case ICMP_TYPE_SOURCEQUENCH:
370 IcmpErr = ICMP_ERR_QUENCH;
383 TrimBytes = (UINT32)(PayLoadHdr - (UINT8 *)IcmpHdr);
391 if (Pkt->TotalSize != 0) {
392 IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, IpIo->RcvdContext);
427 ASSERT (IpIo !=
NULL);
428 ASSERT (Pkt !=
NULL);
429 ASSERT (Session !=
NULL);
430 ASSERT (IpIo->IpVersion == IP_VERSION_6);
440 Type = IcmpHdr->Head.Type;
441 Code = IcmpHdr->Head.Code;
450 case ICMP_V6_BEYOND_SCOPE:
451 case ICMP_V6_ROUTE_REJECTED:
452 IcmpErr = ICMP6_ERR_UNREACH_NET;
456 case ICMP_V6_COMM_PROHIBITED:
457 case ICMP_V6_ADDR_UNREACHABLE:
458 case ICMP_V6_SOURCE_ADDR_FAILED:
459 IcmpErr = ICMP6_ERR_UNREACH_HOST;
463 case ICMP_V6_PORT_UNREACHABLE:
464 IcmpErr = ICMP6_ERR_UNREACH_PORT;
474 case ICMP_V6_PACKET_TOO_BIG:
479 IcmpErr = ICMP6_ERR_PACKAGE_TOOBIG;
483 case ICMP_V6_TIME_EXCEEDED:
488 IcmpErr = (UINT8)(ICMP6_ERR_TIMXCEED_HOPLIMIT + Code);
492 case ICMP_V6_PARAMETER_PROBLEM:
497 IcmpErr = (UINT8)(ICMP6_ERR_PARAMPROB_HEADER + Code);
512 NextHeader = IpHdr->NextHeader;
517 switch (NextHeader) {
518 case EFI_IP_PROTO_UDP:
519 case EFI_IP_PROTO_TCP:
520 case EFI_IP_PROTO_ICMP:
521 case IP6_NO_NEXT_HEADER:
527 case IP6_DESTINATION:
532 NextHeader = *(PayLoadHdr);
533 PayLoadHdr = (UINT8 *)(PayLoadHdr + (*(PayLoadHdr + 1) + 1) * 8);
541 NextHeader = *(PayLoadHdr);
542 PayLoadHdr = (UINT8 *)(PayLoadHdr + 8);
552 TrimBytes = (UINT32)(PayLoadHdr - (UINT8 *)IcmpHdr);
560 if (Pkt->TotalSize != 0) {
561 IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, IpIo->RcvdContext);
586 if (IpIo->IpVersion == IP_VERSION_4) {
588 }
else if (IpIo->IpVersion == IP_VERSION_6) {
591 return EFI_UNSUPPORTED;
633 IN VOID *Context OPTIONAL,
634 IN VOID *NotifyData OPTIONAL,
643 UINT32 FragmentCount;
649 if ((IpIo->IpVersion != IP_VERSION_4) && (IpIo->IpVersion != IP_VERSION_6)) {
661 if (
NULL == SndEntry) {
665 Status =
gBS->CreateEvent (
672 if (EFI_ERROR (Status)) {
676 FragmentCount = Pkt->BlockOpNum;
685 if (
NULL == TxData) {
692 if (IpIo->IpVersion == IP_VERSION_4) {
693 ExtFragment = (
NET_FRAGMENT *)TxData->Ip4TxData.FragmentTable;
703 if (
NULL != Override) {
705 if (
NULL == OverrideData) {
713 if (IpIo->IpVersion == IP_VERSION_4) {
714 Ip4TxData = &TxData->Ip4TxData;
716 IP4_COPY_ADDRESS (&Ip4TxData->DestinationAddress, Dest);
718 Ip4TxData->OverrideData = &OverrideData->Ip4OverrideData;
719 Ip4TxData->OptionsLength = 0;
720 Ip4TxData->OptionsBuffer =
NULL;
721 Ip4TxData->TotalDataLength = Pkt->TotalSize;
722 Ip4TxData->FragmentCount = FragmentCount;
727 SndEntry->SndToken.Ip4Token.
Event = Event;
728 SndEntry->SndToken.Ip4Token.Packet.
TxData = Ip4TxData;
730 Ip6TxData = &TxData->Ip6TxData;
738 Ip6TxData->
OverrideData = &OverrideData->Ip6OverrideData;
747 SndEntry->SndToken.Ip6Token.
Event = Event;
748 SndEntry->SndToken.Ip6Token.Packet.
TxData = Ip6TxData;
754 SndEntry->IpIo = IpIo;
755 SndEntry->Ip = Sender;
756 SndEntry->Context = Context;
757 SndEntry->NotifyData = NotifyData;
768 if (OverrideData !=
NULL) {
772 if (TxData !=
NULL) {
776 if (SndEntry !=
NULL) {
781 gBS->CloseEvent (Event);
804 if (SndEntry->IpIo->IpVersion == IP_VERSION_4) {
805 Event = SndEntry->SndToken.Ip4Token.Event;
808 }
else if (SndEntry->IpIo->IpVersion == IP_VERSION_6) {
809 Event = SndEntry->SndToken.Ip6Token.Event;
816 gBS->CloseEvent (Event);
820 if (
NULL != Override) {
849 IpIo = SndEntry->IpIo;
851 if (IpIo->IpVersion == IP_VERSION_4) {
852 Status = SndEntry->SndToken.Ip4Token.
Status;
853 }
else if (IpIo->IpVersion == IP_VERSION_6) {
854 Status = SndEntry->SndToken.Ip6Token.
Status;
909 if ((IpInfo->IpVersion != IP_VERSION_4) && (IpInfo->IpVersion != IP_VERSION_6)) {
915 if (IpInfo->IpVersion == IP_VERSION_4) {
916 Status = IpInfo->DummyRcvToken.Ip4Token.
Status;
918 if (IpInfo->DummyRcvToken.Ip4Token.Packet.
RxData !=
NULL) {
919 RecycleEvent = IpInfo->DummyRcvToken.Ip4Token.Packet.
RxData->RecycleSignal;
922 Status = IpInfo->DummyRcvToken.Ip6Token.
Status;
924 if (IpInfo->DummyRcvToken.Ip6Token.Packet.
RxData !=
NULL) {
929 if (EFI_ABORTED == Status) {
938 ASSERT (RecycleEvent !=
NULL);
940 gBS->SignalEvent (RecycleEvent);
946 if (IpInfo->IpVersion == IP_VERSION_4) {
947 IpInfo->Ip.Ip4->Receive (
949 &IpInfo->DummyRcvToken.Ip4Token
952 IpInfo->Ip.Ip6->Receive (
954 &IpInfo->DummyRcvToken.Ip6Token
998 IpIo = (
IP_IO *)Context;
1000 if (IpIo->IpVersion == IP_VERSION_4) {
1003 }
else if (IpIo->IpVersion == IP_VERSION_6) {
1010 if (EFI_ABORTED == Status) {
1017 if ((
EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) {
1021 if (RxData !=
NULL) {
1031 ASSERT (RxData !=
NULL);
1032 if (RxData ==
NULL) {
1040 if (IpIo->IpVersion == IP_VERSION_4) {
1041 ASSERT (RxData->Ip4RxData.Header !=
NULL);
1042 if (IP4_IS_LOCAL_BROADCAST (EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress))) {
1049 if ((EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress) != 0) &&
1050 (IpIo->SubnetMask != 0) &&
1051 IP4_NET_EQUAL (IpIo->StationIp, EFI_NTOHL (((
EFI_IP4_RECEIVE_DATA *)RxData)->Header->SourceAddress), IpIo->SubnetMask) &&
1060 if (RxData->Ip4RxData.DataLength == 0) {
1070 ASSERT (RxData->Ip4RxData.FragmentCount != 0);
1077 RxData->Ip4RxData.FragmentCount,
1081 RxData->Ip4RxData.RecycleSignal
1090 Session.
Source.Addr[0] = EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress);
1091 Session.
Dest.Addr[0] = EFI_IP4 (RxData->Ip4RxData.Header->DestinationAddress);
1092 Session.
IpHdr.Ip4Hdr = RxData->Ip4RxData.Header;
1093 Session.
IpHdrLen = RxData->Ip4RxData.HeaderLength;
1133 &RxData->Ip6RxData.
Header->SourceAddress,
1138 &RxData->Ip6RxData.
Header->DestinationAddress,
1153 if (EFI_ERROR (Status)) {
1162 if (IpIo->IpVersion == IP_VERSION_4) {
1163 gBS->SignalEvent (RxData->Ip4RxData.RecycleSignal);
1170 if (IpIo->IpVersion == IP_VERSION_4) {
1171 IpIo->Ip.Ip4->Receive (IpIo->Ip.Ip4, &(IpIo->
RcvToken.Ip4Token));
1173 IpIo->Ip.Ip6->Receive (IpIo->Ip.Ip6, &(IpIo->
RcvToken.Ip6Token));
1227 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6));
1236 IpIo->Controller = Controller;
1237 IpIo->Image = Image;
1238 IpIo->IpVersion = IpVersion;
1241 Status =
gBS->CreateEvent (
1248 if (EFI_ERROR (Status)) {
1252 if (IpVersion == IP_VERSION_4) {
1266 (VOID **)&(IpIo->Ip)
1268 if (EFI_ERROR (Status)) {
1276 if (Event !=
NULL) {
1277 gBS->CloseEvent (Event);
1280 gBS->FreePool (IpIo);
1318 if ((IpIo ==
NULL) || (OpenData ==
NULL)) {
1319 return EFI_INVALID_PARAMETER;
1322 if (IpIo->IsConfigured) {
1323 return EFI_ACCESS_DENIED;
1326 IpVersion = IpIo->IpVersion;
1328 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6));
1333 if (IpVersion == IP_VERSION_4) {
1337 ASSERT (!OpenData->IpConfigData.Ip4CfgData.RawData);
1338 if (OpenData->IpConfigData.Ip4CfgData.RawData) {
1339 return EFI_UNSUPPORTED;
1342 if (!OpenData->IpConfigData.Ip4CfgData.UseDefaultAddress) {
1343 IpIo->StationIp = EFI_NTOHL (OpenData->IpConfigData.Ip4CfgData.StationAddress);
1344 IpIo->SubnetMask = EFI_NTOHL (OpenData->IpConfigData.Ip4CfgData.SubnetMask);
1347 Status = IpIo->Ip.Ip4->Configure (
1349 &OpenData->IpConfigData.Ip4CfgData
1352 Status = IpIo->Ip.Ip6->Configure (
1354 &OpenData->IpConfigData.Ip6CfgData
1358 if (EFI_ERROR (Status)) {
1367 if (IpVersion == IP_VERSION_4) {
1368 Status = IpIo->Ip.Ip4->Routes (
1376 if (EFI_ERROR (Status) && (EFI_NOT_FOUND != Status)) {
1381 IpIo->PktRcvdNotify = OpenData->PktRcvdNotify;
1382 IpIo->PktSentNotify = OpenData->PktSentNotify;
1384 IpIo->RcvdContext = OpenData->RcvdContext;
1385 IpIo->SndContext = OpenData->SndContext;
1387 if (IpVersion == IP_VERSION_4) {
1388 IpIo->Protocol = OpenData->IpConfigData.Ip4CfgData.DefaultProtocol;
1393 Status = IpIo->Ip.Ip4->Receive (
1395 &(IpIo->RcvToken.Ip4Token)
1397 if (EFI_ERROR (Status)) {
1398 IpIo->Ip.Ip4->Configure (IpIo->Ip.Ip4,
NULL);
1402 IpIo->Protocol = OpenData->IpConfigData.Ip6CfgData.DefaultProtocol;
1403 Status = IpIo->Ip.Ip6->Receive (
1405 &(IpIo->RcvToken.Ip6Token)
1407 if (EFI_ERROR (Status)) {
1408 IpIo->Ip.Ip6->Configure (IpIo->Ip.Ip6,
NULL);
1413 IpIo->IsConfigured =
TRUE;
1445 return EFI_INVALID_PARAMETER;
1448 if (!IpIo->IsConfigured) {
1452 IpVersion = IpIo->IpVersion;
1454 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6));
1464 if (IpVersion == IP_VERSION_4) {
1465 Status = IpIo->Ip.Ip4->Configure (IpIo->Ip.Ip4,
NULL);
1467 Status = IpIo->Ip.Ip6->Configure (IpIo->Ip.Ip6,
NULL);
1470 if (EFI_ERROR (Status)) {
1474 IpIo->IsConfigured =
FALSE;
1481 IpInfo = NET_LIST_HEAD (&(IpIo->IpList),
IP_IO_IP_INFO, Entry);
1494 if (IpVersion == IP_VERSION_4) {
1495 gBS->CloseEvent (IpIo->RcvToken.Ip4Token.Event);
1497 gBS->CloseEvent (IpIo->RcvToken.Ip6Token.Event);
1528 if (EFI_ERROR (Status)) {
1541 if (EFI_ERROR (Status)) {
1545 gBS->FreePool (IpIo);
1582 IN VOID *Context OPTIONAL,
1583 IN VOID *NotifyData OPTIONAL,
1592 if ((IpIo ==
NULL) || (Pkt ==
NULL)) {
1593 return EFI_INVALID_PARAMETER;
1596 if ((IpIo->IpVersion == IP_VERSION_4) && (Dest ==
NULL)) {
1597 return EFI_INVALID_PARAMETER;
1600 if (!IpIo->IsConfigured) {
1601 return EFI_NOT_STARTED;
1604 Ip = (
NULL == Sender) ? IpIo->Ip : Sender->Ip;
1609 SndEntry =
IpIoCreateSndEntry (IpIo, Pkt, Ip, Context, NotifyData, Dest, OverrideData);
1610 if (
NULL == SndEntry) {
1611 return EFI_OUT_OF_RESOURCES;
1617 if (IpIo->IpVersion == IP_VERSION_4) {
1618 Status = Ip.Ip4->Transmit (
1620 &SndEntry->SndToken.Ip4Token
1623 Status = Ip.Ip6->Transmit (
1625 &SndEntry->SndToken.Ip6Token
1629 if (EFI_ERROR (Status)) {
1657 ASSERT ((IpIo !=
NULL) && (Packet !=
NULL));
1659 NET_LIST_FOR_EACH (Node, &IpIo->PendingSndList) {
1662 if (SndEntry->Pkt == Packet) {
1665 if (IpIo->IpVersion == IP_VERSION_4) {
1668 &SndEntry->SndToken.Ip4Token
1673 &SndEntry->SndToken.Ip6Token
1708 ASSERT (IpIo !=
NULL);
1709 ASSERT ((IpIo->IpVersion == IP_VERSION_4) || (IpIo->IpVersion == IP_VERSION_6));
1712 if (IpInfo ==
NULL) {
1721 IpInfo->ChildHandle =
NULL;
1722 ZeroMem (&IpInfo->Addr, sizeof (IpInfo->Addr));
1723 ZeroMem (&IpInfo->PreMask, sizeof (IpInfo->PreMask));
1726 IpInfo->IpVersion = IpIo->IpVersion;
1734 &IpInfo->ChildHandle,
1736 (VOID **)&IpInfo->Ip
1738 if (EFI_ERROR (Status)) {
1745 Status =
gBS->CreateEvent (
1752 if (EFI_ERROR (Status)) {
1753 goto ReleaseIpChild;
1756 if (IpInfo->IpVersion == IP_VERSION_4) {
1757 IpInfo->DummyRcvToken.Ip4Token.
Event = Event;
1759 IpInfo->DummyRcvToken.Ip6Token.
Event = Event;
1774 IpInfo->ChildHandle,
1780 gBS->FreePool (IpInfo);
1808 IN OUT VOID *IpConfigData OPTIONAL
1817 ASSERT (IpInfo !=
NULL);
1819 if (IpInfo->RefCnt > 1) {
1829 IpVersion = IpInfo->IpVersion;
1830 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6));
1834 if (IpInfo->IpVersion == IP_VERSION_4) {
1835 Status = Ip.Ip4->Configure (Ip.Ip4, IpConfigData);
1837 Status = Ip.Ip6->Configure (Ip.Ip6, IpConfigData);
1840 if (EFI_ERROR (Status)) {
1844 if (IpConfigData !=
NULL) {
1845 if (IpInfo->IpVersion == IP_VERSION_4) {
1847 Status = Ip.Ip4->GetModeData (
1853 if (EFI_ERROR (Status)) {
1854 Ip.Ip4->Configure (Ip.Ip4,
NULL);
1868 &IpInfo->PreMask.SubnetMask,
1873 Status = Ip.Ip4->Receive (
1875 &IpInfo->DummyRcvToken.Ip4Token
1877 if (EFI_ERROR (Status)) {
1878 Ip.Ip4->Configure (Ip.Ip4,
NULL);
1881 Status = Ip.Ip6->GetModeData (
1887 if (EFI_ERROR (Status)) {
1888 Ip.Ip6->Configure (Ip.Ip6,
NULL);
1923 Status = EFI_NO_MAPPING;
1933 Status = Ip.Ip6->Receive (
1935 &IpInfo->DummyRcvToken.Ip6Token
1937 if (EFI_ERROR (Status)) {
1938 Ip.Ip6->Configure (Ip.Ip6,
NULL);
1945 ZeroMem (&IpInfo->Addr, sizeof (IpInfo->Addr));
1946 ZeroMem (&IpInfo->PreMask, sizeof (IpInfo->PreMask));
1975 if ((IpIo ==
NULL) || (IpInfo ==
NULL)) {
1979 ASSERT (IpInfo->RefCnt > 0);
1981 NET_PUT_REF (IpInfo);
1983 if (IpInfo->RefCnt > 0) {
1987 IpVersion = IpIo->IpVersion;
1989 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6));
1993 if (IpVersion == IP_VERSION_4) {
1994 IpInfo->Ip.Ip4->Configure (
2001 IpInfo->ChildHandle,
2005 gBS->CloseEvent (IpInfo->DummyRcvToken.Ip4Token.Event);
2007 IpInfo->Ip.Ip6->Configure (
2015 IpInfo->ChildHandle,
2019 gBS->CloseEvent (IpInfo->DummyRcvToken.Ip6Token.Event);
2054 if ((IpIo ==
NULL) || (Src ==
NULL)) {
2058 if ((IpVersion != IP_VERSION_4) && (IpVersion != IP_VERSION_6)) {
2062 NET_LIST_FOR_EACH (IpIoEntry, &mActiveIpIoList) {
2063 IpIoPtr = NET_LIST_USER_STRUCT (IpIoEntry,
IP_IO, Entry);
2065 if (((*IpIo !=
NULL) && (*IpIo != IpIoPtr)) || (IpIoPtr->IpVersion != IpVersion)) {
2069 NET_LIST_FOR_EACH (IpInfoEntry, &IpIoPtr->
IpList) {
2070 IpInfo = NET_LIST_USER_STRUCT (IpInfoEntry,
IP_IO_IP_INFO, Entry);
2071 if (IpInfo->IpVersion == IP_VERSION_4) {
2072 if (EFI_IP4_EQUAL (&IpInfo->Addr.v4, &Src->v4)) {
2077 if (EFI_IP6_EQUAL (&IpInfo->Addr.v6, &Src->v6)) {
2112 OUT BOOLEAN *IsHard OPTIONAL,
2113 OUT BOOLEAN *Notify OPTIONAL
2116 if (IpVersion == IP_VERSION_4 ) {
2117 ASSERT (IcmpError <= ICMP_ERR_PARAMPROB);
2119 if (IsHard !=
NULL) {
2120 *IsHard = mIcmpErrMap[IcmpError].IsHard;
2123 if (Notify !=
NULL) {
2124 *Notify = mIcmpErrMap[IcmpError].Notify;
2127 switch (IcmpError) {
2131 case ICMP_ERR_TIMXCEED_INTRANS:
2132 case ICMP_ERR_TIMXCEED_REASS:
2133 case ICMP_ERR_UNREACH_HOST:
2134 return EFI_HOST_UNREACHABLE;
2136 case ICMP_ERR_UNREACH_PROTOCOL:
2137 return EFI_PROTOCOL_UNREACHABLE;
2139 case ICMP_ERR_UNREACH_PORT:
2140 return EFI_PORT_UNREACHABLE;
2142 case ICMP_ERR_MSGSIZE:
2143 case ICMP_ERR_UNREACH_SRCFAIL:
2144 case ICMP_ERR_QUENCH:
2145 case ICMP_ERR_PARAMPROB:
2146 return EFI_ICMP_ERROR;
2150 return EFI_UNSUPPORTED;
2152 }
else if (IpVersion == IP_VERSION_6) {
2153 ASSERT (IcmpError <= ICMP6_ERR_PARAMPROB_IPV6OPTION);
2155 if (IsHard !=
NULL) {
2156 *IsHard = mIcmp6ErrMap[IcmpError].IsHard;
2159 if (Notify !=
NULL) {
2160 *Notify = mIcmp6ErrMap[IcmpError].Notify;
2163 switch (IcmpError) {
2164 case ICMP6_ERR_UNREACH_NET:
2167 case ICMP6_ERR_UNREACH_HOST:
2168 case ICMP6_ERR_TIMXCEED_HOPLIMIT:
2169 case ICMP6_ERR_TIMXCEED_REASS:
2170 return EFI_HOST_UNREACHABLE;
2172 case ICMP6_ERR_UNREACH_PROTOCOL:
2173 return EFI_PROTOCOL_UNREACHABLE;
2175 case ICMP6_ERR_UNREACH_PORT:
2176 return EFI_PORT_UNREACHABLE;
2178 case ICMP6_ERR_PACKAGE_TOOBIG:
2179 case ICMP6_ERR_PARAMPROB_HEADER:
2180 case ICMP6_ERR_PARAMPROB_NEXHEADER:
2181 case ICMP6_ERR_PARAMPROB_IPV6OPTION:
2182 return EFI_ICMP_ERROR;
2186 return EFI_UNSUPPORTED;
2193 return EFI_UNSUPPORTED;
2232 if (!IpIo->IsConfigured) {
2233 return EFI_NOT_STARTED;
2236 if (IpIo->IpVersion != IP_VERSION_6) {
2237 return EFI_UNSUPPORTED;
2242 return Ip->Neighbors (Ip,
FALSE, &Neighbor->v6,
NULL, Timeout,
TRUE);
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)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI QueueDpc(IN EFI_TPL DpcTpl, IN EFI_DPC_PROCEDURE DpcProcedure, IN VOID *DpcContext OPTIONAL)
VOID EFIAPI IpIoListenHandler(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI IpIoRefreshNeighbor(IN IP_IO *IpIo, IN EFI_IP_ADDRESS *Neighbor, IN UINT32 Timeout)
EFI_STATUS EFIAPI IpIoDestroy(IN OUT IP_IO *IpIo)
IP_IO *EFIAPI IpIoCreate(IN EFI_HANDLE Image, IN EFI_HANDLE Controller, IN UINT8 IpVersion)
VOID EFIAPI IpIoRemoveIp(IN IP_IO *IpIo, IN IP_IO_IP_INFO *IpInfo)
EFI_STATUS IpIoIcmpv6Handler(IN IP_IO *IpIo, IN OUT NET_BUF *Pkt, IN EFI_NET_SESSION_DATA *Session)
EFI_STATUS IpIoIcmpv4Handler(IN IP_IO *IpIo, IN OUT NET_BUF *Pkt, IN EFI_NET_SESSION_DATA *Session)
VOID EFIAPI IpIoTransmitHandlerDpc(IN VOID *Context)
VOID EFIAPI IpIoExtFree(IN VOID *Event)
EFI_STATUS EFIAPI IpIoStop(IN OUT IP_IO *IpIo)
VOID EFIAPI IpIoListenHandlerDpc(IN VOID *Context)
EFI_STATUS EFIAPI IpIoOpen(IN OUT IP_IO *IpIo, IN IP_IO_OPEN_DATA *OpenData)
VOID IpIoDestroySndEntry(IN IP_IO_SEND_ENTRY *SndEntry)
EFI_STATUS EFIAPI IpIoSend(IN OUT IP_IO *IpIo, IN OUT NET_BUF *Pkt, IN IP_IO_IP_INFO *Sender OPTIONAL, IN VOID *Context OPTIONAL, IN VOID *NotifyData OPTIONAL, IN EFI_IP_ADDRESS *Dest OPTIONAL, IN IP_IO_OVERRIDE *OverrideData OPTIONAL)
VOID EFIAPI IpIoCancelTxToken(IN IP_IO *IpIo, IN VOID *Packet)
EFI_STATUS EFIAPI IpIoConfigIp(IN OUT IP_IO_IP_INFO *IpInfo, IN OUT VOID *IpConfigData OPTIONAL)
VOID EFIAPI IpIoTransmitHandler(IN EFI_EVENT Event, IN VOID *Context)
IP_IO_IP_INFO *EFIAPI IpIoAddIp(IN OUT IP_IO *IpIo)
EFI_STATUS IpIoCreateIpChildOpenProtocol(IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE *ChildHandle, IN UINT8 IpVersion, OUT VOID **Interface)
IP_IO_SEND_ENTRY * IpIoCreateSndEntry(IN OUT IP_IO *IpIo, IN OUT NET_BUF *Pkt, IN IP_IO_IP_PROTOCOL Sender, IN VOID *Context OPTIONAL, IN VOID *NotifyData OPTIONAL, IN EFI_IP_ADDRESS *Dest OPTIONAL, IN IP_IO_OVERRIDE *Override)
EFI_STATUS IpIoCloseProtocolDestroyIpChild(IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ChildHandle, IN UINT8 IpVersion)
VOID EFIAPI IpIoDummyHandlerDpc(IN VOID *Context)
EFI_STATUS IpIoIcmpHandler(IN IP_IO *IpIo, IN OUT NET_BUF *Pkt, IN EFI_NET_SESSION_DATA *Session)
IP_IO_IP_INFO *EFIAPI IpIoFindSender(IN OUT IP_IO **IpIo, IN UINT8 IpVersion, IN EFI_IP_ADDRESS *Src)
EFI_STATUS EFIAPI IpIoGetIcmpErrStatus(IN UINT8 IcmpError, IN UINT8 IpVersion, OUT BOOLEAN *IsHard OPTIONAL, OUT BOOLEAN *Notify OPTIONAL)
VOID EFIAPI IpIoDummyHandler(IN EFI_EVENT Event, IN VOID *Context)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define ICMP_V6_NO_ROUTE_TO_DEST
#define ICMP_V6_DEST_UNREACHABLE
#define EFI_IP4_HEADER_LEN(HdrPtr)
#define ICMP_ERRLEN(IpHdr)
#define NET_PROTO_HDR(Buf, Type)
#define ICMP_ERR_UNREACH_NET
#define GLOBAL_REMOVE_IF_UNREFERENCED
VOID EFIAPI NetbufFree(IN NET_BUF *Nbuf)
UINT32 EFIAPI NetbufTrim(IN OUT NET_BUF *Nbuf, IN UINT32 Len, IN BOOLEAN FromHead)
EFI_STATUS EFIAPI NetbufBuildExt(IN NET_BUF *Nbuf, IN OUT NET_FRAGMENT *ExtFragment, IN OUT UINT32 *ExtNum)
BOOLEAN EFIAPI NetIp4IsUnicast(IN IP4_ADDR Ip, IN IP4_ADDR NetMask)
BOOLEAN EFIAPI NetIp6IsValidUnicast(IN EFI_IPv6_ADDRESS *Ip6)
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)
NET_BUF *EFIAPI NetbufFromExt(IN NET_FRAGMENT *ExtFragment, IN UINT32 ExtNum, IN UINT32 HeadSpace, IN UINT32 HeadLen, IN NET_VECTOR_EXT_FREE ExtFree, IN VOID *Arg OPTIONAL)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
#define EFI_NETWORK_UNREACHABLE
EFI_IP6_FRAGMENT_DATA FragmentTable[1]
EFI_IP6_FRAGMENT_DATA FragmentTable[1]
EFI_IP6_OVERRIDE_DATA * OverrideData
EFI_IPv6_ADDRESS DestinationAddress
UINT8 IpVersion
The IP version of the received packet.
EFI_IP_ADDRESS Source
Source IP of the received packet.
EFI_IP_ADDRESS Dest
Destination IP of the received packet.
IP_IO_IP_HEADER IpHdr
IP header of the received packet.
PKT_RCVD_NOTIFY PktRcvdNotify
See IP_IO_OPEN_DATA::PktRcvdNotify.
VOID * RcvdContext
See IP_IO_OPEN_DATA::RcvdContext.
IP_IO_IP_COMPLETION_TOKEN RcvToken
LIST_ENTRY PendingSndList
PKT_SENT_NOTIFY PktSentNotify
See IP_IO_OPEN_DATA::PktSentNotify.
EFI_IP4_RECEIVE_DATA * RxData
EFI_IP4_TRANSMIT_DATA * TxData
EFI_IPv4_ADDRESS SubnetMask
EFI_IPv4_ADDRESS StationAddress
EFI_IP4_CONFIG_DATA ConfigData
EFI_IP6_RECEIVE_DATA * RxData
EFI_IP6_TRANSMIT_DATA * TxData
EFI_IPv6_ADDRESS StationAddress
EFI_IP6_NEIGHBOR_CACHE * NeighborCache
EFI_IP6_ICMP_TYPE * IcmpTypeList
EFI_IP6_ADDRESS_INFO * AddressList
EFI_IP6_ROUTE_TABLE * RouteTable
EFI_IPv6_ADDRESS * GroupTable
EFI_IP6_CONFIG_DATA ConfigData
EFI_IP6_ADDRESS_INFO * PrefixTable