Commit Graph

796 Commits

Author SHA1 Message Date
xuewenliang
c69ec94d13 Modifying the ping command
1、Round trip times in the ping command range from millisecond to subtle
2、Add statistics on RTT related min/avg/Max/mdev in ping program
3、The ping command supports ctrl+c interruption operations

Signed-off-by: xuewenliang <xuewenliang@xiaomi.com>
2022-03-18 09:54:01 +08:00
zhanghongyu
5e22b6f564 fix: iperf can not exit when stop
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-03-15 18:01:04 +08:00
zhanghongyu
f1d5d6e671 fix: ap socket can not accept twice
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-03-15 18:01:04 +08:00
zhanghongyu
6c2a487f85 feature: pointer of netdev ioctl support cross-core access via clean dcache
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-03-15 18:01:04 +08:00
Alin Jerpelea
448a7d2ec9 netutils: telnetc: convert licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-11 00:14:32 +02:00
Petro Karashchenko
f9baa422c1 style: unify path to files in comment section
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-09 10:37:33 +08:00
Alin Jerpelea
3984796156 apps: examples: nxstyle fixes
Fix for errors reported by the nxstyle tool.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 17:04:01 +02:00
Alin Jerpelea
e156e192bf apps: netutils: esp8266: nxstyle fixes
Fix for errors reported by the nxstyle tool.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 17:04:01 +02:00
Alin Jerpelea
4535245e08 apps: netutils: esp8266: update licenses to Apache
Gregory Nutt has submitted the SGA
Pierre-Noel Bouteville has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 17:04:01 +02:00
YAMAMOTO Takashi
f2737a208c webclient: Remove a duplicated "Connection:" header
When making the following change, I haven't noticed that
g_httpuseragentfields contains a "Connection" header.

```
commit 092ce81444
Author: YAMAMOTO Takashi <yamamoto@midokura.com>
Date:   Mon Mar 7 09:30:23 2022 +0900

    webclient: Always use "connection: close" for HTTP 1.1 for now

    * This matches the HTTP 1.0 behavior.

    * Persistent connection doesn't make much sense with the current API.
```

It seems that some servers are not happy with the duplicated header
and ignore them. (and do the default keep-alive for HTTP 1.1)
eg. Azure Blob (global)
2022-03-08 11:52:35 +08:00
YAMAMOTO Takashi
8a5dc04be2 webclient: Remove an inappropriate comment (a copy-and-paste botch) 2022-03-08 11:52:28 +08:00
YAMAMOTO Takashi
44e80ac972 webclient: Implement chunked transfer (receiving side)
This is a requirement for HTTP 1.1.

Tested against:

* http://httpbin.org/stream/10

* Docker API
2022-03-08 09:39:55 +08:00
YAMAMOTO Takashi
092ce81444 webclient: Always use "connection: close" for HTTP 1.1 for now
* This matches the HTTP 1.0 behavior.

