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 #ifndef __W00T_H__ 27 #define __W00T_H__ 28 29 #include <net80211/ieee80211.h> 30 #include <net80211/ieee80211_freebsd.h> 31 32 int str2mac(char *mac, char *str); 33 void mac2str(char *str, char *mac); 34 int open_tx(char *iface); 35 int open_rx(char *iface); 36 int open_rxtx(char *iface, int *rx, int *tx); 37 int inject(int fd, void *buf, int len); 38 int inject_params(int fd, void *buf, int len, 39 struct ieee80211_bpf_params *params); 40 int sniff(int fd, void *buf, int len); 41 void *get_wifi(void *buf, int *len); 42 short seqfn(unsigned short seq, unsigned short fn); 43 int send_ack(int fd, char *mac); 44 unsigned short seqno(struct ieee80211_frame *wh); 45 int open_tap(char *iface); 46 int set_iface_mac(char *iface, char *mac); 47 int str2wep(char *wep, int *len, char *str); 48 int wep_decrypt(struct ieee80211_frame *wh, int len, char *key, int klen); 49 void wep_encrypt(struct ieee80211_frame *wh, int len, char *key, int klen); 50 int frame_type(struct ieee80211_frame *wh, int type, int stype); 51 void hexdump(void *b, int len); 52 int elapsed(struct timeval *past, struct timeval *now); 53 char *known_pt(struct ieee80211_frame *wh, int *len); 54 55 #endif /* __W00T_H__ */ 56