5 bool do_igmp_set (int argc, const char **argv, struct ngadmin *nga)
12 printf("usage: igmp set <enable> <vlan> <validate> <block>\n");
16 if (ngadmin_getCurrentSwitch(nga) == NULL) {
17 printf("must be logged\n");
21 ic.enable = strtol(argv[0], NULL, 0);
22 ic.vlan = strtol(argv[1], NULL, 0);
23 ic.validate = strtol(argv[2], NULL, 0);
24 ic.block = strtol(argv[3], NULL, 0);
26 i = ngadmin_setIGMPConf(nga, &ic);
34 bool do_igmp_show (int argc, const char **argv UNUSED, struct ngadmin *nga)
37 const struct swi_attr *sa;
43 printf("this command takes no argument\n");
48 sa = ngadmin_getCurrentSwitch(nga);
50 printf("must be logged\n");
55 i = ngadmin_getIGMPConf(nga, &ic);
62 printf("IGMP snooping enabled: %s\n", ic.enable ? "yes" : "no" );
63 printf("IGMP snooping vlan: %u\n", ic.vlan);
64 printf("Validate IGMPv3 headers: %s\n", ic.validate ? "yes" : "no" );
65 printf("Block unknown multicast addresses: %s\n", ic.block ? "yes" : "no" );