svn commit: r191641 - projects/mesh11s/sbin/ifconfig
Rui Paulo
rpaulo at FreeBSD.org
Tue Apr 28 22:27:23 UTC 2009
Author: rpaulo
Date: Tue Apr 28 22:27:22 2009
New Revision: 191641
URL: http://svn.freebsd.org/changeset/base/191641
Log:
Sync with latest modifications to meshconf IE struct.
Sponsored by: The FreeBSD Foundation
Modified:
projects/mesh11s/sbin/ifconfig/ifieee80211.c
Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c
==============================================================================
--- projects/mesh11s/sbin/ifconfig/ifieee80211.c Tue Apr 28 21:48:07 2009 (r191640)
+++ projects/mesh11s/sbin/ifconfig/ifieee80211.c Tue Apr 28 22:27:22 2009 (r191641)
@@ -83,6 +83,7 @@
#include <net80211/ieee80211_freebsd.h>
#include <net80211/ieee80211_superg.h>
#include <net80211/ieee80211_tdma.h>
+#include <net80211/ieee80211_mesh.h>
#include <assert.h>
#include <ctype.h>
@@ -2502,10 +2503,9 @@ printathie(const char *tag, const u_int8
static void
printmeshconf(const char *tag, const uint8_t *ie, size_t ielen, int maxlen)
{
-#define MATCHOUI(bitfield, oui, value, string) \
+#define MATCHOUI(field, oui, string) \
do { \
- if (((htonl(bitfield)) >> 8) == oui && \
- ((htonl(bitfield)) & 0xff) == value) \
+ if (memcmp(field, oui, 4) == 0) \
printf("%s", string); \
} while (0)
@@ -2513,21 +2513,27 @@ do { \
if (verbose) {
const struct ieee80211_meshconf_ie *mconf =
(const struct ieee80211_meshconf_ie *)ie;
- printf("<v%d APSPI:", mconf->conf_ver);
- MATCHOUI(mconf->conf_apspi, IEEE80211_MESHCONF_APSPI_HWMP_OUI,
- IEEE80211_MESHCONF_APSPI_HWMP_VALUE, "HWMP");
- printf(" APSMI:");
- MATCHOUI(mconf->conf_apsmi,
- IEEE80211_MESHCONF_APSMI_AIRTIME_OUI,
- IEEE80211_MESHCONF_APSMI_AIRTIME_VALUE, "AIRTIME");
- printf(" CCMI:");
- MATCHOUI(mconf->conf_ccmi, IEEE80211_MESHCONF_CCMI_DEFAULT_OUI,
- IEEE80211_MESHCONF_CCMI_DEFAULT_VALUE, "DEFAULT");
- MATCHOUI(mconf->conf_ccmi, IEEE80211_MESHCONF_CCMI_NULL_OUI,
- IEEE80211_MESHCONF_CCMI_NULL_VALUE, "NULL");
- printf(" FORM:0x%x CAPS:0x%x", mconf->conf_finfo,
+ const uint8_t null[4] = IEEE80211_MESHCONF_NULL;
+ const uint8_t hwmp[4] = IEEE80211_MESHCONF_HWMP;
+ const uint8_t airtime[4] = IEEE80211_MESHCONF_AIRTIME;
+ const uint8_t ccsig[4] = IEEE80211_MESHCONF_CCSIG;
+ const uint8_t sae[4] = IEEE80211_MESHCONF_SAE;
+ const uint8_t neighoff[4] = IEEE80211_MESHCONF_SAE;
+ printf("<v%d PATH:", mconf->conf_ver);
+ MATCHOUI(mconf->conf_pselid, hwmp, "HWMP");
+ printf(" LINK:");
+ MATCHOUI(mconf->conf_pmetid, airtime, "AIRTIME");
+ printf(" CONGESTION:");
+ MATCHOUI(mconf->conf_ccid, ccsig, "SIG");
+ MATCHOUI(mconf->conf_ccid, null, "NULL");
+ printf(" SYNC:");
+ MATCHOUI(mconf->conf_syncid, neighoff, "NEIGHOFF");
+ MATCHOUI(mconf->conf_syncid, null, "NULL");
+ printf(" AUTH:");
+ MATCHOUI(mconf->conf_authid, sae, "SAE");
+ MATCHOUI(mconf->conf_authid, null, "NULL");
+ printf(" FORM:0x%x CAPS:0x%x>", mconf->conf_form,
mconf->conf_cap);
- printf(">");
}
#undef MATCHOUI
}
More information about the svn-src-projects
mailing list