Contiki 3.x
contiki-conf.h
1 /*
2  * Copyright (c) 2005, Swedish Institute of Computer Science
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 Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * This file is part of the Contiki operating system.
30  *
31  */
32 
33 #ifndef CONTIKI_CONF_H_
34 #define CONTIKI_CONF_H_
35 
36 #include <inttypes.h>
37 #ifndef WIN32_LEAN_AND_MEAN
38 #include <sys/select.h>
39 #endif
40 
41 struct select_callback {
42  int (* set_fd)(fd_set *fdr, fd_set *fdw);
43  void (* handle_fd)(fd_set *fdr, fd_set *fdw);
44 };
45 int select_set_callback(int fd, const struct select_callback *callback);
46 
47 #define CC_CONF_REGISTER_ARGS 1
48 #define CC_CONF_FUNCTION_POINTER_ARGS 1
49 #define CC_CONF_FASTCALL
50 #define CC_CONF_VA_ARGS 1
51 /*#define CC_CONF_INLINE inline*/
52 
53 #ifndef EEPROM_CONF_SIZE
54 #define EEPROM_CONF_SIZE 1024
55 #endif
56 
57 #define CCIF
58 #define CLIF
59 
60 /* These names are deprecated, use C99 names. */
61 typedef uint8_t u8_t;
62 typedef uint16_t u16_t;
63 typedef uint32_t u32_t;
64 typedef int32_t s32_t;
65 
66 typedef unsigned short uip_stats_t;
67 
68 #define UIP_CONF_UDP 1
69 #define UIP_CONF_MAX_CONNECTIONS 40
70 #define UIP_CONF_MAX_LISTENPORTS 40
71 #define UIP_CONF_BUFFER_SIZE 420
72 #define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN
73 #define UIP_CONF_TCP 1
74 #define UIP_CONF_TCP_SPLIT 0
75 #define UIP_CONF_LOGGING 0
76 #define UIP_CONF_UDP_CHECKSUMS 1
77 
78 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
79 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
80 #endif /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE */
81 
82 #if UIP_CONF_IPV6
83 
84 #define LINKADDR_CONF_SIZE 8
85 
86 #ifndef NETSTACK_CONF_MAC
87 #define NETSTACK_CONF_MAC nullmac_driver
88 #endif /* NETSTACK_CONF_MAC */
89 
90 #ifndef NETSTACK_CONF_RDC
91 #define NETSTACK_CONF_RDC nullrdc_driver
92 #endif /* NETSTACK_CONF_RDC */
93 
94 #ifndef NETSTACK_CONF_RADIO
95 #define NETSTACK_CONF_RADIO nullradio_driver
96 #endif /* NETSTACK_CONF_RADIO */
97 
98 #ifndef NETSTACK_CONF_FRAMER
99 #define NETSTACK_CONF_FRAMER framer_802154
100 #endif /* NETSTACK_CONF_FRAMER */
101 
102 #define NETSTACK_CONF_NETWORK sicslowpan_driver
103 
104 #define UIP_CONF_ROUTER 1
105 #ifndef UIP_CONF_IPV6_RPL
106 #define UIP_CONF_IPV6_RPL 1
107 #endif /* UIP_CONF_IPV6_RPL */
108 
109 #define SICSLOWPAN_CONF_COMPRESSION_IPV6 0
110 #define SICSLOWPAN_CONF_COMPRESSION_HC1 1
111 #define SICSLOWPAN_CONF_COMPRESSION_HC01 2
112 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
113 #ifndef SICSLOWPAN_CONF_FRAG
114 #define SICSLOWPAN_CONF_FRAG 1
115 #define SICSLOWPAN_CONF_MAXAGE 8
116 #endif /* SICSLOWPAN_CONF_FRAG */
117 #define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
118 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
119 #ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
120 #define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 5
121 #endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
122 
123 #define UIP_CONF_IPV6_CHECKS 1
124 #define UIP_CONF_IPV6_QUEUE_PKT 1
125 #define UIP_CONF_IPV6_REASSEMBLY 0
126 #define UIP_CONF_NETIF_MAX_ADDRESSES 3
127 #define UIP_CONF_ND6_MAX_PREFIXES 3
128 #define UIP_CONF_ND6_MAX_DEFROUTERS 2
129 #define UIP_CONF_ICMP6 1
130 
131 /* configure number of neighbors and routes */
132 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
133 #define NBR_TABLE_CONF_MAX_NEIGHBORS 30
134 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
135 #ifndef UIP_CONF_MAX_ROUTES
136 #define UIP_CONF_MAX_ROUTES 30
137 #endif /* UIP_CONF_MAX_ROUTES */
138 
139 #define UIP_CONF_ND6_SEND_RA 0
140 #define UIP_CONF_ND6_REACHABLE_TIME 600000
141 #define UIP_CONF_ND6_RETRANS_TIMER 10000
142 
143 #define UIP_CONF_IP_FORWARD 0
144 #ifndef UIP_CONF_BUFFER_SIZE
145 #define UIP_CONF_BUFFER_SIZE 240
146 #endif
147 
148 
149 #define UIP_CONF_LLH_LEN 0
150 #define UIP_CONF_LL_802154 1
151 
152 #define UIP_CONF_ICMP_DEST_UNREACH 1
153 
154 #define UIP_CONF_DHCP_LIGHT
155 #define UIP_CONF_RECEIVE_WINDOW 48
156 #define UIP_CONF_TCP_MSS 48
157 #define UIP_CONF_UDP_CONNS 12
158 #define UIP_CONF_FWCACHE_SIZE 30
159 #define UIP_CONF_BROADCAST 1
160 #define UIP_ARCH_IPCHKSUM 1
161 #define UIP_CONF_UDP 1
162 #define UIP_CONF_UDP_CHECKSUMS 1
163 #define UIP_CONF_PINGADDRCONF 0
164 #define UIP_CONF_LOGGING 0
165 
166 
167 
168 #endif /* UIP_CONF_IPV6 */
169 
170 #include <ctype.h>
171 #define ctk_arch_isprint isprint
172 
173 #include "ctk/ctk-curses.h"
174 
175 #define CH_ULCORNER -10
176 #define CH_URCORNER -11
177 #define CH_LLCORNER -12
178 #define CH_LRCORNER -13
179 #define CH_ENTER '\n'
180 #define CH_DEL '\b'
181 #define CH_CURS_UP -1
182 #define CH_CURS_LEFT -2
183 #define CH_CURS_RIGHT -3
184 #define CH_CURS_DOWN -4
185 
186 #define CTK_CONF_MENU_KEY -5 /* F10 */
187 #define CTK_CONF_WINDOWSWITCH_KEY -6 /* Ctrl-Tab */
188 #define CTK_CONF_WIDGETUP_KEY -7 /* Shift-Tab */
189 #define CTK_CONF_WIDGETDOWN_KEY '\t'
190 #define CTK_CONF_WIDGET_FLAGS 0
191 #define CTK_CONF_SCREENSAVER 1
192 
193 #ifdef PLATFORM_BUILD
194 #define CTK_CONF_MOUSE_SUPPORT 1
195 #define CTK_CONF_WINDOWS 1
196 #define CTK_CONF_WINDOWMOVE 1
197 #define CTK_CONF_WINDOWCLOSE 1
198 #define CTK_CONF_ICONS 1
199 #define CTK_CONF_ICON_BITMAPS 0
200 #define CTK_CONF_ICON_TEXTMAPS 1
201 #define CTK_CONF_MENUS 1
202 #define CTK_CONF_MENUWIDTH 16
203 #define CTK_CONF_MAXMENUITEMS 10
204 #else /* PLATFORM_BUILD */
205 #define CTK_CONF_MOUSE_SUPPORT 1
206 #define CTK_CONF_WINDOWS 0
207 #define CTK_CONF_WINDOWMOVE 0
208 #define CTK_CONF_WINDOWCLOSE 0
209 #define CTK_CONF_ICONS 0
210 #define CTK_CONF_MENUS 0
211 #endif /* PLATFORM_BUILD */
212 
213 /* CTK-specific color constants */
214 #define CTK_COLOR_BLACK 0
215 #define CTK_COLOR_RED 1
216 #define CTK_COLOR_GREEN 2
217 #define CTK_COLOR_YELLOW 3
218 #define CTK_COLOR_BLUE 4
219 #define CTK_COLOR_MAGENTA 5
220 #define CTK_COLOR_CYAN 6
221 #define CTK_COLOR_WHITE 7
222 
223 /* base background color for widgets */
224 #define COLOR_BG CTK_COLOR_BLUE
225 
226 #define BORDERCOLOR CTK_COLOR_BLACK
227 #define SCREENCOLOR CTK_COLOR_BLACK
228 #define BACKGROUNDCOLOR CTK_COLOR_BLACK
229 #define WINDOWCOLOR_FOCUS CTK_COLOR_WHITE | COLOR_BG * 0x10
230 #define WINDOWCOLOR CTK_COLOR_CYAN | COLOR_BG * 0x10
231 #define DIALOGCOLOR CTK_COLOR_WHITE | COLOR_BG * 0x10
232 #define WIDGETCOLOR_HLINK CTK_COLOR_CYAN | COLOR_BG * 0x10
233 #define WIDGETCOLOR_FWIN CTK_COLOR_WHITE | COLOR_BG * 0x10
234 #define WIDGETCOLOR CTK_COLOR_CYAN | COLOR_BG * 0x10
235 #define WIDGETCOLOR_DIALOG CTK_COLOR_WHITE | COLOR_BG * 0x10
236 #define WIDGETCOLOR_FOCUS CTK_COLOR_YELLOW | COLOR_BG * 0x10
237 #define MENUCOLOR CTK_COLOR_WHITE | COLOR_BG * 0x10
238 #define OPENMENUCOLOR CTK_COLOR_WHITE | COLOR_BG * 0x10
239 #define ACTIVEMENUITEMCOLOR CTK_COLOR_YELLOW | COLOR_BG * 0x10
240 
241 
242 typedef unsigned long clock_time_t;
243 
244 #define CLOCK_CONF_SECOND 1000
245 
246 #define LOG_CONF_ENABLED 1
247 
248 #define PROGRAM_HANDLER_CONF_MAX_NUMDSCS 10
249 #define PROGRAM_HANDLER_CONF_QUIT_MENU 1
250 
251 #define EMAIL_CONF_WIDTH 78
252 #define EMAIL_CONF_HEIGHT 17
253 #ifndef PLATFORM_BUILD
254 #define EMAIL_CONF_ERASE 0
255 #endif
256 
257 #define IRC_CONF_WIDTH 78
258 #define IRC_CONF_HEIGHT 17
259 #define IRC_CONF_SYSTEM_STRING "*nix"
260 
261 #define SHELL_CONF_WITH_PROGRAM_HANDLER 1
262 
263 #define SHELL_GUI_CONF_XSIZE 78
264 #define SHELL_GUI_CONF_YSIZE 17
265 
266 #ifdef PLATFORM_BUILD
267 #define TELNETD_CONF_GUI 1
268 #endif /* PLATFORM_BUILD */
269 
270 #ifdef PLATFORM_BUILD
271 #define WWW_CONF_WEBPAGE_WIDTH 78
272 #define WWW_CONF_WEBPAGE_HEIGHT 17
273 #endif /* PLATFORM_BUILD */
274 
275 /* Not part of C99 but actually present */
276 int strcasecmp(const char*, const char*);
277 
278 /* include the project config */
279 /* PROJECT_CONF_H might be defined in the project Makefile */
280 #ifdef PROJECT_CONF_H
281 #include PROJECT_CONF_H
282 #endif /* PROJECT_CONF_H */
283 
284 #endif /* CONTIKI_CONF_H_ */