mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 05:43:59 -07:00
.
This commit is contained in:
parent
3b3e6d2bfc
commit
4303c43db7
13 changed files with 560 additions and 296 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue