1. added multipath protocol and schema suport

2. added SCTP protocol and schema support
3. added set of NAS models support (Asustor, ReadyNAS, Drobo, QNAP, WD, Synology, Terramaster)
4. moved to fc00::/7 private segment
5. added Windows, MacOS and Linux UI for peers edit and current status
This commit is contained in:
vadym 2022-10-27 22:03:37 +03:00
parent cfa293d189
commit d8a4000141
198 changed files with 8589 additions and 697 deletions

View file

@ -19,7 +19,7 @@ import (
"net"
"runtime"
"github.com/yggdrasil-network/yggdrasil-go/src/address"
"github.com/RiV-chain/RiV-mesh/src/address"
)
type keySet struct {

View file

@ -25,16 +25,16 @@ import (
"github.com/kardianos/minwinsvc"
"github.com/mitchellh/mapstructure"
"github.com/yggdrasil-network/yggdrasil-go/src/address"
"github.com/yggdrasil-network/yggdrasil-go/src/admin"
"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/admin"
"github.com/RiV-chain/RiV-mesh/src/config"
"github.com/RiV-chain/RiV-mesh/src/defaults"
"github.com/yggdrasil-network/yggdrasil-go/src/core"
"github.com/yggdrasil-network/yggdrasil-go/src/multicast"
"github.com/yggdrasil-network/yggdrasil-go/src/tun"
"github.com/yggdrasil-network/yggdrasil-go/src/version"
"github.com/RiV-chain/RiV-mesh/src/core"
"github.com/RiV-chain/RiV-mesh/src/ipv6rwc"
"github.com/RiV-chain/RiV-mesh/src/multicast"
"github.com/RiV-chain/RiV-mesh/src/tun"
"github.com/RiV-chain/RiV-mesh/src/version"
)
type node struct {
@ -153,6 +153,8 @@ type yggArgs struct {
useconffile string
logto string
loglevel string
httpaddress string
wwwroot string
}
func getArgs() yggArgs {
@ -167,6 +169,9 @@ func getArgs() yggArgs {
getaddr := flag.Bool("address", false, "returns the IPv6 address as derived from the supplied configuration")
getsnet := flag.Bool("subnet", false, "returns the IPv6 subnet as derived from the supplied configuration")
loglevel := flag.String("loglevel", "info", "loglevel to enable")
httpaddress := flag.String("httpaddress", "", "httpaddress to enable")
wwwroot := flag.String("wwwroot", "", "wwwroot to enable")
flag.Parse()
return yggArgs{
genconf: *genconf,
@ -180,10 +185,11 @@ func getArgs() yggArgs {
getaddr: *getaddr,
getsnet: *getsnet,
loglevel: *loglevel,
httpaddress: *httpaddress,
wwwroot: *wwwroot,
}
}
// The main function is responsible for configuring and starting Yggdrasil.
func run(args yggArgs, ctx context.Context) {
// Create a new logger that logs output to stdout.
var logger *log.Logger
@ -281,10 +287,12 @@ func run(args yggArgs, ctx context.Context) {
}
return
}
//override httpaddress and wwwroot parameters in cfg
cfg.HttpAddress = args.httpaddress
cfg.WwwRoot = args.wwwroot
n := &node{}
// Setup the Yggdrasil node itself.
// Setup the RiV-mesh node itself.
{
sk, err := hex.DecodeString(cfg.PrivateKey)
if err != nil {
@ -335,10 +343,10 @@ func run(args yggArgs, ctx context.Context) {
options := []multicast.SetupOption{}
for _, intf := range cfg.MulticastInterfaces {
options = append(options, multicast.MulticastInterface{
Regex: regexp.MustCompile(intf.Regex),
Beacon: intf.Beacon,
Listen: intf.Listen,
Port: intf.Port,
Regex: regexp.MustCompile(intf.Regex),
Beacon: intf.Beacon,
Listen: intf.Listen,
Port: intf.Port,
Priority: intf.Priority,
})
}
@ -372,7 +380,8 @@ func run(args yggArgs, ctx context.Context) {
logger.Infof("Your public key is %s", hex.EncodeToString(public[:]))
logger.Infof("Your IPv6 address is %s", address.String())
logger.Infof("Your IPv6 subnet is %s", subnet.String())
// Start HTTP server
n.admin.StartHttpServer(cfg)
// Block until we are told to shut down.
<-ctx.Done()

View file

@ -10,7 +10,7 @@ import (
"github.com/hjson/hjson-go"
"golang.org/x/text/encoding/unicode"
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
"github.com/RiV-chain/RiV-mesh/src/defaults"
)
type CmdLineEnv struct {

View file

@ -14,11 +14,11 @@ import (
"time"
"github.com/olekukonko/tablewriter"
"github.com/yggdrasil-network/yggdrasil-go/src/admin"
"github.com/yggdrasil-network/yggdrasil-go/src/core"
"github.com/yggdrasil-network/yggdrasil-go/src/multicast"
"github.com/yggdrasil-network/yggdrasil-go/src/tun"
"github.com/yggdrasil-network/yggdrasil-go/src/version"
"github.com/RiV-chain/RiV-mesh/src/admin"
"github.com/RiV-chain/RiV-mesh/src/core"
"github.com/RiV-chain/RiV-mesh/src/multicast"
"github.com/RiV-chain/RiV-mesh/src/tun"
"github.com/RiV-chain/RiV-mesh/src/version"
)
func main() {
@ -45,7 +45,7 @@ func run() int {
if cmdLineEnv.ver {
fmt.Println("Build name:", version.BuildName())
fmt.Println("Build version:", version.BuildVersion())
fmt.Println("To get the version number of the running Yggdrasil node, run", os.Args[0], "getSelf")
fmt.Println("To get the version number of the running Mesh node, run", os.Args[0], "getSelf")
return 0
}
@ -111,6 +111,8 @@ func run() int {
panic(err)
}
logger.Printf("Request sent")
//js, _ := json.Marshal(send)
//fmt.Println("sent:", string(js))
if err := decoder.Decode(&recv); err != nil {
panic(err)
}
@ -180,11 +182,10 @@ func run() int {
fmt.Sprintf("%d", peer.Port),
peer.PublicKey,
peer.IPAddress,
peer.Remote,
(time.Duration(peer.Uptime) * time.Second).String(),
peer.RXBytes.String(),
peer.TXBytes.String(),
fmt.Sprintf("%d", peer.Priority),
peer.Remote,
})
}
table.Render()
@ -270,8 +271,6 @@ func run() int {
}
table.Render()
case "addpeer", "removepeer":
default:
fmt.Println(string(recv.Response))
}