Changeset 137

Show
Ignore:
Timestamp:
04/10/07 20:21:35 (21 months ago)
Author:
jwright
Message:

Changes to man page

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/lorcon.3

    r123 r137  
    11.\" $Id: $ 
    2 .TH LORCON 3 "01 November 2006" 
     2.TH LORCON 3 "22 March 2007" 
    33.SH NAME 
    44LORCON \- 802.11 Wireless Packet Injection Library 
     
    77.ft B 
    88#include <tx80211.h> 
    9 #include <tx80211_packet.h> 
    109.ft 
    1110.LP 
    1211.nf 
    1312.ft B 
    14 struct tx80211_cardlist *tx80211_getcardlist() 
     13tx80211_cardlist_t *tx80211_getcardlist() 
    1514void tx80211_freecardlist(struct tx80211_cardlist *in_list) 
    1615.ft 
     
    2524.LP 
    2625.ft B 
    27 int tx80211_init(struct tx80211 *in_tx, const char *in_ifname,  
     26int tx80211_init(tx80211_t *in_tx, const char *in_ifname,  
    2827.ti +8  
    2928int in_injector) 
     
    3130.LP 
    3231.ft B 
    33 char * tx80211_geterrstr(struct tx80211 *in_tx) 
    34 .ft 
    35 .LP 
    36 .ft B 
    37 int tx80211_getcapabilities(struct tx80211 *in_tx) 
    38 .ft 
    39 .LP 
    40 .ft B 
    41 int tx80211_open(struct tx80211 *in_tx) 
    42 .ft 
    43 .LP 
    44 .ft B 
    45 int tx80211_setmode(struct tx80211 *in_tx, int in_mode) /* superceded */ 
    46 int tx80211_getmode(struct tx80211 *in_tx)  
    47 int tx80211_setfunctionalmode(struct tx80211 *in_tx, int in_fmode) 
    48 .ft 
    49 .LP 
    50 .ft B 
    51 int tx80211_setchannel(struct tx80211 *in_tx, int in_chan) 
    52 int tx80211_getchannel(struct tx80211 *in_tx) 
    53 .ft 
    54 .LP 
    55 .ft B 
    56 int tx80211_txpacket(struct tx80211 *in_tx,  
     32char * tx80211_geterrstr(tx80211_t *in_tx) 
     33.ft 
     34.LP 
     35.ft B 
     36int tx80211_getcapabilities(tx80211_t *in_tx) 
     37.ft 
     38.LP 
     39.ft B 
     40int tx80211_open(tx80211_t *in_tx) 
     41.ft 
     42.LP 
     43.ft B 
     44int tx80211_setmode(tx80211_t *in_tx, int in_mode) /* superceded */ 
     45int tx80211_getmode(tx80211_t *in_tx)  
     46int tx80211_setfunctionalmode(tx80211_t *in_tx, int in_fmode) 
     47.ft 
     48.LP 
     49.ft B 
     50int tx80211_setchannel(tx80211_t *in_tx, int in_chan) 
     51int tx80211_getchannel(tx80211_t *in_tx) 
     52.ft 
     53.LP 
     54.ft B 
     55int tx80211_settxrate(tx80211_t *in_tx, tx80211_packet_t *in_packet,  
    5756.ti +8  
    58 struct tx80211_packet *in_packet) 
    59 .ft 
    60 .LP 
    61 .ft B 
    62 int tx80211_close(struct tx80211 *in_tx) 
     57int rate) 
     58.ft 
     59.ft B 
     60int tx80211_gettxrate(tx80211_packet_t *in_packet) 
     61.ft 
     62.LP 
     63.ft B 
     64int tx80211_setmodulation(tx80211_t *in_tx, tx80211_packet_t *in_packet,  
     65.ti +8  
     66int modulation) 
     67.ft 
     68.ft B 
     69int tx80211_getmodulation(tx80211_packet_t *in_packet) 
     70.ft 
     71.LP 
     72.ft B 
     73int tx80211_initpacket(tx80211_packet_t *in_packet) 
     74.ft 
     75.LP 
     76.ft B 
     77int tx80211_txpacket(tx80211_t *in_tx,  
     78.ti +8  
     79tx80211_packet_t *in_packet) 
     80.ft 
     81.LP 
     82.ft B 
     83int tx80211_close(tx80211_t *in_tx) 
    6384.ft 
    6485.fi 
     
    91112architecture, with a driver description and capability information.  This 
    92113function allocates memory to populate a pointer of type  
    93 .I tx80211_cardlist 
     114.I tx80211_cardlist_t 
    94115, returning NULL on error. 
    95116 
     
    97118.BR tx80211_freecardlist() 
    98119is used to free the 
    99 .I tx80211_cardlist 
     120.I tx80211_cardlist_t 
    100121pointer populated by 
    101122.B tx80211_getcardlist(). 
    102123.I in_list 
    103 is the populated tx80211_cardlist pointer. 
     124is the populated tx80211_cardlist_t pointer. 
    104125 
    105126.PP 
     
    115136Indicates the wlan-ng driver available at  
    116137.I ftp://ftp.linux-wlan.org/pub/linux-wlan-ng. 
    117 The string "wlanng" or "wlan-ng" may be used to indicate the use of this driver. 
     138The strings "wlanng" or "wlan-ng" may be used to indicate the use of this driver. 
    118139.TP 
    119140.B INJ_HOSTAP 
    120141Indicated the HostAP driver available at  
    121142.I http://hostap.epitest.fi. 
    122 The string "host-ap" or "hostap" may be used to indicate the use of this driver. 
     143The strings "host-ap" or "hostap" may be used to indicate the use of this driver. 
    123144.TP 
    124145.B INJ_AIRJACK 
     
    136157Indicates the Prism54 driver, available at  
    137158.I http://prism54.org. 
    138 The string "prismgt" or "prism54" may be used to indicate the use of this driver. 
     159The strings "prismgt" or "prism54" may be used to indicate the use of this driver. 
    139160.TP 
    140161.B INJ_MADWIFING 
    141162Indicates the MADWIFI-ng drivers, available at 
    142163.I http://www.madwifi.org. 
    143 The string "madwifi-ng" may be used to indicate the use of this driver. 
     164The strings "madwifi-ng" or "madwifing" may be used to indicate the use of this driver. 
    144165.TP 
    145166.B INJ_MADWIFIOLD 
     
    151172Indicates the Realtek RTL8180 driver, available at 
    152173.I http://sourceforge.net/projects/rtl8180-sa2400. 
    153 The string "rtl8180" or "rt8180" may be used to indicate the use of this driver. 
     174The strings "rtl8180" or "rt8180" may be used to indicate the use of this driver. 
    154175.TP 
    155176.B INJ_RT2500 
    156177Indicates the Ralink RT2500 driver, available at 
    157 .I http://sourceforge.net/projects/rt2400. 
    158 The string "rt2500" or "rtl2500" or "rt25k" or "rtl25k" may be used to indicate the use of this driver. 
     178.I http://rt2x00.serialmonkey.com. 
     179The strings "rt2500" or "rtl2500" or "rt25k" or "rtl25k" may be used to indicate the use of this driver. 
    159180.TP 
    160181.B INJ_RT2750 
    161182Indicates the Ralink RT2570 USB driver, available at  
    162 .I http://sourceforge.net/projects/rt2400. 
    163 The string "rt2750" or "rtl2570" may be used to indicate the use of this driver. 
     183.I http://rt2x00.serialmonkey.com. 
     184The strings "rt2750" or "rtl2570" may be used to indicate the use of this driver. 
     185.TP 
     186.B INJ_RT73 
     187Indicates the Ralink RT73 USB driver, available at  
     188.I http://rt2x00.serialmonkey.com. 
     189The strings "rt73" or "rtl2571" may be used to indicate the use of this driver. 
     190.TP 
     191.B INJ_RT61 
     192Indicates the Ralink RT61 PCI/PC-Card driver, available at  
     193.I http://rt2x00.serialmonkey.com. 
     194The strings "rt61" or "rt2561" may be used to indicate the use of this driver. 
     195.TP 
     196.B INJ_AIRPCAP 
     197Indicates the CACE Technologies AirPcap USB adapter for Windows, available at 
     198.I http://www.cacetech.com/products/airpcap.htm.  This is a commercial adapter for Windows.  The string "airpcap" may be used to indicate the use of this driver. 
    164199.TP 
    165200.B INJ_NODRIVER 
     
    167202.I in_str 
    168203is not recognized.  This can be due to a typo, or due to lack of support for 
    169 the specified driver in the installed version of LORCON. 
     204the specified driver in the installed version of LORCON for the current operating system. 
    170205.RE 
    171206.LP 
     
    270305TX80211_CAP_SNIFFACK 
    271306Indicates the capability to observe the presence of ACK frames in monitor mode. 
    272 .B NOTE: 
    273 This is not a TX-related capability, and may be replaced with a separate  
    274 capability bitmask for RX-related capabilities in a future release. 
    275307.TP 
    276308.B 
     
    300332Indicates the capability to transmit frames using OFDM modulation.  This is 
    301333appropriate for cards that support 802.11g or 802.11a networking. 
    302 .B NOTE: 
    303 It is possible to differentiate between 802.11g and 802.11a networking by 
    304 specifying the appropriate channel in the 2.4 GHz or 5 GHz spectrums with the 
    305334.B tx80211_setchannel() 
    306335function. 
     
    315344TX80211_CAP_SETRATE 
    316345Indicates the capability to set the data transmission rate using the 
    317 .B tx80211_setrate() 
     346.B tx80211_settxrate() 
     347function. 
     348.TP 
     349.B 
     350TX80211_CAP_SETMODULATION 
     351Indicates the capability to set the data modulation mechanism using the 
     352.B tx80211_setmodulation() 
    318353function. 
    319354.RE 
     
    337372.B tx80211_open() 
    338373function before transmitting packets. 
     374.B tx80211_open() 
     375returns 
     376.B 
     377TX80211_ENOERR 
     378on success and < 0 on failure. 
    339379 
    340380.PP 
     
    390430.RE 
    391431.B tx80211_setmode() 
    392 returns 0 on success, -1 on error. 
     432returns  
     433.B 
     434TX80211_ENOERR 
     435on success, < 0 on error. 
    393436 
    394437.PP 
     
    421464.RE 
    422465.B tx80211_setfunctionalmode() 
    423 returns 0 on success, < 0 on error. 
     466returns 
     467.B 
     468TX80211_ENOERR 
     469on success, < 0 on error. 
    424470 
    425471.B NOTE: 
     
    434480.PP 
    435481.BR tx80211_getmode() 
    436 is used to identify the current operating mode, returning the operating mode or -1 on error. 
     482is used to identify the current operating mode, returning the operating mode or < 0 on error. 
    437483.I in_tx 
    438484is the structure populated by the 
     
    442488.PP 
    443489.BR tx80211_setchannel() 
    444 is used to set card channel, returning 0 on success and -1 on error. 
     490is used to set card channel, returning 
     491.B 
     492TX80211_ENOERR 
     493on success and -1 on error. 
    445494.I in_tx 
    446495is the structure populated by the 
     
    448497function. 
    449498.I in_chan is the desired channel number. 
     499.B tx80211_setchannel() 
     500returns 
     501.B 
     502TX80211_ENOERR 
     503on success, and < 0 on failure. 
    450504 
    451505.PP 
    452506.BR tx80211_getchannel() 
    453507is used to identify the current channel number, returning the channel number 
    454 or -1 on error. 
    455 .I in_tx 
    456 is the structure populated by the 
    457 .B tx80211_init 
    458 function. 
     508or < 0 on error. 
     509.I in_tx 
     510is the structure populated by the 
     511.B tx80211_init 
     512function. 
     513 
     514.PP 
     515.BR tx80211_settxrate() 
     516is used to specify the transmit rate for the frame.  This parameter is per-packet specific (e.g. specified in the 
     517.I 
     518in_packet 
     519structure, allowing you to create and transmit multiple frames with different rates without having to call 
     520.B 
     521tx80211_settxrate() 
     522successively for each transmission.   
     523.I in_tx 
     524is the structure populated by the 
     525.B tx80211_init 
     526function. The 
     527.B rate 
     528specifiers are defined as follows: 
     529.RS 
     530.TP 
     531.B 
     532TX80211_RATE_DEFAULT 
     533Transmission at the default driver rate, typically 1 Mbps 
     534.TP 
     535.B 
     536TX80211_RATE_1MB 
     537Transmission at 1 Mbps 
     538.TP 
     539.B 
     540TX80211_RATE_2MB 
     541Transmission at 2 Mbps 
     542.TP 
     543.B 
     544TX80211_RATE_5_5MB 
     545Transmission at 5.5 Mbps 
     546.TP 
     547.B 
     548TX80211_RATE_6MB 
     549Transmission at 6 Mbps 
     550.TP 
     551.B 
     552TX80211_RATE_9MB 
     553Transmission at 9 Mbps 
     554.TP 
     555.B 
     556TX80211_RATE_11MB 
     557Transmission at 11 Mbps 
     558.TP 
     559.B 
     560TX80211_RATE_22MB 
     561Transmission at 22 Mbps 
     562.TP 
     563.B 
     564TX80211_RATE_24MB 
     565Transmission at 24 Mbps 
     566.TP 
     567.B 
     568TX80211_RATE_36MB 
     569Transmission at 36 Mbps 
     570.TP 
     571.B 
     572TX80211_RATE_48MB 
     573Transmission at 48 Mbps 
     574.TP 
     575.B 
     576TX80211_RATE_72MB 
     577Transmission at 72 Mbps 
     578.TP 
     579.B 
     580TX80211_RATE_96MB 
     581Transmission at 96 Mbps 
     582.TP 
     583.B 
     584TX80211_RATE_108MB 
     585Transmission at 108 Mbps 
     586.RE 
     587.LP 
     588 
     589.B 
     590NOTE: 
     591This function is only available for drivers with the 
     592.B 
     593TX80211_CAP_SETRATE 
     594capability. 
     595.B 
     596tx80211_settxrate() 
     597returns 
     598.B 
     599TX80211_ENOERR 
     600on success, < 0 on failure. 
     601 
     602.PP 
     603.BR tx80211_gettxrate() 
     604returns the configured data rate for the 
     605.B 
     606in_packet 
     607context.  Returns the rate as specified with the 
     608.B tx80211_settxrate() 
     609function, or 
     610.B TX80211_RATE_DEFAULT 
     611\. 
     612 
     613.PP 
     614.BR tx80211_setmodulation() 
     615is used to specify the modulation mechanism rate for the frame.  This parameter is per-packet specific (e.g. specified in the 
     616.I 
     617in_packet 
     618structure, allowing you to create and transmit multiple frames with different rates without having to call 
     619.B 
     620tx80211_setmodulation() 
     621successively for each transmission.   
     622.I in_tx 
     623is the structure populated by the 
     624.B tx80211_init 
     625function. The 
     626.B rate 
     627specifiers are defined as follows: 
     628.RS 
     629.TP 
     630.B 
     631TX80211_MOD_DEFAULT 
     632Transmission using the default driver modulation mechanism for the configured channel. 
     633.TP 
     634.B 
     635TX80211_MOD_FHSS 
     636Transmission using Frequency Hopping Spread Spectrum (FHSS).  Currently, no LORCON supported drivers accommodate FHSS transmission. 
     637.TP 
     638.B 
     639TX80211_MOD_DSSS 
     640Transmission using Distributed Sequence Spread Spectrum (DSSS). This is the common modulation mechanism for IEEE 802.11b networks. 
     641.TP 
     642.B 
     643TX80211_MOD_OFDM 
     644Transmission using Orthogonal Frequency Division Multiplexing (OFDM).  This is the common modulation mechanism for IEEE 802.11g and IEEE 802.11a networks. 
     645.TP 
     646.B 
     647TX80211_MOD_TURBO 
     648Transmission using the proprietary Atheros Turbo modulation mechanism. 
     649.TP 
     650.B 
     651TX80211_MOD_MIMO 
     652Transmission using the Multiple Input Multiple Output (MIMO) mechanism specified in IEEE 802.11n.  This modulation mechanism uses a preamble that is backward-compatible with IEEE 802.11a/b/g cards. 
     653.TP 
     654.B 
     655TX80211_MOD_MIMOGF 
     656Transmission using the Multiple Input Multiple Output (MIMO) Greenfield mode specified in IEEE 802.11n.  This modulation mechanism uses a preamble that is NOT backward-compatible with IEEE 802.11a/b/g cards. 
     657.RE 
     658.LP 
     659.B 
     660NOTE: 
     661This function is only available for drivers with the 
     662.B 
     663TX80211_CAP_SETMODODULATION 
     664capability. 
     665.B 
     666tx80211_setmodulation() 
     667returns 
     668.B 
     669TX80211_ENOERR 
     670on success, < 0 on failure. 
     671 
     672.PP 
     673.BR tx80211_initpacket() 
     674is used to initialize the per-packet context.  Must be called before 
     675.B tx80211_txpacket(). 
     676.I in_packet 
     677is the structure declared with tx80211_packet_t. 
    459678 
    460679.PP 
     
    488707is the structure populated by the 
    489708.B tx80211_init 
    490 function.  The return value is zero on success, or -1 if an error occurred. 
     709function.  The return value is  
     710.B 
     711TX80211_ENOERR 
     712on success, or < 0 if an error occured. 
    491713 
    492714.PP 
     
    499721 
    500722#include <tx80211.h> 
    501 #include <tx80211_packet.h> 
    502723#include <linux/wireless.h> 
    503724 
     
    508729{ 
    509730 
    510         struct tx80211_cardlist *cardlist = NULL; 
     731        tx80211_cardlist_t *cardlist = NULL; 
    511732        int i; 
    512733 
     
    535756        }; 
    536757 
    537         struct tx80211 in_tx; 
    538         struct tx80211_packet in_packet; 
     758        tx80211_t in_tx; 
     759        tx80211_packet_t in_packet; 
    539760        int drivertype; 
    540761 
     
    557778        if (tx80211_init(&in_tx, IFACE, drivertype) < 0) { 
    558779                fprintf(stderr, "Error initializing driver " 
    559                                 "\\"%s\\".\\n", argv[1]); 
     780                                "\\"%s\\": %s.\\n", argv[1], 
     781                                tx80211_geterrstr(&in_tx)); 
    560782                return -1; 
    561783        } 
     
    572794        if (tx80211_setfunctionalmode(&in_tx, TX80211_FUNCMODE_INJMON) != 0) { 
    573795                fprintf(stderr, "Error setting monitor/inject mode: %s.\\n", 
    574                         tx80211_geterrstr(in_tx)); 
     796                        tx80211_geterrstr(&in_tx)); 
    575797                return 1; 
    576798        } 
     
    579801        if (tx80211_setchannel(&in_tx, CHANNEL) < 0) { 
    580802                fprintf(stderr, "Error setting channel: %s.\\n", 
    581                         tx80211_geterrstr(in_tx)); 
     803                        tx80211_geterrstr(&in_tx)); 
    582804                return 1; 
    583805        } 
     
    586808        if (tx80211_open(&in_tx) < 0) { 
    587809                fprintf(stderr, "Unable to open interface %s: %s.\\n",  
    588                         in_tx.ifname, tx80211_geterrstr(in_tx)); 
     810                        in_tx.ifname, tx80211_geterrstr(&in_tx)); 
    589811                return 1; 
    590812        } 
    591813 
    592         /* Initialized in_packet with packet contents and length of  
     814        /* Initialize in_packet and set packet contents and length of  
    593815           the packet */ 
     816        tx80211_initpacket(&in_packet); 
    594817        in_packet.packet = packet; 
    595818        in_packet.plen = sizeof(packet); 
     
    598821        if (tx80211_txpacket(&in_tx, &in_packet) < 0) { 
    599822                fprintf(stderr, "Unable to transmit packet: %s.\\n", 
    600                         tx80211_geterrstr(in_tx)); 
     823                        tx80211_geterrstr(&in_tx)); 
    601824                return 1; 
    602825        } 
     
    621844.LP 
    622845.RS 
    623 lorcon-devel@felloffthebackofatruck.com 
     846lorcon@802.11ninja.net 
     847 
     848.SH RESOURCES 
     849Please see http://802.11ninja.net/lorcon for updates to LORCON, documentation and the bug database. 
    624850.RE 
  • trunk/tx80211.c

    r135 r137  
    135135        ret->cardnames[ret->num_cards] = strdup("rt61"); 
    136136        ret->descriptions[ret->num_cards] = strdup("Raylink 61 pre-N PC Card"); 
    137         ret->capabilities[ret->num_cards] = tx80211_rt2570_capabilities(); 
     137        ret->capabilities[ret->num_cards] = tx80211_rt61_capabilities(); 
    138138        ret->num_cards++; 
    139139 
     
    204204                return INJ_RT2500; 
    205205 
    206         if (!strcasecmp(in_str, "rt2570") || !strcasecmp(in_str, "rtl2570")) 
     206        if (!strcasecmp(in_str, "rt2570") || !strcasecmp(in_str, "rtl2570") || 
     207            !strcasecmp(in_str, "rt2570")) 
    207208                return INJ_RT2570; 
    208209 
    209         if (!strcasecmp(in_str, "rt73") || !strcasecmp(in_str, "rtl73")) 
     210        if (!strcasecmp(in_str, "rt73") || !strcasecmp(in_str, "rtl73") || 
     211                !strcasecmp(in_str, "rt2571")) 
    210212                return INJ_RT73; 
    211213 
    212         if (!strcasecmp(in_str, "rt61") || !strcasecmp(in_str, "rtl61")) 
     214        if (!strcasecmp(in_str, "rt61") || !strcasecmp(in_str, "rt2561")) 
    213215                return INJ_RT61; 
    214216 
  • trunk/tx80211.h

    r135 r137  
    214214#define INJ_ZD1211RW    13 
    215215/* 
    216 * No-one should be testing for INJ_MAX, test for TX80211_ENOSUCHINJ instead 
     216* No-one should test for INJ_MAX, test for INJ_NODRIVER instead 
    217217*/ 
    218218#define INJ_MAX         14 
  • trunk/tx80211_packet.h

    r123 r137  
    6666 
    6767/* Values are in a quantity of 500 Kbps increments */ 
     68#define TX80211_RATE_DEFAULT 0 
    6869#define TX80211_RATE_1MB 2  
    6970#define TX80211_RATE_2MB 4