initial: ZeroTier-like P2P mesh VPN server with multi-tenant Web UI
This commit is contained in:
24
internal/tap/tap.go
Normal file
24
internal/tap/tap.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package tap
|
||||
|
||||
type Interface struct {
|
||||
Name string
|
||||
MTU int
|
||||
fd int
|
||||
}
|
||||
|
||||
// Open creates a TAP interface on Linux. On other platforms it returns an error.
|
||||
func Open(name string, mtu int) (*Interface, error) {
|
||||
return openTap(name, mtu)
|
||||
}
|
||||
|
||||
func (t *Interface) Read(buf []byte) (int, error) {
|
||||
return readBuf(t.fd, buf)
|
||||
}
|
||||
|
||||
func (t *Interface) Write(buf []byte) (int, error) {
|
||||
return writeBuf(t.fd, buf)
|
||||
}
|
||||
|
||||
func (t *Interface) Close() error {
|
||||
return closeFD(t.fd)
|
||||
}
|
||||
Reference in New Issue
Block a user