device.go 351 B

123456789101112131415161718192021
  1. package device
  2. import (
  3. "github.com/v2fly/v2ray-core/v5/common"
  4. "gvisor.dev/gvisor/pkg/tcpip/stack"
  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)