adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 1 | /** |
| 2 | * \defgroup uipopt Configuration options for uIP |
| 3 | * @{ |
| 4 | * |
| 5 | * uIP is configured using the per-project configuration file |
| 6 | * "uipopt.h". This file contains all compile-time options for uIP and |
| 7 | * should be tweaked to match each specific project. The uIP |
| 8 | * distribution contains a documented example "uipopt.h" that can be |
| 9 | * copied and modified for each project. |
| 10 | * |
| 11 | * \note Contiki does not use the uipopt.h file to configure uIP, but |
| 12 | * uses a per-port uip-conf.h file that should be edited instead. |
| 13 | */ |
| 14 | |
| 15 | /** |
| 16 | * \file |
| 17 | * Configuration options for uIP. |
| 18 | * \author Adam Dunkels <adam@dunkels.com> |
| 19 | * |
| 20 | * This file is used for tweaking various configuration options for |
| 21 | * uIP. You should make a copy of this file into one of your project's |
| 22 | * directories instead of editing this example "uipopt.h" file that |
| 23 | * comes with the uIP distribution. |
| 24 | */ |
| 25 | |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 26 | /* |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 27 | * Copyright (c) 2001-2003, Adam Dunkels. |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 28 | * All rights reserved. |
| 29 | * |
| 30 | * Redistribution and use in source and binary forms, with or without |
| 31 | * modification, are permitted provided that the following conditions |
| 32 | * are met: |
| 33 | * 1. Redistributions of source code must retain the above copyright |
| 34 | * notice, this list of conditions and the following disclaimer. |
| 35 | * 2. Redistributions in binary form must reproduce the above copyright |
| 36 | * notice, this list of conditions and the following disclaimer in the |
| 37 | * documentation and/or other materials provided with the distribution. |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 38 | * 3. The name of the author may not be used to endorse or promote |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 39 | * products derived from this software without specific prior |
| 40 | * written permission. |
| 41 | * |
| 42 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS |
| 43 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 44 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 45 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| 46 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 47 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 48 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 49 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 50 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 51 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 52 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 53 | * |
| 54 | * This file is part of the uIP TCP/IP stack. |
| 55 | * |
adamdunkels | 4735e72 | 2003-11-27 15:50:54 +0000 | [diff] [blame^] | 56 | * $Id: uipopt.h,v 1.8 2003/11/27 15:50:54 adamdunkels Exp $ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 57 | * |
| 58 | */ |
| 59 | |
| 60 | #ifndef __UIPOPT_H__ |
| 61 | #define __UIPOPT_H__ |
| 62 | |
adamdunkels | 43748a1 | 2003-06-30 20:38:05 +0000 | [diff] [blame] | 63 | #ifndef LITTLE_ENDIAN |
| 64 | #define LITTLE_ENDIAN 3412 |
| 65 | #endif /* LITTLE_ENDIAN */ |
| 66 | #ifndef BIG_ENDIAN |
| 67 | #define BIG_ENDIAN 1234 |
| 68 | #endif /* BIGE_ENDIAN */ |
| 69 | |
| 70 | #include "uip-conf.h" |
| 71 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 72 | /*------------------------------------------------------------------------------*/ |
| 73 | /** |
| 74 | * \defgroup uipopttypedef uIP type definitions |
| 75 | * @{ |
| 76 | */ |
| 77 | |
| 78 | /** |
| 79 | * The 8-bit unsigned data type. |
| 80 | * |
| 81 | * This may have to be tweaked for your particular compiler. "unsigned |
| 82 | * char" works for most compilers. |
| 83 | */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 84 | typedef unsigned char u8_t; |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * The 16-bit unsigned data type. |
| 88 | * |
| 89 | * This may have to be tweaked for your particular compiler. "unsigned |
| 90 | * short" works for most compilers. |
| 91 | */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 92 | typedef unsigned short u16_t; |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 93 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 94 | /** |
| 95 | * The statistics data type. |
| 96 | * |
| 97 | * This datatype determines how high the statistics counters are able |
| 98 | * to count. |
| 99 | */ |
| 100 | typedef unsigned short uip_stats_t; |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 101 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 102 | /** @} */ |
| 103 | |
| 104 | #include "dispatcher.h" |
| 105 | |
| 106 | /*------------------------------------------------------------------------------*/ |
| 107 | |
| 108 | /** |
| 109 | * \defgroup uipoptstaticconf Static configuration options |
| 110 | * @{ |
| 111 | * |
| 112 | * These configuration options can be used for setting the IP address |
| 113 | * settings statically, but only if UIP_FIXEDADDR is set to 1. The |
| 114 | * configuration options for a specific node includes IP address, |
| 115 | * netmask and default router as well as the Ethernet address. The |
| 116 | * netmask, default router and Ethernet address are appliciable only |
| 117 | * if uIP should be run over Ethernet. |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 118 | * |
| 119 | * All of these should be changed to suit your project. |
| 120 | */ |
adamdunkels | 033e51d | 2003-10-01 11:33:43 +0000 | [diff] [blame] | 121 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 122 | /** |
| 123 | * Determines if uIP should use a fixed IP address or not. |
| 124 | * |
| 125 | * If uIP should use a fixed IP address, the settings are set in the |
| 126 | * uipopt.h file. If not, the macros uip_sethostaddr(), |
| 127 | * uip_setdraddr() and uip_setnetmask() should be used instead. |
| 128 | * |
| 129 | * \hideinitializer |
| 130 | */ |
| 131 | #define UIP_FIXEDADDR 0 |
| 132 | |
| 133 | /** |
| 134 | * Ping IP address asignment. |
| 135 | * |
| 136 | * uIP uses a "ping" packets for setting its own IP address if this |
| 137 | * option is set. If so, uIP will start with an empty IP address and |
| 138 | * the destination IP address of the first incoming "ping" (ICMP echo) |
| 139 | * packet will be used for setting the hosts IP address. |
| 140 | * |
| 141 | * \note This works only if UIP_FIXEDADDR is 0. |
| 142 | * |
| 143 | * \hideinitializer |
| 144 | */ |
adamdunkels | 033e51d | 2003-10-01 11:33:43 +0000 | [diff] [blame] | 145 | #ifdef UIP_CONF_PINGADDRCONF |
| 146 | #define UIP_PINGADDRCONF UIP_CONF_PINGADDRCONF |
| 147 | #else /* UIP_CONF_PINGADDRCONF */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 148 | #define UIP_PINGADDRCONF 0 |
adamdunkels | 033e51d | 2003-10-01 11:33:43 +0000 | [diff] [blame] | 149 | #endif /* UIP_CONF_PINGADDRCONF */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 150 | |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 151 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 152 | /** |
| 153 | * Specifies if the uIP ARP module should be compiled with a fixed |
| 154 | * Ethernet MAC address or not. |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 155 | * |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 156 | * If this configuration option is 0, the macro uip_setethaddr() can |
| 157 | * be used to specify the Ethernet address at run-time. |
| 158 | * |
| 159 | * \hideinitializer |
| 160 | */ |
| 161 | #define UIP_FIXEDETHADDR 0 |
| 162 | |
| 163 | /** @} */ |
| 164 | /*------------------------------------------------------------------------------*/ |
| 165 | /** |
| 166 | * \defgroup uipoptip IP configuration options |
| 167 | * @{ |
| 168 | * |
| 169 | */ |
| 170 | /** |
| 171 | * The IP TTL (time to live) of IP packets sent by uIP. |
| 172 | * |
| 173 | * This should normally not be changed. |
| 174 | */ |
| 175 | #define UIP_TTL 255 |
| 176 | |
| 177 | /** |
| 178 | * Turn on support for IP packet reassembly. |
| 179 | * |
| 180 | * uIP supports reassembly of fragmented IP packets. This features |
| 181 | * requires an additonal amount of RAM to hold the reassembly buffer |
| 182 | * and the reassembly code size is approximately 700 bytes. The |
| 183 | * reassembly buffer is of the same size as the uip_buf buffer |
| 184 | * (configured by UIP_BUFSIZE). |
| 185 | * |
| 186 | * \note IP packet reassembly is not heavily tested. |
| 187 | * |
| 188 | * \hideinitializer |
| 189 | */ |
| 190 | #define UIP_REASSEMBLY 0 |
| 191 | |
| 192 | /** |
| 193 | * The maximum time an IP fragment should wait in the reassembly |
| 194 | * buffer before it is dropped. |
| 195 | * |
| 196 | */ |
| 197 | #define UIP_REASS_MAXAGE 40 |
| 198 | |
| 199 | /** @} */ |
| 200 | |
| 201 | /*------------------------------------------------------------------------------*/ |
| 202 | /** |
| 203 | * \defgroup uipoptudp UDP configuration options |
| 204 | * @{ |
| 205 | * |
| 206 | * \note The UDP support in uIP is still not entirely complete; there |
| 207 | * is no support for sending or receiving broadcast or multicast |
| 208 | * packets, but it works well enough to support a number of vital |
| 209 | * applications such as DNS queries, though |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 210 | */ |
| 211 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 212 | /** |
| 213 | * Toggles wether UDP support should be compiled in or not. |
| 214 | * |
| 215 | * \hideinitializer |
| 216 | */ |
| 217 | #ifdef UIP_CONF_UDP |
| 218 | #define UIP_UDP UIP_CONF_UDP |
| 219 | #else /* UIP_CONF_UDP */ |
| 220 | #define UIP_UDP 1 |
| 221 | #endif /* UIP_CONF_UDP */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 222 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 223 | /** |
| 224 | * Toggles if UDP checksums should be used or not. |
| 225 | * |
| 226 | * \note Support for UDP checksums is currently not included in uIP, |
| 227 | * so this option has no function. |
| 228 | * |
| 229 | * \hideinitializer |
| 230 | */ |
| 231 | #define UIP_UDP_CHECKSUMS 0 |
| 232 | |
| 233 | /** |
| 234 | * The maximum amount of concurrent UDP connections. |
| 235 | * |
| 236 | * \hideinitializer |
| 237 | */ |
| 238 | #define UIP_UDP_CONNS 10 |
| 239 | |
| 240 | /** |
| 241 | * The name of the function that should be called when UDP datagrams arrive. |
| 242 | * |
| 243 | * \hideinitializer |
| 244 | */ |
adamdunkels | 4735e72 | 2003-11-27 15:50:54 +0000 | [diff] [blame^] | 245 | #define UIP_UDP_APPCALL dispatcher_uipcall |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 246 | |
| 247 | /** @} */ |
| 248 | /*------------------------------------------------------------------------------*/ |
| 249 | /** |
| 250 | * \defgroup uipopttcp TCP configuration options |
| 251 | * @{ |
| 252 | */ |
| 253 | |
| 254 | /** |
| 255 | * Determines if support for opening connections from uIP should be |
| 256 | * compiled in. |
| 257 | * |
| 258 | * If the applications that are running on top of uIP for this project |
| 259 | * do not need to open outgoing TCP connections, this configration |
| 260 | * option can be turned off to reduce the code size of uIP. |
| 261 | * |
| 262 | * \hideinitializer |
| 263 | */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 264 | #define UIP_ACTIVE_OPEN 1 |
| 265 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 266 | /** |
| 267 | * The maximum number of simultaneously open TCP connections. |
| 268 | * |
| 269 | * Since the TCP connections are statically allocated, turning this |
| 270 | * configuration knob down results in less RAM used. Each TCP |
| 271 | * connection requires approximatly 30 bytes of memory. |
| 272 | * |
| 273 | * \hideinitializer |
| 274 | */ |
adamdunkels | 43748a1 | 2003-06-30 20:38:05 +0000 | [diff] [blame] | 275 | #ifndef UIP_CONF_MAX_CONNECTIONS |
| 276 | #define UIP_CONNS 10 |
| 277 | #else /* UIP_CONF_MAX_CONNECTIONS */ |
| 278 | #define UIP_CONNS UIP_CONF_MAX_CONNECTIONS |
| 279 | #endif /* UIP_CONF_MAX_CONNECTIONS */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 280 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 281 | |
| 282 | /** |
| 283 | * The maximum number of simultaneously listening TCP ports. |
| 284 | * |
| 285 | * Each listening TCP port requires 2 bytes of memory. |
| 286 | * |
| 287 | * \hideinitializer |
| 288 | */ |
adamdunkels | 43748a1 | 2003-06-30 20:38:05 +0000 | [diff] [blame] | 289 | #ifndef UIP_CONF_MAX_LISTENPORTS |
| 290 | #define UIP_LISTENPORTS 20 |
| 291 | #else /* UIP_CONF_MAX_LISTENPORTS */ |
| 292 | #define UIP_LISTENPORTS UIP_CONF_MAX_LISTENPORTS |
| 293 | #endif /* UIP_CONF_MAX_LISTENPORTS */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 294 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 295 | /** |
| 296 | * The size of the advertised receiver's window. |
| 297 | * |
| 298 | * Should be set low (i.e., to the size of the uip_buf buffer) is the |
| 299 | * application is slow to process incoming data, or high (32768 bytes) |
| 300 | * if the application processes data quickly. |
| 301 | * |
| 302 | * \hideinitializer |
| 303 | */ |
adamdunkels | 4735e72 | 2003-11-27 15:50:54 +0000 | [diff] [blame^] | 304 | #ifndef UIP_CONF_RECEIVE_WINDOW |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 305 | #define UIP_RECEIVE_WINDOW 32768 |
adamdunkels | 4735e72 | 2003-11-27 15:50:54 +0000 | [diff] [blame^] | 306 | #else |
| 307 | #define UIP_RECEIVE_WINDOW UIP_CONF_RECEIVE_WINDOW |
| 308 | #endif |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 309 | |
| 310 | /** |
| 311 | * Determines if support for TCP urgent data notification should be |
| 312 | * compiled in. |
| 313 | * |
| 314 | * Urgent data (out-of-band data) is a rarely used TCP feature that |
| 315 | * very seldom would be required. |
| 316 | * |
| 317 | * \hideinitializer |
| 318 | */ |
| 319 | #define UIP_URGDATA 1 |
| 320 | |
| 321 | /** |
| 322 | * The initial retransmission timeout counted in timer pulses. |
| 323 | * |
| 324 | * This should not be changed. |
| 325 | */ |
| 326 | #define UIP_RTO 3 |
| 327 | |
| 328 | /** |
| 329 | * The maximum number of times a segment should be retransmitted |
| 330 | * before the connection should be aborted. |
| 331 | * |
| 332 | * This should not be changed. |
| 333 | */ |
| 334 | #define UIP_MAXRTX 8 |
| 335 | |
| 336 | /** |
| 337 | * The maximum number of times a SYN segment should be retransmitted |
| 338 | * before a connection request should be deemed to have been |
| 339 | * unsuccessful. |
| 340 | * |
| 341 | * This should not need to be changed. |
| 342 | */ |
adamdunkels | 4735e72 | 2003-11-27 15:50:54 +0000 | [diff] [blame^] | 343 | #define UIP_MAXSYNRTX 5 |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 344 | |
| 345 | /** |
| 346 | * The TCP maximum segment size. |
| 347 | * |
| 348 | * This is should not be to set to more than UIP_BUFSIZE - UIP_LLH_LEN - 40. |
| 349 | */ |
| 350 | #define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - 40) |
| 351 | |
| 352 | /** |
| 353 | * How long a connection should stay in the TIME_WAIT state. |
| 354 | * |
| 355 | * This configiration option has no real implication, and it should be |
| 356 | * left untouched. |
| 357 | */ |
| 358 | #define UIP_TIME_WAIT_TIMEOUT 120 |
| 359 | |
| 360 | |
| 361 | /** @} */ |
| 362 | /*------------------------------------------------------------------------------*/ |
| 363 | /** |
| 364 | * \defgroup uipoptarp ARP configuration options |
| 365 | * @{ |
| 366 | */ |
| 367 | |
| 368 | /** |
| 369 | * The size of the ARP table. |
| 370 | * |
| 371 | * This option should be set to a larger value if this uIP node will |
| 372 | * have many connections from the local network. |
| 373 | * |
| 374 | * \hideinitializer |
| 375 | */ |
| 376 | #define UIP_ARPTAB_SIZE 8 |
| 377 | |
| 378 | /** |
| 379 | * The maxium age of ARP table entries measured in 10ths of seconds. |
| 380 | * |
| 381 | * An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD |
| 382 | * default). |
| 383 | */ |
| 384 | #define UIP_ARP_MAXAGE 120 |
| 385 | |
| 386 | /** @} */ |
| 387 | |
| 388 | /*------------------------------------------------------------------------------*/ |
| 389 | |
| 390 | /** |
| 391 | * \defgroup uipoptgeneral General configuration options |
| 392 | * @{ |
| 393 | */ |
| 394 | |
| 395 | /** |
| 396 | * The size of the uIP packet buffer. |
| 397 | * |
| 398 | * The uIP packet buffer should not be smaller than 60 bytes, and does |
| 399 | * not need to be larger than 1500 bytes. Lower size results in lower |
| 400 | * TCP throughput, larger size results in higher TCP throughput. |
| 401 | * |
| 402 | * \hideinitializer |
| 403 | */ |
adamdunkels | 43748a1 | 2003-06-30 20:38:05 +0000 | [diff] [blame] | 404 | #ifndef UIP_CONF_BUFFER_SIZE |
| 405 | #define UIP_BUFSIZE 400 |
| 406 | #else /* UIP_CONF_BUFFER_SIZE */ |
| 407 | #define UIP_BUFSIZE UIP_CONF_BUFFER_SIZE |
| 408 | #endif /* UIP_CONF_BUFFER_SIZE */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 409 | |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 410 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 411 | /** |
| 412 | * Determines if statistics support should be compiled in. |
| 413 | * |
| 414 | * The statistics is useful for debugging and to show the user. |
| 415 | * |
| 416 | * \hideinitializer |
| 417 | */ |
| 418 | #define UIP_STATISTICS 1 |
| 419 | |
| 420 | /** |
| 421 | * Determines if logging of certain events should be compiled in. |
| 422 | * |
| 423 | * This is useful mostly for debugging. The function uip_log() |
| 424 | * must be implemented to suit the architecture of the project, if |
| 425 | * logging is turned on. |
| 426 | * |
| 427 | * \hideinitializer |
| 428 | */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 429 | #define UIP_LOGGING 0 |
| 430 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 431 | /** |
| 432 | * Print out a uIP log message. |
| 433 | * |
| 434 | * This function must be implemented by the module that uses uIP, and |
| 435 | * is called by uIP whenever a log message is generated. |
| 436 | */ |
| 437 | void uip_log(char *msg); |
| 438 | |
| 439 | /** |
| 440 | * The link level header length. |
| 441 | * |
| 442 | * This is the offset into the uip_buf where the IP header can be |
| 443 | * found. For Ethernet, this should be set to 14. For SLIP, this |
| 444 | * should be set to 0. |
| 445 | * |
| 446 | * \hideinitializer |
| 447 | */ |
adamdunkels | 4735e72 | 2003-11-27 15:50:54 +0000 | [diff] [blame^] | 448 | #ifdef UIP_CONF_LLH_LEN |
| 449 | #define UIP_LLH_LEN UIP_CONF_LLH_LEN |
| 450 | #else /* UIP_CONF_LLH_LEN */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 451 | #define UIP_LLH_LEN 14 |
adamdunkels | 4735e72 | 2003-11-27 15:50:54 +0000 | [diff] [blame^] | 452 | #endif /* UIP_CONF_LLH_LEN */ |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 453 | |
| 454 | /** @} */ |
| 455 | /*------------------------------------------------------------------------------*/ |
| 456 | /** |
| 457 | * \defgroup uipoptcpu CPU architecture configuration |
| 458 | * @{ |
| 459 | * |
| 460 | * The CPU architecture configuration is where the endianess of the |
| 461 | * CPU on which uIP is to be run is specified. Most CPUs today are |
| 462 | * little endian, and the most notable exception are the Motorolas |
| 463 | * which are big endian. The BYTE_ORDER macro should be changed to |
| 464 | * reflect the CPU architecture on which uIP is to be run. |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 465 | */ |
| 466 | |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 467 | /** |
| 468 | * The byte order of the CPU architecture on which uIP is to be run. |
| 469 | * |
| 470 | * This option can be either BIG_ENDIAN (Motorola byte order) or |
| 471 | * LITTLE_ENDIAN (Intel byte order). |
| 472 | * |
| 473 | * \hideinitializer |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 474 | */ |
adamdunkels | 43748a1 | 2003-06-30 20:38:05 +0000 | [diff] [blame] | 475 | #ifdef UIP_CONF_BYTE_ORDER |
| 476 | #define BYTE_ORDER UIP_CONF_BYTE_ORDER |
| 477 | #else /* UIP_CONF_BYTE_ORDER */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 478 | #define BYTE_ORDER LITTLE_ENDIAN |
adamdunkels | 43748a1 | 2003-06-30 20:38:05 +0000 | [diff] [blame] | 479 | #endif /* UIP_CONF_BYTE_ORDER */ |
adamdunkels | b489e7a | 2003-10-14 11:12:50 +0000 | [diff] [blame] | 480 | |
| 481 | |
| 482 | /** @} */ |
| 483 | /*------------------------------------------------------------------------------*/ |
| 484 | |
| 485 | /** |
| 486 | * \defgroup uipoptapp Appication specific configurations |
| 487 | * @{ |
| 488 | * |
| 489 | * An uIP application is implemented using a single application |
| 490 | * function that is called by uIP whenever a TCP/IP event occurs. The |
| 491 | * name of this function must be registered with uIP at compile time |
| 492 | * using the UIP_APPCALL definition. |
| 493 | * |
| 494 | * uIP applications can store the application state within the |
| 495 | * uip_conn structure by specifying the size of the application |
| 496 | * structure with the UIP_APPSTATE_SIZE macro. |
| 497 | * |
| 498 | * The file containing the definitions must be included in the |
| 499 | * uipopt.h file. |
| 500 | * |
| 501 | * The following example illustrates how this can look. |
| 502 | \code |
| 503 | |
| 504 | void httpd_appcall(void); |
| 505 | #define UIP_APPCALL httpd_appcall |
| 506 | |
| 507 | struct httpd_state { |
| 508 | u8_t state; |
| 509 | u16_t count; |
| 510 | char *dataptr; |
| 511 | char *script; |
| 512 | }; |
| 513 | #define UIP_APPSTATE_SIZE (sizeof(struct httpd_state)) |
| 514 | \endcode |
| 515 | */ |
| 516 | |
| 517 | /** |
| 518 | * \var #define UIP_APPCALL |
| 519 | * |
| 520 | * The name of the application function that uIP should call in |
| 521 | * response to TCP/IP events. |
| 522 | * |
| 523 | */ |
| 524 | |
| 525 | /** |
| 526 | * \var #define UIP_APPSTATE_SIZE |
| 527 | * |
| 528 | * The size of the application state that is to be stored in the |
| 529 | * uip_conn structure. |
| 530 | */ |
| 531 | /** @} */ |
| 532 | |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 533 | |
| 534 | #endif /* __UIPOPT_H__ */ |