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>
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>
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>
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
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>
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>
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>
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.
If multicast PTP packets are not being received, rejoin the multicast group.
This automatically recovers from situations such as rebooting a network switch.
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>
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>
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>
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.
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>
Support Stateless and Stateful. The renew6 is used as follows:
- Stateless: renew6 eth0
- Stateful: renew6 eth0 1
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
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
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>