Rearrange public interface, godoc improvements

This commit is contained in:
Neil Alexander 2019-03-29 18:05:17 +00:00
parent 399e1a2ffe
commit b5ac65cacb
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 99 additions and 97 deletions

View file

@ -65,6 +65,28 @@ func (tun *TunAdapter) IsTAP() bool {
return tun.iface.IsTAP()
}
// Gets the default TUN/TAP interface name for your platform.
func DefaultName() string {
return defaults.GetDefaults().DefaultIfName
}
// Gets the default TUN/TAP interface MTU for your platform. This can be as high
// as 65535, depending on platform, but is never lower than 1280.
func DefaultMTU() int {
return defaults.GetDefaults().DefaultIfMTU
}
// Gets the default TUN/TAP interface mode for your platform.
func DefaultIsTAP() bool {
return defaults.GetDefaults().DefaultIfTAPMode
}
// Gets the maximum supported TUN/TAP interface MTU for your platform. This
// can be as high as 65535, depending on platform, but is never lower than 1280.
func MaximumMTU() int {
return defaults.GetDefaults().MaximumIfMTU
}
// Initialises the TUN/TAP adapter.
func (tun *TunAdapter) Init(config *config.NodeState, log *log.Logger, send chan<- []byte, recv <-chan []byte, reject <-chan yggdrasil.RejectedPacket) {
tun.config = config