diff options
Diffstat (limited to 'nuttx/include/net/uip')
-rw-r--r-- | nuttx/include/net/uip/uip-arch.h | 6 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-arp.h | 20 | ||||
-rw-r--r-- | nuttx/include/net/uip/uipopt.h | 51 |
3 files changed, 60 insertions, 17 deletions
diff --git a/nuttx/include/net/uip/uip-arch.h b/nuttx/include/net/uip/uip-arch.h index c7e8687c1..49608de49 100644 --- a/nuttx/include/net/uip/uip-arch.h +++ b/nuttx/include/net/uip/uip-arch.h @@ -2,7 +2,7 @@ * uip-arch.h * Defines architecture-specific device driver interfaces to uIP * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Derived largely from portions of uIP with has a similar BSD-styple license: @@ -90,9 +90,11 @@ struct uip_driver_s char d_ifname[IFNAMSIZ]; #endif - /* Device identitity */ + /* Ethernet device identity */ +#ifdef CONFIG_NET_ETHERNET struct ether_addr d_mac; /* Device MAC address */ +#endif /* Network identity */ diff --git a/nuttx/include/net/uip/uip-arp.h b/nuttx/include/net/uip/uip-arp.h index 439960e9a..3afe1b252 100644 --- a/nuttx/include/net/uip/uip-arp.h +++ b/nuttx/include/net/uip/uip-arp.h @@ -2,7 +2,7 @@ * include/net/uip/uip-arch.h * Macros and definitions for the ARP module. * - * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Derived from uIP with has a similar BSD-styple license: @@ -49,7 +49,9 @@ #include <nuttx/compiler.h> #include <stdint.h> + #include <net/ethernet.h> +#include <net/uip/uipopt.h> #include <net/uip/uip.h> /**************************************************************************** @@ -102,6 +104,7 @@ extern "C" { * Public Function Prototypes ****************************************************************************/ +#ifdef CONFIG_NET_ARP /**************************************************************************** * Name: uip_arp_init * @@ -236,6 +239,21 @@ EXTERN struct arp_entry *uip_arp_find(in_addr_t ipaddr); } \ } +#else /* CONFIG_NET_ARP */ + +/* If ARP is disabled, stub out all ARP interfaces */ + +# define uip_arp_init() +# define uip_arp_ipin(dev) +# define uip_arp_arpin(dev) +# define uip_arp_out(dev) +# define uip_arp_timer() +# define uip_arp_update(pipaddr,ethaddr) +# define uip_arp_find(ipaddr) NULL +# define uip_arp_delete(ipaddr) + +#endif /* CONFIG_NET_ARP */ + #undef EXTERN #ifdef __cplusplus } diff --git a/nuttx/include/net/uip/uipopt.h b/nuttx/include/net/uip/uipopt.h index be62d1a6e..f6aff58bd 100644 --- a/nuttx/include/net/uip/uipopt.h +++ b/nuttx/include/net/uip/uipopt.h @@ -16,7 +16,7 @@ * Note: Most of the configuration options in the uipopt.h should not * be changed, but rather the per-project defconfig file. * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * This logic was leveraged from uIP which also has a BSD-style license: @@ -69,6 +69,42 @@ * 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. @@ -251,19 +287,6 @@ # define CONFIG_NET_TCP_READAHEAD_BUFSIZE UIP_TCP_MSS #endif -/* The link level header length. - * - * This 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. - */ - -#ifdef CONFIG_NET_LLH_LEN -# define UIP_LLH_LEN CONFIG_NET_LLH_LEN -#else -# define UIP_LLH_LEN 14 -#endif - /**************************************************************************** * Public Type Definitions ****************************************************************************/ |