[ovs-dev] [PATCH v4 01/17] packets: Define ICMP types.

Daniele Di Proietto diproiettod at vmware.com
Fri Jun 10 22:47:27 UTC 2016


Linux and FreeBSD have slightly different names for these constants.
Windows doesn't define them.  It is simpler to redefine them from
scratch for OVS.  The new names are different than those used in Linux
and FreeBSD.

These definitions will be used by a future commit.

Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>
Acked-by: Joe Stringer <joe at ovn.org>
Acked-by: Flavio Leitner <fbl at sysclose.org>
Acked-by: Ryan Moats <rmoats at us.ibm.com>
---
 lib/packets.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/packets.h b/lib/packets.h
index 5945940..2594c86 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -611,9 +611,21 @@ struct ip_header {
     ovs_16aligned_be32 ip_src;
     ovs_16aligned_be32 ip_dst;
 };
-
 BUILD_ASSERT_DECL(IP_HEADER_LEN == sizeof(struct ip_header));
 
+/* ICMPv4 types. */
+#define ICMP4_ECHO_REPLY 0
+#define ICMP4_DST_UNREACH 3
+#define ICMP4_SOURCEQUENCH 4
+#define ICMP4_REDIRECT 5
+#define ICMP4_ECHO_REQUEST 8
+#define ICMP4_TIME_EXCEEDED 11
+#define ICMP4_PARAM_PROB 12
+#define ICMP4_TIMESTAMP 13
+#define ICMP4_TIMESTAMPREPLY 14
+#define ICMP4_INFOREQUEST 15
+#define ICMP4_INFOREPLY 16
+
 #define ICMP_HEADER_LEN 8
 struct icmp_header {
     uint8_t icmp_type;
-- 
2.8.1




More information about the dev mailing list