process

package
v0.0.0-...-9a26220 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: AGPL-3.0, GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Reference: https://github.com/MetaCubeX/mihomo

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

This section is empty.

Jump to

Keyboard shortcuts

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