2005-06-01 22:22:14 +00:00
|
|
|
#ifndef IGMP_H
|
|
|
|
#define IGMP_H
|
|
|
|
|
|
|
|
#include "stdint.h"
|
2006-03-23 16:45:01 +00:00
|
|
|
#include <gpxe/in.h>
|
2005-03-08 18:53:11 +00:00
|
|
|
|
|
|
|
#define IGMP_QUERY 0x11
|
|
|
|
#define IGMPv1_REPORT 0x12
|
|
|
|
#define IGMPv2_REPORT 0x16
|
|
|
|
#define IGMP_LEAVE 0x17
|
|
|
|
#define GROUP_ALL_HOSTS 0xe0000001 /* 224.0.0.1 Host byte order */
|
|
|
|
|
2005-06-01 22:22:14 +00:00
|
|
|
#define MULTICAST_MASK 0xf0000000
|
|
|
|
#define MULTICAST_NETWORK 0xe0000000
|
|
|
|
|
|
|
|
enum {
|
|
|
|
IGMP_SERVER,
|
|
|
|
MAX_IGMP
|
|
|
|
};
|
|
|
|
|
2005-03-08 18:53:11 +00:00
|
|
|
struct igmp {
|
2005-06-01 22:22:14 +00:00
|
|
|
uint8_t type;
|
|
|
|
uint8_t response_time;
|
|
|
|
uint16_t chksum;
|
|
|
|
struct in_addr group;
|
2005-03-08 18:53:11 +00:00
|
|
|
} PACKED;
|
|
|
|
|
|
|
|
struct igmp_ip_t { /* Format of an igmp ip packet */
|
|
|
|
struct iphdr ip;
|
|
|
|
uint8_t router_alert[4]; /* Router alert option */
|
|
|
|
struct igmp igmp;
|
|
|
|
} PACKED;
|
|
|
|
|
2005-06-01 22:22:14 +00:00
|
|
|
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 */
|