1 /* 2 * Copyright (c) 2007, 2008, Andrea Bittau <a.bittau@cs.ucl.ac.uk> 3 * 4 * Networking structures. 5 * 6 */ 7 8 #ifndef __AIRCRACK_NG_OSDEP_NETWORK_H__ 9 #define __AIRCRACK_NG_OSDEP_NETWORK_H__ 10 11 #include <inttypes.h> 12 #include <sys/types.h> 13 14 #include "osdep.h" 15 16 enum 17 { 18 NET_RC = 1, 19 NET_GET_CHAN, 20 NET_SET_CHAN, 21 NET_WRITE, 22 NET_PACKET, /* 5 */ 23 NET_GET_MAC, 24 NET_MAC, 25 NET_GET_MONITOR, 26 NET_GET_RATE, 27 NET_SET_RATE, 28 }; 29 30 #define HIGHEST_NET_COMMAND NET_SET_RATE 31 32 struct net_hdr 33 { 34 uint8_t nh_type; 35 uint32_t nh_len; 36 uint8_t nh_data[0]; 37 } __packed; 38 39 IMPORT struct wif * net_open(char * iface); 40 IMPORT int net_send(int s, int command, void * arg, int len); 41 IMPORT int net_read_exact(int s, void * arg, int len); 42 IMPORT int net_get(int s, void * arg, int * len); 43 44 #endif /* __AIRCRACK_NG_OSEDEP_NETWORK_H__ */ 45