blob: 17bced6920146a8d689a6750958d2faaaae95bb5 [file] [log] [blame]
giolekva3c0e1822021-03-15 00:08:44 +04001package engine
2
3import (
4 "inet.af/netaddr"
5 "tailscale.com/ipn/ipnstate"
6
7 "github.com/giolekva/pcloud/core/vpn/types"
8)
9
10// Abstracts away communication with host OS needed to setup netfwork interfaces
11// for VPN.
12type Engine interface {
13 // Reconfigures local network interfaces in accordance to the given VPN
14 // layout.
15 Configure(netMap *types.NetworkMap) error
16 // Unique public discovery key of the current device.
17 DiscoKey() types.DiscoKey
giolekva3c0e1822021-03-15 00:08:44 +040018 // Sends ping to the given IP address and invokes callback with results.
19 Ping(ip netaddr.IP, cb func(*ipnstate.PingResult))
20}