From 5910ae4170e2ebaca9fc05ee87aef167b533d586 Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 18 Aug 2017 11:29:26 +0800 Subject: [PATCH 1/3] [NET] Add telnet app to netutils. --- components/net/netutils/README.md | 1 + components/net/netutils/SConscript | 10 ++++++++++ components/net/{lwip-2.0.2/apps => netutils}/telnet.c | 0 3 files changed, 11 insertions(+) create mode 100644 components/net/netutils/README.md create mode 100644 components/net/netutils/SConscript rename components/net/{lwip-2.0.2/apps => netutils}/telnet.c (100%) diff --git a/components/net/netutils/README.md b/components/net/netutils/README.md new file mode 100644 index 0000000000..49545bab32 --- /dev/null +++ b/components/net/netutils/README.md @@ -0,0 +1 @@ +Some net utils which using standard interface such as BSD Sockets. \ No newline at end of file diff --git a/components/net/netutils/SConscript b/components/net/netutils/SConscript new file mode 100644 index 0000000000..853b94a857 --- /dev/null +++ b/components/net/netutils/SConscript @@ -0,0 +1,10 @@ +from building import * + +cwd = GetCurrentDir() +src = Glob('*.c') + +CPPPATH = [cwd] + +group = DefineGroup('LwIP', src, depend = ['RT_USING_NETUTILS'], CPPPATH = CPPPATH) + +Return('group') \ No newline at end of file diff --git a/components/net/lwip-2.0.2/apps/telnet.c b/components/net/netutils/telnet.c similarity index 100% rename from components/net/lwip-2.0.2/apps/telnet.c rename to components/net/netutils/telnet.c From 871297747a1aea9c0f3868640856aab97377eea5 Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 18 Aug 2017 11:52:12 +0800 Subject: [PATCH 2/3] [LWIP] Move net apps to `LwIP/src/apps`. --- components/net/lwip-2.0.2/src/apps/README.md | 6 ++++++ .../net/lwip-2.0.2/{apps => src/apps/ping}/ping.c | 0 .../tftp_server.c => src/apps/tftp/tftp_port.c} | 12 ++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 components/net/lwip-2.0.2/src/apps/README.md rename components/net/lwip-2.0.2/{apps => src/apps/ping}/ping.c (100%) rename components/net/lwip-2.0.2/{apps/tftp_server.c => src/apps/tftp/tftp_port.c} (90%) diff --git a/components/net/lwip-2.0.2/src/apps/README.md b/components/net/lwip-2.0.2/src/apps/README.md new file mode 100644 index 0000000000..26670858c5 --- /dev/null +++ b/components/net/lwip-2.0.2/src/apps/README.md @@ -0,0 +1,6 @@ +Some net apps for current version LwIP. + +The RT-Thread develop team ported apps. It's easy to use it on finsh/msh. + +- ping +- tftp diff --git a/components/net/lwip-2.0.2/apps/ping.c b/components/net/lwip-2.0.2/src/apps/ping/ping.c similarity index 100% rename from components/net/lwip-2.0.2/apps/ping.c rename to components/net/lwip-2.0.2/src/apps/ping/ping.c diff --git a/components/net/lwip-2.0.2/apps/tftp_server.c b/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c similarity index 90% rename from components/net/lwip-2.0.2/apps/tftp_server.c rename to components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c index f5667ef0ad..129cc7da17 100644 --- a/components/net/lwip-2.0.2/apps/tftp_server.c +++ b/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c @@ -1,5 +1,5 @@ /* - * File : tftp_server.c + * File : tftp_port.c * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team * @@ -59,7 +59,7 @@ static int tftp_write(void* handle, struct pbuf* p) return write(fd, p->payload, p->len); } -#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) +#if defined(RT_USING_FINSH) #include static void tftp_server(uint8_t argc, char **argv) @@ -78,6 +78,10 @@ static void tftp_server(uint8_t argc, char **argv) rt_kprintf("TFTP server start failed.\n"); } } -MSH_CMD_EXPORT(tftp_server, start tftp server.); +FINSH_FUNCTION_EXPORT(tftp_server, start tftp server.); -#endif /* defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) */ +#if defined(FINSH_USING_MSH) +MSH_CMD_EXPORT(tftp_server, start tftp server.); +#endif /* defined(FINSH_USING_MSH) */ + +#endif /* defined(RT_USING_FINSH) */ From a97d70066b9626018801d87c7dba35939c005e94 Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 18 Aug 2017 12:10:28 +0800 Subject: [PATCH 3/3] [LWIP] Add LwIP apps SConscript. --- components/net/lwip-2.0.2/src/apps/SConscript | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 components/net/lwip-2.0.2/src/apps/SConscript diff --git a/components/net/lwip-2.0.2/src/apps/SConscript b/components/net/lwip-2.0.2/src/apps/SConscript new file mode 100644 index 0000000000..2bc01cc16e --- /dev/null +++ b/components/net/lwip-2.0.2/src/apps/SConscript @@ -0,0 +1,13 @@ +from building import * + +cwd = GetCurrentDir() +src = Glob('tftp/*.c') + +if GetDepend(['RT_LWIP_ICMP', 'RT_LWIP_RAW']): + src += Glob('ping/*.c') + +CPPPATH = [cwd] + +group = DefineGroup('LwIP', src, depend = ['RT_USING_NETUTILS', 'RT_USING_LWIP202'], CPPPATH = CPPPATH) + +Return('group') \ No newline at end of file