device.go 480 B

123456789101112131415161718192021
  1. package overlay
  2. import (
  3. "io"
  4. "net/netip"
  5. "github.com/slackhq/nebula/routing"
  6. )
  7. type Device interface {
  8. io.ReadWriteCloser
  9. Activate() error
  10. Networks() []netip.Prefix
  11. Name() string
  12. RoutesFor(netip.Addr) routing.Gateways
  13. SupportsMultiqueue() bool
  14. NewMultiQueueReader() (io.ReadWriteCloser, error)
  15. // TunPrefixLen reports the number of bytes the device prepends to every IP packet on the wire.
  16. // Currently only non zero for the BSD tun devices.
  17. TunPrefixLen() int
  18. }