This commit is contained in:
Adam Ierymenko 2019-09-27 14:55:46 -07:00
commit 4303c43db7
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
13 changed files with 560 additions and 296 deletions

View file

@ -17,15 +17,39 @@ import "net"
// Tap represents an Ethernet tap connecting a virtual network to a device or something else "real"
type Tap interface {
// Close is called when this tap is being shut down
Close()
// Type is a string describing what kind of tap this is e.g. "native" for OS-native
Type() string
// Error returns the most recent error experienced by this tap
Error() (int, string)
// SetEnabled sets whether this tap will accept and process packets
SetEnabled(enabled bool)
// Enabled returns the current enabled status
Enabled() bool
// AddIP assigns an IP address to this tap device
AddIP(ip *net.IPNet) error
// RemoveIP removes an IP address from this tap
RemoveIP(ip *net.IPNet) error
// IPs returns an array of all IPs currently assigned to this tap including those not assigned by ZeroTier
IPs() ([]net.IPNet, error)
// DeviceName gets the OS-specific device name for this tap or an empty string if none
DeviceName() string
// AddMulticastGroupChangeHandler registers a function to be called on multicast group subscribe or unsubscribe (first argument)
AddMulticastGroupChangeHandler(func(bool, *MulticastGroup))
// AddRoute adds a route to this tap device via the system or other routing table
AddRoute(r *Route) error
// RemoveRoute removes a route from this tap device
RemoveRoute(r *Route) error
}