icmp.h File Reference
`#include "lwip/opt.h"`
`#include "lwip/pbuf.h"`
`#include "lwip/ip_addr.h"`
`#include "lwip/netif.h"`
`#include "lwip/prot/icmp.h"`
`#include "lwip/icmp6.h"`

## Enumerations

enum | icmp_dur_type { ICMP_DUR_NET = 0, ICMP_DUR_HOST = 1, ICMP_DUR_PROTO = 2, ICMP_DUR_PORT = 3, ICMP_DUR_FRAG = 4, ICMP_DUR_SR = 5 }
enum | icmp_te_type { ICMP_TE_TTL = 0, ICMP_TE_FRAG = 1 }

## Functions

void | icmp_input (struct pbuf *p, struct netif *inp)
void | icmp_dest_unreach (struct pbuf *p, enum icmp_dur_type t)
void | icmp_time_exceeded (struct pbuf *p, enum icmp_te_type t)

## Detailed Description

ICMP API

## Enumeration Type Documentation

## icmp_dur_type

enum icmp_dur_type

ICMP destination unreachable codes

Enumerator
ICMP_DUR_NET | net unreachable
ICMP_DUR_HOST | host unreachable
ICMP_DUR_PROTO | protocol unreachable
ICMP_DUR_PORT | port unreachable
ICMP_DUR_FRAG | fragmentation needed and DF set
ICMP_DUR_SR | source route failed

## icmp_te_type

enum icmp_te_type

ICMP time exceeded codes

Enumerator
ICMP_TE_TTL | time to live exceeded in transit
ICMP_TE_FRAG | fragment reassembly time exceeded

## Function Documentation

## icmp_dest_unreach()

void icmp_dest_unreach | ( | struct pbuf * | p,
|  | enum icmp_dur_type | t
| ) |  |

Send an icmp 'destination unreachable' packet, called from ip_input() if the transport layer protocol is unknown and from udp_input() if the local port is not bound.

Parameters

  p | the input packet for which the 'unreachable' should be sent, p->payload pointing to the IP header
  t | type of the 'unreachable' packet

## icmp_input()

void icmp_input | ( | struct pbuf * | p,
|  | struct netif * | inp
| ) |  |

Processes ICMP input packets, called from ip_input().

Currently only processes icmp echo requests and sends out the echo response.

Parameters

  p | the icmp echo request packet, p->payload pointing to the icmp header
  inp | the netif on which this packet was received

## icmp_time_exceeded()

void icmp_time_exceeded | ( | struct pbuf * | p,
|  | enum icmp_te_type | t
| ) |  |

Send a 'time exceeded' packet, called from ip_forward() if TTL is 0.

Parameters

  p | the input packet for which the 'time exceeded' should be sent, p->payload pointing to the IP header
  t | type of the 'time exceeded' packet