Commit Graph

636 Commits

Author SHA1 Message Date
YAMAMOTO Takashi
cbaf05bfd0 netutils/netlib/netlib_ipmsfilter.c: Appease nxstyle 2020-11-23 04:59:11 -08:00
YAMAMOTO Takashi
37aa346da6 netutils/dhcpc/dhcpc.c: Fix syslog formats 2020-11-23 04:59:11 -08:00
YAMAMOTO Takashi
73fb7baa05 webclient: Distinguish request size and buffer size in body callback
This fixes the case when webclient_set_static_body is used
for data larger than webclient_context::buflen.

Note: as of writing this, webclient_set_static_body is the
only user of body_callback in NuttX apps tree.
2020-11-19 18:46:38 -08:00
Philippe Coval
4a5152fc91 netutils/netcat: Add netcat tool
Check readme for usage and demo:

[![weboftwins-osvehicle-2020-rzr](
https://files.mastodon.social/media_attachments/files/105/163/916/892/863/178/original/05468e28b4463f95.png
)](
https://mastodon.social/@rzr/105225153152922220#weboftwins-osvehicle-2020-rzr
"weboftwins-osvehicle-2020-rzr")

Change-Id: I2eac915954ca6cf585f01addb53df581631a7ae6
Bug: https://github.com/apache/incubator-nuttx/pull/1999
Relate-to: https://github.com/rzr/aframe-smart-home/issues/3
Origin: https://github.com/CrossStream/nuttx-apps/tree/sandbox/rzr/review/master/netutils/netcat
Forwarded: https://github.com/apache/incubator-nuttx-apps/pull/482
Signed-off-by: Philippe Coval <rzr@users.sf.net>
2020-11-17 09:12:54 -08:00
YAMAMOTO Takashi
b4651db64f netutils/webserver/httpd_dirlist.c: Fix a printf format warning 2020-11-13 05:51:23 -08:00
YAMAMOTO Takashi
28296d539d netutils/ftpd/ftpd.c: Fix a printf format warning 2020-11-13 05:51:23 -08:00
Simon Piriou
a3e27eb1a0 netutils/webserver: fix build error 2020-11-08 17:44:08 -08:00
ligd
0781dbf9e9 usrsock_rpmsg: fix can't wake ppoll when no ACTION
N/A

no matter open/close CONFIG_SIGUSR1_ACTION, usrsock always do,
unmask SIGUSR1, set action to NULL.

Change-Id: I39ba51db8e4c77b4923c97598b3cb73c12473a2c
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-10-27 10:16:55 -07:00
Xiang Xiao
8375a2177e Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-18 22:27:57 -07:00
Xiang Xiao
8a63e58936 Change all 'Nuttx' to 'NuttX'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-18 22:27:57 -07:00
David Sidrane
cb111c0ee8 netinit:Fix typo IPCFG_USE_DHCPC->IPCFG_USE_DHCP 2020-10-16 10:11:21 +08:00
Gregory Nutt
f65b16bb2e Incorporate IP configuration files into netinit.
Uses logic from apps/fsutils/ipcfg to obtain the IP address configuration from a file, if available.  This only effects the behavior of netinit if CONFIG_FSUTILS_IPCFG is selected and if an IP configuration file is available on a file system. Otherwise, it reverts to the preceding behavior.

Also adds definitions to apps/include/fsutils/ipcfg.h to formalize a bit encoding of the prototype which was already in use, but not documented.

Also fixes some bad assertions (duplication of PR #420) and makes use of variable names consistent in ipcfg.h comments and in ipcfg_text implementation.
2020-10-06 10:42:35 -07:00
YAMAMOTO Takashi
a1db71fa43 webclient improvements
Highlights:

* TLS support (a hook to allow users to provide TLS implementation)
* ability to add extra request headers
* ability to use PUT method
* ability to report http status
* error handling improvements

Proposed on the ML while ago:
https://www.mail-archive.com/dev@nuttx.apache.org/msg03803.html

The original API is kept for now.
I plan to remove them after adapting the existing users.
(examples in this repo)
2020-10-01 15:32:25 +08:00
YAMAMOTO Takashi
b78370dbf2 webclient: move WGET_USE_URLENCODE definiton to the header
Because it's used by the header.

This fixes warnings while building wgetjson.
2020-09-30 08:22:16 +02:00
Masayuki Ishikawa
e8a353af05 netutils: dhcpc: Fix dhcpc.c
Summary:
- dhcpc now uses gethostname() but the hostname might be empty
- This commit fixes this issue

Impact:
- All use cases which use dhcpc

Testing:
- Tested with spresense:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-09-20 08:19:38 -07:00
chao.an
3061dbf2f8 wireless/wapi: add option to associate with bssid
Change-Id: I68ef42edfc50ef5baf0f02a570d0e7f79669659f
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 04:20:43 -07:00
chao.an
77aa0e8908 netutils/dhcpc: try to get the host name via syscall first
Change-Id: I22aa8316f5c126bf3bafe9476a27a43c01da6129
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 01:13:05 -07:00
Pierre-Olivier Vauboin
bd537f286d ntpclient: fix NTP daemon state in case of DNS failure 2020-09-15 01:18:37 +08:00
Xiang Xiao
837b405624 Change all files come from Xiaomi/Pinecone to Apache License 2.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-23 15:44:32 -06:00
SPRESENSE
78e8090842 examples: wget: Fix nxstyle issues 2020-08-18 10:07:47 -05:00
SPRESENSE
7a1d626504 netutils/webclient: Enable to send long HTTP request
Call send() repeatedly until whole buffer to be sent.
2020-08-18 10:07:47 -05:00
Xiang Xiao
e71e537e24 ftpc_transfer.c:667:15: Fix error: ‘argc’ undeclared
forget in commit efeb1d10b1

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I93a99e909dac57821366f7b522404e673fbcd9d8
2020-08-15 18:19:31 +01:00
Xiang Xiao
efeb1d10b1 netutils/ftpc: Change watchdog callback prototype
follow up the kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-14 08:20:05 -06:00
Xiang Xiao
ebf37162ed Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-11 12:33:50 -06:00
Xiang Xiao
bf4c36c83f netutils/ftpc: Embed wdog_s in ftpc_session_s directly
follow up the kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-11 12:33:50 -06:00
Xiang Xiao
e6c5ff9208 Remove the unnecessary touch and clean from Makefile
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-11 19:10:19 +01:00
chao.an
8917467d04 netutils/dhcpd: correct the member name
Change-Id: I4dc6be8550a938851ae897fd93200a995e5c5178
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-07 14:16:14 -05:00
SPRESENSE
c1bf012211 netutils/usrsock_rpmsg: Change to pass the flags to the psock interface
Pass the sendto/recvfrom flags argument to the psock interface.
2020-08-06 20:52:09 +09:00
Masayuki Ishikawa
cb9eb7cfd7 netutils: webserver: Replace license header with Apache License 2.0
Summary:
- This commit replaces license header in httpd_dirlist.c

Impact:
- No impact

Testing:
- Buid check only
2020-07-29 01:05:31 -05:00
Masayuki Ishikawa
caaf343bad netutils: webserver: Fix style violations
Summary:
- This commit fixes style violations in httpd_dirlist.c

Impact:
- No impact

Testing:
- Buid check only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>>
2020-07-29 01:05:31 -05:00
Maciej Wójcik
21049ece6e Rewritten READMEs to Markdown 2020-07-25 01:01:51 -07:00
Maciej Wójcik
51e6645f71 Rename README and README.txt to README.md 2020-07-25 01:01:51 -07:00
Masayuki Ishikawa
63068ce602 netutils: netclient: Introduce CONFIG_NETUTILS_NTPCLIENT_WITH_AUTH
NOTE: currently, no authentication-related code is implemented.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-18 04:44:38 -05:00
Xiang Xiao
317f0159a4 telnetd: Fix the buffer overflow
Should only memset ipv6 part of socket address(exclude famliy and port field)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-12 14:11:54 +01:00
Xiang Xiao
deaa6c5b7b build: Replace $(TOPDIR)/Make.defs with $(APPDIR)/Make.defs
and move NUTTXLIB defintion to the common place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 15:17:37 -03:00
chao.an
24407f16f5 net/sockopt: change the socket option style from Linux to BSD
Linux Programmer's Manual
...
IP(7)
...
NOTES
...
    Using the SOL_IP socket options level isn't portable;
    BSD-based stacks use the IPPROTO_IP level.

Change-Id: I143477d8884dd44913c5685028ee62854e4c11ac
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-29 21:07:04 -05:00
Peter van der Perk
839b3530d4 netlib: add AF_CAN family and CONFIG_NET_CAN support 2020-06-15 07:23:37 -06:00
YAMAMOTO Takashi
faba0249c1 Include malloc.h instead of stdlib.h for mallinfo()
Adapt to the change in the main repo.

mallinfo is meant to be API compatible with Linux,
where it's provided by malloc.h.

(I think the API actually originated with System V. I don't
remember how it was there though. Anyway, I guess the
compatibility with Linux is more important than System V
these days.)
2020-06-15 07:21:52 -06:00
YAMAMOTO Takashi
83324b68f9 webclient: Fix errno in case of recv failure
When recv() failed, the current code assumes the return value
of recv() is a negative errno. It's wrong. Actually the return value
in case of error is -1. The wrong assumption ends up with reporting
EPERM, as EPERM happens to be -(-1).

This commit changes the code to leave the errno set by the failed
recv() as it is. It should be fine as wget_base() has the same
error returning convention as recv(). That is, return -1 (ERROR)
and set errno in the case of failure.

NOTE: the close() after the errout label can also fail and overwrite
the errno. I don't feel it's a big problem as wget_base() doesn't have
any promise about which error should be reported.
2020-06-12 05:22:45 -07:00
YAMAMOTO Takashi
a49f951c86 netlib_parsehttpurl: Fix pathlen check 2020-05-28 19:59:03 +08:00
YAMAMOTO Takashi
585d63b30d netlib_parseurl: Fix pathlen check 2020-05-28 19:59:03 +08:00
YAMAMOTO Takashi
a455f13ec1 webclient: Check the return value of netlib_parseurl correctly 2020-05-28 19:58:53 +08:00
YAMAMOTO Takashi
415010b7fd webclient: include string.h for strlen
Instead of relying on indirect namespace pollutions.
2020-05-28 11:15:18 +02:00
YAMAMOTO Takashi
276bf42e0d webclient: Fix http -> https redirection
http -> https redirection is rather common. The old code was
just broken in that case.

Also, this commit is a step towards https support.

* Switch to netlib_parseurl
* Fix error propagation in wget_parseheaders
* Bail out on a redirect to a URL with unsupported scheme
2020-05-26 15:38:12 +08:00
YAMAMOTO Takashi
e939e55a50 webclient.c: Limit the number of redirections 2020-05-25 23:54:38 +08:00
YAMAMOTO Takashi
6b00c37a65 dhcpc.c: Fix an nxstyle complaint 2020-05-25 23:53:29 +08:00
YAMAMOTO Takashi
1cb82e58ac dhcpc: Don't use an uninitialized variable 2020-05-25 23:53:29 +08:00
Xiang Xiao
69f013e74e build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 15:56:35 +01:00
Xiang Xiao
3f933d073c netuitls/thttpd: Add $(APPDIR)/netutils/thttpd into search path
to fix config.h can't be found

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-22 12:25:09 +01:00
Masayuki Ishikawa
34305351c4 netutils: ftpd: Fix style violations in ftpd.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-22 16:53:37 +08:00