summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/net/Kconfig13
-rw-r--r--nuttx/net/Makefile8
-rw-r--r--nuttx/net/arp/arp_inout.c2
-rw-r--r--nuttx/net/net_sockets.c2
-rw-r--r--nuttx/net/netdev_findbyaddr.c2
-rw-r--r--nuttx/net/netdev_ioctl.c2
-rw-r--r--nuttx/net/route/Kconfig23
-rw-r--r--nuttx/net/route/Make.defs50
-rw-r--r--nuttx/net/route/net_addroute.c (renamed from nuttx/net/net_addroute.c)4
-rw-r--r--nuttx/net/route/net_allocroute.c (renamed from nuttx/net/net_allocroute.c)4
-rw-r--r--nuttx/net/route/net_delroute.c (renamed from nuttx/net/net_delroute.c)4
-rw-r--r--nuttx/net/route/net_foreachroute.c (renamed from nuttx/net/net_foreachroute.c)4
-rw-r--r--nuttx/net/route/net_router.c (renamed from nuttx/net/net_router.c)4
-rw-r--r--nuttx/net/route/netdev_router.c (renamed from nuttx/net/netdev_router.c)6
-rw-r--r--nuttx/net/route/route.h (renamed from nuttx/net/net_route.h)10
-rw-r--r--nuttx/net/tcp/tcp_send.c2
16 files changed, 98 insertions, 42 deletions
diff --git a/nuttx/net/Kconfig b/nuttx/net/Kconfig
index 05feed11f..76807288a 100644
--- a/nuttx/net/Kconfig
+++ b/nuttx/net/Kconfig
@@ -138,18 +138,7 @@ config NET_STATISTICS
---help---
uIP statistics on or off
-config NET_ROUTE
- bool "Routing table suport"
- default n
- ---help---
- Build in support for a routing table. See include/net/route.h
-
-config NET_MAXROUTES
- int "Routing table size"
- default 4
- depends on NET_ROUTE
- ---help---
- The size of the routing table (in entries).
+source "net/route/Kconfig"
config NET_MULTICAST
bool "Multi-cast Tx support"
diff --git a/nuttx/net/Makefile b/nuttx/net/Makefile
index ab34e09f6..f81257483 100644
--- a/nuttx/net/Makefile
+++ b/nuttx/net/Makefile
@@ -62,13 +62,6 @@ SOCK_CSRCS += net_timeo.c net_dsec2timeval.c net_timeval2dsec.c
endif
endif
-# Routing table support
-
-ifeq ($(CONFIG_NET_ROUTE),y)
-SOCK_CSRCS += net_addroute.c net_allocroute.c net_delroute.c
-SOCK_CSRCS += net_foreachroute.c net_router.c netdev_router.c
-endif
-
# Support for network access using streams
ifneq ($(CONFIG_NFILE_STREAMS),0)
@@ -101,6 +94,7 @@ include tcp/Make.defs
include udp/Make.defs
include pkt/Make.defs
include uip/Make.defs
+include route/Make.defs
endif
ASRCS = $(SOCK_ASRCS) $(NETDEV_ASRCS) $(NET_ASRCS)
diff --git a/nuttx/net/arp/arp_inout.c b/nuttx/net/arp/arp_inout.c
index 9f5bd26c3..9cb4d6b15 100644
--- a/nuttx/net/arp/arp_inout.c
+++ b/nuttx/net/arp/arp_inout.c
@@ -67,7 +67,7 @@
#include <nuttx/net/netdev.h>
#include <nuttx/net/arp.h>
-#include "net_route.h"
+#include "route/route.h"
#ifdef CONFIG_NET_ARP
diff --git a/nuttx/net/net_sockets.c b/nuttx/net/net_sockets.c
index 66800f382..df19c216a 100644
--- a/nuttx/net/net_sockets.c
+++ b/nuttx/net/net_sockets.c
@@ -53,8 +53,8 @@
#include <nuttx/net/net.h>
#include <nuttx/kmalloc.h>
-#include "net_route.h"
#include "net.h"
+#include "route/route.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/net/netdev_findbyaddr.c b/nuttx/net/netdev_findbyaddr.c
index 99bdc9d9f..7915f4a83 100644
--- a/nuttx/net/netdev_findbyaddr.c
+++ b/nuttx/net/netdev_findbyaddr.c
@@ -47,8 +47,8 @@
#include <nuttx/net/netdev.h>
-#include "net_route.h"
#include "net.h"
+#include "route/route.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/net/netdev_ioctl.c b/nuttx/net/netdev_ioctl.c
index 3c7e4eeda..1505e668f 100644
--- a/nuttx/net/netdev_ioctl.c
+++ b/nuttx/net/netdev_ioctl.c
@@ -64,7 +64,7 @@
#endif
#include "net.h"
-#include "net_route.h"
+#include "route/route.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/net/route/Kconfig b/nuttx/net/route/Kconfig
new file mode 100644
index 000000000..07b61d92d
--- /dev/null
+++ b/nuttx/net/route/Kconfig
@@ -0,0 +1,23 @@
+#
+# For a description of the syntax of this configuration file,
+# see misc/tools/kconfig-language.txt.
+#
+
+menu "Routing Table Configuration"
+
+config NET_ROUTE
+ bool "Routing table support"
+ default n
+ ---help---
+ Build in support for a routing table. See include/net/route.h
+
+if NET_ROUTE
+
+config NET_MAXROUTES
+ int "Routing table size"
+ default 4
+ ---help---
+ The size of the routing table (in entries).
+
+endif # NET_ROUTE
+endmenu # ARP Configuration
diff --git a/nuttx/net/route/Make.defs b/nuttx/net/route/Make.defs
new file mode 100644
index 000000000..1f6eef3a0
--- /dev/null
+++ b/nuttx/net/route/Make.defs
@@ -0,0 +1,50 @@
+############################################################################
+# net/route/Make.defs
+#
+# Copyright (C) 2014 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# 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 NuttX 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 COPYRIGHT HOLDERS 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
+# COPYRIGHT OWNER 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.
+#
+############################################################################
+
+ifeq ($(CONFIG_NET),y)
+ifeq ($(CONFIG_NET_ROUTE),y)
+
+# Routing table support
+
+SOCK_CSRCS += net_addroute.c net_allocroute.c net_delroute.c
+SOCK_CSRCS += net_foreachroute.c net_router.c netdev_router.c
+
+# Include routing table build support
+
+DEPPATH += --dep-path route
+VPATH += :route
+
+endif
+endif
diff --git a/nuttx/net/net_addroute.c b/nuttx/net/route/net_addroute.c
index 7db5504d8..a29e5b461 100644
--- a/nuttx/net/net_addroute.c
+++ b/nuttx/net/route/net_addroute.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_addroute.c
+ * net/route/net_addroute.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -47,7 +47,7 @@
#include <arch/irq.h>
#include "net.h"
-#include "net_route.h"
+#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/net_allocroute.c b/nuttx/net/route/net_allocroute.c
index 69fdd56b9..bcb82be2b 100644
--- a/nuttx/net/net_allocroute.c
+++ b/nuttx/net/route/net_allocroute.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_allocroute.c
+ * net/route/net_allocroute.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -46,7 +46,7 @@
#include <arch/irq.h>
#include "net.h"
-#include "net_route.h"
+#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/net_delroute.c b/nuttx/net/route/net_delroute.c
index 1d4571c52..d1c84aa54 100644
--- a/nuttx/net/net_delroute.c
+++ b/nuttx/net/route/net_delroute.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_delroute.c
+ * net/route/net_delroute.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <errno.h>
#include "net.h"
-#include "net_route.h"
+#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/net_foreachroute.c b/nuttx/net/route/net_foreachroute.c
index 2b22abc90..fb2b7e87b 100644
--- a/nuttx/net/net_foreachroute.c
+++ b/nuttx/net/route/net_foreachroute.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_foreachroute.c
+ * net/route/net_foreachroute.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -45,7 +45,7 @@
#include <arch/irq.h>
#include "net.h"
-#include "net_route.h"
+#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/net_router.c b/nuttx/net/route/net_router.c
index 4851c08ec..37fa91036 100644
--- a/nuttx/net/net_router.c
+++ b/nuttx/net/route/net_router.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_router.c
+ * net/route/net_router.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <errno.h>
#include "net.h"
-#include "net_route.h"
+#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/netdev_router.c b/nuttx/net/route/netdev_router.c
index bcb47b3ab..9074d733c 100644
--- a/nuttx/net/netdev_router.c
+++ b/nuttx/net/route/netdev_router.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/netdev_router.c
+ * net/route/netdev_router.c
*
- * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@
#include <nuttx/net/netdev.h>
#include "net.h"
-#include "net_route.h"
+#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/net_route.h b/nuttx/net/route/route.h
index e6484ce93..140afdf5d 100644
--- a/nuttx/net/net_route.h
+++ b/nuttx/net/route/route.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/net_route.h
+ * net/route/route.h
*
- * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __NET_NET_ROUTE_H
-#define __NET_NET_ROUTE_H
+#ifndef __NET_ROUTE_ROUTE_H
+#define __NET_ROUTE_ROUTE_H
/****************************************************************************
* Included Files
@@ -260,4 +260,4 @@ int net_foreachroute(route_handler_t handler, FAR void *arg);
#endif
#endif /* CONFIG_NET_ROUTE */
-#endif /* __NET_NET_ROUTE_H */
+#endif /* __NET_ROUTE_ROUTE_H */
diff --git a/nuttx/net/tcp/tcp_send.c b/nuttx/net/tcp/tcp_send.c
index 97cf9053f..929ca1c9b 100644
--- a/nuttx/net/tcp/tcp_send.c
+++ b/nuttx/net/tcp/tcp_send.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net//tcp_send.c
+ * net/tcp/tcp_send.c
*
* Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>