summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authormonthadar <monthadar@FreeBSD.org>2013-02-07 21:29:48 +0000
committermonthadar <monthadar@FreeBSD.org>2013-02-07 21:29:48 +0000
commit3e303ed5b8de97909718241e4218ae04b7a1c8da (patch)
treee791102d12ca4668417656d898f09b805b93d297 /sys/net80211
parent422806540dea1e01868b6ba5127e297b53892a07 (diff)
downloadFreeBSD-src-3e303ed5b8de97909718241e4218ae04b7a1c8da.zip
FreeBSD-src-3e303ed5b8de97909718241e4218ae04b7a1c8da.tar.gz
Update ddb to print mesh routing table.
* Modified _db_show_vap and _db_show_com to print mesh routing table if the 'm' modifier is specified; Approved by: adrian (mentor)
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_ddb.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c
index c869571..6f7dabf 100644
--- a/sys/net80211/ieee80211_ddb.c
+++ b/sys/net80211/ieee80211_ddb.c
@@ -63,9 +63,9 @@ __FBSDID("$FreeBSD$");
} while (0)
static void _db_show_sta(const struct ieee80211_node *);
-static void _db_show_vap(const struct ieee80211vap *, int);
+static void _db_show_vap(const struct ieee80211vap *, int, int);
static void _db_show_com(const struct ieee80211com *,
- int showvaps, int showsta, int showprocs);
+ int showvaps, int showsta, int showmesh, int showprocs);
static void _db_show_node_table(const char *tag,
const struct ieee80211_node_table *);
@@ -103,7 +103,7 @@ DB_SHOW_COMMAND(statab, db_show_statab)
DB_SHOW_COMMAND(vap, db_show_vap)
{
- int i, showprocs = 0;
+ int i, showmesh = 0, showprocs = 0;
if (!have_addr) {
db_printf("usage: show vap <addr>\n");
@@ -113,18 +113,22 @@ DB_SHOW_COMMAND(vap, db_show_vap)
switch (modif[i]) {
case 'a':
showprocs = 1;
+ showmesh = 1;
+ break;
+ case 'm':
+ showmesh = 1;
break;
case 'p':
showprocs = 1;
break;
}
- _db_show_vap((const struct ieee80211vap *) addr, showprocs);
+ _db_show_vap((const struct ieee80211vap *) addr, showmesh, showprocs);
}
DB_SHOW_COMMAND(com, db_show_com)
{
const struct ieee80211com *ic;
- int i, showprocs = 0, showvaps = 0, showsta = 0;
+ int i, showprocs = 0, showvaps = 0, showsta = 0, showmesh = 0;
if (!have_addr) {
db_printf("usage: show com <addr>\n");
@@ -133,11 +137,14 @@ DB_SHOW_COMMAND(com, db_show_com)
for (i = 0; modif[i] != '\0'; i++)
switch (modif[i]) {
case 'a':
- showsta = showvaps = showprocs = 1;
+ showsta = showmesh = showvaps = showprocs = 1;
break;
case 's':
showsta = 1;
break;
+ case 'm':
+ showmesh = 1;
+ break;
case 'v':
showvaps = 1;
break;
@@ -147,7 +154,7 @@ DB_SHOW_COMMAND(com, db_show_com)
}
ic = (const struct ieee80211com *) addr;
- _db_show_com(ic, showvaps, showsta, showprocs);
+ _db_show_com(ic, showvaps, showsta, showmesh, showprocs);
}
DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps)
@@ -178,7 +185,7 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps)
vap->iv_ifp->if_xname, vap);
db_printf("\n");
} else
- _db_show_com(ic, 1, 1, 1);
+ _db_show_com(ic, 1, 1, 1, 1);
}
}
}
@@ -330,7 +337,7 @@ _db_show_tdma(const char *sep, const struct ieee80211_tdma_state *ts, int showpr
#endif /* IEEE80211_SUPPORT_TDMA */
static void
-_db_show_vap(const struct ieee80211vap *vap, int showprocs)
+_db_show_vap(const struct ieee80211vap *vap, int showmesh, int showprocs)
{
const struct ieee80211com *ic = vap->iv_ic;
int i;
@@ -341,6 +348,10 @@ _db_show_vap(const struct ieee80211vap *vap, int showprocs)
db_printf("\n");
db_printf("\topmode %s", ieee80211_opmode_name[vap->iv_opmode]);
+#ifdef IEEE80211_SUPPORT_MESH
+ if (vap->iv_opmode == IEEE80211_M_MBSS)
+ db_printf("(%p)", vap->iv_mesh);
+#endif
db_printf(" state %s", ieee80211_state_name[vap->iv_state]);
db_printf(" ifp %p(%s)", vap->iv_ifp, vap->iv_ifp->if_xname);
db_printf("\n");
@@ -472,6 +483,10 @@ _db_show_vap(const struct ieee80211vap *vap, int showprocs)
db_printf(" acl %p", vap->iv_acl);
db_printf(" as %p", vap->iv_as);
db_printf("\n");
+#ifdef IEEE80211_SUPPORT_MESH
+ if (showmesh && vap->iv_mesh != NULL)
+ _db_show_mesh(vap->iv_mesh);
+#endif
#ifdef IEEE80211_SUPPORT_TDMA
if (vap->iv_tdma != NULL)
_db_show_tdma("\t", vap->iv_tdma, showprocs);
@@ -495,7 +510,8 @@ _db_show_vap(const struct ieee80211vap *vap, int showprocs)
}
static void
-_db_show_com(const struct ieee80211com *ic, int showvaps, int showsta, int showprocs)
+_db_show_com(const struct ieee80211com *ic, int showvaps, int showsta,
+ int showmesh, int showprocs)
{
struct ieee80211vap *vap;
@@ -651,7 +667,7 @@ _db_show_com(const struct ieee80211com *ic, int showvaps, int showsta, int showp
if (showvaps && !TAILQ_EMPTY(&ic->ic_vaps)) {
db_printf("\n");
TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
- _db_show_vap(vap, showprocs);
+ _db_show_vap(vap, showmesh, showprocs);
}
if (showsta && !TAILQ_EMPTY(&ic->ic_sta.nt_node)) {
const struct ieee80211_node_table *nt = &ic->ic_sta;
OpenPOWER on IntegriCloud