Commit Graph

1019 Commits

Author SHA1 Message Date
Zhe Weng
9489659890 netutils/ping: Optimize stack usage of icmp_ping
Can reduce 88~144 Bytes on ARMv7-A depending on optimization level.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-01-02 19:47:23 +01:00
Petteri Aimonen
fcd0729e21 ptpd: Fix reserved word 'class'
When ptpd.h is included in C++ code, the use of identifier 'class'
caused a compilation error. Changed to "clockclass".
2023-12-07 18:26:39 -08:00
liqinhui
91a697a3f4 renew6: Optimize the process of obtaining an IPv6 address.
If Managed Address Congfiguration flag in the Router Advertisement
Messsage is set, we would obtain the IPv6 address though the stateful
DHCPv6 procedure.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-12-07 06:26:50 -08:00
Petteri Aimonen
6dd9adbb5b ptpd: Code quality improvements 2023-12-04 00:30:26 -08:00
Petteri Aimonen
af6e4d2cb9 ptpd: Code style and FAR pointer fixes 2023-11-24 20:15:38 -08:00
Petteri Aimonen
0adce22400 ptpd: Implement status & stop interfaces 2023-11-24 20:15:38 -08:00
Petteri Aimonen
efc6cfddb4 ptpd: Fix compilation error when debug messages disabled
The debug macros did not get declared in all setups.
2023-11-24 20:15:38 -08:00
Petteri Aimonen
e2168abe9a ptpd: Implement delay reqs, fix timing bugs
Fixed bug where negative offsets were not properly handled because
clock_timespec_subtract clamps values to zero.

Implement support for SO_TIMESTAMP to get accurate packet
reception timestamp.

Implemented delay requests for measuring packet transfer delay.

Implemented clock drift estimation to bring the clocks closer to
sync and to filter out measurement jitter.
2023-11-24 20:15:38 -08:00
Petteri Aimonen
8dbf26016a ptpd: Re-join multicast group after timeout
If multicast PTP packets are not being received, rejoin the multicast group.
This automatically recovers from situations such as rebooting a network switch.
2023-11-24 20:15:38 -08:00
zhanghongyu
ae59177279 matter: download chip and dependent source for open source version
The community version needs to dynamically fetch the matter source code at compile time and apply the required nuttx adaptation patch

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
zhanghongyu
72e67e9d6d jsoncpp: add cmake scripts for jsoncpp
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
zhanghongyu
891c5e0cc8 matter: add cmake support
A nuttx with the matter command can be compiled using cmake and enable CONFIG_MATTER option.
The matter compiled by the current script is just a lighting example of
a limited number of commands that can be tested by chip-tool.

After nuttx is connected to the LAN and the matter command is executed, other devices in the LAN, such as linux PCS, can run the following commands to scan, connect, turn on and off, adjust brightness and contrast, and so on.

chip-tool pairing onnetwork 1 20202021
chip-tool onoff on 1 1
chip-tool levelcontrol move-to-level 128 10 0 0 1 1
chip-tool colorcontrol move-to-hue-and-saturation 240 100 0 0 0 1 1

Depends on the following configuration options:
CONFIG_CRYPTO_MBEDTLS=y
CONFIG_DEV_URANDOM=y
CONFIG_LIBCXX=y
CONFIG_LIBM=y
CONFIG_NET_IPv6=y
CONFIG_NET_ICMPv6=y
CONFIG_NET_ICMPv6_AUTOCONF=y
CONFIG_NET_ICMPv6_NEIGHBOR=y
CONFIG_NET_ICMPv6_ROUTER=y
CONFIG_NET_ICMPv6_SOCKET=y
CONFIG_NET_IGMP=y
CONFIG_NET_MLD=y
CONFIG_NET_MLD_ROUTER=y

This initial version does not yet have Bluetooth and OTA support.

The community version needs to dynamically fetch the matter source code at compile time and apply the required nuttx adaptation patch.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
Zhe Weng
2f9d98cab2 netutils/netlib: Add support for add/del a single IPv6 address
Note:
The `SIOCSIFADDR` and `SIOCDIFADDR` uses different params for `AF_INET` and `AF_INET6` (`struct ifreq` vs `struct in6_ifreq`) as defined by https://man7.org/linux/man-pages/man7/netdevice.7.html

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-08 00:20:19 +08:00
raiden00pl
008aba12d4 remove netuitls/xxx/README.md. Migrated to Documentation/applications/netutils 2023-10-30 10:00:01 +08:00
dongjiuzhu1
cc66e34fbf rexecd: avoid socket/pipe/socketpair dup to new task
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-26 00:24:28 +08:00
Stuart Ianna
a21476beab netutils/netinit: Reduce net monitor delay on platforms without 64 bit time type.
Waiting for an hour can cause the calculated tick count in nxsem_clockwait to overflow due to the default width of sclock_t.

Reduce the long wait period on platforms not using 64-bit time.
2023-10-25 15:39:25 +08:00
Stuart Ianna
7605197f9d netutils/netinit: Perform icmpv6 autoconfiguration when link transitions from down to up.
Without this addition, icmpv6 is never configured in the case that the
device is powered on without an ethernet cable connected.
2023-10-24 12:38:24 +08:00
raiden00pl
fdabc7eccc netutils/netinit/Kconfig: cosmetics 2023-10-23 22:26:13 +08:00
raiden00pl
dbdd59e52f remove empty netutils/usrsock_rpmsg 2023-10-23 22:26:13 +08:00
makejian
9fa9c5b0a2 netutils/dhcpc: Add configuration check for getrandom
Calling getrandom depends on 'CONFIG_DEV_URANDOM' or 'CONFIG_DEV_RANDOM'
depends on patch https://github.com/apache/nuttx/pull/10925
Signed-off-by: makejian <makejian@xiaomi.com>
2023-10-18 19:47:48 +08:00
liqinhui
79e8722743 dhcp6c: Add the renew6 command for dhcp6c.
Support Stateless and Stateful. The renew6 is used as follows:
 - Stateless: renew6 eth0
 - Stateful: renew6 eth0 1

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-10-12 10:15:55 +08:00
Petteri Aimonen
5a992d4e18 Add basic IEEE-1588 PTP server/client
What works:
- Basic server & client operation
- Transmission and reception of announce, sync and follow-up

