noop.go 768 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package overlay
  2. import (
  3. "errors"
  4. "net/netip"
  5. "github.com/slackhq/nebula/routing"
  6. )
  7. type NoopTun struct{}
  8. func (NoopTun) RoutesFor(addr netip.Addr) routing.Gateways {
  9. return routing.Gateways{}
  10. }
  11. func (NoopTun) Activate() error {
  12. return nil
  13. }
  14. func (NoopTun) Networks() []netip.Prefix {
  15. return []netip.Prefix{}
  16. }
  17. func (NoopTun) Name() string {
  18. return "noop"
  19. }
  20. func (NoopTun) Read() ([][]byte, error) {
  21. return nil, nil
  22. }
  23. func (NoopTun) Write([]byte) (int, error) {
  24. return 0, nil
  25. }
  26. func (NoopTun) WriteReject(p []byte) (int, error) {
  27. return 0, nil
  28. }
  29. func (NoopTun) SupportsMultiqueue() bool {
  30. return false
  31. }
  32. func (NoopTun) NewMultiQueueReader() (Queue, error) {
  33. return nil, errors.New("unsupported")
  34. }
  35. func (NoopTun) Close() error {
  36. return nil
  37. }