mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-08-23 10:42:33 +00:00
21 lines
423 B
Go
21 lines
423 B
Go
package process
|
|
|
|
import (
|
|
"errors"
|
|
"net/netip"
|
|
)
|
|
|
|
var (
|
|
ErrInvalidNetwork = errors.New("invalid network")
|
|
ErrPlatformNotSupport = errors.New("not support on this platform")
|
|
ErrNotFound = errors.New("process not found")
|
|
)
|
|
|
|
const (
|
|
TCP = "tcp"
|
|
UDP = "udp"
|
|
)
|
|
|
|
func FindProcessName(network string, srcIP netip.Addr, srcPort int) (uint32, string, error) {
|
|
return findProcessName(network, srcIP, srcPort)
|
|
}
|