Define Adapter base type/interface

This commit is contained in:
Neil Alexander 2018-12-14 18:29:00 +00:00
parent 8045cb4dc3
commit f9dc300787
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
3 changed files with 29 additions and 12 deletions

View file

@ -18,7 +18,7 @@ const tun_ETHER_HEADER_LENGTH = 14
// Represents a running TUN/TAP interface.
type tunAdapter struct {
adapter
Adapter
icmpv6 icmpv6
mtu int
iface *water.Interface
@ -35,10 +35,8 @@ func getSupportedMTU(mtu int) int {
// Initialises the TUN/TAP adapter.
func (tun *tunAdapter) init(core *Core, send chan<- []byte, recv <-chan []byte) {
tun.core = core
tun.Adapter.init(core, send, recv)
tun.icmpv6.init(tun)
tun.send = send
tun.recv = recv
}
// Starts the setup process for the TUN/TAP adapter, and if successful, starts