svn commit: r297010 - head/sbin/ifconfig

Adrian Chadd adrian at FreeBSD.org
Fri Mar 18 04:22:09 UTC 2016


Author: adrian
Date: Fri Mar 18 04:22:07 2016
New Revision: 297010
URL: https://svnweb.freebsd.org/changeset/base/297010

Log:
  Add parsing for AP channel report IE.
  
  Eg:
  
  TP-LINK_D579                     60:e3:27:e1:d5:79   10   54M  -72:-95   100 EP   SSID<TP-LINK_D579> RATES<B2,B4,B11,B22,18,36,72,108>
      DSPARMS<10> XRATES<12,24,48,96> COUNTRY<US  1-11,20> APCHANREP<class 32, chan:[1,2,3,4,5,6,7]> APCHANREP<class 33, chan:[5,6,7,8,9,10,11]>
      TIM<050400010000> ERP<0x4> HTCAP<cap 0x106e param 0x17 mcsset[0-15,32] extcap 0x0 txbf 0x0 antenna 0x0> HTINFO<ctl 10, 7,0,0,0 basicmcs[]>
      ???<4a0e14000a002c01c800140005001900> RSN<v1 mc:AES-CCMP uc:AES-CCMP km:8021X-PSK>
      WME<qosinfo 0x0 BE[aifsn 3 cwmin 4 cwmax 10 txop 0] BK[aifsn 7 cwmin 4 cwmax 10 txop 0] VO[aifsn 2 cwmin 3 cwmax 4 txop 94] VI[aifsn 2 cwmin 2 cwmax 3 txop 47]>
      BSSLOAD<sta count 0, chan load 11, aac 18> VEN<dd07000c4300000000>

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==============================================================================
--- head/sbin/ifconfig/ifieee80211.c	Fri Mar 18 04:09:27 2016	(r297009)
+++ head/sbin/ifconfig/ifieee80211.c	Fri Mar 18 04:22:07 2016	(r297010)
@@ -2727,6 +2727,26 @@ printbssload(const char *tag, const uint
 	}
 }
 
+static void
+printapchanrep(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
+{
+	printf("%s", tag);
+	if (verbose) {
+		const struct ieee80211_ap_chan_report_ie *ap =
+		    (const struct ieee80211_ap_chan_report_ie *) ie;
+		const char *sep = "";
+		int i;
+
+		printf("<class %u, chan:[", ap->i_class);
+
+		for (i = 3; i < ielen; i++) {
+			printf("%s%u", sep, ie[i]);
+			sep = ",";
+		}
+		printf("]>");
+	}
+}
+
 static const char *
 wpa_cipher(const u_int8_t *sel)
 {
@@ -3129,11 +3149,8 @@ iename(int elemid)
 	case IEEE80211_ELEMID_MEASREP:	return " MEASREP";
 	case IEEE80211_ELEMID_QUIET:	return " QUIET";
 	case IEEE80211_ELEMID_IBSSDFS:	return " IBSSDFS";
-	case IEEE80211_ELEMID_APCHANREP:return " APCHANREP";
 	case IEEE80211_ELEMID_TPC:	return " TPC";
 	case IEEE80211_ELEMID_CCKM:	return " CCKM";
-	case IEEE80211_ELEMID_VHT_CAP:	return " VHTCAP";
-	case IEEE80211_ELEMID_VHT_OPMODE:	return " VHTOPMODE";
 	case IEEE80211_ELEMID_VHT_PWR_ENV:	return " VHTPWRENV";
 	}
 	return " ???";
@@ -3208,6 +3225,9 @@ printies(const u_int8_t *vp, int ielen, 
 		case IEEE80211_ELEMID_BSSLOAD:
 			printbssload(" BSSLOAD", vp, 2+vp[1], maxcols);
 			break;
+		case IEEE80211_ELEMID_APCHANREP:
+			printapchanrep(" APCHANREP", vp, 2+vp[1], maxcols);
+			break;
 		default:
 			if (verbose)
 				printie(iename(vp[0]), vp, 2+vp[1], maxcols);


More information about the svn-src-head mailing list