mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Rename tuntap
package to tun
We haven't had TAP support in ages.
This commit is contained in:
parent
217ac39e77
commit
01c44a087b
18 changed files with 31 additions and 36 deletions
|
@ -20,7 +20,7 @@ type platformDefaultParameters struct {
|
|||
// Multicast interfaces
|
||||
DefaultMulticastInterfaces []MulticastInterfaceConfig
|
||||
|
||||
// TUN/TAP
|
||||
// TUN
|
||||
MaximumIfMTU uint64
|
||||
DefaultIfMTU uint64
|
||||
DefaultIfName string
|
||||
|
|
|
@ -19,7 +19,7 @@ func getDefaults() platformDefaultParameters {
|
|||
{Regex: "bridge.*", Beacon: true, Listen: true},
|
||||
},
|
||||
|
||||
// TUN/TAP
|
||||
// TUN
|
||||
MaximumIfMTU: 65535,
|
||||
DefaultIfMTU: 65535,
|
||||
DefaultIfName: "auto",
|
||||
|
|
|
@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
|
|||
{Regex: ".*", Beacon: true, Listen: true},
|
||||
},
|
||||
|
||||
// TUN/TAP
|
||||
// TUN
|
||||
MaximumIfMTU: 32767,
|
||||
DefaultIfMTU: 32767,
|
||||
DefaultIfName: "/dev/tun0",
|
||||
|
|
|
@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
|
|||
{Regex: ".*", Beacon: true, Listen: true},
|
||||
},
|
||||
|
||||
// TUN/TAP
|
||||
// TUN
|
||||
MaximumIfMTU: 65535,
|
||||
DefaultIfMTU: 65535,
|
||||
DefaultIfName: "auto",
|
||||
|
|
|
@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
|
|||
{Regex: ".*", Beacon: true, Listen: true},
|
||||
},
|
||||
|
||||
// TUN/TAP
|
||||
// TUN
|
||||
MaximumIfMTU: 16384,
|
||||
DefaultIfMTU: 16384,
|
||||
DefaultIfName: "tun0",
|
||||
|
|
|
@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
|
|||
{Regex: ".*", Beacon: true, Listen: true},
|
||||
},
|
||||
|
||||
// TUN/TAP
|
||||
// TUN
|
||||
MaximumIfMTU: 65535,
|
||||
DefaultIfMTU: 65535,
|
||||
DefaultIfName: "none",
|
||||
|
|
|
@ -18,7 +18,7 @@ func getDefaults() platformDefaultParameters {
|
|||
{Regex: ".*", Beacon: true, Listen: true},
|
||||
},
|
||||
|
||||
// TUN/TAP
|
||||
// TUN
|
||||
MaximumIfMTU: 65535,
|
||||
DefaultIfMTU: 65535,
|
||||
DefaultIfName: "Yggdrasil",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package tuntap
|
||||
package tun
|
||||
|
||||
import (
|
||||
"encoding/json"
|
|
@ -1,4 +1,4 @@
|
|||
package tuntap
|
||||
package tun
|
||||
|
||||
const TUN_OFFSET_BYTES = 4
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package tuntap
|
||||
package tun
|
||||
|
||||
func (m *TunAdapter) _applyOption(opt SetupOption) {
|
||||
switch v := opt.(type) {
|
|
@ -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"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
//go:build openbsd || freebsd
|
||||
// +build openbsd freebsd
|
||||
|
||||
package tuntap
|
||||
package tun
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
|
@ -1,7 +1,7 @@
|
|||
//go:build !mobile
|
||||
// +build !mobile
|
||||
|
||||
package tuntap
|
||||
package tun
|
||||
|
||||
// The darwin platform specific tun parts
|
||||
|
|
@ -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).
|
|
@ -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
|
|
@ -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")
|
Loading…
Add table
Add a link
Reference in a new issue