added list support
[my-code/hdw-sniff.git] / hdw-sniff.h
1 #include <linux/wireless.h>
2 #include "list.h"
3
4 #define C_MAX 14
5
6 /* the pcap_process callback function */
7 void pcap_process(u_char *count,const struct pcap_pkthdr *pcap_header,
8                         const u_char *package);
9
10 /* snap header struct */
11 struct snaphdr {
12                 unsigned char snap[6];  /* the six magic snap chars */
13                 unsigned short proto;   /* protocol type */
14 } __attribute__ ((packed));
15
16 /* info struct */
17 struct info_struct {
18                 int count;      /* count packages */
19                 char dev[10];   /* device */
20                 char mmode;     /* monitor type ... and later more */
21                 int channel;    /* current freq channel */
22                 struct list *ssid_list; /* pointer to ssid list */
23 };
24
25 /* hop_chanel function */
26 int hop_channel(struct info_struct *info,int foo_fd);
27
28 /* ssid struct */
29 struct ssid_struct {
30                 unsigned char elementid;        /* element id */
31                 unsigned char length;           /* length of ssid */
32                 unsigned char ssid[32];         /* ssid */
33 } __attribute__ ((packed));
34
35 /* beacon header */
36 struct beacon_struct {
37                 long long timestamp;            /* time stamp */
38                 unsigned short interval;        /* beacon interval field */
39                 unsigned short capability;      /* capability field */
40                 struct ssid_struct ssid_s;      /* ssid field */
41 } __attribute__ ((packed));
42
43 /* association request header */
44 struct asso_req_struct {
45                 unsigned short capability;      /* capability field */
46                 unsigned short listeninterval;  /* listen interval field */
47                 unsigned short ssid;            /* ssid field */
48                 /* supported rates missing */
49 } __attribute__ ((packed));