ifieee80211.c (121827) | ifieee80211.c (127649) |
---|---|
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 121827 2003-11-01 00:03:20Z brooks $ | 27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 127649 2004-03-30 22:59:22Z 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, --- 245 unchanged lines hidden (view full) --- 281 for (i = 1; i < 4; i++) 282 set80211(s, IEEE80211_IOC_WEPKEY, i, 0, data); 283 } 284 285 set80211(s, IEEE80211_IOC_WEPTXKEY, txkey, 0, NULL); 286} 287 288void | 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, --- 245 unchanged lines hidden (view full) --- 281 for (i = 1; i < 4; i++) 282 set80211(s, IEEE80211_IOC_WEPKEY, i, 0, data); 283 } 284 285 set80211(s, IEEE80211_IOC_WEPTXKEY, txkey, 0, NULL); 286} 287 288void |
289set80211rtsthreshold(const char *val, int d, int s, const struct afswtch *rafp) 290{ 291 set80211(s, IEEE80211_IOC_RTSTHRESHOLD, atoi(val), 0, NULL); 292} 293 294void 295set80211protmode(const char *val, int d, int s, const struct afswtch *rafp) 296{ 297 int mode; 298 299 if (strcasecmp(val, "off") == 0) { 300 mode = IEEE80211_PROTMODE_OFF; 301 } else if (strcasecmp(val, "cts") == 0) { 302 mode = IEEE80211_PROTMODE_CTS; 303 } else if (strcasecmp(val, "rtscts") == 0) { 304 mode = IEEE80211_PROTMODE_RTSCTS; 305 } else { 306 err(1, "unknown protection mode"); 307 } 308 309 set80211(s, IEEE80211_IOC_PROTMODE, mode, 0, NULL); 310} 311 312void 313set80211txpower(const char *val, int d, int s, const struct afswtch *rafp) 314{ 315 set80211(s, IEEE80211_IOC_TXPOWER, atoi(val), 0, NULL); 316} 317 318void |
|
289ieee80211_status (int s, struct rt_addrinfo *info __unused) 290{ 291 int i; 292 int num; 293 struct ieee80211req ireq; 294 u_int8_t data[32]; 295 char spacer; 296 --- 78 unchanged lines hidden (view full) --- 375 if (ioctl(s, SIOCG80211, &ireq) != -1) { 376 if (ireq.i_val) 377 printf(" powersavesleep %d", ireq.i_val); 378 } 379 } 380 381 printf("\n"); 382 | 319ieee80211_status (int s, struct rt_addrinfo *info __unused) 320{ 321 int i; 322 int num; 323 struct ieee80211req ireq; 324 u_int8_t data[32]; 325 char spacer; 326 --- 78 unchanged lines hidden (view full) --- 405 if (ioctl(s, SIOCG80211, &ireq) != -1) { 406 if (ireq.i_val) 407 printf(" powersavesleep %d", ireq.i_val); 408 } 409 } 410 411 printf("\n"); 412 |
413 spacer = '\t'; 414 ireq.i_type = IEEE80211_IOC_RTSTHRESHOLD; 415 if (ioctl(s, SIOCG80211, &ireq) != -1) { 416 printf("%crtsthreshold %d", spacer, ireq.i_val); 417 spacer = ' '; 418 } 419 420 ireq.i_type = IEEE80211_IOC_PROTMODE; 421 if (ioctl(s, SIOCG80211, &ireq) != -1) { 422 printf("%cprotmode", spacer); 423 switch (ireq.i_val) { 424 case IEEE80211_PROTMODE_OFF: 425 printf(" OFF"); 426 break; 427 case IEEE80211_PROTMODE_CTS: 428 printf(" CTS"); 429 break; 430 case IEEE80211_PROTMODE_RTSCTS: 431 printf(" RTSCTS"); 432 break; 433 default: 434 printf(" UNKNOWN"); 435 break; 436 } 437 spacer = ' '; 438 } 439 440 ireq.i_type = IEEE80211_IOC_TXPOWER; 441 if (ioctl(s, SIOCG80211, &ireq) != -1) { 442 printf("%ctxpower %d", spacer, ireq.i_val); 443 spacer = ' '; 444 } 445 446 if (spacer != '\t') 447 printf("\n"); 448 |
|
383 ireq.i_type = IEEE80211_IOC_WEP; 384 if (ioctl(s, SIOCG80211, &ireq) != -1 && 385 ireq.i_val != IEEE80211_WEP_NOSUP) { 386 printf("\twepmode"); 387 switch (ireq.i_val) { 388 case IEEE80211_WEP_OFF: 389 printf(" OFF"); 390 break; --- 150 unchanged lines hidden --- | 449 ireq.i_type = IEEE80211_IOC_WEP; 450 if (ioctl(s, SIOCG80211, &ireq) != -1 && 451 ireq.i_val != IEEE80211_WEP_NOSUP) { 452 printf("\twepmode"); 453 switch (ireq.i_val) { 454 case IEEE80211_WEP_OFF: 455 printf(" OFF"); 456 break; --- 150 unchanged lines hidden --- |