Various API changes and simplifications to fix mobile builds

This commit is contained in:
Neil Alexander 2019-07-27 15:00:09 +01:00
parent 9b99f0b5e4
commit de1005e4fa
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
13 changed files with 63 additions and 122 deletions

View file

@ -290,18 +290,6 @@ func (c *Core) ListenTCP(uri string) (*TcpListener, error) {
return c.link.tcp.listen(uri)
}
// NewEncryptionKeys generates a new encryption keypair. The encryption keys are
// used to encrypt traffic and to derive the IPv6 address/subnet of the node.
func (c *Core) NewEncryptionKeys() (*crypto.BoxPubKey, *crypto.BoxPrivKey) {
return crypto.NewBoxKeys()
}
// NewSigningKeys generates a new signing keypair. The signing keys are used to
// derive the structure of the spanning tree.
func (c *Core) NewSigningKeys() (*crypto.SigPubKey, *crypto.SigPrivKey) {
return crypto.NewSigKeys()
}
// NodeID gets the node ID.
func (c *Core) NodeID() *crypto.NodeID {
return crypto.GetNodeID(&c.boxPub)
@ -343,12 +331,6 @@ func (c *Core) Subnet() *net.IPNet {
return &net.IPNet{IP: subnet, Mask: net.CIDRMask(64, 128)}
}
// RouterAddresses returns the raw address and subnet types as used by the
// router
func (c *Core) RouterAddresses() (address.Address, address.Subnet) {
return c.router.addr, c.router.subnet
}
// NodeInfo gets the currently configured nodeinfo.
func (c *Core) MyNodeInfo() nodeinfoPayload {
return c.router.nodeinfo.getNodeInfo()
@ -473,6 +455,16 @@ func (c *Core) DisconnectPeer(port uint64) error {
return nil
}
// RouterAddress returns the raw address as used by the router.
func (c *Core) RouterAddress() address.Address {
return c.router.addr
}
// RouterSubnet returns the raw address as used by the router.
func (c *Core) RouterSubnet() address.Subnet {
return c.router.subnet
}
// GetAllowedEncryptionPublicKeys returns the public keys permitted for incoming
// peer connections.
func (c *Core) GetAllowedEncryptionPublicKeys() []string {