Changeset 81

Show
Ignore:
Timestamp:
04/21/06 10:53:56 (3 years ago)
Author:
jwright
Message:

Added patch+README for madwifing, updated hostap patch

Location:
trunk
Files:
3 added
2 modified
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ieee80211.h

    r68 r81  
    287287                } extiv; 
    288288 
    289                 uint8_t extivhdr; 
     289                uint8_t extivhdr[4]; 
    290290        } u2; 
    291291 
    292292} __attribute__ ((packed)); 
     293 
     294struct ieee80211_ccmp { 
     295        union { 
     296                struct { 
     297                        uint8_t pn0; 
     298                        uint8_t pn1; 
     299                        uint8_t reserved1; 
     300                        uint8_t reserved2:5; 
     301                        uint8_t extiv:1; 
     302                        uint8_t keyid:2; 
     303                } __attribute__ ((packed)) iv; 
     304 
     305                uint8_t ivhdr; 
     306        } u1; 
     307 
     308        union { 
     309                struct { 
     310                        uint8_t pn2; 
     311                        uint8_t pn3; 
     312                        uint8_t pn4; 
     313                        uint8_t pn5; 
     314                } extiv; 
     315 
     316                uint8_t extivhdr[4]; 
     317        } u2; 
     318 
     319} __attribute__ ((packed)); 
    293320#endif 
  • trunk/mwnginject.c

    r79 r81  
    9494} 
    9595 
    96  
    97 void lamont_hdump(unsigned char *bp, unsigned int length) 
    98 { 
    99  
    100         /* stolen from tcpdump, then kludged extensively */ 
    101  
    102         static const char asciify[] = 
    103             "................................ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~................................................................................................................................."; 
    104  
    105         const unsigned short *sp; 
    106         const unsigned char *ap; 
    107         unsigned int i, j; 
    108         int nshorts, nshorts2; 
    109         int padding; 
    110  
    111         printf("\n\t"); 
    112         padding = 0; 
    113         sp = (unsigned short *)bp; 
    114         ap = (unsigned char *)bp; 
    115         nshorts = (unsigned int)length / sizeof(unsigned short); 
    116         nshorts2 = (unsigned int)length / sizeof(unsigned short); 
    117         i = 0; 
    118         j = 0; 
    119         while (1) { 
    120                 while (--nshorts >= 0) { 
    121                         printf(" %04x", ntohs(*sp)); 
    122                         sp++; 
    123                         if ((++i % 8) == 0) 
    124                                 break; 
    125                 } 
    126                 if (nshorts < 0) { 
    127                         if ((length & 1) && (((i - 1) % 8) != 0)) { 
    128                                 printf(" %02x  ", *(unsigned char *)sp); 
    129                                 padding++; 
    130                         } 
    131                         nshorts = (8 - (nshorts2 - nshorts)); 
    132                         while (--nshorts >= 0) { 
    133                                 printf("     "); 
    134                         } 
    135                         if (!padding) 
    136                                 printf("     "); 
    137                 } 
    138                 printf("  "); 
    139  
    140                 while (--nshorts2 >= 0) { 
    141                         printf("%c%c", asciify[*ap], asciify[*(ap + 1)]); 
    142                         ap += 2; 
    143                         if ((++j % 8) == 0) { 
    144                                 printf("\n\t"); 
    145                                 break; 
    146                         } 
    147                 } 
    148                 if (nshorts2 < 0) { 
    149                         if ((length & 1) && (((j - 1) % 8) != 0)) { 
    150                                 printf("%c", asciify[*ap]); 
    151                         } 
    152                         break; 
    153                 } 
    154         } 
    155         if ((length & 1) && (((i - 1) % 8) == 0)) { 
    156                 printf(" %02x", *(unsigned char *)sp); 
    157                 printf("                                       %c", 
    158                        asciify[*ap]); 
    159         } 
    160         printf("\n"); 
    161 } 
    162  
    16396int madwifing_send(struct tx80211 *in_tx, struct tx80211_packet *in_pkt) 
    16497{ 
     
    196129                        in_pkt->plen); 
    197130 
    198         /* debug */ 
    199         lamont_hdump(pkt, len); 
    200  
    201          
    202131        mwng_pkt.packet = pkt; 
    203132        mwng_pkt.plen = len; 
     
    209138 
    210139        free(pkt); 
    211         return 0; 
     140        return (mwng_pkt.plen - sizeof(struct prismavs_header)); 
    212141}