MCPcopy Create free account
hub / github.com/encodeous/nylon / NativeTun

Struct NativeTun

polyamide/tun/tun_linux.go:30–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28)
29
30type NativeTun struct {
31 tunFile *os.File
32 index int32 // if index
33 errors chan error // async error handling
34 events chan Event // device related events
35 netlinkSock int
36 netlinkCancel *rwcancel.RWCancel
37 hackListenerClosed sync.Mutex
38 statusListenersShutdown chan struct{}
39 batchSize int
40 vnetHdr bool
41 udpGSO bool
42
43 closeOnce sync.Once
44
45 nameOnce sync.Once // guards calling initNameCache, which sets following fields
46 nameCache string // name of interface
47 nameErr error
48
49 readOpMu sync.Mutex // readOpMu guards readBuff
50 readBuff [virtioNetHdrLen + 65535]byte // if vnetHdr every read() is prefixed by virtioNetHdr
51
52 writeOpMu sync.Mutex // writeOpMu guards toWrite, tcpGROTable
53 toWrite []int
54 tcpGROTable *tcpGROTable
55 udpGROTable *udpGROTable
56}
57
58func (tun *NativeTun) File() *os.File {
59 return tun.tunFile

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected