net: remove CONFIG_NET_TCP
authorEunBong Song <eunb.song@samsung.com>
Mon, 13 Mar 2017 11:47:30 +0000 (20:47 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Mon, 17 Apr 2017 10:00:52 +0000 (19:00 +0900)
CONFIG_NET_TCP is a Nuttx legacy feature and not supported anymore.
Let's remove all codes which are related CONFIG_NET_TCP.

Change-Id: I2817d27336bd979ff330159d42dab922157f90ae
Signed-off-by: EunBong Song <eunb.song@samsung.com>
13 files changed:
apps/netutils/ftpc/Makefile
apps/netutils/ftpd/Makefile
apps/netutils/netlib/Makefile
apps/netutils/smtp/Makefile
apps/netutils/webserver/Kconfig
apps/netutils/xmlrpc/Kconfig
apps/netutils/xmlrpc/Makefile
apps/system/utils/netcmd.c
os/fs/aio/aio.h
os/fs/vfs/fs_write.c
os/include/tinyara/net/netdev.h
os/net/socket/net_monitor.c [deleted file]
os/tools/mkconfig.c

index ed08b08..2a6f387 100644 (file)
@@ -59,7 +59,6 @@ include $(APPDIR)/Make.defs
 ASRCS          =
 CSRCS          =
 
-ifeq ($(CONFIG_NET_TCP),y)
 # FTP connection management
 CSRCS = ftpc_connect.c ftpc_disconnect.c
 
@@ -77,7 +76,6 @@ CSRCS += ftpc_response.c ftpc_getreply.c
 
 # FTP helpers
 CSRCS += ftpc_utils.c ftpc_socket.c
-endif
 
 AOBJS          = $(ASRCS:.S=$(OBJEXT))
 COBJS          = $(CSRCS:.c=$(OBJEXT))
index db697d7..062530e 100644 (file)
@@ -59,13 +59,9 @@ include $(APPDIR)/Make.defs
 ASRCS          =
 CSRCS          =
 
-ifeq ($(CONFIG_NET_TCP),y)
-CSRCS          += ftpd.c
-else
 ifeq ($(CONFIG_NET_LWIP),y)
 CSRCS          += ftpd.c
 endif
-endif
 
 
 AOBJS          = $(ASRCS:.S=$(OBJEXT))
index b804661..b9d6cfc 100644 (file)
@@ -76,13 +76,6 @@ CSRCS += netlib_autoconfig.c
 endif
 endif
 
-# These require TCP support
-
-ifeq ($(CONFIG_NET_TCP),y)
-ifeq ($(CONFIG_NET_IPv4),y) # Not yet available for IPv6
-CSRCS += netlib_server.c netlib_listenon.c
-endif
-endif
 
 # No MAC address support for SLIP (Ethernet only)
 
index 841115d..ef583b9 100644 (file)
@@ -59,9 +59,7 @@ include $(APPDIR)/Make.defs
 ASRCS          =
 CSRCS          =
 
-ifeq ($(CONFIG_NET_TCP),y)
 CSRCS          += smtp.c
-endif
 
 AOBJS          = $(ASRCS:.S=$(OBJEXT))
 COBJS          = $(CSRCS:.c=$(OBJEXT))
index 91b6978..543251e 100644 (file)
@@ -6,7 +6,6 @@
 config NETUTILS_WEBSERVER
        bool "TinyAra Webserver"
        default n
-#      depends on NET_TCP
        ---help---
                Enable TinyAra Webserver.
 
index c5d9fa6..3634796 100644 (file)
@@ -6,7 +6,6 @@
 config NETUTILS_XMLRPC
        bool "XML RPC library"
        default n
-       depends on NET_TCP
        select NETUTILS_NETLIB
        ---help---
                Enables the Embeddable Lightweight XML-RPC Server discussed at
index b32ac0f..be48667 100644 (file)
@@ -60,9 +60,7 @@ include $(APPDIR)/Make.defs
 ASRCS          =
 CSRCS          =
 
-ifeq ($(CONFIG_NET_TCP),y)
 CSRCS          += xmlparser.c response.c
-endif
 
 AOBJS          = $(ASRCS:.S=$(OBJEXT))
 COBJS          = $(CSRCS:.c=$(OBJEXT))
index 0594cee..1fa2ecf 100644 (file)
 #include <apps/netutils/tftp.h>
 #endif
 
-#if defined(CONFIG_NET_TCP) && CONFIG_NFILE_DESCRIPTORS > 0
-#include <apps/netutils/netlib.h>
-#include <apps/netutils/webclient.h>
-#endif
-
 #if defined(CONFIG_NETUTILS_DHCPC) || defined(CONFIG_SYSTEM_NETDB)
 #ifdef CONFIG_HAVE_GETHOSTBYNAME
 #include <netdb.h>
@@ -198,9 +193,6 @@ static inline void net_statistics()
 #ifdef CONFIG_NET_IPv6
        printf("  IPv6");
 #endif
-#ifdef CONFIG_NET_TCP
-       printf("   TCP");
-#endif
 #ifdef CONFIG_NET_UDP
        printf("   UDP");
 #endif
@@ -221,9 +213,6 @@ static inline void net_statistics()
 #ifdef CONFIG_NET_IPv6
        printf("  %04x", g_netstats.ipv6.recv);
 #endif
-#ifdef CONFIG_NET_TCP
-       printf("  %04x", g_netstats.tcp.recv);
-#endif
 #ifdef CONFIG_NET_UDP
        printf("  %04x", g_netstats.udp.recv);
 #endif
@@ -244,9 +233,6 @@ static inline void net_statistics()
 #ifdef CONFIG_NET_IPv6
        printf("  %04x", g_netstats.ipv6.drop);
 #endif
-#ifdef CONFIG_NET_TCP
-       printf("  %04x", g_netstats.tcp.drop);
-#endif
 #ifdef CONFIG_NET_UDP
        printf("  %04x", g_netstats.udp.drop);
 #endif
@@ -276,9 +262,6 @@ static inline void net_statistics()
 #ifdef CONFIG_NET_IPv6
        printf("  ----");
 #endif
-#ifdef CONFIG_NET_TCP
-       printf("  %04x", g_netstats.tcp.chkerr);
-#endif
 #ifdef CONFIG_NET_UDP
        printf("  %04x", g_netstats.udp.chkerr);
 #endif
@@ -290,11 +273,6 @@ static inline void net_statistics()
 #endif
        printf("\n");
 
-#ifdef CONFIG_NET_TCP
-       printf("  TCP         ACK: %04x   SYN: %04x\n", g_netstats.tcp.ackerr, g_netstats.tcp.syndrop);
-       printf("              RST: %04x  %04x\n", g_netstats.tcp.rst, g_netstats.tcp.synrst);
-#endif
-
        /* Prototype errors */
 
        printf("  Type     ");
@@ -304,9 +282,6 @@ static inline void net_statistics()
 #ifdef CONFIG_NET_IPv6
        printf("  %04x", g_netstats.ipv6.protoerr);
 #endif
-#ifdef CONFIG_NET_TCP
-       printf("  ----");
-#endif
 #ifdef CONFIG_NET_UDP
        printf("  ----");
 #endif
@@ -327,9 +302,6 @@ static inline void net_statistics()
 #ifdef CONFIG_NET_IPv6
        printf("  %04x", g_netstats.ipv6.sent);
 #endif
-#ifdef CONFIG_NET_TCP
-       printf("  %04x", g_netstats.tcp.sent);
-#endif
 #ifdef CONFIG_NET_UDP
        printf("  %04x", g_netstats.udp.sent);
 #endif
@@ -340,29 +312,6 @@ static inline void net_statistics()
        printf("  %04x", g_netstats.icmpv6.sent);
 #endif
        printf("\n");
-
-       /* TCP retransmissions */
-
-#ifdef CONFIG_NET_TCP
-       printf("  Rexmit   ");
-#ifdef CONFIG_NET_IPv4
-       printf("  ----");
-#endif
-#ifdef CONFIG_NET_IPv6
-       printf("  ----");
-#endif
-       printf("  %04x", g_netstats.tcp.rexmit);
-#ifdef CONFIG_NET_UDP
-       printf("  ----");
-#endif
-#ifdef CONFIG_NET_ICMP
-       printf("  ----");
-#endif
-#ifdef CONFIG_NET_ICMPv6
-       printf("  ----");
-#endif
-       printf("\n");
-#endif                                                 /* CONFIG_NET_TCP */
 }
 #else
 #define net_statistics()
