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