packets: Add igmp header definitions
authorDaniel Borkmann <dborkman@redhat.com>
Fri, 11 Apr 2014 21:34:07 +0000 (18:34 -0300)
committerBen Pfaff <blp@nicira.com>
Mon, 19 May 2014 22:50:37 +0000 (15:50 -0700)
Add basic header structure and definitions into packet.h.

Acked-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/packets.h

index f294d84..10eac67 100644 (file)
@@ -508,6 +508,21 @@ struct icmp_header {
 };
 BUILD_ASSERT_DECL(ICMP_HEADER_LEN == sizeof(struct icmp_header));
 
+#define IGMP_HEADER_LEN 8
+struct igmp_header {
+    uint8_t igmp_type;
+    uint8_t igmp_code;
+    ovs_be16 igmp_csum;
+    ovs_16aligned_be32 group;
+};
+BUILD_ASSERT_DECL(IGMP_HEADER_LEN == sizeof(struct igmp_header));
+
+#define IGMP_HOST_MEMBERSHIP_QUERY    0x11 /* From RFC1112 */
+#define IGMP_HOST_MEMBERSHIP_REPORT   0x12 /* Ditto */
+#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x12 */
+#define IGMP_HOST_LEAVE_MESSAGE       0x17
+#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x12 */
+
 #define SCTP_HEADER_LEN 12
 struct sctp_header {
     ovs_be16 sctp_src;