From e3757ce7e8a0e933f271a8f2a5e74af1d4a5ab81 Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Tue, 14 May 2024 16:17:40 +0530 Subject: [PATCH] chore: deprecate `NewTCPx` methods Deprecate TCP APIs in favor of `github.com/mdlayher/netlink`. Refer: https://github.com/prometheus/procfs/pull/622#pullrequestreview-2054345257. Signed-off-by: Pranshu Srivastava --- net_tcp.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net_tcp.go b/net_tcp.go index 527762955..0396d7201 100644 --- a/net_tcp.go +++ b/net_tcp.go @@ -25,24 +25,28 @@ type ( // NetTCP returns the IPv4 kernel/networking statistics for TCP datagrams // read from /proc/net/tcp. +// Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET) instead. func (fs FS) NetTCP() (NetTCP, error) { return newNetTCP(fs.proc.Path("net/tcp")) } // NetTCP6 returns the IPv6 kernel/networking statistics for TCP datagrams // read from /proc/net/tcp6. +// Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET6) instead. func (fs FS) NetTCP6() (NetTCP, error) { return newNetTCP(fs.proc.Path("net/tcp6")) } // NetTCPSummary returns already computed statistics like the total queue lengths // for TCP datagrams read from /proc/net/tcp. +// Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET) instead. func (fs FS) NetTCPSummary() (*NetTCPSummary, error) { return newNetTCPSummary(fs.proc.Path("net/tcp")) } // NetTCP6Summary returns already computed statistics like the total queue lengths // for TCP datagrams read from /proc/net/tcp6. +// Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET6) instead. func (fs FS) NetTCP6Summary() (*NetTCPSummary, error) { return newNetTCPSummary(fs.proc.Path("net/tcp6")) }