Xiang Xiao
f86baa76fc
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-09 18:19:23 +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
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
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
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
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
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
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
chao an
4d79a5cbaf
add initial cmake build system
...
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
Zhe Weng
f671c004df
netlib: set addr.sin_zero to 0 in netlib_set_ipv4dnsaddr
...
In dns_add_nameserver, the dns_check_nameserver is comparing addresses
with addrlen = sizeof(struct sockaddr_in) for IPv4 addresses, so the
trailing sin_zero field should be 0, otherwise it may fail to figure out
same nameserver address.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-05-22 17:09:33 +03:00
wangchen
c2f75330f7
nshlib/netcmds:support to set MTU
...
Usage:ifconfig interfacename mtu ***
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-04-27 18:02:23 +08:00
Petro Karashchenko
700b0ed235
netutils/netlib: fix typos in comments
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-19 03:11:19 +08:00
simbit18
804762c72d
apps/netutils/netlib/Make.defs: fix nxstyle
...
Add missing first line header
2023-03-20 14:17:07 +01:00
lilei19
41f60bd669
change strcpy to strlcpy
...
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-22 23:09:55 +08:00
chao an
8ad4ae5508
net: fix compiler warning
...
sixlowpan_assocresp.c: In function ‘sixlowpan_assoc_resp’:
sixlowpan_assocresp.c:48:3: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
48 | strncpy(arg.ifr_name, ifname, IFNAMSIZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-08 00:35:39 +08:00
Xiang Xiao
a29d9ea9da
fsutils/examples: Include unistd.h explicitly
...
to get the prototypes or macros are defined in it
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 08:46:59 +02:00
Zhe Weng
2ad05e3062
ifconfig: Support prefixlen/CIDR for IPv6
...
Linux:
ifconfig eth0 [inet6] add 2022::2/96
FreeBSD:
ifconfig eth0 inet6 2022::2/96
ifconfig eth0 inet6 2022::2 prefixlen 96
NuttX newly supported:
ifconfig eth0 inet6 [add] 2022::2/96
ifconfig eth0 inet6 [add] 2022::2 prefixlen 96
Ref:
https://man7.org/linux/man-pages/man8/ifconfig.8.html
https://www.freebsd.org/cgi/man.cgi?ifconfig
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 17:33:59 +08:00
Zhe Weng
64f9dc100c
netutils: Add iptables in netlib.
...
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 14:26:41 +08:00
Xiang Xiao
cfc005a460
arp: Remove the unnecessary inclusion of nuttx/net/arp
...
and change the remain inclusion to netinet/arp.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 22:11:10 +02:00
zhanghongyu
c7e8ade590
arp: change arptable get struct from arp_entry_s to arpreq
...
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-14 21:19:37 +08:00
zhanghongyu
df3121213e
cmd_arp: add device input for arp interface
...
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-14 21:19:37 +08:00
mlondono74
fd22b63722
fix issue with reading ipv6 routes. Handle space ahead of first line of route.
2022-11-22 13:20:17 +08:00
qinwei1
c86509be4c
apps: getpid should return process id not thread id
...
Summary:
following the change in the nuttx kernel, implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id
Refer:
https://github.com/apache/incubator-nuttx/issues/2499
https://github.com/apache/incubator-nuttx/pull/2518
Nuttx Kernel PR:
https://github.com/apache/incubator-nuttx/pull/7597
update apps code
Testing PASSED with qemu( 32/64 )
Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-11-17 17:58:45 +08:00
Fotis Panagiotopoulos
d251d12f6f
Fixed compiler warnings.
2022-10-24 12:03:44 +08:00
zhanghongyu
cfb64cffb1
netlib_getarptab: fix codechecker high level issue
...
197: paysize = RTA_PAYLOAD(&resp->attr);
198: if (paysize > maxsize)
199: {
200: paysize = maxsize;
201: }
202:
203: memcpy(arptab, resp->data, paysize);
Memory copy function accesses out-of-bound array element
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-21 16:31:13 +08:00
Xiang Xiao
4941182cc6
Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),)
...
to support the tristate option correctly and unify the usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 14:59:08 +02:00
Xiang Xiao
9291d07a87
Fix the coding style issue
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-06 12:20:32 +02:00
liyi
7035546422
fix use of addroute/delroute
...
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-08-27 23:50:46 +08:00
Fotis Panagiotopoulos
0cdb2cfa48
Fixed compiler warnings.
2022-08-23 01:39:59 +08:00
liyi
c5102fe504
ifconfig support set IPv6 DNS server
...
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-08-04 19:47:15 +08:00
YAMAMOTO Takashi
f7b3eb5b44
netlib_parseurl: Make the buffer size assumption explicit
2022-06-07 15:09:11 +03:00
YAMAMOTO Takashi
a7de8dffe7
netlib_parseurl.c: Add a comment
2022-06-07 15:09:11 +03:00
Xiang Xiao
3afd1234e0
netutils/netlib: Fix error: 'strncpy' specified bound 16 equals destination size
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-04 22:05:14 +02:00
Xiang Xiao
0426c8c09f
Fix error: 'strncpy' specified bound 16 equals destination size
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-15 12:38:03 +01:00
Fotis Panagiotopoulos
bc5d8034f1
Typo fixes.
2022-01-06 10:30:41 +08:00
Xiang Xiao
66dbaa4539
Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
...
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-20 16:04:29 -03:00
Juha Niskanen
b283289986
apps: fix miscellaneous typos
...
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-08-26 11:39:28 -07:00
Alin Jerpelea
e78ef68927
netutils: fix relative path CI error
...
error: Path relative to repository other than nuttx must begin with the root directory
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-16 09:03:06 -05:00
Alin Jerpelea
6bc7a448de
examples: author: Gregory Nutt: update licenses to Apache
...
Gregory Nutt is has submitted the SGA
as a result we can migrate the licenses to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-15 05:16:58 -05:00
Alin Jerpelea
5572819bb1
netutils: nxstyle fixes
...
fixes for errors reported by nxstyle tool
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-11 08:53:57 -05:00
Alin Jerpelea
0a6b1f55ab
netutils: update licenses to Apache
...
Gregory Nutt is has submitted the SGA
Sebastien Lorquet has submitted the ICLA
as a result we can migrate the licenses to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-11 05:05:27 -05:00
Xiang Xiao
d9c1c5bbc8
Include assert.h in necessary place
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-08 13:04:34 -07:00
Alin Jerpelea
ec339bc49a
Makefiles: Gregory Nutt: update licenses to Apache
...
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-07 21:35:33 -05:00
Xiang Xiao
1ee948e0c8
Include assert.h for DEBUGASSERT caller
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:34:37 +09:00