Still missing:
- SO_TIMINGS for getting more precise packet timestamps
- Implementation of delay_req and delay_resp packets
- Status and stop interfaces for the daemon
2023-10-06 17:25:23 +08:00
daniellizewski
a4ab405faa Fix typo in uint8_t 2023-09-21 10:45:17 +08:00
wangyingdong
2e5139eba4 dhcpd:Optimize the data area memory and reduce it by about 1k bytes
If a daemon app(e.ot_client) starts dhcpd by calling dhcpd_start and needs to shut it down after use,
then the global static variables ds_inpacket and ds_outpacket will always occupy the data area,
causing unnecessary waste.

Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-09-13 21:49:49 +08:00
xuxin19
c230321cae fix progname do not match issue
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-09-11 16:37:05 +08:00
wangmingrong
a9f0fc55d1 codecs: add md5_file API
Add the API for 'md5_file' to directly obtain the digest value by passing in the file path

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2023-09-08 02:11:23 +08:00
zhanghongyu
956b935511 mqttc: add mbedtls MQTTC support
The mqttc demo under example path can not support mbedtls api.
Because of the MQTT-C source code already contains many types of
link examples, so we added the corresponding makefile to
support mbedtls mqttc connections publisher and posix mqttc
connections publisher and subscriber.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-01 23:21:34 +08:00
simbit18
17a497492a Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Add comments
2023-09-01 01:21:54 +08:00
Petro Karashchenko
189d0c803f net/ip: print ip addresses using ip4_addrN macro
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-22 01:36:42 +08:00
Xiang Xiao
7251645685 Fix some coding style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
Xiang Xiao
054cf3b1cb Change all sizeof(arr)/sizeof(arr[0]) to nitems
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
raiden00pl
6b98aec34a wakaama: update wakaama to a commit that includes a fix for wakaama examples under NuttX 2023-08-09 00:02:46 +08:00
yangyalei
fd261d839d test: modify stacksize and priority
Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-08-03 07:26:49 -07:00
zhanghongyu
768993fb15 ntpclient: change sendto/recv timeout to Kconfig
Change the timeout period of ntpclient to configurable to reduce the impact
The NTP packet is lost during the first TLS connection after the board is started.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-03 06:16:54 -07:00
simbit18
85988dc77f Fix nuttx coding style
Remove TABs
2023-08-01 23:10:32 -07:00
dongjiuzhu1
fb7dafc7e0 netutils/rexec/rexecd: supports remote execution and interaction
using popen with r+,w+ mode to interact with the remote service on
the command line, supporting input and output until the local
voluntarily exits or the remote service ends.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-29 20:29:54 -07:00
raiden00pl
7b066ed0d8 netutils: add Eclipse Wakaama support 2023-07-27 09:33:10 -07:00
Xiang Xiao
8083b094c3 Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 09:51:09 +08:00
chao an
7cfcb49213 cmake/apps: add more applications into cmake support
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-13 19:00:18 +02:00
zhanghongyu
bbb2b289cf iptables: add iptables libary
Add xtables.c and xtables.h
In order to support the compilation of third-party utils, we encounter some
situations where the macro is not defined, refer to the common implementation
of other systems, add relevant definitions and empty function.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-13 15:52:36 +08:00
Xiang Xiao
dab972b907 Remove the const cast from the initialization of boardioc_symtab_s::symtab
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-08 16:01:52 +03:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
Mingjie Shen
e94e1e59f3 rexec: warn users about cleartext password transmission
Close apache/nuttx#9642.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-07-01 13:23:04 +08:00
SunJ
b8856479ef netutils/iperf: Fix possible precision loss
Signed-off-by: SunJ <jsun@bouffalolab.com>
2023-06-17 17:12:45 +08:00
Zhe Weng
3e68694bdf netutils/dhcpc: Set BOOTP BROADCAST flag when IPFORWARD is enabled
Socket binded to INADDR_ANY is not intended to receive unicast traffic before being fully configured, at least dhclient configured with socket-only won't do so on Linux and BSDs (https://github.com/isc-projects/dhcp/blob/v4_4_3/common/socket.c#L1201).
We can sometimes receive unicast traffic before being fully configured, it's good, but not always, so we need to set the broadcast flag under some situations.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-15 10:10:05 +08:00
Petro Karashchenko
aed0e2873e apps: fix style issues in code
Add missing FAR and CODE to pointers
Remove FAR for non-pointer variables
Remove extra spaces and align the parameters
Add do {} while(0) wrapper in macro
Use nitems to calculate number of elements in arrays

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 18:47:50 +08:00
Roy Feng
ea0501387f Add interface to configure DHCP daemon 2023-06-06 17:17:08 +08:00
Zhe Weng
f671c004df netlib: set addr.sin_zero to 0 in netlib_set_ipv4dnsaddr
In dns_add_nameserver, the dns_check_nameserver is comparing addresses
with addrlen = sizeof(struct sockaddr_in) for IPv4 addresses, so the
trailing sin_zero field should be 0, otherwise it may fail to figure out
same nameserver address.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-05-22 17:09:33 +03:00
Xiang Xiao
7032c72f2f Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 07:39:53 +03:00
simbit18
c356fe92bc netutils/ping/Kconfig: Fix Kconfig style
Remove spaces from Kconfig file
2023-05-18 00:38:54 +08:00