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