Moved TUN device creation to pre-fork
This commit is contained in:
parent
69fe86edf0
commit
88801529fd
6 changed files with 111 additions and 59 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ const (
|
|||
)
|
||||
|
||||
type TUNDevice interface {
|
||||
File() *os.File // returns the file descriptor of the device
|
||||
Read([]byte) (int, error) // read a packet from the device (without any additional headers)
|
||||
Write([]byte) (int, error) // writes a packet to the device (without any additional headers)
|
||||
MTU() (int, error) // returns the MTU of the device
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue