1
0
Fork 0
forked from nuttx/nuttx-update

Move all socket-related files from net/ to net/socket. Move net/net.h to net/socket/socket.h

This commit is contained in:
Gregory Nutt 2014-06-28 17:25:18 -06:00
parent 64c8dba8c4
commit 76fa58ee00
52 changed files with 97 additions and 93 deletions

View file

@ -48,8 +48,6 @@
#include <nuttx/net/netconfig.h>
#include <nuttx/net/arp.h>
#include "net.h"
#ifdef CONFIG_NET_ARP
/****************************************************************************

View file

@ -58,8 +58,6 @@
#include "uip/uip.h"
#include "icmp/icmp.h"
#include "net.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

View file

@ -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"

View file

@ -52,7 +52,6 @@
#include <net/ethernet.h>
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -45,7 +45,6 @@
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -47,7 +47,6 @@
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
#include "route/route.h"

View file

@ -45,7 +45,6 @@
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -44,7 +44,6 @@
#include <nuttx/net/net.h>
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -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"

View file

@ -52,7 +52,6 @@
#include <net/ethernet.h>
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -47,7 +47,6 @@
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -48,7 +48,6 @@
#include <assert.h>
#include <errno.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -47,7 +47,6 @@
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -52,7 +52,6 @@
#include <net/ethernet.h>
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
/****************************************************************************

View file

@ -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"

View file

@ -46,7 +46,6 @@
#include <arch/irq.h>
#include "net.h"
#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)

View file

@ -45,7 +45,6 @@
#include <arch/irq.h>
#include "net.h"
#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)

View file

@ -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)

View file

@ -44,7 +44,6 @@
#include <arch/irq.h>
#include "net.h"
#include "route/route.h"
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)

View file

@ -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)

View file

@ -45,7 +45,6 @@
#include <nuttx/net/netdev.h>
#include "net.h"
#include "netdev/netdev.h"
#include "route/route.h"

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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

View file

@ -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"
/****************************************************************************

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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"
/****************************************************************************

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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 */

View file

@ -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"

View file

@ -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 */

View file

@ -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"

View file

@ -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"

View file

@ -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?

View file

@ -44,7 +44,7 @@
#include <errno.h>
#include <nuttx/clock.h>
#include "net.h"
#include "utils/utils.h"
/****************************************************************************
* Public Functions

View file

@ -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 */

View file

@ -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