diff --git a/include/net/net_context.h b/include/net/net_context.h index 85f1b84219..3040c9f3b1 100644 --- a/include/net/net_context.h +++ b/include/net/net_context.h @@ -252,10 +252,10 @@ __net_socket struct net_context { net_pkt_get_pool_func_t data_pool; #endif /* CONFIG_NET_CONTEXT_NET_PKT_POOL */ -#if defined(CONFIG_NET_TCP2) +#if defined(CONFIG_NET_TCP) /** TCP connection information */ void *tcp; -#endif /* CONFIG_NET_TCP2 */ +#endif /* CONFIG_NET_TCP */ #if defined(CONFIG_NET_CONTEXT_SYNC_RECV) /** diff --git a/include/net/net_pkt.h b/include/net/net_pkt.h index 57acfc683d..50bdeb329b 100644 --- a/include/net/net_pkt.h +++ b/include/net/net_pkt.h @@ -128,7 +128,7 @@ struct net_pkt { struct net_linkaddr lladdr_src; struct net_linkaddr lladdr_dst; -#if defined(CONFIG_NET_TCP2) +#if defined(CONFIG_NET_TCP) /** Allow placing the packet into sys_slist_t */ sys_snode_t next; #endif diff --git a/samples/net/sockets/echo_server/src/common.h b/samples/net/sockets/echo_server/src/common.h index 94985148af..4c387bd684 100644 --- a/samples/net/sockets/echo_server/src/common.h +++ b/samples/net/sockets/echo_server/src/common.h @@ -7,7 +7,7 @@ #define MY_PORT 4242 -#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) || defined(CONFIG_NET_TCP2) || \ +#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) || defined(CONFIG_NET_TCP) || \ defined(CONFIG_COVERAGE) #define STACK_SIZE 4096 #else diff --git a/samples/net/sockets/tcp/README.rst b/samples/net/sockets/tcp/README.rst index 36ce6d9280..d574fdfcf9 100644 --- a/samples/net/sockets/tcp/README.rst +++ b/samples/net/sockets/tcp/README.rst @@ -7,10 +7,10 @@ Overview ******** This application is used together with the TTCN-3 based sanity check -to validate the functionality of the experimental TCP (TCP2). +to validate the functionality of the TCP. -Building, Running and executing TTCN-3 based Sanity Check for TCP2 -****************************************************************** +Building, Running and executing TTCN-3 based Sanity Check for TCP +***************************************************************** Compile and start the `net-test-tools`_: @@ -29,7 +29,7 @@ Build the TCP sample app: cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG="overlay-slip.conf" .. make run -Compile and run the TCP2 sanity check `net-test-suites`_: +Compile and run the TCP sanity check `net-test-suites`_: .. code-block:: console diff --git a/samples/net/sockets/tcp/sample.yaml b/samples/net/sockets/tcp/sample.yaml index 4988106ac5..68609b8fa5 100644 --- a/samples/net/sockets/tcp/sample.yaml +++ b/samples/net/sockets/tcp/sample.yaml @@ -1,3 +1,3 @@ sample: - description: A sample for running TTCN-3 based sanity check for TCP2 + description: A sample for running TTCN-3 based sanity check for TCP name: tcp diff --git a/samples/net/sockets/tcp/src/main.c b/samples/net/sockets/tcp/src/main.c index 88e6e79001..9c51849053 100644 --- a/samples/net/sockets/tcp/src/main.c +++ b/samples/net/sockets/tcp/src/main.c @@ -25,13 +25,13 @@ do { \ /* * This application is used together with the TTCN-3 based sanity check - * to validate the functionality of the experimental TCP (TCP2). + * to validate the functionality of the TCP. * * samples/net/sockets/tcp/README.rst * * Eventually UDP based test protocol might be terminated in the user space * (see udp() below), but at the moment it's just a dummy loop - * to keep the sample running in order to execute TTCN-3 TCP2 sanity check. + * to keep the sample running in order to execute TTCN-3 TCP sanity check. */ void main(void) { diff --git a/subsys/net/Kconfig b/subsys/net/Kconfig index e9749895ef..c4ea412d3c 100644 --- a/subsys/net/Kconfig +++ b/subsys/net/Kconfig @@ -15,9 +15,9 @@ if NET_BUF config NET_BUF_USER_DATA_SIZE int "Size of user_data available in every network buffer" - default 8 if ((BT || NET_TCP2) && 64BIT) || BT_ISO + default 8 if ((BT || NET_TCP) && 64BIT) || BT_ISO default 4 - range 4 65535 if BT || NET_TCP2 + range 4 65535 if BT || NET_TCP range 0 65535 help Amount of memory reserved in each network buffer for user data. In diff --git a/subsys/net/ip/CMakeLists.txt b/subsys/net/ip/CMakeLists.txt index 997324b382..337e9a81ee 100644 --- a/subsys/net/ip/CMakeLists.txt +++ b/subsys/net/ip/CMakeLists.txt @@ -34,7 +34,7 @@ zephyr_library_sources_ifdef(CONFIG_NET_IPV6_MLD ipv6_mld.c) zephyr_library_sources_ifdef(CONFIG_NET_IPV6_FRAGMENT ipv6_fragment.c) zephyr_library_sources_ifdef(CONFIG_NET_ROUTE route.c) zephyr_library_sources_ifdef(CONFIG_NET_STATISTICS net_stats.c) -zephyr_library_sources_ifdef(CONFIG_NET_TCP2 connection.c tcp2.c) +zephyr_library_sources_ifdef(CONFIG_NET_TCP connection.c tcp.c) zephyr_library_sources_ifdef(CONFIG_NET_TEST_PROTOCOL tp.c) zephyr_library_sources_ifdef(CONFIG_NET_TRICKLE trickle.c) zephyr_library_sources_ifdef(CONFIG_NET_UDP connection.c udp.c) diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index 2c0bd1cd19..18dc37fe37 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -423,7 +423,7 @@ config NET_TCP_RETRY_COUNT config NET_TCP_MAX_SEND_WINDOW_SIZE int "Maximum sending window size to use" - depends on NET_TCP2 + depends on NET_TCP default 0 range 0 65535 help @@ -433,7 +433,7 @@ config NET_TCP_MAX_SEND_WINDOW_SIZE config NET_TCP_RECV_QUEUE_TIMEOUT int "How long to queue received data (in ms)" - depends on NET_TCP2 + depends on NET_TCP default 100 range 0 10000 help @@ -467,11 +467,6 @@ config NET_TCP_ISN_RFC6528 RFC 6528 chapter 3. https://tools.ietf.org/html/rfc6528 If this is not set, then sys_rand32_get() is used for ISN value. -config NET_TCP2 - bool - default y - depends on NET_TCP - config NET_TEST_PROTOCOL bool "Enable JSON based test protocol (UDP)" help diff --git a/subsys/net/ip/net_context.c b/subsys/net/ip/net_context.c index c82304cce1..8918184e69 100644 --- a/subsys/net/ip/net_context.c +++ b/subsys/net/ip/net_context.c @@ -37,8 +37,8 @@ LOG_MODULE_REGISTER(net_ctx, CONFIG_NET_CONTEXT_LOG_LEVEL); #include "tcp_internal.h" #include "net_stats.h" -#if IS_ENABLED(CONFIG_NET_TCP2) -#include "tcp2.h" +#if IS_ENABLED(CONFIG_NET_TCP) +#include "tcp.h" #endif #ifndef EPFNOSUPPORT diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index ad493eeadd..2c6ac8badc 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -1454,14 +1454,14 @@ static void conn_handler_cb(struct net_conn *conn, void *user_data) #endif /* CONFIG_NET_CONN_LOG_LEVEL >= LOG_LEVEL_DBG */ #if CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG -struct tcp2_detail_info { +struct tcp_detail_info { int printed_send_queue_header; int printed_details; int count; }; #endif -#if defined(CONFIG_NET_TCP2) && \ +#if defined(CONFIG_NET_TCP) && \ (defined(CONFIG_NET_OFFLOAD) || defined(CONFIG_NET_NATIVE)) static void tcp_cb(struct tcp *conn, void *user_data) { @@ -1485,7 +1485,7 @@ static void tcp_sent_list_cb(struct tcp *conn, void *user_data) { struct net_shell_user_data *data = user_data; const struct shell *shell = data->shell; - struct tcp2_detail_info *details = data->user_data; + struct tcp_detail_info *details = data->user_data; struct net_pkt *pkt; sys_snode_t *node; @@ -1554,7 +1554,7 @@ static void tcp_sent_list_cb(struct tcp *conn, void *user_data) details->printed_send_queue_header = true; } #endif /* CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG */ -#endif /* TCP2 */ +#endif /* TCP */ #if defined(CONFIG_NET_IPV6_FRAGMENT) static void ipv6_frag_cb(struct net_ipv6_reassembly *reass, @@ -2040,18 +2040,18 @@ static int cmd_net_conn(const struct shell *shell, size_t argc, char *argv[]) } else { #if CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG /* Print information about pending packets */ - struct tcp2_detail_info details; + struct tcp_detail_info details; count = 0; - if (IS_ENABLED(CONFIG_NET_TCP2)) { + if (IS_ENABLED(CONFIG_NET_TCP)) { memset(&details, 0, sizeof(details)); user_data.user_data = &details; } net_tcp_foreach(tcp_sent_list_cb, &user_data); - if (IS_ENABLED(CONFIG_NET_TCP2)) { + if (IS_ENABLED(CONFIG_NET_TCP)) { if (details.count == 0) { PR("No active connections.\n"); } diff --git a/subsys/net/ip/tcp2.c b/subsys/net/ip/tcp.c similarity index 99% rename from subsys/net/ip/tcp2.c rename to subsys/net/ip/tcp.c index 852e4e6d53..4b3decfe97 100644 --- a/subsys/net/ip/tcp2.c +++ b/subsys/net/ip/tcp.c @@ -2813,7 +2813,7 @@ const char *net_tcp_state_str(enum tcp_state state) void net_tcp_init(void) { #if defined(CONFIG_NET_TEST_PROTOCOL) - /* Register inputs for TTCN-3 based TCP2 sanity check */ + /* Register inputs for TTCN-3 based TCP sanity check */ test_cb_register(AF_INET, IPPROTO_TCP, 4242, 4242, tcp_input); test_cb_register(AF_INET6, IPPROTO_TCP, 4242, 4242, tcp_input); test_cb_register(AF_INET, IPPROTO_UDP, 4242, 4242, tp_input); diff --git a/subsys/net/ip/tcp2.h b/subsys/net/ip/tcp.h similarity index 97% rename from subsys/net/ip/tcp2.h rename to subsys/net/ip/tcp.h index 5677109c92..666e6429dc 100644 --- a/subsys/net/ip/tcp2.h +++ b/subsys/net/ip/tcp.h @@ -21,11 +21,11 @@ * into the ip stack and the socket layer less intrusive. * * Semantically cleaner use is possible (and might be exposed), - * look into the unit test tests/net/tcp2 for insights. + * look into the unit test tests/net/tcp for insights. */ -#ifndef TCP2_H -#define TCP2_H +#ifndef TCP_H +#define TCP_H #ifdef __cplusplus extern "C" { @@ -142,4 +142,4 @@ void tcp_input(struct net_pkt *pkt); } #endif -#endif /* TCP2_H */ +#endif /* TCP_H */ diff --git a/subsys/net/ip/tcp_internal.h b/subsys/net/ip/tcp_internal.h index 44a9830fa9..c12c5f0abb 100644 --- a/subsys/net/ip/tcp_internal.h +++ b/subsys/net/ip/tcp_internal.h @@ -28,7 +28,7 @@ extern "C" { #endif -#include "tcp2_priv.h" +#include "tcp_private.h" /** * @brief Calculates and returns the MSS for a given TCP context diff --git a/subsys/net/ip/tcp2_priv.h b/subsys/net/ip/tcp_private.h similarity index 100% rename from subsys/net/ip/tcp2_priv.h rename to subsys/net/ip/tcp_private.h diff --git a/tests/net/tcp2/CMakeLists.txt b/tests/net/tcp/CMakeLists.txt similarity index 100% rename from tests/net/tcp2/CMakeLists.txt rename to tests/net/tcp/CMakeLists.txt diff --git a/tests/net/tcp2/prj.conf b/tests/net/tcp/prj.conf similarity index 100% rename from tests/net/tcp2/prj.conf rename to tests/net/tcp/prj.conf diff --git a/tests/net/tcp2/src/main.c b/tests/net/tcp/src/main.c similarity index 99% rename from tests/net/tcp2/src/main.c rename to tests/net/tcp/src/main.c index e5e656f908..ce936409f9 100644 --- a/tests/net/tcp2/src/main.c +++ b/tests/net/tcp/src/main.c @@ -1,6 +1,6 @@ /* main.c - Application main entry point * - * This is a self-contained test for exercising the TCP2 protocol stack. Both + * This is a self-contained test for exercising the TCP protocol stack. Both * the server and client side run on ths same device using a DUMMY interface * as a loopback of the IP packets. * @@ -29,8 +29,8 @@ LOG_MODULE_REGISTER(net_test, CONFIG_NET_TCP_LOG_LEVEL); #include "ipv4.h" #include "ipv6.h" -#include "tcp2.h" -#include "tcp2_priv.h" +#include "tcp.h" +#include "tcp_private.h" #include "net_stats.h" #include @@ -1475,7 +1475,7 @@ static void test_server_timeout_out_of_order_data(void) } /* Because the pending seq values are not sequential, - * the recv queue in tcp2 should timeout. + * the recv queue in tcp should timeout. */ ret = k_sem_take(&test_sem, K_MSEC(CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT + 10)); diff --git a/tests/net/tcp2/testcase.yaml b/tests/net/tcp/testcase.yaml similarity index 72% rename from tests/net/tcp2/testcase.yaml rename to tests/net/tcp/testcase.yaml index 763d01a972..c2df1ca45f 100644 --- a/tests/net/tcp2/testcase.yaml +++ b/tests/net/tcp/testcase.yaml @@ -1,10 +1,10 @@ common: depends_on: netif - tags: net tcp2 + tags: net tcp tests: - net.tcp2.simple: + net.tcp.simple: extra_configs: - CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT=1000 - net.tcp2.no_recv_queue: + net.tcp.no_recv_queue: extra_configs: - CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT=0