2021-11-12 10:47:36 -06:00
|
|
|
package test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
"io"
|
2024-07-31 10:18:56 -05:00
|
|
|
"net/netip"
|
2025-03-24 23:15:59 +01:00
|
|
|
|
|
|
|
|
"github.com/slackhq/nebula/routing"
|
2021-11-12 10:47:36 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type NoopTun struct{}
|
|
|
|
|
|
2025-03-24 23:15:59 +01:00
|
|
|
func (NoopTun) RoutesFor(addr netip.Addr) routing.Gateways {
|
|
|
|
|
return routing.Gateways{}
|
2021-11-12 10:47:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (NoopTun) Activate() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-06 11:28:26 -06:00
|
|
|
func (NoopTun) Networks() []netip.Prefix {
|
|
|
|
|
return []netip.Prefix{}
|
2021-11-12 10:47:36 -06:00
|
|
|
}
|
|
|
|
|
|
2021-11-12 12:47:09 -06:00
|
|
|
func (NoopTun) Name() string {
|
2021-11-12 10:47:36 -06:00
|
|
|
return "noop"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (NoopTun) Read([]byte) (int, error) {
|
|
|
|
|
return 0, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (NoopTun) Write([]byte) (int, error) {
|
|
|
|
|
return 0, nil
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-19 14:10:11 -05:00
|
|
|
func (NoopTun) SupportsMultiqueue() bool {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-12 10:47:36 -06:00
|
|
|
func (NoopTun) NewMultiQueueReader() (io.ReadWriteCloser, error) {
|
|
|
|
|
return nil, errors.New("unsupported")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (NoopTun) Close() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|