clash/constant/ebpf.go

21 lines
337 B
Go
Raw Normal View History

2022-07-29 01:08:35 +00:00
package constant
import (
"net/netip"
2023-11-03 13:01:45 +00:00
"github.com/metacubex/mihomo/transport/socks5"
2022-07-29 01:08:35 +00:00
)
const (
2023-11-03 13:01:45 +00:00
BpfFSPath = "/sys/fs/bpf/mihomo"
2022-07-29 01:08:35 +00:00
2023-11-03 13:01:45 +00:00
TcpAutoRedirPort = 't'<<8 | 'r'<<0
MihomoTrafficMark = 'c'<<24 | 'l'<<16 | 't'<<8 | 'm'<<0
2022-07-29 01:08:35 +00:00
)
type EBpf interface {
Start() error
Close()
Lookup(srcAddrPort netip.AddrPort) (socks5.Addr, error)
}