1160996Ssam/*- 2160996Ssam * Copyright (c) 2006, Andrea Bittau <a.bittau@cs.ucl.ac.uk> 3160996Ssam * All rights reserved. 4160996Ssam * 5160996Ssam * Redistribution and use in source and binary forms, with or without 6160996Ssam * modification, are permitted provided that the following conditions 7160996Ssam * are met: 8160996Ssam * 1. Redistributions of source code must retain the above copyright 9160996Ssam * notice, this list of conditions and the following disclaimer. 10160996Ssam * 2. Redistributions in binary form must reproduce the above copyright 11160996Ssam * notice, this list of conditions and the following disclaimer in the 12160996Ssam * documentation and/or other materials provided with the distribution. 13160996Ssam * 14160996Ssam * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15160996Ssam * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16160996Ssam * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17160996Ssam * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18160996Ssam * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19160996Ssam * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20160996Ssam * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21160996Ssam * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22160996Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23160996Ssam * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24160996Ssam * SUCH DAMAGE. 25160996Ssam * 26160996Ssam * $FreeBSD$ 27160996Ssam */ 28160996Ssam#ifndef __W00T_H__ 29160996Ssam#define __W00T_H__ 30160996Ssam 31160996Ssam#include <net80211/ieee80211.h> 32160996Ssam#include <net80211/ieee80211_freebsd.h> 33160996Ssam 34160996Ssamint str2mac(char *mac, char *str); 35160996Ssamvoid mac2str(char *str, char *mac); 36160996Ssamint open_tx(char *iface); 37160996Ssamint open_rx(char *iface); 38160996Ssamint open_rxtx(char *iface, int *rx, int *tx); 39160996Ssamint inject(int fd, void *buf, int len); 40160996Ssamint inject_params(int fd, void *buf, int len, 41160996Ssam struct ieee80211_bpf_params *params); 42160996Ssamint sniff(int fd, void *buf, int len); 43160996Ssamvoid *get_wifi(void *buf, int *len); 44160996Ssamshort seqfn(unsigned short seq, unsigned short fn); 45160996Ssamint send_ack(int fd, char *mac); 46160996Ssamunsigned short seqno(struct ieee80211_frame *wh); 47160996Ssamint open_tap(char *iface); 48160996Ssamint set_iface_mac(char *iface, char *mac); 49160996Ssamint str2wep(char *wep, int *len, char *str); 50160996Ssamint wep_decrypt(struct ieee80211_frame *wh, int len, char *key, int klen); 51160996Ssamvoid wep_encrypt(struct ieee80211_frame *wh, int len, char *key, int klen); 52160996Ssamint frame_type(struct ieee80211_frame *wh, int type, int stype); 53160996Ssamvoid hexdump(void *b, int len); 54160996Ssamint elapsed(struct timeval *past, struct timeval *now); 55160996Ssamchar *known_pt(struct ieee80211_frame *wh, int *len); 56160996Ssam 57160996Ssam#endif /* __W00T_H__ */ 58