This commit is contained in:
asolana 2022-10-07 11:36:39 +02:00
parent 74910f96da
commit 82dd30ee5c
61 changed files with 2197 additions and 2030 deletions

20
src/tun/options.go Normal file
View file

@ -0,0 +1,20 @@
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() {}