20 ICMP_V6_COMM_PROHIBITED
28 ICMP_V6_ADDR_UNREACHABLE
32 ICMP_V6_PORT_UNREACHABLE
36 ICMP_V6_SOURCE_ADDR_FAILED
40 ICMP_V6_ROUTE_REJECTED
44 ICMP_V6_PACKET_TOO_BIG,
49 ICMP_V6_TIME_EXCEEDED,
53 ICMP_V6_TIME_EXCEEDED,
54 ICMP_V6_TIMEOUT_REASSEMBLE
58 ICMP_V6_PARAMETER_PROBLEM,
62 ICMP_V6_PARAMETER_PROBLEM,
63 ICMP_V6_UNRECOGNIZE_NEXT_HDR
66 ICMP_V6_PARAMETER_PROBLEM,
67 ICMP_V6_UNRECOGNIZE_OPTION
80 ICMP_V6_LISTENER_QUERY,
84 ICMP_V6_LISTENER_REPORT,
88 ICMP_V6_LISTENER_REPORT_2,
92 ICMP_V6_LISTENER_DONE,
97 ICMP_V6_ROUTER_SOLICIT,
101 ICMP_V6_ROUTER_ADVERTISE,
105 ICMP_V6_NEIGHBOR_SOLICIT,
109 ICMP_V6_NEIGHBOR_ADVERTISE,
139 Status = EFI_OUT_OF_RESOURCES;
161 Icmp->Head.Type = ICMP_V6_ECHO_REPLY;
162 Icmp->Head.Checksum = 0;
171 ReplyHead.PayloadLength = HTONS ((UINT16)(Packet->TotalSize));
172 ReplyHead.NextHeader = IP6_ICMP;
173 ReplyHead.HopLimit = IpSb->CurHopLimit;
174 IP6_COPY_ADDRESS (&ReplyHead.DestinationAddress, &Head->SourceAddress);
177 IP6_COPY_ADDRESS (&ReplyHead.SourceAddress, &Head->DestinationAddress);
230 NetbufCopy (Packet, 0,
sizeof (Icmp), (UINT8 *)&Icmp);
231 Mtu = NTOHL (Icmp.Fourth);
232 DestAddress = &Icmp.IpHead.DestinationAddress;
234 if (Mtu < IP6_MIN_LINK_MTU) {
240 if (IP6_IS_MULTICAST (DestAddress)) {
242 if (RouteEntry ==
NULL) {
244 return EFI_OUT_OF_RESOURCES;
247 RouteEntry->Flag = IP6_DIRECT_ROUTE | IP6_PACKET_TOO_BIG;
248 InsertHeadList (&IpSb->RouteTable->RouteArea[128], &RouteEntry->Link);
249 IpSb->RouteTable->TotalNum++;
252 if (RouteEntry ==
NULL) {
254 return EFI_NOT_FOUND;
257 RouteEntry->Flag = RouteEntry->Flag | IP6_PACKET_TOO_BIG;
292 if (Packet->TotalSize < sizeof (Icmp)) {
296 NetbufCopy (Packet, 0,
sizeof (Icmp), (UINT8 *)&Icmp);
297 if (Icmp.Head.Type == ICMP_V6_PACKET_TOO_BIG) {
304 IP6_GET_CLIP_INFO (Packet)->Status = EFI_ICMP_ERROR;
310 return EFI_INVALID_PARAMETER;
339 NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
340 NET_CHECK_SIGNATURE (Packet, NET_BUF_SIGNATURE);
341 ASSERT (Head !=
NULL);
343 NetbufCopy (Packet, 0,
sizeof (Icmp), (UINT8 *)&Icmp);
344 Status = EFI_INVALID_PARAMETER;
346 switch (Icmp.Head.Type) {
351 if (Icmp.Head.Code == 0) {
356 case ICMP_V6_LISTENER_QUERY:
359 case ICMP_V6_LISTENER_REPORT:
360 case ICMP_V6_LISTENER_REPORT_2:
363 case ICMP_V6_NEIGHBOR_SOLICIT:
366 case ICMP_V6_NEIGHBOR_ADVERTISE:
369 case ICMP_V6_ROUTER_ADVERTISE:
372 case ICMP_V6_REDIRECT:
375 case ICMP_V6_ECHO_REPLY:
379 Status = EFI_INVALID_PARAMETER;
409 UINT16 PseudoCheckSum;
415 if (Packet->TotalSize < sizeof (Icmp)) {
419 NetbufCopy (Packet, 0,
sizeof (Icmp), (UINT8 *)&Icmp);
425 &Head->SourceAddress,
426 &Head->DestinationAddress,
438 if (Icmp.Type <= ICMP_V6_ERROR_MAX) {
446 return EFI_INVALID_PARAMETER;
461 IN UINT8 PrefixLength,
470 ASSERT ((Prefix !=
NULL) && (PrefixLength < IP6_PREFIX_MAX));
472 if (PrefixLength == 0) {
477 if (PrefixLength >= IP6_PREFIX_MAX) {
481 Byte = (UINT8)(PrefixLength / 8);
482 Bit = (UINT8)(PrefixLength % 8);
483 Value = Prefix->Addr[Byte];
486 ZeroMem (Prefix->Addr + Byte, 16 - Byte);
490 Mask = (UINT8)(0xFF << (8 - Bit));
491 Prefix->Addr[Byte] = (UINT8)(Value & Mask);
525 if (PrefixEntry !=
NULL) {
526 IP6_COPY_ADDRESS (&Prefix, &PrefixEntry->Prefix);
528 if (EFI_IP6_EQUAL (&Prefix, DestinationAddress)) {
533 Flag = (BOOLEAN) !Flag;
571 IN UINT32 *Pointer OPTIONAL
581 if (DestinationAddress ==
NULL) {
582 return EFI_INVALID_PARAMETER;
592 IP6_IS_MULTICAST (DestinationAddress) ||
596 return EFI_INVALID_PARAMETER;
601 case ICMP_V6_TIME_EXCEEDED:
604 case ICMP_V6_PARAMETER_PROBLEM:
605 if (Pointer ==
NULL) {
606 return EFI_INVALID_PARAMETER;
612 return EFI_INVALID_PARAMETER;
617 if (PacketLen > IpSb->MaxPacketSize) {
618 PacketLen = IpSb->MaxPacketSize;
622 if (ErrorMsg ==
NULL) {
623 return EFI_OUT_OF_RESOURCES;
633 Head.PayloadLength = HTONS (PayloadLen);
634 Head.NextHeader = IP6_ICMP;
635 Head.HopLimit = IpSb->CurHopLimit;
637 if (SourceAddress !=
NULL) {
638 IP6_COPY_ADDRESS (&Head.SourceAddress, SourceAddress);
643 IP6_COPY_ADDRESS (&Head.DestinationAddress, DestinationAddress);
651 if (IcmpHead ==
NULL) {
653 return EFI_OUT_OF_RESOURCES;
657 IcmpHead->Head.Type = Type;
658 IcmpHead->Head.Code = Code;
660 if (Pointer !=
NULL) {
661 IcmpHead->Fourth = HTONL (*Pointer);
669 if (ErrorBody !=
NULL) {
670 ZeroMem (ErrorBody, PayloadLen);
671 NetbufCopy (Packet, 0, PayloadLen, ErrorBody);
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define ICMP_V6_TIMEOUT_HOP_LIMIT
#define ICMP_V6_NO_ROUTE_TO_DEST
#define ICMP_V6_ERRONEOUS_HEADER
#define ICMP_V6_DEST_UNREACHABLE
#define ICMP_V6_ECHO_REQUEST
BOOLEAN Ip6IsOneOfSetAddress(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Address, OUT IP6_INTERFACE **Interface OPTIONAL, OUT IP6_ADDRESS_INFO **AddressInfo OPTIONAL)
BOOLEAN Ip6IsAnycast(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *DestinationAddress)
EFI_STATUS Ip6IcmpReplyEcho(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6ProcessIcmpError(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6ProcessIcmpInformation(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
VOID Ip6GetPrefix(IN UINT8 PrefixLength, IN OUT EFI_IPv6_ADDRESS *Prefix)
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 Ip6ProcessPacketTooBig(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6IcmpHandle(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6ProcessMldReport(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6ProcessMldQuery(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6ProcessRedirect(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
IP6_PREFIX_LIST_ENTRY * Ip6FindPrefixListEntry(IN IP6_SERVICE *IpSb, IN BOOLEAN OnLinkOrAuto, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *Prefix)
EFI_STATUS Ip6ProcessNeighborAdvertise(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6ProcessNeighborSolicit(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6ProcessRouterAdvertise(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
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)
VOID Ip6SysPacketSent(NET_BUF *Packet, EFI_STATUS IoStatus, UINT32 LinkFlag, VOID *Context)
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)
VOID Ip6FreeRouteEntry(IN OUT IP6_ROUTE_ENTRY *RtEntry)
VOID EFIAPI NetbufFree(IN NET_BUF *Nbuf)
VOID EFIAPI NetbufReserve(IN OUT NET_BUF *Nbuf, IN UINT32 Len)
UINT16 EFIAPI NetIp6PseudoHeadChecksum(IN EFI_IPv6_ADDRESS *Src, IN EFI_IPv6_ADDRESS *Dst, IN UINT8 NextHeader, IN UINT32 Len)
UINT16 EFIAPI NetbufChecksum(IN NET_BUF *Nbuf)
UINT32 EFIAPI NetbufCopy(IN NET_BUF *Nbuf, IN UINT32 Offset, IN UINT32 Len, IN UINT8 *Dest)
UINT16 EFIAPI NetAddChecksum(IN UINT16 Checksum1, IN UINT16 Checksum2)
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)
NET_BUF *EFIAPI NetbufDuplicate(IN NET_BUF *Nbuf, IN OUT NET_BUF *Duplicate OPTIONAL, IN UINT32 HeadSpace)
UINT8 *EFIAPI NetbufGetByte(IN NET_BUF *Nbuf, IN UINT32 Offset, OUT UINT32 *Index OPTIONAL)
VOID EFIAPI Exit(IN EFI_STATUS Status)