Contiki-NG
contiki-default-conf.h
1 /*
2  * Copyright (c) 2012, Thingsquare, http://www.thingsquare.com/.
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 copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  */
31 
32 #ifndef CONTIKI_DEFAULT_CONF_H
33 #define CONTIKI_DEFAULT_CONF_H
34 
35 /*---------------------------------------------------------------------------*/
36 /* Link-layer options
37  */
38 
39 /* IEEE802154_CONF_PANID defines the default PAN ID for IEEE 802.15.4 networks */
40 #ifndef IEEE802154_CONF_PANID
41 #define IEEE802154_CONF_PANID 0xabcd
42 #endif /* IEEE802154_CONF_PANID */
43 
44 /* IEEE802154_CONF_DEFAULT_CHANNEL defines the default channel for IEEE 802.15.4
45  * networks, for MAC layers without a channel selection or channel hopping
46  * mechanism. Current 802.15.4 MAC layers:
47  * - CSMA: uses IEEE802154_CONF_DEFAULT_CHANNEL
48  * - TSCH: uses its own TSCH_DEFAULT_HOPPING_SEQUENCE instead
49  */
50 #ifndef IEEE802154_CONF_DEFAULT_CHANNEL
51 #define IEEE802154_CONF_DEFAULT_CHANNEL 26
52 #endif /* IEEE802154_CONF_DEF_CHANNEL */
53 
54 /* QUEUEBUF_CONF_NUM specifies the number of queue buffers. Queue
55  buffers are used throughout the Contiki netstack but the
56  configuration option can be tweaked to save memory. Performance can
57  suffer with a too low number of queue buffers though. */
58 #ifndef QUEUEBUF_CONF_NUM
59 #define QUEUEBUF_CONF_NUM 8
60 #endif /* QUEUEBUF_CONF_NUM */
61 /*---------------------------------------------------------------------------*/
62 /* uIPv6 configuration options.
63  *
64  * Many of the uIPv6 configuration options can be overriden by a
65  * project-specific configuration to save memory.
66  */
67 
68  /* NBR_TABLE_CONF_MAX_NEIGHBORS specifies the maximum number of neighbors
69  that each node will be able to handle. */
70 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
71 #define NBR_TABLE_CONF_MAX_NEIGHBORS 16
72 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
73 
74 /* NETSTACK_MAX_ROUTE_ENTRIES specifies the maximum number of entries
75  the routing module will handle. Applies to uIP routing tables if they are
76  used, or to RPL non-storing mode links instead */
77 #ifndef NETSTACK_MAX_ROUTE_ENTRIES
78 #define NETSTACK_MAX_ROUTE_ENTRIES 16
79 #endif /* NETSTACK_MAX_ROUTE_ENTRIES */
80 
81 /* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved
82  for the uIP packet buffer. This sets an upper bound on the largest
83  IP packet that can be received by the system. */
84 #ifndef UIP_CONF_BUFFER_SIZE
85 #define UIP_CONF_BUFFER_SIZE 1280
86 #endif /* UIP_CONF_BUFFER_SIZE */
87 
88 /* UIP_CONF_ROUTER specifies if the IPv6 node should be a router or
89  not. By default, all Contiki nodes are routers. */
90 #ifndef UIP_CONF_ROUTER
91 #define UIP_CONF_ROUTER 1
92 #endif /* UIP_CONF_ROUTER */
93 
94 /* UIP_CONF_IPV6_RPL tells whether the RPL routing protocol is running,
95  whether implemented as RPL Lite or RPL Classic */
96 #define UIP_CONF_IPV6_RPL (ROUTING_CONF_RPL_LITE || ROUTING_CONF_RPL_CLASSIC)
97 
98 /* If RPL is enabled also enable the RPL NBR Policy */
99 #if UIP_CONF_IPV6_RPL
100 #ifndef NBR_TABLE_FIND_REMOVABLE
101 #define NBR_TABLE_FIND_REMOVABLE rpl_nbr_policy_find_removable
102 #endif /* NBR_TABLE_FIND_REMOVABLE */
103 #endif /* UIP_CONF_IPV6_RPL */
104 
105 /* UIP_CONF_UDP specifies if UDP support should be included or
106  not. Disabling UDP saves memory but breaks a lot of stuff. */
107 #ifndef UIP_CONF_UDP
108 #define UIP_CONF_UDP 1
109 #endif /* UIP_CONF_UDP */
110 
111 /* UIP_CONF_UDP_CONNS specifies the maximum number of
112  simultaneous UDP connections. */
113 #ifndef UIP_CONF_UDP_CONNS
114 #define UIP_CONF_UDP_CONNS 8
115 #endif /* UIP_CONF_UDP_CONNS */
116 
117 /* UIP_CONF_TCP specifies if TCP support should be included or
118  not. Disabling TCP saves memory. */
119 #ifndef UIP_CONF_TCP
120 #define UIP_CONF_TCP 0
121 #endif /* UIP_CONF_TCP */
122 
123 /* UIP_CONF_TCP_CONNS specifies the maximum number of
124  simultaneous TCP connections. */
125 #ifndef UIP_CONF_TCP_CONNS
126 #if UIP_CONF_TCP
127 #define UIP_CONF_TCP_CONNS 8
128 #else /* UIP_CONF_TCP */
129 #define UIP_CONF_TCP_CONNS 0
130 #endif /* UIP_CONF_TCP */
131 #endif /* UIP_CONF_TCP_CONNS */
132 
133 /* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement.
134  * We enable it by default when IPv6 is used without RPL. */
135 #ifndef UIP_CONF_ND6_SEND_RA
136 #if (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
137 #define UIP_CONF_ND6_SEND_RA 1
138 #else /* NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL */
139 #define UIP_CONF_ND6_SEND_RA 0
140 #endif /* NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL */
141 #endif /* UIP_CONF_ND6_SEND_RA */
142 
143 /* UIP_CONF_ND6_SEND_NS enables standard IPv6 Neighbor Discovery Protocol
144  (RFC 4861). We enable it by default when IPv6 is used without RPL.
145  With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping)
146  is fed whenever receiving DIO. This is often sufficient
147  for RPL routing, i.e. to send to the preferred parent or any child.
148  Link-local unicast to other neighbors may, however, not be possible if
149  we never receive any DIO from them. This may happen if the link from the
150  neighbor to us is weak, if DIO transmissions are suppressed (Trickle
151  timer) or if the neighbor chooses not to transmit DIOs because it is
152  a leaf node or for any reason. */
153 #ifndef UIP_CONF_ND6_SEND_NS
154 #if (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
155 #define UIP_CONF_ND6_SEND_NS 1
156 #else /* (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) */
157 #define UIP_CONF_ND6_SEND_NS 0
158 #endif /* (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) */
159 #endif /* UIP_CONF_ND6_SEND_NS */
160 /* To speed up the neighbor cache construction,
161  enable UIP_CONF_ND6_AUTOFILL_NBR_CACHE. When a node does not the link-layer
162  address of a neighbor, it will infer it from the link-local IPv6, assuming
163  the node used autoconfiguration. Note that RPL uses its own freshness
164  mechanism to select whether neighbors are still usable as a parent
165  or not, regardless of the neighbor cache. Note that this is not
166  standard-compliant (RFC 4861), as neighbors will be added regardless of
167  their reachability and liveness. */
168 #ifndef UIP_CONF_ND6_AUTOFILL_NBR_CACHE
169 #if UIP_CONF_ND6_SEND_NS
170 #define UIP_CONF_ND6_AUTOFILL_NBR_CACHE 0
171 #else /* UIP_CONF_ND6_SEND_NS */
172 #define UIP_CONF_ND6_AUTOFILL_NBR_CACHE 1
173 #endif /* UIP_CONF_ND6_SEND_NS */
174 #endif /* UIP_CONF_ND6_AUTOFILL_NBR_CACHE */
175 /* UIP_CONF_ND6_SEND_NA allows to still comply with NDP even if the host does
176  not perform NUD or DAD processes. By default it is activated so the host
177  can still communicate with a full NDP peer. */
178 #ifndef UIP_CONF_ND6_SEND_NA
179 #if NETSTACK_CONF_WITH_IPV6
180 #define UIP_CONF_ND6_SEND_NA 1
181 #else /* NETSTACK_CONF_WITH_IPV6 */
182 #define UIP_CONF_ND6_SEND_NA 0
183 #endif /* NETSTACK_CONF_WITH_IPV6 */
184 #endif /* UIP_CONF_ND6_SEND_NS */
185 
186 /*---------------------------------------------------------------------------*/
187 /* 6lowpan configuration options.
188  *
189  * These options change the behavior of the 6lowpan header compression
190  * code (sicslowpan). They typically depend on the type of radio used
191  * on the target platform, and are therefore platform-specific.
192  */
193 
194 /* SICSLOWPAN_CONF_FRAG specifies if 6lowpan fragmentation should be
195  used or not. Fragmentation is on by default. */
196 #ifndef SICSLOWPAN_CONF_FRAG
197 #define SICSLOWPAN_CONF_FRAG 1
198 #endif /* SICSLOWPAN_CONF_FRAG */
199 
200 /* SICSLOWPAN_CONF_COMPRESSION specifies what 6lowpan compression
201  mechanism to be used. 6lowpan hc06 is the default in Contiki. */
202 #ifndef SICSLOWPAN_CONF_COMPRESSION
203 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC
204 #endif /* SICSLOWPAN_CONF_COMPRESSION */
205 
206 #endif /* CONTIKI_DEFAULT_CONF_H */