These are the examples provided for [[/users/frank26080115/libraries/LPC1700CMSIS_Lib/]] Note, the entire "program" is not compilable!

Committer:
frank26080115
Date:
Sun Mar 20 05:38:56 2011 +0000
Revision:
0:bf7b9fba3924

        

Who changed what in which revision?

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