This commit is contained in:
vadym 2021-09-09 10:19:40 +03:00
parent af9260c802
commit 1dce2d51be
42 changed files with 187 additions and 187 deletions

View file

@ -3,7 +3,7 @@ package tuntap
import (
"encoding/json"
"github.com/yggdrasil-network/yggdrasil-go/src/admin"
"github.com/RiV-chain/RiV-mesh/src/admin"
)
type GetTUNRequest struct{}

View file

@ -11,11 +11,11 @@ import (
"sync"
"sync/atomic"
"github.com/yggdrasil-network/yggdrasil-go/src/address"
"github.com/RiV-chain/RiV-mesh/src/address"
)
// This module implements crypto-key routing, similar to Wireguard, where we
// allow traffic for non-Yggdrasil ranges to be routed over Yggdrasil.
// allow traffic for non-Mesh ranges to be routed over Mesh.
type cryptokey struct {
tun *TunAdapter
@ -213,13 +213,13 @@ func (c *cryptokey) addRemoteSubnet(cidr string, dest string) error {
return errors.New("unexpected prefix size")
}
// Is the route an Yggdrasil destination?
// Is the route an Mesh destination?
var addr address.Address
var snet address.Subnet
copy(addr[:], ipaddr)
copy(snet[:], ipnet.IP)
if addr.IsValid() || snet.IsValid() {
return errors.New("can't specify Yggdrasil destination as crypto-key route")
return errors.New("can't specify Mesh destination as crypto-key route")
}
// Do we already have a route for this subnet?
for _, route := range *routingtable {
@ -264,10 +264,10 @@ func (c *cryptokey) addRemoteSubnet(cidr string, dest string) error {
// returned if the address is not suitable or no route was found.
func (c *cryptokey) getPublicKeyForAddress(addr address.Address, addrlen int) (ed25519.PublicKey, error) {
// Check if the address is a valid Yggdrasil address - if so it
// Check if the address is a valid Mesh address - if so it
// is exempt from all CKR checking
if addr.IsValid() {
return ed25519.PublicKey{}, errors.New("cannot look up CKR for Yggdrasil addresses")
return ed25519.PublicKey{}, errors.New("cannot look up CKR for Mesh addresses")
}
// Build our references to the routing table and cache

View file

@ -7,9 +7,9 @@ import (
"time"
"github.com/Arceliar/phony"
"github.com/yggdrasil-network/yggdrasil-go/src/address"
"github.com/yggdrasil-network/yggdrasil-go/src/util"
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
"github.com/RiV-chain/RiV-mesh/src/address"
"github.com/RiV-chain/RiV-mesh/src/util"
"github.com/RiV-chain/RiV-mesh/src/yggdrasil"
"golang.org/x/net/icmp"
"golang.org/x/net/ipv6"
)

View file

@ -19,16 +19,16 @@ import (
"github.com/gologme/log"
"golang.zx2c4.com/wireguard/tun"
"github.com/yggdrasil-network/yggdrasil-go/src/address"
"github.com/yggdrasil-network/yggdrasil-go/src/config"
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
"github.com/yggdrasil-network/yggdrasil-go/src/ipv6rwc"
"github.com/RiV-chain/RiV-mesh/src/address"
"github.com/RiV-chain/RiV-mesh/src/config"
"github.com/RiV-chain/RiV-mesh/src/defaults"
"github.com/RiV-chain/RiV-mesh/src/ipv6rwc"
)
type MTU uint16
// TunAdapter represents a running TUN interface and extends the
// yggdrasil.Adapter type. In order to use the TUN adapter with Yggdrasil, you
// yggdrasil.Adapter type. In order to use the TUN adapter with Mesh, you
// should pass this object to the yggdrasil.SetRouterAdapter() function before
// calling yggdrasil.Start().
type TunAdapter struct {
@ -93,7 +93,7 @@ func MaximumMTU() uint64 {
}
// Init initialises the TUN module. You must have acquired a Listener from
// the Yggdrasil core before this point and it must not be in use elsewhere.
// the Mesh core before this point and it must not be in use elsewhere.
func (tun *TunAdapter) Init(rwc *ipv6rwc.ReadWriteCloser, config *config.NodeConfig, log *log.Logger, options interface{}) error {
tun.rwc = rwc
tun.config = config

View file

@ -8,7 +8,7 @@ import (
"log"
"net"
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
"github.com/RiV-chain/RiV-mesh/src/defaults"
"golang.org/x/sys/windows"
wgtun "golang.zx2c4.com/wireguard/tun"