1102 Commits

Author SHA1 Message Date
Halysson
ddf1dcc3ff netutils/cmux: Add support for CMUX protocol
This commit adds CMUX (GSM 07.10) protocol support to netutils.
CMUX allows multiplexing multiple virtual serial connections
over a single physical serial link.

Changes include:
- CMUX protocol implementation
- CRC table for frame validation
- Basic frame handling

Signed-off-by: Halysson <halysson1007@gmail.com>
2025-10-06 15:04:22 -03:00
Stepan Pressl
cf41b01135 netutils/libshvc: add Silicon Heaven integration into NuttX and SHV examples
This commit marks the end of my GSoC 2025 project in the NuttX section.
All changes:

- Silicon Heaven protocol (SHV) implementation:
  The library is cloned from github.com/silicon-heaven/shv-libs4c
  and compiled here. The library has out-of-the-box support
  for NuttX and possibly all posix systems.
  The library is compiled with CONFIG_SHV_LIBS4C_PLATFORM define
  set to "nuttx". The library's dependancy is Pavel Pisa's ULUT
  and originates from Michal Lenc's GSoC.

- examples/shv-nxboot-updater:
  An example which constructs a SHV tree with which you can perform
  firmware updates using a SHV "file node". The file node wraps
  around NXBoot's update partition.
  The application also allows for NXBoot confirmation of the images.
  This application is to be meant used as a "background service",
  started before any apps, possibly using rcS. The tree is allocated
  as GAVL (see below).

- examples/shv-test:
  An example which constructs a SHV tree and gives the user
  the ability to choose which type of construction should be used,
  either:
    - GAVL:       dynamic SHV tree allocation encapsulated within
                  an AVL tree.
    - GSA:        dynamic SHV tree allocation encapsulated within
                  a continuous array with binary search
    - GSA_STATIC: SHV tree is defined as static const, this means
                  all the data structures are placed in .rodata.
		  Extremely beneficial for embedded systems,
		  as .rodata is located in flash and embedded
		  systems usually have more flash than sram,
		  thus reducing sram usage. The downside is that
		  the definitions are rather tedious, but can
		  be automated in case of some code generation
		  (like in pysimCoder).
		  All of it is places in a continuous array with
		  binary search.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-09-24 21:43:07 +08:00
michal matias
a85121b168 netutils: Add plcatool
Add plcatool - simple tool for managing PLCA configuration in 10BASE-T1S PHYs.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-09-17 19:29:10 +08:00
nuttxs
9cb9cea4b2 ntpclient/ntpclient.c: fix the NTP client’s timeval conversion
bug from milliseconds to microseconds

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-11 21:49:28 +08:00
nuttxs
8f3c3c57f9 netutils/dhcpc/dhcpc: add implementation to get renewal (T1) time and
rebinding (T2) time from DHCP packet.
According to RFC 2131, T1 and T2 times play a critical role in lease
management in DHCP clients.

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-06 10:54:18 +08:00
Jorge Guzman
c19c2a71f3 netutils/xedge: refactor Makefile to use git clone instead of zip downloads
Previous zip-based approach was failing in CI environment. Changed to use
git clone with specific commit hashes to resolve CI build issues.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2025-08-02 10:00:20 -03:00
RTL
2de49b8b22 examples/xedge_demo: Add Xedge IoT Toolkit with BAS integration
Add support for Xedge, an embedded software toolkit for IoT applications
 using Lua scripting with HTTP(S), WebSockets, MQTT, and device I/O.

* netutils/xedge: Dependency manager that downloads BAS library
  and BAS-Resources, generates XedgeZip.c during build

* examples/xedge_demo: Complete example showing Xedge integration
  with HTTP server, Lua runtime, and SNTP time synchronization

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2025-07-25 09:19:10 -03:00
SPRESENSE
5e704891d9 netutils/esp8266: Add a function for finalization.
Add a function for finalization so that it can be used repeatedly.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
549836600c netutils/esp8266: Add to get channel from access points
Fix bug that channel retrieved by lesp_list_access_points is undefined.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
e61ee7981d netutils/esp8266: Fix bug to get gateway address
Fix bug to get gateway address.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
5429191ab0 netutils/esp8266: Fix nxstyle
Fix nxstyle.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
8b4a015f07 netutils/esp8266: Fix compile error
Fix compile error.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
nuttxs
dfeeef41ed netutils/dhcpc/dhcpc.c:Implement a dedicated interface to send
DHCPRELEASE, According to RFC 2131 section 3.1, DHCPRELEASE is
used by a client to relinquish a network address and cancel any
remaining lease time

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-07-14 15:49:29 -03:00
Petro Karashchenko
227d3ec35b netutils/nanopb: fix unpack step for MACOS
Currently NANOPB_UNPACK step in Makefile uses nanopb binary name with
hardcoded suffix '-linux-x86' that is not suitable for MACOS x86.
This commit replaces the hardcoded nanopb binary name with name that
is derived from NANOPB_NAME variable that reflects the nanopb binary
that is selected based on host OS selected in the build system

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-07-14 15:48:08 -03:00
Tim Hardisty
e6a335ded0 Fix Compiler warnings 2025-07-03 10:42:11 +08:00
Tim Hardisty
8c9e126f91 netutils/thttpd-fix-broken-CGI-and-fixup-Kconfig 2025-07-03 10:42:11 +08:00
Tim Hardisty
30b1c024a1 apps/netutils: add mdns library support
This commit allows an external mDNS library to be included in NuttX.

It originates from here: <https://github.com/mjansson/mdns>

It is declared as being in the Public Domain as per <http://unlicense.org>

Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-06-02 23:18:24 +08:00
raiden00pl
3764ab041a cmake: remove empty strings from FetchContent
remove empty strings from FetchContent to eliminate cmake build warnings like this:

CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1564 (cmake_parse_arguments):
  The BUILD_COMMAND keyword was followed by an empty string or no value at
  all.  Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
  ARG_BUILD_COMMAND variable rather than setting it to an empty string.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 14:20:21 +08:00
Felipe Moura
2eb18712d3 netutils/pppd/ppp.h: Fix build issue when network debug is enabled
This commit add include necessary when we enable network debug feature using ppp feature.

Signed-off-by: Felipe Moura de Oliveira <moura.fmo@gmail.com>
2025-02-24 10:19:31 +01:00
chao an
66231194be apps/system: replace CONFIG_NSH_LINELEN to LINE_MAX
Applications should not depend on any properties of nshlib

Signed-off-by: chao an <anchao@lixiang.com>
2025-01-14 19:31:54 +08:00
Huang Qi
ffd256d32b Remove unused header files across multiple source files
Clean up code by removing redundant and unused header file includes that were identified through static analysis.
This improves code readability and reduces unnecessary dependencies.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 21:42:00 +08:00
Alin Jerpelea
83ea91531f netutils: migrate the license to ASF
Xiaomi has submitted the SGA and we can migate the license to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
ac8002d7d3 Cmake: migrate the license to ASF
Xiaomi has submitted the SGA and we can migate the license to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
hujun5
32ee7611bb fix a typo
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 12:06:32 +08:00
xuxin19
1b91e3c4a6 cmake:add missing rtptools CMake scripts
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-19 17:17:30 +08:00
zhushiqshi
1f5ec0bfe7 apps/rexecd: add more trace info when failed
Signed-off-by: zhushiqi <zhushiqshi@xiaomi.com>
2024-11-11 17:17:52 +08:00
zhushiqshi
de8080dbff apps/rexecd: fix bind failed return 13
Signed-off-by: zhushiqi <zhushiqshi@xiaomi.com>
2024-11-11 17:17:52 +08:00
zhanghongyu
b42bbcb5d3 netlib_getarptab.c: improved the display without any arp entry
before:
server> arp
ERROR: send() failed: 2
nsh: arp: S��x�����Ì
 failed: 2
server>

