Commit Graph

558 Commits

Author SHA1 Message Date
archer
52abe148ce
netutils/base64: correct the buffer type 2020-04-03 11:16:12 +01:00
Xiang Xiao
595c72b38e
ping/ping6: Support the dual stack host correctly 2020-03-31 22:18:26 +01:00
YAMAMOTO Takashi
c9c1d2bbc6 Change the default of stack size configs to DEFAULT_TASK_STACKSIZE
Where:
 * Under examples and testing
 * And the default value is less than 2048

Using a bit more memory for examples and tests should not
be a critical problem.
2020-03-27 02:43:11 -05:00
YAMAMOTO Takashi
e7156be066 Change the defaults of stack size configs to DEFAULT_TASK_STACKSIZE
This commit changes only ones with the default 2048 and
leaves the others.
E.g. this leaves SYSTEM_RAMTEST_STACKSIZE, whose default is 1024.
I guess those need to be inspected one-by-one.
2020-03-27 02:43:11 -05:00
Xiang Xiao
1511403fdf Revert "Don't generate .depend anymore"
This reverts commit cc5ad09caa.
2020-03-22 23:09:40 -05:00
Xiang Xiao
cc5ad09caa
Don't generate .depend anymore 2020-03-22 18:15:21 +00:00
Xiang Xiao
d96bc5a4fb netinit: Unregister notification at the end in netinit_monitor 2020-03-07 13:13:55 -06:00
Xiang Xiao
127fe118b9 telnet: Fix compile error by commit 39bf19d 2020-02-28 08:08:37 -06:00
Xiang Xiao
39bf19d1f4 Fix some wrong state handler in _negotiate
Also run file through nxstyle and correct coding standard issues.
2020-02-27 13:14:32 -06:00
chao.an
52ad01f0bf netutils: save wapi config to file system
save and reload the wapi config from file system
2020-02-26 16:11:46 +00:00
chao.an
ee615f0568 net/wapi: remove unnecessary cast 2020-02-26 16:11:39 +00:00
Xiang Xiao
41d88f06e7 Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
Xiang Xiao
d660492289 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:41:36 -06:00
chao.an
f28eca9dbc Make.defs: Use complete include path 2020-02-19 12:56:10 -06:00
Xiang Xiao
d81b7af407 ntpclient: Use sem protect global variable instead sched_lock/unlock 2020-02-14 09:08:31 -06:00
Xiang Xiao
02a800c930 ntpclient: Initialize g_ntpc_daemon at the definition
Change-Id: I4dad2e246aca7d30092cf8a4bc8136e90668f134
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-14 09:01:57 -06:00
Xiang Xiao
782953ff05 ntpclient: the 2nd arg of MKLVM should be version number
Change-Id: I742c3a5082f48fcc8e291100ff81c60093bc7538
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-14 09:01:57 -06:00
Gregory Nutt
c8dbd59e9a netutils/telnetd/telnetd_daemon.c: Avoid a warning if CONFIG_NET_SOCKOPTS=n 2020-02-09 00:33:39 +08:00
Gregory Nutt
d2522e2821 apps/netutils/telnetd: Fix undefined reference to setsockopt.
Recent change from Xiao Xiang enabled the SO_REUSEADDR socket option unconditionally.  This, of course, causes link time failures if socket options are not enabled:

apps/netutils/telnetd/telnetd_daemon.c:182: undefined reference to 'setsockopt'.

Observed during build testing with configuration rddrone-uavcan144:nsh
2020-02-09 00:33:39 +08:00
Miguel Herranz
960a92c652 Make SO_REUSEADDR not mandatory in netlib
This functionality is not available in NuttX so far.
2020-02-06 23:43:37 +01:00
Xiang Xiao
bf3e6e2367 Improvements for telnet server
Author: Xiang Xiao <xiaoxiang@xiaomi.com>

    Check POLLHUP and POLLERR in telnet poll loop

      to handle the remote end close correctly

    Send "NVT"(network virtual terminal) as the default if getenv("TERM") return NULL

      telnet should trigger the error handling if inet_pton return zero
      since zero mean the string has format error

    Don't return 1 in _environ_telnet to avoid trigger the compression
    and remove the redundant TELNET_TELOPT_COMPRESS2 check

    Change telnet_error_u to telnet_error_e required by the coding standard

    Ensure telnet object get freed before the abnormal exit
