Changeset 123 for trunk

Show
Ignore:
Timestamp:
03/16/07 21:26:07 (22 months ago)
Author:
jwright
Message:

Added typedefs for common lorcon types, fixed return from wtinj_send, madwifing_send to reflect man page return value desc

Location:
trunk
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/BUGS

    r111 r123  
    2323 
    2424Solution: don't put dependencies in directory paths that include spaces.  I use C:\DEV, you should too. 
     25 
     2613-MAR-2007 - JWRIGHT 
     27Formerly, you could say tx80211_init, tx80211_setchannel, tx80211_open,  
     28tx80211_txpacket, tx80211_close.  With the changes to the madwifing handling 
     29code however, we create a new VAP during tx80211_open which changes the 
     30interface name. As such, it is mandatory to call tx80211_init followed by 
     31tx80211_open BEFORE tx80211_setfuncmode or tx80211_setchannel. 
  • trunk/lorcon.3

    r104 r123  
    461461.BR tx80211_txpacket() 
    462462is used to transmit a packet, returning the number of bytes transmitted on  
    463 success.  On error, -1 is returned if no bytes were transmitted; -2 is returned 
     463success.  On error, TX80211_ENOTX is returned if no bytes were transmitted; TX80211_EPARTTX is returned 
    464464if only a partial number of bytes were transmitted. 
    465465.I in_tx 
  • trunk/mwnginject.c

    r122 r123  
    175175        struct tx80211_radiotap_header *rtaphdr; 
    176176        uint8_t *pkt; 
    177         int len, channel; 
     177        int len, channel, sendcount; 
    178178 
    179179        memset(&mwng_pkt, 0, sizeof(mwng_pkt)); 
     
    244244        mwng_pkt.plen = len; 
    245245 
    246         if (wtinj_send(in_tx, &mwng_pkt) != mwng_pkt.plen) { 
    247                 free(pkt); 
    248                 return -1; 
    249         } 
    250  
     246        if ( 
     247        sendcount = wtinj_send(in_tx, &mwng_pkt) != mwng_pkt.plen); 
    251248        free(pkt); 
    252         return (mwng_pkt.plen - TX80211_RTAP_LEN); 
     249 
     250        if (sendcount < 0) { 
     251                return TX80211_ENOTX; 
     252        } else if (sendcount != mwng_pkt.plen) { 
     253                return TX80211_EPARTTX; 
     254        } else { 
     255                return (sendcount); 
     256        } 
    253257} 
    254258 
  • trunk/tx80211.c

    r114 r123  
    452452} 
    453453 
    454 void tx80211_initpacket(struct tx80211_packet *in_packet) { 
     454void tx80211_initpacket(struct tx80211_packet *in_packet)  
     455{ 
    455456        memset(in_packet, 0, sizeof(struct tx80211_packet)); 
    456457} 
     458 
  • trunk/tx80211.h

    r114 r123  
    8484        int (*selfack_callthrough) (struct tx80211 *, uint8_t *); 
    8585}; 
     86typedef struct tx80211 tx80211_t; 
    8687 
    8788/* Dynamic structure of supported cards, for clients to list supported types */ 
     
    9293        int num_cards; 
    9394}; 
     95typedef struct tx80211_cardlist tx80211_cardlist_t; 
    9496 
    9597 
  • trunk/tx80211_errno.h

    r121 r123  
    5555#define TX80211_EOPENFAILED             -19 
    5656 
     57/* Transmission, no bytes were transmitted. */ 
     58#define TX80211_ENOTX                   -20 
     59 
     60/* Transmission, partial byte count was transmitted */ 
     61#define TX80211_EPARTTX                 -21 
     62 
    5763#endif 
  • trunk/tx80211_packet.h

    r107 r123  
    8787        int plen; 
    8888}; 
     89typedef struct tx80211_packet tx80211_packet_t; 
    8990 
    9091#endif 
  • trunk/wtinject.c

    r121 r123  
    4040        if (!(wtinj->raw_fd > 0)) { 
    4141                /* file descriptor is not open */ 
    42                 return 0; 
     42                return TX80211_ENOTX; 
    4343        } 
    4444 
     
    4848                snprintf(wtinj->errstr, TX80211_STATUS_MAX, "write failed, %s", 
    4949                                 strerror(errno)); 
    50                 return -1; 
     50                return TX80211_ENOTX;; 
    5151        } 
    5252        if (ret < (in_pkt->plen)) { 
    5353                snprintf(wtinj->errstr, TX80211_STATUS_MAX, "incomplete write" 
    5454                                ", %s", strerror(errno)); 
    55                 return -2; 
     55                return ret; 
    5656        } 
    5757        return (ret);