ifieee80211.c (80315) | ifieee80211.c (88748) |
---|---|
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. --- 8 unchanged lines hidden (view full) --- 17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 * | 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. --- 8 unchanged lines hidden (view full) --- 17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 * |
25 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 80315 2001-07-25 05:52:19Z brooks $ | 25 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 88748 2001-12-31 22:01:44Z ambrisko $ |
26 */ 27 28/*- 29 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. 30 * All rights reserved. 31 * 32 * This code is derived from software contributed to The NetBSD Foundation 33 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, --- 60 unchanged lines hidden (view full) --- 94void 95set80211ssid(const char *val, int d, int s, const struct afswtch *rafp) 96{ 97 int ssid; 98 int len; 99 u_int8_t data[33]; 100 101 ssid = 0; | 26 */ 27 28/*- 29 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. 30 * All rights reserved. 31 * 32 * This code is derived from software contributed to The NetBSD Foundation 33 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, --- 60 unchanged lines hidden (view full) --- 94void 95set80211ssid(const char *val, int d, int s, const struct afswtch *rafp) 96{ 97 int ssid; 98 int len; 99 u_int8_t data[33]; 100 101 ssid = 0; |
102 len = sizeof(val); 103 if (len > 2 && isdigit(val[0]) && val[1] == ':') { 104 ssid = atoi(val)-1; 105 val += 2; 106 } |
|
102 103 bzero(data, sizeof(data)); 104 len = sizeof(data); 105 get_string(val, NULL, data, &len); 106 107 set80211(s, IEEE80211_IOC_SSID, ssid, len, data); 108} 109 --- 181 unchanged lines hidden (view full) --- 291 ireq.i_type = IEEE80211_IOC_SSID; 292 ireq.i_val = -1; 293 if (ioctl(s, SIOCG80211, &ireq) < 0) { 294 /* If we can't get the SSID, the this isn't an 802.11 device. */ 295 return; 296 } 297 printf("\tssid "); 298 print_string(data, ireq.i_len); | 107 108 bzero(data, sizeof(data)); 109 len = sizeof(data); 110 get_string(val, NULL, data, &len); 111 112 set80211(s, IEEE80211_IOC_SSID, ssid, len, data); 113} 114 --- 181 unchanged lines hidden (view full) --- 296 ireq.i_type = IEEE80211_IOC_SSID; 297 ireq.i_val = -1; 298 if (ioctl(s, SIOCG80211, &ireq) < 0) { 299 /* If we can't get the SSID, the this isn't an 802.11 device. */ 300 return; 301 } 302 printf("\tssid "); 303 print_string(data, ireq.i_len); |
304 num = 0; 305 ireq.i_type = IEEE80211_IOC_NUMSSIDS; 306 if (ioctl(s, SIOCG80211, &ireq) >= 0) { 307 num = ireq.i_val; 308 } 309 ireq.i_type = IEEE80211_IOC_SSID; 310 for (ireq.i_val = 0; ireq.i_val < num; ireq.i_val++) { 311 if (ioctl(s, SIOCG80211, &ireq) >= 0 && ireq.i_len > 0) { 312 printf(" %d:", ireq.i_val + 1); 313 print_string(data, ireq.i_len); 314 } 315 } |
|
299 printf("\n"); 300 301 ireq.i_type = IEEE80211_IOC_STATIONNAME; 302 if (ioctl(s, SIOCG80211, &ireq) != -1) { 303 printf("\tstationname "); 304 print_string(data, ireq.i_len); 305 printf("\n"); 306 } --- 210 unchanged lines hidden --- | 316 printf("\n"); 317 318 ireq.i_type = IEEE80211_IOC_STATIONNAME; 319 if (ioctl(s, SIOCG80211, &ireq) != -1) { 320 printf("\tstationname "); 321 print_string(data, ireq.i_len); 322 printf("\n"); 323 } --- 210 unchanged lines hidden --- |