annotate network/uipopt.h @ 107:56d09a0969b5 avr-http

Import uIP and the PPP implementation from https://code.google.com/p/avrusbmodem/
author Matt Johnston <matt@ucc.asn.au>
date Fri, 07 Sep 2012 23:53:53 +0800
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
107
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2 * \addtogroup uip
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7 * \defgroup uipopt Configuration options for uIP
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 * uIP is configured using the per-project configuration file
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 * "uipopt.h". This file contains all compile-time options for uIP and
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 * should be tweaked to match each specific project. The uIP
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 * distribution contains a documented example "uipopt.h" that can be
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 * copied and modified for each project.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
15 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 * \note Contiki does not use the uipopt.h file to configure uIP, but
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
17 * uses a per-port uip-conf.h file that should be edited instead.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
18 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
19
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
20 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
21 * \file
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
22 * Configuration options for uIP.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
23 * \author Adam Dunkels <[email protected]>
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
24 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
25 * This file is used for tweaking various configuration options for
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
26 * uIP. You should make a copy of this file into one of your project's
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
27 * directories instead of editing this example "uipopt.h" file that
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
28 * comes with the uIP distribution.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
29 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
30
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
31 /*
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
32 * Copyright (c) 2001-2003, Adam Dunkels.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
33 * All rights reserved.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
34 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
35 * Redistribution and use in source and binary forms, with or without
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
36 * modification, are permitted provided that the following conditions
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
37 * are met:
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
38 * 1. Redistributions of source code must retain the above copyright
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
39 * notice, this list of conditions and the following disclaimer.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
40 * 2. Redistributions in binary form must reproduce the above copyright
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
41 * notice, this list of conditions and the following disclaimer in the
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
42 * documentation and/or other materials provided with the distribution.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
43 * 3. The name of the author may not be used to endorse or promote
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
44 * products derived from this software without specific prior
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
45 * written permission.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
46 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
47 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
48 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
49 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
50 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
51 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
52 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
53 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
54 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
55 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
56 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
57 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
58 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
59 * This file is part of the uIP TCP/IP stack.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
60 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
61 * $Id: uipopt.h,v 1.14 2010/12/24 00:39:04 dak664 Exp $
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
62 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
63 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
64
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
65 #ifndef __UIPOPT_H__
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
66 #define __UIPOPT_H__
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
67
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
68 #ifndef UIP_LITTLE_ENDIAN
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
69 #define UIP_LITTLE_ENDIAN 3412
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
70 #endif /* UIP_LITTLE_ENDIAN */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
71 #ifndef UIP_BIG_ENDIAN
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
72 #define UIP_BIG_ENDIAN 1234
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
73 #endif /* UIP_BIG_ENDIAN */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
74
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
75 //#include "contiki-conf.h"
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
76
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
77 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
78
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
79 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
80 * \defgroup uipoptstaticconf Static configuration options
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
81 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
82 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
83 * These configuration options can be used for setting the IP address
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
84 * settings statically, but only if UIP_FIXEDADDR is set to 1. The
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
85 * configuration options for a specific node includes IP address,
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
86 * netmask and default router as well as the Ethernet address. The
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
87 * netmask, default router and Ethernet address are applicable only
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
88 * if uIP should be run over Ethernet.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
89 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
90 * This options are meaningful only for the IPv4 code.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
91 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
92 * All of these should be changed to suit your project.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
93 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
94
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
95 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
96 * Determines if uIP should use a fixed IP address or not.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
97 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
98 * If uIP should use a fixed IP address, the settings are set in the
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
99 * uipopt.h file. If not, the macros uip_sethostaddr(),
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
100 * uip_setdraddr() and uip_setnetmask() should be used instead.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
101 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
102 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
103 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
104 #define UIP_FIXEDADDR 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
105
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
106 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
107 * Ping IP address assignment.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
108 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
109 * uIP uses a "ping" packets for setting its own IP address if this
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
110 * option is set. If so, uIP will start with an empty IP address and
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
111 * the destination IP address of the first incoming "ping" (ICMP echo)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
112 * packet will be used for setting the hosts IP address.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
113 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
114 * \note This works only if UIP_FIXEDADDR is 0.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
115 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
116 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
117 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
118 #ifdef UIP_CONF_PINGADDRCONF
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
119 #define UIP_PINGADDRCONF (UIP_CONF_PINGADDRCONF)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
120 #else /* UIP_CONF_PINGADDRCONF */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
121 #define UIP_PINGADDRCONF 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
122 #endif /* UIP_CONF_PINGADDRCONF */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
123
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
124
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
125 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
126 * Specifies if the uIP ARP module should be compiled with a fixed
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
127 * Ethernet MAC address or not.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
128 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
129 * If this configuration option is 0, the macro uip_setethaddr() can
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
130 * be used to specify the Ethernet address at run-time.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
131 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
132 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
133 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
134 #define UIP_FIXEDETHADDR 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
135
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
136 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
137 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
138 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
139 * \defgroup uipoptip IP configuration options
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
140 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
141 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
142 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
143 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
144 * The IP TTL (time to live) of IP packets sent by uIP.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
145 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
146 * This should normally not be changed.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
147 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
148 #define UIP_TTL 64
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
149
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
150 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
151 * The maximum time an IP fragment should wait in the reassembly
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
152 * buffer before it is dropped.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
153 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
154 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
155 #define UIP_REASS_MAXAGE 60 /*60s*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
156
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
157 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
158 * Turn on support for IP packet reassembly.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
159 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
160 * uIP supports reassembly of fragmented IP packets. This features
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
161 * requires an additional amount of RAM to hold the reassembly buffer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
162 * and the reassembly code size is approximately 700 bytes. The
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
163 * reassembly buffer is of the same size as the uip_buf buffer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
164 * (configured by UIP_BUFSIZE).
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
165 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
166 * \note IP packet reassembly is not heavily tested.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
167 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
168 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
169 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
170 #ifdef UIP_CONF_REASSEMBLY
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
171 #define UIP_REASSEMBLY (UIP_CONF_REASSEMBLY)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
172 #else /* UIP_CONF_REASSEMBLY */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
173 #define UIP_REASSEMBLY 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
174 #endif /* UIP_CONF_REASSEMBLY */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
175 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
176
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
177 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
178 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
179 * \defgroup uipoptipv6 IPv6 configuration options
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
180 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
181 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
182 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
183
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
184 /** The maximum transmission unit at the IP Layer*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
185 #define UIP_LINK_MTU 1280
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
186
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
187 #ifndef UIP_CONF_IPV6
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
188 /** Do we use IPv6 or not (default: no) */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
189 #define UIP_CONF_IPV6 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
190 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
191
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
192 #ifndef UIP_CONF_IPV6_QUEUE_PKT
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
193 /** Do we do per %neighbor queuing during address resolution (default: no) */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
194 #define UIP_CONF_IPV6_QUEUE_PKT 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
195 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
196
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
197 #ifndef UIP_CONF_IPV6_CHECKS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
198 /** Do we do IPv6 consistency checks (highly recommended, default: yes) */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
199 #define UIP_CONF_IPV6_CHECKS 1
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
200 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
201
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
202 #ifndef UIP_CONF_IPV6_REASSEMBLY
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
203 /** Do we do IPv6 fragmentation (default: no) */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
204 #define UIP_CONF_IPV6_REASSEMBLY 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
205 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
206
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
207 #ifndef UIP_CONF_NETIF_MAX_ADDRESSES
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
208 /** Default number of IPv6 addresses associated to the node's interface */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
209 #define UIP_CONF_NETIF_MAX_ADDRESSES 3
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
210 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
211
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
212 #ifndef UIP_CONF_ND6_MAX_PREFIXES
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
213 /** Default number of IPv6 prefixes associated to the node's interface */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
214 #define UIP_CONF_ND6_MAX_PREFIXES 3
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
215 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
216
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
217 #ifndef UIP_CONF_ND6_MAX_NEIGHBORS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
218 /** Default number of neighbors that can be stored in the %neighbor cache */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
219 #define UIP_CONF_ND6_MAX_NEIGHBORS 4
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
220 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
221
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
222 #ifndef UIP_CONF_ND6_MAX_DEFROUTERS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
223 /** Minimum number of default routers */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
224 #define UIP_CONF_ND6_MAX_DEFROUTERS 2
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
225 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
226 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
227
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
228 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
229 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
230 * \defgroup uipoptudp UDP configuration options
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
231 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
232 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
233 * \note The UDP support in uIP is still not entirely complete; there
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
234 * is no support for sending or receiving broadcast or multicast
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
235 * packets, but it works well enough to support a number of vital
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
236 * applications such as DNS queries, though
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
237 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
238
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
239 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
240 * Toggles whether UDP support should be compiled in or not.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
241 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
242 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
243 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
244 #ifdef UIP_CONF_UDP
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
245 #define UIP_UDP UIP_CONF_UDP
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
246 #else /* UIP_CONF_UDP */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
247 #define UIP_UDP 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
248 #endif /* UIP_CONF_UDP */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
249
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
250 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
251 * Toggles if UDP checksums should be used or not.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
252 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
253 * \note Support for UDP checksums is currently not included in uIP,
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
254 * so this option has no function.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
255 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
256 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
257 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
258 #ifdef UIP_CONF_UDP_CHECKSUMS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
259 #define UIP_UDP_CHECKSUMS (UIP_CONF_UDP_CHECKSUMS)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
260 #else
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
261 #define UIP_UDP_CHECKSUMS (UIP_CONF_IPV6)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
262 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
263
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
264 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
265 * The maximum amount of concurrent UDP connections.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
266 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
267 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
268 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
269 #ifdef UIP_CONF_UDP_CONNS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
270 #define UIP_UDP_CONNS (UIP_CONF_UDP_CONNS)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
271 #else /* UIP_CONF_UDP_CONNS */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
272 #define UIP_UDP_CONNS 5
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
273 #endif /* UIP_CONF_UDP_CONNS */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
274
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
275 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
276 * The name of the function that should be called when UDP datagrams arrive.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
277 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
278 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
279 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
280
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
281
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
282 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
283 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
284 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
285 * \defgroup uipopttcp TCP configuration options
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
286 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
287 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
288
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
289 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
290 * Toggles whether UDP support should be compiled in or not.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
291 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
292 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
293 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
294 #ifdef UIP_CONF_TCP
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
295 #define UIP_TCP (UIP_CONF_TCP)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
296 #else /* UIP_CONF_UDP */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
297 #define UIP_TCP 1
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
298 #endif /* UIP_CONF_UDP */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
299
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
300 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
301 * Determines if support for opening connections from uIP should be
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
302 * compiled in.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
303 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
304 * If the applications that are running on top of uIP for this project
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
305 * do not need to open outgoing TCP connections, this configuration
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
306 * option can be turned off to reduce the code size of uIP.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
307 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
308 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
309 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
310 #ifndef UIP_CONF_ACTIVE_OPEN
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
311 #define UIP_ACTIVE_OPEN 1
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
312 #else /* UIP_CONF_ACTIVE_OPEN */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
313 #define UIP_ACTIVE_OPEN (UIP_CONF_ACTIVE_OPEN)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
314 #endif /* UIP_CONF_ACTIVE_OPEN */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
315
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
316 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
317 * The maximum number of simultaneously open TCP connections.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
318 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
319 * Since the TCP connections are statically allocated, turning this
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
320 * configuration knob down results in less RAM used. Each TCP
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
321 * connection requires approximately 30 bytes of memory.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
322 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
323 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
324 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
325 #ifndef UIP_CONF_MAX_CONNECTIONS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
326 #define UIP_CONNS 5
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
327 #else /* UIP_CONF_MAX_CONNECTIONS */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
328 #define UIP_CONNS (UIP_CONF_MAX_CONNECTIONS)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
329 #endif /* UIP_CONF_MAX_CONNECTIONS */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
330
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
331
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
332 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
333 * The maximum number of simultaneously listening TCP ports.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
334 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
335 * Each listening TCP port requires 2 bytes of memory.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
336 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
337 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
338 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
339 #ifndef UIP_CONF_MAX_LISTENPORTS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
340 #define UIP_LISTENPORTS 2
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
341 #else /* UIP_CONF_MAX_LISTENPORTS */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
342 #define UIP_LISTENPORTS (UIP_CONF_MAX_LISTENPORTS)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
343 #endif /* UIP_CONF_MAX_LISTENPORTS */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
344
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
345 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
346 * Determines if support for TCP urgent data notification should be
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
347 * compiled in.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
348 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
349 * Urgent data (out-of-band data) is a rarely used TCP feature that
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
350 * very seldom would be required.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
351 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
352 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
353 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
354 #define UIP_URGDATA 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
355
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
356 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
357 * The initial retransmission timeout counted in timer pulses.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
358 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
359 * This should not be changed.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
360 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
361 #define UIP_RTO 3
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
362
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
363 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
364 * The maximum number of times a segment should be retransmitted
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
365 * before the connection should be aborted.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
366 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
367 * This should not be changed.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
368 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
369 #define UIP_MAXRTX 8
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
370
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
371 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
372 * The maximum number of times a SYN segment should be retransmitted
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
373 * before a connection request should be deemed to have been
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
374 * unsuccessful.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
375 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
376 * This should not need to be changed.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
377 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
378 #define UIP_MAXSYNRTX 5
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
379
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
380 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
381 * The TCP maximum segment size.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
382 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
383 * This is should not be to set to more than
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
384 * UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
385 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
386 #ifdef UIP_CONF_TCP_MSS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
387 #define UIP_TCP_MSS (UIP_CONF_TCP_MSS)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
388 #else
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
389 #define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
390 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
391
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
392 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
393 * The size of the advertised receiver's window.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
394 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
395 * Should be set low (i.e., to the size of the uip_buf buffer) if the
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
396 * application is slow to process incoming data, or high (32768 bytes)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
397 * if the application processes data quickly.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
398 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
399 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
400 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
401 #ifndef UIP_CONF_RECEIVE_WINDOW
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
402 #define UIP_RECEIVE_WINDOW (UIP_TCP_MSS)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
403 #else
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
404 #define UIP_RECEIVE_WINDOW (UIP_CONF_RECEIVE_WINDOW)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
405 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
406
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
407 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
408 * How long a connection should stay in the TIME_WAIT state.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
409 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
410 * This can be reduced for faster entry into power saving modes.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
411 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
412 #ifndef UIP_CONF_WAIT_TIMEOUT
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
413 #define UIP_TIME_WAIT_TIMEOUT 120
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
414 #else
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
415 #define UIP_TIME_WAIT_TIMEOUT UIP_CONF_WAIT_TIMEOUT
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
416 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
417
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
418 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
419 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
420 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
421 * \defgroup uipoptarp ARP configuration options
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
422 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
423 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
424
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
425 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
426 * The size of the ARP table.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
427 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
428 * This option should be set to a larger value if this uIP node will
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
429 * have many connections from the local network.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
430 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
431 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
432 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
433 #ifdef UIP_CONF_ARPTAB_SIZE
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
434 #define UIP_ARPTAB_SIZE (UIP_CONF_ARPTAB_SIZE)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
435 #else
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
436 #define UIP_ARPTAB_SIZE 8
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
437 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
438
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
439 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
440 * The maximum age of ARP table entries measured in 10ths of seconds.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
441 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
442 * An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
443 * default).
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
444 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
445 #define UIP_ARP_MAXAGE 120
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
446
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
447
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
448 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
449
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
450 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
451
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
452 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
453 * \defgroup uipoptmac layer 2 options (for ipv6)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
454 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
455 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
456
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
457 #define UIP_DEFAULT_PREFIX_LEN 64
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
458
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
459 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
460
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
461 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
462
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
463 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
464 * \defgroup uipoptsics 6lowpan options (for ipv6)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
465 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
466 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
467 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
468 * Timeout for packet reassembly at the 6lowpan layer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
469 * (should be < 60s)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
470 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
471 #ifdef SICSLOWPAN_CONF_MAXAGE
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
472 #define SICSLOWPAN_REASS_MAXAGE (SICSLOWPAN_CONF_MAXAGE)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
473 #else
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
474 #define SICSLOWPAN_REASS_MAXAGE 20
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
475 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
476
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
477 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
478 * Do we compress the IP header or not (default: no)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
479 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
480 #ifndef SICSLOWPAN_CONF_COMPRESSION
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
481 #define SICSLOWPAN_CONF_COMPRESSION 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
482 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
483
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
484 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
485 * If we use IPHC compression, how many address contexts do we support
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
486 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
487 #ifndef SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
488 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 1
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
489 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
490
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
491 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
492 * Do we support 6lowpan fragmentation
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
493 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
494 #ifndef SICSLOWPAN_CONF_FRAG
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
495 #define SICSLOWPAN_CONF_FRAG 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
496 #endif
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
497
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
498 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
499
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
500 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
501
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
502 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
503 * \defgroup uipoptgeneral General configuration options
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
504 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
505 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
506
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
507 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
508 * The size of the uIP packet buffer.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
509 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
510 * The uIP packet buffer should not be smaller than 60 bytes, and does
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
511 * not need to be larger than 1514 bytes. Lower size results in lower
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
512 * TCP throughput, larger size results in higher TCP throughput.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
513 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
514 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
515 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
516 #ifndef UIP_CONF_BUFFER_SIZE
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
517 #define UIP_BUFSIZE (UIP_LINK_MTU + UIP_LLH_LEN)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
518 #else /* UIP_CONF_BUFFER_SIZE */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
519 #define UIP_BUFSIZE (UIP_CONF_BUFFER_SIZE)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
520 #endif /* UIP_CONF_BUFFER_SIZE */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
521
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
522
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
523 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
524 * Determines if statistics support should be compiled in.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
525 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
526 * The statistics is useful for debugging and to show the user.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
527 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
528 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
529 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
530 #ifndef UIP_CONF_STATISTICS
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
531 #define UIP_STATISTICS 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
532 #else /* UIP_CONF_STATISTICS */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
533 #define UIP_STATISTICS (UIP_CONF_STATISTICS)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
534 #endif /* UIP_CONF_STATISTICS */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
535
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
536 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
537 * Determines if logging of certain events should be compiled in.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
538 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
539 * This is useful mostly for debugging. The function uip_log()
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
540 * must be implemented to suit the architecture of the project, if
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
541 * logging is turned on.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
542 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
543 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
544 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
545 #ifndef UIP_CONF_LOGGING
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
546 #define UIP_LOGGING 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
547 #else /* UIP_CONF_LOGGING */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
548 #define UIP_LOGGING (UIP_CONF_LOGGING)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
549 #endif /* UIP_CONF_LOGGING */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
550
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
551 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
552 * Broadcast support.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
553 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
554 * This flag configures IP broadcast support. This is useful only
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
555 * together with UDP.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
556 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
557 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
558 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
559 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
560 #ifndef UIP_CONF_BROADCAST
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
561 #define UIP_BROADCAST 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
562 #else /* UIP_CONF_BROADCAST */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
563 #define UIP_BROADCAST (UIP_CONF_BROADCAST)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
564 #endif /* UIP_CONF_BROADCAST */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
565
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
566 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
567 * Print out a uIP log message.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
568 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
569 * This function must be implemented by the module that uses uIP, and
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
570 * is called by uIP whenever a log message is generated.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
571 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
572 void uip_log(char *msg);
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
573
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
574 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
575 * The link level header length.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
576 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
577 * This is the offset into the uip_buf where the IP header can be
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
578 * found. For Ethernet, this should be set to 14. For SLIP, this
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
579 * should be set to 0.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
580 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
581 * \note we probably won't use this constant for other link layers than
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
582 * ethernet as they have variable header length (this is due to variable
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
583 * number and type of address fields and to optional security features)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
584 * E.g.: 802.15.4 -> 2 + (1/2*4/8) + 0/5/6/10/14
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
585 * 802.11 -> 4 + (6*3/4) + 2
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
586 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
587 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
588 #ifdef UIP_CONF_LLH_LEN
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
589 #define UIP_LLH_LEN (UIP_CONF_LLH_LEN)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
590 #else /* UIP_LLH_LEN */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
591 #define UIP_LLH_LEN 0
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
592 #endif /* UIP_CONF_LLH_LEN */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
593
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
594 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
595 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
596 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
597 * \defgroup uipoptcpu CPU architecture configuration
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
598 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
599 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
600 * The CPU architecture configuration is where the endianess of the
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
601 * CPU on which uIP is to be run is specified. Most CPUs today are
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
602 * little endian, and the most notable exception are the Motorolas
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
603 * which are big endian. The BYTE_ORDER macro should be changed to
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
604 * reflect the CPU architecture on which uIP is to be run.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
605 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
606
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
607 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
608 * The byte order of the CPU architecture on which uIP is to be run.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
609 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
610 * This option can be either UIP_BIG_ENDIAN (Motorola byte order) or
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
611 * UIP_LITTLE_ENDIAN (Intel byte order).
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
612 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
613 * \hideinitializer
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
614 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
615 #ifdef UIP_CONF_BYTE_ORDER
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
616 #define UIP_BYTE_ORDER (UIP_CONF_BYTE_ORDER)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
617 #else /* UIP_CONF_BYTE_ORDER */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
618 #define UIP_BYTE_ORDER (UIP_LITTLE_ENDIAN)
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
619 #endif /* UIP_CONF_BYTE_ORDER */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
620
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
621 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
622 /*------------------------------------------------------------------------------*/
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
623 #include <stdint.h>
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
624 //
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
625 typedef uint8_t u8_t;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
626 typedef uint16_t u16_t;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
627 typedef uint32_t u32_t;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
628 typedef uint32_t uip_stats_t;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
629 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
630 * \defgroup uipoptapp Application specific configurations
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
631 * @{
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
632 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
633 * An uIP application is implemented using a single application
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
634 * function that is called by uIP whenever a TCP/IP event occurs. The
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
635 * name of this function must be registered with uIP at compile time
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
636 * using the UIP_APPCALL definition.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
637 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
638 * uIP applications can store the application state within the
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
639 * uip_conn structure by specifying the type of the application
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
640 * structure by typedef:ing the type uip_tcp_appstate_t and uip_udp_appstate_t.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
641 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
642 * The file containing the definitions must be included in the
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
643 * uipopt.h file.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
644 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
645 * The following example illustrates how this can look.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
646 \code
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
647
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
648 void httpd_appcall(void);
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
649 #define UIP_APPCALL httpd_appcall
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
650
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
651 struct httpd_state {
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
652 u8_t state;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
653 u16_t count;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
654 char *dataptr;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
655 char *script;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
656 };
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
657 typedef struct httpd_state uip_tcp_appstate_t
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
658 \endcode
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
659 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
660
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
661 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
662 * \var #define UIP_APPCALL
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
663 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
664 * The name of the application function that uIP should call in
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
665 * response to TCP/IP events.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
666 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
667 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
668 #define UIP_APPCALL TCPIP_TCPCallback
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
669 void UIP_APPCALL(void);
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
670
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
671 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
672 * \var typedef uip_tcp_appstate_t
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
673 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
674 * The type of the application state that is to be stored in the
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
675 * uip_conn structure. This usually is typedef:ed to a struct holding
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
676 * application state information.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
677 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
678 typedef struct
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
679 {
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
680 uint8_t RESERVED;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
681 } uip_tcp_appstate_t;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
682
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
683 /**
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
684 * \var typedef uip_udp_appstate_t
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
685 *
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
686 * The type of the application state that is to be stored in the
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
687 * uip_conn structure. This usually is typedef:ed to a struct holding
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
688 * application state information.
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
689 */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
690 typedef struct
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
691 {
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
692 uint8_t RESERVED;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
693 } uip_udp_appstate_t;
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
694
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
695 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
696
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
697 #endif /* __UIPOPT_H__ */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
698 /** @} */
56d09a0969b5 Import uIP and the PPP implementation from
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
699 /** @} */