diff options
author | bz <bz@FreeBSD.org> | 2016-06-06 22:26:18 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2016-06-06 22:26:18 +0000 |
commit | cbabf9b05eb30469d91bedc8c80b9ac45eec4d40 (patch) | |
tree | cdd1b2e964233617b42b27f88b695889038b451f /sys/netinet/igmp.c | |
parent | 2919ef7927bf2497d9230fdfd7b49ce2b2effb53 (diff) | |
download | FreeBSD-src-cbabf9b05eb30469d91bedc8c80b9ac45eec4d40.zip FreeBSD-src-cbabf9b05eb30469d91bedc8c80b9ac45eec4d40.tar.gz |
Add a `show igi_list` command to DDB to debug IGMP state.
Obtained from: projects/vnet
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/netinet/igmp.c')
-rw-r--r-- | sys/netinet/igmp.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 90c00c62..1fc1812 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -50,6 +50,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/module.h> @@ -64,6 +66,10 @@ __FBSDID("$FreeBSD$"); #include <sys/ktr.h> #include <sys/condvar.h> +#ifdef DDB +#include <ddb/ddb.h> +#endif + #include <net/if.h> #include <net/if_var.h> #include <net/netisr.h> @@ -3641,6 +3647,37 @@ vnet_igmp_uninit(const void *unused __unused) VNET_SYSUNINIT(vnet_igmp_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_igmp_uninit, NULL); +#ifdef DDB +DB_SHOW_COMMAND(igi_list, db_show_igi_list) +{ + struct igmp_ifsoftc *igi, *tigi; + LIST_HEAD(_igi_list, igmp_ifsoftc) *igi_head; + + if (!have_addr) { + db_printf("usage: show igi_list <addr>\n"); + return; + } + igi_head = (struct _igi_list *)addr; + + LIST_FOREACH_SAFE(igi, igi_head, igi_link, tigi) { + db_printf("igmp_ifsoftc %p:\n", igi); + db_printf(" ifp %p\n", igi->igi_ifp); + db_printf(" version %u\n", igi->igi_version); + db_printf(" v1_timer %u\n", igi->igi_v1_timer); + db_printf(" v2_timer %u\n", igi->igi_v2_timer); + db_printf(" v3_timer %u\n", igi->igi_v3_timer); + db_printf(" flags %#x\n", igi->igi_flags); + db_printf(" rv %u\n", igi->igi_rv); + db_printf(" qi %u\n", igi->igi_qi); + db_printf(" qri %u\n", igi->igi_qri); + db_printf(" uri %u\n", igi->igi_uri); + /* SLIST_HEAD(,in_multi) igi_relinmhead */ + /* struct mbufq igi_gq; */ + db_printf("\n"); + } +} +#endif + static int igmp_modevent(module_t mod, int type, void *unused __unused) { |