platform.go 506 B

12345678910111213141516
  1. package libbox
  2. type PlatformInterface interface {
  3. AutoDetectInterfaceControl(fd int32) error
  4. OpenTun(options TunOptions) (TunInterface, error)
  5. WriteLog(message string)
  6. UseProcFS() bool
  7. FindConnectionOwner(ipProtocol int32, sourceAddress string, sourcePort int32, destinationAddress string, destinationPort int32) (int32, error)
  8. PackageNameByUid(uid int32) (string, error)
  9. UIDByPackageName(packageName string) (int32, error)
  10. }
  11. type TunInterface interface {
  12. FileDescriptor() int32
  13. Close() error
  14. }