Add experimental dummy interface for AWDL

This commit is contained in:
Neil Alexander 2019-01-04 17:14:40 +00:00
parent d10a0d6137
commit f29a098488
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 106 additions and 2 deletions

View file

@ -11,6 +11,7 @@ import (
hjson "github.com/hjson/hjson-go"
"github.com/mitchellh/mapstructure"
"github.com/yggdrasil-network/yggdrasil-go/src/config"
"github.com/yggdrasil-network/yggdrasil-go/src/crypto"
"github.com/yggdrasil-network/yggdrasil-go/src/util"
)
@ -91,3 +92,11 @@ func (c *Core) RouterSendPacket(buf []byte) error {
c.router.tun.send <- packet
return nil
}
func (c *Core) AWDLCreateInterface(boxPubKey []byte, sigPubKey []byte, name string) {
var box crypto.BoxPubKey
var sig crypto.SigPubKey
copy(box[:crypto.BoxPubKeyLen], boxPubKey[:])
copy(sig[:crypto.SigPubKeyLen], sigPubKey[:])
c.awdl.create(&box, &sig, name)
}