Contiki 2.6
|
00001 /* 00002 * Copyright (c) 2005, Swedish Institute of Computer Science 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 3. Neither the name of the Institute nor the names of its contributors 00014 * may be used to endorse or promote products derived from this software 00015 * without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00027 * SUCH DAMAGE. 00028 * 00029 * This file is part of the Contiki operating system. 00030 * 00031 * @(#)$Id: contiki-conf.h,v 1.10 2010/03/18 20:11:54 dak664 Exp $ 00032 */ 00033 00034 #ifndef __CONTIKI_CONF_H__ 00035 #define __CONTIKI_CONF_H__ 00036 00037 #include <inttypes.h> 00038 #include <limits.h> 00039 00040 #define CC_CONF_REGISTER_ARGS 1 00041 #define CC_CONF_FUNCTION_POINTER_ARGS 1 00042 #define CC_CONF_FASTCALL 00043 #define CC_CONF_VA_ARGS 1 00044 00045 #define CCIF 00046 #define CLIF 00047 00048 /* These names are deprecated, use C99 names. */ 00049 typedef uint8_t u8_t; 00050 typedef uint16_t u16_t; 00051 typedef uint32_t u32_t; 00052 typedef int32_t s32_t; 00053 00054 typedef unsigned short uip_stats_t; 00055 00056 00057 #if UIP_CONF_IPV6 00058 /* The Windows build uses wpcap to connect to a host interface. It finds the interface by scanning for 00059 * an address, which can be specified here and overridden with the command line. 00060 * An ip4 or ip6 address can be used; this allows turning off the ip4 protocol on the interface. 00061 * The existing turorials use an ipv4 address, so we leave that as the default. 00062 * Non-windows builds don't use this define. 00063 */ 00064 //#define WPCAP_INTERFACE_ADDRESS "fdfd::1" //10.10.10.10 is the default (even for ipv6) 00065 00066 /* Minimal-net gets a 6 byte ethernet MAC assigned in uip.c, currently {0x00,0x06,0x98,0x00,0x02,0x32} 00067 * This gets converted to a link layer address of [fe80::206:98ff:fe00:232] 00068 * You could change the uip.c address when running multiple instances, however HARD_CODED_ADDRESS 00069 * can also specify a different MAC address if any of the last three bytes are non-zero. It can also 00070 * specify a prefix if any of the first four longs are nonzero. RPL builds use this to pass a prefix 00071 * to the border router and also to ensure it has a different link-layer address from the RPL end node. 00072 * HARD_CODED_ADDRESS can also be changed in /platform/minimal-net/contiki-main.c so as not to force complete 00073 * rebuilds when making multiple instances of a minimal-net client. 00074 */ 00075 //#define HARD_CODED_ADDRESS "::10" //assign link-layer address fe80::ff:fe00:10, wait for RA or RPL prefix 00076 //#define HARD_CODED_ADDRESS "fdfd::" //assign prefix; address becomes fdfd::206:98ff:fe00:232 00077 //#define HARD_CODED_ADDRESS "fdfd::10" //assign prefix and ipv6 address fdfd::ff:fe00:10 00078 00079 /* The status.shtml page shows addresses, neighbors, and routes on ipv6 builds. Use this define to enable 00080 * the needed routines in httpd-cgi.c on the webserver6 build. The status page is present in 00081 * /apps/webserver/httpd-fs/ but not in the default /apps/webserver/httpd-fsdata.c file. 00082 * To include it run the PERL script /../../tools/makefsdata from the /apps/webserver/ directory. 00083 * NB: Webserver builds on all platforms will use the current httpd-fsdata.c file. The added 160 bytes 00084 * could overflow memory on the smaller platforms. 00085 */ 00086 #define WEBSERVER_CONF_STATUSPAGE 1 00087 00088 /* RPL currently works only on Windows. *nix would require converting the tun interface to two pcap tees. */ 00089 //#define UIP_CONF_IPV6_RPL 0 00090 //#define RPL_BORDER_ROUTER 0 00091 #endif 00092 00093 #if UIP_CONF_IPV6_RPL 00094 /* RPL motes use the uip.c link layer address or optionally the harded coded address (but without the prefix!) 00095 * Different instances can be made by changing the link layer portion of HARD_CODED_ADDRESS in contiki-main.c 00096 * Rename them to e.g. webserver6.10, webserver6.11, ... 00097 * They should all attach to a minimal-net rpl border that uses the same primary interface. 00098 * For multihop testing, configure intermediate notes as routers. 00099 */ 00100 #define HARD_CODED_ADDRESS "bbbb::10" //the prefix is ignored for a rpl node 00101 #define UIP_CONF_ROUTER 0 00102 #define UIP_CONF_ND6_SEND_RA 0 00103 #define UIP_CONF_ND6_REACHABLE_TIME 600000 00104 #define UIP_CONF_ND6_RETRANS_TIMER 10000 00105 00106 #if RPL_BORDER_ROUTER 00107 /* RPL border router accepts packets from the host through the fallback and directs them to 00108 * the primary interface. Thus the fallback and rpl dag prefix must be the same. The prefix of 00109 * the primary interface does not matter! 00110 * Rename this build to e.g. webrouter. Then on Windows create two loopback interfaces, bbbb:: and fdfd:: 00111 * Attach the RPL end nodes to fdfd:: and the webrouter to fdfd:: with bbbb:: as the fallback. 00112 * Direct browser to bbbb::ff:fe00:1/status.html, bbbb::ff:fe00:10/status.html, bbbb::ff:fe00:20/status.html. 00113 * The traffic will go through the bbbb:: interface to the router, then out the fdfd:: interface to the end 00114 * nodes. The end nodes must be explicitly added as neighbors to avoid a blocking NS 00115 * netsh interface ipv6 add neighbor bbbb::ff:fe00:10 33-33-ff-33-44-10 interface=16 (# of the bbbb interface) 00116 * netsh interface ipv6 add neighbor bbbb::ff:fe00:20 33-33-ff-33-44-20 interface=16 (# of the bbbb interface) 00117 * 00118 * Instead of using the fdfd:: loopback it is also possible to attach the border router to another interface, 00119 * e.g. the jackdaw RNDIS <-> repeater. Then RPL will configure on the radio network and the RF motes will 00120 * be reached through bbbb::<mote link layer address>. 00121 * Possibly minimal-net RPL motes could also be added to this interface? 00122 * 00123 */ 00124 #undef UIP_CONF_ROUTER 00125 #define UIP_CONF_ROUTER 1 00126 //#define RPL_CONF_STATS 0 00127 //#define UIP_CONF_BUFFER_SIZE 1300 00128 #undef UIP_FALLBACK_INTERFACE 00129 #define UIP_FALLBACK_INTERFACE rpl_interface 00130 //#define WPCAP_FALLBACK_ADDRESS "bbbb::1" //bbbb::1 is the default fallback prefix 00131 #undef HARD_CODED_ADDRESS 00132 #define HARD_CODED_ADDRESS "bbbb::1" //bbbb::ff:fe00:1 is the RPL border router default 00133 //#define UIP_CONF_ND6_SEND_RA 0 00134 //#define UIP_CONF_ND6_REACHABLE_TIME 600000 00135 //#define UIP_CONF_ND6_RETRANS_TIMER 10000 00136 #endif 00137 00138 #endif 00139 00140 #define UIP_CONF_MAX_LISTENPORTS 40 00141 #define UIP_CONF_MAX_CONNECTIONS 40 00142 #define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN 00143 #define UIP_CONF_TCP_SPLIT 0 00144 #define UIP_CONF_IP_FORWARD 0 00145 #define UIP_CONF_LOGGING 0 00146 #define UIP_CONF_UDP_CHECKSUMS 1 00147 00148 /* Not used but avoids compile errors while sicslowpan.c is being developed */ 00149 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06 00150 00151 #define UIP_CONF_UDP 1 00152 #define UIP_CONF_TCP 1 00153 00154 #if UIP_CONF_IPV6 00155 #define UIP_CONF_IPV6_QUEUE_PKT 1 00156 #define UIP_CONF_IPV6_CHECKS 1 00157 #define UIP_CONF_IPV6_REASSEMBLY 1 00158 //#define UIP_CONF_NETIF_MAX_ADDRESSES 5 00159 //#define UIP_CONF_ND6_MAX_PREFIXES 3 00160 //#define UIP_CONF_ND6_MAX_NEIGHBORS 40 00161 //#define UIP_CONF_ND6_MAX_DEFROUTERS 2 00162 #define UIP_CONF_DS6_NBR_NBU 100 00163 #define UIP_CONF_DS6_DEFRT_NBU 2 00164 #define UIP_CONF_DS6_PREFIX_NBU 5 00165 #define UIP_CONF_DS6_ROUTE_NBU 100 00166 #define UIP_CONF_DS6_ADDR_NBU 10 00167 #define UIP_CONF_DS6_MADDR_NBU 0 00168 #define UIP_CONF_DS6_AADDR_NBU 0 00169 #endif /* UIP_CONF_IPV6 */ 00170 00171 typedef unsigned long clock_time_t; 00172 #define CLOCK_CONF_SECOND 1000 00173 #define INFINITE_TIME ULONG_MAX 00174 00175 #define LOG_CONF_ENABLED 1 00176 00177 /* Not part of C99 but actually present */ 00178 int strcasecmp(const char*, const char*); 00179 00180 #endif /* __CONTIKI_CONF_H__ */