github.com/icexin/eggos@v0.4.2-0.20220216025428-78b167e4f349/inet/ndev.go (about) 1 package inet 2 3 import "gvisor.dev/gvisor/pkg/tcpip/stack" 4 5 var DefaultDevice Device 6 7 type Device interface { 8 Mac() [6]byte 9 Transmit(pkt *stack.PacketBuffer) error 10 SetReceiveCallback(func(b []byte)) 11 } 12 13 func RegisterDevice(d Device) { 14 DefaultDevice = d 15 }