1 /* 2 * Copyright (c) 2017 Apple Inc. All rights reserved. 3 * 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. The rights granted to you under the License 10 * may not be used to create, or enable the creation or redistribution of, 11 * unlawful or unlicensed copies of an Apple operating system, or to 12 * circumvent, violate, or enable the circumvention or violation of, any 13 * terms of an Apple operating system software license agreement. 14 * 15 * Please obtain a copy of the License at 16 * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 * 18 * The Original Code and all software distributed under the License are 19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 * Please see the License for the specific language governing rights and 24 * limitations under the License. 25 * 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 */ 28 /* 29 * Copyright (c) 2012, Thingsquare, http://www.thingsquare.com/. 30 * All rights reserved. 31 * 32 * Redistribution and use in source and binary forms, with or without 33 * modification, are permitted provided that the following conditions 34 * are met: 35 * 1. Redistributions of source code must retain the above copyright 36 * notice, this list of conditions and the following disclaimer. 37 * 2. Redistributions in binary form must reproduce the above copyright 38 * notice, this list of conditions and the following disclaimer in the 39 * documentation and/or other materials provided with the distribution. 40 * 3. Neither the name of the copyright holder nor the names of its 41 * contributors may be used to endorse or promote products derived 42 * from this software without specific prior written permission. 43 * 44 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 45 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 46 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 47 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 48 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 49 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 50 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 51 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 53 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 54 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 55 * OF THE POSSIBILITY OF SUCH DAMAGE. 56 * 57 */ 58 59 #ifndef CONTIKI_DEFAULT_CONF_H 60 #define CONTIKI_DEFAULT_CONF_H 61 62 /*---------------------------------------------------------------------------*/ 63 /* Netstack configuration 64 * 65 * The netstack configuration is typically overridden by the platform 66 * configuration, as defined in contiki-conf.h 67 */ 68 69 /* NETSTACK_CONF_RADIO specifies the radio driver. The radio driver 70 * typically depends on the radio used on the target hardware. */ 71 #ifndef NETSTACK_CONF_RADIO 72 #define NETSTACK_CONF_RADIO nullradio_driver 73 /* #define NETSTACK_CONF_RADIO cc2420_driver */ 74 #endif /* NETSTACK_CONF_RADIO */ 75 76 /* NETSTACK_CONF_FRAMER specifies the over-the-air frame format used 77 * by Contiki radio packets. For IEEE 802.15.4 radios, use the 78 * framer_802154 driver. */ 79 #ifndef NETSTACK_CONF_FRAMER 80 #define NETSTACK_CONF_FRAMER framer_nullmac 81 /* #define NETSTACK_CONF_FRAMER framer_802154 */ 82 #endif /* NETSTACK_CONF_FRAMER */ 83 84 /* NETSTACK_CONF_RDC specifies the Radio Duty Cycling (RDC) layer. The 85 * nullrdc_driver never turns the radio off and is compatible with all 86 * radios, but consumes a lot of power. The contikimac_driver is 87 * highly power-efficent and allows sleepy routers, but is not 88 * compatible with all radios. */ 89 #ifndef NETSTACK_CONF_RDC 90 #define NETSTACK_CONF_RDC nullrdc_driver 91 /* #define NETSTACK_CONF_RDC contikimac_driver */ 92 #endif /* NETSTACK_CONF_RDC */ 93 94 /* NETSTACK_CONF_MAC specifies the Medium Access Control (MAC) 95 * layer. The nullmac_driver does not provide any MAC 96 * functionality. The csma_driver is the default CSMA MAC layer, but 97 * is not compatible with all radios. */ 98 #ifndef NETSTACK_CONF_MAC 99 #define NETSTACK_CONF_MAC nullmac_driver 100 /* #define NETSTACK_CONF_MAC csma_driver */ 101 #endif /* NETSTACK_CONF_MAC */ 102 103 /* NETSTACK_CONF_LLSEC specifies the link layer security driver. */ 104 #ifndef NETSTACK_CONF_LLSEC 105 #define NETSTACK_CONF_LLSEC nullsec_driver 106 #endif /* NETSTACK_CONF_LLSEC */ 107 108 /* To avoid unnecessary complexity, we assume the common case of 109 * a constant LoWPAN-wide IEEE 802.15.4 security level, which 110 * can be specified by defining LLSEC802154_CONF_SECURITY_LEVEL. */ 111 #ifndef LLSEC802154_CONF_SECURITY_LEVEL 112 #define LLSEC802154_CONF_SECURITY_LEVEL 0 113 #endif /* LLSEC802154_CONF_SECURITY_LEVEL */ 114 115 /* NETSTACK_CONF_NETWORK specifies the network layer and can be either 116 * sicslowpan_driver, for IPv6 networking, or rime_driver, for the 117 * custom Rime network stack. */ 118 #ifndef NETSTACK_CONF_NETWORK 119 #define NETSTACK_CONF_NETWORK rime_driver 120 /* #define NETSTACK_CONF_NETWORK sicslowpan_driver */ 121 #endif /* NETSTACK_CONF_NETWORK */ 122 123 /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE specifies the channel check 124 * rate of the RDC layer. This defines how often the RDC will wake up 125 * and check for radio channel activity. A higher check rate results 126 * in higher communication performance at the cost of a higher power 127 * consumption. */ 128 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 129 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8 130 #endif /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE */ 131 132 /*---------------------------------------------------------------------------*/ 133 /* Packet buffer size options. 134 * 135 * The packet buffer size options can be tweaked on a per-project 136 * basis to reduce memory consumption. 137 */ 138 139 /* QUEUEBUF_CONF_NUM specifies the number of queue buffers. Queue 140 * buffers are used throughout the Contiki netstack but the 141 * configuration option can be tweaked to save memory. Performance can 142 * suffer with a too low number of queue buffers though. */ 143 #ifndef QUEUEBUF_CONF_NUM 144 #define QUEUEBUF_CONF_NUM 8 145 #endif /* QUEUEBUF_CONF_NUM */ 146 /*---------------------------------------------------------------------------*/ 147 /* uIPv6 configuration options. 148 * 149 * Many of the uIPv6 configuration options can be overriden by a 150 * project-specific configuration to save memory. 151 */ 152 153 /* NETSTACK_CONF_WITH_IPV6 specifies whether or not IPv6 should be used. If IPv6 154 * is not used, IPv4 is used instead. */ 155 #ifndef NETSTACK_CONF_WITH_IPV6 156 #define NETSTACK_CONF_WITH_IPV6 0 157 #endif /* NETSTACK_CONF_WITH_IPV6 */ 158 159 /* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved 160 * for the uIP packet buffer. This sets an upper bound on the largest 161 * IP packet that can be received by the system. */ 162 #ifndef UIP_CONF_BUFFER_SIZE 163 #define UIP_CONF_BUFFER_SIZE 128 164 #endif /* UIP_CONF_BUFFER_SIZE */ 165 166 /* UIP_CONF_ROUTER specifies if the IPv6 node should be a router or 167 * not. By default, all Contiki nodes are routers. */ 168 #ifndef UIP_CONF_ROUTER 169 #define UIP_CONF_ROUTER 1 170 #endif /* UIP_CONF_ROUTER */ 171 172 /* UIP_CONF_IPV6_RPL specifies if RPL is to be used for IPv6 173 * routing. */ 174 #ifndef UIP_CONF_IPV6_RPL 175 #define UIP_CONF_IPV6_RPL 1 176 #endif /* UIP_CONF_IPV6_RPL */ 177 178 /* UIP_CONF_MAX_ROUTES specifies the maximum number of routes that each 179 * node will be able to handle. */ 180 #ifndef UIP_CONF_MAX_ROUTES 181 #define UIP_CONF_MAX_ROUTES 20 182 #endif /* UIP_CONF_MAX_ROUTES */ 183 184 /* UIP_CONF_UDP specifies if UDP support should be included or 185 * not. Disabling UDP saves memory but breaks a lot of stuff. */ 186 #ifndef UIP_CONF_UDP 187 #define UIP_CONF_UDP 1 188 #endif /* UIP_CONF_UDP */ 189 190 /* UIP_CONF_MAX_CONNECTIONS specifies the maximum number of 191 * simultaneous TCP connections. */ 192 #ifndef UIP_CONF_MAX_CONNECTIONS 193 #define UIP_CONF_MAX_CONNECTIONS 8 194 #endif /* UIP_CONF_MAX_CONNECTIONS */ 195 196 /* UIP_CONF_TCP specifies if TCP support should be included or 197 * not. Disabling TCP saves memory. */ 198 #ifndef UIP_CONF_TCP 199 #define UIP_CONF_TCP 1 200 #endif /* UIP_CONF_TCP */ 201 202 /* UIP_CONF_MAX_CONNECTIONS specifies the maximum number of 203 * simultaneous TCP connections. */ 204 #ifndef UIP_CONF_MAX_CONNECTIONS 205 #define UIP_CONF_MAX_CONNECTIONS 8 206 #endif /* UIP_CONF_MAX_CONNECTIONS */ 207 208 209 /* UIP_CONF_TCP_SPLIT enables a performance optimization hack, where 210 * each maximum-sized TCP segment is split into two, to avoid the 211 * performance degradation that is caused by delayed ACKs. */ 212 #ifndef UIP_CONF_TCP_SPLIT 213 #define UIP_CONF_TCP_SPLIT 0 214 #endif /* UIP_CONF_TCP_SPLIT */ 215 216 /* NBR_TABLE_CONF_MAX_NEIGHBORS specifies the maximum number of neighbors 217 * that each node will be able to handle. */ 218 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS 219 #define NBR_TABLE_CONF_MAX_NEIGHBORS 8 220 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */ 221 222 /* UIP_CONF_ND6_SEND_NA enables standard IPv6 Neighbor Discovery Protocol. 223 * This is unneeded when RPL is used. Disable to save ROM and a little RAM. */ 224 #ifndef UIP_CONF_ND6_SEND_NA 225 #define UIP_CONF_ND6_SEND_NA 1 226 #endif /* UIP_CONF_ND6_SEND_NA */ 227 228 /*---------------------------------------------------------------------------*/ 229 /* 6lowpan configuration options. 230 * 231 * These options change the behavior of the 6lowpan header compression 232 * code (sicslowpan). They typically depend on the type of radio used 233 * on the target platform, and are therefore platform-specific. 234 */ 235 236 /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS specifies how many times the 237 * MAC layer should resend packets if no link-layer ACK was 238 * received. This only makes sense with the csma_driver 239 * NETSTACK_CONF_MAC. */ 240 #ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 241 #define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 4 242 #endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */ 243 244 /* SICSLOWPAN_CONF_FRAG specifies if 6lowpan fragmentation should be 245 * used or not. Fragmentation is on by default. */ 246 #ifndef SICSLOWPAN_CONF_FRAG 247 #define SICSLOWPAN_CONF_FRAG 1 248 #endif /* SICSLOWPAN_CONF_FRAG */ 249 250 /* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD is the maximum available size for 251 * frame headers, link layer security-related overhead, as well as 252 * 6LoWPAN payload. By default, SICSLOWPAN_CONF_MAC_MAX_PAYLOAD is 253 * 127 bytes (MTU of 802.15.4) - 2 bytes (Footer of 802.15.4). */ 254 #ifndef SICSLOWPAN_CONF_MAC_MAX_PAYLOAD 255 #define SICSLOWPAN_CONF_MAC_MAX_PAYLOAD (127 - 2) 256 #endif /* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD */ 257 258 /* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD sets a lower threshold for 259 * when packets should not be compressed. This is used by ContikiMAC, 260 * which requires packets to be larger than a given minimum size. */ 261 #ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 262 #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 0 263 /* #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63 */ 264 #endif /* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD */ 265 266 /* SICSLOWPAN_CONF_COMPRESSION specifies what 6lowpan compression 267 * mechanism to be used. 6lowpan hc06 is the default in Contiki. */ 268 #ifndef SICSLOWPAN_CONF_COMPRESSION 269 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06 270 #endif /* SICSLOWPAN_CONF_COMPRESSION */ 271 272 /*---------------------------------------------------------------------------*/ 273 /* ContikiMAC configuration options. 274 * 275 * These are typically configured on a per-platform basis. 276 */ 277 278 /* CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION specifies if ContikiMAC 279 * should optimize for the phase of neighbors. The phase optimization 280 * may reduce power consumption but is not compatible with all timer 281 * settings and is therefore off by default. */ 282 #ifndef CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 283 #define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0 284 #endif /* CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION */ 285 286 287 #endif /* CONTIKI_DEFAULT_CONF_H */ 288