mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
get the fd instead of depending on water to do it
This commit is contained in:
parent
3eccca62cc
commit
cd0d1a1d26
2 changed files with 6 additions and 15 deletions
|
@ -2,29 +2,19 @@ package yggdrasil
|
|||
|
||||
// This manages the tun driver to send/recv packets to/from applications
|
||||
|
||||
import "os"
|
||||
import ethernet "github.com/songgao/packets/ethernet"
|
||||
import "github.com/songgao/packets/ethernet"
|
||||
import "github.com/yggdrasil-network/water"
|
||||
|
||||
const IPv6_HEADER_LENGTH = 40
|
||||
const ETHER_HEADER_LENGTH = 14
|
||||
|
||||
type tunInterface interface {
|
||||
IsTUN() bool
|
||||
IsTAP() bool
|
||||
Name() string
|
||||
Read(to []byte) (int, error)
|
||||
Write(from []byte) (int, error)
|
||||
Close() error
|
||||
FD() *os.File
|
||||
}
|
||||
|
||||
type tunDevice struct {
|
||||
core *Core
|
||||
icmpv6 icmpv6
|
||||
send chan<- []byte
|
||||
recv <-chan []byte
|
||||
mtu int
|
||||
iface tunInterface
|
||||
iface *water.Interface
|
||||
}
|
||||
|
||||
type tunDefaultParameters struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue