Commit Graph

6 Commits

Author SHA1 Message Date
Alin Jerpelea 67d02a45eb net: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-09-12 01:08:11 +08:00
Zhe Weng 194d0cdec9 net/procfs: Simplify logic for tcp/udp stats
By:
1. Take out net_ip_binding_laddr/raddr macro
2. INET6_ADDRSTRLEN is long enough for all address buffer and no need to
   add 0 to the end of buffer since inet_ntop will do so

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-07 08:08:37 -07:00
Xiang Xiao 74e2b75857 net: Simplify the tcp/udp existence check
Replace defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_TCP_NO_STACK) with NET_TCP_HAVE_STACK
Replace defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK) with NET_UDP_HAVE_STACK

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:00 +03:00
chao an 4a8cd8ca0c net/procfs: fix visual studio Compiler Error C2057
D:\archer\code\nuttx\net\procfs\net_tcp.c(63,15): error C2057: expected constant expression

Compiler error C2057:
The context requires a constant expression, an expression whose value is known at compile time.

Reference:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2057?view=msvc-170

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:11:55 +08:00
chao an f286012c0d net/procfs: disable tcp/udp proc node if no stack available
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-19 15:45:19 +08:00
chao an 7190e56a14 net/procfs: add tcp profs support
add proc node /proc/net/tcp to show the active tcp connections from procfs

nuttx style:

server> cat /proc/net/tcp
TCP sl  st flg ref tmr uack nrt   rxsz local_address           remote_address
     1: 04  61   1  12    0   0   1024          0.0.0.0:4855      192.168.31.22:5001
     2: 04  61   1  12    0   0   1024          0.0.0.0:4856      192.168.31.22:5001
     3: 04  61   1   9    0   0      0                      :::4853   fe80::b27b:25ff:fe28:4011:8789
     4: 04  61   1   3    3   0      0                      :::4854   fe80::b27b:25ff:fe28:4011:8789

linux kernel:
https://www.kernel.org/doc/Documentation/networking/proc_net_tcp.txt

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-09 19:33:46 +08:00