Contiki 3.x
rime.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006, Swedish Institute of Computer Science.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * This file is part of the Contiki operating system.
30  *
31  */
32 
33 /**
34  * \file
35  * Header file for the Rime stack
36  * \author
37  * Adam Dunkels <adam@sics.se>
38  */
39 
40 /**
41  * \addtogroup rime
42  * @{
43  */
44 
45 #ifndef RIME_H_
46 #define RIME_H_
47 
48 #include "net/rime/announcement.h"
49 #include "net/rime/collect.h"
50 #include "net/rime/ipolite.h"
51 #include "net/rime/mesh.h"
52 #include "net/rime/multihop.h"
54 #include "net/rime/netflood.h"
56 #include "net/rime/polite.h"
57 #include "net/queuebuf.h"
58 #include "net/linkaddr.h"
59 #include "net/packetbuf.h"
60 #include "net/rime/rimestats.h"
61 #include "net/rime/rmh.h"
63 #include "net/rime/route.h"
64 #include "net/rime/rucb.h"
65 #include "net/rime/runicast.h"
66 #include "net/rime/timesynch.h"
67 #include "net/rime/trickle.h"
68 
69 #include "net/mac/mac.h"
70 /**
71  * \brief Initialize Rime
72  *
73  * This function should be called from the system boot up
74  * code to initialize Rime.
75  */
76 int rime_init(void);
77 
78 /**
79  * \brief Send an incoming packet to Rime
80  *
81  * This function should be called by the network driver to
82  * hand over a packet to Rime for further processing. The
83  * packet should be placed in the packetbuf (with
84  * packetbuf_copyfrom()) before calling this function.
85  *
86  */
87 void rime_input(void);
88 
89 int rime_output(struct channel *c);
90 
91 struct rime_sniffer {
92  struct rime_sniffer *next;
93  void (* input_callback)(void);
94  void (* output_callback)(int mac_status);
95 };
96 
97 #define RIME_SNIFFER(name, input_callback, output_callback) \
98 static struct rime_sniffer name = { NULL, input_callback, output_callback }
99 
100 void rime_sniffer_add(struct rime_sniffer *s);
101 void rime_sniffer_remove(struct rime_sniffer *s);
102 
103 extern const struct network_driver rime_driver;
104 
105 /* Generic Rime return values. */
106 enum {
107  RIME_OK,
108  RIME_ERR,
109  RIME_ERR_CONTENTION,
110  RIME_ERR_NOACK,
111 };
112 #endif /* RIME_H_ */
113 
114 /** @} */
115 /** @} */
Neighbor discovery header file
Header file for hop-by-hop reliable data collection
Header file for the Rime buffer (packetbuf) management
Multihop forwarding header file
Neighbor discovery header file
void rime_input(void)
Send an incoming packet to Rime.
The structure of a network driver in Contiki.
Definition: netstack.h:117
int rime_init(void)
Initialize Rime.
Header file for a simple time synchronization mechanism
Header file for Polite Anonymous best effort local Broadcast (polite)
Header file for the announcement primitive
Reliable unicast header file
Header file for Ipolite best effort local Broadcast (ipolite)
Header file for the Rime queue buffer management
Header file for the Rime mesh routing protocol
Header file for the best-effort network flooding (netflood)
Header file for Trickle (reliable single source flooding) for Rime
Header file for Rime statistics
Multihop forwarding header file
Header file for the Rime mesh routing protocol
MAC driver header file
Header file for the reliable unicast bulk transfer module
Header file for the Rime route table
Header file for the Rime address representation