TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6Icmp.c File Reference
#include "Ip6Impl.h"

Go to the source code of this file.

Functions

EFI_STATUS Ip6IcmpReplyEcho (IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
 
EFI_STATUS Ip6ProcessPacketTooBig (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)
 
EFI_STATUS Ip6IcmpHandle (IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
 
VOID Ip6GetPrefix (IN UINT8 PrefixLength, IN OUT EFI_IPv6_ADDRESS *Prefix)
 
BOOLEAN Ip6IsAnycast (IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *DestinationAddress)
 
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)
 

Variables

EFI_IP6_ICMP_TYPE mIp6SupportedIcmp [23]
 

Detailed Description

The ICMPv6 handle routines to process the ICMPv6 control messages.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ip6Icmp.c.

Function Documentation

◆ Ip6GetPrefix()

VOID Ip6GetPrefix ( IN UINT8  PrefixLength,
IN OUT EFI_IPv6_ADDRESS Prefix 
)

Retrieve the Prefix address according to the PrefixLength by clear the useless bits.

Parameters
[in]PrefixLengthThe prefix length of the prefix.
[in,out]PrefixOn input, points to the original prefix address with dirty bits; on output, points to the updated address with useless bit clear.

Definition at line 460 of file Ip6Icmp.c.

◆ Ip6IcmpHandle()

EFI_STATUS Ip6IcmpHandle ( IN IP6_SERVICE IpSb,
IN EFI_IP6_HEADER Head,
IN NET_BUF Packet 
)

Handle the ICMPv6 packet. First validate the message format, then, according to the message types, process it as an informational packet or an error packet.

Parameters
[in]IpSbThe IP service that received the packet.
[in]HeadThe IP head of the ICMPv6 packet.
[in]PacketThe content of the ICMPv6 packet with IP head removed.
Return values
EFI_INVALID_PARAMETERThe packet is malformatted.
EFI_SUCCESSThe ICMPv6 message successfully processed.
OthersFailed to handle the ICMPv6 packet.

Definition at line 402 of file Ip6Icmp.c.

◆ Ip6IcmpReplyEcho()

EFI_STATUS Ip6IcmpReplyEcho ( IN IP6_SERVICE IpSb,
IN EFI_IP6_HEADER Head,
IN NET_BUF Packet 
)

Reply an ICMPv6 echo request.

Parameters
[in]IpSbThe IP service that received the packet.
[in]HeadThe IP head of the ICMPv6 informational message.
[in]PacketThe content of the ICMPv6 message with the IP head removed.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate resources.
EFI_SUCCESSSuccessfully answered the ICMPv6 Echo request.
OthersFailed to answer the ICMPv6 Echo request.

Definition at line 128 of file Ip6Icmp.c.

◆ Ip6IsAnycast()

BOOLEAN Ip6IsAnycast ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS DestinationAddress 
)

Check whether the DestinationAddress is an anycast address.

Parameters
[in]IpSbThe IP service that received the packet.
[in]DestinationAddressPoints to the Destination Address of the packet.
Return values
TRUEThe DestinationAddress is anycast address.
FALSEThe DestinationAddress is not anycast address.

Definition at line 506 of file Ip6Icmp.c.

◆ Ip6ProcessIcmpError()

EFI_STATUS Ip6ProcessIcmpError ( IN IP6_SERVICE IpSb,
IN EFI_IP6_HEADER Head,
IN NET_BUF Packet 
)

Process the ICMPv6 error packet, and deliver the packet to upper layer.

Parameters
[in]IpSbThe IP service that received the packet.
[in]HeadThe IP head of the ICMPv6 error packet.
[in]PacketThe content of the ICMPv6 error with the IP head removed.
Return values
EFI_SUCCESSThe ICMPv6 error processed successfully.
EFI_INVALID_PARAMETERThe packet is invalid.
OthersFailed to process the packet.

Definition at line 281 of file Ip6Icmp.c.

◆ Ip6ProcessIcmpInformation()

EFI_STATUS Ip6ProcessIcmpInformation ( IN IP6_SERVICE IpSb,
IN EFI_IP6_HEADER Head,
IN NET_BUF Packet 
)

Process the ICMPv6 informational messages. If it is an ICMPv6 echo request, answer it. If it is a MLD message, trigger MLD routines to process it. If it is a ND message, trigger ND routines to process it. Otherwise, deliver it to upper layer.

Parameters
[in]IpSbThe IP service that receivd the packet.
[in]HeadThe IP head of the ICMPv6 informational packet.
[in]PacketThe content of the ICMPv6 informational packet with IP head removed.
Return values
EFI_INVALID_PARAMETERThe packet is invalid.
EFI_SUCCESSThe ICMPv6 informational message processed.
OthersFailed to process ICMPv6 informational message.

Definition at line 330 of file Ip6Icmp.c.

◆ Ip6ProcessPacketTooBig()

EFI_STATUS Ip6ProcessPacketTooBig ( IN IP6_SERVICE IpSb,
IN EFI_IP6_HEADER Head,
IN NET_BUF Packet 
)

Process Packet Too Big message sent by a router in response to a packet that it cannot forward because the packet is larger than the MTU of outgoing link. Since this driver already uses IPv6 minimum link MTU as the maximum packet size, if Packet Too Big message is still received, do not reduce the packet size, but rather include a Fragment header in the subsequent packets.

Parameters
[in]IpSbThe IP service that received the packet.
[in]HeadThe IP head of the ICMPv6 error packet.
[in]PacketThe content of the ICMPv6 error with the IP head removed.
Return values
EFI_SUCCESSThe ICMPv6 error processed successfully.
EFI_OUT_OF_RESOURCESFailed to finish the operation due to lack of resource.
EFI_NOT_FOUNDThe packet too big message is not sent to us.

Definition at line 219 of file Ip6Icmp.c.

◆ Ip6SendIcmpError()

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 
)

Generate ICMPv6 error message and send it out to DestinationAddress. Currently Destination Unreachable message, Time Exceeded message and Parameter Problem message are supported.

Parameters
[in]IpSbThe IP service that received the packet.
[in]PacketThe packet which invoking ICMPv6 error.
[in]SourceAddressIf not NULL, points to the SourceAddress. Otherwise, the IP layer will select a source address according to the DestinationAddress.
[in]DestinationAddressPoints to the Destination Address of the ICMPv6 error message.
[in]TypeThe type of the ICMPv6 message.
[in]CodeThe additional level of the ICMPv6 message.
[in]PointerIf not NULL, identifies the octet offset within the invoking packet where the error was detected.
Return values
EFI_INVALID_PARAMETERThe packet is malformatted.
EFI_OUT_OF_RESOURCESThere is no sufficient resource to complete the operation.
EFI_SUCCESSThe ICMPv6 message was successfully sent out.
OthersFailed to generate the ICMPv6 packet.

Definition at line 564 of file Ip6Icmp.c.

Variable Documentation

◆ mIp6SupportedIcmp

EFI_IP6_ICMP_TYPE mIp6SupportedIcmp[23]

Definition at line 13 of file Ip6Icmp.c.