Browse Source

Merge pull request #813 from armink/fix_netutils

[lwIP] Fix netutils
Bernard Xiong 7 years ago
parent
commit
bd460dda2b

+ 6 - 0
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

+ 13 - 0
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')

+ 0 - 0
components/net/lwip-2.0.2/apps/ping.c → components/net/lwip-2.0.2/src/apps/ping/ping.c


+ 7 - 3
components/net/lwip-2.0.2/apps/tftp_server.c → 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 <finsh.h>
 
 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");
     }
 }
+FINSH_FUNCTION_EXPORT(tftp_server, start tftp server.);
+
+#if defined(FINSH_USING_MSH)
 MSH_CMD_EXPORT(tftp_server, start tftp server.);
+#endif /* defined(FINSH_USING_MSH) */
 
-#endif /* defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) */
+#endif /* defined(RT_USING_FINSH) */

+ 1 - 0
components/net/netutils/README.md

@@ -0,0 +1 @@
+Some net utils which using standard interface such as BSD Sockets.

+ 10 - 0
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')

+ 0 - 0
components/net/lwip-2.0.2/apps/telnet.c → components/net/netutils/telnet.c