Helper Reference Manual  1.7.1
icmp.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2014-2018 Linaro Limited
3  */
4 
5 
12 #ifndef ODPH_ICMP_H_
13 #define ODPH_ICMP_H_
14 
15 #include <odp_api.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
27 #define ODPH_ICMPHDR_LEN 8
28 
30 typedef struct ODP_PACKED {
31  uint8_t type;
32  uint8_t code;
33  odp_u16sum_t chksum;
35  union {
37  struct {
38  odp_u16be_t id;
39  odp_u16be_t sequence;
40  } echo;
41  odp_u32be_t gateway;
43  struct {
44  odp_u16be_t __unused;
45  odp_u16be_t mtu;
46  } frag;
47  } un;
49 
50 #define ODPH_ICMP_ECHOREPLY 0
51 #define ODPH_ICMP_ECHO 8
54 ODP_STATIC_ASSERT(sizeof(odph_icmphdr_t) == ODPH_ICMPHDR_LEN,
55  "ODPH_ICMPHDR_T__SIZE_ERROR");
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif
#define ODPH_ICMPHDR_LEN
ICMP header length.
Definition: icmp.h:27
struct ODP_PACKED odph_icmphdr_t
ICMP header.
Ethernet MAC address.
Definition: eth.h:54
struct ODP_PACKED::@0::@2 frag
Fields used for ICMP frag msgs.
uint8_t type
message type
Definition: icmp.h:31
union ODP_PACKED::@0 un
Variant mappings of ICMP fields.
odp_u16sum_t chksum
checksum of icmp header
Definition: icmp.h:33
odp_u16be_t sequence
sequence
Definition: icmp.h:39
odp_u16be_t __unused
Definition: icmp.h:44
odp_u32be_t gateway
gateway address
Definition: icmp.h:41
struct ODP_PACKED::@0::@1 echo
Fields used for ICMP echo msgs.
odp_u16be_t mtu
mtu
Definition: icmp.h:45
odp_u16be_t id
id
Definition: icmp.h:38
uint8_t code
type sub-code
Definition: icmp.h:32