Contiki-NG
Loading...
Searching...
No Matches
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/* Enable 802.15.4g payload bit-reversal (LSB⇄MSB) on TX/RX */
63#ifdef RADIO_CONF_PAYLOAD_BIT_REVERSE
64#define RADIO_PAYLOAD_BIT_REVERSE RADIO_CONF_PAYLOAD_BIT_REVERSE
65#else
66#define RADIO_PAYLOAD_BIT_REVERSE 0
67#endif
68
69/*---------------------------------------------------------------------------*/
70/* uIPv6 configuration options.
71 *
72 * Many of the uIPv6 configuration options can be overriden by a
73 * project-specific configuration to save memory.
74 */
75
76 /* NBR_TABLE_CONF_MAX_NEIGHBORS specifies the maximum number of neighbors
77 that each node will be able to handle. */
78#ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
79#define NBR_TABLE_CONF_MAX_NEIGHBORS 16
80#endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
81
82/* NETSTACK_MAX_ROUTE_ENTRIES specifies the maximum number of entries
83 the routing module will handle. Applies to uIP routing tables if they are
84 used, or to RPL non-storing mode links instead */
85#ifndef NETSTACK_MAX_ROUTE_ENTRIES
86#define NETSTACK_MAX_ROUTE_ENTRIES 16
87#endif /* NETSTACK_MAX_ROUTE_ENTRIES */
88
89/* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved
90 for the uIP packet buffer. This sets an upper bound on the largest
91 IP packet that can be received by the system. */
92#ifndef UIP_CONF_BUFFER_SIZE
93#define UIP_CONF_BUFFER_SIZE 1280
94#endif /* UIP_CONF_BUFFER_SIZE */
95
96/* UIP_CONF_ROUTER specifies if the IPv6 node should be a router or
97 not. By default, all Contiki nodes are routers. */
98#ifndef UIP_CONF_ROUTER
99#define UIP_CONF_ROUTER 1
100#endif /* UIP_CONF_ROUTER */
101
102/* UIP_CONF_IPV6_RPL tells whether the RPL routing protocol is running,
103 whether implemented as RPL Lite or RPL Classic */
104#define UIP_CONF_IPV6_RPL (ROUTING_CONF_RPL_LITE || ROUTING_CONF_RPL_CLASSIC)
105
106/* If RPL is enabled also enable the RPL NBR Policy */
107#if UIP_CONF_IPV6_RPL
108/* Both Classic and Lite use rpl_nbr_gc_get_worst */
109#ifndef NBR_TABLE_CONF_GC_GET_WORST
110#define NBR_TABLE_CONF_GC_GET_WORST rpl_nbr_gc_get_worst
111#endif /* NBR_TABLE_CONF_GC_GET_WORST */
112#if ROUTING_CONF_RPL_CLASSIC
113/* Only Classic handles a max number of children */
114#ifndef NBR_TABLE_CONF_CAN_ACCEPT_NEW
115#define NBR_TABLE_CONF_CAN_ACCEPT_NEW rpl_nbr_can_accept_new
116#endif /* NBR_TABLE_CONF_CAN_ACCEPT_NEW */
117/* Leave 3 spots for candidate parents incl. default route. */
118#ifndef RPL_NBR_POLICY_CONF_MAX_NEXTHOP_NEIGHBORS
119#define RPL_NBR_POLICY_CONF_MAX_NEXTHOP_NEIGHBORS MAX(NBR_TABLE_CONF_MAX_NEIGHBORS - 3, 0)
120#endif /* RPL_NBR_POLICY_CONF_MAX_NEXTHOP_NEIGHBORS */
121#endif /* ROUTING_CONF_RPL_CLASSIC */
122#endif /* UIP_CONF_IPV6_RPL */
123
124/* UIP_CONF_UDP specifies if UDP support should be included or
125 not. Disabling UDP saves memory but breaks a lot of stuff. */
126#ifndef UIP_CONF_UDP
127#define UIP_CONF_UDP 1
128#endif /* UIP_CONF_UDP */
129
130/* UIP_CONF_UDP_CONNS specifies the maximum number of
131 simultaneous UDP connections. */
132#ifndef UIP_CONF_UDP_CONNS
133#define UIP_CONF_UDP_CONNS 8
134#endif /* UIP_CONF_UDP_CONNS */
135
136/* UIP_CONF_TCP specifies if TCP support should be included or
137 not. Disabling TCP saves memory. */
138#ifndef UIP_CONF_TCP
139#define UIP_CONF_TCP 0
140#endif /* UIP_CONF_TCP */
141
142/* UIP_CONF_TCP_CONNS specifies the maximum number of
143 simultaneous TCP connections. */
144#ifndef UIP_CONF_TCP_CONNS
145#if UIP_CONF_TCP
146#define UIP_CONF_TCP_CONNS 8
147#else /* UIP_CONF_TCP */
148#define UIP_CONF_TCP_CONNS 0
149#endif /* UIP_CONF_TCP */
150#endif /* UIP_CONF_TCP_CONNS */
151
152/* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement.
153 * We enable it by default when IPv6 is used without RPL. */
154#ifndef UIP_CONF_ND6_SEND_RA
155#if (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
156#define UIP_CONF_ND6_SEND_RA 1
157#else /* NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL */
158#define UIP_CONF_ND6_SEND_RA 0
159#endif /* NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL */
160#endif /* UIP_CONF_ND6_SEND_RA */
161
162/* UIP_CONF_ND6_SEND_NS enables standard IPv6 Neighbor Discovery Protocol
163 (RFC 4861). We enable it by default when IPv6 is used without RPL.
164 With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping)
165 is fed whenever receiving DIO. This is often sufficient
166 for RPL routing, i.e. to send to the preferred parent or any child.
167 Link-local unicast to other neighbors may, however, not be possible if
168 we never receive any DIO from them. This may happen if the link from the
169 neighbor to us is weak, if DIO transmissions are suppressed (Trickle
170 timer) or if the neighbor chooses not to transmit DIOs because it is
171 a leaf node or for any reason. */
172#ifndef UIP_CONF_ND6_SEND_NS
173#if (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
174#define UIP_CONF_ND6_SEND_NS 1
175#else /* (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) */
176#define UIP_CONF_ND6_SEND_NS 0
177#endif /* (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) */
178#endif /* UIP_CONF_ND6_SEND_NS */
179/* To speed up the neighbor cache construction,
180 enable UIP_CONF_ND6_AUTOFILL_NBR_CACHE. When a node does not the link-layer
181 address of a neighbor, it will infer it from the link-local IPv6, assuming
182 the node used autoconfiguration. Note that RPL uses its own freshness
183 mechanism to select whether neighbors are still usable as a parent
184 or not, regardless of the neighbor cache. Note that this is not
185 standard-compliant (RFC 4861), as neighbors will be added regardless of
186 their reachability and liveness. */
187#ifndef UIP_CONF_ND6_AUTOFILL_NBR_CACHE
188#if UIP_CONF_ND6_SEND_NS
189#define UIP_CONF_ND6_AUTOFILL_NBR_CACHE 0
190#else /* UIP_CONF_ND6_SEND_NS */
191#define UIP_CONF_ND6_AUTOFILL_NBR_CACHE 1
192#endif /* UIP_CONF_ND6_SEND_NS */
193#endif /* UIP_CONF_ND6_AUTOFILL_NBR_CACHE */
194/* UIP_CONF_ND6_SEND_NA allows to still comply with NDP even if the host does
195 not perform NUD or DAD processes. By default it is activated so the host
196 can still communicate with a full NDP peer. */
197#ifndef UIP_CONF_ND6_SEND_NA
198#if NETSTACK_CONF_WITH_IPV6
199#define UIP_CONF_ND6_SEND_NA 1
200#else /* NETSTACK_CONF_WITH_IPV6 */
201#define UIP_CONF_ND6_SEND_NA 0
202#endif /* NETSTACK_CONF_WITH_IPV6 */
203#endif /* UIP_CONF_ND6_SEND_NS */
204
205/*---------------------------------------------------------------------------*/
206/* 6lowpan configuration options.
207 *
208 * These options change the behavior of the 6lowpan header compression
209 * code (sicslowpan). They typically depend on the type of radio used
210 * on the target platform, and are therefore platform-specific.
211 */
212
213/* SICSLOWPAN_CONF_FRAG specifies if 6lowpan fragmentation should be
214 used or not. Fragmentation is on by default. */
215#ifndef SICSLOWPAN_CONF_FRAG
216#define SICSLOWPAN_CONF_FRAG 1
217#endif /* SICSLOWPAN_CONF_FRAG */
218
219/* SICSLOWPAN_CONF_COMPRESSION specifies what 6lowpan compression
220 mechanism to be used. 6lowpan hc06 is the default in Contiki. */
221#ifndef SICSLOWPAN_CONF_COMPRESSION
222#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC
223#endif /* SICSLOWPAN_CONF_COMPRESSION */
224
225#endif /* CONTIKI_DEFAULT_CONF_H */