# icmp.h File Reference

`#include "net/arch.h"`
`#include "net/opt.h"`
`#include "net/pbuf.h"`
`#include "net/netif.h"`

Go to the source code of this file.

## Data Structures

struct | icmp_dur_hdr
struct | icmp_echo_hdr
struct | icmp_te_hdr

## Defines

#define | ICMP_DUR 3
#define | ICMP_ECHO 8
#define | ICMP_ER 0
#define | ICMP_IR 16
#define | ICMP_IRQ 15
#define | ICMP_PP 12
#define | ICMP_RD 5
#define | ICMP_SQ 4
#define | ICMP_TE 11
#define | ICMP_TS 13
#define | ICMP_TSR 14
#define | ICMPH_CODE(hdr) (NTOHS((hdr)->_type_code) & 0xff)
#define | ICMPH_CODE_SET(hdr, code) ((hdr)->_type_code = HTONS((code) | (ICMPH_TYPE(hdr) << 8)))
#define | ICMPH_TYPE(hdr) (NTOHS((hdr)->_type_code) >> 8)
#define | ICMPH_TYPE_SET(hdr, type) ((hdr)->_type_code = HTONS(ICMPH_CODE(hdr) | ((type) << 8)))

## 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_dest_unreach (struct pbuf *p, enum icmp_dur_type t)
void | icmp_input (struct pbuf *p, struct netif *inp)
void | icmp_time_exceeded (struct pbuf *p, enum icmp_te_type t)

## Variables

icmp_te_hdr | PACK_STRUCT_STRUCT
icmp_dur_hdr | PACK_STRUCT_STRUCT
icmp_echo_hdr | PACK_STRUCT_STRUCT

## Define Documentation

#define ICMP_DUR 3

Definition at line 46 of file icmp.h.

#define ICMP_ECHO 8

Definition at line 49 of file icmp.h.

#define ICMP_ER 0

Definition at line 45 of file icmp.h.

#define ICMP_IR 16

Definition at line 55 of file icmp.h.

#define ICMP_IRQ 15

Definition at line 54 of file icmp.h.

#define ICMP_PP 12

Definition at line 51 of file icmp.h.

#define ICMP_RD 5

Definition at line 48 of file icmp.h.

#define ICMP_SQ 4

Definition at line 47 of file icmp.h.

#define ICMP_TE 11

Definition at line 50 of file icmp.h.

#define ICMP_TS 13

Definition at line 52 of file icmp.h.

#define ICMP_TSR 14

Definition at line 53 of file icmp.h.

#define ICMPH_CODE | ( | hdr |  | ) | (NTOHS((hdr)->_type_code) & 0xff)

Definition at line 98 of file icmp.h.

#define ICMPH_CODE_SET | ( | hdr,
|  | code |  | ) | ((hdr)->_type_code = HTONS((code) | (ICMPH_TYPE(hdr) << 8)))

Definition at line 101 of file icmp.h.

#define ICMPH_TYPE | ( | hdr |  | ) | (NTOHS((hdr)->_type_code) >> 8)

Definition at line 97 of file icmp.h.

#define ICMPH_TYPE_SET | ( | hdr,
|  | type |  | ) | ((hdr)->_type_code = HTONS(ICMPH_CODE(hdr) | ((type) << 8)))

Definition at line 100 of file icmp.h.

## Enumeration Type Documentation

enum icmp_dur_type

Enumerator:

  ICMP_DUR_NET |
  ICMP_DUR_HOST |
  ICMP_DUR_PROTO |
  ICMP_DUR_PORT |
  ICMP_DUR_FRAG |
  ICMP_DUR_SR |

Definition at line 57 of file icmp.h.

enum icmp_te_type

Enumerator:

  ICMP_TE_TTL |
  ICMP_TE_FRAG |

Definition at line 66 of file icmp.h.

## Function Documentation

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

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

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

## Variable Documentation

struct icmp_te_hdr PACK_STRUCT_STRUCT

struct icmp_dur_hdr PACK_STRUCT_STRUCT

struct icmp_echo_hdr PACK_STRUCT_STRUCT