github.com/slackhq/nebula@v1.9.0/test/tun.go (about)

     1  package test
     2  
     3  import (
     4  	"errors"
     5  	"io"
     6  	"net"
     7  
     8  	"github.com/slackhq/nebula/iputil"
     9  )
    10  
    11  type NoopTun struct{}
    12  
    13  func (NoopTun) RouteFor(iputil.VpnIp) iputil.VpnIp {
    14  	return 0
    15  }
    16  
    17  func (NoopTun) Activate() error {
    18  	return nil
    19  }
    20  
    21  func (NoopTun) Cidr() *net.IPNet {
    22  	return nil
    23  }
    24  
    25  func (NoopTun) Name() string {
    26  	return "noop"
    27  }
    28  
    29  func (NoopTun) Read([]byte) (int, error) {
    30  	return 0, nil
    31  }
    32  
    33  func (NoopTun) Write([]byte) (int, error) {
    34  	return 0, nil
    35  }
    36  
    37  func (NoopTun) NewMultiQueueReader() (io.ReadWriteCloser, error) {
    38  	return nil, errors.New("unsupported")
    39  }
    40  
    41  func (NoopTun) Close() error {
    42  	return nil
    43  }