1
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
68
69
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* ... */
/* ... */
#ifndef LWIP_HDR_PROT_ICMP_H
#define LWIP_HDR_PROT_ICMP_H
#include "lwip/arch.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ICMP_ER 0
#define ICMP_DUR 3
#define ICMP_SQ 4
#define ICMP_RD 5
#define ICMP_ECHO 8
#define ICMP_TE 11
#define ICMP_PP 12
#define ICMP_TS 13
#define ICMP_TSR 14
#define ICMP_IRQ 15
#define ICMP_IR 16
#define ICMP_AM 17
#define ICMP_AMR 18
13 defines
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/bpstruct.h"
#endif
/* ... */
PACK_STRUCT_BEGIN
struct icmp_echo_hdr {
PACK_STRUCT_FLD_8(u8_t type);
PACK_STRUCT_FLD_8(u8_t code);
PACK_STRUCT_FIELD(u16_t chksum);
PACK_STRUCT_FIELD(u16_t id);
PACK_STRUCT_FIELD(u16_t seqno);
...} PACK_STRUCT_STRUCT;
PACK_STRUCT_END
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/epstruct.h"
#endif
#define ICMPH_TYPE(hdr) ((hdr)->type)
#define ICMPH_CODE(hdr) ((hdr)->code)
#define ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t))
#define ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c))
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif