Deleted Added
full compact
ifieee80211.c (296931) ifieee80211.c (297007)
1/*
2 * Copyright 2001 The Aerospace Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*
2 * Copyright 2001 The Aerospace Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 296931 2016-03-16 06:27:57Z adrian $
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 297007 2016-03-18 03:55:57Z adrian $
28 */
29
30/*-
31 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
32 * All rights reserved.
33 *
34 * This code is derived from software contributed to The NetBSD Foundation
35 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

--- 2493 unchanged lines hidden (view full) ---

2529 const struct ieee80211_wme_info *wme =
2530 (const struct ieee80211_wme_info *) ie;
2531 printf("<version 0x%x info 0x%x>",
2532 wme->wme_version, wme->wme_info);
2533 }
2534}
2535
2536static void
28 */
29
30/*-
31 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
32 * All rights reserved.
33 *
34 * This code is derived from software contributed to The NetBSD Foundation
35 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

--- 2493 unchanged lines hidden (view full) ---

2529 const struct ieee80211_wme_info *wme =
2530 (const struct ieee80211_wme_info *) ie;
2531 printf("<version 0x%x info 0x%x>",
2532 wme->wme_version, wme->wme_info);
2533 }
2534}
2535
2536static void
2537printvhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2538{
2539 printf("%s", tag);
2540 if (verbose) {
2541 const struct ieee80211_ie_vhtcap *vhtcap =
2542 (const struct ieee80211_ie_vhtcap *) ie;
2543 uint32_t vhtcap_info = LE_READ_4(&vhtcap->vht_cap_info);
2544
2545 printf("<cap 0x%08x", vhtcap_info);
2546 printf(" rx_mcs_map 0x%x",
2547 LE_READ_2(&vhtcap->supp_mcs.rx_mcs_map));
2548 printf(" rx_highest %d",
2549 LE_READ_2(&vhtcap->supp_mcs.rx_highest) & 0x1fff);
2550 printf(" tx_mcs_map 0x%x",
2551 LE_READ_2(&vhtcap->supp_mcs.tx_mcs_map));
2552 printf(" tx_highest %d",
2553 LE_READ_2(&vhtcap->supp_mcs.tx_highest) & 0x1fff);
2554
2555 printf(">");
2556 }
2557}
2558
2559static void
2560printvhtinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2561{
2562 printf("%s", tag);
2563 if (verbose) {
2564 const struct ieee80211_ie_vht_operation *vhtinfo =
2565 (const struct ieee80211_ie_vht_operation *) ie;
2566
2567 printf("<chw %d freq1_idx %d freq2_idx %d basic_mcs_set 0x%04x>",
2568 vhtinfo->chan_width,
2569 vhtinfo->center_freq_seg1_idx,
2570 vhtinfo->center_freq_seg2_idx,
2571 LE_READ_2(&vhtinfo->basic_mcs_set));
2572 }
2573}
2574
2575static void
2537printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2538{
2539 printf("%s", tag);
2540 if (verbose) {
2541 const struct ieee80211_ie_htcap *htcap =
2542 (const struct ieee80211_ie_htcap *) ie;
2543 const char *sep;
2544 int i, j;

--- 124 unchanged lines hidden (view full) ---

2669 else
2670 printf("UNKNOWN");
2671 printf(" FORM:0x%x CAPS:0x%x>", mconf->conf_form,
2672 mconf->conf_cap);
2673 }
2674#undef MATCHOUI
2675}
2676
2576printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2577{
2578 printf("%s", tag);
2579 if (verbose) {
2580 const struct ieee80211_ie_htcap *htcap =
2581 (const struct ieee80211_ie_htcap *) ie;
2582 const char *sep;
2583 int i, j;

--- 124 unchanged lines hidden (view full) ---

2708 else
2709 printf("UNKNOWN");
2710 printf(" FORM:0x%x CAPS:0x%x>", mconf->conf_form,
2711 mconf->conf_cap);
2712 }
2713#undef MATCHOUI
2714}
2715
2716static void
2717printbssload(const char *tag, const uint8_t *ie, size_t ielen, int maxlen)
2718{
2719 printf("%s", tag);
2720 if (verbose) {
2721 const struct ieee80211_bss_load_ie *bssload =
2722 (const struct ieee80211_bss_load_ie *) ie;
2723 printf("<sta count %d, chan load %d, aac %d>",
2724 LE_READ_2(&bssload->sta_count),
2725 bssload->chan_load,
2726 bssload->aac);
2727 }
2728}
2729
2677static const char *
2678wpa_cipher(const u_int8_t *sel)
2679{
2680#define WPA_SEL(x) (((x)<<24)|WPA_OUI)
2681 u_int32_t w = LE_READ_4(sel);
2682
2683 switch (w) {
2684 case WPA_SEL(WPA_CSE_NULL):

--- 464 unchanged lines hidden (view full) ---

3149 break;
3150 case IEEE80211_ELEMID_MESHID:
3151 if (verbose)
3152 printssid(" MESHID", vp, 2+vp[1], maxcols);
3153 break;
3154 case IEEE80211_ELEMID_MESHCONF:
3155 printmeshconf(" MESHCONF", vp, 2+vp[1], maxcols);
3156 break;
2730static const char *
2731wpa_cipher(const u_int8_t *sel)
2732{
2733#define WPA_SEL(x) (((x)<<24)|WPA_OUI)
2734 u_int32_t w = LE_READ_4(sel);
2735
2736 switch (w) {
2737 case WPA_SEL(WPA_CSE_NULL):

--- 464 unchanged lines hidden (view full) ---

3202 break;
3203 case IEEE80211_ELEMID_MESHID:
3204 if (verbose)
3205 printssid(" MESHID", vp, 2+vp[1], maxcols);
3206 break;
3207 case IEEE80211_ELEMID_MESHCONF:
3208 printmeshconf(" MESHCONF", vp, 2+vp[1], maxcols);
3209 break;
3210 case IEEE80211_ELEMID_VHT_CAP:
3211 printvhtcap(" VHTCAP", vp, 2+vp[1], maxcols);
3212 break;
3213 case IEEE80211_ELEMID_VHT_OPMODE:
3214 printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols);
3215 break;
3216 case IEEE80211_ELEMID_BSSLOAD:
3217 printbssload(" BSSLOAD", vp, 2+vp[1], maxcols);
3218 break;
3157 default:
3158 if (verbose)
3159 printie(iename(vp[0]), vp, 2+vp[1], maxcols);
3160 break;
3161 }
3162 ielen -= 2+vp[1];
3163 vp += 2+vp[1];
3164 }

--- 2141 unchanged lines hidden ---
3219 default:
3220 if (verbose)
3221 printie(iename(vp[0]), vp, 2+vp[1], maxcols);
3222 break;
3223 }
3224 ielen -= 2+vp[1];
3225 vp += 2+vp[1];
3226 }

--- 2141 unchanged lines hidden ---