Changeset 124

Show
Ignore:
Timestamp:
03/17/07 19:15:13 (22 months ago)
Author:
jwright
Message:

Added probe response frame format to lcpf

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/l2ping80211.c

    r115 r124  
    2828 
    2929#include <tx80211.h> 
    30 #include <tx80211_packet.h> 
    3130#include <lorcon_packasm.h> 
    3231#include <lorcon_forge.h> 
  • trunk/lorcon_forge.c

    r114 r124  
    6767 
    6868void lcpf_randmac(uint8_t *addr, int valid) { 
    69     static int listlen = 0; 
     69        static int listlen = 0; 
    7070 
    7171        if (listlen == 0) { 
     
    8383        } 
    8484 
    85     addr[3] = rand() % 255; 
    86     addr[4] = rand() % 255; 
    87     addr[5] = rand() % 255; 
     85        addr[3] = rand() % 255; 
     86        addr[4] = rand() % 255; 
     87        addr[5] = rand() % 255; 
    8888} 
    8989 
     
    188188} 
    189189 
     190void lcpf_proberesp(struct lcpa_metapack *pack, uint8_t *dst, uint8_t *src,  
     191                uint8_t *bssid, int framecontrol, int duration, int fragment, 
     192                int sequence, uint64_t timestamp, int beaconint,  
     193                int capabilities) 
     194{ 
     195        uint8_t chunk[8]; 
     196        uint16_t *sixptr = (uint16_t *) chunk; 
     197        uint64_t *ch64 = (uint64_t *) chunk; 
     198 
     199        lcpf_80211headers(pack, 0, 5, framecontrol, duration, 
     200                                          dst, src, bssid, NULL, 
     201                                          fragment, sequence); 
     202 
     203        *ch64 = timestamp; 
     204        pack = lcpa_append_copy(pack, "BEACONBSSTIME", 8, chunk); 
     205 
     206        *sixptr = beaconint; 
     207        pack = lcpa_append_copy(pack, "BEACONINT", 2, chunk); 
     208 
     209        *sixptr = capabilities; 
     210        pack = lcpa_append_copy(pack, "BEACONCAP", 2, chunk); 
     211 
     212} 
  • trunk/lorcon_forge.h

    r109 r124  
    3333 * All lorcon packet forge functions use the lcpf_ namespace 
    3434 */ 
     35 
     36 
     37#ifndef __PACKET_ASSEMBLY_H__ 
     38#include <lorcon_packasm.h> 
     39#endif 
    3540 
    3641/* Create a random MAC address, optionally seeded with a valid wireless OUI 
     
    9095                                   uint8_t *bssid, int framecontrol, int duration, int fragment,  
    9196                                   int sequence); 
    92  
     97/* Generate a proberesp frame */ 
     98void lcpf_proberesp(struct lcpa_metapack *pack, uint8_t *dst, uint8_t *src,  
     99                uint8_t *bssid, int framecontrol, int duration, int fragment, 
     100                int sequence, uint64_t timestamp, int beaconint,  
     101                int capabilities); 
    93102#endif 
  • trunk/lorcon_packasm.h

    r109 r124  
    6565        int freedata; 
    6666}; 
     67typedef struct lcpa_metapack lcpa_metapack_t; 
    6768 
    6869/* Initialize a packet list */