tailscale.comtailscale.com/net/netstat Index | Files

package netstat

import "tailscale.com/net/netstat"

Package netstat returns the local machine's network connection table.

Index

Variables

var ErrNotImplemented = errors.New("not implemented for GOOS=" + runtime.GOOS)

Types

type Entry

type Entry struct {
	Local, Remote netip.AddrPort
	Pid           int
	State         string // TODO: type?
	OSMetadata    OSMetadata
}

type OSMetadata

type OSMetadata struct{}

OSMetadata includes any additional OS-specific information that may be obtained during the retrieval of a given Entry.

type Table

type Table struct {
	Entries []Entry
}

Table contains local machine's TCP connection entries.

Currently only TCP (IPv4 and IPv6) are included.

func Get

func Get() (*Table, error)

Get returns the connection table.

It returns ErrNotImplemented if the table is not available for the current operating system.

Source Files

netstat.go netstat_noimpl.go

Version
v1.84.0 (latest)
Published
May 21, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
1 day ago

Tools for package owners.