Moep Library  2.0-nc
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
moep8023.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 
26 #ifndef __MOEP80211_MODULES_MOEP8023_H
27 #define __MOEP80211_MODULES_MOEP8023_H
28 
29 #include <stddef.h>
30 
31 #include <netinet/in.h>
32 #include <netinet/if_ether.h>
33 
34 #include <moep/dev.h>
35 #include <moep/frame.h>
36 #include <moep/moep_hdr_ext.h>
37 
38 #include <moep/modules/eth.h>
39 #include <moep/modules/tap.h>
40 #include <moep/modules/unix.h>
41 
42 
43 #define MOEP8023_FRAME_DISCRIMINATOR 0x88b5
44 
45 
46 struct moep8023_hdr {
47  u8 ra[ETH_ALEN];
48  u8 ta[ETH_ALEN];
49  u16 disc;
50  u16 txseq;
51 } __attribute__((packed));
52 
53 
80 moep_dev_t moep_dev_moep8023_open(const char *devname, u8 *addr,
81  const struct in_addr *ip, int prefixlen,
82  int mtu);
83 
110 moep_dev_t moep_dev_moep8023_tap_open(u8 *addr, const struct in_addr *ip,
111  int prefixlen, int mtu);
112 
136 moep_dev_t moep_dev_moep8023_unix_open(const char *devname, int mtu);
137 
151 
166 
181 
200 
202 #endif /* __MOEP80211_MODULES_MOEP8023_H */
struct moep8023_hdr * moep_frame_moep8023_hdr(moep_frame_t frame)
moep8023 header
struct moep_frame * moep_frame_t
a moep frame
Definition: frame.h:45
moep_frame_t moep_frame_moep8023_tap_create(void)
create a moep8023 tap frame
moep_dev_t moep_dev_moep8023_open(const char *devname, u8 *addr, const struct in_addr *ip, int prefixlen, int mtu)
open a moep8023 device
moep_dev_t moep_dev_moep8023_unix_open(const char *devname, int mtu)
open a moep8023 unix device
struct moep_dev * moep_dev_t
a moep device
Definition: dev.h:46
moep_frame_t moep_frame_moep8023_create(void)
create a moep8023 frame
moep_frame_t moep_frame_moep8023_unix_create(void)
create a moep8023 unix frame
moep_dev_t moep_dev_moep8023_tap_open(u8 *addr, const struct in_addr *ip, int prefixlen, int mtu)
open a moep8023 tap device
Definition: moep8023.h:46