Start de-debugging

This commit is contained in:
Neil Alexander 2018-05-24 00:36:07 +01:00
parent fae00e962f
commit 3847e6afb8
4 changed files with 35 additions and 0 deletions

View file

@ -3,6 +3,8 @@ package yggdrasil
import "io/ioutil"
import "log"
import "regexp"
import "net"
import "yggdrasil/config"
type Core struct {
// This is the main data structure that holds everything else for a node
@ -33,6 +35,29 @@ func (c *Core) Init() {
c.init(bpub, bpriv, spub, spriv)
}
func (c *Core) Run(nc *config.NodeConfig) {
var boxPub boxPubKey
var boxPriv boxPrivKey
var sigPub sigPubKey
var sigPriv sigPrivKey
copy(boxPub[:], nc.EncryptionPublicKey)
copy(boxPriv[:], nc.EncryptionPrivateKey)
copy(sigPub[:], nc.SigningPublicKey)
copy(sigPriv[:], nc.SigningPrivateKey)
c.init(&boxPub, &boxPriv, &sigPub, &sigPriv)
c.udp.init(c, nc.Listen)
c.tcp.init(c, nc.Listen)
c.admin.init(c, nc.AdminListen)
c.multicast.start()
c.router.start()
c.switchTable.start()
c.tun.setup(nc.IfName, nc.IfTAPMode, net.IP(c.router.addr[:]).String(), nc.IfMTU)
c.admin.start()
}
func (c *Core) init(bpub *boxPubKey,
bpriv *boxPrivKey,
spub *sigPubKey,