feat: prepare structure for extra IGMP information
This commit is contained in:
parent
b7be261242
commit
98d6331ebc
1 changed files with 22 additions and 1 deletions
|
@ -1,6 +1,27 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <libnet.h>
|
||||
#include <netinet/igmp.h>
|
||||
|
||||
/* Structure to represent IGMP extra information */
|
||||
struct igmp_extra {
|
||||
u_int8_t igmp_version;
|
||||
char *igmp_tag;
|
||||
u_int8_t igmp_type; /* IGMP type */
|
||||
u_int8_t igmp_code; /* routing code */
|
||||
char *igmp_dst;
|
||||
int group_override_dst;
|
||||
} g_igmp_pkts[] = {
|
||||
/* name, type (or version+type), code */
|
||||
{ 1, "query", 0x11, 0, "224.0.0.1", 0 },
|
||||
{ 1, "report", 0x12, 0, "224.0.0.1", 1 },
|
||||
{ 1, "dvmrp", 0x13, 0, "224.0.0.1", 0 },
|
||||
{ 2, "query", 0x11, 1, "224.0.0.1", 0 },
|
||||
{ 2, "report", 0x16, 1, "224.0.0.2", 1 },
|
||||
{ 2, "leave", 0x17, 1, "224.0.0.2", 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
};
|
||||
|
||||
void usage(char *name)
|
||||
{
|
||||
|
@ -12,7 +33,6 @@ int main(int argc, char **argv)
|
|||
/* misc */
|
||||
int c;
|
||||
char *device = NULL;
|
||||
|
||||
printf("IGMP packet generator\n\n");
|
||||
|
||||
printf("Parsing command line...\n");
|
||||
|
@ -35,6 +55,7 @@ int main(int argc, char **argv)
|
|||
usage(argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("done\n");
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue