Add create tun from file descriptor
This commit is contained in:
parent
8cb63dbb54
commit
0cdb0eed74
8 changed files with 67 additions and 49 deletions
|
|
@ -36,7 +36,10 @@ type NativeTun struct {
|
|||
fwpmSession uintptr
|
||||
}
|
||||
|
||||
func Open(options Options) (WinTun, error) {
|
||||
func New(options Options) (WinTun, error) {
|
||||
if options.FileDescriptor != 0 {
|
||||
return nil, os.ErrInvalid
|
||||
}
|
||||
adapter, err := wintun.CreateAdapter(options.Name, TunnelType, generateGUIDByDeviceName(options.Name))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue