Commit graph

1191 commits

Author SHA1 Message Date
Ricard Rosson
be43888aa5 netutils/mdns: raise responder stack size default to 8KiB
CONFIG_NETUTILS_MDNS_STACKSIZE defaulted to DEFAULT_TASK_STACKSIZE,
which resolves to as little as 2KiB on some targets.  The bundled
mjansson responder uses a deeper stack than that (DNS record parsing
with name decompression, plus the send/receive buffers) and overflows
on startup, taking the board down with a hardfault before it answers a
single query.

Default to 8KiB, the value that reliably runs the responder, and
correct the help text, which previously claimed a 4KiB default that did
not match DEFAULT_TASK_STACKSIZE.

Assisted-by: Claude (Anthropic Claude Code)
Signed-off-by: Ricard Rosson <ricard@groundbits.com>
2026-07-31 15:19:31 +08:00
Felipe Moura
355d090d83 netutils/dropbear: back chacha20-poly1305 with NuttX /dev/crypto
Replace the bundled libtomcrypt chacha20-poly1305 implementation with an
adapter that drives the NuttX crypto device: the SSH construction maps onto
CRYPTO_CHACHA20_DJB (the original 64-bit counter/nonce ChaCha20
parameterization used by chacha20-poly1305@openssh.com) for the packet
length and payload streams, and onto CRYPTO_POLY1305 for the authentication
tag (plain MACs are driven in two steps through /dev/crypto: COP_FLAG_UPDATE
feeds the data, a final call retrieves the tag).

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-26 07:54:11 -03:00
Felipe Moura
690ec808e5 netutils/dropbear: back hmac-sha2-256 with NuttX /dev/crypto
Replace the bundled libtomcrypt HMAC modules with an adapter that computes the hmac-sha2-256 packet MAC through the NuttX crypto device using CRYPTO_SHA2_256_HMAC sessions.

Require CRYPTO, CRYPTO_RANDOM_POOL, CRYPTO_CRYPTODEV and CRYPTO_CRYPTODEV_SOFTWARE_CRYPTO explicitly instead of selecting crypto support.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-24 18:34:35 -03:00
wangjianyu3
86afa6d182 netutils/rexecd: forward PRIORITY/STACKSIZE config in CMake build
The Makefile build already forwards both values via PRIORITY /
STACKSIZE.  Align the CMake build with the Makefile so that
CONFIG_NETUTILS_REXECD_PRIORITY and CONFIG_NETUTILS_REXECD_STACKSIZE
take effect under CMake as well.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-07-23 17:18:08 -03:00
Abhishek Mishra
608f13fd4b !fsutils/passwd: Replace TEA with PBKDF2-HMAC-SHA256
Migrate passwd encrypt/verify to PBKDF2 modular crypt format using
kernel cryptodev (CRYPTO_PBKDF2_HMAC_SHA256 via /dev/crypto).  Add
passwd_pbkdf2 wrapper, base64url helpers, complexity validation, and
pbkdf2_test for RFC 6070 vector coverage.  FSUTILS_PASSWD selects
CRYPTO, ALLOW_BSD_COMPONENTS, and CRYPTO_CRYPTODEV so existing sim
defconfigs keep building.  Change NSH_LOGIN_USERNAME default to root and
remove fixed-login password defaults.

BREAKING CHANGE: TEA-encoded /etc/passwd entries no longer verify.
Regenerate each entry after upgrading.  Pair with the nuttx host mkpasswd
changes in apache/nuttx#19209.  Boards must enable the appropriate
software or hardware crypto backend for PBKDF2 at runtime.  When
CONFIG_NSH_LOGIN_FIXED=y, set CONFIG_NSH_LOGIN_PASSWORD in the board
defconfig or menuconfig; there is no default password.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-22 17:21:22 +08:00
Abhishek Mishra
1e490d3fbe dropbear: rename libtomcrypt symbols to avoid NuttX collisions
Rename base64_encode, base64_decode, and ecc_make_key in bundled
libtomcrypt to avoid duplicate symbol link errors when dropbear is built
alongside netutils/codecs and NuttX crypto (e.g. sim:dropbear).

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-20 12:45:48 -04:00
Felipe Moura
7469e88bfa netutils/dropbear: retain child exit status for NSH PTY session
The per-session NSH task is reaped with waitpid() in
dropbear_nshsession.c.  Without CONFIG_SCHED_CHILD_STATUS the kernel does
not retain the child exit status, so waitpid() returns ECHILD right after
authentication and the interactive session never starts
("NSH session wait failed: Unknown error 10").

Depend on SCHED_HAVE_PARENT and SCHED_CHILD_STATUS (following the project's
depends-on-over-select convention) so the requirement is explicit; boards
enabling Dropbear must set these in their defconfig.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-20 10:04:50 +02:00
Felipe Moura
9b540556a1 netutils/dropbear: don't require a hardware TRNG
Dropbear gathers its entropy from /dev/urandom (libtomcrypt's
rng_get_bytes tries /dev/urandom before /dev/random), so requiring
ARCH_HAVE_RNG and DEV_RANDOM shuts the port out of targets without a
hardware TRNG -- including the simulator, where a dropbear
configuration silently loses NETUTILS_DROPBEAR at configure time.
Keep only the DEV_URANDOM requirement.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-12 15:56:25 -03:00
Old-Ding
fd525988f8 netutils: smtp: treat recv EOF as an error
recv() returns zero when the peer closes the TCP connection cleanly. The SMTP response path only treated negative returns as errors, so EOF could leave stale or empty response data to be checked as if a server reply had arrived.

Return ERROR on zero-length receives at each SMTP response point and keep the SPDX copyright header within the project line length limit.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:29:57 +08:00
hanzhijian
81accb0832 apps: fix distclean for partial builds and residual .kconfig files
The current distclean implementation has two issues:

1. Application.mk does not remove .kconfig on distclean, so stale
   config fragments from earlier builds can pollute subsequent ones.

2. Several external-library Makefiles (lame, libshvc, libulut) run
   "make -C <subdir> distclean" without checking whether the
   subdirectory exists.  When the library was never downloaded (common
   in CI partial-build environments), distclean fails with "No such
   file or directory".

Fix:

- Application.mk: add $(call DELFILE, .kconfig) to the distclean
  target so that .kconfig is cleaned along with .built, .depend, etc.

- audioutils/lame/Makefile: guard the distclean recipe with
  "if [ -d $(DST_PATH) ]; then ...; fi" and use $(MAKE) instead
  of bare make.

- netutils/libshvc/Makefile, netutils/libulut/Makefile: same
  directory-existence guard for their distclean recipes.

- crypto/wolfssl/Makefile: change "distclean:" to "distclean::"
  (double-colon) so it does not override the distclean:: rule
  inherited from Application.mk.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-07-09 09:25:33 +08:00
Felipe Moura
4d5f60005c netutils/dropbear: add scp support via SSH exec requests
Code Clean up - Remove unnecessary code.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-05 15:06:17 +08:00
Felipe Moura
ec134a99a8 netutils/dropbear: add scp support via SSH exec requests
Add SCP support do the dropbear server.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-05 15:06:17 +08:00
wangjianyu3
c503843e38 netutils/rexecd: add -t option to serve connections without a thread
By default rexecd spawns a detached worker thread per accepted connection
to allow concurrent sessions. Add a "-t" runtime option to instead handle
each connection inline in the main task, avoiding the per-connection
worker stack (CONFIG_NETUTILS_REXECD_STACKSIZE) allocation from the heap.
This matters on low-memory targets with limited free heap.

With "-t", connections are served strictly one at a time: a long-running
or interactive command blocks the accept loop until it finishes. Without
it, the existing thread-per-connection behaviour is unchanged.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-30 13:46:37 +08:00
wangjianyu3
253f1d40c3 netutils/rexecd: use dpopen() instead of popen() to get raw fd
popen() now returns a fopencookie-backed FILE* whose fileno() yields the
cookie pointer rather than a real descriptor, so poll() silently ignores
the negative fd and the relay loop blocks forever waiting for command
completion. See https://github.com/apache/nuttx-apps/pull/3511

