Mercurial > ecos
changeset 2154:464189c3749b
* cdl/lwip_net.cdl: Add the interfaces CYGPKG_NET_STACK,
CYGPKG_NET_STACK_INET and CYGPKG_NET_STACK_INET6 and say that we
implement a network stack and an IPv4 stack. Without these interfaces
some of the Ethernet device drivers won't be compiled.
* cdl/lwip_net.cdl: Changed names of configuration options
according to eCos configuration option naming convention in
component writers guide.
* include/lwipopts.h: Changed mapping of eCos configuration
parameters to lwip configuration parameters. The mapping
was wrong because it expected a disabled eCos configuration
option is defined as 0 but a disabled eCos configuration option
is not defined.
* include/lwip/api.h Enumeration values of netconn_type are
defined conditional now to avoid compiler warnings if these
values are not evaluated in a switch statement.
* src/api/api_lib.c Compilation of code in several switch
statements is now conditional depending on configured
functionality.
* src/api/sockets.c Compilation of some code is now conditional
depending on configured functionality.
| author | asl |
|---|---|
| date | Thu, 02 Mar 2006 18:28:12 +0000 |
| parents | 16fba4e8c832 |
| children | df4d007af7e8 |
| files | packages/net/lwip_tcpip/current/ChangeLog packages/net/lwip_tcpip/current/cdl/lwip_net.cdl packages/net/lwip_tcpip/current/include/lwip/api.h packages/net/lwip_tcpip/current/include/lwipopts.h packages/net/lwip_tcpip/current/src/api/api_lib.c packages/net/lwip_tcpip/current/src/api/sockets.c packages/net/lwip_tcpip/current/src/ecos/init.c packages/net/lwip_tcpip/current/tests/httpd.c packages/net/lwip_tcpip/current/tests/socket.c packages/net/lwip_tcpip/current/tests/tcpecho.c packages/net/lwip_tcpip/current/tests/udpecho.c |
| diffstat | 11 files changed, 262 insertions(+), 125 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/net/lwip_tcpip/current/ChangeLog +++ b/packages/net/lwip_tcpip/current/ChangeLog @@ -1,3 +1,31 @@ +2006-03-02 Andrew Lunn <andrew.lunn@ascom.ch> + + * cdl/lwip_net.cdl: Add the interfaces CYGPKG_NET_STACK, + CYGPKG_NET_STACK_INET and CYGPKG_NET_STACK_INET6 and say that we + implement a network stack and an IPv4 stack. Without these interfaces + some of the Ethernet device drivers won't be compiled. + +2006-02-24 Uwe Kindler <uwe_kindler@web.de> + + * cdl/lwip_net.cdl: Changed names of configuration options + according to eCos configuration option naming convention in + component writers guide. + * include/lwipopts.h: Changed mapping of eCos configuration + parameters to lwip configuration parameters. The mapping + was wrong because it expected a disabled eCos configuration + option is defined as 0 but a disabled eCos configuration option + is not defined. + * include/lwip/api.h Enumeration values of netconn_type are + defined conditional now to avoid compiler warnings if these + values are not evaluated in a switch statement. + * src/api/api_lib.c Compilation of code in several switch + statements is now conditional depending on configured + functionality. + * src/api/sockets.c Compilation of some code is now conditional + depending on configured functionality. + * src/ecos/init.c Changed initialisation values to match the + new configuration option names. + 2005-10-07 Uwe Kindler <uwe_kindler@web.de> * src/core/tcp_in.c: pbuf_free() assert triggered by
--- a/packages/net/lwip_tcpip/current/cdl/lwip_net.cdl +++ b/packages/net/lwip_tcpip/current/cdl/lwip_net.cdl @@ -52,6 +52,25 @@ cdl_package CYGPKG_NET_LWIP { description "Lightweight TCP/IP stack" requires {(CYGPKG_LWIP_ETH == 1) || (CYGPKG_LWIP_SLIP == 1) || (CYGPKG_LWIP_PPP == 1)} + cdl_interface CYGPKG_NET_STACK { + display "Suitable network stack implementation" + description " + Normally the interface if declared in the net common + package. However LWIP does not use that package + so we declare this interface here. Some of the device + drivers use it to decide if they should be build." + } + cdl_interface CYGPKG_NET_STACK_INET { + display "Network stack support for IPv4" + } + + cdl_interface CYGPKG_NET_STACK_INET6 { + display "Network stack support for IPv6" + } + + implements CYGPKG_NET_STACK + implements CYGPKG_NET_STACK_INET + compile core/mem.c \ core/memp.c \ core/netif.c \ @@ -75,22 +94,22 @@ cdl_package CYGPKG_NET_LWIP { ecos/init.c - cdl_component CYGPKG_LWIP_STATS { - display "Turn ON/OFF statistics" + cdl_option CYGDBG_LWIP_STATS { + display "Maintain traffic statistics" flavor bool default_value 0 description " Check this box to turn ON statistics options for lwIP." } - cdl_component CYGPKG_LWIP_DEBUG { - display "Turn ON/OFF debug options" + cdl_component CYGDBG_LWIP_DEBUG { + display "Support printing debug information" flavor bool default_value 0 description " Check this box to turn ON debug options for lwIP." - cdl_option CYGPKG_LWIP_DEBUG_TCP { + cdl_option CYGDBG_LWIP_DEBUG_TCP { display "Control TCP debug" flavor bool default_value 0 @@ -101,8 +120,8 @@ cdl_package CYGPKG_NET_LWIP { } - cdl_component CYGPKG_LWIP_ASSERTS { - display "Turn ON/OFF assertions" + cdl_option CYGDBG_LWIP_ASSERTS { + display "Enable assertions" flavor bool default_value 0 description " @@ -116,7 +135,7 @@ cdl_package CYGPKG_NET_LWIP { description " See suboptions to define gateway IP, local IP and netmask." - cdl_option CYGPKG_LWIP_SERV_ADDR { + cdl_option CYGDAT_LWIP_SERV_ADDR { display "Gateway IP" flavor data default_value {"192,168,1,1"} @@ -124,7 +143,8 @@ cdl_package CYGPKG_NET_LWIP { Gateway's IP address." } - cdl_option CYGPKG_LWIP_MY_ADDR { + + cdl_option CYGDAT_LWIP_MY_ADDR { display "My IP" flavor data default_value {"192,168,1,222"} @@ -132,7 +152,8 @@ cdl_package CYGPKG_NET_LWIP { The IP address for this device." } - cdl_option CYGPKG_LWIP_NETMASK { + + cdl_option CYGDAT_LWIP_NETMASK { display "Netmask" flavor data default_value {"255,255,255,0"} @@ -149,9 +170,7 @@ cdl_package CYGPKG_NET_LWIP { description " Tunables for various aspects of memory usage throughout the stack." - - - cdl_option CYGPKG_LWIP_MEM_ALIGNMENT { + cdl_option CYGNUM_LWIP_MEM_ALIGNMENT { display "Memory alignment" flavor data default_value 4 @@ -160,16 +179,16 @@ cdl_package CYGPKG_NET_LWIP { lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 byte alignment -> define MEM_ALIGNMENT to 2." } - cdl_option CYGPKG_LWIP_MEM_SIZE { + cdl_option CYGNUM_LWIP_MEM_SIZE { display "Memory size" flavor data default_value 4000 description " MEM_SIZE: the size of the heap memory. If the application will send a lot of data that needs to be copied, this should be set high." - } - cdl_option CYGPKG_LWIP_MEMP_NUM_PBUF { + + cdl_option CYGNUM_LWIP_MEMP_NUM_PBUF { display "Number of memp struct pbufs" flavor data default_value 8 @@ -179,7 +198,7 @@ cdl_package CYGPKG_NET_LWIP { should be set high." } - cdl_option CYGPKG_LWIP_MEMP_NUM_UDP_PCB { + cdl_option CYGNUM_LWIP_MEMP_NUM_UDP_PCB { display "Simultaneous UDP control blocks " flavor data default_value 4 @@ -188,7 +207,7 @@ cdl_package CYGPKG_NET_LWIP { per active UDP 'connection'." } - cdl_option CYGPKG_LWIP_MEMP_NUM_TCP_PCB { + cdl_option CYGNUM_LWIP_MEMP_NUM_TCP_PCB { display "Simultaneous active TCP connections " flavor data default_value 5 @@ -197,7 +216,7 @@ cdl_package CYGPKG_NET_LWIP { connections." } - cdl_option CYGPKG_LWIP_MEMP_NUM_TCP_PCB_LISTEN { + cdl_option CYGNUM_LWIP_MEMP_NUM_TCP_PCB_LISTEN { display "Listening TCP connections" flavor data default_value 8 @@ -206,7 +225,7 @@ cdl_package CYGPKG_NET_LWIP { connections." } - cdl_option CYGPKG_LWIP_MEMP_NUM_TCP_SEG { + cdl_option CYGNUM_LWIP_MEMP_NUM_TCP_SEG { display "Simultaneous TCP segments queued" flavor data default_value 8 @@ -215,7 +234,7 @@ cdl_package CYGPKG_NET_LWIP { segments." } - cdl_option CYGPKG_LWIP_MEMP_NUM_SYS_TIMEOUT { + cdl_option CYGNUM_LWIP_MEMP_NUM_SYS_TIMEOUT { display "Simultaneous active timeouts" flavor data default_value 3 @@ -224,7 +243,7 @@ cdl_package CYGPKG_NET_LWIP { timeouts." } - cdl_component CYGPKG_LWIP_CYGPKG_LWIP_MEM_SEQ_API { + cdl_component CYGPKG_LWIP_MEM_SEQ_API { display "Sequential API settings" flavor none no_define @@ -233,7 +252,7 @@ cdl_package CYGPKG_NET_LWIP { set to 0 if the application only will use the raw API." - cdl_option CYGPKG_LWIP_MEMP_NUM_NETBUF { + cdl_option CYGNUM_LWIP_MEMP_NUM_NETBUF { display "Struct netbufs" flavor data default_value 2 @@ -241,7 +260,7 @@ cdl_package CYGPKG_NET_LWIP { MEMP_NUM_NETBUF: the number of struct netbufs." } - cdl_option CYGPKG_LWIP_MEMP_NUM_NETCONN { + cdl_option CYGNUM_LWIP_MEMP_NUM_NETCONN { display "Struct netconns" flavor data default_value 4 @@ -249,7 +268,7 @@ cdl_package CYGPKG_NET_LWIP { MEMP_NUM_NETCONN: the number of struct netconns." } - cdl_option CYGPKG_LWIP_MEMP_NUM_APIMSG { + cdl_option CYGNUM_LWIP_MEMP_NUM_APIMSG { display "Struct api_msgs" flavor data default_value 8 @@ -259,7 +278,7 @@ cdl_package CYGPKG_NET_LWIP { programs." } - cdl_option CYGPKG_LWIP_MEMP_NUM_TCPIP_MSG { + cdl_option CYGNUM_LWIP_MEMP_NUM_TCPIP_MSG { display "Struct tcpip_msgs" flavor data default_value 8 @@ -281,7 +300,7 @@ cdl_package CYGPKG_NET_LWIP { Packet buffer related tunings." - cdl_option CYGPKG_LWIP_PBUF_POOL_SIZE { + cdl_option CYGNUM_LWIP_PBUF_POOL_SIZE { display "PBUF pool size" flavor data default_value 60 @@ -290,15 +309,15 @@ cdl_package CYGPKG_NET_LWIP { } - cdl_option CYGPKG_LWIP_PBUF_POOL_BUFSIZE { + cdl_option CYGNUM_LWIP_PBUF_POOL_BUFSIZE { display "PBUF buffer size" flavor data default_value 1024 description " PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool." - } - cdl_option CYGPKG_LWIP_PBUF_LINK_HLEN { + + cdl_option CYGNUM_LWIP_PBUF_LINK_HLEN { display "Allocation for a link level header" flavor data calculated {CYGPKG_LWIP_SLIP || CYGPKG_LWIP_PPP ? 0 : 16} @@ -315,7 +334,7 @@ cdl_package CYGPKG_NET_LWIP { description " Tune the TCP protocol details" - cdl_option CYGPKG_LWIP_TCP { + cdl_option CYGFUN_LWIP_TCP { display "Activate TCP" flavor bool default_value 1 @@ -323,38 +342,39 @@ cdl_package CYGPKG_NET_LWIP { } - cdl_option CYGPKG_LWIP_TCPIP_THREAD_PRIORITY { - display "tcpip thread priority" + cdl_option CYGNUM_LWIP_TCPIP_THREAD_PRIORITY { + display "TCP/IP thread priority" flavor data default_value 7 description "Pririty of the lwIP network thread.This thread handles all API messages and network packets." } - cdl_option CYGPKG_LWIP_TCP_TTL { + cdl_option CYGNUM_LWIP_TCP_TTL { display "Time To Live" flavor data default_value 255 description "" } - cdl_option CYGPKG_LWIP_TCP_QUEUE_OOSEQ { + cdl_option CYGIMP_LWIP_TCP_QUEUE_OOSEQ { display "Queue segments" flavor bool default_value 1 description " Controls if TCP should queue segments that arrive out of - order. Define to 0 if your device is low on memory." + order. Disable this option if your device is low on memory." } - cdl_option CYGPKG_LWIP_TCP_MSS { + cdl_option CYGNUM_LWIP_TCP_MSS { display "Maximum segment size" flavor data default_value 2048 description " TCP Maximum segment size." } - cdl_option CYGPKG_LWIP_TCP_SND_BUF { + + cdl_option CYGNUM_LWIP_TCP_SND_BUF { display "Sender buffer space" flavor data default_value 2048 @@ -362,16 +382,16 @@ cdl_package CYGPKG_NET_LWIP { TCP sender buffer space (bytes)." } - cdl_option CYGPKG_LWIP_TCP_SND_QUEUELEN { + cdl_option CYGNUM_LWIP_TCP_SND_QUEUELEN { display "Sender pbufs" flavor data - calculated "4 * CYGPKG_LWIP_TCP_SND_BUF/CYGPKG_LWIP_TCP_MSS" + calculated "4 * CYGNUM_LWIP_TCP_SND_BUF/CYGNUM_LWIP_TCP_MSS" description " TCP sender buffer space (pbufs). This must be at least = 2 * TCP_SND_BUF/TCP_MSS for things to work." } - cdl_option CYGPKG_LWIP_TCP_WND { + cdl_option CYGNUM_LWIP_TCP_WND { display "Receive window" flavor data default_value 4096 @@ -379,7 +399,7 @@ cdl_package CYGPKG_NET_LWIP { TCP receive window." } - cdl_option CYGPKG_LWIP_TCP_MAXRTX { + cdl_option CYGNUM_LWIP_TCP_MAXRTX { display "Segment retransmissions" flavor data default_value 12 @@ -387,7 +407,7 @@ cdl_package CYGPKG_NET_LWIP { Maximum number of retransmissions of data segments." } - cdl_option CYGPKG_LWIP_TCP_SYNMAXRTX { + cdl_option CYGNUM_LWIP_TCP_SYNMAXRTX { display "Syn retransmissions" flavor data default_value 4 @@ -401,7 +421,7 @@ cdl_package CYGPKG_NET_LWIP { flavor none no_define - cdl_option CYGPKG_LWIP_ARP_TABLE_SIZE { + cdl_option CYGNUM_LWIP_ARP_TABLE_SIZE { display "ARP table size" flavor data default_value 10 @@ -415,27 +435,27 @@ cdl_package CYGPKG_NET_LWIP { flavor none no_define - cdl_option CYGPKG_LWIP_IP_FORWARD { - display "IP forwarding" + cdl_option CYGFUN_LWIP_IP_FORWARD { + display "Support IP forwarding" flavor bool default_value 1 description " - Define IP_FORWARD to 1 if you wish to have the ability to forward + Enable this option if you wish to have the ability to forward IP packets across network interfaces. If you are going to run lwIP - on a device with only one network interface, define this to 0." + on a device with only one network interface, disable this option." } - cdl_option CYGPKG_LWIP_IP_OPTIONS { + cdl_option CYGFUN_LWIP_IP_OPTIONS { display "Allow IP options" flavor bool default_value 1 description " - If defined to 1, IP options are allowed (but not parsed). If - defined to 0, all packets with IP options are dropped." + If enabled, IP options are allowed (but not parsed). If + disabled, all packets with IP options are dropped." } - cdl_option CYGPKG_LWIP_IP_FRAG { + cdl_option CYGFUN_LWIP_IP_FRAG { display "Support IP fragmentation" flavor bool default_value 1 @@ -443,7 +463,7 @@ cdl_package CYGPKG_NET_LWIP { " } - cdl_option CYGPKG_LWIP_IP_REASS { + cdl_option CYGFUN_LWIP_IP_REASS { display "Support IP reassembly" flavor bool default_value 1 @@ -458,7 +478,7 @@ cdl_package CYGPKG_NET_LWIP { flavor none no_define - cdl_option CYGPKG_LWIP_ICMP_TTL { + cdl_option CYGNUM_LWIP_ICMP_TTL { display "ICMP Time To Live" flavor data default_value 255 @@ -472,28 +492,28 @@ cdl_package CYGPKG_NET_LWIP { no_define - cdl_option CYGPKG_LWIP_DHCP { + cdl_option CYGFUN_LWIP_DHCP { display "Activate DHCP" flavor bool default_value 0 description " - Define LWIP_DHCP to 1 if you want DHCP configuration of + Enable this option if you want DHCP configuration of interfaces." compile core/dhcp.c } - cdl_option CYGPKG_LWIP_DHCP_DOES_ARP_CHECK { + cdl_option CYGOPT_LWIP_DHCP_DOES_ARP_CHECK { display "Check offered address" flavor bool default_value 0 description " - 1 if you want to do an ARP check on the offered address + Enable this option if you want to do an ARP check on the offered address (recommended)." } } - cdl_component CYGPKG_LWIP_LOOPIF { + cdl_component CYGFUN_LWIP_LOOPIF { display "Support loop interface (127.0.0.1)" flavor bool default_value 1 @@ -508,7 +528,7 @@ cdl_package CYGPKG_NET_LWIP { description "Ethernet support" compile netif/etharp.c - cdl_option CYGPKG_LWIP_ETH_THREAD_PRIORITY { + cdl_option CYGNUM_LWIP_ETH_THREAD_PRIORITY { display "ethernet input thread priority" flavor data default_value 6 @@ -525,14 +545,14 @@ cdl_package CYGPKG_NET_LWIP { description "IP over Serial Line" compile netif/slipif.c ecos/sio.c - cdl_option CYGPKG_LWIP_SLIPIF_THREAD_PRIORITY { + cdl_option CYGNUM_LWIP_SLIPIF_THREAD_PRIORITY { display "SLIP thread priority" flavor data default_value 8 description "Priority of the SLIP input thread" } - cdl_option CYGPKG_LWIP_SLIP_DEV { + cdl_option CYGDAT_LWIP_SLIP_DEV { display "Serial device" flavor data default_value {"\"/dev/ser0\""} @@ -560,21 +580,21 @@ cdl_package CYGPKG_NET_LWIP { ecos/sio.c - cdl_option CYGPKG_LWIP_PPP_PAP_AUTH { + cdl_option CYGIMP_LWIP_PPP_PAP_AUTH { display "Support PAP authentication" flavor bool default_value 1 compile netif/ppp/pap.c } - cdl_option CYGPKG_LWIP_PPP_CHAP_AUTH { + cdl_option CYGIMP_LWIP_PPP_CHAP_AUTH { display "Support CHAP authentication" flavor bool default_value 1 compile netif/ppp/chap.c } - cdl_option CYGPKG_LWIP_PPP_DEV { + cdl_option CYGDAT_LWIP_PPP_DEV { display "Serial device for PPP" flavor data default_value {"\"/dev/ser0\""} @@ -582,7 +602,7 @@ cdl_package CYGPKG_NET_LWIP { Which serial port to use PPP on." } - cdl_option CYGPKG_LWIP_PPP_THREAD_PRIORITY { + cdl_option CYGNUM_LWIP_PPP_THREAD_PRIORITY { display "PPP main thread priority" flavor data default_value 8 @@ -595,7 +615,7 @@ cdl_package CYGPKG_NET_LWIP { flavor none no_define - cdl_option CYGPKG_LWIP_UDP { + cdl_option CYGFUN_LWIP_UDP { display "Activate UDP" flavor bool default_value 1 @@ -603,7 +623,7 @@ cdl_package CYGPKG_NET_LWIP { compile core/udp.c } - cdl_option CYGPKG_LWIP_UDP_TTL { + cdl_option CYGNUM_LWIP_UDP_TTL { display "Time To Live" flavor data default_value 255 @@ -611,7 +631,7 @@ cdl_package CYGPKG_NET_LWIP { } } - cdl_option CYGPKG_LWIP_RAW { + cdl_option CYGFUN_LWIP_RAW { display "Enable RAW socket support" flavor bool default_value 1
--- a/packages/net/lwip_tcpip/current/include/lwip/api.h +++ b/packages/net/lwip_tcpip/current/include/lwip/api.h @@ -48,11 +48,17 @@ #define NETCONN_COPY 0x01 enum netconn_type { +#if LWIP_TCP NETCONN_TCP, +#endif +#if LWIP_UDP NETCONN_UDP, NETCONN_UDPLITE, NETCONN_UDPNOCHKSUM, +#endif +#if LWIP_RAW NETCONN_RAW +#endif }; enum netconn_state {
--- a/packages/net/lwip_tcpip/current/include/lwipopts.h +++ b/packages/net/lwip_tcpip/current/include/lwipopts.h @@ -39,158 +39,209 @@ /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 byte alignment -> define MEM_ALIGNMENT to 2. */ -#define MEM_ALIGNMENT CYGPKG_LWIP_MEM_ALIGNMENT +#define MEM_ALIGNMENT CYGNUM_LWIP_MEM_ALIGNMENT /* MEM_SIZE: the size of the heap memory. If the application will send a lot of data that needs to be copied, this should be set high. */ -#define MEM_SIZE CYGPKG_LWIP_MEM_SIZE +#define MEM_SIZE CYGNUM_LWIP_MEM_SIZE /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application sends a lot of data out of ROM (or other static memory), this should be set high. */ -#define MEMP_NUM_PBUF CYGPKG_LWIP_MEMP_NUM_PBUF +#define MEMP_NUM_PBUF CYGNUM_LWIP_MEMP_NUM_PBUF /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One per active UDP "connection". */ -#define MEMP_NUM_UDP_PCB CYGPKG_LWIP_MEMP_NUM_UDP_PCB +#define MEMP_NUM_UDP_PCB CYGNUM_LWIP_MEMP_NUM_UDP_PCB /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. */ -#define MEMP_NUM_TCP_PCB CYGPKG_LWIP_MEMP_NUM_TCP_PCB +#define MEMP_NUM_TCP_PCB CYGNUM_LWIP_MEMP_NUM_TCP_PCB /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. */ -#define MEMP_NUM_TCP_PCB_LISTEN CYGPKG_LWIP_MEMP_NUM_TCP_PCB_LISTEN +#define MEMP_NUM_TCP_PCB_LISTEN CYGNUM_LWIP_MEMP_NUM_TCP_PCB_LISTEN /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */ -#define MEMP_NUM_TCP_SEG CYGPKG_LWIP_MEMP_NUM_TCP_SEG +#define MEMP_NUM_TCP_SEG CYGNUM_LWIP_MEMP_NUM_TCP_SEG /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. */ -#define MEMP_NUM_SYS_TIMEOUT CYGPKG_LWIP_MEMP_NUM_SYS_TIMEOUT +#define MEMP_NUM_SYS_TIMEOUT CYGNUM_LWIP_MEMP_NUM_SYS_TIMEOUT /* The following four are used only with the sequential API and can be set to 0 if the application only will use the raw API. */ /* MEMP_NUM_NETBUF: the number of struct netbufs. */ -#define MEMP_NUM_NETBUF CYGPKG_LWIP_MEMP_NUM_NETBUF +#define MEMP_NUM_NETBUF CYGNUM_LWIP_MEMP_NUM_NETBUF /* MEMP_NUM_NETCONN: the number of struct netconns. */ -#define MEMP_NUM_NETCONN CYGPKG_LWIP_MEMP_NUM_NETCONN +#define MEMP_NUM_NETCONN CYGNUM_LWIP_MEMP_NUM_NETCONN /* MEMP_NUM_APIMSG: the number of struct api_msg, used for communication between the TCP/IP stack and the sequential programs. */ -#define MEMP_NUM_API_MSG CYGPKG_LWIP_MEMP_NUM_APIMSG +#define MEMP_NUM_API_MSG CYGNUM_LWIP_MEMP_NUM_APIMSG /* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used for sequential API communication and incoming packets. Used in src/api/tcpip.c. */ -#define MEMP_NUM_TCPIP_MSG CYGPKG_LWIP_MEMP_NUM_TCPIP_MSG +#define MEMP_NUM_TCPIP_MSG CYGNUM_LWIP_MEMP_NUM_TCPIP_MSG /* ---------- Pbuf options ---------- */ /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ -#define PBUF_POOL_SIZE CYGPKG_LWIP_PBUF_POOL_SIZE +#define PBUF_POOL_SIZE CYGNUM_LWIP_PBUF_POOL_SIZE /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ -#define PBUF_POOL_BUFSIZE CYGPKG_LWIP_PBUF_POOL_BUFSIZE +#define PBUF_POOL_BUFSIZE CYGNUM_LWIP_PBUF_POOL_BUFSIZE /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a link level header. */ -#define PBUF_LINK_HLEN CYGPKG_LWIP_PBUF_LINK_HLEN +#define PBUF_LINK_HLEN CYGNUM_LWIP_PBUF_LINK_HLEN /* ---------- TCP options ---------- */ -#define LWIP_TCP defined (CYGPKG_LWIP_TCP) -#define TCP_TTL CYGPKG_LWIP_TCP_TTL +#ifdef CYGFUN_LWIP_TCP +#define LWIP_TCP 1 +#else +#define LWIP_TCP 0 +#endif + +#define TCP_TTL CYGNUM_LWIP_TCP_TTL /* Controls if TCP should queue segments that arrive out of order. Define to 0 if your device is low on memory. */ -#define TCP_QUEUE_OOSEQ CYGPKG_LWIP_TCP_QUEUE_OOSEQ +#ifdef CYGIMP_LWIP_TCP_QUEUE_OOSEQ +#define TCP_QUEUE_OOSEQ 1 +#else +#define TCP_QUEUE_OOSEQ 0 +#endif /* TCP Maximum segment size. */ -#define TCP_MSS CYGPKG_LWIP_TCP_MSS +#define TCP_MSS CYGNUM_LWIP_TCP_MSS /* TCP sender buffer space (bytes). */ -#define TCP_SND_BUF CYGPKG_LWIP_TCP_SND_BUF +#define TCP_SND_BUF CYGNUM_LWIP_TCP_SND_BUF #define TCP_SNDLOWAT TCP_SND_BUF/2 /* TCP sender buffer space (pbufs). This must be at least = 2 * TCP_SND_BUF/TCP_MSS for things to work. */ -#define TCP_SND_QUEUELEN CYGPKG_LWIP_TCP_SND_QUEUELEN +#define TCP_SND_QUEUELEN CYGNUM_LWIP_TCP_SND_QUEUELEN /* TCP receive window. */ -#define TCP_WND CYGPKG_LWIP_TCP_WND +#define TCP_WND CYGNUM_LWIP_TCP_WND /* Maximum number of retransmissions of data segments. */ -#define TCP_MAXRTX CYGPKG_LWIP_TCP_MAXRTX +#define TCP_MAXRTX CYGNUM_LWIP_TCP_MAXRTX /* Maximum number of retransmissions of SYN segments. */ -#define TCP_SYNMAXRTX CYGPKG_LWIP_TCP_SYNMAXRTX +#define TCP_SYNMAXRTX CYGNUM_LWIP_TCP_SYNMAXRTX /* ---------- ARP options ---------- */ -#define ARP_TABLE_SIZE CYGPKG_LWIP_ARP_TABLE_SIZE +#define ARP_TABLE_SIZE CYGNUM_LWIP_ARP_TABLE_SIZE /* ---------- IP options ---------- */ /* Define IP_FORWARD to 1 if you wish to have the ability to forward IP packets across network interfaces. If you are going to run lwIP on a device with only one network interface, define this to 0. */ -#define IP_FORWARD CYGPKG_LWIP_IP_FORWARD +#ifdef CYGFUN_LWIP_IP_FORWARD +#define IP_FORWARD 1 +#else +#define IP_FORWARD 0 +#endif /* If defined to 1, IP options are allowed (but not parsed). If defined to 0, all packets with IP options are dropped. */ -#define IP_OPTIONS CYGPKG_LWIP_IP_OPTIONS +#ifdef CYGFUN_LWIP_IP_OPTIONS +#define IP_OPTIONS 1 +#else +#define IP_OPTIONS 0 +#endif /* ---------- ICMP options ---------- */ -#define ICMP_TTL CYGPKG_LWIP_ICMP_TTL +#define ICMP_TTL CYGNUM_LWIP_ICMP_TTL /* ---------- DHCP options ---------- */ /* Define LWIP_DHCP to 1 if you want DHCP configuration of interfaces.*/ -#ifdef CYGPKG_LWIP_DHCP -#define LWIP_DHCP CYGPKG_LWIP_DHCP +#ifdef CYGFUN_LWIP_DHCP + #define LWIP_DHCP 1 /* 1 if you want to do an ARP check on the offered address (recommended). */ -#define DHCP_DOES_ARP_CHECK CYGPKG_LWIP_DHCP_DOES_ARP_CHECK + #ifdef CYGOPT_LWIP_DHCP_DOES_ARP_CHECK + #define DHCP_DOES_ARP_CHECK 1 + #else + #define DHCP_DOES_ARP_CHECK 0 + #endif +#else + #define LWIP_DHCP 0 + #define DHCP_DOES_ARP_CHECK 0 #endif + /* ---------- UDP options ---------- */ -#define LWIP_UDP CYGPKG_LWIP_UDP -#define UDP_TTL CYGPKG_LWIP_UDP_TTL +#ifdef CYGFUN_LWIP_UDP +#define LWIP_UDP 1 +#else +#define LWIP_UDP 0 +#endif +#define UDP_TTL CYGNUM_LWIP_UDP_TTL /* ---------- RAW socket support ---------- */ -#define LWIP_RAW CYGPKG_LWIP_RAW +#ifdef CYGFUN_LWIP_RAW +#define LWIP_RAW 1 +#else +#define LWIP_RAW 0 +#endif /* ---------- SLIP options --------- */ -#define LWIP_SLIP defined(CYGPKG_LWIP_SLIP) -#define SLIP_DEV CYGPKG_LWIP_SLIP_DEV +#ifdef CYGPKG_LWIP_SLIP +#define LWIP_SLIP 1 +#else +#define LWIP_SLIP 0 +#endif +#define SLIP_DEV CYGDAT_LWIP_SLIP_DEV -#define LWIP_HAVE_LOOPIF defined (CYGPKG_LWIP_LOOPIF) +#ifdef CYGFUN_LWIP_LOOPIF +#define LWIP_HAVE_LOOPIF 1 +#else +#define LWIP_HAVE_LOOPIF 0 +#endif /* ---------- PPP options --------- */ -#define PPP_SUPPORT defined(CYGPKG_LWIP_PPP) -#define PPP_DEV CYGPKG_LWIP_PPP_DEV +#ifdef CYGPKG_LWIP_PPP +#define PPP_SUPPORT 1 +#else +#define PPP_SUPPORT 0 +#endif +#define PPP_DEV CYGDAT_LWIP_PPP_DEV #define MD5_SUPPORT 1 -#if defined(CYGPKG_LWIP_PPP_PAP_AUTH) +#ifdef CYGIMP_LWIP_PPP_PAP_AUTH #define PAP_SUPPORT 1 #else #define PAP_SUPPORT 0 #endif -#if defined(CYGPKG_LWIP_PPP_CHAP_AUTH) +#ifdef CYGIMP_LWIP_PPP_CHAP_AUTH #define CHAP_SUPPORT 1 #else #define CHAP_SUPPORT 0 #endif /* ------- Thread priorities ---------------*/ -#define TCPIP_THREAD_PRIO CYGPKG_LWIP_TCPIP_THREAD_PRIORITY -#define SLIPIF_THREAD_PRIO CYGPKG_LWIP_SLIPIF_THREAD_PRIORITY -#define PPP_THREAD_PRIO CYGPKG_LWIP_PPP_THREAD_PRIORITY +#define TCPIP_THREAD_PRIO CYGNUM_LWIP_TCPIP_THREAD_PRIORITY +#define SLIPIF_THREAD_PRIO CYGNUM_LWIP_SLIPIF_THREAD_PRIORITY +#define PPP_THREAD_PRIO CYGNUM_LWIP_PPP_THREAD_PRIORITY + + /* ---------- Statistics options ---------- */ -#define LWIP_STATS defined(CYGPKG_LWIP_STATS) +#ifdef CYGDBG_LWIP_STATS +#define LWIP_STATS 1 +#else +#define LWIP_STATS 0 +#endif /* ---------- Debug options ---------- */ -#if !defined(CYGPKG_LWIP_ASSERTS) +#if !defined(CYGDBG_LWIP_ASSERTS) #define LWIP_NOASSERT #endif -#if defined(CYGPKG_LWIP_DEBUG) +#if defined(CYGDBG_LWIP_DEBUG) #define LWIP_DEBUG #define MEM_DEBUG DBG_ON #define MEMP_DEBUG DBG_ON
--- a/packages/net/lwip_tcpip/current/src/api/api_lib.c +++ b/packages/net/lwip_tcpip/current/src/api/api_lib.c @@ -321,9 +321,12 @@ netconn_peer(struct netconn *conn, struc u16_t *port) { switch (conn->type) { +#if LWIP_RAW case NETCONN_RAW: /* return an error as connecting is only a helper for upper layers */ return ERR_CONN; +#endif +#if LWIP_UDP case NETCONN_UDPLITE: case NETCONN_UDPNOCHKSUM: case NETCONN_UDP: @@ -333,12 +336,15 @@ netconn_peer(struct netconn *conn, struc *addr = (conn->pcb.udp->remote_ip); *port = conn->pcb.udp->remote_port; break; +#endif +#if LWIP_TCP case NETCONN_TCP: if (conn->pcb.tcp == NULL) return ERR_CONN; *addr = (conn->pcb.tcp->remote_ip); *port = conn->pcb.tcp->remote_port; break; +#endif } return (conn->err = ERR_OK); } @@ -348,20 +354,26 @@ netconn_addr(struct netconn *conn, struc u16_t *port) { switch (conn->type) { +#if LWIP_RAW case NETCONN_RAW: *addr = &(conn->pcb.raw->local_ip); *port = conn->pcb.raw->protocol; break; +#endif +#if LWIP_UDP case NETCONN_UDPLITE: case NETCONN_UDPNOCHKSUM: case NETCONN_UDP: *addr = &(conn->pcb.udp->local_ip); *port = conn->pcb.udp->local_port; break; +#endif +#if LWIP_TCP case NETCONN_TCP: *addr = &(conn->pcb.tcp->local_ip); *port = conn->pcb.tcp->local_port; break; +#endif } return (conn->err = ERR_OK); }
--- a/packages/net/lwip_tcpip/current/src/api/sockets.c +++ b/packages/net/lwip_tcpip/current/src/api/sockets.c @@ -460,7 +460,6 @@ int lwip_send(int s, void *data, int size, unsigned int flags) { struct lwip_socket *sock; - struct netbuf *buf; err_t err; LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_send(%d, data=%p, size=%d, flags=0x%x)\n", s, data, size, flags)); @@ -472,10 +471,15 @@ lwip_send(int s, void *data, int size, u } switch (netconn_type(sock->conn)) { +#if LWIP_RAW case NETCONN_RAW: +#endif +#if LWIP_UDP case NETCONN_UDP: case NETCONN_UDPLITE: case NETCONN_UDPNOCHKSUM: + { + struct netbuf *buf; /* create a buffer */ buf = netbuf_new(); @@ -494,10 +498,14 @@ lwip_send(int s, void *data, int size, u /* deallocated the buffer */ netbuf_delete(buf); + } break; +#endif +#if LWIP_TCP case NETCONN_TCP: err = netconn_write(sock->conn, data, size, NETCONN_COPY); break; +#endif default: err = ERR_ARG; break; @@ -559,18 +567,24 @@ lwip_socket(int domain, int type, int pr /* create a netconn */ switch (type) { +#if LWIP_RAW case SOCK_RAW: conn = netconn_new_with_proto_and_callback(NETCONN_RAW, protocol, event_callback); LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_RAW, %d) = ", domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol)); break; +#endif +#if LWIP_UDP case SOCK_DGRAM: conn = netconn_new_with_callback(NETCONN_UDP, event_callback); LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_DGRAM, %d) = ", domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol)); break; +#endif +#if LWIP_TCP case SOCK_STREAM: conn = netconn_new_with_callback(NETCONN_TCP, event_callback); LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_STREAM, %d) = ", domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol)); break; +#endif default: LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%d, %d/UNKNOWN, %d) = -1\n", domain, type, protocol)); set_errno(EINVAL); @@ -1091,17 +1105,23 @@ int lwip_getsockopt (int s, int level, i case SO_TYPE: switch (sock->conn->type) { +#if LWIP_RAW case NETCONN_RAW: *(int*)optval = SOCK_RAW; break; +#endif +#if LWIP_TCP case NETCONN_TCP: *(int*)optval = SOCK_STREAM; break; +#endif +#if LWIP_UDP case NETCONN_UDP: case NETCONN_UDPLITE: case NETCONN_UDPNOCHKSUM: *(int*)optval = SOCK_DGRAM; break; +#endif default: /* unrecognized socket type */ *(int*)optval = sock->conn->type; LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, SO_TYPE): unrecognized socket type %d\n", s, *(int *)optval));
--- a/packages/net/lwip_tcpip/current/src/ecos/init.c +++ b/packages/net/lwip_tcpip/current/src/ecos/init.c @@ -174,9 +174,9 @@ lwip_set_addr(struct netif *netif) { struct ip_addr ipaddr, netmask, gw; - IP_ADDR(&gw, CYGPKG_LWIP_SERV_ADDR); - IP_ADDR(&ipaddr, CYGPKG_LWIP_MY_ADDR); - IP_ADDR(&netmask, CYGPKG_LWIP_NETMASK); + IP_ADDR(&gw, CYGDAT_LWIP_SERV_ADDR); + IP_ADDR(&ipaddr, CYGDAT_LWIP_MY_ADDR); + IP_ADDR(&netmask, CYGDAT_LWIP_NETMASK); netif_set_addr(netif, &ipaddr, &netmask, &gw); netif->next = netif_list; netif_list = netif; @@ -253,7 +253,7 @@ ecosglue_init(void) { cyg_semaphore_init(&delivery, 0); init_hw_drivers(); - sys_thread_new(input_thread, (void*)0, CYGPKG_LWIP_ETH_THREAD_PRIORITY); + sys_thread_new(input_thread, (void*)0, CYGNUM_LWIP_ETH_THREAD_PRIORITY); etharp_init(); sys_timeout(ARP_TMR_INTERVAL, (sys_timeout_handler) arp_timer, NULL); }
--- a/packages/net/lwip_tcpip/current/tests/httpd.c +++ b/packages/net/lwip_tcpip/current/tests/httpd.c @@ -250,7 +250,7 @@ tmain(cyg_addrword_t p) sys_thread_new(httpd_init, (void*)"httpd",7); } -#define STACK_SIZE 0x1000 +#define STACK_SIZE 0x4000 static char stack[STACK_SIZE]; static cyg_thread thread_data; static cyg_handle_t thread_handle;
--- a/packages/net/lwip_tcpip/current/tests/socket.c +++ b/packages/net/lwip_tcpip/current/tests/socket.c @@ -68,7 +68,7 @@ tmain(cyg_addrword_t p) sys_thread_new(socket_thread, (void*)"socket",7); } -#define STACK_SIZE 0x1000 +#define STACK_SIZE 0x4000 static char stack[STACK_SIZE]; static cyg_thread thread_data; static cyg_handle_t thread_handle;
--- a/packages/net/lwip_tcpip/current/tests/tcpecho.c +++ b/packages/net/lwip_tcpip/current/tests/tcpecho.c @@ -82,7 +82,7 @@ tmain(cyg_addrword_t p) sys_thread_new(tcpecho_thread, (void*)"tcpecho",7); } -#define STACK_SIZE 0x1000 +#define STACK_SIZE 0x4000 static char stack[STACK_SIZE]; static cyg_thread thread_data; static cyg_handle_t thread_handle;
--- a/packages/net/lwip_tcpip/current/tests/udpecho.c +++ b/packages/net/lwip_tcpip/current/tests/udpecho.c @@ -65,7 +65,7 @@ void tmain(cyg_addrword_t p) sys_thread_new(udpecho_thread, (void*)"udpecho",7); } -#define STACK_SIZE 0x1000 +#define STACK_SIZE 0x4000 static char stack[STACK_SIZE]; static cyg_thread thread_data; static cyg_handle_t thread_handle;
