summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-06-28 17:25:18 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-06-28 17:25:18 -0600
commitdc5d8364a9b2d53397f74d72e8f2beda05c73c7f (patch)
tree03b0c1360bace17da6a0f0eccc7db652c8d94e27
parent469ef047adbea4d5ef72f90a36da7035d9602826 (diff)
downloadpx4-nuttx-dc5d8364a9b2d53397f74d72e8f2beda05c73c7f.tar.gz
px4-nuttx-dc5d8364a9b2d53397f74d72e8f2beda05c73c7f.tar.bz2
px4-nuttx-dc5d8364a9b2d53397f74d72e8f2beda05c73c7f.zip
Move all socket-related files from net/ to net/socket. Move net/net.h to net/socket/socket.h
-rw-r--r--nuttx/net/arp/arp_timer.c2
-rw-r--r--nuttx/net/icmp/icmp_ping.c2
-rw-r--r--nuttx/net/net_initialize.c2
-rw-r--r--nuttx/net/netdev/netdev_carrier.c1
-rw-r--r--nuttx/net/netdev/netdev_count.c1
-rw-r--r--nuttx/net/netdev/netdev_findbyaddr.c1
-rw-r--r--nuttx/net/netdev/netdev_findbyname.c1
-rw-r--r--nuttx/net/netdev/netdev_foreach.c1
-rw-r--r--nuttx/net/netdev/netdev_ioctl.c2
-rw-r--r--nuttx/net/netdev/netdev_register.c1
-rw-r--r--nuttx/net/netdev/netdev_rxnotify.c1
-rw-r--r--nuttx/net/netdev/netdev_sem.c1
-rw-r--r--nuttx/net/netdev/netdev_txnotify.c1
-rw-r--r--nuttx/net/netdev/netdev_unregister.c1
-rw-r--r--nuttx/net/pkt/pkt_send.c2
-rw-r--r--nuttx/net/route/net_addroute.c1
-rw-r--r--nuttx/net/route/net_allocroute.c1
-rw-r--r--nuttx/net/route/net_delroute.c1
-rw-r--r--nuttx/net/route/net_foreachroute.c1
-rw-r--r--nuttx/net/route/net_router.c1
-rw-r--r--nuttx/net/route/netdev_router.c1
-rw-r--r--nuttx/net/socket/Make.defs2
-rw-r--r--nuttx/net/socket/accept.c (renamed from nuttx/net/accept.c)4
-rw-r--r--nuttx/net/socket/bind.c (renamed from nuttx/net/bind.c)4
-rw-r--r--nuttx/net/socket/connect.c (renamed from nuttx/net/connect.c)4
-rw-r--r--nuttx/net/socket/getsockname.c (renamed from nuttx/net/getsockname.c)4
-rw-r--r--nuttx/net/socket/getsockopt.c (renamed from nuttx/net/getsockopt.c)4
-rw-r--r--nuttx/net/socket/listen.c (renamed from nuttx/net/listen.c)4
-rw-r--r--nuttx/net/socket/net_checksd.c (renamed from nuttx/net/net_checksd.c)4
-rw-r--r--nuttx/net/socket/net_clone.c (renamed from nuttx/net/net_clone.c)4
-rw-r--r--nuttx/net/socket/net_close.c (renamed from nuttx/net/net_close.c)4
-rw-r--r--nuttx/net/socket/net_dup.c (renamed from nuttx/net/net_dup.c)4
-rw-r--r--nuttx/net/socket/net_dup2.c (renamed from nuttx/net/net_dup2.c)4
-rw-r--r--nuttx/net/socket/net_monitor.c (renamed from nuttx/net/net_monitor.c)4
-rw-r--r--nuttx/net/socket/net_poll.c (renamed from nuttx/net/net_poll.c)4
-rw-r--r--nuttx/net/socket/net_sendfile.c (renamed from nuttx/net/net_sendfile.c)4
-rw-r--r--nuttx/net/socket/net_sockets.c (renamed from nuttx/net/net_sockets.c)4
-rw-r--r--nuttx/net/socket/net_timeo.c (renamed from nuttx/net/net_timeo.c)4
-rw-r--r--nuttx/net/socket/net_vfcntl.c (renamed from nuttx/net/net_vfcntl.c)4
-rw-r--r--nuttx/net/socket/recv.c (renamed from nuttx/net/recv.c)4
-rw-r--r--nuttx/net/socket/recvfrom.c (renamed from nuttx/net/recvfrom.c)4
-rw-r--r--nuttx/net/socket/send.c (renamed from nuttx/net/send.c)4
-rw-r--r--nuttx/net/socket/sendto.c (renamed from nuttx/net/sendto.c)4
-rw-r--r--nuttx/net/socket/setsockopt.c (renamed from nuttx/net/setsockopt.c)7
-rw-r--r--nuttx/net/socket/socket.c (renamed from nuttx/net/socket.c)4
-rw-r--r--nuttx/net/socket/socket.h (renamed from nuttx/net/net.h)11
-rw-r--r--nuttx/net/tcp/tcp_send_buffered.c2
-rw-r--r--nuttx/net/tcp/tcp_send_unbuffered.c2
-rw-r--r--nuttx/net/utils/Make.defs2
-rw-r--r--nuttx/net/utils/net_dsec2timeval.c2
-rw-r--r--nuttx/net/utils/net_timeval2dsec.c (renamed from nuttx/net/net_timeval2dsec.c)19
-rw-r--r--nuttx/net/utils/utils.h29
52 files changed, 97 insertions, 93 deletions
diff --git a/nuttx/net/arp/arp_timer.c b/nuttx/net/arp/arp_timer.c
index 059f1577a..75119a3e2 100644
--- a/nuttx/net/arp/arp_timer.c
+++ b/nuttx/net/arp/arp_timer.c
@@ -48,8 +48,6 @@
#include <nuttx/net/netconfig.h>
#include <nuttx/net/arp.h>
-#include "net.h"
-
#ifdef CONFIG_NET_ARP
/****************************************************************************
diff --git a/nuttx/net/icmp/icmp_ping.c b/nuttx/net/icmp/icmp_ping.c
index 0054f2096..1ba91d337 100644
--- a/nuttx/net/icmp/icmp_ping.c
+++ b/nuttx/net/icmp/icmp_ping.c
@@ -58,8 +58,6 @@
#include "uip/uip.h"
#include "icmp/icmp.h"
-#include "net.h"
-
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/nuttx/net/net_initialize.c b/nuttx/net/net_initialize.c
index 80366bc11..185a07943 100644
--- a/nuttx/net/net_initialize.c
+++ b/nuttx/net/net_initialize.c
@@ -46,7 +46,7 @@
#include <nuttx/net/net.h>
#include <nuttx/net/arp.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "tcp/tcp.h"
#include "udp/udp.h"
diff --git a/nuttx/net/netdev/netdev_carrier.c b/nuttx/net/netdev/netdev_carrier.c
index fb5e7e4d7..fb2dead4f 100644
--- a/nuttx/net/netdev/netdev_carrier.c
+++ b/nuttx/net/netdev/netdev_carrier.c
@@ -52,7 +52,6 @@
#include <net/ethernet.h>
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/netdev/netdev_count.c b/nuttx/net/netdev/netdev_count.c
index 1a67be883..7dace4993 100644
--- a/nuttx/net/netdev/netdev_count.c
+++ b/nuttx/net/netdev/netdev_count.c
@@ -45,7 +45,6 @@
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/netdev/netdev_findbyaddr.c b/nuttx/net/netdev/netdev_findbyaddr.c
index 1966d99f5..2ad23bdf9 100644
--- a/nuttx/net/netdev/netdev_findbyaddr.c
+++ b/nuttx/net/netdev/netdev_findbyaddr.c
@@ -47,7 +47,6 @@
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
#include "route/route.h"
diff --git a/nuttx/net/netdev/netdev_findbyname.c b/nuttx/net/netdev/netdev_findbyname.c
index 980808652..60a965441 100644
--- a/nuttx/net/netdev/netdev_findbyname.c
+++ b/nuttx/net/netdev/netdev_findbyname.c
@@ -45,7 +45,6 @@
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/netdev/netdev_foreach.c b/nuttx/net/netdev/netdev_foreach.c
index 9a5eb491b..f3e852e51 100644
--- a/nuttx/net/netdev/netdev_foreach.c
+++ b/nuttx/net/netdev/netdev_foreach.c
@@ -44,7 +44,6 @@
#include <nuttx/net/net.h>
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/netdev/netdev_ioctl.c b/nuttx/net/netdev/netdev_ioctl.c
index af555dda0..c4ca4ff18 100644
--- a/nuttx/net/netdev/netdev_ioctl.c
+++ b/nuttx/net/netdev/netdev_ioctl.c
@@ -63,7 +63,7 @@
# include "nuttx/net/igmp.h"
#endif
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "route/route.h"
diff --git a/nuttx/net/netdev/netdev_register.c b/nuttx/net/netdev/netdev_register.c
index c2e47e3be..6ed760ec8 100644
--- a/nuttx/net/netdev/netdev_register.c
+++ b/nuttx/net/netdev/netdev_register.c
@@ -52,7 +52,6 @@
#include <net/ethernet.h>
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/netdev/netdev_rxnotify.c b/nuttx/net/netdev/netdev_rxnotify.c
index 5473d934d..c14409c3c 100644
--- a/nuttx/net/netdev/netdev_rxnotify.c
+++ b/nuttx/net/netdev/netdev_rxnotify.c
@@ -47,7 +47,6 @@
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/netdev/netdev_sem.c b/nuttx/net/netdev/netdev_sem.c
index cf6557999..2a7fa07ca 100644
--- a/nuttx/net/netdev/netdev_sem.c
+++ b/nuttx/net/netdev/netdev_sem.c
@@ -48,7 +48,6 @@
#include <assert.h>
#include <errno.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/netdev/netdev_txnotify.c b/nuttx/net/netdev/netdev_txnotify.c
index f044f2d24..6ca3c5513 100644
--- a/nuttx/net/netdev/netdev_txnotify.c
+++ b/nuttx/net/netdev/netdev_txnotify.c
@@ -47,7 +47,6 @@
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/netdev/netdev_unregister.c b/nuttx/net/netdev/netdev_unregister.c
index 150e410f5..68114ccb7 100644
--- a/nuttx/net/netdev/netdev_unregister.c
+++ b/nuttx/net/netdev/netdev_unregister.c
@@ -52,7 +52,6 @@
#include <net/ethernet.h>
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************
diff --git a/nuttx/net/pkt/pkt_send.c b/nuttx/net/pkt/pkt_send.c
index bc2c2b33c..60fcb65e4 100644
--- a/nuttx/net/pkt/pkt_send.c
+++ b/nuttx/net/pkt/pkt_send.c
@@ -55,7 +55,7 @@
#include <nuttx/net/netdev.h>
#include <nuttx/net/pkt.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "uip/uip.h"
#include "pkt/pkt.h"
diff --git a/nuttx/net/route/net_addroute.c b/nuttx/net/route/net_addroute.c
index 8c842a1e2..5f537a346 100644
--- a/nuttx/net/route/net_addroute.c
+++ b/nuttx/net/route/net_addroute.c
@@ -46,7 +46,6 @@
#include <arch/irq.h>
-#include "net.h"
#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/route/net_allocroute.c b/nuttx/net/route/net_allocroute.c
index 9efa120ed..a8074b20c 100644
--- a/nuttx/net/route/net_allocroute.c
+++ b/nuttx/net/route/net_allocroute.c
@@ -45,7 +45,6 @@
#include <arch/irq.h>
-#include "net.h"
#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/route/net_delroute.c b/nuttx/net/route/net_delroute.c
index d1c84aa54..7bee168a9 100644
--- a/nuttx/net/route/net_delroute.c
+++ b/nuttx/net/route/net_delroute.c
@@ -43,7 +43,6 @@
#include <string.h>
#include <errno.h>
-#include "net.h"
#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/route/net_foreachroute.c b/nuttx/net/route/net_foreachroute.c
index aaf92b14c..0c0de44f1 100644
--- a/nuttx/net/route/net_foreachroute.c
+++ b/nuttx/net/route/net_foreachroute.c
@@ -44,7 +44,6 @@
#include <arch/irq.h>
-#include "net.h"
#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/route/net_router.c b/nuttx/net/route/net_router.c
index 37fa91036..1c04f0ea5 100644
--- a/nuttx/net/route/net_router.c
+++ b/nuttx/net/route/net_router.c
@@ -43,7 +43,6 @@
#include <string.h>
#include <errno.h>
-#include "net.h"
#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
diff --git a/nuttx/net/route/netdev_router.c b/nuttx/net/route/netdev_router.c
index d62fe5f0f..7af96259e 100644
--- a/nuttx/net/route/netdev_router.c
+++ b/nuttx/net/route/netdev_router.c
@@ -45,7 +45,6 @@
#include <nuttx/net/netdev.h>
-#include "net.h"
#include "netdev/netdev.h"
#include "route/route.h"
diff --git a/nuttx/net/socket/Make.defs b/nuttx/net/socket/Make.defs
index 1b310ca7d..f70c2d64f 100644
--- a/nuttx/net/socket/Make.defs
+++ b/nuttx/net/socket/Make.defs
@@ -50,7 +50,7 @@ endif
ifeq ($(CONFIG_NET_SOCKOPTS),y)
SOCK_CSRCS += setsockopt.c getsockopt.c
ifneq ($(CONFIG_DISABLE_CLOCK),y)
-SOCK_CSRCS += net_timeo.c net_timeval2dsec.c
+SOCK_CSRCS += net_timeo.c
endif
endif
diff --git a/nuttx/net/accept.c b/nuttx/net/socket/accept.c
index 6c04fa1c0..1908c9293 100644
--- a/nuttx/net/accept.c
+++ b/nuttx/net/socket/accept.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/accept.c
+ * net/socket/accept.c
*
* Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -53,7 +53,7 @@
#include <nuttx/net/tcp.h>
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/net/bind.c b/nuttx/net/socket/bind.c
index 1d55846b1..f399d3c99 100644
--- a/nuttx/net/bind.c
+++ b/nuttx/net/socket/bind.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/bind.c
+ * net/socket/bind.c
*
* Copyright (C) 2007-2009, 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -53,7 +53,7 @@
#include <nuttx/net/udp.h>
#include <nuttx/net/pkt.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "tcp/tcp.h"
#include "udp/udp.h"
diff --git a/nuttx/net/connect.c b/nuttx/net/socket/connect.c
index c7812c321..057d795bf 100644
--- a/nuttx/net/connect.c
+++ b/nuttx/net/socket/connect.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/connect.c
+ * net/socket/connect.c
*
* Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -52,7 +52,7 @@
#include <nuttx/net/tcp.h>
#include <nuttx/net/udp.h>
-#include "net.h"
+#include "socket/socket.h"
#include "uip/uip.h"
#include "tcp/tcp.h"
#include "udp/udp.h"
diff --git a/nuttx/net/getsockname.c b/nuttx/net/socket/getsockname.c
index fb05eb5af..45378f823 100644
--- a/nuttx/net/getsockname.c
+++ b/nuttx/net/socket/getsockname.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/getsockname.c
+ * net/socket/getsockname.c
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -50,7 +50,7 @@
#include <nuttx/net/tcp.h>
#include <nuttx/net/udp.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#ifdef CONFIG_NET
diff --git a/nuttx/net/getsockopt.c b/nuttx/net/socket/getsockopt.c
index 7d106b591..c7e66ed8e 100644
--- a/nuttx/net/getsockopt.c
+++ b/nuttx/net/socket/getsockopt.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/getsockopt.c
+ * net/socket/getsockopt.c
*
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <sys/socket.h>
#include <errno.h>
-#include "net.h"
+#include "socket/socket.h"
#include "utils/utils.h"
/****************************************************************************
diff --git a/nuttx/net/listen.c b/nuttx/net/socket/listen.c
index eb4e29f34..9eb9551a9 100644
--- a/nuttx/net/listen.c
+++ b/nuttx/net/socket/listen.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/listen.c
+ * net/socket/listen.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -46,7 +46,7 @@
#include <nuttx/net/tcp.h>
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Global Functions
diff --git a/nuttx/net/net_checksd.c b/nuttx/net/socket/net_checksd.c
index 77feab68a..67d783a09 100644
--- a/nuttx/net/net_checksd.c
+++ b/nuttx/net/socket/net_checksd.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_checksd.c
+ * net/socket/net_checksd.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -45,7 +45,7 @@
#include <errno.h>
#include <debug.h>
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Global Functions
diff --git a/nuttx/net/net_clone.c b/nuttx/net/socket/net_clone.c
index 52905da5e..0866d88f4 100644
--- a/nuttx/net/net_clone.c
+++ b/nuttx/net/socket/net_clone.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_clone.c
+ * net/socket/net_clone.c
*
* Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -48,7 +48,7 @@
#include <nuttx/net/tcp.h>
#include <nuttx/net/udp.h>
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Global Functions
diff --git a/nuttx/net/net_close.c b/nuttx/net/socket/net_close.c
index a2c57b6ef..7d0eab2b7 100644
--- a/nuttx/net/net_close.c
+++ b/nuttx/net/socket/net_close.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_close.c
+ * net/socket/net_close.c
*
* Copyright (C) 2007-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -57,7 +57,7 @@
# include <nuttx/clock.h>
#endif
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "uip/uip.h"
#include "pkt/pkt.h"
diff --git a/nuttx/net/net_dup.c b/nuttx/net/socket/net_dup.c
index 5f0185a12..0c8a35c0b 100644
--- a/nuttx/net/net_dup.c
+++ b/nuttx/net/socket/net_dup.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_dup.c
+ * net/socket/net_dup.c
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <errno.h>
#include <debug.h>
-#include "net.h"
+#include "socket/socket.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
diff --git a/nuttx/net/net_dup2.c b/nuttx/net/socket/net_dup2.c
index 3223fcf78..063123722 100644
--- a/nuttx/net/net_dup2.c
+++ b/nuttx/net/socket/net_dup2.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_dup2.c
+ * net/socket/net_dup2.c
*
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <errno.h>
#include <debug.h>
-#include "net.h"
+#include "socket/socket.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
diff --git a/nuttx/net/net_monitor.c b/nuttx/net/socket/net_monitor.c
index afbe1121c..25bcff8cb 100644
--- a/nuttx/net/net_monitor.c
+++ b/nuttx/net/socket/net_monitor.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_monitor.c
+ * net/socket/net_monitor.c
*
* Copyright (C) 2007-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -46,7 +46,7 @@
#include <nuttx/net/tcp.h>
-#include "net.h"
+#include "socket/socket.h"
#include "uip/uip.h"
/****************************************************************************
diff --git a/nuttx/net/net_poll.c b/nuttx/net/socket/net_poll.c
index d865631a6..bb40c0b54 100644
--- a/nuttx/net/net_poll.c
+++ b/nuttx/net/socket/net_poll.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_poll.c
+ * net/socket/net_poll.c
*
* Copyright (C) 2008-2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -58,7 +58,7 @@
#include <uip/uip.h>
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/net/net_sendfile.c b/nuttx/net/socket/net_sendfile.c
index c5f249b51..07396a1b7 100644
--- a/nuttx/net/net_sendfile.c
+++ b/nuttx/net/socket/net_sendfile.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_sendfile.c
+ * net/socket/net_sendfile.c
*
* Copyright (C) 2013 UVC Ingenieure. All rights reserved.
* Copyright (C) 2007-2013 Gregory Nutt. All rights reserved.
@@ -61,7 +61,7 @@
#include <nuttx/net/arp.h>
#include <nuttx/net/netdev.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "uip/uip.h"
diff --git a/nuttx/net/net_sockets.c b/nuttx/net/socket/net_sockets.c
index 1b237e3ce..d1ece6c18 100644
--- a/nuttx/net/net_sockets.c
+++ b/nuttx/net/socket/net_sockets.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_sockets.c
+ * net/socket/net_sockets.c
*
* Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -51,7 +51,7 @@
#include <nuttx/net/net.h>
#include <nuttx/kmalloc.h>
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/net/net_timeo.c b/nuttx/net/socket/net_timeo.c
index 551aa188f..062106092 100644
--- a/nuttx/net/net_timeo.c
+++ b/nuttx/net/socket/net_timeo.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_timeo.c
+ * net/socket/net_timeo.c
*
* Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -45,7 +45,7 @@
#include <nuttx/clock.h>
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Global Functions
diff --git a/nuttx/net/net_vfcntl.c b/nuttx/net/socket/net_vfcntl.c
index 50da8a020..e251af8a5 100644
--- a/nuttx/net/net_vfcntl.c
+++ b/nuttx/net/socket/net_vfcntl.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/net_vfcntl.c
+ * net/socket/net_vfcntl.c
*
* Copyright (C) 2009, 2012-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -47,7 +47,7 @@
#include <arch/irq.h>
#include <nuttx/net/net.h>
-#include "net.h"
+#include "socket/socket.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
diff --git a/nuttx/net/recv.c b/nuttx/net/socket/recv.c
index 8ddb4bce6..cac55d84a 100644
--- a/nuttx/net/recv.c
+++ b/nuttx/net/socket/recv.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/recv.c
+ * net/socket/recv.c
*
* Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <sys/socket.h>
#include <errno.h>
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Global Functions
diff --git a/nuttx/net/recvfrom.c b/nuttx/net/socket/recvfrom.c
index 9c6c576fd..8a74e3b3e 100644
--- a/nuttx/net/recvfrom.c
+++ b/nuttx/net/socket/recvfrom.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/recvfrom.c
+ * net/socket/recvfrom.c
*
* Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -60,7 +60,7 @@
#include <nuttx/net/udp.h>
#include <nuttx/net/pkt.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "uip/uip.h"
#include "tcp/tcp.h"
diff --git a/nuttx/net/send.c b/nuttx/net/socket/send.c
index b52194905..c9e7e969b 100644
--- a/nuttx/net/send.c
+++ b/nuttx/net/socket/send.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/send.c
+ * net/socket/send.c
*
* Copyright (C) 2007-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -47,7 +47,7 @@
#include "tcp/tcp.h"
#include "pkt/pkt.h"
-#include "net.h"
+#include "socket/socket.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/net/sendto.c b/nuttx/net/socket/sendto.c
index e88f69175..846050f82 100644
--- a/nuttx/net/sendto.c
+++ b/nuttx/net/socket/sendto.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/sendto.c
+ * net/socket/sendto.c
*
* Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -52,7 +52,7 @@
#include <nuttx/net/netdev.h>
#include <nuttx/net/udp.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "uip/uip.h"
#include "udp/udp.h"
diff --git a/nuttx/net/setsockopt.c b/nuttx/net/socket/setsockopt.c
index e6fc2d092..fdd9e2e3a 100644
--- a/nuttx/net/setsockopt.c
+++ b/nuttx/net/socket/setsockopt.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/setsockopt.c
+ * net/socket/setsockopt.c
*
* Copyright (C) 2007, 2008, 2011-2012, 2014 Gregory Nutt. All rights
* reserved.
@@ -46,7 +46,8 @@
#include <errno.h>
#include <arch/irq.h>
-#include "net.h"
+#include "socket/socket.h"
+#include "utils/utils.h"
/****************************************************************************
* Global Functions
@@ -184,7 +185,7 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option,
/* Get the timeout value */
- timeo = net_timeval2dsec((struct timeval *)value);
+ timeo = (socktimeo_t)net_timeval2dsec((struct timeval *)value);
/* Save the timeout value */
diff --git a/nuttx/net/socket.c b/nuttx/net/socket/socket.c
index 8676875c1..2c7e7a071 100644
--- a/nuttx/net/socket.c
+++ b/nuttx/net/socket/socket.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/socket.c
+ * net/socket/socket.c
*
* Copyright (C) 2007-2009, 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -49,7 +49,7 @@
#include <nuttx/net/udp.h>
#include <nuttx/net/pkt.h>
-#include "net.h"
+#include "socket/socket.h"
#include "tcp/tcp.h"
#include "udp/udp.h"
#include "pkt/pkt.h"
diff --git a/nuttx/net/net.h b/nuttx/net/socket/socket.h
index c5990d491..6989d32ee 100644
--- a/nuttx/net/net.h
+++ b/nuttx/net/socket/socket.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/net.h
+ * net/socket/socket.h
*
- * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-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_H
-#define _NET_NET_H
+#ifndef _NET_SOCKET_SOCKET_H
+#define _NET_SOCKET_SOCKET_H
/****************************************************************************
* Included Files
@@ -177,7 +177,6 @@ int psock_close(FAR struct socket *psock);
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
int net_timeo(uint32_t start_time, socktimeo_t timeo);
-socktimeo_t net_timeval2dsec(FAR struct timeval *tv);
#endif
/* send.c ********************************************************************/
@@ -191,4 +190,4 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len,
#endif
#endif /* CONFIG_NET */
-#endif /* _NET_NET_H */
+#endif /* _NET_SOCKET_SOCKET_H */
diff --git a/nuttx/net/tcp/tcp_send_buffered.c b/nuttx/net/tcp/tcp_send_buffered.c
index d51a6efbf..f9af6e0a8 100644
--- a/nuttx/net/tcp/tcp_send_buffered.c
+++ b/nuttx/net/tcp/tcp_send_buffered.c
@@ -68,7 +68,7 @@
#include <nuttx/net/netdev.h>
#include <nuttx/net/tcp.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "tcp/tcp.h"
#include "uip/uip.h"
diff --git a/nuttx/net/tcp/tcp_send_unbuffered.c b/nuttx/net/tcp/tcp_send_unbuffered.c
index 39474cfc3..6a3d5062f 100644
--- a/nuttx/net/tcp/tcp_send_unbuffered.c
+++ b/nuttx/net/tcp/tcp_send_unbuffered.c
@@ -56,7 +56,7 @@
#include <nuttx/net/netdev.h>
#include <nuttx/net/tcp.h>
-#include "net.h"
+#include "socket/socket.h"
#include "netdev/netdev.h"
#include "uip/uip.h"
#include "tcp/tcp.h"
diff --git a/nuttx/net/utils/Make.defs b/nuttx/net/utils/Make.defs
index 376398bf4..dd3ad35a5 100644
--- a/nuttx/net/utils/Make.defs
+++ b/nuttx/net/utils/Make.defs
@@ -33,7 +33,7 @@
#
############################################################################
-NET_CSRCS += net_dsec2timeval.c net_chksum.c
+NET_CSRCS += net_dsec2timeval.c net_timeval2dsec.c net_chksum.c
# Non-interrupt level support required?
diff --git a/nuttx/net/utils/net_dsec2timeval.c b/nuttx/net/utils/net_dsec2timeval.c
index 92b93cd42..df6db20db 100644
--- a/nuttx/net/utils/net_dsec2timeval.c
+++ b/nuttx/net/utils/net_dsec2timeval.c
@@ -44,7 +44,7 @@
#include <errno.h>
#include <nuttx/clock.h>
-#include "net.h"
+#include "utils/utils.h"
/****************************************************************************
* Public Functions
diff --git a/nuttx/net/net_timeval2dsec.c b/nuttx/net/utils/net_timeval2dsec.c
index f61f1a179..12fafab7f 100644
--- a/nuttx/net/net_timeval2dsec.c
+++ b/nuttx/net/utils/net_timeval2dsec.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/net_timeval2dsec.c
+ * net/utils/net_timeval2dsec.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,14 +38,11 @@
****************************************************************************/
#include <nuttx/config.h>
-#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
+#if defined(CONFIG_NET) && !defined(CONFIG_DISABLE_CLOCK)
-#include <sys/socket.h>
-#include <stdint.h>
-#include <errno.h>
#include <nuttx/clock.h>
-#include "net.h"
+#include "utils/utils.h"
/****************************************************************************
* Global Functions
@@ -62,15 +59,15 @@
* tv The struct timeval to convert
*
* Returned Value:
- * the converted value
+ * The converted value
*
* Assumptions:
*
****************************************************************************/
-socktimeo_t net_timeval2dsec(struct timeval *tv)
+unsigned int net_timeval2dsec(struct timeval *tv)
{
- return (uint16_t)(tv->tv_sec* DSEC_PER_SEC + tv->tv_usec / USEC_PER_DSEC);
+ return (unsigned int)(tv->tv_sec * DSEC_PER_SEC + tv->tv_usec / USEC_PER_DSEC);
}
-#endif /* CONFIG_NET && CONFIG_NET_SOCKOPTS && !CONFIG_DISABLE_CLOCK */
+#endif /* CONFIG_NET && !CONFIG_DISABLE_CLOCK */
diff --git a/nuttx/net/utils/utils.h b/nuttx/net/utils/utils.h
index 1ccd0aedc..152cd4a24 100644
--- a/nuttx/net/utils/utils.h
+++ b/nuttx/net/utils/utils.h
@@ -66,6 +66,11 @@ extern "C"
* Public Function Prototypes
****************************************************************************/
+struct net_driver_s; /* Forward reference */
+#if !defined(CONFIG_DISABLE_CLOCK)
+struct timeval; /* Forward reference */
+#endif
+
/****************************************************************************
* Function: net_dsec2timeval
*
@@ -84,8 +89,30 @@ extern "C"
*
****************************************************************************/
-struct timeval;
+#if !defined(CONFIG_DISABLE_CLOCK)
void net_dsec2timeval(uint16_t dsec, FAR struct timeval *tv);
+#endif
+
+/****************************************************************************
+ * Function: net_timeval2dsec
+ *
+ * Description:
+ * Convert a struct timeval to deciseconds. Needed by setsockopt() to
+ * save new timeout values.
+ *
+ * Parameters:
+ * tv The struct timeval to convert
+ *
+ * Returned Value:
+ * The converted value
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+#if !defined(CONFIG_DISABLE_CLOCK)
+unsigned int net_timeval2dsec(FAR struct timeval *tv);
+#endif
/****************************************************************************
* Name: tcp_chksum