index b7d8949..d4bb04c 100644 (file)
 #define AIO_HAVE_FILEP
 #endif
 
-#if defined(CONFIG_NET_TCP) && CONFIG_NSOCKET_DESCRIPTORS > 0
-#define AIO_HAVE_PSOCK
-#endif
-
 #if !defined(AIO_HAVE_FILEP)
 #error AIO needs file and/or socket descriptors
 #endif
index 366f8b4..f865d67 100644 (file)
@@ -189,7 +189,7 @@ ssize_t write(int fd, FAR const void *buf, size_t nbytes)
        {
                /* Write to a socket descriptor is equivalent to send with flags == 0 */
 
-#if (defined(CONFIG_NET_TCP) || defined(CONFIG_NET_LWIP)) && CONFIG_NSOCKET_DESCRIPTORS > 0
+#if defined(CONFIG_NET_LWIP) && CONFIG_NSOCKET_DESCRIPTORS > 0
                ret = send(fd, buf, nbytes, 0);
 #else
                set_errno(EBADF);
index baa5b79..bde8c31 100644 (file)
@@ -116,9 +116,6 @@ struct net_driver_s {
        uint8_t d_lltype;                       /* See enum net_lltype_e */
        uint8_t d_llhdrlen;                     /* Link layer header size */
        uint16_t d_mtu;                         /* Maximum packet size */
-#ifdef CONFIG_NET_TCP
-       uint16_t d_recvwndo;            /* TCP receive window size */
-#endif
 #endif
 
 #ifdef CONFIG_NET_ETHERNET
diff --git a/os/net/socket/net_monitor.c b/os/net/socket/net_monitor.c
deleted file mode 100644 (file)
index 68ad2eb..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/****************************************************************************
- *
- * Copyright 2016 Samsung Electronics All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * net/socket/net_monitor.c
- *
- *   Copyright (C) 2007-2013 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.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <tinyara/config.h>
-#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
-
-#include <stdint.h>
-#include <assert.h>
-#include <debug.h>
-
-#include "socket/socket.h"
-
-/* TODO: Support with LWIP socket layer */
-
-#if 0
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-static void connection_event(FAR struct tcp_conn_s *conn, uint16_t flags);
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-/****************************************************************************
- * Name: connection_event
- *
- * Description:
- *   Some connection related event has occurred
- *
- * Parameters:
- *   conn     The connection structure associated with the socket
- *   flags    Set of events describing why the callback was invoked
- *
- * Returned Value:
- *   None
- *
- * Assumptions:
- *   Running at the interrupt level
- *
- ****************************************************************************/
-
-static void connection_event(FAR struct tcp_conn_s *conn, uint16_t flags)
-{
-       FAR struct socket *psock = (FAR struct socket *)conn->connection_private;
-
-       if (psock) {
-               nllvdbg("flags: %04x s_flags: %02x\n", flags, psock->s_flags);
-
-               /* TCP_CLOSE, TCP_ABORT, or TCP_TIMEDOUT: Loss-of-connection events */
-
-               if ((flags & (TCP_CLOSE | TCP_ABORT | TCP_TIMEDOUT)) != 0) {
-                       net_lostconnection(psock, flags);
-               }
-
-               /* TCP_CONNECTED: The socket is successfully connected */
-
-               else if ((flags & TCP_CONNECTED) != 0) {
-                       /* Indicate that the socket is now connected */
-
-                       psock->s_flags |= _SF_CONNECTED;
-                       psock->s_flags &= ~_SF_CLOSED;
-               }
-       }
-}
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-/****************************************************************************
- * Name: net_startmonitor
- *
- * Description:
- *   Set up to receive TCP connection state changes for a given socket
- *
- * Input Parameters:
- *   psock - The socket of interest
- *
- * Returned Value:
- *   For now, this function always returns OK.
- *
- ****************************************************************************/
-
-int net_startmonitor(FAR struct socket *psock)
-{
-       FAR struct tcp_conn_s *conn = psock->s_conn;
-
-       DEBUGASSERT(psock && conn);
-
-       /* Set up to receive callbacks on connection-related events */
-
-       conn->connection_private = (void *)psock;
-       conn->connection_event = connection_event;
-
-       /* Check if the connection has already been closed before any callbacks have
-        * been registered. (Maybe the connection is lost before accept has registered
-        * the monitoring callback.)
-        */
-
-       if (!(conn->tcpstateflags == TCP_ESTABLISHED || conn->tcpstateflags == TCP_SYN_RCVD)) {
-               connection_event(conn, TCP_CLOSE);
-       }
-
-       return OK;
-}
-
-/****************************************************************************
- * Name: net_stopmonitor
- *
- * Description:
- *   Stop monitoring TCP connection changes for a given socket
- *
- * Input Parameters:
- *   conn - The TCP connection of interest
- *
- * Returned Value:
- *   None
- *
- ****************************************************************************/
-
-void net_stopmonitor(FAR struct tcp_conn_s *conn)
-{
-       DEBUGASSERT(conn);
-
-       conn->connection_private = NULL;
-       conn->connection_event = NULL;
-}
-
-/****************************************************************************
- * Name: net_lostconnection
- *
- * Description:
- *   Called when a loss-of-connection event has occurred.
- *
- * Parameters:
- *   psock    The TCP socket structure associated.
- *   flags    Set of connection events events
- *
- * Returned Value:
- *   None
- *
- * Assumptions:
- *   Running at the interrupt level
- *
- ****************************************************************************/
-
-void net_lostconnection(FAR struct socket *psock, uint16_t flags)
-{
-       DEBUGASSERT(psock)
-
-       /* These loss-of-connection events may be reported:
-        *
-        *   TCP_CLOSE: The remote host has closed the connection
-        *   TCP_ABORT: The remote host has aborted the connection
-        *   TCP_TIMEDOUT: Connection aborted due to too many retransmissions.
-        *
-        * And we need to set these two socket status bits appropriately:
-        *
-        *  _SF_CONNECTED==1 && _SF_CLOSED==0 - the socket is connected
-        *  _SF_CONNECTED==0 && _SF_CLOSED==1 - the socket was gracefully disconnected
-        *  _SF_CONNECTED==0 && _SF_CLOSED==0 - the socket was rudely disconnected
-        */
-       if ((flags & TCP_CLOSE) != 0) {
-               /* The peer gracefully closed the connection.  Marking the
-                * connection as disconnected will suppress some subsequent
-                * ENOTCONN errors from receive.  A graceful disconnection is
-                * not handle as an error but as an "end-of-file"
-                */
-
-               psock->s_flags &= ~_SF_CONNECTED;
-               psock->s_flags |= _SF_CLOSED;
-       } else if ((flags & (TCP_ABORT | TCP_TIMEDOUT)) != 0) {
-               /* The loss of connection was less than graceful.  This will (eventually)
-                * be reported as an ENOTCONN error.
-                */
-
-               psock->s_flags &= ~(_SF_CONNECTED | _SF_CLOSED);
-       }
-}
-#endif
-#endif                                                 /* CONFIG_NET && CONFIG_NET_TCP */
index bb4e16f..af39622 100644 (file)
@@ -275,7 +275,6 @@ int main(int argc, char **argv, char **envp)
        printf("#endif\n\n");
        printf("/* Protocol support can only be provided on top of basic network support */\n\n");
        printf("#ifndef CONFIG_NET\n");
-       printf("# undef CONFIG_NET_TCP\n");
        printf("# undef CONFIG_NET_UDP\n");
        printf("# undef CONFIG_NET_ICMP\n");
        printf("#endif\n\n");