mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
net/procfs: add udp profs support
add proc node /proc/net/udp to show the active udp connections from procfs nuttx style: server> cat /proc/net/udp UDP sl local_address remote_address flg txsz rxsz (IPv4) 1: 0.0.0.0: 5285 192.168.31.22: 7779 9 0 1041 2: 0.0.0.0: 5286 192.168.31.22: 7779 9 0 1041 3: 0.0.0.0: 5287 192.168.31.22: 7779 9 0 1041 linux kernel: https://www.kernel.org/doc/Documentation/networking/proc_net_tcp.txt Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -187,6 +187,29 @@ ssize_t netprocfs_read_tcpstats(FAR struct netprocfs_file_s *priv,
|
||||
FAR char *buffer, size_t buflen);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: netprocfs_read_udpstats
|
||||
*
|
||||
* Description:
|
||||
* Read and format UDP statistics.
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - A reference to the network procfs file structure
|
||||
* buffer - The user-provided buffer into which network status will be
|
||||
* returned.
|
||||
* bulen - The size in bytes of the user provided buffer.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; a negated errno value is returned
|
||||
* on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_UDP
|
||||
ssize_t netprocfs_read_udpstats(FAR struct netprocfs_file_s *priv,
|
||||
FAR char *buffer, size_t buflen);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: netprocfs_read_routes
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user