diff options
Diffstat (limited to 'src/include/igmp.h')
-rw-r--r-- | src/include/igmp.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/include/igmp.h b/src/include/igmp.h index 2235d6c6..48753eab 100644 --- a/src/include/igmp.h +++ b/src/include/igmp.h @@ -1,5 +1,8 @@ -#ifndef _IGMP_H -#define _IGMP_H +#ifndef IGMP_H +#define IGMP_H + +#include "stdint.h" +#include "in.h" #define IGMP_QUERY 0x11 #define IGMPv1_REPORT 0x12 @@ -7,11 +10,19 @@ #define IGMP_LEAVE 0x17 #define GROUP_ALL_HOSTS 0xe0000001 /* 224.0.0.1 Host byte order */ +#define MULTICAST_MASK 0xf0000000 +#define MULTICAST_NETWORK 0xe0000000 + +enum { + IGMP_SERVER, + MAX_IGMP +}; + struct igmp { - uint8_t type; - uint8_t response_time; - uint16_t chksum; - in_addr group; + uint8_t type; + uint8_t response_time; + uint16_t chksum; + struct in_addr group; } PACKED; struct igmp_ip_t { /* Format of an igmp ip packet */ @@ -20,4 +31,12 @@ struct igmp_ip_t { /* Format of an igmp ip packet */ struct igmp igmp; } PACKED; -#endif /* _IGMP_H */ +struct igmptable_t { + struct in_addr group; + unsigned long time; +} PACKED; + +extern void join_group ( int slot, unsigned long group ); +extern void leave_group ( int slot ); + +#endif /* IGMP_H */ |