Deleted Added
sdiff udiff text old ( 246505 ) new ( 288305 )
full compact
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 246505 2013-02-07 21:23:03Z monthadar $
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,

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

2851#define BE_READ_2(p) \
2852 ((u_int16_t) \
2853 ((((const u_int8_t *)(p))[1] ) | \
2854 (((const u_int8_t *)(p))[0] << 8)))
2855
2856static void
2857printwpsie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2858{
2859#define N(a) (sizeof(a) / sizeof(a[0]))
2860 u_int8_t len = ie[1];
2861
2862 printf("%s", tag);
2863 if (verbose) {
2864 static const char *dev_pass_id[] = {
2865 "D", /* Default (PIN) */
2866 "U", /* User-specified */
2867 "M", /* Machine-specified */

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

2892 else
2893 printf(" st:%s", *ie == 1 ? "N" : "C");
2894 break;
2895 case IEEE80211_WPS_SELECTED_REG:
2896 printf(" sel:%s", *ie ? "T" : "F");
2897 break;
2898 case IEEE80211_WPS_DEV_PASS_ID:
2899 n = LE_READ_2(ie);
2900 if (n < N(dev_pass_id))
2901 printf(" dpi:%s", dev_pass_id[n]);
2902 break;
2903 case IEEE80211_WPS_UUID_E:
2904 printf(" uuid-e:");
2905 for (n = 0; n < (tlv_len - 1); n++)
2906 printf("%02x-", ie[n]);
2907 printf("%02x", ie[n]);
2908 break;
2909 }
2910 ie += tlv_len, len -= tlv_len;
2911 }
2912 printf(">");
2913 }
2914#undef N
2915}
2916
2917static void
2918printtdmaie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2919{
2920 printf("%s", tag);
2921 if (verbose && ielen >= sizeof(struct ieee80211_tdma_param)) {
2922 const struct ieee80211_tdma_param *tdma =

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

3413 printf("\n");
3414 cp += si->isi_len, len -= si->isi_len;
3415 } while (len >= sizeof(struct ieee80211req_sta_info));
3416}
3417
3418static const char *
3419mesh_linkstate_string(uint8_t state)
3420{
3421#define N(a) (sizeof(a) / sizeof(a[0]))
3422 static const char *state_names[] = {
3423 [0] = "IDLE",
3424 [1] = "OPEN-TX",
3425 [2] = "OPEN-RX",
3426 [3] = "CONF-RX",
3427 [4] = "ESTAB",
3428 [5] = "HOLDING",
3429 };
3430
3431 if (state >= N(state_names)) {
3432 static char buf[10];
3433 snprintf(buf, sizeof(buf), "#%u", state);
3434 return buf;
3435 } else
3436 return state_names[state];
3437#undef N
3438}
3439
3440static const char *
3441get_chaninfo(const struct ieee80211_channel *c, int precise,
3442 char buf[], size_t bsize)
3443{
3444 buf[0] = '\0';
3445 if (IEEE80211_IS_CHAN_FHSS(c))

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

5315 .af_name = "af_ieee80211",
5316 .af_af = AF_UNSPEC,
5317 .af_other_status = ieee80211_status,
5318};
5319
5320static __constructor void
5321ieee80211_ctor(void)
5322{
5323#define N(a) (sizeof(a) / sizeof(a[0]))
5324 int i;
5325
5326 for (i = 0; i < N(ieee80211_cmds); i++)
5327 cmd_register(&ieee80211_cmds[i]);
5328 af_register(&af_ieee80211);
5329 clone_setdefcallback("wlan", wlan_create);
5330#undef N
5331}