From 9eb46d95a7068b6fa3cb76c4625b8efcbd58bbfa Mon Sep 17 00:00:00 2001 From: Loic Poulain Date: Wed, 19 Aug 2020 15:10:57 +0200 Subject: [PATCH] net: shell: TCP stack agnostic shell Now that TCP2 is the default stack, make the shell compatible with both stacks. Note: net_tcp_foreach is not implemented in TCP2, so related code depends on TCP1. Signed-off-by: Loic Poulain --- subsys/net/ip/net_shell.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index f29fd2a8e76..3ab8711eb31 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -3735,7 +3735,7 @@ static int cmd_net_stats(const struct shell *shell, size_t argc, char *argv[]) return 0; } -#if defined(CONFIG_NET_TCP1) && defined(CONFIG_NET_NATIVE_TCP) +#if defined(CONFIG_NET_TCP) && defined(CONFIG_NET_NATIVE_TCP) static struct net_context *tcp_ctx; static const struct shell *tcp_shell; @@ -3966,7 +3966,7 @@ static void tcp_recv_cb(struct net_context *context, struct net_pkt *pkt, static int cmd_net_tcp_connect(const struct shell *shell, size_t argc, char *argv[]) { -#if defined(CONFIG_NET_TCP1) && defined(CONFIG_NET_NATIVE_TCP) +#if defined(CONFIG_NET_TCP) && defined(CONFIG_NET_NATIVE_TCP) int arg = 0; /* tcp connect port */ @@ -4010,7 +4010,7 @@ static int cmd_net_tcp_connect(const struct shell *shell, size_t argc, static int cmd_net_tcp_send(const struct shell *shell, size_t argc, char *argv[]) { -#if defined(CONFIG_NET_TCP1) && defined(CONFIG_NET_NATIVE_TCP) +#if defined(CONFIG_NET_TCP) && defined(CONFIG_NET_NATIVE_TCP) int arg = 0; int ret; struct net_shell_user_data user_data; @@ -4047,7 +4047,7 @@ static int cmd_net_tcp_send(const struct shell *shell, size_t argc, static int cmd_net_tcp_recv(const struct shell *shell, size_t argc, char *argv[]) { -#if defined(CONFIG_NET_TCP1) && defined(CONFIG_NET_NATIVE_TCP) +#if defined(CONFIG_NET_TCP) && defined(CONFIG_NET_NATIVE_TCP) int ret; struct net_shell_user_data user_data; @@ -4076,7 +4076,7 @@ static int cmd_net_tcp_recv(const struct shell *shell, size_t argc, static int cmd_net_tcp_close(const struct shell *shell, size_t argc, char *argv[]) { -#if defined(CONFIG_NET_TCP1) && defined(CONFIG_NET_NATIVE_TCP) +#if defined(CONFIG_NET_TCP) && defined(CONFIG_NET_NATIVE_TCP) int ret; /* tcp close */