2020-02-04 19:09:22 -03:00
Xiang Xiao
e0adf5ee0b Remove all CONFIG_NET_HAVE_REUSEADDR guard 2020-02-03 15:13:19 -06:00
Gregory Nutt
724a34bd3b Run all files modified by pr45 through nxstyle. 2020-02-03 07:38:57 -06:00
Xiang Xiao
72bbc27b0f Free daemon struct in all telnetd_daemon error path
Change-Id: I7f014dc5f327a6ae6adf9cdbea8089ffab2efe37
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-03 07:17:22 -06:00
Xiang Xiao
d6e450e39a Skip to close acceptsd since it is already closed in SIOCTELNET handler
Change-Id: I669224fd5cd44162bb67c8316b56348f7f298883
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-03 07:17:22 -06:00
Xiang Xiao
579327a972 Remove CONFIG_NET_HAVE_REUSEADDR check from telnetd_daemon
since this option doesn't exist at all

Change-Id: I9ee8e61d0a8af1c9eb690b2f2945a7f7f7b5f834
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-03 07:17:22 -06:00
Xiang Xiao
28891ef27e Remove the global variable in telnetd_daemon
Change-Id: I264d10c0f141109ada6ac90afb2ba3e8cfad4404
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-03 07:17:22 -06:00
Xiang Xiao
1154735ca6 Refine the preprocess conditional guard style 2020-01-31 11:04:10 -06:00
Xiang Xiao
e0dcfa0c55 Remove extra whitespace from files (#43)
* Remove multiple newlines at the end of file
* Remove the white space from the end of line
2020-01-31 08:29:24 -06:00
Alin Jerpelea
59b763add4 netutils/netlib: Fix buffer overflow 2020-01-29 00:29:30 -08:00
Ouss4
eb1af03259 examples/sendmail: Few fixes to make the example run on a local SMTP
server.
2020-01-25 16:39:21 -06:00
Gregory Nutt
72a934c6c2 Add configuration settings for apps/examples/sendmail.
The sendmail example hasn't been used in years.  I am not sure it was ever debugged.  It is so old that it still expects hand editted .config files.  As a result, all of the configuration settings were missing from the Kconfig file.

This commit adds the missing apps/examples/sendmail configuration settings so that the example at least builds.  I cannot test it because I have no smtp server that I am willing to spam.

This configuration also adds missing configuration dependencies and runs the C files in apps/examples/sendmail and apps/netutils/smtp through nxstyle.

This commit resolves an issue reported by surya prakash rased in the Google group:  https://groups.google.com/forum/#!topic/nuttx/idr-M164Y24
2020-01-24 19:07:54 -03:00
Xiang Xiao
fd3775e068 Remove CONFIG_TIME_EXTENDED conditioning
Remove CONFIG_TIME_EXTENDED related stuff since kernel remove this option
2020-01-23 08:36:03 -06:00
Xiang Xiao
db61c92100 Fix dhcpd #17
apps/netutils/dhcpd/dhcpd.c:  Fix unused const variable

dhcpd.c:273:29: warning: 'g_anyipaddr' defined but not used [-Wunused-const-variable=]
 static const uint8_t        g_anyipaddr[4] = {0, 0, 0, 0};

apps/netutils/dhcpd:  Make dhcpd interface configurable

apps/netutils/dhcpd:  Lease address directly if hit in address range

apps/netutils/netinit: Initialize dhcpc_state

update the addresses only on request success
2020-01-16 12:06:25 -06:00
Gregory Nutt
b2cd439b10 Remove unselectable CONFIG_NET_TCP_READHEAD dependencies.
NuttX commit 346336bb9e5c9199b82e34d08bf23dd1bc389460 make CONFIG_NET_TCP_READADHEAD unselectable and removed all references to CONFIG_NET_TCP_READHEAD from the the NuttX repositories.  However, there was no corresponding removal of CONFIG_NET_TCP_READHEAD from the apps/ repository.  As a result, there was logic that depended on the selection of CONFIG_NET_TCP_READHEAD that could never be enabled.

This was found during build testing using the configuration olimex-lpc1766stk/thttpd-binfs.  THTTPD was not being build fully because it had dependencies on CONFIG_NET_TCP_READHEAD.  There resulted int numerous new warnings and, finally, the error:

(.../apps.examples.thttpd.o): in function `thttp_main':
thttpd_main.c:(.text+0x104): undefined reference to `thttpd_main'
2020-01-15 11:16:17 -03:00
Xiang Xiao
53efd71d6d Fix format warn (#13)
* fix warning: format '%u' expects argument of type 'unsigned int *', but argument 3 has type 'uint16_t *

Change-Id: I3eccf8e2cd917f19b7a9edab233b327297d74bb7
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* fix warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'int'

Change-Id: Ic59a1e9e49256637fa73459c46b8cded036cf971
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-14 03:21:13 +01:00
Gregory Nutt
561fc02ae5 netutils/ftpd/ftpd.c: Fix an error introduced in PR10. In error clean-up, it was trying to free memory on an error where we failed allocated memory. Not good. 2020-01-12 11:55:16 +00:00
Gregory Nutt
e67850971d apps/netutils/ftpd/ftpd.c: Fixes several problems:
1. This fixes the issue reported in Bitbucket apps/ Issue 15.  That is, if fopen() fails, the NULL stream handle would be used in subsequent logic.  The handling of the failure was incomplete.
2. Some of the error handling was fixed.  In the event of an error, it was return return an error value ONLY if we failure to report the error and even then the wrong error would be reported.  This change now preserves and returns the correct error number that is the root cause of the failure.
3. Ran the file through tools/nxstyle and cleaned up many formatting problems.
2020-01-11 22:22:46 -03:00
Xiang Xiao
857158451b Unify the void cast usage
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro

Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-02 23:21:01 +08:00
Gregory Nutt
9b77f80740 apps/netutils/dhcpd/dhcpd.c: Correct backward conditional logic in dhcpd_leaseexpired(). Noted by surya prakash <suryaec1684@gmail.com>. 2019-12-19 07:35:52 -06:00
Xiang Xiao
3a2bd2c05f apps/netutils/ntpclient/ntpclient.c: Merge local structure variables xmit and recv into pkt to save the stack. 2019-12-18 09:39:57 -06:00
Gregory Nutt
3da8091d30 Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 2019-12-10 08:39:22 -06:00
Xiang Xiao
0218a2fcc7 Fix compiler warnings:
tftpc_get.c: In function 'tftp_write': tftpc_get.c:307:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   int fd = (int)ctx;
            ^
tftpc_get.c: In function 'tftpget': tftpc_get.c:368:57: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   result = tftpget_cb(remote, addr, binary, tftp_write, (void*)fd);
                                                         ^
2019-12-05 07:14:29 -06:00
Xiang Xiao
3bf17d602e apps/netutils/ftpc: ix the compiler warnings:
ftpc_transfer.c:652:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   FAR struct ftpc_session_s *session = (FAR struct ftpc_session_s *)arg1;
                                        ^
ftpc_getreply.c: In function 'fptc_getreply': ftpc_getreply.c:218:58:
warning: passing argument 3 of 'wd_start' from incompatible pointer type [-Wincompatible-pointer-types]
       ret = wd_start(session->wdog, session->replytimeo, ftpc_timeout, 1, session);
                                                          ^~~~~~~~~~~~
 In file included from
/workspace/mirtos/out/sim/miai/mirtos/nuttx/include/nuttx/sched.h:56:0,
                 from /workspace/mirtos/out/sim/miai/mirtos/nuttx/include/sched.h:49,
                 from /workspace/mirtos/out/sim/miai/mirtos/nuttx/include/stdio.h:48,
                 from ftpc_internal.h:48,
                 from ftpc_getreply.c:46: /workspace/mirtos/out/sim/miai/mirtos/nuttx/include/nuttx/wdog.h:247:5: note: expected 'wdentry_t {aka void
(*)(int, long long unsigned int)}' but argument is of type 'void (*)(int, uint32_t) {aka void (*)(int, unsigned int)}'
 int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...);
     ^~~~~~~~
