nuttx-apps/netutils
zhouliang3 426cc840d8 apps/ping: fix ping statistics error problem
nsh> ping 192.168.31.162
PING 192.168.31.162 56 bytes of data
56 bytes from 192.168.31.162: icmp_seq=0 time=8 ms
56 bytes from 192.168.31.162: icmp_seq=1 time=27 ms
56 bytes from 192.168.31.162: icmp_seq=2 time=17 ms
56 bytes from 192.168.31.162: icmp_seq=3 time=14 ms
56 bytes from 192.168.31.162: icmp_seq=4 time=16 ms
56 bytes from 192.168.31.162: icmp_seq=5 time=14 ms
56 bytes from 192.168.31.162: icmp_seq=6 time=8 ms
56 bytes from 192.168.31.162: icmp_seq=7 time=87 ms
WARNING: Received after timeout
56 bytes from 192.168.31.162: icmp_seq=8 time=1003 ms
56 bytes from 192.168.31.162: icmp_seq=8 time=6 ms
56 bytes from 192.168.31.162: icmp_seq=9 time=5 ms
10 packets transmitted, 11 received, 4294967287% packet loss, time 10011 ms

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2022-04-25 22:12:42 +08:00
..
chat Makefile: update licenses to Apache 2022-03-08 01:44:49 +08:00
cjson netutils: fix relative path CI error 2021-06-16 09:03:06 -05:00
codecs Makefiles: Gregory Nutt: update licenses to Apache 2021-06-07 21:35:33 -05:00
dhcp6c Add dhcp6c module 2022-03-19 23:25:50 +08:00
dhcpc netutils/dhcpc: Fix dhcpc lease bug 2022-01-05 18:27:59 +08:00
dhcpd netutils/dhcpd: bind socket to the interface 2021-07-23 08:25:36 -03:00
discover netutils: fix relative path CI error 2021-06-16 09:03:06 -05:00
esp8266 apps: examples: nxstyle fixes 2022-03-08 17:04:01 +02:00
ftpc netutils/ftpc: implemented FTPC_OVER_SENDFILE option. 2022-01-20 14:16:01 +08:00
ftpd apps: unify FAR attribute usage across apps 2022-04-05 00:55:22 +08:00
iperf fix: iperf can not exit when stop 2022-03-15 18:01:04 +08:00
libcurl4nx include: fix double include pre-processor guards 2022-01-16 17:36:21 +08:00
mqttc neutils/mqttc: Update to version 1.1.5 2021-03-31 17:49:46 +01:00
netcat style: unify path to files in comment section 2022-03-09 10:37:33 +08:00
netinit netutils: Check lo by CONFIG_NET_LOOPBACK not CONFIG_NET_LOCAL 2022-02-09 12:13:31 +08:00
netlib netutils/netlib: Fix error: 'strncpy' specified bound 16 equals destination size 2022-03-04 22:05:14 +02:00
ntpclient Remove CONFIG_CLOCK_MONOTONIC special code 2022-02-23 01:21:44 +08:00
ping apps/ping: fix ping statistics error problem 2022-04-25 22:12:42 +08:00
pppd apps: unify FAR attribute usage across apps 2022-04-05 00:55:22 +08:00
rexec rexec: correct af type from int to sa_family_t 2022-03-29 17:10:32 +08:00
rexecd rexecd: fix compile warning 2022-03-28 00:25:56 +08:00
smtp Makefiles: Gregory Nutt: update licenses to Apache 2021-06-07 21:35:33 -05:00
telnetc netutils: telnetc: convert licenses to Apache 2022-03-11 00:14:32 +02:00
telnetd netutils/telnetd: use a larger buffer for a 64-bit pointer 2021-07-02 04:18:23 -05:00
tftpc include: fix double include pre-processor guards 2022-01-16 17:36:21 +08:00
thttpd Update the call site of exec to accommodate the environment variables 2022-04-22 10:40:38 +03:00
usrsock_rpmsg usrsock: Don't clear recv and send available flag 2022-04-16 14:07:48 +08:00
wakeonlan netutils/wakeonlan: Remove the tab from the blank line in Kconfig 2021-05-12 10:48:44 +01:00
webclient webclient: Remove a duplicated "Connection:" header 2022-03-08 11:52:35 +08:00
webserver netutils/webserver: Fix the compiler warning 2022-03-07 00:58:19 +08:00
xmlrpc Makefile: Max Holtzberg: update licenses to Apache 2021-06-07 21:35:33 -05:00
.gitignore build: Remve the unnecessary .gitignore 2020-05-23 15:56:35 +01:00
Make.defs Makefiles: Gregory Nutt: update licenses to Apache 2021-06-07 21:35:33 -05:00
Makefile Makefiles: Gregory Nutt: update licenses to Apache 2021-06-07 21:35:33 -05:00
README.md Rewritten READMEs to Markdown 2020-07-25 01:01:51 -07:00

Network Utilities

Contents

  • uIP Applications
  • Other Network Applications
  • Tips for Using Telnetd
  • Tips for Using DHCPC

uIP Applications

This directory contains most of the network applications contained under the uIP-1.0 apps directory. As the uIP apps/README.md says, these applications are not all heavily tested. These uIP-based apps include:

  • dhcpc Dynamic Host Configuration Protocol (DHCP) client. See apps/include/netutils/dhcpc.h for interface information.

  • smtp Simple Mail Transfer Protocol (SMTP) client. See apps/include/netutils/smtp.h for interface information.

  • webclient HTTP web client. See apps/include/netutils/webclient.h for interface information.

  • webserver HTTP web server. See apps/include/netutils/httpd.h for interface information.

You may find additional information on these apps in the uIP forum accessible through: http://www.sics.se/~adam/uip/index.php/Main_Page. Some of these (such as the uIP web server) have grown some additional functionality due primarily to NuttX user contributions.

Other Network Applications

Additional applications that were not part of uIP (but which are highly influenced by uIP) include:

  • dhcpd Dynamic Host Configuration Protocol (DHCP) server. See apps/include/netutils/dhcpd.h for interface information.

  • discover This daemon is useful for discovering devices in local networks, especially with DHCP configured devices. It listens for UDP broadcasts which also can include a device class so that groups of devices can be discovered. It is also possible to address all classes with a kind of broadcast discover. (Contributed by Max Holtzberg).

  • esp8266 An ESP8266 networking layer contributed by Pierre-Noel Bouteville.

  • json cJSON is an ultra-lightweight, portable, single-file, simple-as-can-be ANSI-C compliant JSON parser, under MIT license. Embeddable Lightweight XML-RPC Server discussed at http://www.drdobbs.com/web-development/an-embeddable-lightweight-xml-rpc-server/184405364.

    This code was taken from http://sourceforge.net/projects/cjson/ and adapted for NuttX by Darcy Gong.

  • tftpc TFTP client. See apps/include/netutils/tftp.h for interface information.

  • telnetc This is a port of libtelnet to NuttX. This is a public domain Telnet client library available from https://github.com/seanmiddleditch/libtelnet modified for use with NuttX. Original Authors: Sean Middleditch sean@sourcemud.org, Jack Kelly endgame.dos@gmail.com and Katherine Flavel kate@elide.org

  • telnetd TELNET server. This is the Telnet logic adapted from uIP and generalized for use as the front end to any shell. The telnet daemon creates sessions that are wrapped as character devices and mapped to stdin, stdout and stderr. Now the telnet session can be inherited by spawned tasks.

  • ftpc FTP client. See apps/include/netutils/ftpc.h for interface information.

  • ftpd FTP server. See apps/include/netutils/ftpd.h for interface information.

  • ntpclient This is a fragmentary NTP client. It neither well-tested nor mature nor complete at this point in time.

  • thttpd This is a port of Jef Poskanzer's THTTPD HTPPD server. See http://acme.com/software/thttpd/ for general THTTPD information. See apps/include/netutils/thttpd.h for interface information. Applications using this thttpd will need to provide the following definitions in the defconfig file to select the appropriate netutils libraries:

    CONFIG_NETUTILS_NETLIB=y
    CONFIG_NETUTILS_THTTPD=y
    
  • xmlrpc The Embeddable Lightweight XML-RPC Server discussed at http://www.drdobbs.com/web-development/an-embeddable-lightweight-xml-rpc-server/184405364

  • ping This is an unfinished implementation of ping and ping6 using raw sockets. It is not yet hooked into the configuration or build systems.

    Current ping/ping6 logic in NSH makes illegal calls into the OS in order to implement ping/ping6. One correct implementation would be to use raw sockets to implement ping/ping6 as a user application. This is a first cut at such an implementation.

Tips for Using Telnetd

Telnetd is set up to be the front end for a shell. The primary use of Telnetd in NuttX is to support the NuttShell (NSH) Telnet front end. See apps/include/netutils/telnetd.h for information about how to incorporate Telnetd into your custom applications.

To enable and link the Telnetd daemon, you need to include the following in in your defconfig file:

CONFIG_NETUTILS_NETLIB=y
CONFIG_NETUTILS_TELNETD=y

Also if the Telnet console is enabled, make sure that you have the following set in the NuttX configuration file or else the performance will be very bad (because there will be only one character per TCP transfer):

  • CONFIG_STDIO_BUFFER_SIZE Some value >= 64.
  • CONFIG_STDIO_LINEBUFFER=y Since Telnetd is line oriented, line buffering is optimal.

Tips for Using DHCPC

If you use DHCPC/D, then some special configuration network options are required. These include:

  • CONFIG_NET=y
  • CONFIG_NET_UDP=y UDP support is required for DHCP (as well as various other UDP-related configuration settings).
  • CONFIG_NET_BROADCAST=y UDP broadcast support is needed.
  • CONFIG_NET_ETH_PKTSIZE=650 or larger. The client must be prepared to receive DHCP messages of up to 576 bytes (excluding Ethernet, IP or UDP headers and FCS). Note: Note that the actual MTU setting will depend upon the specific link protocol. Here Ethernet is indicated.