Changeset 104
- Timestamp:
- 03/04/07 01:25:08 (23 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
iwcontrol.c (modified) (2 diffs)
-
lorcon.3 (modified) (4 diffs)
-
lorcon_forge.c (modified) (1 diff)
-
lorcon_forge.h (modified) (1 diff)
-
tx80211.h (modified) (1 diff)
-
wginject.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/iwcontrol.c
r97 r104 613 613 } 614 614 615 int iwconfig_set_mode(const char *in_dev, char *in_err, int in_mode)615 int iwconfig_set_mode(const char *in_dev, char *in_err, int tx80211_mode) 616 616 { 617 617 struct iwreq wrq; … … 627 627 memset(&wrq, 0, sizeof(struct iwreq)); 628 628 strncpy(wrq.ifr_name, in_dev, IFNAMSIZ); 629 wrq.u.mode = in_mode; 629 630 /* LORCON modes align with Linux wireless tools modes */ 631 wrq.u.mode = tx80211_mode; 630 632 631 633 if (ioctl(skfd, SIOCSIWMODE, &wrq) < 0) { -
trunk/lorcon.3
r102 r104 43 43 .LP 44 44 .ft B 45 int tx80211_setmode(struct tx80211 *in_tx, int in_mode) /* deprecated */45 int tx80211_setmode(struct tx80211 *in_tx, int in_mode) /* superceded */ 46 46 int tx80211_getmode(struct tx80211 *in_tx) 47 47 int tx80211_setfunctionalmode(struct tx80211 *in_tx, int in_fmode) … … 340 340 .PP 341 341 .BR tx80211_setmode() 342 is used to set the operating mode of the wireless card. 343 .I in_tx 344 is the structure populated by the 345 .B tx80211_init 346 function. 347 348 .I This function is deprecated. It has been superseded by the 349 .B tx80211_setfunctionalmode 350 .I function. 342 is used to explicitly set the operating mode of the wireless card. 343 .I in_tx 344 is the structure populated by the 345 .B tx80211_init 346 function. 347 348 .I This function has been superceded with the 349 .B tx80211_setfunctionalmode() 350 .I function. Only use this function for explicitly setting the card mode, 351 .I not to prepare the card for packet injection. 351 352 352 353 .I in_mode 353 is the desired operating mode for the wireless card, as defined in the 354 .B <linux/wireless.h> 355 header file: 354 is the desired operating mode for the wireless card, as defined below: 356 355 357 356 .RS 358 357 .TP 359 358 .B 360 IW_MODE_AUTO359 TX80211_MODE_AUTO 361 360 Allows the driver to decide the best operating mode. 362 361 .TP 363 362 .B 364 IW_MODE_ADHOC363 TX80211_MODE_ADHOC 365 364 Configures the card to operate as an IBSS or ad-hoc network. 366 365 .TP 367 366 .B 368 IW_MODE_INFRA367 TX80211_MODE_INFRA 369 368 Configures the card as a wireless client in an BSS or ESS network. 370 369 .TP 371 370 .B 372 IW_MODE_MASTER371 TX80211_MODE_MASTER 373 372 Configures the card as an access point or master device. 374 373 .TP 375 374 .B 376 IW_MODE_REPEAT375 TX80211_MODE_REPEAT 377 376 Configures the card as a wireless repeater or forwarder. 378 377 .TP 379 378 .B 380 IW_MODE_SECOND379 TX80211_MODE_SECOND 381 380 Configures the card as a backup or secondary access point or master device. 382 381 .TP 383 382 .B 384 IW_MODE_MONITOR383 TX80211_MODE_MONITOR 385 384 Configures the card to forward all frames to userspace regardless of destination 386 385 or BSSID address. 386 387 .RE 388 Note that these values match the Linux wireless IW_MODE_ values for backward-compatibility. 387 389 388 390 .RE … … 390 392 returns 0 on success, -1 on error. 391 393 392 .B NOTE:393 For most packet injection uses, the394 .B IW_MODE_MONITOR395 operating mode is the preferred operating mechanism.396 397 394 .PP 398 395 .BR tx80211_setfunctionalmode() 399 is used to set the operating mode of the wireless card.396 is used to set the functional operating mode of the wireless card. 400 397 .I in_tx 401 398 is the structure populated by the … … 433 430 .B NOTE 2: It's possible that on some cards one mode can perform multiple tasks (IE 434 431 injection still works while in monitor mode) however this is not recommended as it 435 will not operate on all cards. The caller should always set the desired functional 436 mode. 432 will not operate on all cards. The caller should always set the desired functional mode. 437 433 438 434 .PP -
trunk/lorcon_forge.c
r101 r104 75 75 addr[4] = rand() % 255; 76 76 addr[5] = rand() % 255; 77 } 78 79 void lcpf_qosheaders(metapack_component *pack, unsigned int priority, 80 unsigned int eosp, unsigned int ackpol) { 81 uint8_t chunk[2]; 82 83 /* Bits 0 and 4 are reserved. */ 84 chunk[0] = 0; 85 chunk[0] = ((priority << 5) | (eosp << 3) | (ackpol << 1)); 86 /* All 8 bits reserved */ 87 chunk[1] = 0; 88 pack = pack_append_copy(pack, "80211QOSHDR", 2, chunk); 77 89 } 78 90 -
trunk/lorcon_forge.h
r101 r104 68 68 unsigned int sequence); 69 69 70 /* Generate a QoS header (2 bytes) which follows immediately after Addr4 or 71 * the sequence number field in the standard 802.11 header */ 72 void lcpf_qosheaders(metapack_component *pack, unsigned int priority, 73 unsigned int eosp, unsigned int ackpol); 74 70 75 /* Generate a beacon frame header with no IE tags (see lcpf_appendie) 71 76 * -
trunk/tx80211.h
r103 r104 161 161 #define TX80211_FUNCMODE_INJMON 2 162 162 163 /* Modes for setting various operation types. This aligns with the standard 164 * Linux wireless operation modes, but doesn't tie us to the IW literals. */ 165 #define TX80211_MODE_AUTO 0 /* Let the driver decides */ 166 #define TX80211_MODE_ADHOC 1 /* Single cell network */ 167 #define TX80211_MODE_INFRA 2 /* Multi cell network, roaming, ... */ 168 #define TX80211_MODE_MASTER 3 /* Synchronisation master or Access Point */ 169 #define TX80211_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */ 170 #define TX80211_MODE_SECOND 5 /* Secondary master/repeater (backup) */ 171 #define TX80211_MODE_MONITOR 6 /* Passive monitor (listen only) */ 172 163 173 /* tx80211 device capabilities */ 164 174 #define TX80211_CAP_NONE 0 /* no capabilities */ -
trunk/wginject.c
r90 r104 175 175 176 176 switch (mode) { 177 case IW_MODE_MONITOR:177 case TX80211_MODE_MONITOR: 178 178 currentchan = wginj_getchannel(wginj); 179 179 snprintf(cmdline, sizeof(cmdline), … … 182 182 return (system(cmdline)); 183 183 184 case IW_MODE_INFRA:184 case TX80211_MODE_INFRA: 185 185 currentchan = wginj_getchannel(wginj); 186 186 snprintf(cmdline, sizeof(cmdline), … … 189 189 return (system(cmdline)); 190 190 191 case IW_MODE_AUTO:192 case IW_MODE_ADHOC:193 case IW_MODE_MASTER:194 case IW_MODE_REPEAT:195 case IW_MODE_SECOND:191 case TX80211_MODE_AUTO: 192 case TX80211_MODE_ADHOC: 193 case TX80211_MODE_MASTER: 194 case TX80211_MODE_REPEAT: 195 case TX80211_MODE_SECOND: 196 196 default: 197 197 return -1; /* not supported */
