Skip to content

Internet Control Message Protocol for IPv6 (ICMPv6)

The RFC 4443 standard defines ICMPv6 as Internet Control Message Protocol (ICMP) for Internet Protocol version 6 (IPv6). The ICMPv6 is commonly used to perform error reporting and to provide operational information within IPv6 networks. A good source of reference for ICMPv6 could be found here. The ICMPv6 header has two fields (type and code) that specifies the type of ICMPv6 packet. The detailed description of different ICMPv6 packet types can be found here. The user could effectively handle the ICMPv6 messages by registering a callback that is invoked at the reception of an ICMPv6 packet.

Note

  • The ICMPv6 callback is activated only for the destination unreachable type of ICMPv6 error at the moment.

Defines

MIRA_NET_ICMP6_DST_UNREACH

#define MIRA_NET_ICMP6_DST_UNREACH

destination unreachable

MIRA_NET_ICMP6_DST_UNREACH_NOROUTE

#define MIRA_NET_ICMP6_DST_UNREACH_NOROUTE

no route to destination

MIRA_NET_ICMP6_DST_UNREACH_ADMIN

#define MIRA_NET_ICMP6_DST_UNREACH_ADMIN

administratively prohibited

MIRA_NET_ICMP6_DST_UNREACH_BEYONDSCOPE

#define MIRA_NET_ICMP6_DST_UNREACH_BEYONDSCOPE

beyond scope of source address

MIRA_NET_ICMP6_DST_UNREACH_ADDR

#define MIRA_NET_ICMP6_DST_UNREACH_ADDR

address unreachable

MIRA_NET_ICMP6_DST_UNREACH_NOPORT

#define MIRA_NET_ICMP6_DST_UNREACH_NOPORT

port unreachable

MIRA_NET_ICMP6_CODE_ANY

#define MIRA_NET_ICMP6_CODE_ANY

Types

mira_net_icmp6_callback_t

typedef void(* mira_net_icmp6_callback_t) (const void *icmp_payload, uint16_t icmp_payload_len, const mira_net_icmp6_callback_metadata_t *metadata, void *storage);

Structs

mira_net_icmp6_callback_metadata_t

Name Type Description
icmp_source_address const mira_net_address_t *
icmp_destination_address const mira_net_address_t *
type uint8_t
code uint8_t

Functions

mira_net_icmp6_register_callback

mira_status_t mira_net_icmp6_register_callback(mira_net_icmp6_callback_t callback, void *storage);

Register the callback for incoming ICMPv6 packets.

The function to register the callback for the incoming ICMP packets. The registered callback would be invoked when an ICMP packet is received.

Note

To get ICMP callback for the desired UDP connection, use mira_net_udp_icmp6_register_callback.

Parameters

Name Description
callback The callback function to register.
storage Storage pointer that is used to store optional information to be used by the callback function. E.g. it could be used as an identifier or to pass on a configuration struct.

Return value

Name Description
MIRA_SUCCESS ICMP callback successfully registered.
Back to top