github.com/metacubex/mihomo@v1.18.5/component/process/process.go (about)

     1  package process
     2  
     3  import (
     4  	"errors"
     5  	"net/netip"
     6  )
     7  
     8  var (
     9  	ErrInvalidNetwork     = errors.New("invalid network")
    10  	ErrPlatformNotSupport = errors.New("not support on this platform")
    11  	ErrNotFound           = errors.New("process not found")
    12  )
    13  
    14  const (
    15  	TCP = "tcp"
    16  	UDP = "udp"
    17  )
    18  
    19  func FindProcessName(network string, srcIP netip.Addr, srcPort int) (uint32, string, error) {
    20  	return findProcessName(network, srcIP, srcPort)
    21  }