4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-06-14 19:46:05 +00:00

Refactoring: move tuntap and icmpv6 into separate package

This commit is contained in:
Neil Alexander
2019-03-28 00:30:25 +00:00
parent 67c670ab4c
commit 0b494a8255
20 changed files with 307 additions and 240 deletions

View File

@ -19,6 +19,7 @@ import (
"github.com/mitchellh/mapstructure"
"github.com/yggdrasil-network/yggdrasil-go/src/config"
"github.com/yggdrasil-network/yggdrasil-go/src/tuntap"
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
)
@ -27,6 +28,7 @@ type Core = yggdrasil.Core
type node struct {
core Core
tun tuntap.TunAdapter
}
func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *nodeConfig {
@ -247,6 +249,7 @@ func main() {
// Now that we have a working configuration, we can now actually start
// Yggdrasil. This will start the router, switch, DHT node, TCP and UDP
// sockets, TUN/TAP adapter and multicast discovery port.
n.core.SetRouterAdapter(&n.tun)
if err := n.core.Start(cfg, logger); err != nil {
logger.Errorln("An error occurred during startup")
panic(err)