igmp.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _NETINET_IGMP_H
  2. #define _NETINET_IGMP_H
  3. #include <stdint.h>
  4. #include <netinet/in.h>
  5. struct igmp {
  6. uint8_t igmp_type;
  7. uint8_t igmp_code;
  8. uint16_t igmp_cksum;
  9. struct in_addr igmp_group;
  10. };
  11. #define IGMP_MINLEN 8
  12. #define IGMP_MEMBERSHIP_QUERY 0x11
  13. #define IGMP_V1_MEMBERSHIP_REPORT 0x12
  14. #define IGMP_V2_MEMBERSHIP_REPORT 0x16
  15. #define IGMP_V2_LEAVE_GROUP 0x17
  16. #define IGMP_DVMRP 0x13
  17. #define IGMP_PIM 0x14
  18. #define IGMP_TRACE 0x15
  19. #define IGMP_MTRACE_RESP 0x1e
  20. #define IGMP_MTRACE 0x1f
  21. #define IGMP_MAX_HOST_REPORT_DELAY 10
  22. #define IGMP_TIMER_SCALE 10
  23. #define IGMP_DELAYING_MEMBER 1
  24. #define IGMP_IDLE_MEMBER 2
  25. #define IGMP_LAZY_MEMBER 3
  26. #define IGMP_SLEEPING_MEMBER 4
  27. #define IGMP_AWAKENING_MEMBER 5
  28. #define IGMP_v1_ROUTER 1
  29. #define IGMP_v2_ROUTER 2
  30. #define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
  31. #define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
  32. #define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
  33. #define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
  34. #endif