From: Daniel Borkmann <dbork...@redhat.com>

Add basic header structure and definitions into packet.h.

Acked-by: Thomas Graf <tg...@redhat.com>
Signed-off-by: Daniel Borkmann <dbork...@redhat.com>
Signed-off-by: Flavio Leitner <f...@redhat.com>
---
 lib/packets.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/packets.h b/lib/packets.h
index eca24d5..675dcc4 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -506,6 +506,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;
-- 
1.9.0

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

Reply via email to