Commit Graph

1043 Commits

Author SHA1 Message Date
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
Sebastien Lorquet
8cb0bf3eab dhcpc: reset the state of the "cancel" variable when restarting the async dhcpc thread. 2024-03-20 02:25:33 +08:00
xuxin19
38d30f9984 matter cmake:fix matter_generate_args_tmp_file call error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-03-15 01:26:22 +08:00
Peter van der Perk
2d6f5f230e netinit: Add check mount path retry option for delayed mounts 2024-02-28 10:21:40 +08:00
zhanghongyu
9c48a8d4fc iperf: add parameters to support dynamic device bind
In addition to the CONFIG_NETUTILS_IPERFTEST_DEVNAME configuration, you can specify network cards by parameter to support devices with multiple network interface

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-17 00:54:31 -08:00
zhanghongyu
d9f467dd8e libcoap: add cmake script
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-06 04:32:41 -08:00
zhanghongyu
ce735f4136 libcoap: add makefile and Kconfig
server:
when ipv6 is enable:
ap> coap_server
only ipv4 is enable, we need to specify the ip address of the network card:
ap> coap_server -A [ipv4 address]

client:
ap> coap_client -m get coap://[ipv4/6 address]/time
Dec 26 06:41:12

Other Examples:
	coap_client -m get coap://[::1]/
	coap_client -m get coap://[::1]/.well-known/core
	coap_client -m get coap+tcp://[::1]/.well-known/core
	coap_client -m get coap://%2Funix%2Fdomain%2Fpath%2Fdgram/.well-known/core
	coap_client -m get coap+tcp://%2Funix%2Fdomain%2Fpath%2Fstream/.well-known/core
	coap_client -m get coaps://[::1]/.well-known/core
	coap_client -m get coaps+tcp://[::1]/.well-known/core
	coap_client -m get coaps://%2Funix%2Fdomain%2Fpath%2Fdtls/.well-known/core
	coap_client -m get coaps+tcp://%2Funix%2Fdomain%2Fpath%2Ftls/.well-known/core
	coap_client -m get -T cafe coap://[::1]/time
	echo -n 1000 | coap-client -m put -T cafe coap://[::1]/time -f -

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-06 04:32:41 -08:00
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