Rename tuntap package to tun

We haven't had TAP support in ages.
This commit is contained in:
Neil Alexander 2022-09-24 14:41:47 +01:00
parent 217ac39e77
commit 01c44a087b
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
18 changed files with 31 additions and 36 deletions

View file

@ -20,7 +20,7 @@ type platformDefaultParameters struct {
// Multicast interfaces
DefaultMulticastInterfaces []MulticastInterfaceConfig
// TUN/TAP
// TUN
MaximumIfMTU uint64
DefaultIfMTU uint64
DefaultIfName string

View file

@ -19,7 +19,7 @@ func getDefaults() platformDefaultParameters {
{Regex: "bridge.*", Beacon: true, Listen: true},
},
// TUN/TAP
// TUN
MaximumIfMTU: 65535,
DefaultIfMTU: 65535,
DefaultIfName: "auto",

View file

@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
{Regex: ".*", Beacon: true, Listen: true},
},
// TUN/TAP
// TUN
MaximumIfMTU: 32767,
DefaultIfMTU: 32767,
DefaultIfName: "/dev/tun0",

View file

@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
{Regex: ".*", Beacon: true, Listen: true},
},
// TUN/TAP
// TUN
MaximumIfMTU: 65535,
DefaultIfMTU: 65535,
DefaultIfName: "auto",

View file

@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
{Regex: ".*", Beacon: true, Listen: true},
},
// TUN/TAP
// TUN
MaximumIfMTU: 16384,
DefaultIfMTU: 16384,
DefaultIfName: "tun0",

View file

@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
{Regex: ".*", Beacon: true, Listen: true},
},
// TUN/TAP
// TUN
MaximumIfMTU: 65535,
DefaultIfMTU: 65535,
DefaultIfName: "none",

View file

@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
{Regex: ".*", Beacon: true, Listen: true},
},
// TUN/TAP
// TUN
MaximumIfMTU: 65535,
DefaultIfMTU: 65535,
DefaultIfName: "Yggdrasil",

View file

@ -1,4 +1,4 @@
package tuntap
package tun
import (
"encoding/json"

View file

@ -1,4 +1,4 @@
package tuntap
package tun
const TUN_OFFSET_BYTES = 4

View file

@ -1,4 +1,4 @@
package tuntap
package tun
func (m *TunAdapter) _applyOption(opt SetupOption) {
switch v := opt.(type) {

View file

@ -1,10 +1,7 @@
package tuntap
package tun
// This manages the tun driver to send/recv packets to/from applications
// TODO: Crypto-key routing support
// TODO: Set MTU of session properly
// TODO: Reject packets that exceed session MTU with ICMPv6 for PMTU Discovery
// TODO: Connection timeouts (call Conn.Close() when we want to time out)
// TODO: Don't block in reader on writes that are pending searches
@ -13,8 +10,6 @@ import (
"fmt"
"net"
//"sync"
"github.com/Arceliar/phony"
"golang.zx2c4.com/wireguard/tun"

View file

@ -1,7 +1,7 @@
//go:build openbsd || freebsd
// +build openbsd freebsd
package tuntap
package tun
import (
"encoding/binary"

View file

@ -1,7 +1,7 @@
//go:build !mobile
// +build !mobile
package tuntap
package tun
// The darwin platform specific tun parts

View file

@ -1,7 +1,7 @@
//go:build !mobile
// +build !mobile
package tuntap
package tun
// The linux platform specific tun parts
@ -28,7 +28,7 @@ func (tun *TunAdapter) setup(ifname string, addr string, mtu uint64) error {
return tun.setupAddress(addr)
}
// Configures the TAP adapter with the correct IPv6 address and MTU. Netlink
// Configures the TUN adapter with the correct IPv6 address and MTU. Netlink
// is used to do this, so there is not a hard requirement on "ip" or "ifconfig"
// to exist on the system, but this will fail if Netlink is not present in the
// kernel (it nearly always is).

View file

@ -1,7 +1,7 @@
//go:build !linux && !darwin && !windows && !openbsd && !freebsd && !mobile
// +build !linux,!darwin,!windows,!openbsd,!freebsd,!mobile
package tuntap
package tun
// This is to catch unsupported platforms
// If your platform supports tun devices, you could try configuring it manually

View file

@ -1,7 +1,7 @@
//go:build windows
// +build windows
package tuntap
package tun
import (
"bytes"
@ -50,7 +50,7 @@ func (tun *TunAdapter) setup(ifname string, addr string, mtu uint64) error {
})
}
// Sets the MTU of the TAP adapter.
// Sets the MTU of the TUN adapter.
func (tun *TunAdapter) setupMTU(mtu uint64) error {
if tun.iface == nil || tun.Name() == "" {
return errors.New("Can't configure MTU as TUN adapter is not present")
@ -77,7 +77,7 @@ func (tun *TunAdapter) setupMTU(mtu uint64) error {
return nil
}
// Sets the IPv6 address of the TAP adapter.
// Sets the IPv6 address of the TUN adapter.
func (tun *TunAdapter) setupAddress(addr string) error {
if tun.iface == nil || tun.Name() == "" {
return errors.New("Can't configure IPv6 address as TUN adapter is not present")