This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

lwIP configuration option patch


Hello,

the following patch fixes wrong mapping of lwIP eCos configuration options to lwIP stack configuration options. The lwIP stack uses
#if CONFIG_OPTION instead of #ifdef CONFIG_OPTION to check if a part of code need to be compiled. So a configuration option should be 0 or 1. But if a configuration option in CDL file is disabled, then it is not 0 but it is simply not defined and the check #if CONFIG_OPTION fails.


Uwe

--

cetoni GmbH
Am Wiesenring 6
D-07554 Korbussen

Tel.: +49 (0) 36602 338 28
Fax:  +49 (0) 36602 338 11
uwe.kindler@cetoni.de
www.cetoni.de
diff -rubx 'Entries*' ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/ChangeLog ecos/ecos/packages/net/lwip_tcpip/current/ChangeLog
--- ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/ChangeLog	2005-11-07 17:33:15.000000000 +0100
+++ ecos/ecos/packages/net/lwip_tcpip/current/ChangeLog	2006-02-26 12:08:59.000000000 +0100
@@ -1,3 +1,24 @@
+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 
diff -rubx 'Entries*' ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/cdl/lwip_net.cdl ecos/ecos/packages/net/lwip_tcpip/current/cdl/lwip_net.cdl
--- ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/cdl/lwip_net.cdl	2004-05-04 14:32:32.000000000 +0200
+++ ecos/ecos/packages/net/lwip_tcpip/current/cdl/lwip_net.cdl	2006-02-17 23:09:07.000000000 +0100
@@ -75,22 +75,22 @@
 		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 +101,8 @@
 		
 	}
 
-	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 +116,7 @@
 		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 +124,8 @@
 				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 +133,8 @@
 				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 +151,7 @@
 		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 +160,16 @@
 				 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 +179,7 @@
 				 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 +188,7 @@
 				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 +197,7 @@
 				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 +206,7 @@
 				 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 +215,7 @@
 				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 +224,7 @@
 				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 +233,7 @@
   			        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 +241,7 @@
 					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 +249,7 @@
 					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 +259,7 @@
 					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 +281,7 @@
 		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 +290,15 @@
 	
 		}
 		
-		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 +315,7 @@
 		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 +323,39 @@
 
 		}
 		
-		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 +363,16 @@
 				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 +380,7 @@
 				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 +388,7 @@
 				 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 +402,7 @@
 		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 +416,27 @@
 		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 +444,7 @@
 			"	
 		}
 
-		cdl_option CYGPKG_LWIP_IP_REASS {
+		cdl_option CYGFUN_LWIP_IP_REASS {
 			display		"Support IP reassembly"
 			flavor		bool
 			default_value 	1
@@ -458,7 +459,7 @@
 		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 +473,28 @@
 		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 +509,7 @@
 		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 +526,14 @@
 		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 +561,21 @@
 			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 +583,7 @@
 			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 +596,7 @@
 		flavor		none
 		no_define
 
-		cdl_option CYGPKG_LWIP_UDP {
+		cdl_option CYGFUN_LWIP_UDP {
 			display		"Activate UDP"
 			flavor		bool
 			default_value 	1
@@ -603,7 +604,7 @@
 			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 +612,7 @@
 		}
 	}
 	
-	cdl_option CYGPKG_LWIP_RAW {
+	cdl_option CYGFUN_LWIP_RAW {
 		display		"Enable RAW socket support"
 		flavor		bool
 		default_value 	1
diff -rubx 'Entries*' ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/include/lwip/api.h ecos/ecos/packages/net/lwip_tcpip/current/include/lwip/api.h
--- ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/include/lwip/api.h	2004-05-04 14:32:32.000000000 +0200
+++ ecos/ecos/packages/net/lwip_tcpip/current/include/lwip/api.h	2006-02-17 23:22:36.000000000 +0100
@@ -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 {
diff -rubx 'Entries*' ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/include/lwipopts.h ecos/ecos/packages/net/lwip_tcpip/current/include/lwipopts.h
--- ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/include/lwipopts.h	2004-05-04 14:32:32.000000000 +0200
+++ ecos/ecos/packages/net/lwip_tcpip/current/include/lwipopts.h	2006-02-17 23:07:13.000000000 +0100
@@ -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
diff -rubx 'Entries*' ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/src/api/api_lib.c ecos/ecos/packages/net/lwip_tcpip/current/src/api/api_lib.c
--- ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/src/api/api_lib.c	2004-05-04 14:32:33.000000000 +0200
+++ ecos/ecos/packages/net/lwip_tcpip/current/src/api/api_lib.c	2006-02-17 23:26:53.000000000 +0100
@@ -321,9 +321,12 @@
        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 @@
     *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 @@
        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);
 }
diff -rubx 'Entries*' ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/src/api/sockets.c ecos/ecos/packages/net/lwip_tcpip/current/src/api/sockets.c
--- ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/src/api/sockets.c	2004-05-04 14:32:33.000000000 +0200
+++ ecos/ecos/packages/net/lwip_tcpip/current/src/api/sockets.c	2006-02-17 23:37:53.000000000 +0100
@@ -460,7 +460,6 @@
 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 @@
   }
 
   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 @@
 
     /* 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 @@
 
   /* 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 @@
 
     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));
diff -rubx 'Entries*' ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/src/ecos/init.c ecos/ecos/packages/net/lwip_tcpip/current/src/ecos/init.c
--- ecos_web_cvs/ecos/packages/net/lwip_tcpip/current/src/ecos/init.c	2005-11-07 17:33:15.000000000 +0100
+++ ecos/ecos/packages/net/lwip_tcpip/current/src/ecos/init.c	2006-02-17 23:16:00.000000000 +0100
@@ -174,9 +174,9 @@
 {
 	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 @@
 {
   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);
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]