mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-16 06:52:21 +08:00
29 lines
538 B
Go
29 lines
538 B
Go
package process
|
|
|
|
import (
|
|
"context"
|
|
"net/netip"
|
|
|
|
"github.com/sagernet/sing-box/log"
|
|
"github.com/sagernet/sing-tun"
|
|
E "github.com/sagernet/sing/common/exceptions"
|
|
)
|
|
|
|
type Searcher interface {
|
|
FindProcessInfo(ctx context.Context, network string, srcIP netip.Addr, srcPort int) (*Info, error)
|
|
}
|
|
|
|
var ErrNotFound = E.New("process not found")
|
|
|
|
type Config struct {
|
|
Logger log.ContextLogger
|
|
PackageManager tun.PackageManager
|
|
}
|
|
|
|
type Info struct {
|
|
ProcessPath string
|
|
PackageName string
|
|
User string
|
|
UserId int32
|
|
}
|