Commit graph

1152 commits

Author SHA1 Message Date
hongfengchen
c69df55cd0 rexecd: fix type change
Fix cast from pointer to integer of different size to ensure
proper type conversion and avoid compilation warnings.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
hongfengchen
b56c785640 testing: add missing header files
Add missing header files in netutils and lsan modules to fix
implicit function declarations and improve compilation compatibility.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
Jiri Vlasak
72f57fc34e netutils: Add BARE
BARE is a simple binary representation for structured application data.

cbare, the BARE implementation ported by this commit, is an I/O agnostic
C implementation of the BARE message encoding.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-23 11:05:48 -03:00
Jiri Vlasak
37403210f9 netutils/nng: Update help for NETUTILS_NNG
NNG depends on options that, if not enabled, makes compilation or
runtime crashes. Noting these options in help helps to find out which
are such options.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-21 09:48:11 +08:00
zhanghongyu
9c85568c4f icmpv6_ping.c: change socket type from SOCK_DGRAM to SOCK_RAW.
standardize the implementation of ping6 to better comply with socket
permissions on certain systems.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-19 22:52:06 +08:00
liqinhui
45a6b0365c netutils/ping: Support ICMP filter for ping.
Add setsockopt support to filter ICMP packets.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-19 14:09:31 +08:00
zhangshuai39
11c8220fd5 netlib: Replace perror with nerr
Use the nerr interface for error print.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-17 12:09:13 +08:00
zhanghongyu
faefee4897 MQTT-C: compile tests only if no with_mbedtls is enabled
tests only supports tests in non-encrypted mode. when we open tests
compilation in other modes, there will be many compilation warning
with mismatched parameter types, and it will not run correctly.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 21:12:36 +08:00
gaohedong
54bef649ea net/ptpd: fix compile warning issue
In some scenarios, dynamic memory allocation is not allowed, so it is modified to a static allocation method.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-16 21:12:22 +08:00
zhanghongyu
c62d0d0875 netlib_setarp.c: add ATF_PERM to mark arp entry as permanent
Improve the behavior of the ARP table so that the manually configured
ARP table has the highest priority, can only be manually modified to
other values, otherwise will never change again, and will not time out.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 21:08:26 +08:00
daichuan
859fc54c96 netutils/ping: change socket type to SOCK_RAW
The ping socket creation method is changed from SOCK_DGRAM to SOCK_RAW,
because SOCK_DGRAM may not have permission in some environments (e.g. Docker).
Also add checksum calculation when send, and perform IP header processing when receive.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-15 17:19:29 +08:00
wangchengdong
60d814efa2 sched/signal: Add support to disable partial or all signals
Fix dependency issue when signals are partially or fully enabled

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-15 15:48:54 +08:00
meijian
b0b90ac728 apps/net: add http connectivity check API
Add netlib_check_httpconnectivity() to verify HTTP service connectivity by sending GET request and validating status code.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-13 10:55:40 +08:00
gaohedong
d594c953a1 net/vlan: fix issue of vlan pcp config
Fix a issue of vlan pcp config.
`vconfig add eth0 10` will create eth0.10 with VID=10 and no PCP(0)
`vconfig add eth0 10 3` will create eth0.10 with VID=10 and PCP=3

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-12 00:55:47 +08:00
Huang Qi
4e8a0ae4c4 style: Fix coding style violations in nuttx-apps
Fix various coding style issues including:
- Case statement formatting
- Include placement and ordering
- Whitespace issues
- Long line formatting
- Bracket alignment

Affected modules:
- audioutils, examples, include
- netutils, system

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-12 00:54:48 +08:00
zhangshuai39
63f61d080a netutils/ntpclient: Fix a large number of print DNS request errors
Before attempting to sample via NTP, network connectivity should be checked to avoid frequent sampling that could cause network error logs to overflow.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-11 15:57:05 +08:00
meijian
c61fb846d7 apps/net: add if network conntivity check API
Perform connectivity testing on the specified network interface card.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-09 14:03:20 +08:00
buxiasen
1512f9c6e5 netlib/ping: fix the stack variable not initialized.
We add devname in ping_info_s, but not initializeed, cause
data abort as value in stack possible not NULL.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-07 11:58:13 +08:00
buxiasen
157ecb091d iperf: compatible work with no IPv4
We possible want to use iperf to test rpmsg socket etc.

