2021-11-12 09:47:36 -07:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"io"
|
2024-07-31 09:18:56 -06:00
|
|
|
"net/netip"
|
2021-11-12 09:47:36 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type NoopTun struct{}
|
|
|
|
|
2024-07-31 09:18:56 -06:00
|
|
|
func (NoopTun) RouteFor(addr netip.Addr) netip.Addr {
|
|
|
|
return netip.Addr{}
|
2021-11-12 09:47:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NoopTun) Activate() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-07-31 09:18:56 -06:00
|
|
|
func (NoopTun) Cidr() netip.Prefix {
|
|
|
|
return netip.Prefix{}
|
2021-11-12 09:47:36 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|