after:
server> arp
IP Address   Ethernet Address  Interface
server>

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 12:27:16 +08:00
haopengxiang
df559f1712 fix: git status/git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-27 22:30:39 +08:00
ligd
da83750cd3 netutils: fix compile error when not defined CONFIG_NET_ETHERNET
/home/ligd/platform/dev/apps/netutils/netlib/netlib_obtainipv4addr.c:117: undefined reference to `netlib_getmacaddr'

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-27 20:03:43 +08:00
Xiang Xiao
f8341ab94d Replace getrandom with arc4random_buf to simplify the usage
and follow the kernel side change:
https://github.com/apache/nuttx/pull/14509

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-27 20:03:14 +08:00
zhanghongyu
8b15b267a3 matter: add Kconfig option to control logging
Logs have a great impact on image size, so whether to print logs is
modified as a compilation option and controlled by Kconfig

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-27 19:45:17 +08:00
Petro Karashchenko
7f7bbe236d examples/mqttc: add option to use MBED TLS for connections
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-26 19:11:55 -03:00
zhanghongyu
2ff75e32e9 netutils/connectedhomeip: use CONFIG_CXX_STANDARD instead of hard code
as c++ versions are upgraded, hard code compilation options can
cause build error

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-24 19:57:59 +08:00
wangyingdong
47c8d3734a Fix to compile failure after mqttc is enabled
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2024-10-16 17:25:46 +08:00
wangyingdong
8eb791763c netutils: introduce libwebsockets support
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-16 17:25:46 +08:00
wanggang26
2de1fdcebd thttpd:fix Coding Style Check Failed issue
error: Mixed case identifier found

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-16 07:13:50 +08:00
chenrun1
bb957498cc cjson_test:add define CONFIG_CJSON_NESTING_LIMIT
Summary:
 Added a limit to CJSON_NESTING_LIMIT. The default value is 1000, which can cause stack overflow in some test cases.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-10-15 00:57:11 +08:00
Xiang Xiao
9b8a02749f net: Remove IFF_DOWN flag to compatible with Linux/*BSD
turn off interface by checking IFF_UP flag isn't set:
https://github.com/apache/nuttx/issues/1838

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-07 20:19:47 +08:00
Petro Karashchenko
86f367132a netutils/ptpd: add missing FAR
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-04 08:17:51 +08:00
yangguangcai
df4cdbaae9 ntp:fix parameter is negative numbers.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-09-28 13:45:43 +08:00
wanggang26
eab2cba4a1 enable SOCK_CLOEXEC explicit
leaking here means fork/vfork will duplicate fd without O_CLOEXEC flag
to the child process.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-26 16:13:29 +08:00
Leandro Zungri
0c734ca62b ppp: Reformat to match nuttx coding style 2024-09-14 13:49:08 +08:00
Leandro Zungri
800b93de9f ppp: Fix wrong lcp_state handling on peer reconnection
If a PPP peer disconnects and then tries to reconnect it will send an 'LCP configure request' packet. The code that handles that scenario seems to be clearing the wrong lcp_state flag (LCP_RX_UP instead of LCP_TX_UP) and thus the nuttx ppp client will keep sending IPCP packets which are rightfully dropped by the new peer since it is still in the LCP negotiation phase.
2024-09-14 13:49:08 +08:00
meijian
e25f89d2d6 app/netstatistics: Add net statistics api for user
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 13:38:38 +08:00
Alexey Matveev
0fc0cb2888 Thttpd Fix: wrong calc offset 2024-09-09 19:45:03 +08:00
meijian
c91a1817aa netlib/setroute: fix dhcpd stack-overflow when calls netlib_set_dripv4addr with debug info-level
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-26 01:54:46 +08:00
zhangshuai39
6d52a0fbc1 netutils/netlib: Encapsulate the dhcp configuration network code and modify at all calling locations
The DHCP configuration network code is called multiple times, so it is encapsulated

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2024-08-23 22:10:04 +08:00
liqinhui
c326677f7a netlib: Delete the redundancy code.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 01:24:29 +08:00
liqinhui
f4141998dd netlib: Use the netlib_add_ipv6addr to set the IPv6 address after obtaining the address.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 01:24:29 +08:00