mirror of
https://github.com/yggdrasil-network/water.git
synced 2025-05-20 00:45:09 +03:00
add new interface for init configuration (#15)
This commit is contained in:
parent
98078a8ac5
commit
37d6645a51
5 changed files with 109 additions and 0 deletions
16
if_unix.go
Normal file
16
if_unix.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
// +build linux darwin
|
||||
|
||||
package water
|
||||
|
||||
import "errors"
|
||||
|
||||
func newDev(config Config) (ifce *Interface, err error) {
|
||||
switch config.DeviceType {
|
||||
case TUN:
|
||||
return newTUN(config.Name)
|
||||
case TAP:
|
||||
return newTAP(config.Name)
|
||||
default:
|
||||
return nil, errors.New("unknown device type")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue