File
Blob: spec/tun/server.go
| 1 | package tun |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "fmt" |
| 6 | "net" |
| 7 | |
| 8 | "go.miragespace.co/specter/spec/protocol" |
| 9 | ) |
| 10 | |
| 11 | var ( |
| 12 | ErrLookupFailed = fmt.Errorf("tun: failed to lookup tunnel on specter network") |
| 13 | ErrDestinationNotFound = fmt.Errorf("tun: tunnel not found on specter network") |
| 14 | ErrTunnelClientNotConnected = fmt.Errorf("tun: tunnel client is not connected to any nodes") |
| 15 | ErrHostnameNotFound = fmt.Errorf("tun: custom hostname is not registered") |
| 16 | ) |
| 17 | |
| 18 | type Server interface { |
| 19 | Identity() *protocol.Node |
| 20 | DialClient(context.Context, *protocol.Link) (net.Conn, error) |
| 21 | DialInternal(context.Context, *protocol.Node) (net.Conn, error) |
| 22 | } |