2019-12-05 07:11:47 -06:00
liuhuahang
ee53a90fa5 apps/netutils/ntpclient/Kconfig: NTP client should depend on NET_SOCKOPTS. 2019-12-05 07:09:27 -06:00
Gregory Nutt
1859f56380 apps/netutils/netinit, apps/netutils/netlib/, and apps/include/netutils/netlib.h: Extend a few definitions to permit building netutils and netinit with only Netlink sockets enabled. 2019-11-19 09:49:36 -06:00
Gregory Nutt
370bd94a6b netutils/netlib/netlib_getdevs.c: Add comments and a placeholder for the RTM_NEWROUTE response. 2019-11-12 10:37:40 -06:00
Gregory Nutt
449290c8da apps/examples/netlink_route: Add test/example of NETLINK_ROUTE 'get' opeations. apps/netutils/netlib: Fixes to NETLINK_ROUTE helpers found by testing with apps/examples/netlink_route. 2019-11-11 13:40:57 -06:00
Gregory Nutt
438777cd38 netutils/netlib/netlib_getroute.c: Add function to retrieve routing tables using netlink. 2019-11-10 12:36:34 -06:00
Gregory Nutt
e260ea779c apps/netutils/netlib/netlib_getnbtab.c: Add a utility function that will return a list of all network devices in the UP state. 2019-11-09 17:38:02 -06:00