Deleted Added
full compact
ifieee80211.c (153892) ifieee80211.c (154522)
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 153892 2005-12-30 17:27:26Z rwatson $
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 154522 2006-01-18 17:45:38Z sam $
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,

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

843
844static void
845list_scan(int s)
846{
847 uint8_t buf[24*1024];
848 struct ieee80211req ireq;
849 char ssid[IEEE80211_NWID_LEN+1];
850 uint8_t *cp;
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,

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

843
844static void
845list_scan(int s)
846{
847 uint8_t buf[24*1024];
848 struct ieee80211req ireq;
849 char ssid[IEEE80211_NWID_LEN+1];
850 uint8_t *cp;
851 int len;
851 int len, ssidmax;
852
853 (void) memset(&ireq, 0, sizeof(ireq));
854 (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
855 ireq.i_type = IEEE80211_IOC_SCAN_RESULTS;
856 ireq.i_data = buf;
857 ireq.i_len = sizeof(buf);
858 if (ioctl(s, SIOCG80211, &ireq) < 0)
859 errx(1, "unable to get scan results");
860 len = ireq.i_len;
861 if (len < sizeof(struct ieee80211req_scan_result))
862 return;
863
852
853 (void) memset(&ireq, 0, sizeof(ireq));
854 (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
855 ireq.i_type = IEEE80211_IOC_SCAN_RESULTS;
856 ireq.i_data = buf;
857 ireq.i_len = sizeof(buf);
858 if (ioctl(s, SIOCG80211, &ireq) < 0)
859 errx(1, "unable to get scan results");
860 len = ireq.i_len;
861 if (len < sizeof(struct ieee80211req_scan_result))
862 return;
863
864 printf("%-32.32s %-17.17s %4s %4s %-5s %3s %4s\n"
865 , "SSID"
864 ssidmax = verbose ? IEEE80211_NWID_LEN : 14;
865 printf("%-*.*s %-17.17s %4s %4s %-5s %3s %4s\n"
866 , ssidmax, ssidmax, "SSID"
866 , "BSSID"
867 , "CHAN"
868 , "RATE"
869 , "S:N"
870 , "INT"
871 , "CAPS"
872 );
873 cp = buf;
874 do {
875 struct ieee80211req_scan_result *sr;
876 uint8_t *vp;
877
878 sr = (struct ieee80211req_scan_result *) cp;
879 vp = (u_int8_t *)(sr+1);
867 , "BSSID"
868 , "CHAN"
869 , "RATE"
870 , "S:N"
871 , "INT"
872 , "CAPS"
873 );
874 cp = buf;
875 do {
876 struct ieee80211req_scan_result *sr;
877 uint8_t *vp;
878
879 sr = (struct ieee80211req_scan_result *) cp;
880 vp = (u_int8_t *)(sr+1);
880 printf("%-32.*s %s %3d %3dM %2d:%-2d %3d %-4.4s"
881 , copy_essid(ssid, sizeof(ssid), vp, sr->isr_ssid_len)
882 , ssid
881 printf("%-*.*s %s %3d %3dM %2d:%-2d %3d %-4.4s"
882 , ssidmax
883 , copy_essid(ssid, sizeof(ssid), vp, sr->isr_ssid_len)
884 , ssid
883 , ether_ntoa((const struct ether_addr *) sr->isr_bssid)
884 , ieee80211_mhz2ieee(sr->isr_freq)
885 , getmaxrate(sr->isr_rates, sr->isr_nrates)
886 , sr->isr_rssi, sr->isr_noise
887 , sr->isr_intval
888 , getcaps(sr->isr_capinfo)
889 );
890 printies(vp + sr->isr_ssid_len, sr->isr_ie_len, 24);;

--- 1078 unchanged lines hidden ---
885 , ether_ntoa((const struct ether_addr *) sr->isr_bssid)
886 , ieee80211_mhz2ieee(sr->isr_freq)
887 , getmaxrate(sr->isr_rates, sr->isr_nrates)
888 , sr->isr_rssi, sr->isr_noise
889 , sr->isr_intval
890 , getcaps(sr->isr_capinfo)
891 );
892 printies(vp + sr->isr_ssid_len, sr->isr_ie_len, 24);;

--- 1078 unchanged lines hidden ---