Update NetProto.h to include ICMP and ICMPv6 types. Update ICMP header to
keep it consistent with KVM. Add UDP and ICMP min length definitions.

Signed-off-by: Sairam Venugopal <vsai...@vmware.com>
---
 datapath-windows/ovsext/NetProto.h | 53 +++++++++++++++++++++++++++++++++-----
 1 file changed, 46 insertions(+), 7 deletions(-)

diff --git a/datapath-windows/ovsext/NetProto.h 
b/datapath-windows/ovsext/NetProto.h
index c18135c..f7527f8 100644
--- a/datapath-windows/ovsext/NetProto.h
+++ b/datapath-windows/ovsext/NetProto.h
@@ -39,7 +39,9 @@ typedef struct EthHdr {
 #define IP_HDR_MIN_LENGTH      20
 #define TCP_HDR_MIN_LENGTH     20
 #define TCP_CSUM_OFFSET        16
+#define UDP_HDR_MIN_LENGTH     8
 #define UDP_CSUM_OFFSET        6
+#define ICMP_HDR_MIN_LENGTH    8
 #define ICMP_CSUM_OFFSET       2
 #define INET_CSUM_LENGTH       (sizeof(UINT16))
 
@@ -99,10 +101,6 @@ typedef UINT64 IP6UnitLength;
 #define IPPROTO_DSTOPTS         60              /* Destination options header 
*/
 #define IPPROTO_ETHERIP         97              /* etherIp tunneled protocol */
 
-/* ICMPv6 types. */
-#define ND_NEIGHBOR_SOLICIT 135     /* neighbor solicitation */
-#define ND_NEIGHBOR_ADVERT  136     /* neighbor advertisment */
-
 /* IPv6 Neighbor discovery option header. */
 #define ND_OPT_SOURCE_LINKADDR  1
 #define ND_OPT_TARGET_LINKADDR  2
@@ -121,9 +119,39 @@ typedef UINT64 IP6UnitLength;
 #define RARPOP_REQUEST_NBO 0x0300       /* NBO RARP request.  */
 #define RARPOP_REPLY_NBO   0x0300       /* NBO RARP reply.    */
 
-#define ICMP_ECHO          8    /* Echo Request */
-#define ICMP_ECHOREPLY     0    /* Echo Reply */
-#define ICMP_DEST_UNREACH  3    /* Destination Unreachable */
+/* ICMPv4 types. */
+#define ICMP4_ECHO_REPLY         0       /* Echo Reply                   */
+#define ICMP4_DEST_UNREACH       3       /* Destination Unreachable      */
+#define ICMP4_SOURCE_QUENCH      4       /* Source Quench                */
+#define ICMP4_REDIRECT           5       /* Redirect (change route)      */
+#define ICMP4_ECHO_REQUEST       8       /* Echo Request                 */
+#define ICMP4_ROUTER_ADVERT      9       /* Router Advert                */
+#define ICMP4_ROUTER_SOLICIT     10      /* Router Solicit               */
+#define ICMP4_TIME_EXCEEDED      11      /* Time Exceeded                */
+#define ICMP4_PARAM_PROB         12      /* Parameter Problem            */
+#define ICMP4_TIMESTAMP_REQUEST  13      /* Timestamp Request            */
+#define ICMP4_TIMESTAMP_REPLY    14      /* Timestamp Reply              */
+#define ICMP4_INFO_REQUEST       15      /* Information Request          */
+#define ICMP4_INFO_REPLY         16      /* Information Reply            */
+#define ICMP4_MASK_REQUEST       17      /* Address Mask Request         */
+#define ICMP4_MASK_REPLY         18      /* Address Mask Reply           */
+
+/* ICMPv6 types. */
+#define ICMP6_DST_UNREACH          1
+#define ICMP6_PACKET_TOO_BIG       2
+#define ICMP6_TIME_EXCEEDED        3
+#define ICMP6_PARAM_PROB           4
+#define ICMP6_ECHO_REQUEST         128
+#define ICMP6_ECHO_REPLY           129
+#define ICMP6_MEMBERSHIP_QUERY     130
+#define ICMP6_MEMBERSHIP_REPORT    131
+#define ICMP6_MEMBERSHIP_REDUCTION 132
+#define ND_ROUTER_SOLICIT          133
+#define ND_ROUTER_ADVERT           134
+#define ND_NEIGHBOR_SOLICIT        135     /* neighbor solicitation */
+#define ND_NEIGHBOR_ADVERT         136     /* neighbor advertisment */
+#define ND_REDIRECT                137
+
 
 /* IGMP related constants */
 #define IGMP_UNKNOWN    0x00    /* For IGMP packets where we don't know the 
type */
@@ -273,6 +301,17 @@ typedef struct ICMPHdr {
    UINT8    type;
    UINT8    code;
    UINT16   checksum;
+   union {
+        struct {
+            UINT16 id;
+            UINT16 seq;
+        } echo;
+        struct {
+            UINT16 empty;
+            UINT16 mtu;
+        } frag;
+        UINT32 gateway;
+    } fields;
 } ICMPHdr;
 
 typedef struct ICMPEcho {
-- 
2.5.0.windows.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to