sysproc

package
v1.4.4-alpha1202-loadi... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License: AGPL-3.0, GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCP = "tcp"
	UDP = "udp"
)
View Source
const (
	SOCK_DIAG_BY_FAMILY = 20
)

Variables

View Source
var (
	ErrInvalidNetwork     = errors.New("invalid network")
	ErrPlatformNotSupport = errors.New("not support on this platform")
	ErrNotFound           = errors.New("process not found")
)

Functions

func FindProcessName

func FindProcessName(network string, srcIP netip.Addr, srcPort int) (uint32, string, error)

func FindProcessNameByConn

func FindProcessNameByConn(conn net.Conn) (uint32, string, error)

func IpToAddr

func IpToAddr(slice net.IP) netip.Addr

IpToAddr converts the net.IP to netip.Addr. If slice's length is not 4 or 16, IpToAddr returns netip.Addr{}

Types

type ProcessInfo

type ProcessInfo struct {
	*process.Process
}

func List

func List() ([]*ProcessInfo, error)

func (*ProcessInfo) GetRemoteNonLocalIPAddresses

func (p *ProcessInfo) GetRemoteNonLocalIPAddresses() ([]string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL