w00t.h revision 160996
1/*-
2 * Copyright (c) 2006, Andrea Bittau <a.bittau@cs.ucl.ac.uk>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/tools/tools/net80211/w00t/libw00t/w00t.h 160996 2006-08-05 05:18:03Z sam $
27 */
28#ifndef __W00T_H__
29#define __W00T_H__
30
31#include <net80211/ieee80211.h>
32#include <net80211/ieee80211_freebsd.h>
33
34int str2mac(char *mac, char *str);
35void mac2str(char *str, char *mac);
36int open_tx(char *iface);
37int open_rx(char *iface);
38int open_rxtx(char *iface, int *rx, int *tx);
39int inject(int fd, void *buf, int len);
40int inject_params(int fd, void *buf, int len,
41		  struct ieee80211_bpf_params *params);
42int sniff(int fd, void *buf, int len);
43void *get_wifi(void *buf, int *len);
44short seqfn(unsigned short seq, unsigned short fn);
45int send_ack(int fd, char *mac);
46unsigned short seqno(struct ieee80211_frame *wh);
47int open_tap(char *iface);
48int set_iface_mac(char *iface, char *mac);
49int str2wep(char *wep, int *len, char *str);
50int wep_decrypt(struct ieee80211_frame *wh, int len, char *key, int klen);
51void wep_encrypt(struct ieee80211_frame *wh, int len, char *key, int klen);
52int frame_type(struct ieee80211_frame *wh, int type, int stype);
53void hexdump(void *b, int len);
54int elapsed(struct timeval *past, struct timeval *now);
55char *known_pt(struct ieee80211_frame *wh, int *len);
56
57#endif /* __W00T_H__ */
58