![](/media/cache/profiles/68a15b5278e4f7c4c056df9d5f1d3b1f.jpg.50x50_q85.jpg)
This is an OSC library for the mbed, created to be compatible with Recotana\'s OSCClass library (http://recotana.com) for the Arduino with Ethernet shield. I have also used parts of the OSC Transceiver(Sender/Receiver) code by xshige. It has many limitations, but it works for simple things (check comments on the mbedOSC.h). It will be evolving. written by: Alvaro Cassinelli, 7.10.2011
EthernetNetIf/LPC2368/lwip/lwipopts2.h@0:f76708a93fb3, 2011-10-15 (annotated)
- Committer:
- mbedalvaro
- Date:
- Sat Oct 15 14:15:55 2011 +0000
- Revision:
- 0:f76708a93fb3
First working test of this simple OSC library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbedalvaro | 0:f76708a93fb3 | 1 | /* |
mbedalvaro | 0:f76708a93fb3 | 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. |
mbedalvaro | 0:f76708a93fb3 | 3 | * All rights reserved. |
mbedalvaro | 0:f76708a93fb3 | 4 | * |
mbedalvaro | 0:f76708a93fb3 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
mbedalvaro | 0:f76708a93fb3 | 6 | * are permitted provided that the following conditions are met: |
mbedalvaro | 0:f76708a93fb3 | 7 | * |
mbedalvaro | 0:f76708a93fb3 | 8 | * 1. Redistributions of source code must retain the above copyright notice, |
mbedalvaro | 0:f76708a93fb3 | 9 | * this list of conditions and the following disclaimer. |
mbedalvaro | 0:f76708a93fb3 | 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbedalvaro | 0:f76708a93fb3 | 11 | * this list of conditions and the following disclaimer in the documentation |
mbedalvaro | 0:f76708a93fb3 | 12 | * and/or other materials provided with the distribution. |
mbedalvaro | 0:f76708a93fb3 | 13 | * 3. The name of the author may not be used to endorse or promote products |
mbedalvaro | 0:f76708a93fb3 | 14 | * derived from this software without specific prior written permission. |
mbedalvaro | 0:f76708a93fb3 | 15 | * |
mbedalvaro | 0:f76708a93fb3 | 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
mbedalvaro | 0:f76708a93fb3 | 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
mbedalvaro | 0:f76708a93fb3 | 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
mbedalvaro | 0:f76708a93fb3 | 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
mbedalvaro | 0:f76708a93fb3 | 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
mbedalvaro | 0:f76708a93fb3 | 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
mbedalvaro | 0:f76708a93fb3 | 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
mbedalvaro | 0:f76708a93fb3 | 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
mbedalvaro | 0:f76708a93fb3 | 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
mbedalvaro | 0:f76708a93fb3 | 25 | * OF SUCH DAMAGE. |
mbedalvaro | 0:f76708a93fb3 | 26 | * |
mbedalvaro | 0:f76708a93fb3 | 27 | * This file is part of the lwIP TCP/IP stack. |
mbedalvaro | 0:f76708a93fb3 | 28 | * |
mbedalvaro | 0:f76708a93fb3 | 29 | * Author: Adam Dunkels <adam@sics.se> |
mbedalvaro | 0:f76708a93fb3 | 30 | * |
mbedalvaro | 0:f76708a93fb3 | 31 | */ |
mbedalvaro | 0:f76708a93fb3 | 32 | #ifndef __LWIPOPTS_H__ |
mbedalvaro | 0:f76708a93fb3 | 33 | #define __LWIPOPTS_H__ |
mbedalvaro | 0:f76708a93fb3 | 34 | |
mbedalvaro | 0:f76708a93fb3 | 35 | #include "netCfg.h" |
mbedalvaro | 0:f76708a93fb3 | 36 | #if NET_LWIP_STACK |
mbedalvaro | 0:f76708a93fb3 | 37 | |
mbedalvaro | 0:f76708a93fb3 | 38 | //#include "arch/sys_arch.h" |
mbedalvaro | 0:f76708a93fb3 | 39 | |
mbedalvaro | 0:f76708a93fb3 | 40 | /* <sys/time.h> is included in cc.h! */ |
mbedalvaro | 0:f76708a93fb3 | 41 | #define LWIP_TIMEVAL_PRIVATE 0 |
mbedalvaro | 0:f76708a93fb3 | 42 | |
mbedalvaro | 0:f76708a93fb3 | 43 | //#define __LWIP_DEBUG |
mbedalvaro | 0:f76708a93fb3 | 44 | #include "dbg/dbg.h" |
mbedalvaro | 0:f76708a93fb3 | 45 | |
mbedalvaro | 0:f76708a93fb3 | 46 | #ifdef __LWIP_DEBUG |
mbedalvaro | 0:f76708a93fb3 | 47 | |
mbedalvaro | 0:f76708a93fb3 | 48 | #define LWIP_DEBUG 1 |
mbedalvaro | 0:f76708a93fb3 | 49 | |
mbedalvaro | 0:f76708a93fb3 | 50 | #define LWIP_DBG_MIN_LEVEL 0 |
mbedalvaro | 0:f76708a93fb3 | 51 | //#define LWIP_COMPAT_SOCKETS 1 |
mbedalvaro | 0:f76708a93fb3 | 52 | #define TAPIF_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 53 | #define TUNIF_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 54 | #define UNIXIF_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 55 | #define DELIF_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 56 | #define SIO_FIFO_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 57 | #define TCPDUMP_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 58 | |
mbedalvaro | 0:f76708a93fb3 | 59 | #define PPP_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 60 | #define MEM_DEBUG LWIP_DBG_ON |
mbedalvaro | 0:f76708a93fb3 | 61 | #define MEMP_DEBUG LWIP_DBG_ON |
mbedalvaro | 0:f76708a93fb3 | 62 | #define PBUF_DEBUG LWIP_DBG_ON |
mbedalvaro | 0:f76708a93fb3 | 63 | #define API_LIB_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 64 | #define API_MSG_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 65 | #define TCPIP_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 66 | #define NETIF_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 67 | #define SOCKETS_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 68 | #define DEMO_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 69 | #define IP_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 70 | #define IP_REASS_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 71 | #define RAW_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 72 | #define ICMP_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 73 | #define UDP_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 74 | #define TCP_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 75 | #define TCP_INPUT_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 76 | #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 77 | #define TCP_RTO_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 78 | #define TCP_CWND_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 79 | #define TCP_WND_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 80 | #define TCP_FR_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 81 | #define TCP_QLEN_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 82 | #define TCP_RST_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 83 | #define ETHARP_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 84 | #define DNS_DEBUG LWIP_DBG_OFF |
mbedalvaro | 0:f76708a93fb3 | 85 | |
mbedalvaro | 0:f76708a93fb3 | 86 | #endif |
mbedalvaro | 0:f76708a93fb3 | 87 | |
mbedalvaro | 0:f76708a93fb3 | 88 | /* |
mbedalvaro | 0:f76708a93fb3 | 89 | extern unsigned char debug_flags; |
mbedalvaro | 0:f76708a93fb3 | 90 | #define LWIP_DBG_TYPES_ON debug_flags |
mbedalvaro | 0:f76708a93fb3 | 91 | */ |
mbedalvaro | 0:f76708a93fb3 | 92 | #define NO_SYS 1 |
mbedalvaro | 0:f76708a93fb3 | 93 | #define LWIP_SOCKET (NO_SYS==0) |
mbedalvaro | 0:f76708a93fb3 | 94 | #define LWIP_NETCONN (NO_SYS==0) |
mbedalvaro | 0:f76708a93fb3 | 95 | |
mbedalvaro | 0:f76708a93fb3 | 96 | |
mbedalvaro | 0:f76708a93fb3 | 97 | #define IP_FRAG_USES_STATIC_BUF 0 |
mbedalvaro | 0:f76708a93fb3 | 98 | |
mbedalvaro | 0:f76708a93fb3 | 99 | |
mbedalvaro | 0:f76708a93fb3 | 100 | |
mbedalvaro | 0:f76708a93fb3 | 101 | /* ---------- Memory options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 102 | /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which |
mbedalvaro | 0:f76708a93fb3 | 103 | lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 |
mbedalvaro | 0:f76708a93fb3 | 104 | byte alignment -> define MEM_ALIGNMENT to 2. */ |
mbedalvaro | 0:f76708a93fb3 | 105 | /* MSVC port: intel processors don't need 4-byte alignment, |
mbedalvaro | 0:f76708a93fb3 | 106 | but are faster that way! */ |
mbedalvaro | 0:f76708a93fb3 | 107 | #define MEM_ALIGNMENT 4 |
mbedalvaro | 0:f76708a93fb3 | 108 | |
mbedalvaro | 0:f76708a93fb3 | 109 | /* MEM_SIZE: the size of the heap memory. If the application will send |
mbedalvaro | 0:f76708a93fb3 | 110 | a lot of data that needs to be copied, this should be set high. */ |
mbedalvaro | 0:f76708a93fb3 | 111 | //#define MEM_SIZE 10240 |
mbedalvaro | 0:f76708a93fb3 | 112 | |
mbedalvaro | 0:f76708a93fb3 | 113 | #if TARGET_LPC1768 |
mbedalvaro | 0:f76708a93fb3 | 114 | |
mbedalvaro | 0:f76708a93fb3 | 115 | |
mbedalvaro | 0:f76708a93fb3 | 116 | #define MEM_SIZE 4000 |
mbedalvaro | 0:f76708a93fb3 | 117 | |
mbedalvaro | 0:f76708a93fb3 | 118 | /// |
mbedalvaro | 0:f76708a93fb3 | 119 | |
mbedalvaro | 0:f76708a93fb3 | 120 | #define MEM_POSITION __attribute((section("AHBSRAM0"))) |
mbedalvaro | 0:f76708a93fb3 | 121 | |
mbedalvaro | 0:f76708a93fb3 | 122 | /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application |
mbedalvaro | 0:f76708a93fb3 | 123 | sends a lot of data out of ROM (or other static memory), this |
mbedalvaro | 0:f76708a93fb3 | 124 | should be set high. */ |
mbedalvaro | 0:f76708a93fb3 | 125 | #define MEMP_NUM_PBUF 16 |
mbedalvaro | 0:f76708a93fb3 | 126 | /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One |
mbedalvaro | 0:f76708a93fb3 | 127 | per active RAW "connection". */ |
mbedalvaro | 0:f76708a93fb3 | 128 | //#define MEMP_NUM_RAW_PCB 3 |
mbedalvaro | 0:f76708a93fb3 | 129 | /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One |
mbedalvaro | 0:f76708a93fb3 | 130 | per active UDP "connection". */ |
mbedalvaro | 0:f76708a93fb3 | 131 | #define MEMP_NUM_UDP_PCB 2 |
mbedalvaro | 0:f76708a93fb3 | 132 | /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP |
mbedalvaro | 0:f76708a93fb3 | 133 | connections. */ |
mbedalvaro | 0:f76708a93fb3 | 134 | #define MEMP_NUM_TCP_PCB 2 |
mbedalvaro | 0:f76708a93fb3 | 135 | /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP |
mbedalvaro | 0:f76708a93fb3 | 136 | connections. */ |
mbedalvaro | 0:f76708a93fb3 | 137 | #define MEMP_NUM_TCP_PCB_LISTEN 2//4 |
mbedalvaro | 0:f76708a93fb3 | 138 | /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP |
mbedalvaro | 0:f76708a93fb3 | 139 | segments. */ |
mbedalvaro | 0:f76708a93fb3 | 140 | #define MEMP_NUM_TCP_SEG 16 |
mbedalvaro | 0:f76708a93fb3 | 141 | /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active |
mbedalvaro | 0:f76708a93fb3 | 142 | timeouts. */ |
mbedalvaro | 0:f76708a93fb3 | 143 | #define MEMP_NUM_SYS_TIMEOUT 12 |
mbedalvaro | 0:f76708a93fb3 | 144 | |
mbedalvaro | 0:f76708a93fb3 | 145 | /* The following four are used only with the sequential API and can be |
mbedalvaro | 0:f76708a93fb3 | 146 | set to 0 if the application only will use the raw API. */ |
mbedalvaro | 0:f76708a93fb3 | 147 | /* MEMP_NUM_NETBUF: the number of struct netbufs. */ |
mbedalvaro | 0:f76708a93fb3 | 148 | #define MEMP_NUM_NETBUF 0 |
mbedalvaro | 0:f76708a93fb3 | 149 | /* MEMP_NUM_NETCONN: the number of struct netconns. */ |
mbedalvaro | 0:f76708a93fb3 | 150 | #define MEMP_NUM_NETCONN 0 |
mbedalvaro | 0:f76708a93fb3 | 151 | /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used |
mbedalvaro | 0:f76708a93fb3 | 152 | for sequential API communication and incoming packets. Used in |
mbedalvaro | 0:f76708a93fb3 | 153 | src/api/tcpip.c. */ |
mbedalvaro | 0:f76708a93fb3 | 154 | #define MEMP_NUM_TCPIP_MSG_API 0 |
mbedalvaro | 0:f76708a93fb3 | 155 | #define MEMP_NUM_TCPIP_MSG_INPKT 0 |
mbedalvaro | 0:f76708a93fb3 | 156 | |
mbedalvaro | 0:f76708a93fb3 | 157 | /* ---------- Pbuf options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 158 | /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ |
mbedalvaro | 0:f76708a93fb3 | 159 | #define PBUF_POOL_SIZE 8//100 |
mbedalvaro | 0:f76708a93fb3 | 160 | |
mbedalvaro | 0:f76708a93fb3 | 161 | /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ |
mbedalvaro | 0:f76708a93fb3 | 162 | #define PBUF_POOL_BUFSIZE 128 |
mbedalvaro | 0:f76708a93fb3 | 163 | |
mbedalvaro | 0:f76708a93fb3 | 164 | /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a |
mbedalvaro | 0:f76708a93fb3 | 165 | link level header. */ |
mbedalvaro | 0:f76708a93fb3 | 166 | //#define PBUF_LINK_HLEN 16 |
mbedalvaro | 0:f76708a93fb3 | 167 | |
mbedalvaro | 0:f76708a93fb3 | 168 | /** SYS_LIGHTWEIGHT_PROT |
mbedalvaro | 0:f76708a93fb3 | 169 | * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection |
mbedalvaro | 0:f76708a93fb3 | 170 | * for certain critical regions during buffer allocation, deallocation and memory |
mbedalvaro | 0:f76708a93fb3 | 171 | * allocation and deallocation. |
mbedalvaro | 0:f76708a93fb3 | 172 | */ |
mbedalvaro | 0:f76708a93fb3 | 173 | #define SYS_LIGHTWEIGHT_PROT 0 //No sys here |
mbedalvaro | 0:f76708a93fb3 | 174 | |
mbedalvaro | 0:f76708a93fb3 | 175 | /* ---------- TCP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 176 | #define LWIP_TCP 1 |
mbedalvaro | 0:f76708a93fb3 | 177 | #define TCP_TTL 255 |
mbedalvaro | 0:f76708a93fb3 | 178 | |
mbedalvaro | 0:f76708a93fb3 | 179 | /* Controls if TCP should queue segments that arrive out of |
mbedalvaro | 0:f76708a93fb3 | 180 | order. Define to 0 if your device is low on memory. */ |
mbedalvaro | 0:f76708a93fb3 | 181 | #define TCP_QUEUE_OOSEQ 0 |
mbedalvaro | 0:f76708a93fb3 | 182 | |
mbedalvaro | 0:f76708a93fb3 | 183 | /* TCP Maximum segment size. */ |
mbedalvaro | 0:f76708a93fb3 | 184 | //#define TCP_MSS 1024 |
mbedalvaro | 0:f76708a93fb3 | 185 | #define TCP_MSS 0x276//536//0x276 |
mbedalvaro | 0:f76708a93fb3 | 186 | |
mbedalvaro | 0:f76708a93fb3 | 187 | /* TCP sender buffer space (bytes). */ |
mbedalvaro | 0:f76708a93fb3 | 188 | #define TCP_SND_BUF 2048 |
mbedalvaro | 0:f76708a93fb3 | 189 | |
mbedalvaro | 0:f76708a93fb3 | 190 | /* TCP sender buffer space (pbufs). This must be at least = 2 * |
mbedalvaro | 0:f76708a93fb3 | 191 | TCP_SND_BUF/TCP_MSS for things to work. */ |
mbedalvaro | 0:f76708a93fb3 | 192 | #define TCP_SND_QUEUELEN (2 * TCP_SND_BUF/TCP_MSS) |
mbedalvaro | 0:f76708a93fb3 | 193 | |
mbedalvaro | 0:f76708a93fb3 | 194 | /* TCP writable space (bytes). This must be less than or equal |
mbedalvaro | 0:f76708a93fb3 | 195 | to TCP_SND_BUF. It is the amount of space which must be |
mbedalvaro | 0:f76708a93fb3 | 196 | available in the tcp snd_buf for select to return writable */ |
mbedalvaro | 0:f76708a93fb3 | 197 | #define TCP_SNDLOWAT (TCP_SND_BUF/2) |
mbedalvaro | 0:f76708a93fb3 | 198 | |
mbedalvaro | 0:f76708a93fb3 | 199 | /* TCP receive window. */ |
mbedalvaro | 0:f76708a93fb3 | 200 | #define TCP_WND 2048 //8096 |
mbedalvaro | 0:f76708a93fb3 | 201 | |
mbedalvaro | 0:f76708a93fb3 | 202 | /* Maximum number of retransmissions of data segments. */ |
mbedalvaro | 0:f76708a93fb3 | 203 | //#define TCP_MAXRTX 12 |
mbedalvaro | 0:f76708a93fb3 | 204 | |
mbedalvaro | 0:f76708a93fb3 | 205 | /* Maximum number of retransmissions of SYN segments. */ |
mbedalvaro | 0:f76708a93fb3 | 206 | //#define TCP_SYNMAXRTX 4 |
mbedalvaro | 0:f76708a93fb3 | 207 | |
mbedalvaro | 0:f76708a93fb3 | 208 | #elif TARGET_LPC2368 |
mbedalvaro | 0:f76708a93fb3 | 209 | |
mbedalvaro | 0:f76708a93fb3 | 210 | #define MEM_POSITION __attribute((section("AHBSRAM1"))) |
mbedalvaro | 0:f76708a93fb3 | 211 | |
mbedalvaro | 0:f76708a93fb3 | 212 | /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application |
mbedalvaro | 0:f76708a93fb3 | 213 | sends a lot of data out of ROM (or other static memory), this |
mbedalvaro | 0:f76708a93fb3 | 214 | should be set high. */ |
mbedalvaro | 0:f76708a93fb3 | 215 | #define MEMP_NUM_PBUF 8 |
mbedalvaro | 0:f76708a93fb3 | 216 | /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One |
mbedalvaro | 0:f76708a93fb3 | 217 | per active RAW "connection". */ |
mbedalvaro | 0:f76708a93fb3 | 218 | //#define MEMP_NUM_RAW_PCB 3 |
mbedalvaro | 0:f76708a93fb3 | 219 | /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One |
mbedalvaro | 0:f76708a93fb3 | 220 | per active UDP "connection". */ |
mbedalvaro | 0:f76708a93fb3 | 221 | #define MEMP_NUM_UDP_PCB 2 |
mbedalvaro | 0:f76708a93fb3 | 222 | /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP |
mbedalvaro | 0:f76708a93fb3 | 223 | connections. */ |
mbedalvaro | 0:f76708a93fb3 | 224 | #define MEMP_NUM_TCP_PCB 2 |
mbedalvaro | 0:f76708a93fb3 | 225 | /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP |
mbedalvaro | 0:f76708a93fb3 | 226 | connections. */ |
mbedalvaro | 0:f76708a93fb3 | 227 | #define MEMP_NUM_TCP_PCB_LISTEN 2//4 |
mbedalvaro | 0:f76708a93fb3 | 228 | /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP |
mbedalvaro | 0:f76708a93fb3 | 229 | segments. */ |
mbedalvaro | 0:f76708a93fb3 | 230 | #define MEMP_NUM_TCP_SEG 8 |
mbedalvaro | 0:f76708a93fb3 | 231 | /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active |
mbedalvaro | 0:f76708a93fb3 | 232 | timeouts. */ |
mbedalvaro | 0:f76708a93fb3 | 233 | #define MEMP_NUM_SYS_TIMEOUT 12 |
mbedalvaro | 0:f76708a93fb3 | 234 | |
mbedalvaro | 0:f76708a93fb3 | 235 | /* The following four are used only with the sequential API and can be |
mbedalvaro | 0:f76708a93fb3 | 236 | set to 0 if the application only will use the raw API. */ |
mbedalvaro | 0:f76708a93fb3 | 237 | /* MEMP_NUM_NETBUF: the number of struct netbufs. */ |
mbedalvaro | 0:f76708a93fb3 | 238 | #define MEMP_NUM_NETBUF 0 |
mbedalvaro | 0:f76708a93fb3 | 239 | /* MEMP_NUM_NETCONN: the number of struct netconns. */ |
mbedalvaro | 0:f76708a93fb3 | 240 | #define MEMP_NUM_NETCONN 0 |
mbedalvaro | 0:f76708a93fb3 | 241 | /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used |
mbedalvaro | 0:f76708a93fb3 | 242 | for sequential API communication and incoming packets. Used in |
mbedalvaro | 0:f76708a93fb3 | 243 | src/api/tcpip.c. */ |
mbedalvaro | 0:f76708a93fb3 | 244 | #define MEMP_NUM_TCPIP_MSG_API 0 |
mbedalvaro | 0:f76708a93fb3 | 245 | #define MEMP_NUM_TCPIP_MSG_INPKT 0 |
mbedalvaro | 0:f76708a93fb3 | 246 | |
mbedalvaro | 0:f76708a93fb3 | 247 | /* ---------- Pbuf options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 248 | /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ |
mbedalvaro | 0:f76708a93fb3 | 249 | #define PBUF_POOL_SIZE 8//16//100 |
mbedalvaro | 0:f76708a93fb3 | 250 | |
mbedalvaro | 0:f76708a93fb3 | 251 | /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ |
mbedalvaro | 0:f76708a93fb3 | 252 | //#define PBUF_POOL_BUFSIZE 128 |
mbedalvaro | 0:f76708a93fb3 | 253 | |
mbedalvaro | 0:f76708a93fb3 | 254 | /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a |
mbedalvaro | 0:f76708a93fb3 | 255 | link level header. */ |
mbedalvaro | 0:f76708a93fb3 | 256 | //#define PBUF_LINK_HLEN 16 |
mbedalvaro | 0:f76708a93fb3 | 257 | |
mbedalvaro | 0:f76708a93fb3 | 258 | /** SYS_LIGHTWEIGHT_PROT |
mbedalvaro | 0:f76708a93fb3 | 259 | * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection |
mbedalvaro | 0:f76708a93fb3 | 260 | * for certain critical regions during buffer allocation, deallocation and memory |
mbedalvaro | 0:f76708a93fb3 | 261 | * allocation and deallocation. |
mbedalvaro | 0:f76708a93fb3 | 262 | */ |
mbedalvaro | 0:f76708a93fb3 | 263 | #define SYS_LIGHTWEIGHT_PROT 0 //No sys here |
mbedalvaro | 0:f76708a93fb3 | 264 | |
mbedalvaro | 0:f76708a93fb3 | 265 | /* ---------- TCP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 266 | #define LWIP_TCP 1 |
mbedalvaro | 0:f76708a93fb3 | 267 | #define TCP_TTL 255 |
mbedalvaro | 0:f76708a93fb3 | 268 | |
mbedalvaro | 0:f76708a93fb3 | 269 | /* Controls if TCP should queue segments that arrive out of |
mbedalvaro | 0:f76708a93fb3 | 270 | order. Define to 0 if your device is low on memory. */ |
mbedalvaro | 0:f76708a93fb3 | 271 | #define TCP_QUEUE_OOSEQ 0 |
mbedalvaro | 0:f76708a93fb3 | 272 | |
mbedalvaro | 0:f76708a93fb3 | 273 | /* TCP Maximum segment size. */ |
mbedalvaro | 0:f76708a93fb3 | 274 | //#define TCP_MSS 1024 |
mbedalvaro | 0:f76708a93fb3 | 275 | #define TCP_MSS 512//0x276//536//0x276 |
mbedalvaro | 0:f76708a93fb3 | 276 | |
mbedalvaro | 0:f76708a93fb3 | 277 | /* TCP sender buffer space (bytes). */ |
mbedalvaro | 0:f76708a93fb3 | 278 | #define TCP_SND_BUF 1024//2048 |
mbedalvaro | 0:f76708a93fb3 | 279 | |
mbedalvaro | 0:f76708a93fb3 | 280 | /* TCP sender buffer space (pbufs). This must be at least = 2 * |
mbedalvaro | 0:f76708a93fb3 | 281 | TCP_SND_BUF/TCP_MSS for things to work. */ |
mbedalvaro | 0:f76708a93fb3 | 282 | #define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS)//(4 * TCP_SND_BUF/TCP_MSS) |
mbedalvaro | 0:f76708a93fb3 | 283 | |
mbedalvaro | 0:f76708a93fb3 | 284 | /* TCP writable space (bytes). This must be less than or equal |
mbedalvaro | 0:f76708a93fb3 | 285 | to TCP_SND_BUF. It is the amount of space which must be |
mbedalvaro | 0:f76708a93fb3 | 286 | available in the tcp snd_buf for select to return writable */ |
mbedalvaro | 0:f76708a93fb3 | 287 | #define TCP_SNDLOWAT (TCP_SND_BUF/2) |
mbedalvaro | 0:f76708a93fb3 | 288 | |
mbedalvaro | 0:f76708a93fb3 | 289 | /* TCP receive window. */ |
mbedalvaro | 0:f76708a93fb3 | 290 | #define TCP_WND 512 //8096 |
mbedalvaro | 0:f76708a93fb3 | 291 | |
mbedalvaro | 0:f76708a93fb3 | 292 | /* Maximum number of retransmissions of data segments. */ |
mbedalvaro | 0:f76708a93fb3 | 293 | //#define TCP_MAXRTX 12 |
mbedalvaro | 0:f76708a93fb3 | 294 | |
mbedalvaro | 0:f76708a93fb3 | 295 | /* Maximum number of retransmissions of SYN segments. */ |
mbedalvaro | 0:f76708a93fb3 | 296 | //#define TCP_SYNMAXRTX 4 |
mbedalvaro | 0:f76708a93fb3 | 297 | |
mbedalvaro | 0:f76708a93fb3 | 298 | #endif |
mbedalvaro | 0:f76708a93fb3 | 299 | |
mbedalvaro | 0:f76708a93fb3 | 300 | /* ---------- ARP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 301 | #define LWIP_ARP (NET_ETH | NET_ZG2100) |
mbedalvaro | 0:f76708a93fb3 | 302 | #define ARP_TABLE_SIZE 2//4//10 |
mbedalvaro | 0:f76708a93fb3 | 303 | #define ARP_QUEUEING 0//1 |
mbedalvaro | 0:f76708a93fb3 | 304 | #define ETHARP_TRUST_IP_MAC 1 |
mbedalvaro | 0:f76708a93fb3 | 305 | |
mbedalvaro | 0:f76708a93fb3 | 306 | /* ---------- IP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 307 | /* Define IP_FORWARD to 1 if you wish to have the ability to forward |
mbedalvaro | 0:f76708a93fb3 | 308 | IP packets across network interfaces. If you are going to run lwIP |
mbedalvaro | 0:f76708a93fb3 | 309 | on a device with only one network interface, define this to 0. */ |
mbedalvaro | 0:f76708a93fb3 | 310 | #define IP_FORWARD 0 |
mbedalvaro | 0:f76708a93fb3 | 311 | |
mbedalvaro | 0:f76708a93fb3 | 312 | |
mbedalvaro | 0:f76708a93fb3 | 313 | /* IP reassembly and segmentation.These are orthogonal even |
mbedalvaro | 0:f76708a93fb3 | 314 | * if they both deal with IP fragments */ |
mbedalvaro | 0:f76708a93fb3 | 315 | /* |
mbedalvaro | 0:f76708a93fb3 | 316 | #define IP_REASSEMBLY 1 |
mbedalvaro | 0:f76708a93fb3 | 317 | #define IP_REASS_MAX_PBUFS 10 |
mbedalvaro | 0:f76708a93fb3 | 318 | #define MEMP_NUM_REASSDATA 10 |
mbedalvaro | 0:f76708a93fb3 | 319 | #define IP_FRAG 1 |
mbedalvaro | 0:f76708a93fb3 | 320 | */ |
mbedalvaro | 0:f76708a93fb3 | 321 | /* ---------- ICMP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 322 | #define ICMP_TTL 255 |
mbedalvaro | 0:f76708a93fb3 | 323 | |
mbedalvaro | 0:f76708a93fb3 | 324 | /* ---------- DHCP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 325 | /* Define LWIP_DHCP to 1 if you want DHCP configuration of |
mbedalvaro | 0:f76708a93fb3 | 326 | interfaces. */ |
mbedalvaro | 0:f76708a93fb3 | 327 | #define LWIP_DHCP (NET_ETH | NET_ZG2100) |
mbedalvaro | 0:f76708a93fb3 | 328 | |
mbedalvaro | 0:f76708a93fb3 | 329 | /* 1 if you want to do an ARP check on the offered address |
mbedalvaro | 0:f76708a93fb3 | 330 | (recommended if using DHCP). */ |
mbedalvaro | 0:f76708a93fb3 | 331 | #define DHCP_DOES_ARP_CHECK (LWIP_DHCP) |
mbedalvaro | 0:f76708a93fb3 | 332 | |
mbedalvaro | 0:f76708a93fb3 | 333 | /* ---------- AUTOIP options ------- */ |
mbedalvaro | 0:f76708a93fb3 | 334 | #define LWIP_AUTOIP 0 |
mbedalvaro | 0:f76708a93fb3 | 335 | |
mbedalvaro | 0:f76708a93fb3 | 336 | /* ---------- SNMP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 337 | /** @todo SNMP is experimental for now |
mbedalvaro | 0:f76708a93fb3 | 338 | @note UDP must be available for SNMP transport */ |
mbedalvaro | 0:f76708a93fb3 | 339 | #ifndef LWIP_SNMP |
mbedalvaro | 0:f76708a93fb3 | 340 | #define LWIP_SNMP 0 |
mbedalvaro | 0:f76708a93fb3 | 341 | #endif |
mbedalvaro | 0:f76708a93fb3 | 342 | |
mbedalvaro | 0:f76708a93fb3 | 343 | |
mbedalvaro | 0:f76708a93fb3 | 344 | #ifndef SNMP_PRIVATE_MIB |
mbedalvaro | 0:f76708a93fb3 | 345 | #define SNMP_PRIVATE_MIB 0 |
mbedalvaro | 0:f76708a93fb3 | 346 | #endif |
mbedalvaro | 0:f76708a93fb3 | 347 | |
mbedalvaro | 0:f76708a93fb3 | 348 | |
mbedalvaro | 0:f76708a93fb3 | 349 | /* ---------- UDP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 350 | #define LWIP_UDP 1 |
mbedalvaro | 0:f76708a93fb3 | 351 | #define UDP_TTL 255 |
mbedalvaro | 0:f76708a93fb3 | 352 | |
mbedalvaro | 0:f76708a93fb3 | 353 | /* ---------- DNS options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 354 | #define LWIP_DNS 1 |
mbedalvaro | 0:f76708a93fb3 | 355 | |
mbedalvaro | 0:f76708a93fb3 | 356 | /* ---------- RAW options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 357 | #define LWIP_RAW 0 |
mbedalvaro | 0:f76708a93fb3 | 358 | #define RAW_TTL 255 |
mbedalvaro | 0:f76708a93fb3 | 359 | |
mbedalvaro | 0:f76708a93fb3 | 360 | /* ---------- Statistics options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 361 | /* individual STATS options can be turned off by defining them to 0 |
mbedalvaro | 0:f76708a93fb3 | 362 | * (e.g #define TCP_STATS 0). All of them are turned off if LWIP_STATS |
mbedalvaro | 0:f76708a93fb3 | 363 | * is 0 |
mbedalvaro | 0:f76708a93fb3 | 364 | * */ |
mbedalvaro | 0:f76708a93fb3 | 365 | |
mbedalvaro | 0:f76708a93fb3 | 366 | #define LWIP_STATS 0 |
mbedalvaro | 0:f76708a93fb3 | 367 | |
mbedalvaro | 0:f76708a93fb3 | 368 | /* ---------- PPP options ---------- */ |
mbedalvaro | 0:f76708a93fb3 | 369 | |
mbedalvaro | 0:f76708a93fb3 | 370 | #define PPP_SUPPORT NET_PPP /* Set > 0 for PPP */ |
mbedalvaro | 0:f76708a93fb3 | 371 | |
mbedalvaro | 0:f76708a93fb3 | 372 | #if PPP_SUPPORT > 0 |
mbedalvaro | 0:f76708a93fb3 | 373 | |
mbedalvaro | 0:f76708a93fb3 | 374 | #define NUM_PPP 1 /* Max PPP sessions. */ |
mbedalvaro | 0:f76708a93fb3 | 375 | |
mbedalvaro | 0:f76708a93fb3 | 376 | |
mbedalvaro | 0:f76708a93fb3 | 377 | /* Select modules to enable. Ideally these would be set in the makefile but |
mbedalvaro | 0:f76708a93fb3 | 378 | * we're limited by the command line length so you need to modify the settings |
mbedalvaro | 0:f76708a93fb3 | 379 | * in this file. |
mbedalvaro | 0:f76708a93fb3 | 380 | */ |
mbedalvaro | 0:f76708a93fb3 | 381 | #define PAP_SUPPORT 1 /* Set > 0 for PAP. */ |
mbedalvaro | 0:f76708a93fb3 | 382 | #define CHAP_SUPPORT 1 /* Set > 0 for CHAP. */ |
mbedalvaro | 0:f76708a93fb3 | 383 | #define MSCHAP_SUPPORT 0 /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */ |
mbedalvaro | 0:f76708a93fb3 | 384 | #define CBCP_SUPPORT 0 /* Set > 0 for CBCP (NOT FUNCTIONAL!) */ |
mbedalvaro | 0:f76708a93fb3 | 385 | #define CCP_SUPPORT 0 /* Set > 0 for CCP (NOT FUNCTIONAL!) */ |
mbedalvaro | 0:f76708a93fb3 | 386 | #define VJ_SUPPORT 1 /* Set > 0 for VJ header compression. */ |
mbedalvaro | 0:f76708a93fb3 | 387 | #define MD5_SUPPORT 1 /* Set > 0 for MD5 (see also CHAP) */ |
mbedalvaro | 0:f76708a93fb3 | 388 | |
mbedalvaro | 0:f76708a93fb3 | 389 | |
mbedalvaro | 0:f76708a93fb3 | 390 | /* |
mbedalvaro | 0:f76708a93fb3 | 391 | * Timeouts. |
mbedalvaro | 0:f76708a93fb3 | 392 | */ |
mbedalvaro | 0:f76708a93fb3 | 393 | #define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ |
mbedalvaro | 0:f76708a93fb3 | 394 | #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ |
mbedalvaro | 0:f76708a93fb3 | 395 | #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ |
mbedalvaro | 0:f76708a93fb3 | 396 | #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ |
mbedalvaro | 0:f76708a93fb3 | 397 | |
mbedalvaro | 0:f76708a93fb3 | 398 | #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ |
mbedalvaro | 0:f76708a93fb3 | 399 | #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ |
mbedalvaro | 0:f76708a93fb3 | 400 | |
mbedalvaro | 0:f76708a93fb3 | 401 | #define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ |
mbedalvaro | 0:f76708a93fb3 | 402 | #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ |
mbedalvaro | 0:f76708a93fb3 | 403 | |
mbedalvaro | 0:f76708a93fb3 | 404 | |
mbedalvaro | 0:f76708a93fb3 | 405 | /* Interval in seconds between keepalive echo requests, 0 to disable. */ |
mbedalvaro | 0:f76708a93fb3 | 406 | #if 1 |
mbedalvaro | 0:f76708a93fb3 | 407 | #define LCP_ECHOINTERVAL 0 |
mbedalvaro | 0:f76708a93fb3 | 408 | #else |
mbedalvaro | 0:f76708a93fb3 | 409 | |
mbedalvaro | 0:f76708a93fb3 | 410 | #define LCP_ECHOINTERVAL 10 |
mbedalvaro | 0:f76708a93fb3 | 411 | #endif |
mbedalvaro | 0:f76708a93fb3 | 412 | |
mbedalvaro | 0:f76708a93fb3 | 413 | |
mbedalvaro | 0:f76708a93fb3 | 414 | /* Number of unanswered echo requests before failure. */ |
mbedalvaro | 0:f76708a93fb3 | 415 | #define LCP_MAXECHOFAILS 3 |
mbedalvaro | 0:f76708a93fb3 | 416 | |
mbedalvaro | 0:f76708a93fb3 | 417 | /* Max Xmit idle time (in jiffies) before resend flag char. */ |
mbedalvaro | 0:f76708a93fb3 | 418 | #define PPP_MAXIDLEFLAG 0//Send it every time//100 |
mbedalvaro | 0:f76708a93fb3 | 419 | |
mbedalvaro | 0:f76708a93fb3 | 420 | /* |
mbedalvaro | 0:f76708a93fb3 | 421 | * Packet sizes |
mbedalvaro | 0:f76708a93fb3 | 422 | * |
mbedalvaro | 0:f76708a93fb3 | 423 | * Note - lcp shouldn't be allowed to negotiate stuff outside these |
mbedalvaro | 0:f76708a93fb3 | 424 | * limits. See lcp.h in the pppd directory. |
mbedalvaro | 0:f76708a93fb3 | 425 | * (XXX - these constants should simply be shared by lcp.c instead |
mbedalvaro | 0:f76708a93fb3 | 426 | * of living in lcp.h) |
mbedalvaro | 0:f76708a93fb3 | 427 | */ |
mbedalvaro | 0:f76708a93fb3 | 428 | #define PPP_MTU 1500 /* Default MTU (size of Info field) */ |
mbedalvaro | 0:f76708a93fb3 | 429 | #if 0 |
mbedalvaro | 0:f76708a93fb3 | 430 | #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) |
mbedalvaro | 0:f76708a93fb3 | 431 | #else |
mbedalvaro | 0:f76708a93fb3 | 432 | |
mbedalvaro | 0:f76708a93fb3 | 433 | #define PPP_MAXMTU 1500 /* Largest MTU we allow */ |
mbedalvaro | 0:f76708a93fb3 | 434 | #endif |
mbedalvaro | 0:f76708a93fb3 | 435 | |
mbedalvaro | 0:f76708a93fb3 | 436 | #define PPP_MINMTU 64 |
mbedalvaro | 0:f76708a93fb3 | 437 | #define PPP_MRU 1500 /* default MRU = max length of info field */ |
mbedalvaro | 0:f76708a93fb3 | 438 | #define PPP_MAXMRU 1500 /* Largest MRU we allow */ |
mbedalvaro | 0:f76708a93fb3 | 439 | #define PPP_DEFMRU 296 /* Try for this */ |
mbedalvaro | 0:f76708a93fb3 | 440 | #define PPP_MINMRU 128 /* No MRUs below this */ |
mbedalvaro | 0:f76708a93fb3 | 441 | |
mbedalvaro | 0:f76708a93fb3 | 442 | |
mbedalvaro | 0:f76708a93fb3 | 443 | #define MAXNAMELEN 64 /* max length of hostname or name for auth */ |
mbedalvaro | 0:f76708a93fb3 | 444 | #define MAXSECRETLEN 64 /* max length of password or secret */ |
mbedalvaro | 0:f76708a93fb3 | 445 | |
mbedalvaro | 0:f76708a93fb3 | 446 | #endif /* PPP_SUPPORT > 0 */ |
mbedalvaro | 0:f76708a93fb3 | 447 | |
mbedalvaro | 0:f76708a93fb3 | 448 | //C++ Compat |
mbedalvaro | 0:f76708a93fb3 | 449 | #define try vTry |
mbedalvaro | 0:f76708a93fb3 | 450 | |
mbedalvaro | 0:f76708a93fb3 | 451 | #endif |
mbedalvaro | 0:f76708a93fb3 | 452 | |
mbedalvaro | 0:f76708a93fb3 | 453 | |
mbedalvaro | 0:f76708a93fb3 | 454 | #endif /* __LWIPOPTS_H__ */ |