mobile

package
v0.0.0-...-de4c1f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2022 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateConfigJSON

func GenerateConfigJSON() []byte

GenerateConfigJSON generates mobile-friendly configuration in JSON format

func GetVersion

func GetVersion() string

Types

type MobileLogger

type MobileLogger struct {
}

func (MobileLogger) Write

func (nsl MobileLogger) Write(p []byte) (n int, err error)

type Yggdrasil

type Yggdrasil struct {
	// contains filtered or unexported fields
}

Yggdrasil mobile package is meant to "plug the gap" for mobile support, as Gomobile will not create headers for Swift/Obj-C etc if they have complex (non-native) types. Therefore for iOS we will expose some nice simple functions. Note that in the case of iOS we handle reading/writing to/from TUN in Swift therefore we use the "dummy" TUN interface instead.

func (*Yggdrasil) GetAddressString

func (m *Yggdrasil) GetAddressString() string

GetAddressString gets the node's IPv6 address

func (*Yggdrasil) GetCoordsString

func (m *Yggdrasil) GetCoordsString() string

GetCoordsString gets the node's coordinates

func (*Yggdrasil) GetDHTJSON

func (m *Yggdrasil) GetDHTJSON() (result string)

func (*Yggdrasil) GetMTU

func (m *Yggdrasil) GetMTU() int

GetMTU returns the configured node MTU. This must be called AFTER Start.

func (*Yggdrasil) GetPeersJSON

func (m *Yggdrasil) GetPeersJSON() (result string)

func (*Yggdrasil) GetPublicKeyString

func (m *Yggdrasil) GetPublicKeyString() string

GetPublicKeyString gets the node's public key in hex form

func (*Yggdrasil) GetSubnetString

func (m *Yggdrasil) GetSubnetString() string

GetSubnetString gets the node's IPv6 subnet in CIDR notation

func (*Yggdrasil) Recv

func (m *Yggdrasil) Recv() ([]byte, error)

Recv waits for and reads a packet coming from Yggdrasil. It will be a fully formed IPv6 packet

func (*Yggdrasil) Send

func (m *Yggdrasil) Send(p []byte) error

Send sends a packet to Yggdrasil. It should be a fully formed IPv6 packet

func (*Yggdrasil) StartAutoconfigure

func (m *Yggdrasil) StartAutoconfigure() error

StartAutoconfigure starts a node with a randomly generated config

func (*Yggdrasil) StartJSON

func (m *Yggdrasil) StartJSON(configjson []byte) error

StartJSON starts a node with the given JSON config. You can get JSON config (rather than HJSON) by using the GenerateConfigJSON() function

func (*Yggdrasil) Stop

func (m *Yggdrasil) Stop() error

Stop the mobile Yggdrasil instance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL