2021-11-12 09:47:36 -07:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"io"
|
|
|
|
"net"
|
|
|
|
|
|
|
|
"github.com/slackhq/nebula/iputil"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NoopTun struct{}
|
|
|
|
|
|
|
|
func (NoopTun) RouteFor(iputil.VpnIp) iputil.VpnIp {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NoopTun) Activate() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-11-12 11:47:09 -07:00
|
|
|
func (NoopTun) Cidr() *net.IPNet {
|
2021-11-12 09:47:36 -07:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-11-12 11:47:09 -07:00
|
|
|
func (NoopTun) Name() string {
|
2021-11-12 09:47:36 -07:00
|
|
|
return "noop"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NoopTun) Read([]byte) (int, error) {
|
|
|
|
return 0, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NoopTun) Write([]byte) (int, error) {
|
|
|
|
return 0, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NoopTun) NewMultiQueueReader() (io.ReadWriteCloser, error) {
|
|
|
|
return nil, errors.New("unsupported")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NoopTun) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|