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_VA_ARGS 1
50 /*#define CC_CONF_INLINE inline*/
51 
52 #ifndef EEPROM_CONF_SIZE
53 #define EEPROM_CONF_SIZE 1024
54 #endif
55 
56 #define CCIF
57 #define CLIF
58 
59 /* These names are deprecated, use C99 names. */
60 typedef uint8_t u8_t;
61 typedef uint16_t u16_t;
62 typedef uint32_t u32_t;
63 typedef int32_t s32_t;
64 
65 typedef unsigned short uip_stats_t;
66 
67 #define UIP_CONF_UDP 1
68 #define UIP_CONF_MAX_CONNECTIONS 40
69 #define UIP_CONF_MAX_LISTENPORTS 40
70 #define UIP_CONF_BUFFER_SIZE 420
71 #define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN
72 #define UIP_CONF_TCP 1
73 #define UIP_CONF_TCP_SPLIT 0
74 #define UIP_CONF_LOGGING 0
75 #define UIP_CONF_UDP_CHECKSUMS 1
76 
77 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
78 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
79 #endif /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE */
80 
81 #if NETSTACK_CONF_WITH_IPV6
82 
83 #define LINKADDR_CONF_SIZE 8
84 
85 #ifndef NETSTACK_CONF_MAC
86 #define NETSTACK_CONF_MAC nullmac_driver
87 #endif /* NETSTACK_CONF_MAC */
88 
89 #ifndef NETSTACK_CONF_RDC
90 #define NETSTACK_CONF_RDC nullrdc_driver
91 #endif /* NETSTACK_CONF_RDC */
92 
93 #ifndef NETSTACK_CONF_RADIO
94 #define NETSTACK_CONF_RADIO nullradio_driver
95 #endif /* NETSTACK_CONF_RADIO */
96 
97 #ifndef NETSTACK_CONF_FRAMER
98 #define NETSTACK_CONF_FRAMER framer_802154
99 #endif /* NETSTACK_CONF_FRAMER */
100 
101 #define NETSTACK_CONF_NETWORK sicslowpan_driver
102 
103 #define NETSTACK_CONF_LINUXRADIO_DEV "wpan0"
104 
105 #define UIP_CONF_ROUTER 1
106 
107 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
108 #ifndef SICSLOWPAN_CONF_FRAG
109 #define SICSLOWPAN_CONF_FRAG 1
110 #define SICSLOWPAN_CONF_MAXAGE 8
111 #endif /* SICSLOWPAN_CONF_FRAG */
112 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
113 
114 #define UIP_CONF_IPV6_CHECKS 1
115 #define UIP_CONF_IPV6_QUEUE_PKT 1
116 #define UIP_CONF_IPV6_REASSEMBLY 0
117 #define UIP_CONF_NETIF_MAX_ADDRESSES 3
118 #define UIP_CONF_ICMP6 1
119 
120 /* configure number of neighbors and routes */
121 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
122 #define NBR_TABLE_CONF_MAX_NEIGHBORS 30
123 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
124 #ifndef UIP_CONF_MAX_ROUTES
125 #define UIP_CONF_MAX_ROUTES 30
126 #endif /* UIP_CONF_MAX_ROUTES */
127 
128 #define UIP_CONF_ND6_SEND_RA 0
129 #define UIP_CONF_ND6_REACHABLE_TIME 600000
130 #define UIP_CONF_ND6_RETRANS_TIMER 10000
131 
132 #define UIP_CONF_IP_FORWARD 0
133 #ifndef UIP_CONF_BUFFER_SIZE
134 #define UIP_CONF_BUFFER_SIZE 240
135 #endif
136 
137 
138 #define UIP_CONF_LLH_LEN 0
139 #define UIP_CONF_LL_802154 1
140 
141 #define UIP_CONF_ICMP_DEST_UNREACH 1
142 
143 #define UIP_CONF_DHCP_LIGHT
144 #define UIP_CONF_RECEIVE_WINDOW 48
145 #define UIP_CONF_TCP_MSS 48
146 #define UIP_CONF_UDP_CONNS 12
147 #define UIP_CONF_FWCACHE_SIZE 30
148 #define UIP_CONF_BROADCAST 1
149 #define UIP_ARCH_IPCHKSUM 1
150 #define UIP_CONF_UDP 1
151 #define UIP_CONF_UDP_CHECKSUMS 1
152 #define UIP_CONF_PINGADDRCONF 0
153 #define UIP_CONF_LOGGING 0
154 
155 
156 
157 #endif /* NETSTACK_CONF_WITH_IPV6 */
158 
159 #include <ctype.h>
160 #define ctk_arch_isprint isprint
161 
162 #include "ctk/ctk-curses.h"
163 
164 #define CH_ULCORNER -10
165 #define CH_URCORNER -11
166 #define CH_LLCORNER -12
167 #define CH_LRCORNER -13
168 #define CH_ENTER '\n'
169 #define CH_DEL '\b'
170 #define CH_CURS_UP -1
171 #define CH_CURS_LEFT -2
172 #define CH_CURS_RIGHT -3
173 #define CH_CURS_DOWN -4
174 
175 #define CTK_CONF_MENU_KEY -5 /* F10 */
176 #define CTK_CONF_WINDOWSWITCH_KEY -6 /* Ctrl-Tab */
177 #define CTK_CONF_WIDGETUP_KEY -7 /* Shift-Tab */
178 #define CTK_CONF_WIDGETDOWN_KEY '\t'
179 #define CTK_CONF_WIDGET_FLAGS 0
180 #define CTK_CONF_SCREENSAVER 1
181 
182 #ifdef PLATFORM_BUILD
183 #define CTK_CONF_MOUSE_SUPPORT 1
184 #define CTK_CONF_WINDOWS 1
185 #define CTK_CONF_WINDOWMOVE 1
186 #define CTK_CONF_WINDOWCLOSE 1
187 #define CTK_CONF_ICONS 1
188 #define CTK_CONF_ICON_BITMAPS 0
189 #define CTK_CONF_ICON_TEXTMAPS 1
190 #define CTK_CONF_MENUS 1
191 #define CTK_CONF_MENUWIDTH 16
192 #define CTK_CONF_MAXMENUITEMS 10
193 #else /* PLATFORM_BUILD */
194 #define CTK_CONF_MOUSE_SUPPORT 1
195 #define CTK_CONF_WINDOWS 0
196 #define CTK_CONF_WINDOWMOVE 0
197 #define CTK_CONF_WINDOWCLOSE 0
198 #define CTK_CONF_ICONS 0
199 #define CTK_CONF_MENUS 0
200 #endif /* PLATFORM_BUILD */
201 
202 /* CTK-specific color constants */
203 #define CTK_COLOR_BLACK 0
204 #define CTK_COLOR_RED 1
205 #define CTK_COLOR_GREEN 2
206 #define CTK_COLOR_YELLOW 3
207 #define CTK_COLOR_BLUE 4
208 #define CTK_COLOR_MAGENTA 5
209 #define CTK_COLOR_CYAN 6
210 #define CTK_COLOR_WHITE 7
211 
212 /* base background color for widgets */
213 #define COLOR_BG CTK_COLOR_BLUE
214 
215 #define BORDERCOLOR CTK_COLOR_BLACK
216 #define SCREENCOLOR CTK_COLOR_BLACK
217 #define BACKGROUNDCOLOR CTK_COLOR_BLACK
218 #define WINDOWCOLOR_FOCUS CTK_COLOR_WHITE | COLOR_BG * 0x10
219 #define WINDOWCOLOR CTK_COLOR_CYAN | COLOR_BG * 0x10
220 #define DIALOGCOLOR CTK_COLOR_WHITE | COLOR_BG * 0x10
221 #define WIDGETCOLOR_HLINK CTK_COLOR_CYAN | COLOR_BG * 0x10
222 #define WIDGETCOLOR_FWIN CTK_COLOR_WHITE | COLOR_BG * 0x10
223 #define WIDGETCOLOR CTK_COLOR_CYAN | COLOR_BG * 0x10
224 #define WIDGETCOLOR_DIALOG CTK_COLOR_WHITE | COLOR_BG * 0x10
225 #define WIDGETCOLOR_FOCUS CTK_COLOR_YELLOW | COLOR_BG * 0x10
226 #define MENUCOLOR CTK_COLOR_WHITE | COLOR_BG * 0x10
227 #define OPENMENUCOLOR CTK_COLOR_WHITE | COLOR_BG * 0x10
228 #define ACTIVEMENUITEMCOLOR CTK_COLOR_YELLOW | COLOR_BG * 0x10
229 
230 
231 typedef unsigned long clock_time_t;
232 
233 #define CLOCK_CONF_SECOND 1000
234 
235 #define LOG_CONF_ENABLED 1
236 
237 #define PROGRAM_HANDLER_CONF_MAX_NUMDSCS 10
238 #define PROGRAM_HANDLER_CONF_QUIT_MENU 1
239 
240 #define EMAIL_CONF_WIDTH 78
241 #define EMAIL_CONF_HEIGHT 17
242 #ifndef PLATFORM_BUILD
243 #define EMAIL_CONF_ERASE 0
244 #endif
245 
246 #define IRC_CONF_WIDTH 78
247 #define IRC_CONF_HEIGHT 17
248 #define IRC_CONF_SYSTEM_STRING "*nix"
249 
250 #define SHELL_CONF_WITH_PROGRAM_HANDLER 1
251 
252 #define SHELL_GUI_CONF_XSIZE 78
253 #define SHELL_GUI_CONF_YSIZE 17
254 
255 #ifdef PLATFORM_BUILD
256 #define TELNETD_CONF_GUI 1
257 #endif /* PLATFORM_BUILD */
258 
259 #ifdef PLATFORM_BUILD
260 #define WWW_CONF_WEBPAGE_WIDTH 78
261 #define WWW_CONF_WEBPAGE_HEIGHT 17
262 #endif /* PLATFORM_BUILD */
263 
264 /* Not part of C99 but actually present */
265 int strcasecmp(const char*, const char*);
266 
267 /* include the project config */
268 /* PROJECT_CONF_H might be defined in the project Makefile */
269 #ifdef PROJECT_CONF_H
270 #include PROJECT_CONF_H
271 #endif /* PROJECT_CONF_H */
272 
273 #endif /* CONTIKI_CONF_H_ */