From 7d0ab3975a124b6c8d96330e39b5d0eaeee7dd43 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 24 Jun 2014 08:53:28 -0600 Subject: Move include/nuttx/net/uipopt.h to include/nuttx/net/netconfig.h --- apps/examples/thttpd/content/netstat/netstat.c | 2 +- apps/include/netutils/dnsclient.h | 2 +- apps/include/netutils/smtp.h | 2 +- apps/include/netutils/uiplib.h | 2 +- apps/netutils/tftpc/tftpc_get.c | 2 +- apps/netutils/tftpc/tftpc_internal.h | 2 +- apps/netutils/tftpc/tftpc_packets.c | 2 +- apps/netutils/tftpc/tftpc_put.c | 2 +- apps/netutils/webserver/httpd.h | 2 +- nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c | 2 +- nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c | 2 +- nuttx/fs/nfs/nfs_vfsops.c | 2 +- nuttx/include/nuttx/net/arp.h | 2 +- nuttx/include/nuttx/net/netconfig.h | 325 ++++++++++++++++++++++++ nuttx/include/nuttx/net/uip/uip-arch.h | 2 +- nuttx/include/nuttx/net/uip/uip-icmp.h | 2 +- nuttx/include/nuttx/net/uip/uip-pkt.h | 2 +- nuttx/include/nuttx/net/uip/uip-tcp.h | 2 +- nuttx/include/nuttx/net/uip/uip-udp.h | 2 +- nuttx/include/nuttx/net/uip/uip.h | 2 +- nuttx/include/nuttx/net/uip/uipopt.h | 332 ------------------------- nuttx/net/arp/arp_inout.c | 2 +- nuttx/net/arp/arp_table.c | 2 +- nuttx/net/arp/arp_timer.c | 2 +- nuttx/net/icmp/icmp_input.c | 2 +- nuttx/net/icmp/icmp_ping.c | 2 +- nuttx/net/icmp/icmp_poll.c | 2 +- nuttx/net/icmp/icmp_send.c | 2 +- nuttx/net/igmp/igmp_input.c | 2 +- nuttx/net/igmp/igmp_join.c | 2 +- nuttx/net/igmp/igmp_leave.c | 2 +- nuttx/net/igmp/igmp_mcastmac.c | 2 +- nuttx/net/igmp/igmp_msg.c | 2 +- nuttx/net/igmp/igmp_poll.c | 2 +- nuttx/net/igmp/igmp_send.c | 2 +- nuttx/net/igmp/igmp_timer.c | 2 +- nuttx/net/pkt/pkt_callback.c | 2 +- nuttx/net/pkt/pkt_conn.c | 2 +- nuttx/net/pkt/pkt_poll.c | 2 +- nuttx/net/tcp/tcp_appsend.c | 2 +- nuttx/net/tcp/tcp_backlog.c | 2 +- nuttx/net/tcp/tcp_callback.c | 2 +- nuttx/net/tcp/tcp_conn.c | 2 +- nuttx/net/tcp/tcp_input.c | 2 +- nuttx/net/tcp/tcp_listen.c | 2 +- nuttx/net/tcp/tcp_poll.c | 2 +- nuttx/net/tcp/tcp_readahead.c | 2 +- nuttx/net/tcp/tcp_send.c | 2 +- nuttx/net/tcp/tcp_seqno.c | 2 +- nuttx/net/tcp/tcp_timer.c | 2 +- nuttx/net/tcp/tcp_wrbuffer.c | 2 +- nuttx/net/udp/udp_callback.c | 2 +- nuttx/net/udp/udp_conn.c | 2 +- nuttx/net/udp/udp_input.c | 2 +- nuttx/net/udp/udp_poll.c | 2 +- nuttx/net/udp/udp_send.c | 2 +- nuttx/net/uip/uip_callback.c | 2 +- nuttx/net/uip/uip_chksum.c | 2 +- nuttx/net/uip/uip_input.c | 2 +- nuttx/net/uip/uip_poll.c | 2 +- 60 files changed, 383 insertions(+), 390 deletions(-) create mode 100644 nuttx/include/nuttx/net/netconfig.h delete mode 100644 nuttx/include/nuttx/net/uip/uipopt.h diff --git a/apps/examples/thttpd/content/netstat/netstat.c b/apps/examples/thttpd/content/netstat/netstat.c index 9aec0c81c..dda7dfb2d 100644 --- a/apps/examples/thttpd/content/netstat/netstat.c +++ b/apps/examples/thttpd/content/netstat/netstat.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include /**************************************************************************** diff --git a/apps/include/netutils/dnsclient.h b/apps/include/netutils/dnsclient.h index 6f6cbd035..c4639f908 100644 --- a/apps/include/netutils/dnsclient.h +++ b/apps/include/netutils/dnsclient.h @@ -44,7 +44,7 @@ * Included Files ****************************************************************************/ -#include +#include #include diff --git a/apps/include/netutils/smtp.h b/apps/include/netutils/smtp.h index 1bb0cc16f..5392babc2 100644 --- a/apps/include/netutils/smtp.h +++ b/apps/include/netutils/smtp.h @@ -44,7 +44,7 @@ * Included Files ****************************************************************************/ -#include +#include #include /**************************************************************************** diff --git a/apps/include/netutils/uiplib.h b/apps/include/netutils/uiplib.h index 9d13ed3ff..a89db4fdd 100644 --- a/apps/include/netutils/uiplib.h +++ b/apps/include/netutils/uiplib.h @@ -56,7 +56,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/apps/netutils/tftpc/tftpc_get.c b/apps/netutils/tftpc/tftpc_get.c index 697021d95..0c92f4a73 100644 --- a/apps/netutils/tftpc/tftpc_get.c +++ b/apps/netutils/tftpc/tftpc_get.c @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include diff --git a/apps/netutils/tftpc/tftpc_internal.h b/apps/netutils/tftpc/tftpc_internal.h index f689ce176..1a9601c63 100644 --- a/apps/netutils/tftpc/tftpc_internal.h +++ b/apps/netutils/tftpc/tftpc_internal.h @@ -47,7 +47,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/apps/netutils/tftpc/tftpc_packets.c b/apps/netutils/tftpc/tftpc_packets.c index 7d172e659..d1e41f2d4 100644 --- a/apps/netutils/tftpc/tftpc_packets.c +++ b/apps/netutils/tftpc/tftpc_packets.c @@ -51,7 +51,7 @@ #include -#include +#include #include #include diff --git a/apps/netutils/tftpc/tftpc_put.c b/apps/netutils/tftpc/tftpc_put.c index 76ef18a8c..e04a5dc43 100644 --- a/apps/netutils/tftpc/tftpc_put.c +++ b/apps/netutils/tftpc/tftpc_put.c @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include diff --git a/apps/netutils/webserver/httpd.h b/apps/netutils/webserver/httpd.h index dbe3d0e20..a20b7f077 100644 --- a/apps/netutils/webserver/httpd.h +++ b/apps/netutils/webserver/httpd.h @@ -46,7 +46,7 @@ #include #include -#include +#include /**************************************************************************** * Public Types diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c index 60dee4a8e..cea75f4ab 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c b/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c index 5af9e7452..de34dc2d7 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -56,7 +56,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/fs/nfs/nfs_vfsops.c b/nuttx/fs/nfs/nfs_vfsops.c index 6da88bb2c..0051184e1 100644 --- a/nuttx/fs/nfs/nfs_vfsops.c +++ b/nuttx/fs/nfs/nfs_vfsops.c @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include #include diff --git a/nuttx/include/nuttx/net/arp.h b/nuttx/include/nuttx/net/arp.h index e0fea967d..c64471ce5 100644 --- a/nuttx/include/nuttx/net/arp.h +++ b/nuttx/include/nuttx/net/arp.h @@ -51,7 +51,7 @@ #include #include -#include +#include #include /**************************************************************************** diff --git a/nuttx/include/nuttx/net/netconfig.h b/nuttx/include/nuttx/net/netconfig.h new file mode 100644 index 000000000..ab2135ee4 --- /dev/null +++ b/nuttx/include/nuttx/net/netconfig.h @@ -0,0 +1,325 @@ +/**************************************************************************** + * include/nuttx/net/netconfig.h + * Configuration options for NuttX uIP-based networking. + * + * This file is used for tweaking various configuration options for + * uIP. This is most assuring the correct default values are provided and + * that configured options are valid. + * + * Note: Network configuration options the netconfig.h should not be changed, + * but rather the per-project defconfig file. + * + * Copyright (C) 2007, 2011, 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * This logic was leveraged from uIP which also has a BSD-style license: + * + * Author: Adam Dunkels + * Copyright (c) 2001-2003, Adam Dunkels. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_NET_NETCONFG_H +#define __INCLUDE_NUTTX_NET_NETCONFG_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Public Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Type Definitions + ****************************************************************************/ + +/* Layer 2 Configuration Options ********************************************/ + +/* The default data link layer for uIP is Ethernet. If CONFIG_NET_SLIP is + * defined in the NuttX header file, then SLIP will be supported. The basic + * differences between the SLIP and Ethernet configurations is that when SLIP + * is selected: + * + * - The link level header (that comes before the IP header) is omitted. + * - All MAC address processing is suppressed. + * - ARP is disabled. + * + * If CONFIG_NET_SLIP is not supported, then Ethernet will be used (there is + * no need to define anything special in the configuration file to use + * Ethernet -- it is the default). + * + * The "link level header" is the offset into the d_buf where the IP header + * can be found. For Ethernet, this should be set to 14. For SLIP, this + * should be set to 0. + */ + +#undef CONFIG_NET_ETHERNET +#undef CONFIG_NET_ARP + +#ifdef CONFIG_NET_SLIP +# ifdef CONFIG_NET_IPv6 +# error "SLIP is not implemented for IPv6" +# endif +# define UIP_LLH_LEN 0 +#else +# define CONFIG_NET_ETHERNET 1 +# define CONFIG_NET_ARP 1 +# define UIP_LLH_LEN 14 +#endif + +/* Layer 3/4 Configuration Options ******************************************/ + +/* IP configuration options */ + +/* The IP TTL (time to live) of IP packets sent by uIP. + * + * This should normally not be changed. + */ + +#define UIP_TTL 64 + +/* Turn on support for IP packet reassembly. + * + * uIP supports reassembly of fragmented IP packets. This features + * requires an additonal amount of RAM to hold the reassembly buffer + * and the reassembly code size is approximately 700 bytes. The + * reassembly buffer is of the same size as the d_buf buffer + * (configured by CONFIG_NET_BUFSIZE). + * + * Note: IP packet reassembly is not heavily tested. + */ + +#define UIP_REASSEMBLY 0 + +/* The maximum time an IP fragment should wait in the reassembly + * buffer before it is dropped. Units are deci-seconds, the range + * of the timer is 8-bits. + */ + +#define UIP_REASS_MAXAGE (20*10) /* 20 seconds */ + +/* Network drivers often receive packets with garbage at the end + * and are longer than the size of packet in the TCP header. The + * following "fudge" factor increases the size of the I/O buffering + * by a small amount to allocate slightly oversize packets. After + * receipt, the packet size will be chopped down to the size indicated + * in the TCP header. + */ + +#ifndef CONFIG_NET_GUARDSIZE +# define CONFIG_NET_GUARDSIZE 2 +#endif + +/* ICMP configuration options */ + +#if !defined(CONFIG_NET_ICMP) || defined(CONFIG_DISABLE_CLOCK) +# undef CONFIG_NET_ICMP_PING +#endif + +/* UDP configuration options */ + +/* The maximum amount of concurrent UDP connection, Default: 10 */ + +#ifndef CONFIG_NET_UDP_CONNS +# ifdef CONFIG_NET_UDP +# define CONFIG_NET_UDP_CONNS 10 +# else +# define CONFIG_NET_UDP_CONNS 0 +# endif +#endif + +/* The UDP maximum packet size. This is should not be to set to more + * than CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_IPUDPH_LEN. + */ + +#define UIP_UDP_MSS (CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_IPUDPH_LEN) + +/* TCP configuration options */ + +/* The maximum number of simultaneously open TCP connections. + * + * Since the TCP connections are statically allocated, turning this + * configuration knob down results in less RAM used. Each TCP + * connection requires approximatly 30 bytes of memory. + */ + +#ifndef CONFIG_NET_TCP_CONNS +# ifdef CONFIG_NET_TCP +# define CONFIG_NET_TCP_CONNS 10 +# else +# define CONFIG_NET_TCP_CONNS 0 +# endif +#endif + +/* The maximum number of simultaneously listening TCP ports. + * + * Each listening TCP port requires 2 bytes of memory. + */ + +#ifndef CONFIG_NET_MAX_LISTENPORTS +# define CONFIG_NET_MAX_LISTENPORTS 20 +#endif + +/* Define the maximum number of concurrently active UDP and TCP + * ports. This number must be greater than the number of open + * sockets in order to support multi-threaded read/write operations. + */ + +#ifndef CONFIG_NET_NACTIVESOCKETS +# define CONFIG_NET_NACTIVESOCKETS (CONFIG_NET_TCP_CONNS + CONFIG_NET_UDP_CONNS) +#endif + +/* The initial retransmission timeout counted in timer pulses. + * + * This should not be changed. + */ + +#define UIP_RTO 3 + +/* The maximum number of times a segment should be retransmitted + * before the connection should be aborted. + * + * This should not be changed. + */ + +#define UIP_MAXRTX 8 + +/* The maximum number of times a SYN segment should be retransmitted + * before a connection request should be deemed to have been + * unsuccessful. + * + * This should not need to be changed. + */ + +#define UIP_MAXSYNRTX 5 + +/* The TCP maximum segment size. This is should not be set to more + * than CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN. + */ + +#define UIP_TCP_MSS (CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) + +/* The size of the advertised receiver's window. + * + * Should be set low (i.e., to the size of the d_buf buffer) is the + * application is slow to process incoming data, or high (32768 bytes) + * if the application processes data quickly. + */ + +#ifndef CONFIG_NET_RECEIVE_WINDOW +# define CONFIG_NET_RECEIVE_WINDOW UIP_TCP_MSS +#endif + +/* How long a connection should stay in the TIME_WAIT state. + * + * This configiration option has no real implication, and it should be + * left untouched. Units: half second. + */ + +#define UIP_TIME_WAIT_TIMEOUT (60*2) + +/* ARP configuration options */ + +/* The size of the ARP table. + * + * This option should be set to a larger value if this uIP node will + * have many connections from the local network. + */ + +#ifndef CONFIG_NET_ARPTAB_SIZE +# define CONFIG_NET_ARPTAB_SIZE 8 +#endif + +/* The maxium age of ARP table entries measured in 10ths of seconds. + * + * An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD + * default). + */ + +#define UIP_ARP_MAXAGE 120 + +/* General configuration options */ + +/* The size of the uIP packet buffer. + * + * The uIP packet buffer should not be smaller than 60 bytes, and does + * not need to be larger than 1500 bytes. Lower size results in lower + * TCP throughput, larger size results in higher TCP throughput. + */ + +#ifndef CONFIG_NET_BUFSIZE +# define CONFIG_NET_BUFSIZE 400 +#endif + +#ifdef CONFIG_NET_TCP_READAHEAD + /* Number of TCP read-ahead buffers */ + +# ifndef CONFIG_NET_NTCP_READAHEAD_BUFFERS +# define CONFIG_NET_NTCP_READAHEAD_BUFFERS 4 +# endif + + /* The size of one TCP read buffer */ + +# ifndef CONFIG_NET_TCP_READAHEAD_BUFSIZE +# define CONFIG_NET_TCP_READAHEAD_BUFSIZE UIP_TCP_MSS +# endif + +#else +# undef CONFIG_NET_TCP_READAHEAD_BUFSIZE +# undef CONFIG_NET_NTCP_READAHEAD_BUFFERS +#endif + +/* Delay after receive to catch a following packet. No delay should be + * required if TCP/IP read-ahead buffering is enabled. + */ + +#ifndef CONFIG_NET_TCP_RECVDELAY +# ifdef CONFIG_NET_TCP_READAHEAD +# define CONFIG_NET_TCP_RECVDELAY 0 +# else +# define CONFIG_NET_TCP_RECVDELAY 5 +# endif +#endif + +/**************************************************************************** + * Public Type Definitions + ****************************************************************************/ + +/* Statistics datatype + * + * This typedef defines the dataype used for keeping statistics in + * uIP. + */ + +typedef uint16_t uip_stats_t; + +#endif /* __INCLUDE_NUTTX_NET_NETCONFG_H */ diff --git a/nuttx/include/nuttx/net/uip/uip-arch.h b/nuttx/include/nuttx/net/uip/uip-arch.h index 905af0c50..546fe4451 100644 --- a/nuttx/include/nuttx/net/uip/uip-arch.h +++ b/nuttx/include/nuttx/net/uip/uip-arch.h @@ -57,7 +57,7 @@ # include #endif -#include +#include #include /**************************************************************************** diff --git a/nuttx/include/nuttx/net/uip/uip-icmp.h b/nuttx/include/nuttx/net/uip/uip-icmp.h index 27098d5d3..849d62af0 100644 --- a/nuttx/include/nuttx/net/uip/uip-icmp.h +++ b/nuttx/include/nuttx/net/uip/uip-icmp.h @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/include/nuttx/net/uip/uip-pkt.h b/nuttx/include/nuttx/net/uip/uip-pkt.h index 2580b5be6..1a5f2db4a 100644 --- a/nuttx/include/nuttx/net/uip/uip-pkt.h +++ b/nuttx/include/nuttx/net/uip/uip-pkt.h @@ -47,7 +47,7 @@ #include #include -#include +#include /**************************************************************************** * Public Type Definitions diff --git a/nuttx/include/nuttx/net/uip/uip-tcp.h b/nuttx/include/nuttx/net/uip/uip-tcp.h index b1e0fac2f..a019f70b0 100644 --- a/nuttx/include/nuttx/net/uip/uip-tcp.h +++ b/nuttx/include/nuttx/net/uip/uip-tcp.h @@ -55,7 +55,7 @@ #include #include -#include +#include #include /**************************************************************************** diff --git a/nuttx/include/nuttx/net/uip/uip-udp.h b/nuttx/include/nuttx/net/uip/uip-udp.h index 5eb7f1711..9cdfb3fe7 100644 --- a/nuttx/include/nuttx/net/uip/uip-udp.h +++ b/nuttx/include/nuttx/net/uip/uip-udp.h @@ -52,7 +52,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/include/nuttx/net/uip/uip.h b/nuttx/include/nuttx/net/uip/uip.h index 65f05a5ec..260082795 100644 --- a/nuttx/include/nuttx/net/uip/uip.h +++ b/nuttx/include/nuttx/net/uip/uip.h @@ -60,7 +60,7 @@ #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/include/nuttx/net/uip/uipopt.h b/nuttx/include/nuttx/net/uip/uipopt.h deleted file mode 100644 index fb85b4ad7..000000000 --- a/nuttx/include/nuttx/net/uip/uipopt.h +++ /dev/null @@ -1,332 +0,0 @@ -/**************************************************************************** - * include/nuttx/net/uip/uipopt.h - * Configuration options for uIP. - * - * This file is used for tweaking various configuration options for - * uIP. You should make a copy of this file into one of your project's - * directories instead of editing this example "uipopt.h" file that - * comes with the uIP distribution. - * - * uIP is configured using the per-project configuration file - * uipopt.h. This file contains all compile-time options for uIP and - * should be tweaked to match each specific project. The uIP - * distribution contains a documented example "uipopt.h" that can be - * copied and modified for each project. - * - * Note: Most of the configuration options in the uipopt.h should not - * be changed, but rather the per-project defconfig file. - * - * Copyright (C) 2007, 2011, 2014 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * This logic was leveraged from uIP which also has a BSD-style license: - * - * Author: Adam Dunkels - * Copyright (c) 2001-2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __INCLUDE_NUTTX_NET_UIP_UIPOPT_H -#define __INCLUDE_NUTTX_NET_UIP_UIPOPT_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Public Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Type Definitions - ****************************************************************************/ - -/* Layer 2 Configuration Options ********************************************/ - -/* The default data link layer for uIP is Ethernet. If CONFIG_NET_SLIP is - * defined in the NuttX header file, then SLIP will be supported. The basic - * differences between the SLIP and Ethernet configurations is that when SLIP - * is selected: - * - * - The link level header (that comes before the IP header) is omitted. - * - All MAC address processing is suppressed. - * - ARP is disabled. - * - * If CONFIG_NET_SLIP is not supported, then Ethernet will be used (there is - * no need to define anything special in the configuration file to use - * Ethernet -- it is the default). - * - * The "link level header" is the offset into the d_buf where the IP header - * can be found. For Ethernet, this should be set to 14. For SLIP, this - * should be set to 0. - */ - -#undef CONFIG_NET_ETHERNET -#undef CONFIG_NET_ARP - -#ifdef CONFIG_NET_SLIP -# ifdef CONFIG_NET_IPv6 -# error "SLIP is not implemented for IPv6" -# endif -# define UIP_LLH_LEN 0 -#else -# define CONFIG_NET_ETHERNET 1 -# define CONFIG_NET_ARP 1 -# define UIP_LLH_LEN 14 -#endif - -/* Layer 3/4 Configuration Options ******************************************/ - -/* IP configuration options */ - -/* The IP TTL (time to live) of IP packets sent by uIP. - * - * This should normally not be changed. - */ - -#define UIP_TTL 64 - -/* Turn on support for IP packet reassembly. - * - * uIP supports reassembly of fragmented IP packets. This features - * requires an additonal amount of RAM to hold the reassembly buffer - * and the reassembly code size is approximately 700 bytes. The - * reassembly buffer is of the same size as the d_buf buffer - * (configured by CONFIG_NET_BUFSIZE). - * - * Note: IP packet reassembly is not heavily tested. - */ - -#define UIP_REASSEMBLY 0 - -/* The maximum time an IP fragment should wait in the reassembly - * buffer before it is dropped. Units are deci-seconds, the range - * of the timer is 8-bits. - */ - -#define UIP_REASS_MAXAGE (20*10) /* 20 seconds */ - -/* Network drivers often receive packets with garbage at the end - * and are longer than the size of packet in the TCP header. The - * following "fudge" factor increases the size of the I/O buffering - * by a small amount to allocate slightly oversize packets. After - * receipt, the packet size will be chopped down to the size indicated - * in the TCP header. - */ - -#ifndef CONFIG_NET_GUARDSIZE -# define CONFIG_NET_GUARDSIZE 2 -#endif - -/* ICMP configuration options */ - -#if !defined(CONFIG_NET_ICMP) || defined(CONFIG_DISABLE_CLOCK) -# undef CONFIG_NET_ICMP_PING -#endif - -/* UDP configuration options */ - -/* The maximum amount of concurrent UDP connection, Default: 10 */ - -#ifndef CONFIG_NET_UDP_CONNS -# ifdef CONFIG_NET_UDP -# define CONFIG_NET_UDP_CONNS 10 -# else -# define CONFIG_NET_UDP_CONNS 0 -# endif -#endif - -/* The UDP maximum packet size. This is should not be to set to more - * than CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_IPUDPH_LEN. - */ - -#define UIP_UDP_MSS (CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_IPUDPH_LEN) - -/* TCP configuration options */ - -/* The maximum number of simultaneously open TCP connections. - * - * Since the TCP connections are statically allocated, turning this - * configuration knob down results in less RAM used. Each TCP - * connection requires approximatly 30 bytes of memory. - */ - -#ifndef CONFIG_NET_TCP_CONNS -# ifdef CONFIG_NET_TCP -# define CONFIG_NET_TCP_CONNS 10 -# else -# define CONFIG_NET_TCP_CONNS 0 -# endif -#endif - -/* The maximum number of simultaneously listening TCP ports. - * - * Each listening TCP port requires 2 bytes of memory. - */ - -#ifndef CONFIG_NET_MAX_LISTENPORTS -# define CONFIG_NET_MAX_LISTENPORTS 20 -#endif - -/* Define the maximum number of concurrently active UDP and TCP - * ports. This number must be greater than the number of open - * sockets in order to support multi-threaded read/write operations. - */ - -#ifndef CONFIG_NET_NACTIVESOCKETS -# define CONFIG_NET_NACTIVESOCKETS (CONFIG_NET_TCP_CONNS + CONFIG_NET_UDP_CONNS) -#endif - -/* The initial retransmission timeout counted in timer pulses. - * - * This should not be changed. - */ - -#define UIP_RTO 3 - -/* The maximum number of times a segment should be retransmitted - * before the connection should be aborted. - * - * This should not be changed. - */ - -#define UIP_MAXRTX 8 - -/* The maximum number of times a SYN segment should be retransmitted - * before a connection request should be deemed to have been - * unsuccessful. - * - * This should not need to be changed. - */ - -#define UIP_MAXSYNRTX 5 - -/* The TCP maximum segment size. This is should not be set to more - * than CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN. - */ - -#define UIP_TCP_MSS (CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) - -/* The size of the advertised receiver's window. - * - * Should be set low (i.e., to the size of the d_buf buffer) is the - * application is slow to process incoming data, or high (32768 bytes) - * if the application processes data quickly. - */ - -#ifndef CONFIG_NET_RECEIVE_WINDOW -# define CONFIG_NET_RECEIVE_WINDOW UIP_TCP_MSS -#endif - -/* How long a connection should stay in the TIME_WAIT state. - * - * This configiration option has no real implication, and it should be - * left untouched. Units: half second. - */ - -#define UIP_TIME_WAIT_TIMEOUT (60*2) - -/* ARP configuration options */ - -/* The size of the ARP table. - * - * This option should be set to a larger value if this uIP node will - * have many connections from the local network. - */ - -#ifndef CONFIG_NET_ARPTAB_SIZE -# define CONFIG_NET_ARPTAB_SIZE 8 -#endif - -/* The maxium age of ARP table entries measured in 10ths of seconds. - * - * An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD - * default). - */ - -#define UIP_ARP_MAXAGE 120 - -/* General configuration options */ - -/* The size of the uIP packet buffer. - * - * The uIP packet buffer should not be smaller than 60 bytes, and does - * not need to be larger than 1500 bytes. Lower size results in lower - * TCP throughput, larger size results in higher TCP throughput. - */ - -#ifndef CONFIG_NET_BUFSIZE -# define CONFIG_NET_BUFSIZE 400 -#endif - -#ifdef CONFIG_NET_TCP_READAHEAD - /* Number of TCP read-ahead buffers */ - -# ifndef CONFIG_NET_NTCP_READAHEAD_BUFFERS -# define CONFIG_NET_NTCP_READAHEAD_BUFFERS 4 -# endif - - /* The size of one TCP read buffer */ - -# ifndef CONFIG_NET_TCP_READAHEAD_BUFSIZE -# define CONFIG_NET_TCP_READAHEAD_BUFSIZE UIP_TCP_MSS -# endif - -#else -# undef CONFIG_NET_TCP_READAHEAD_BUFSIZE -# undef CONFIG_NET_NTCP_READAHEAD_BUFFERS -#endif - -/* Delay after receive to catch a following packet. No delay should be - * required if TCP/IP read-ahead buffering is enabled. - */ - -#ifndef CONFIG_NET_TCP_RECVDELAY -# ifdef CONFIG_NET_TCP_READAHEAD -# define CONFIG_NET_TCP_RECVDELAY 0 -# else -# define CONFIG_NET_TCP_RECVDELAY 5 -# endif -#endif - -/**************************************************************************** - * Public Type Definitions - ****************************************************************************/ - -/* Statistics datatype - * - * This typedef defines the dataype used for keeping statistics in - * uIP. - */ - -typedef uint16_t uip_stats_t; - -#endif /* __INCLUDE_NUTTX_NET_UIP_UIPOPT_H */ diff --git a/nuttx/net/arp/arp_inout.c b/nuttx/net/arp/arp_inout.c index 18a1483ca..14963436a 100644 --- a/nuttx/net/arp/arp_inout.c +++ b/nuttx/net/arp/arp_inout.c @@ -63,7 +63,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/arp/arp_table.c b/nuttx/net/arp/arp_table.c index b4d7ac684..ebf11e252 100644 --- a/nuttx/net/arp/arp_table.c +++ b/nuttx/net/arp/arp_table.c @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/arp/arp_timer.c b/nuttx/net/arp/arp_timer.c index d6f105ac1..6331bda19 100644 --- a/nuttx/net/arp/arp_timer.c +++ b/nuttx/net/arp/arp_timer.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include "net_internal.h" diff --git a/nuttx/net/icmp/icmp_input.c b/nuttx/net/icmp/icmp_input.c index 1e2626f3b..8434e4ab1 100644 --- a/nuttx/net/icmp/icmp_input.c +++ b/nuttx/net/icmp/icmp_input.c @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/icmp/icmp_ping.c b/nuttx/net/icmp/icmp_ping.c index 32c859ca0..66f23cf79 100644 --- a/nuttx/net/icmp/icmp_ping.c +++ b/nuttx/net/icmp/icmp_ping.c @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/icmp/icmp_poll.c b/nuttx/net/icmp/icmp_poll.c index 747b8ae05..045facfb5 100644 --- a/nuttx/net/icmp/icmp_poll.c +++ b/nuttx/net/icmp/icmp_poll.c @@ -42,7 +42,7 @@ #include -#include +#include #include #include diff --git a/nuttx/net/icmp/icmp_send.c b/nuttx/net/icmp/icmp_send.c index b46701ed4..8d6232d36 100644 --- a/nuttx/net/icmp/icmp_send.c +++ b/nuttx/net/icmp/icmp_send.c @@ -42,7 +42,7 @@ #include -#include +#include #include #include diff --git a/nuttx/net/igmp/igmp_input.c b/nuttx/net/igmp/igmp_input.c index 1c6f9cc91..660d9f0b0 100644 --- a/nuttx/net/igmp/igmp_input.c +++ b/nuttx/net/igmp/igmp_input.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/igmp/igmp_join.c b/nuttx/net/igmp/igmp_join.c index e795d1dd6..33e5b5140 100644 --- a/nuttx/net/igmp/igmp_join.c +++ b/nuttx/net/igmp/igmp_join.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/igmp/igmp_leave.c b/nuttx/net/igmp/igmp_leave.c index f3632e338..1b80272ee 100644 --- a/nuttx/net/igmp/igmp_leave.c +++ b/nuttx/net/igmp/igmp_leave.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/igmp/igmp_mcastmac.c b/nuttx/net/igmp/igmp_mcastmac.c index 3f8b8369f..937810935 100644 --- a/nuttx/net/igmp/igmp_mcastmac.c +++ b/nuttx/net/igmp/igmp_mcastmac.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include "uip/uip_internal.h" diff --git a/nuttx/net/igmp/igmp_msg.c b/nuttx/net/igmp/igmp_msg.c index b3d1948bf..ae0155e70 100644 --- a/nuttx/net/igmp/igmp_msg.c +++ b/nuttx/net/igmp/igmp_msg.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/igmp/igmp_poll.c b/nuttx/net/igmp/igmp_poll.c index 219ffe217..55b94deb5 100644 --- a/nuttx/net/igmp/igmp_poll.c +++ b/nuttx/net/igmp/igmp_poll.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/igmp/igmp_send.c b/nuttx/net/igmp/igmp_send.c index 32dc1d78f..dbcce795b 100644 --- a/nuttx/net/igmp/igmp_send.c +++ b/nuttx/net/igmp/igmp_send.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include #include diff --git a/nuttx/net/igmp/igmp_timer.c b/nuttx/net/igmp/igmp_timer.c index 74ee41e5b..bf7007998 100644 --- a/nuttx/net/igmp/igmp_timer.c +++ b/nuttx/net/igmp/igmp_timer.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/pkt/pkt_callback.c b/nuttx/net/pkt/pkt_callback.c index 1110a5a02..5bc84fdb2 100644 --- a/nuttx/net/pkt/pkt_callback.c +++ b/nuttx/net/pkt/pkt_callback.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/pkt/pkt_conn.c b/nuttx/net/pkt/pkt_conn.c index 1b262195d..e52be6d48 100644 --- a/nuttx/net/pkt/pkt_conn.c +++ b/nuttx/net/pkt/pkt_conn.c @@ -50,7 +50,7 @@ #include -#include +#include #include #include #include diff --git a/nuttx/net/pkt/pkt_poll.c b/nuttx/net/pkt/pkt_poll.c index 8e8d71847..ab34a3b9a 100644 --- a/nuttx/net/pkt/pkt_poll.c +++ b/nuttx/net/pkt/pkt_poll.c @@ -47,7 +47,7 @@ #include -#include +#include #include #include #include diff --git a/nuttx/net/tcp/tcp_appsend.c b/nuttx/net/tcp/tcp_appsend.c index 857ca4385..79b27efe0 100644 --- a/nuttx/net/tcp/tcp_appsend.c +++ b/nuttx/net/tcp/tcp_appsend.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/tcp/tcp_backlog.c b/nuttx/net/tcp/tcp_backlog.c index a1a16323e..8fa707223 100644 --- a/nuttx/net/tcp/tcp_backlog.c +++ b/nuttx/net/tcp/tcp_backlog.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCPBACKLOG) #include diff --git a/nuttx/net/tcp/tcp_callback.c b/nuttx/net/tcp/tcp_callback.c index 6a1422628..8a15e86e2 100644 --- a/nuttx/net/tcp/tcp_callback.c +++ b/nuttx/net/tcp/tcp_callback.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/tcp/tcp_conn.c b/nuttx/net/tcp/tcp_conn.c index bae10a754..87b8881c2 100644 --- a/nuttx/net/tcp/tcp_conn.c +++ b/nuttx/net/tcp/tcp_conn.c @@ -51,7 +51,7 @@ #include -#include +#include #include #include diff --git a/nuttx/net/tcp/tcp_input.c b/nuttx/net/tcp/tcp_input.c index bbd44ee6f..76d688eda 100644 --- a/nuttx/net/tcp/tcp_input.c +++ b/nuttx/net/tcp/tcp_input.c @@ -50,7 +50,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/tcp/tcp_listen.c b/nuttx/net/tcp/tcp_listen.c index 4a5978091..f974d3f6f 100644 --- a/nuttx/net/tcp/tcp_listen.c +++ b/nuttx/net/tcp/tcp_listen.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include "uip/uip_internal.h" diff --git a/nuttx/net/tcp/tcp_poll.c b/nuttx/net/tcp/tcp_poll.c index ac4cdb8f3..39955b7f1 100644 --- a/nuttx/net/tcp/tcp_poll.c +++ b/nuttx/net/tcp/tcp_poll.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/tcp/tcp_readahead.c b/nuttx/net/tcp/tcp_readahead.c index 5ac4a42ac..280b5469c 100644 --- a/nuttx/net/tcp/tcp_readahead.c +++ b/nuttx/net/tcp/tcp_readahead.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCP_READAHEAD) #include diff --git a/nuttx/net/tcp/tcp_send.c b/nuttx/net/tcp/tcp_send.c index 3e313f214..4d98e269c 100644 --- a/nuttx/net/tcp/tcp_send.c +++ b/nuttx/net/tcp/tcp_send.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/tcp/tcp_seqno.c b/nuttx/net/tcp/tcp_seqno.c index 625eefeb2..5242fe9a0 100644 --- a/nuttx/net/tcp/tcp_seqno.c +++ b/nuttx/net/tcp/tcp_seqno.c @@ -50,7 +50,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/tcp/tcp_timer.c b/nuttx/net/tcp/tcp_timer.c index edcdb9c24..06be1902f 100644 --- a/nuttx/net/tcp/tcp_timer.c +++ b/nuttx/net/tcp/tcp_timer.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/tcp/tcp_wrbuffer.c b/nuttx/net/tcp/tcp_wrbuffer.c index 929b2f3a2..0cdd99c97 100644 --- a/nuttx/net/tcp/tcp_wrbuffer.c +++ b/nuttx/net/tcp/tcp_wrbuffer.c @@ -38,7 +38,7 @@ * Included Files ****************************************************************************/ -#include +#include #if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCP_WRITE_BUFFERS) #if defined(CONFIG_DEBUG) && defined(CONFIG_NET_TCP_WRBUFFER_DEBUG) diff --git a/nuttx/net/udp/udp_callback.c b/nuttx/net/udp/udp_callback.c index 9cdc8633d..cec22630c 100644 --- a/nuttx/net/udp/udp_callback.c +++ b/nuttx/net/udp/udp_callback.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/udp/udp_conn.c b/nuttx/net/udp/udp_conn.c index 0d36d7d67..f1c0195c2 100644 --- a/nuttx/net/udp/udp_conn.c +++ b/nuttx/net/udp/udp_conn.c @@ -56,7 +56,7 @@ #include -#include +#include #include #include diff --git a/nuttx/net/udp/udp_input.c b/nuttx/net/udp/udp_input.c index e2d7c434f..f9e710795 100644 --- a/nuttx/net/udp/udp_input.c +++ b/nuttx/net/udp/udp_input.c @@ -47,7 +47,7 @@ #include -#include +#include #include #include diff --git a/nuttx/net/udp/udp_poll.c b/nuttx/net/udp/udp_poll.c index 23b663250..b565e50e8 100644 --- a/nuttx/net/udp/udp_poll.c +++ b/nuttx/net/udp/udp_poll.c @@ -47,7 +47,7 @@ #include -#include +#include #include #include diff --git a/nuttx/net/udp/udp_send.c b/nuttx/net/udp/udp_send.c index aab52f6d4..4296d69e9 100644 --- a/nuttx/net/udp/udp_send.c +++ b/nuttx/net/udp/udp_send.c @@ -46,7 +46,7 @@ #include -#include +#include #include #include diff --git a/nuttx/net/uip/uip_callback.c b/nuttx/net/uip/uip_callback.c index 4ed830e95..3c8bb19f8 100644 --- a/nuttx/net/uip/uip_callback.c +++ b/nuttx/net/uip/uip_callback.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/uip/uip_chksum.c b/nuttx/net/uip/uip_chksum.c index 9f4a89866..8670f2e1e 100644 --- a/nuttx/net/uip/uip_chksum.c +++ b/nuttx/net/uip/uip_chksum.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/uip/uip_input.c b/nuttx/net/uip/uip_input.c index fa0496ad9..0bff32387 100644 --- a/nuttx/net/uip/uip_input.c +++ b/nuttx/net/uip/uip_input.c @@ -85,7 +85,7 @@ #include #include -#include +#include #include #include diff --git a/nuttx/net/uip/uip_poll.c b/nuttx/net/uip/uip_poll.c index 644c1e98c..25185e4f9 100644 --- a/nuttx/net/uip/uip_poll.c +++ b/nuttx/net/uip/uip_poll.c @@ -42,7 +42,7 @@ #include -#include +#include #include #include -- cgit v1.2.3