Moep Library  2.0-nc
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
dev.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013, 2014 Maurice Leclaire <leclaire@in.tum.de>
3  * Stephan M. Guenther <moepi@moepi.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * See COPYING for more details.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
30 #ifndef __MOEP80211_DEV_H
31 #define __MOEP80211_DEV_H
32 
33 #include <stddef.h>
34 
35 #include <moep/types.h>
36 #include <moep/frame.h>
37 
38 
39 struct moep_dev;
40 
46 typedef struct moep_dev *moep_dev_t;
47 
61 int moep_dev_set_rx_status(moep_dev_t dev, int status);
62 
75 
88 typedef int (*dev_status_cb)(void *, int);
89 
104 int moep_dev_set_tx_status_cb(moep_dev_t dev, dev_status_cb cb, void *data);
105 
119 int moep_dev_pair(moep_dev_t dev1, moep_dev_t dev2);
120 
137 typedef int (*rx_handler)(moep_dev_t dev, moep_frame_t frame);
138 
151 
164 
186 int moep_dev_tx(moep_dev_t dev, moep_frame_t frame);
187 
188 typedef int (*rx_raw_handler)(moep_dev_t dev, u8 *buf, size_t buflen);
189 
190 rx_raw_handler moep_dev_get_rx_raw_handler(moep_dev_t dev);
191 
192 rx_raw_handler moep_dev_set_rx_raw_handler(moep_dev_t dev,
193  rx_raw_handler handler);
194 
195 int moep_dev_tx_raw(moep_dev_t dev, u8 *buf, size_t buflen);
196 
214 
230 moep_frame_t moep_dev_frame_decode(moep_dev_t dev, u8 *buf, size_t buflen);
231 
245 
253 void moep_dev_close(moep_dev_t dev);
254 
256 #endif /* __MOEP80211_DEV_H */
struct moep_frame * moep_frame_t
a moep frame
Definition: frame.h:45
moep_frame_t moep_dev_frame_create(moep_dev_t dev)
create a frame
int moep_dev_set_rx_status(moep_dev_t dev, int status)
set the receive status of a moep device
int moep_dev_pair(moep_dev_t dev1, moep_dev_t dev2)
pair off two moep devices
void moep_dev_close(moep_dev_t dev)
close a moep device
int(* rx_handler)(moep_dev_t dev, moep_frame_t frame)
a receive handler
Definition: dev.h:137
int moep_dev_set_tx_status_cb(moep_dev_t dev, dev_status_cb cb, void *data)
set the transmission status callback of a device
struct moep_dev * moep_dev_t
a moep device
Definition: dev.h:46
rx_handler moep_dev_get_rx_handler(moep_dev_t dev)
return the rx handler of a moep device
moep_frame_t moep_dev_frame_decode(moep_dev_t dev, u8 *buf, size_t buflen)
decode a frame
rx_handler moep_dev_set_rx_handler(moep_dev_t dev, rx_handler handler)
set the rx handler of a moep device
void moep_dev_frame_convert(moep_dev_t dev, moep_frame_t frame)
convert a frame
int(* dev_status_cb)(void *, int)
a device status callback
Definition: dev.h:88
int moep_dev_get_tx_status(moep_dev_t dev)
get the transmission status of a device
int moep_dev_tx(moep_dev_t dev, moep_frame_t frame)
transmit a frame