ebpf.go 337 B

1234567891011121314151617181920
  1. package constant
  2. import (
  3. "net/netip"
  4. "github.com/metacubex/mihomo/transport/socks5"
  5. )
  6. const (
  7. BpfFSPath = "/sys/fs/bpf/mihomo"
  8. TcpAutoRedirPort = 't'<<8 | 'r'<<0
  9. MihomoTrafficMark = 'c'<<24 | 'l'<<16 | 't'<<8 | 'm'<<0
  10. )
  11. type EBpf interface {
  12. Start() error
  13. Close()
  14. Lookup(srcAddrPort netip.AddrPort) (socks5.Addr, error)
  15. }