Use dpopen()/dpclose() to obtain the raw bidirectional socket descriptor
directly, restoring the EOF/POLLHUP command-completion signal.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-27 08:47:46 -03:00
wangjianyu3
d29ae9bda6 netutils/rexec: initialize ret to avoid maybe-uninitialized
When the relay loop exits early without entering any branch, ret would be
returned uninitialized, tripping -Werror=maybe-uninitialized. Initialize
it to 0.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-27 08:47:46 -03:00
Felipe Moura
fee2ddbf54 netutils/dropbear: add Dropbear SSH server port for NuttX
Integrated SSH daemon authenticating against FSUTILS_PASSWD, with an
ECDSA P-256 host key and an NSH session over a PTY per connection. Built
from the upstream Dropbear tarball (pinned commit) and patched for
NuttX, using Dropbear's bundled libtomcrypt for all crypto. setsid()
(apache/nuttx#19184) and link() now come from NuttX, not local stubs.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-06-27 08:42:00 -03:00
Tiago Medicci
d6cf3015d8 netutils/libwebsockets: Fix error regarding building with CMake
Prior to this change, if an empty folder existed instead of the
actual libwebsockets source, the build would fail. This commit
checks for an actual file instead, avoid such kind of errors.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
4263e27d92 netutils/libwebsockets: Enable libwebsockets server
This commit enables building libwebsockets server based on a new
Kconfig entry.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
d106011a7f netutils/libwebsockets: Remove hard dependency on mbedTLS
libwebsockets can be built without TLS support. To allow this, it
was necessary to create a specific Kconfig option that enables TLS
support if OPENSSL_MBEDTLS_WRAPPER is enabled. Otherwise, TLS is
not supported (but libwebsockets can still be used with plain ws://
connections).

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Nightt
8568013436 netutils/thttpd: Apply the same check to related allocation sites
Extend the allocation-failure check to httpd_strdup(), the thttpd-local wrapper that has the same failure contract as strdup().

This is logically separable from the direct strdup()/asprintf() fixes: it prevents using hs->hostname before checking whether the wrapped string allocation succeeded, and releases the partially allocated server state on failure.

The scope intentionally does not extend to malloc(), calloc(), or other raw allocators because #1727 specifically calls out strdup()/asprintf(), and covering all allocation APIs would make this PR much broader.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-23 16:30:52 -04:00
Nightt
c44f9a0556 apps: Fix unchecked strdup()/asprintf() as requested in #1727
Add missing failure handling for direct strdup() and asprintf() calls where the allocated result is consumed locally before any NULL/error check.

This keeps the scope to the functions named in #1727 and avoids changing pass-through return sites where callers already receive NULL on allocation failure.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-23 16:30:52 -04:00
Xiang Xiao
f9f59bd0f8 !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats
Now that time_t is unconditionally 64-bit (signed int64_t) and the
struct timespec fields tv_sec / tv_nsec are wide enough on their own,
the explicit (uint64_t)/(int64_t)/(int) casts that used to guard the
multiplications and subtractions in *_us / *_ms / *_ns helpers are no
longer needed.  Drop them to keep the timekeeping math readable.

In the same spirit, this commit also normalises the printf-style format
specifiers and casts used to print tv_sec / tv_nsec / tv_usec values.
The prior code was a mix of "%d"/"%u"/"%ld"/"%lu"/"%lld" with matching
(int)/(unsigned long)/(long long) casts; some formats truncated time_t
on 32-bit hosts, others mismatched signedness or width.  Replace all
such cases with the portable POSIX-recommended forms:

  - tv_sec  (time_t,       signed, impl-defined width) -> %jd  + (intmax_t)
  - tv_nsec (long,         signed)                     -> %ld  (no cast)
  - tv_usec (suseconds_t / long)                       -> %ld  (no cast)

Also drop two stale `(FAR const time_t *)&ts.tv_sec` casts that are
unnecessary now that ts.tv_sec is plain time_t.

Arithmetic-cleanup files (existing scope):

  - benchmarks/cyclictest/cyclictest.c:        timediff_us()
  - benchmarks/sd_bench/sd_bench_main.c:       get_time_delta_us()
  - examples/oneshot/oneshot_main.c:           maxus computation
  - examples/watchdog/watchdog_main.c:         current_time_ms (x2)
  - industry/nxmodbus/nxmb_internal.h:         nxmb_util_clock_ms()
  - netutils/ntpclient/ntpclient.c:            timespec2ntp()
  - netutils/ptpd/ptpd.c:                      ptp_adjtime()
  - system/dd/dd_main.c:                       elapsed accounting
  - testing/drivers/drivertest/drivertest_posix_timer.c:
                                               get_timestamp()
  - testing/drivers/sd_stress/sd_stress_main.c:get_time_delta()
  - testing/sched/getprime/getprime_main.c:    elapsed accounting
  - testing/sched/pthread_mutex_perf/pthread_mutex_perf.c:
                                               timespec_avg()

Printf-format-fix files (new in this revision):

  - examples/adjtime/adjtime_main.c
  - examples/charger/charger_main.c
  - examples/netpkt/netpkt_ethercat.c
  - fsutils/mkfatfs/mkfatfs.c
  - graphics/tiff/tiff_initialize.c
  - netutils/ptpd/ptpd.c
  - nshlib/nsh_timcmds.c
  - system/coredump/coredump.c
  - system/ptpd/ptpd_main.c
  - testing/drivers/drivertest/drivertest_oneshot.c
  - testing/mm/kasantest/kasantest.c
  - testing/ostest/semtimed.c
  - testing/sched/pthread_mutex_perf/pthread_mutex_perf.c
  - testing/sched/timerjitter/timerjitter.c
  - testing/testsuites/kernel/time/cases/clock_test_clock01.c
  - testing/testsuites/kernel/time/cases/clock_test_smoke.c

No behavioural change.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-22 13:38:25 +08:00
raiden00pl
f0f7c5ada9 wakaama: add support for TLV
add support for LWM2M TLV

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-18 16:18:53 -04:00
zhanghongyu
5d15d97418 netlib: replace DNS ping with gateway ping for connectivity check
Refactor netlib_check_ipconnectivity() to use gateway/router ping instead
of DNS server ping for network connectivity checks. Add IPv6 support.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-05-14 11:58:15 +08:00
zhanghongyu
97485342aa netlib_ipv6route.c: fix the issue of parsing IPv6 routing entries
Update the column ruler and field labels in route_ipv6_entry comment
to match the actual output: lowercase to uppercase, remove colons.
Consistent with Nuttx definition

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-05-14 11:58:15 +08:00
Xiang Xiao
a6477ec8dc !apps: replace sclock_t with clock_t and drop redundant time_t/off_t casts
Align with the upstream nuttx change that drops the sclock_t alias now
that clock_t is itself a signed 64-bit type (int64_t).  Beyond the pure
sclock_t -> clock_t rename, this commit also removes the
now-unnecessary (time_t)-1 / (time_t)0 / (off_t)-1 casts that were
papering over the previously-unsigned time_t.

Files touched:

  - examples/alarm/alarm_main.c:        sclock_t -> clock_t
  - netutils/dhcpd/dhcpd.c:             sclock_t -> clock_t
  - netutils/ftpd/ftpd.c:               sclock_t -> clock_t
  - netutils/thttpd/libhttpd.c,
    netutils/thttpd/tdate_parse.c:      drop (time_t)-1 / (time_t)0 /
                                        (off_t)-1 sentinel casts
  - system/resmonitor/filldisk.c,
    system/zmodem/zm_receive.c:         sclock_t -> clock_t
  - testing/ostest/wdog.c:              sclock_t -> clock_t (the bulk
                                        of the rename, 30 sites)
  - testing/testsuites/kernel/syscall/cases/{clock_nanosleep_test,
    fsync_test,time_test}.c:            drop (time_t)-1 casts in the
                                        new signed-time_t world

No behavioural change.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
Xiang Xiao
72837c8d26 !apps: drop CONFIG_SYSTEM_TIME64 conditionals
NuttX always uses a 64-bit system clock now (time_t/clock_t are
always 64-bit). Remove the obsolete CONFIG_SYSTEM_TIME64 #ifdef
branches and Kconfig dependency.

  - examples/dronecan: drop SYSTEM_TIME64 dependency
  - examples/netlink_route: always use PRIx64
  - netutils/netinit: always use the 1-hour LONG_TIME_SEC
  - netutils/ptpd: always pack the 48-bit seconds field and apply
    the 64-bit overflow guard in timespec_delta_ns()
  - testing/ostest/semtimed: always validate tv_sec >= 0

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
Xiang Xiao
3adb14f12d !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support
The matching nuttx commit removes CONFIG_HAVE_LONG_LONG; clean up the
remaining users in nuttx-apps so that "long long" is always assumed:

  - examples/noteprintf, examples/nxscope:
        unconditionally exercise the %lld / long long branch.
  - fsutils/mkfatfs/configfat.c:
        drop the 32-bit fall-back paths in mkfatfs_nfatsect12/16/32;
        always use uint64_t for the FAT-size arithmetic.
  - logging/nxscope/nxscope_chan.c:
        drop the CONFIG_HAVE_LONG_LONG guard around the 64-bit
        sample helpers.
  - netutils/ftpd, netutils/ntpclient:
        always emit the 64-bit format strings.
  - testing/fs/fstest/fstest_main.c:
        drop the parallel 32-bit verification path; keep only the
        64-bit (long long) random pattern generator.
  - system/zmodem/host/nuttx/compiler.h:
        remove the host-side CONFIG_HAVE_LONG_LONG stub macro.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
shichunma
0105a9b238 netutils/ntpclient: guard DHCP-only helpers
fix a warning that static function defined by not used

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-04-30 13:29:42 +02:00
shichunma
c82957109f netutils: prefer DHCP-provided NTP servers for ntpc
Use the DHCP-learned NTP server list as the default ntpc server source when DHCP option 42 is available.

Fall back to CONFIG_NETUTILS_NTPCLIENT_SERVER only when DHCP does not provide any NTP servers, and restart ntpc when the DHCP-provided server list changes.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-04-24 10:44:08 -03:00
shichunma
4b705721ca netutils/dhcpc: parse DHCP NTP server option
Request DHCP option 42 and store the returned IPv4 NTP server
addresses in struct dhcpc_state for later consumers.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-04-24 10:44:08 -03:00
Piyush Patle
9d849adfab include/debug.h: Use <nuttx/debug.h> in apps
Replace app-side includes of <debug.h> with <nuttx/debug.h> to use the
header from the NuttX tree explicitly after the header move.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00
Filipe Cavalcanti
bfbeafabbf netutils/mqttc: fix patch and add mbedtls dependency
Add mbedtls dependecy and fix patch path.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-10 12:23:37 -03:00
Filipe Cavalcanti
f3a7282230 netutils/cjson: fix apps path in CMake
Fix mismatch on apps directory naming when it is cloned under 'nuttx-apps' instead of 'apps'.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-03-26 20:18:52 -04:00
Arjav Patel
76e02c0dd6 netutils/cjson: update cJSON download URL format
Modified CMakeLists.txt, Kconfig, and Makefile to change the cJSON download URL to include 'refs/tags/' for proper version fetching. This ensures compatibility with GitHub's archive download requirements.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-02-16 10:29:27 -03:00
Arjav Patel
1ab486d1d0 netutils/cjson: update download URL for cJSON tarball to include refs/tags
Modified the CMakeLists.txt and Makefile to ensure the correct format for downloading the cJSON tarball from GitHub by including 'refs/tags/' in the URL. This change addresses issues with fetching the correct version of the library.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-02-16 10:29:27 -03:00
zhanghongyu
d48b45000d netlib_xarp: remove redundant cast
removes redundant type casts in ARP-related network library functions.
The casts from req.arp_dev (already a char array) to (FAR char *)
are unnecessary and can be safely removed.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-02-04 01:52:49 +08:00
fangpeina
eb9b9a2d60 netutils/rexecd: fix rpname mismatch with rexec when using AF_RPMSG
When using AF_RPMSG (-r option), rexecd was setting the rp_name
to the raw port number, while rexec was using htons(port). This
caused a mismatch where rexec couldn't connect to rexecd.

This commit fixes the issue by applying htons() to REXECD_PORT
when setting rp_name in the AF_RPMSG case, making it consistent
with the rexec client implementation.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-02-03 10:18:57 +08:00
liqinhui
b80d67c628 netutils/netinit: Support the NETINIT_MACADDR
Support getting MAC address from boardctl(BOARDIOC_MACADDR) via NETINIT_MACADDR.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-29 12:08:20 +08:00
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