Fix error when enable iperf and no IPv4
```
arm-none-eabi-ld: warning: ~/nuttx/nuttx has a LOAD segment with RWX permissions
arm-none-eabi-ld: ~/nuttx/staging/libapps.a(iperf_main.c.~.apps.netutils.iperf_1.o): in function `iperf_main':
~/apps/netutils/iperf/iperf_main.c:248:(.text.iperf_main+0x330): undefined reference to `inet_ntoa_r'
arm-none-eabi-ld: ~/apps/netutils/iperf/iperf_main.c:240:(.text.iperf_main+0x354): undefined reference to `netlib_get_ipv4addr'
arm-none-eabi-ld: ~/nuttx/staging/libapps.a(iperf.c.~.apps.netutils.iperf_1.o): in function `iperf_print_addr':
~/apps/netutils/iperf/iperf.c:226:(.text.iperf_print_addr+0x3c): undefined reference to `inet_ntoa'
```

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-04 00:06:17 +08:00
meijian
3467f9b82d apps/net: add ip address connectivity check API
The system checks connectivity with the input IP address; if no IP address is provided, it defaults to checking DNS server connectivity.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-04 00:05:38 +08:00
zhangshuai39
6830e297cf dhcpd: Supports kernel mode compilation
The previous method of terminating the dhcp daemon via a global variable has been removed; instead, the `kill pid` command is used. Also, because the original `dhcp_start` method creates tasks via `task_create`, which is not supported in kernel mode, `dhcp_start` is not compiled in kernel mode. The daemon can be started in kernel mode using `dhcpd xxx &`.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-02 12:29:42 -03:00
zhangkai25
710aef6bd0 iperf: Increase the priority of the report thread
ensure it is not blocked by the iperf thread, preventing iperf from completing

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2025-12-30 19:51:57 +08:00
dongjiuzhu1
e5c85d1ca2 netutils/ptpd: Add switch correction time change
The current gPTP stack does not support path delay correction of the Switch.
This patch adds the path delay correction field in the Header.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
03ca9ba500 netutils/ptpd: using -B to control BMCA message
new option -B to BMCA message

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
54cbc2ee0d netutils/ptpd: support PTP ethernet transport
support ptp by rawsocket

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
65d29de0f7 netutils/ptpd: add NET_PKT to enable PTP
support ptp clock device

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
54d55fe5f4 netutils/ptpd: add NETUTILS_PTPD_ADJTIME_THRESHOLD_NS to accelerate adjustment
optimize the speed of adjustment

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
d3504bf9b3 netutils/ptpd: support adjtime for ptp device
support ptp clock deivce to adjust time

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
4426ce733a netutils/ptpd: using dynamic config to config clien-only mode and delaye2e
fix compile warning when only enable PTPD_CLIENT or PTPD_SERVER

ptpd.c:493:38: error: 'CONFIG_NETUTILS_PTPD_PRIORITY1' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:494:39: error: 'CONFIG_NETUTILS_PTPD_CLASS' undeclared (first use
in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:495:39: error: 'CONFIG_NETUTILS_PTPD_ACCURACY' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_DEBUG'?
ptpd.c:498:38: error: 'CONFIG_NETUTILS_PTPD_PRIORITY2' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:502:36: error: 'CONFIG_NETUTILS_PTPD_CLOCKSOURCE' undeclared
(first use in this function); did you mean
'CONFIG_NETUTILS_PTPD_STACKSIZE'?

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
5d34a0906a netutils/ptp: destroy donesem at the end of ptpd_status
fix minor issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
Xiang Xiao
832e61c1c4 netutils/ptpd: Add the missing comparison in is_better_clock
The original implementation only checked if each field was less than,
but didn't check for greater than before proceeding to the next field.
This caused incorrect clock selection behavior in the PTP Best Master
Clock Algorithm (BMCA).

The fix expands each comparison to explicitly check both < and >
conditions, returning the appropriate result immediately. This ensures
proper precedence evaluation according to IEEE 1588 specification:
- gm_priority1
- gm_quality (class, accuracy, variance)
- gm_priority2
- gm_identity

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
e718fdd2c6 netutils/ptpd: get nanoseconds by SO_TIMESTAMPNS to satisfy higher precision
using nanoseconds as timestamp

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
4411a41bc2 netutils/ptpd: using hardware_ts to replace CONFIG_NET_TIMESTAMP
runtime to config the ways of timestamp

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
ac881e5108 system/ptpd: provide more parameter by struct ptpd_config_s when starting ptpd
origin command change to new command:
ptpd start interface & -> ptpd -i eth0 &
ptpd stop pid          -> ptpd -d pid
ptpd status pid        -> ptpd -t status

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
28302ae7d7 system/ptpd: using main task to replace new task
new starting command:
ptpd start interface &

we should run it in background ways

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
d1f59bef8e netutils/ptpd: using DEBUG_PTP_ERR/WARN/INFO to replace NETUTILS_PTPD_DEBUG
using new ptp clock device debug function

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
e4ddfdeed1 netutils/ptpd: byte align for ptp structure
pass structure between remote and local core

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
3ddda82313 netutils/ptpd: add CMakelist for ptpd
support cmake build

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
Zhe Weng
40c7982816 netlib: Add support for adding/removing VLAN device
Add support for adding/removing VLAN device

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-30 11:17:38 +08:00
meijian
9da2bc0696 apps/net: add get iobinfo api
Obtain detailed IOB information by parsing the /proc/iobinfo file.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 12:27:27 -05:00
gaohedong
74c71145da net/ethernet: ARP can be configured on interface
ARP can be configured on interface

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-25 12:25:02 +08:00
meijian
5d3b2d07d6 ping: add -I for bind device
Add -I option to specify the network device to use for sending ICMP
echo requests. This allows users to explicitly bind ping to a
specific network interface, which is particularly useful in
multi-homed systems with multiple network interfaces.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 12:24:04 +08:00
zhangshuai39
532a055abb paho_mqtt: Add mqtt compilation files
It provides the necessary compilation files and configuration management files, and offers a publish demo and a subscribe demo

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-25 12:20:17 +08:00
meijian
4b3070c081 apps/net: add ip conflict check API
Supports checking for IP conflicts on a NIC.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 09:44:47 +08:00
zhanghongyu
837c27d6e3 netutils/libwebsockets: add cmake support
add libwebsockets cmake support

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 09:43:48 +08:00
zhangshuai39
26a969ac71 apps/netutils: Modify the MQTT compilation file to enable MQTT testing
Modify the build and test files to make the MQTT test cases run.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-22 11:11:59 +08:00
daniel-geotab
9bbc2fe1e4 Revert "ppp: Fix wrong lcp_state handling on peer reconnection"
This reverts commit 800b93de9f.

Signed-off-by: daniellizewski <daniellizewski@geotab.com>
2025-11-11 14:05:47 -05:00
daniel-geotab
ba8823534c Revert "ppp: Reformat to match nuttx coding style"
This reverts commit 0c734ca62b.

Signed-off-by: daniellizewski <daniellizewski@geotab.com>
2025-11-11 14:05:47 -05:00
nuttxs
92269be92a netutils/netlib: support delete the DNS server address by index or address
- Modify the DHCP-client data structure to support multiple DNS addresses
- Enhance DHCP-option parsing to extract all DNS-server addresses
- Set all received DNS-server addresses
- fix some test case build error

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-11-10 18:10:16 +08:00
Pavel Pisa
7f90139918 netutils/libshvc: update to correct reply head for non single element CID array
The update enables interoperability with a Silicon-Heaven
SHV3 protocol broker implemented in Rust language

  https://github.com/silicon-heaven/shvbroker-rs

New commits from shv-libs4c project

  https://github.com/silicon-heaven/shv-libs4c

- shv_pack_head_reply: correct reply head for non single element
  CID array

  When servicing request from the SHV3 protocol version broker
  itself then CID array is empty and missing TAG_CALLER_IDS
  for empty array breaks encoding scheme.

- shv_process: even in case of unsuccessful attempts to connect
  respect request to stop

  The request to stop initiate  by signal caused the high priority
  thread to enter busy-loop and block a system. Check for request
  to stop (running flag cleared) even in disconnected state after
  unsuccessful attempt.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2025-10-17 14:39:16 -04:00