* Persistent connection doesn't make much sense with the current API.
2022-03-08 09:39:55 +08:00
YAMAMOTO Takashi
7949059ec2 webclient: Send HTTP 1.1 request if enabled 2022-03-08 09:39:55 +08:00
YAMAMOTO Takashi
3759da3d00 webclient: Add a parameter to specifiy protocol version 2022-03-08 09:39:55 +08:00
Alin Jerpelea
cd79a79d00 Makefile: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 01:44:49 +08:00
Xiang Xiao
18bb3331f3 netutils/webserver: Fix the compiler warning
httpd_dirlist.c: In function 'httpd_dirlist':
Error: httpd_dirlist.c:199:40: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 128 [-Werror=format-truncation=]
  199 |       snprintf(path, CONFIG_NAME_MAX, "%s/%s",
      |                                        ^~
httpd_dirlist.c:199:7: note: 'snprintf' output between 2 and 385 bytes into a destination of size 128
  199 |       snprintf(path, CONFIG_NAME_MAX, "%s/%s",
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  200 |                file->path, dent->d_name);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-07 00:58:19 +08:00
Xiang Xiao
3afd1234e0 netutils/netlib: Fix error: 'strncpy' specified bound 16 equals destination size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-04 22:05:14 +02:00
Xiang Xiao
f31cc67da8 netutils/usrsock_rpmsg: Switch the nonblocking mode by psock_ioctl instead
since it's more simpler than psock_ioctl

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-04 14:00:29 +02:00
Xiang Xiao
997379d14e netutils/webserver: Fix the compiler error when -no-builtin is removed
Error: httpd.c:671:7: error: 'strncpy' output truncated before terminating nul copying 12 bytes from a string of the same length [-Werror=stringop-truncation]
  671 |       strncpy(pstate->ht_filename, "/" CONFIG_NETUTILS_HTTPD_INDEX,
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  672 |               strlen("/" CONFIG_NETUTILS_HTTPD_INDEX));
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-03 12:49:35 +02:00
Xiang Xiao
4cc0c755bf Remove CONFIG_CLOCK_MONOTONIC special code
since this opion doesn't exist anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 01:21:44 +08:00
Xiang Xiao
0426c8c09f Fix error: 'strncpy' specified bound 16 equals destination size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-15 12:38:03 +01:00
Huang Qi
5451214d0b ftpd: Remove usage of deprecated macro __NUTTX__
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-02-14 13:57:10 +08:00
Alexander Lunev
e317d32fe1 netutils/netcat: fixed crash on accept() invocation.
Sometimes netcat in server mode crashed with "psock_accept: ERROR: si_accept failed: -9".
And sometimes it crashed with "up_assert: Assertion failed at file:inet/inet_sockif.c line: 841 task: netcat".
2022-02-10 12:20:27 +08:00
Xiang Xiao
8361990261 netutils: Check lo by CONFIG_NET_LOOPBACK not CONFIG_NET_LOCAL
CONFIG_NET_LOCAL is used to enable Unix Domain Socket

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-09 12:13:31 +08:00
Xiang Xiao
60989b196c neutils/thttpd: Remove CONFIG_SDCLONE_DISABLE
since this option doesn't exist anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-31 19:03:55 +01:00
Alexander Lunev
d595ba2b25 netutils/netcat: implemented NETUTILS_NETCAT_BUFSIZE option.
This option can be used for the performance optimization if sendfile() is not applicable.
2022-01-25 00:47:34 +08:00
Alexander Lunev
5a697c18ba netutils/netcat: fixed ISO C89/C90 related warnings:
warning: ISO C90 forbids variable length array ‘buf’ [-Wvla]
warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
2022-01-21 12:30:40 +08:00
Alexander Lunev
b8c060260c netutils/ftpc: implemented FTPC_OVER_SENDFILE option.
This option enables using sendfile() in ftpc binary transfer mode of PUT operation.
If the option is enabled but ASCII transfer mode is activated,
ftpc falls back to the combination of read() and write().
Using sendfile() provides a higher performance compared to
the combination of read() and write().

Also this option is useful for testing / debugging tcp_sendfile()
functionality of NuttX TCP/IP stack.
2022-01-20 14:16:01 +08:00
Alexander Lunev
371beb2a0f netutils/netcat: sendfile related code refactoring + small fixes 2022-01-18 10:38:55 +08:00
Xiang Xiao
c7e96dbe32 Fix the nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-17 07:57:22 +01:00
Petro Karashchenko
9480c0ec12 include: fix double include pre-processor guards
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-16 17:36:21 +08:00
Fotis Panagiotopoulos
bc5d8034f1 Typo fixes. 2022-01-06 10:30:41 +08:00
songlinzhang
04dd2d70fd netutils/dhcpc: Fix dhcpc lease bug
Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2022-01-05 18:27:59 +08:00
Jiuzhu Dong
64ffdb46bb ntpc: optimize stack used
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-01-05 18:36:12 +09:00
Alexander Lunev
b9a6dc2a85 netutils/netcat: implemented NETUTILS_NETCAT_SENDFILE option.
This option enables using sendfile() in netcat client mode
if a normal file (not stdin) is sent. If the option is enabled
but stdin is sent rather than a normal file, netcat falls back
to the combination of read() and write().
Using sendfile() provides a higher performance compared to
the combination of read() and write().

Also this option is useful for testing / debugging tcp_sendfile()
functionality of NuttX TCP/IP stack.
2022-01-05 13:29:04 +08:00
chao.an
df53de1d68 net/usrsock: replace usrsock xid type to uint64_t
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-05 13:25:21 +08:00
Petro Karashchenko
5ac15130db apps: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 20:52:08 -06:00
Xiang Xiao
66dbaa4539 Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-20 16:04:29 -03:00
songlinzhang
e0fc53b23c netutils/dhcpc: add non-blocking interface
Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2021-11-29 02:04:49 -06:00
Jiuzhu Dong
b480d00323 rexec: support send command with arguments
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-23 03:58:49 -05:00
songlinzhang
98dfaa3eff dhcpc abnormal block
The logic changes are as follows:
1、Loop sending the DISCOVER up to CONFIG_NETUTILS_DHCPC_RETRIES times
   and exit if failure
2、Loop sending the REQUEST up to CONFIG_NETUTILS_DHCPC_RETRIES times
   and exit if failure

Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2021-10-22 09:20:25 -03:00
Alan C. Assis
cb1b8e10db chat: Replace _info with ninfo to avoid polluting the nsh 2021-09-27 10:31:43 +02:00
YAMAMOTO Takashi
78fb3bc240 webclient: handle EINTR in a few places 2021-09-14 14:39:29 +08:00
Jiuzhu Dong
2add33e6a3 rexecd/rexec: support AF_RPMSG to communicate
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-13 09:00:20 +08:00
Jiuzhu Dong
00e7be92dc netutils: support rexec and rexecd
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-13 09:00:20 +08:00
Juha Niskanen
b283289986 apps: fix miscellaneous typos
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-08-26 11:39:28 -07:00
YAMAMOTO Takashi
23e0325698 webclient: check content-length
While it's better to use a reliable transport like
TLS with working close notify, it isn't always possible.
2021-08-16 09:47:44 -07:00
YAMAMOTO Takashi
bdae564c22 webclient: Add _s suffix to internal structures
To follow our coding standard.

I left the structures which is a part of the API for now.
(E.g. struct webclient_context)
2021-08-11 03:11:14 -07:00
YAMAMOTO Takashi
b8fd862965 webclient: Add some assertions on webclient_context state 2021-08-08 22:34:26 -07:00