Skip to content

Commit 661a63e

Browse files
authored
chore: deprecate NewTCPx methods (#640)
Deprecate TCP APIs in favor of `github.com/mdlayher/netlink`. Refer: #622 (review). Signed-off-by: Pranshu Srivastava <[email protected]>
1 parent ec61d8a commit 661a63e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net_tcp.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,28 @@ type (
2525

2626
// NetTCP returns the IPv4 kernel/networking statistics for TCP datagrams
2727
// read from /proc/net/tcp.
28+
// Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET) instead.
2829
func (fs FS) NetTCP() (NetTCP, error) {
2930
return newNetTCP(fs.proc.Path("net/tcp"))
3031
}
3132

3233
// NetTCP6 returns the IPv6 kernel/networking statistics for TCP datagrams
3334
// read from /proc/net/tcp6.
35+
// Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET6) instead.
3436
func (fs FS) NetTCP6() (NetTCP, error) {
3537
return newNetTCP(fs.proc.Path("net/tcp6"))
3638
}
3739

3840
// NetTCPSummary returns already computed statistics like the total queue lengths
3941
// for TCP datagrams read from /proc/net/tcp.
42+
// Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET) instead.
4043
func (fs FS) NetTCPSummary() (*NetTCPSummary, error) {
4144
return newNetTCPSummary(fs.proc.Path("net/tcp"))
4245
}
4346

4447
// NetTCP6Summary returns already computed statistics like the total queue lengths
4548
// for TCP datagrams read from /proc/net/tcp6.
49+
// Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET6) instead.
4650
func (fs FS) NetTCP6Summary() (*NetTCPSummary, error) {
4751
return newNetTCPSummary(fs.proc.Path("net/tcp6"))
4852
}

0 commit comments

Comments
 (0)