Removed unused uIP files

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@403 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2007-11-23 21:16:43 +00:00
parent 2ce5085cc8
commit 2d9b57758b
11 changed files with 28 additions and 927 deletions

View File

@@ -246,3 +246,5 @@
0.3.3 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
* Removed unused uIP files

View File

@@ -725,6 +725,8 @@ Other memory:
<pre><ul>
0.3.3 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
* Removed unused uIP files
</pre></ul>
<table width ="100%">

3
TODO
View File

@@ -38,7 +38,8 @@ o Network
- Should implement SOCK_RAW
- Performance Improvements (uIP is not very fast):
Need to extend logic so that uIP can have more than on packet in flight and to
handle deferred acknowledgements.
handle deferred acknowledgements. This is supposed to improve send performance by
an order of magnitude.
- uIP polling issues:
(1) Current logic will not support multiple ethernet drivers. Each driver should
poll on TCP connections connect on the network supported by the driver; UDP

View File

@@ -75,7 +75,10 @@
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
{
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
int i;
#endif
dbg(" TCB=%p name=%s\n", tcb, tcb->argv[0]);
#if CONFIG_NFILE_DESCRIPTORS > 0

View File

@@ -49,7 +49,7 @@
****************************************************************************/
/* This macro to convert a 16/32-bit constant values quantity from host byte
* order to network byte order. The 16-bit version of this macro is require
* order to network byte order. The 16-bit version of this macro is required
* for uIP:
*
* Author Adam Dunkels <adam@dunkels.com>

View File

@@ -370,25 +370,14 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len);
*
* Construct an IP address from four bytes.
*
* This function constructs an IP address of the type that uIP handles
* internally from four bytes. The function is handy for specifying IP
* addresses to use with e.g. the uip_connect() function.
* This function constructs an IPv4 address in network byte order.
*
* Example:
*
* uip_ipaddr_t ipaddr;
* struct uip_conn *c;
*
* uip_ipaddr(&ipaddr, 192,168,1,2);
* c = uip_connect(&ipaddr, HTONS(80));
*
* addr A pointer to a uip_ipaddr_t variable that will be
* filled in with the IP address.
*
* addr0 The first octet of the IP address.
* addr1 The second octet of the IP address.
* addr2 The third octet of the IP address.
* addr3 The forth octet of the IP address.
* addr A pointer to a uip_ipaddr_t variable that will be
* filled in with the IPv4 address.
* addr0 The first octet of the IPv4 address.
* addr1 The second octet of the IPv4 address.
* addr2 The third octet of the IPv4 address.
* addr3 The forth octet of the IPv4 address.
*/
#define uip_ipaddr(addr, addr0, addr1, addr2, addr3) \
@@ -409,16 +398,17 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len);
* This function constructs an IPv6 address.
*/
#define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) do { \
((uint16*)(addr))[0] = HTONS((addr0)); \
((uint16*)(addr))[1] = HTONS((addr1)); \
((uint16*)(addr))[2] = HTONS((addr2)); \
((uint16*)(addr))[3] = HTONS((addr3)); \
((uint16*)(addr))[4] = HTONS((addr4)); \
((uint16*)(addr))[5] = HTONS((addr5)); \
((uint16*)(addr))[6] = HTONS((addr6)); \
((uint16*)(addr))[7] = HTONS((addr7)); \
} while(0)
#define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) \
do { \
((uint16*)(addr))[0] = HTONS((addr0)); \
((uint16*)(addr))[1] = HTONS((addr1)); \
((uint16*)(addr))[2] = HTONS((addr2)); \
((uint16*)(addr))[3] = HTONS((addr3)); \
((uint16*)(addr))[4] = HTONS((addr4)); \
((uint16*)(addr))[5] = HTONS((addr5)); \
((uint16*)(addr))[6] = HTONS((addr6)); \
((uint16*)(addr))[7] = HTONS((addr7)); \
} while(0)
/* Copy an IP address to another IP address.
*

View File

@@ -55,11 +55,6 @@ UIP_CSRCS += uip-tcpconn.c uip-tcppoll.c uip-tcptimer.c uip-tcpsend.c \
uip-tcpinput.c uip-tcpappsend.c uip-listen.c uip-tcpcallback.c \
uip-tcpreadahead.c
# Follow can be used to add support for the "uipsplit uIP TCP throughput booster hack"
# but are not currently used
UIP_CSRCS += uip-fw.c uip-split.c
endif
# UDP source files

File diff suppressed because it is too large Load Diff

View File

@@ -1,151 +0,0 @@
/****************************************************************************
* net/uip/uip-fw.h
* uIP packet forwarding header file.
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Based on uIP which also has a BSD style license:
*
* Author: Adam Dunkels <adam@sics.se>
* Copyright (c) 2004, Swedish Institute of Computer Science.
* 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. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``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 INSTITUTE OR CONTRIBUTORS 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 __UIP_FW_H__
#define __UIP_FW_H__
/****************************************************************************
* Included Files
****************************************************************************/
#include <net/uip/uip.h>
/* Representation of a uIP network interface. */
struct uip_fw_netif
{
struct uip_fw_netif *next; /**< Pointer to the next interface when
linked in a list. */
uint16 ipaddr[2]; /**< The IP address of this interface. */
uint16 netmask[2]; /**< The netmask of the interface. */
uint8 (* output)(void);
/**< A pointer to the function that
sends a packet. */
};
/* Intantiating macro for a uIP network interface.
*
* Example:
*
* struct uip_fw_netif slipnetif =
* {UIP_FW_NETIF(192,168,76,1, 255,255,255,0, slip_output)};
*
* ip1,ip2,ip3,ip4 The IP address of the network interface.
*
* nm1,nm2,nm3,nm4 The netmask of the network interface.
*
* outputfunc A pointer to the output function of the network interface.
*/
#define UIP_FW_NETIF(ip1,ip2,ip3,ip4, nm1,nm2,nm3,nm4, outputfunc) \
NULL, \
{HTONS((ip1 << 8) | ip2), HTONS((ip3 << 8) | ip4)}, \
{HTONS((nm1 << 8) | nm2), HTONS((nm3 << 8) | nm4)}, \
outputfunc
/* Set the IP address of a network interface.
*
* netif A pointer to the uip_fw_netif structure for the network interface.
*
* addr A pointer to an IP address.
*/
#define uip_fw_setipaddr(netif, addr) \
do { (netif)->ipaddr[0] = ((uint16 *)(addr))[0]; \
(netif)->ipaddr[1] = ((uint16 *)(addr))[1]; } while(0)
/* Set the netmask of a network interface.
*
* netif A pointer to the uip_fw_netif structure for the network interface.
*
* addr A pointer to an IP address representing the netmask.
*/
#define uip_fw_setnetmask(netif, addr) \
do { (netif)->netmask[0] = ((uint16 *)(addr))[0]; \
(netif)->netmask[1] = ((uint16 *)(addr))[1]; } while(0)
void uip_fw_init(void);
uint8 uip_fw_forward(struct uip_driver_s *dev);
uint8 uip_fw_output(struct uip_driver_s *dev);
void uip_fw_register(struct uip_fw_netif *netif);
void uip_fw_default(struct uip_fw_netif *netif);
void uip_fw_periodic(void);
/* A non-error message that indicates that a packet should be
* processed locally.
*/
#define UIP_FW_LOCAL 0
/* A non-error message that indicates that something went OK. */
#define UIP_FW_OK 0
/* A non-error message that indicates that a packet was forwarded. */
#define UIP_FW_FORWARDED 1
/* A non-error message that indicates that a zero-length packet
* transmission was attempted, and that no packet was sent.
*/
#define UIP_FW_ZEROLEN 2
/* An error message that indicates that a packet that was too large
* for the outbound network interface was detected.
*/
#define UIP_FW_TOOLARGE 3
/* An error message that indicates that no suitable interface could be
* found for an outbound packet.
*/
#define UIP_FW_NOROUTE 4
/* An error message that indicates that a packet that should be
* forwarded or output was dropped.
*/
#define UIP_FW_DROPPED 5
#endif /* __UIP_FW_H__ */

View File

@@ -1,144 +0,0 @@
/* uip-split.c
* Author: Adam Dunkels <adam@sics.se>
*
* Copyright (c) 2004, Swedish Institute of Computer Science.
* 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. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``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 INSTITUTE OR CONTRIBUTORS 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.
*/
#include <nuttx/config.h>
#include <string.h>
#include <net/uip/uip.h>
#include <net/uip/uip-arch.h>
#include "uip-split.h"
#include "uip-fw.h"
#define BUF ((struct uip_tcpip_hdr *)&dev->d_buf[UIP_LLH_LEN])
void uip_split_output(struct uip_driver_s *dev)
{
uint16 tcplen;
uint16 len1;
uint16 len2;
/* We only try to split maximum sized TCP segments. */
if (BUF->proto == UIP_PROTO_TCP &&
dev->d_len == CONFIG_NET_BUFSIZE - UIP_LLH_LEN)
{
tcplen = dev->d_len - UIP_TCPIP_HLEN;
/* Split the segment in two. If the original packet length was
* odd, we make the second packet one byte larger.
*/
len1 = len2 = tcplen / 2;
if (len1 + len2 < tcplen)
{
++len2;
}
/* Create the first packet. This is done by altering the length
* field of the IP header and updating the checksums.
*/
dev->d_len = len1 + UIP_TCPIP_HLEN;
#ifdef CONFIG_NET_IPv6
/* For IPv6, the IP length field does not include the IPv6 IP header
* length.
*/
BUF->len[0] = ((dev->d_len - UIP_IPH_LEN) >> 8);
BUF->len[1] = ((dev->d_len - UIP_IPH_LEN) & 0xff);
#else /* CONFIG_NET_IPv6 */
BUF->len[0] = dev->d_len >> 8;
BUF->len[1] = dev->d_len & 0xff;
#endif /* CONFIG_NET_IPv6 */
/* Recalculate the TCP checksum. */
BUF->tcpchksum = 0;
BUF->tcpchksum = ~(uip_tcpchksum(dev));
#ifndef CONFIG_NET_IPv6
/* Recalculate the IP checksum. */
BUF->ipchksum = 0;
BUF->ipchksum = ~(uip_ipchksum(dev));
#endif /* CONFIG_NET_IPv6 */
/* Transmit the first packet. */
/* uip_fw_output();*/
tcpip_output();
/* Now, create the second packet. To do this, it is not enough to
* just alter the length field, but we must also update the TCP
* sequence number and point the d_appdata to a new place in
* memory. This place is detemined by the length of the first
* packet (len1).
*/
dev->d_len = len2 + UIP_TCPIP_HLEN;
#ifdef CONFIG_NET_IPv6
/* For IPv6, the IP length field does not include the IPv6 IP header
* length.
*/
BUF->len[0] = ((dev->d_len - UIP_IPH_LEN) >> 8);
BUF->len[1] = ((dev->d_len - UIP_IPH_LEN) & 0xff);
#else /* CONFIG_NET_IPv6 */
BUF->len[0] = dev->d_len >> 8;
BUF->len[1] = dev->d_len & 0xff;
#endif /* CONFIG_NET_IPv6 */
/* dev->d_appdata += len1;*/
memcpy(dev->d_appdata, dev->d_appdata + len1, len2);
uip_incr32(BUF->seqno, len1);
/* Recalculate the TCP checksum. */
BUF->tcpchksum = 0;
BUF->tcpchksum = ~(uip_tcpchksum(dev));
#ifndef CONFIG_NET_IPv6
/* Recalculate the IP checksum. */
BUF->ipchksum = 0;
BUF->ipchksum = ~(uip_ipchksum(dev));
#endif /* CONFIG_NET_IPv6 */
/* Transmit the second packet. */
/* uip_fw_output();*/
tcpip_output();
}
else
{
/* uip_fw_output();*/
tcpip_output();
}
}

View File

@@ -1,89 +0,0 @@
/****************************************************************************
* net/uip/uip-split.h
* Module for splitting outbound TCP segments in two to avoid the
* delayed ACK throughput degradation.
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Based on uIP which also has a BSD style license:
*
* Author: Adam Dunkels <adam@sics.se>
* Copyright (c) 2004, Swedish Institute of Computer Science.
* 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. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``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 INSTITUTE OR CONTRIBUTORS 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.
*
****************************************************************************/
/* uipsplit uIP TCP throughput booster hack
*
* The basic uIP TCP implementation only allows each TCP connection to
* have a single TCP segment in flight at any given time. Because of
* the delayed ACK algorithm employed by most TCP receivers, uIP's
* limit on the amount of in-flight TCP segments seriously reduces the
* maximum achievable throughput for sending data from uIP.
*
* The uip-split module is a hack which tries to remedy this
* situation. By splitting maximum sized outgoing TCP segments into
* two, the delayed ACK algorithm is not invoked at TCP
* receivers. This improves the throughput when sending data from uIP
* by orders of magnitude.
*
* The uip-split module uses the uip-fw module (uIP IP packet
* forwarding) for sending packets. Therefore, the uip-fw module must
* be set up with the appropriate network interfaces for this module
* to work.
*/
/****************************************************************************
* Included Files
****************************************************************************/
#ifndef __UIP_SPLIT_H__
#define __UIP_SPLIT_H__
/* Handle outgoing packets.
*
* This function inspects an outgoing packet in the d_buf buffer and
* sends it out using the uip_fw_output() function. If the packet is a
* full-sized TCP segment it will be split into two segments and
* transmitted separately. This function should be called instead of
* the actual device driver output function, or the uip_fw_output()
* function.
*
* The headers of the outgoing packet is assumed to be in the d_buf
* buffer and the payload is assumed to be wherever d_appdata
* points. The length of the outgoing packet is assumed to be in the
* d_len field.
*/
void uip_split_output(struct uip_driver_s *dev);
#endif /* __UIP_SPLIT_H__ */
/** @} */
/** @} */