d0309537ed873701254b0ffe47d6b1a5656136b0
[dpdk.git] / lib / librte_net / rte_icmp.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 1982, 1986, 1990, 1993
3  *      The Regents of the University of California.
4  * Copyright(c) 2013 6WIND S.A.
5  * All rights reserved.
6  */
7
8 #ifndef _RTE_ICMP_H_
9 #define _RTE_ICMP_H_
10
11 /**
12  * @file
13  *
14  * ICMP-related defines
15  */
16
17 #include <stdint.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 /**
24  * ICMP Header
25  */
26 struct rte_icmp_hdr {
27         uint8_t  icmp_type;   /* ICMP packet type. */
28         uint8_t  icmp_code;   /* ICMP packet code. */
29         uint16_t icmp_cksum;  /* ICMP packet checksum. */
30         uint16_t icmp_ident;  /* ICMP packet identifier. */
31         uint16_t icmp_seq_nb; /* ICMP packet sequence number. */
32 } __attribute__((__packed__));
33
34 /* ICMP packet types */
35 #define IP_ICMP_ECHO_REPLY   0
36 #define IP_ICMP_ECHO_REQUEST 8
37
38 #ifdef __cplusplus
39 }
40 #endif
41
42 #endif /* RTE_ICMP_H_ */