- Moved from openvpn package to tun package - TUN check verifies Rdev value - TUN create - Inject as interface to main function - Add integration test - Clearer log message for end users if tun device does not exist - Remove unix package (unneeded for tests) - Remove tun file opening at the end of tun file creation - Do not mock unix.Mkdev (no OS operation) - Remove Tun operations from OpenVPN configurator
21 lines
262 B
Go
21 lines
262 B
Go
package tun
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
var _ Interface = (*Tun)(nil)
|
|
|
|
type Interface interface {
|
|
Checker
|
|
Creator
|
|
}
|
|
|
|
type Tun struct {
|
|
mknod func(path string, mode uint32, dev int) (err error)
|
|
}
|
|
|
|
func New() *Tun {
|
|
return &Tun{
|
|
mknod: unix.Mknod,
|
|
}
|
|
}
|