Contiki 2.5
sicslow_ethernet.h
1 /**
2  * \file sicslow_ethernet.c
3  * Routines to interface between Ethernet and 6LowPan
4  *
5  * \author
6  * Colin O'Flynn <coflynn@newae.com>
7  *
8  * \addtogroup usbstick
9  */
10 
11 /* Copyright (c) 2008 by:
12 
13  Colin O'Flynn coflynn@newae.com
14  Eric Gnoske egnoske@gmail.com
15  Blake Leverett bleverett@gmail.com
16  Mike Vidales mavida404@gmail.com
17  Kevin Brown kbrown3@uccs.edu
18  Nate Bohlmann nate@elfwerks.com
19 
20  All rights reserved.
21 
22  Redistribution and use in source and binary forms, with or without
23  modification, are permitted provided that the following conditions are met:
24 
25  * Redistributions of source code must retain the above copyright
26  notice, this list of conditions and the following disclaimer.
27  * Redistributions in binary form must reproduce the above copyright
28  notice, this list of conditions and the following disclaimer in
29  the documentation and/or other materials provided with the
30  distribution.
31  * Neither the name of the copyright holders nor the names of
32  contributors may be used to endorse or promote products derived
33  from this software without specific prior written permission.
34 
35  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
36  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
38  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
39  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
40  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
41  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
42  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
43  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
44  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45  POSSIBILITY OF SUCH DAMAGE.
46 */
47 
48 #ifndef SICSLOW_ETHERNET_H
49 #define SICSLOW_ETHERNET_H
50 
51 #if !RF230BB
52 #include "sicslowmac.h"
53 #include "frame.h"
54 #endif
55 
56 typedef enum {
57  ll_802154_type,
58  ll_8023_type
59 } lltype_t;
60 
61 
62 typedef struct {
63  uint8_t sicslowpan :1;
64  uint8_t sendToRf :1;
65  uint8_t translate :1;
66  uint8_t raw :1;
67  uint8_t debugOn :1;
68  uint8_t sneeze :1;
69 } usbstick_mode_t;
70 
71 
72 #define UIP_ETHTYPE_802154 0x809A
73 
74 extern usbstick_mode_t usbstick_mode;
75 
76 
77 int8_t mac_translateIcmpLinkLayer(lltype_t target);
78 int8_t mac_translateIPLinkLayer(lltype_t target);
79 void mac_LowpanToEthernet(void);
80 void mac_ethernetToLowpan(uint8_t * ethHeader);
81 void mac_ethernetSetup(void);
82 #if !RF230BB
83 void mac_802154raw(const struct mac_driver *r);
85 #endif
86 
87 #endif
88