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/* Both Classic and Lite use rpl_nbr_gc_get_worst */
101#ifndef NBR_TABLE_CONF_GC_GET_WORST
102#define NBR_TABLE_CONF_GC_GET_WORST rpl_nbr_gc_get_worst
103#endif /* NBR_TABLE_CONF_GC_GET_WORST */
104#if ROUTING_CONF_RPL_CLASSIC
105/* Only Classic handles a max number of children */
106#ifndef NBR_TABLE_CONF_CAN_ACCEPT_NEW
107#define NBR_TABLE_CONF_CAN_ACCEPT_NEW rpl_nbr_can_accept_new
108#endif /* NBR_TABLE_CONF_CAN_ACCEPT_NEW */
109/* Leave 3 spots for candidate parents incl. default route. */
110#if RPL_NBR_POLICY_MAX_NEXTHOP_NEIGHBORS
111#define RPL_NBR_POLICY_MAX_NEXTHOP_NEIGHBORS MAX(NBR_TABLE_CONF_MAX_NEIGHBORS - 3, 0)
112#endif /* RPL_NBR_POLICY_MAX_NEXTHOP_NEIGHBORS */
113#endif /* ROUTING_CONF_RPL_CLASSIC */
114#endif /* UIP_CONF_IPV6_RPL */
115
116/* UIP_CONF_UDP specifies if UDP support should be included or
117 not. Disabling UDP saves memory but breaks a lot of stuff. */
118#ifndef UIP_CONF_UDP
119#define UIP_CONF_UDP 1
120#endif /* UIP_CONF_UDP */
121
122/* UIP_CONF_UDP_CONNS specifies the maximum number of
123 simultaneous UDP connections. */
124#ifndef UIP_CONF_UDP_CONNS
125#define UIP_CONF_UDP_CONNS 8
126#endif /* UIP_CONF_UDP_CONNS */
127
128/* UIP_CONF_TCP specifies if TCP support should be included or
129 not. Disabling TCP saves memory. */
130#ifndef UIP_CONF_TCP
131#define UIP_CONF_TCP 0
132#endif /* UIP_CONF_TCP */
133
134/* UIP_CONF_TCP_CONNS specifies the maximum number of
135 simultaneous TCP connections. */
136#ifndef UIP_CONF_TCP_CONNS
137#if UIP_CONF_TCP
138#define UIP_CONF_TCP_CONNS 8
139#else /* UIP_CONF_TCP */
140#define UIP_CONF_TCP_CONNS 0
141#endif /* UIP_CONF_TCP */
142#endif /* UIP_CONF_TCP_CONNS */
143
144/* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement.
145 * We enable it by default when IPv6 is used without RPL. */
146#ifndef UIP_CONF_ND6_SEND_RA
147#if (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
148#define UIP_CONF_ND6_SEND_RA 1
149#else /* NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL */
150#define UIP_CONF_ND6_SEND_RA 0
151#endif /* NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL */
152#endif /* UIP_CONF_ND6_SEND_RA */
153
154/* UIP_CONF_ND6_SEND_NS enables standard IPv6 Neighbor Discovery Protocol
155 (RFC 4861). We enable it by default when IPv6 is used without RPL.
156 With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping)
157 is fed whenever receiving DIO. This is often sufficient
158 for RPL routing, i.e. to send to the preferred parent or any child.
159 Link-local unicast to other neighbors may, however, not be possible if
160 we never receive any DIO from them. This may happen if the link from the
161 neighbor to us is weak, if DIO transmissions are suppressed (Trickle
162 timer) or if the neighbor chooses not to transmit DIOs because it is
163 a leaf node or for any reason. */
164#ifndef UIP_CONF_ND6_SEND_NS
165#if (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
166#define UIP_CONF_ND6_SEND_NS 1
167#else /* (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) */
168#define UIP_CONF_ND6_SEND_NS 0
169#endif /* (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) */
170#endif /* UIP_CONF_ND6_SEND_NS */
171/* To speed up the neighbor cache construction,
172 enable UIP_CONF_ND6_AUTOFILL_NBR_CACHE. When a node does not the link-layer
173 address of a neighbor, it will infer it from the link-local IPv6, assuming
174 the node used autoconfiguration. Note that RPL uses its own freshness
175 mechanism to select whether neighbors are still usable as a parent
176 or not, regardless of the neighbor cache. Note that this is not
177 standard-compliant (RFC 4861), as neighbors will be added regardless of
178 their reachability and liveness. */
179#ifndef UIP_CONF_ND6_AUTOFILL_NBR_CACHE
180#if UIP_CONF_ND6_SEND_NS
181#define UIP_CONF_ND6_AUTOFILL_NBR_CACHE 0
182#else /* UIP_CONF_ND6_SEND_NS */
183#define UIP_CONF_ND6_AUTOFILL_NBR_CACHE 1
184#endif /* UIP_CONF_ND6_SEND_NS */
185#endif /* UIP_CONF_ND6_AUTOFILL_NBR_CACHE */
186/* UIP_CONF_ND6_SEND_NA allows to still comply with NDP even if the host does
187 not perform NUD or DAD processes. By default it is activated so the host
188 can still communicate with a full NDP peer. */
189#ifndef UIP_CONF_ND6_SEND_NA
190#if NETSTACK_CONF_WITH_IPV6
191#define UIP_CONF_ND6_SEND_NA 1
192#else /* NETSTACK_CONF_WITH_IPV6 */
193#define UIP_CONF_ND6_SEND_NA 0
194#endif /* NETSTACK_CONF_WITH_IPV6 */
195#endif /* UIP_CONF_ND6_SEND_NS */
196
197/*---------------------------------------------------------------------------*/
198/* 6lowpan configuration options.
199 *
200 * These options change the behavior of the 6lowpan header compression
201 * code (sicslowpan). They typically depend on the type of radio used
202 * on the target platform, and are therefore platform-specific.
203 */
204
205/* SICSLOWPAN_CONF_FRAG specifies if 6lowpan fragmentation should be
206 used or not. Fragmentation is on by default. */
207#ifndef SICSLOWPAN_CONF_FRAG
208#define SICSLOWPAN_CONF_FRAG 1
209#endif /* SICSLOWPAN_CONF_FRAG */
210
211/* SICSLOWPAN_CONF_COMPRESSION specifies what 6lowpan compression
212 mechanism to be used. 6lowpan hc06 is the default in Contiki. */
213#ifndef SICSLOWPAN_CONF_COMPRESSION
214#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC
215#endif /* SICSLOWPAN_CONF_COMPRESSION */
216
217#endif /* CONTIKI_DEFAULT_CONF_H */