mirror of
https://github.com/fumiama/water.git
synced 2026-06-28 07:50:25 +08:00
add new interface for init configuration (#15)
This commit is contained in:
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user