device.go 352 B

12345678910111213141516171819202122
  1. package device
  2. import (
  3. "gvisor.dev/gvisor/pkg/tcpip/stack"
  4. "github.com/v2fly/v2ray-core/v5/common"
  5. )
  6. //go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
  7. type Device interface {
  8. stack.LinkEndpoint
  9. common.Closable
  10. }
  11. type Options struct {
  12. Name string
  13. MTU uint32
  14. }
  15. type DeviceConstructor func(Options) (Device, error)