PERFORCE change 130140 for review

Sam Leffler sam at FreeBSD.org
Mon Dec 3 21:20:23 PST 2007


http://perforce.freebsd.org/chv.cgi?CH=130140

Change 130140 by sam at sam_ebb on 2007/12/04 05:20:01

	sync w/ vap code

Affected files ...

.. //depot/projects/vap/tools/tools/net80211/wlanwatch/wlanwatch.c#3 edit

Differences ...

==== //depot/projects/vap/tools/tools/net80211/wlanwatch/wlanwatch.c#3 (text+ko) ====

@@ -12,14 +12,7 @@
  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
  *    redistribution must be conditioned upon including a substantially
  *    similar Disclaimer requirement for further binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
  * NO WARRANTY
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -74,6 +67,14 @@
 #include <unistd.h>
 #include <ifaddrs.h>
 
+/* XXX */
+enum ieee80211_notify_cac_event {
+	IEEE80211_NOTIFY_CAC_START  = 0, /* CAC timer started */
+	IEEE80211_NOTIFY_CAC_STOP   = 1, /* CAC intentionally stopped */
+	IEEE80211_NOTIFY_CAC_RADAR  = 2, /* CAC stopped due to radar detectio */
+	IEEE80211_NOTIFY_CAC_EXPIRE = 3, /* CAC expired w/o radar */
+};
+
 static	void print_rtmsg(struct rt_msghdr *rtm, int msglen);
 
 int	nflag = 0;
@@ -95,10 +96,7 @@
 }
 
 static void
-bprintf(fp, b, s)
-	FILE *fp;
-	int b;
-	u_char *s;
+bprintf(FILE *fp, int b, char *s)
 {
 	int i;
 	int gotsome = 0;
@@ -138,9 +136,8 @@
 char addrnames[] =
 "\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD";
 
-const char *
-routename(sa)
-	struct sockaddr *sa;
+static const char *
+routename(struct sockaddr *sa)
 {
 	char *cp;
 	static char line[MAXHOSTNAMELEN + 1];
@@ -293,7 +290,6 @@
 {
 	struct if_msghdr *ifm;
 	struct if_announcemsghdr *ifan;
-	char *state;
 	time_t now = time(NULL);
 	char *cnow = ctime(&now);
 
@@ -309,16 +305,16 @@
 			cnow, ifm->ifm_index);
 		switch (ifm->ifm_data.ifi_link_state) {
 		case LINK_STATE_DOWN:
-			state = "down";
+			printf("link: down, flags:");
 			break;
 		case LINK_STATE_UP:
-			state = "up";
+			printf("link: up, flags:");
 			break;
 		default:
-			state = "unknown";
+			printf("link: unknown<%d>, flags:",
+			    ifm->ifm_data.ifi_link_state);
 			break;
 		}
-		printf("link: %s, flags:", state);
 		bprintf(stdout, ifm->ifm_flags, ifnetflags);
 		pmsg_addrs((char *)(ifm + 1), ifm->ifm_addrs);
 		break;
@@ -391,6 +387,53 @@
 			    , V(ieee80211_michael_event)->iev_keyix
 			);
 			break;
+		case RTM_IEEE80211_WDS:
+			printf("%s wds discovery",
+			    ether_sprintf(V(ieee80211_wds_event)->iev_addr));
+			break;
+		case RTM_IEEE80211_CSA:
+			printf("channel switch announcement: channel %u (%u MHz flags 0x%x) mode %d count %d"
+			    , V(ieee80211_csa_event)->iev_ieee
+			    , V(ieee80211_csa_event)->iev_freq
+			    , V(ieee80211_csa_event)->iev_flags
+			    , V(ieee80211_csa_event)->iev_mode
+			    , V(ieee80211_csa_event)->iev_count
+			);
+			break;
+		case RTM_IEEE80211_CAC:
+			printf("channel availability check "
+			    "(channel %u, %u MHz flags 0x%x) "
+			    , V(ieee80211_cac_event)->iev_ieee
+			    , V(ieee80211_cac_event)->iev_freq
+			    , V(ieee80211_cac_event)->iev_flags
+			);
+			switch (V(ieee80211_cac_event)->iev_type) {
+			case IEEE80211_NOTIFY_CAC_START:
+				printf("start timer");
+				break;
+			case IEEE80211_NOTIFY_CAC_STOP:
+				printf("stop timer");
+				break;
+			case IEEE80211_NOTIFY_CAC_EXPIRE:
+				printf("timer expired");
+				break;
+			case IEEE80211_NOTIFY_CAC_RADAR:
+				printf("radar detected");
+				break;
+			default:
+				printf("unknown type %d",
+				   V(ieee80211_cac_event)->iev_type);
+				break;
+			}
+			break;
+		case RTM_IEEE80211_DEAUTH:
+			printf("%s wds deauth",
+			    ether_sprintf(V(ieee80211_deauth_event)->iev_addr));
+			break;
+		case RTM_IEEE80211_AUTH:
+			printf("%s node authenticate",
+			    ether_sprintf(V(ieee80211_auth_event)->iev_addr));
+			break;
 		default:
 			printf("if# %d, what: #%d",
 				ifan->ifan_index, ifan->ifan_what);


More information about the p4-projects mailing list