Clash.Meta/constant/ebpf.go

21 lines
337 B
Go
Raw Normal View History

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