yggdrasil-go/src/tun/options.go
Neil Alexander 01c44a087b
Rename tuntap package to tun
We haven't had TAP support in ages.
2022-09-24 14:41:47 +01:00

20 lines
363 B
Go

package tun
func (m *TunAdapter) _applyOption(opt SetupOption) {
switch v := opt.(type) {
case InterfaceName:
m.config.name = v
case InterfaceMTU:
m.config.mtu = v
}
}
type SetupOption interface {
isSetupOption()
}
type InterfaceName string
type InterfaceMTU uint64
func (a InterfaceName) isSetupOption() {}
func (a InterfaceMTU) isSetupOption() {}