1075 Commits

Author SHA1 Message Date
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
SPRESENSE
fb17471673 netutils/webclient: Fix the coding style 2024-08-20 15:23:59 +08:00
SPRESENSE
66f6e5f048 netutils/webclient: Fix bug that the socket is not close
Fix to close socket when it fails to resolve hostname.
2024-08-20 15:23:59 +08:00
meijian
a9ff36b2a4 nng/clock: fix the timer clock is affected by UTC update bug
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 16:49:57 -03:00
meijian
68577f76f0 netutils/nng: add cmake for nng
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 16:49:57 -03:00
meijian
35a26eafea netutils/nng: fix nng compile warnings on some platforms
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 16:49:57 -03:00
meijian
8fa5fd8adc netutils: porting NNG-v1.5.2 for nuttx
1.fix build warings
2.add thread name for nuttx
3.add config to set thread stack-size
4.fix urandom memleak

Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 16:49:57 -03:00
zhanghongyu
acf9e3679e netutils/iptables: add cmake support.
add cmake support for xtables.c, solves the problem of missing symbols
when compiling with cmake

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-20 02:48:49 +08:00
meijian
2e929bdf15 netutils/mqttc: add cmake support
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-20 02:48:22 +08:00
zhanghongyu
972594604c libcoap: fix makefile compile error after menuconfig
correct the LIBCOAP_VERSION format

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-20 02:46:43 +08:00
Alan Carvalho de Assis
6b9d51793f Fix error caused by netinit code assuming CONFIG_NETINIT_DNS was enabled
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-07-07 10:35:49 +08:00
Zhe Weng
3022f836dc netlib/ip6tables: Add functions for ip6tables & filter table
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-21 10:16:01 +08:00
Zhe Weng
4283e57013 netlib/iptables: Add functions for filter table
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-21 10:16:01 +08:00
Zhe Weng
9fcde632a7 netlib/iptables: Change matching to memcmp all related structs
Compare both the struct ipt_ip, the match and the target, to support
more entry types other than NAT entry.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-21 10:16:01 +08:00
raiden00pl
b32cf5f0b7 libcurl4nx: fix compilation 2024-06-06 03:21:19 +08:00
raiden00pl
c644ef477b cmake: add missing netlib_set_ipv4dnsaddr.c file 2024-06-06 03:21:19 +08:00
meijian
8d1bb4cfe8 [app][netlink_route] fix get route netlink bugs
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 22:06:47 +08:00
zhanghongyu
c6051e4c41 connectedhomeip: supports specifying CHIP_ROOT from the cmake parameter.
support CI compilation for the matter community
https://github.com/project-chip/connectedhomeip/pull/31236

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-05-07 14:53:26 +08:00
simbit18
dadbea7e3b fix nxstyle
fix Relative file path does not match actual file.
Add missing Apache Foundation copyright header
2024-04-30 00:02:31 +08:00
meijian
255df7c01f [ping] fix ping error busyloop add goto wait
Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
meijian
a7cffe03b5 [ping] fix ping early return when ping is interrupted by ifdown
During a long ping, the tester will repeatedly switch the dev interface on and off.
When the interface is down and ping is in sendto sem_wait state,ifdown will trigger event of sendto and post sem.
in func of sendto_eventhandler:
if ((flags & NETDEV_DOWN) != 0)
{
  nerr("ERROR: Interface is down\n");
  pstate->snd_result = -ENETUNREACH;
  goto end_wait;
}

Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
meijian
c0c9a6007c [ping] fix ping early return when ping is interrupted by ifdown and poll return
During a long ping, the tester will repeatedly switch the dev interface on and off.
When the interface is down and ping is in poll sem_wait state,ifdown will trigger event of poll and post sem.
The poll will return and revent is 0x18 POLLHUP | POLLERR.Then recvfrom will process and return error to stop ping.
if ((flags & NETDEV_DOWN) != 0)
{
  eventset |= (POLLHUP | POLLERR);
}

Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
Filipe Cavalcanti
ad7f69d25e Add support for protocol buffers (nanopb)
Adding nanopb download and compilation

Improvements and example running

Working distclean

Check for win/linux/mac
2024-04-22 10:46:39 -03:00
Michael Jung
3dc64d9a26 netutils/dhcp6c: Fix printf-style format strings
Signed-off-by: Michael Jung <michael.jung@secore.ly>
2024-04-20 12:01:19 -03:00
Zhe Weng
7e7b108ef9 netutils/netlib: Add netfilter conntrack functions
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-18 09:57:01 +08:00
simbit18
000a8bcdf1 Fix nuttx coding style
fix
error: Relative file path does not match actual file
error: Long line found
error: Operator/assignment must be preceded with whitespace
error: Missing blank line after comment
2024-04-18 09:56:48 +08:00
zhanghongyu
e2805fc9c4 matter: use a fixed version of pigweed
Otherwise, the compilation may fail due to changes in the pigweed code

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-03-26 01:19:37 +08:00
Adam Comley
c15a6970c9 Derive MAC Address from board unique_id 2024-03-21 22:46:28 +08:00