From cbabf9b05eb30469d91bedc8c80b9ac45eec4d40 Mon Sep 17 00:00:00 2001 From: bz Date: Mon, 6 Jun 2016 22:26:18 +0000 Subject: 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 --- sys/netinet/igmp.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'sys/netinet/igmp.c') 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 __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include #include @@ -64,6 +66,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DDB +#include +#endif + #include #include #include @@ -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 \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) { -- cgit v1.1