"io"
)
+// TAP is a TUN or a TAP interface.
type TAP struct {
Name string
Sink chan []byte
taps = make(map[string]*TAP)
)
+// NewTAP create a new TUN/TAP virtual interface
func NewTAP(ifaceName string, mtu int) (*TAP, error) {
tapRaw, err := newTAPer(ifaceName)
if err != nil {
return t.dev.Write(data)
}
+// TAPListen open an existing TAP, if none exists, open one
func TAPListen(ifaceName string, mtu int) (*TAP, error) {
tap, exists := taps[ifaceName]
if exists {