2013-03-17 21:54:12 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2012, Thingsquare, http://www.thingsquare.com/.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the copyright holder nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
|
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTIKI_DEFAULT_CONF_H
|
|
|
|
#define CONTIKI_DEFAULT_CONF_H
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
/* Netstack configuration
|
|
|
|
*
|
|
|
|
* The netstack configuration is typically overridden by the platform
|
|
|
|
* configuration, as defined in contiki-conf.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* NETSTACK_CONF_RADIO specifies the radio driver. The radio driver
|
|
|
|
typically depends on the radio used on the target hardware. */
|
|
|
|
#ifndef NETSTACK_CONF_RADIO
|
|
|
|
#define NETSTACK_CONF_RADIO nullradio_driver
|
|
|
|
/* #define NETSTACK_CONF_RADIO cc2420_driver */
|
|
|
|
#endif /* NETSTACK_CONF_RADIO */
|
|
|
|
|
|
|
|
/* NETSTACK_CONF_FRAMER specifies the over-the-air frame format used
|
|
|
|
by Contiki radio packets. For IEEE 802.15.4 radios, use the
|
|
|
|
framer_802154 driver. */
|
|
|
|
#ifndef NETSTACK_CONF_FRAMER
|
2017-05-16 16:34:32 +00:00
|
|
|
#define NETSTACK_CONF_FRAMER framer_802154
|
2013-03-17 21:54:12 +00:00
|
|
|
/* #define NETSTACK_CONF_FRAMER framer_802154 */
|
|
|
|
#endif /* NETSTACK_CONF_FRAMER */
|
|
|
|
|
|
|
|
/* NETSTACK_CONF_MAC specifies the Medium Access Control (MAC)
|
|
|
|
layer. The nullmac_driver does not provide any MAC
|
|
|
|
functionality. The csma_driver is the default CSMA MAC layer, but
|
|
|
|
is not compatible with all radios. */
|
|
|
|
#ifndef NETSTACK_CONF_MAC
|
2017-05-16 16:34:32 +00:00
|
|
|
#define NETSTACK_CONF_MAC csma_driver
|
2013-03-17 21:54:12 +00:00
|
|
|
/* #define NETSTACK_CONF_MAC csma_driver */
|
|
|
|
#endif /* NETSTACK_CONF_MAC */
|
|
|
|
|
|
|
|
/* NETSTACK_CONF_NETWORK specifies the network layer and can be either
|
2017-05-13 11:09:58 +00:00
|
|
|
sicslowpan_driver, for IPv6 networking. */
|
2013-03-17 21:54:12 +00:00
|
|
|
#ifndef NETSTACK_CONF_NETWORK
|
2017-05-13 11:09:58 +00:00
|
|
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
2013-03-17 21:54:12 +00:00
|
|
|
#endif /* NETSTACK_CONF_NETWORK */
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
/* Packet buffer size options.
|
|
|
|
*
|
|
|
|
* The packet buffer size options can be tweaked on a per-project
|
|
|
|
* basis to reduce memory consumption.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* QUEUEBUF_CONF_NUM specifies the number of queue buffers. Queue
|
|
|
|
buffers are used throughout the Contiki netstack but the
|
|
|
|
configuration option can be tweaked to save memory. Performance can
|
|
|
|
suffer with a too low number of queue buffers though. */
|
|
|
|
#ifndef QUEUEBUF_CONF_NUM
|
|
|
|
#define QUEUEBUF_CONF_NUM 8
|
|
|
|
#endif /* QUEUEBUF_CONF_NUM */
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
/* uIPv6 configuration options.
|
|
|
|
*
|
|
|
|
* Many of the uIPv6 configuration options can be overriden by a
|
|
|
|
* project-specific configuration to save memory.
|
|
|
|
*/
|
|
|
|
|
2017-06-27 07:27:00 +00:00
|
|
|
/* NBR_TABLE_CONF_MAX_NEIGHBORS specifies the maximum number of neighbors
|
|
|
|
that each node will be able to handle. */
|
|
|
|
#ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
|
|
|
|
#define NBR_TABLE_CONF_MAX_NEIGHBORS 16
|
|
|
|
#endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
|
2017-06-10 12:35:39 +00:00
|
|
|
|
2017-06-30 16:03:58 +00:00
|
|
|
/* NETSTACK_MAX_ROUTE_ENTRIES specifies the maximum number of entries
|
2017-06-27 07:27:00 +00:00
|
|
|
the routing module will handle. Applies to uIP routing tables if they are
|
|
|
|
used, or to RPL non-storing mode links instead */
|
2017-06-30 16:03:58 +00:00
|
|
|
#ifndef NETSTACK_MAX_ROUTE_ENTRIES
|
|
|
|
#define NETSTACK_MAX_ROUTE_ENTRIES 16
|
|
|
|
#endif /* NETSTACK_MAX_ROUTE_ENTRIES */
|
2017-06-10 12:35:39 +00:00
|
|
|
|
2014-12-01 20:02:57 +00:00
|
|
|
/* NETSTACK_CONF_WITH_IPV6 specifies whether or not IPv6 should be used. If IPv6
|
2013-03-17 21:54:12 +00:00
|
|
|
is not used, IPv4 is used instead. */
|
2014-12-01 20:02:57 +00:00
|
|
|
#ifndef NETSTACK_CONF_WITH_IPV6
|
|
|
|
#define NETSTACK_CONF_WITH_IPV6 0
|
|
|
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
2013-03-17 21:54:12 +00:00
|
|
|
|
|
|
|
/* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved
|
|
|
|
for the uIP packet buffer. This sets an upper bound on the largest
|
|
|
|
IP packet that can be received by the system. */
|
|
|
|
#ifndef UIP_CONF_BUFFER_SIZE
|
|
|
|
#define UIP_CONF_BUFFER_SIZE 128
|
|
|
|
#endif /* UIP_CONF_BUFFER_SIZE */
|
|
|
|
|
|
|
|
/* UIP_CONF_ROUTER specifies if the IPv6 node should be a router or
|
|
|
|
not. By default, all Contiki nodes are routers. */
|
|
|
|
#ifndef UIP_CONF_ROUTER
|
|
|
|
#define UIP_CONF_ROUTER 1
|
|
|
|
#endif /* UIP_CONF_ROUTER */
|
|
|
|
|
|
|
|
/* UIP_CONF_IPV6_RPL specifies if RPL is to be used for IPv6
|
|
|
|
routing. */
|
|
|
|
#ifndef UIP_CONF_IPV6_RPL
|
|
|
|
#define UIP_CONF_IPV6_RPL 1
|
|
|
|
#endif /* UIP_CONF_IPV6_RPL */
|
|
|
|
|
2015-09-20 19:02:30 +00:00
|
|
|
/* If RPL is enabled also enable the RPL NBR Policy */
|
|
|
|
#if UIP_CONF_IPV6_RPL
|
|
|
|
#ifndef NBR_TABLE_FIND_REMOVABLE
|
|
|
|
#define NBR_TABLE_FIND_REMOVABLE rpl_nbr_policy_find_removable
|
|
|
|
#endif /* NBR_TABLE_FIND_REMOVABLE */
|
|
|
|
#endif /* UIP_CONF_IPV6_RPL */
|
|
|
|
|
2013-03-17 21:54:12 +00:00
|
|
|
/* UIP_CONF_UDP specifies if UDP support should be included or
|
|
|
|
not. Disabling UDP saves memory but breaks a lot of stuff. */
|
|
|
|
#ifndef UIP_CONF_UDP
|
|
|
|
#define UIP_CONF_UDP 1
|
|
|
|
#endif /* UIP_CONF_UDP */
|
|
|
|
|
2017-06-23 19:26:59 +00:00
|
|
|
/* UIP_CONF_UDP_CONNS specifies the maximum number of
|
|
|
|
simultaneous UDP connections. */
|
|
|
|
#ifndef UIP_CONF_UDP_CONNS
|
|
|
|
#define UIP_CONF_UDP_CONNS 8
|
|
|
|
#endif /* UIP_CONF_UDP_CONNS */
|
2013-03-17 21:54:12 +00:00
|
|
|
|
|
|
|
/* UIP_CONF_TCP specifies if TCP support should be included or
|
|
|
|
not. Disabling TCP saves memory. */
|
|
|
|
#ifndef UIP_CONF_TCP
|
2017-06-23 19:26:59 +00:00
|
|
|
#define UIP_CONF_TCP 0
|
2013-03-17 21:54:12 +00:00
|
|
|
#endif /* UIP_CONF_TCP */
|
|
|
|
|
2017-06-23 19:26:59 +00:00
|
|
|
/* UIP_CONF_TCP_CONNS specifies the maximum number of
|
2013-03-17 21:54:12 +00:00
|
|
|
simultaneous TCP connections. */
|
2017-06-23 19:26:59 +00:00
|
|
|
#ifndef UIP_CONF_TCP_CONNS
|
|
|
|
#define UIP_CONF_TCP_CONNS 8
|
|
|
|
#endif /* UIP_CONF_TCP_CONNS */
|
2013-03-17 21:54:12 +00:00
|
|
|
|
2015-05-10 11:40:56 +00:00
|
|
|
/* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement.
|
2015-10-06 14:40:53 +00:00
|
|
|
* We enable it by default when IPv6 is used without RPL. */
|
2015-05-10 11:40:56 +00:00
|
|
|
#ifndef UIP_CONF_ND6_SEND_RA
|
|
|
|
#define UIP_CONF_ND6_SEND_RA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
|
|
|
|
#endif /* UIP_CONF_ND6_SEND_RA */
|
|
|
|
|
2017-06-19 07:55:22 +00:00
|
|
|
/* UIP_CONF_ND6_SEND_NS enables standard IPv6 Neighbor Discovery Protocol
|
|
|
|
(RFC 4861). We enable it by default when IPv6 is used without RPL.
|
2015-10-06 14:40:53 +00:00
|
|
|
With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping)
|
2017-06-16 13:57:24 +00:00
|
|
|
is fed whenever receiving DIO. This is often sufficient
|
2015-10-06 14:40:53 +00:00
|
|
|
for RPL routing, i.e. to send to the preferred parent or any child.
|
|
|
|
Link-local unicast to other neighbors may, however, not be possible if
|
|
|
|
we never receive any DIO from them. This may happen if the link from the
|
|
|
|
neighbor to us is weak, if DIO transmissions are suppressed (Trickle
|
|
|
|
timer) or if the neighbor chooses not to transmit DIOs because it is
|
2017-06-19 07:55:22 +00:00
|
|
|
a leaf node or for any reason. */
|
2017-01-16 12:44:15 +00:00
|
|
|
#ifndef UIP_CONF_ND6_SEND_NS
|
|
|
|
#define UIP_CONF_ND6_SEND_NS (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
|
|
|
|
#endif /* UIP_CONF_ND6_SEND_NS */
|
2017-06-16 13:57:24 +00:00
|
|
|
/* To speed up the neighbor cache construction,
|
|
|
|
enable UIP_CONF_ND6_AUTOFILL_NBR_CACHE. When a node does not the link-layer
|
|
|
|
address of a neighbor, it will infer it from the link-local IPv6, assuming
|
|
|
|
the node used autoconfiguration. Note that RPL uses its own freshness
|
2017-06-19 07:55:22 +00:00
|
|
|
mechanism to select whether neighbors are still usable as a parent
|
|
|
|
or not, regardless of the neighbor cache. Note that this is not
|
|
|
|
standard-compliant (RFC 4861), as neighbors will be added regardless of
|
|
|
|
their reachability and liveness. */
|
2017-06-16 13:57:24 +00:00
|
|
|
#ifndef UIP_CONF_ND6_AUTOFILL_NBR_CACHE
|
|
|
|
#define UIP_CONF_ND6_AUTOFILL_NBR_CACHE (!UIP_CONF_ND6_SEND_NS)
|
|
|
|
#endif /* UIP_CONF_ND6_AUTOFILL_NBR_CACHE */
|
2017-01-16 12:44:15 +00:00
|
|
|
/* UIP_CONF_ND6_SEND_NA allows to still comply with NDP even if the host does
|
|
|
|
not perform NUD or DAD processes. By default it is activated so the host
|
|
|
|
can still communicate with a full NDP peer. */
|
2014-04-30 09:15:52 +00:00
|
|
|
#ifndef UIP_CONF_ND6_SEND_NA
|
2017-01-16 12:44:15 +00:00
|
|
|
#define UIP_CONF_ND6_SEND_NA (NETSTACK_CONF_WITH_IPV6)
|
|
|
|
#endif /* UIP_CONF_ND6_SEND_NS */
|
2014-04-30 09:15:52 +00:00
|
|
|
|
2013-03-17 21:54:12 +00:00
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
/* 6lowpan configuration options.
|
|
|
|
*
|
|
|
|
* These options change the behavior of the 6lowpan header compression
|
|
|
|
* code (sicslowpan). They typically depend on the type of radio used
|
|
|
|
* on the target platform, and are therefore platform-specific.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* SICSLOWPAN_CONF_FRAG specifies if 6lowpan fragmentation should be
|
|
|
|
used or not. Fragmentation is on by default. */
|
|
|
|
#ifndef SICSLOWPAN_CONF_FRAG
|
|
|
|
#define SICSLOWPAN_CONF_FRAG 1
|
|
|
|
#endif /* SICSLOWPAN_CONF_FRAG */
|
|
|
|
|
2014-02-09 14:02:55 +00:00
|
|
|
/* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD is the maximum available size for
|
|
|
|
frame headers, link layer security-related overhead, as well as
|
|
|
|
6LoWPAN payload. By default, SICSLOWPAN_CONF_MAC_MAX_PAYLOAD is
|
|
|
|
127 bytes (MTU of 802.15.4) - 2 bytes (Footer of 802.15.4). */
|
2013-03-17 21:54:12 +00:00
|
|
|
#ifndef SICSLOWPAN_CONF_MAC_MAX_PAYLOAD
|
2014-02-09 14:02:55 +00:00
|
|
|
#define SICSLOWPAN_CONF_MAC_MAX_PAYLOAD (127 - 2)
|
2013-03-17 21:54:12 +00:00
|
|
|
#endif /* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD */
|
|
|
|
|
|
|
|
/* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD sets a lower threshold for
|
|
|
|
when packets should not be compressed. This is used by ContikiMAC,
|
|
|
|
which requires packets to be larger than a given minimum size. */
|
|
|
|
#ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD
|
|
|
|
#define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 0
|
|
|
|
/* #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63 */
|
|
|
|
#endif /* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD */
|
|
|
|
|
|
|
|
/* SICSLOWPAN_CONF_COMPRESSION specifies what 6lowpan compression
|
|
|
|
mechanism to be used. 6lowpan hc06 is the default in Contiki. */
|
|
|
|
#ifndef SICSLOWPAN_CONF_COMPRESSION
|
|
|
|
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
|
|
|
|
#endif /* SICSLOWPAN_CONF_COMPRESSION */
|
|
|
|
|
|
|
|
#endif /* CONTIKI_DEFAULT_CONF_H */
|