Microchip® Advanced Software Framework

icmp6.h File Reference

IPv6 version of ICMP, as per RFC 4443.

#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/ip6_addr.h"
#include "lwip/netif.h"

Data Structures

struct  icmp6_echo_hdr
 This is the ICMP6 header adapted for echo req/resp. More...
 
struct  icmp6_hdr
 This is the standard ICMP6 header. More...
 

Enumerations

enum  icmp6_dur_code {
  ICMP6_DUR_NO_ROUTE = 0,
  ICMP6_DUR_PROHIBITED = 1,
  ICMP6_DUR_SCOPE = 2,
  ICMP6_DUR_ADDRESS = 3,
  ICMP6_DUR_PORT = 4,
  ICMP6_DUR_POLICY = 5,
  ICMP6_DUR_REJECT_ROUTE = 6
}
 
enum  icmp6_pp_code {
  ICMP6_PP_FIELD = 0,
  ICMP6_PP_HEADER = 1,
  ICMP6_PP_OPTION = 2
}
 
enum  icmp6_te_code {
  ICMP6_TE_HL = 0,
  ICMP6_TE_FRAG = 1
}
 
enum  icmp6_type {
  ICMP6_TYPE_DUR = 1,
  ICMP6_TYPE_PTB = 2,
  ICMP6_TYPE_TE = 3,
  ICMP6_TYPE_PP = 4,
  ICMP6_TYPE_PE1 = 100,
  ICMP6_TYPE_PE2 = 101,
  ICMP6_TYPE_RSV_ERR = 127,
  ICMP6_TYPE_EREQ = 128,
  ICMP6_TYPE_EREP = 129,
  ICMP6_TYPE_MLQ = 130,
  ICMP6_TYPE_MLR = 131,
  ICMP6_TYPE_MLD = 132,
  ICMP6_TYPE_RS = 133,
  ICMP6_TYPE_RA = 134,
  ICMP6_TYPE_NS = 135,
  ICMP6_TYPE_NA = 136,
  ICMP6_TYPE_RD = 137,
  ICMP6_TYPE_MRA = 151,
  ICMP6_TYPE_MRS = 152,
  ICMP6_TYPE_MRT = 153,
  ICMP6_TYPE_PE3 = 200,
  ICMP6_TYPE_PE4 = 201,
  ICMP6_TYPE_RSV_INF = 255
}
 

Functions

void icmp6_dest_unreach (struct pbuf *p, enum icmp6_dur_code c)
 Send an icmpv6 'destination unreachable' packet. More...
 
PACK_STRUCT_END void icmp6_input (struct pbuf *p, struct netif *inp)
 Process an input ICMPv6 message. More...
 
void icmp6_packet_too_big (struct pbuf *p, u32_t mtu)
 Send an icmpv6 'packet too big' packet. More...
 
void icmp6_param_problem (struct pbuf *p, enum icmp6_pp_code c, u32_t pointer)
 Send an icmpv6 'parameter problem' packet. More...
 
void icmp6_time_exceeded (struct pbuf *p, enum icmp6_te_code c)
 Send an icmpv6 'time exceeded' packet. More...
 

Variables

PACK_STRUCT_BEGIN struct icmp6_hdr PACK_STRUCT_STRUCT
 

Enumerator
ICMP6_DUR_NO_ROUTE 
ICMP6_DUR_PROHIBITED 
ICMP6_DUR_SCOPE 
ICMP6_DUR_ADDRESS 
ICMP6_DUR_PORT 
ICMP6_DUR_POLICY 
ICMP6_DUR_REJECT_ROUTE 
Enumerator
ICMP6_PP_FIELD 
ICMP6_PP_HEADER 
ICMP6_PP_OPTION 
Enumerator
ICMP6_TE_HL 
ICMP6_TE_FRAG 
enum icmp6_type
Enumerator
ICMP6_TYPE_DUR 
ICMP6_TYPE_PTB 
ICMP6_TYPE_TE 
ICMP6_TYPE_PP 
ICMP6_TYPE_PE1 
ICMP6_TYPE_PE2 
ICMP6_TYPE_RSV_ERR 
ICMP6_TYPE_EREQ 
ICMP6_TYPE_EREP 
ICMP6_TYPE_MLQ 
ICMP6_TYPE_MLR 
ICMP6_TYPE_MLD 
ICMP6_TYPE_RS 
ICMP6_TYPE_RA 
ICMP6_TYPE_NS 
ICMP6_TYPE_NA 
ICMP6_TYPE_RD 
ICMP6_TYPE_MRA 
ICMP6_TYPE_MRS 
ICMP6_TYPE_MRT 
ICMP6_TYPE_PE3 
ICMP6_TYPE_PE4 
ICMP6_TYPE_RSV_INF 

void icmp6_dest_unreach ( struct pbuf p,
enum icmp6_dur_code  c 
)

Send an icmpv6 'destination unreachable' packet.

Parameters
pthe input packet for which the 'unreachable' should be sent, p->payload pointing to the IPv6 header
cICMPv6 code for the unreachable type

References icmp6_send_response(), and ICMP6_TYPE_DUR.

PACK_STRUCT_END void icmp6_input ( struct pbuf p,
struct netif inp 
)

Process an input ICMPv6 message.

Called by ip6_input.

Will generate a reply for echo requests. Other messages are forwarded to nd6_input, or mld6_input.

Parameters
pthe mld packet, p->payload pointing to the icmpv6 header
inpthe netif on which this packet was received

References ERR_OK, ICMP6_STATS_INC, ICMP6_TYPE_EREP, ICMP6_TYPE_EREQ, ICMP6_TYPE_MLD, ICMP6_TYPE_MLQ, ICMP6_TYPE_MLR, ICMP6_TYPE_NA, ICMP6_TYPE_NS, ICMP6_TYPE_PTB, ICMP6_TYPE_RA, ICMP6_TYPE_RD, ICMP6_TYPE_RS, if(), ip6_addr_ismulticast, ip6_chksum_pseudo(), ip6_current_dest_addr, ip6_current_src_addr, IP6_NEXTH_ICMP6, ip6_output_if(), ip6_select_source_address(), pbuf::len, mld6_input(), nd6_input(), NULL, pbuf::payload, pbuf_alloc(), pbuf_copy(), pbuf_free(), PBUF_IP, PBUF_RAM, and pbuf::tot_len.

Referenced by ip6_input().

void icmp6_packet_too_big ( struct pbuf p,
u32_t  mtu 
)

Send an icmpv6 'packet too big' packet.

Parameters
pthe input packet for which the 'packet too big' should be sent, p->payload pointing to the IPv6 header
mtuthe maximum mtu that we can accept

References icmp6_send_response(), and ICMP6_TYPE_PTB.

void icmp6_param_problem ( struct pbuf p,
enum icmp6_pp_code  c,
u32_t  pointer 
)

Send an icmpv6 'parameter problem' packet.

Parameters
pthe input packet for which the 'param problem' should be sent, p->payload pointing to the IP header
cICMPv6 code for the param problem type
pointerthe pointer to the byte where the parameter is found

References icmp6_send_response(), and ICMP6_TYPE_PP.

Referenced by ip6_input().

void icmp6_time_exceeded ( struct pbuf p,
enum icmp6_te_code  c 
)

Send an icmpv6 'time exceeded' packet.

Parameters
pthe input packet for which the 'unreachable' should be sent, p->payload pointing to the IPv6 header
cICMPv6 code for the time exceeded type

References icmp6_send_response(), and ICMP6_TYPE_TE.

Referenced by ip6_reass_free_complete_datagram().