mobile

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: LGPL-3.0 Imports: 15 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 ConfigSummary

type ConfigSummary struct {
	PublicKey   string
	IPv6Address string
	IPv6Subnet  string
}

func SummaryForConfig

func SummaryForConfig(b []byte) *ConfigSummary

type MobileLogger

type MobileLogger struct {
}

func (MobileLogger) Write

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

type Uqda

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

Uqda 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 (*Uqda) GetAddressString

func (m *Uqda) GetAddressString() string

GetAddressString gets the node's IPv6 address

func (*Uqda) GetMTU

func (m *Uqda) GetMTU() int

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

func (*Uqda) GetPathsJSON

func (m *Uqda) GetPathsJSON() (result string)

func (*Uqda) GetPeersJSON

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

func (*Uqda) GetPublicKeyString

func (m *Uqda) GetPublicKeyString() string

GetPublicKeyString gets the node's public key in hex form

func (*Uqda) GetRoutingEntries

func (m *Uqda) GetRoutingEntries() int

GetRoutingEntries gets the number of entries in the routing table

func (*Uqda) GetSubnetString

func (m *Uqda) GetSubnetString() string

GetSubnetString gets the node's IPv6 subnet in CIDR notation

func (*Uqda) GetTreeJSON

func (m *Uqda) GetTreeJSON() (result string)

func (*Uqda) Recv

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

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

func (*Uqda) RecvBuffer

func (m *Uqda) RecvBuffer(buf []byte) (int, error)

Recv waits for and reads a packet coming from Uqda to given buffer, returning size of packet

func (*Uqda) RetryPeersNow

func (m *Uqda) RetryPeersNow()

Retry resets the peer connection timer and tries to dial them immediately.

func (*Uqda) Send

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

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

func (*Uqda) SendBuffer

func (m *Uqda) SendBuffer(p []byte, length int) error

Send sends a packet from given buffer to Uqda. From first byte up to length.

func (*Uqda) StartAutoconfigure

func (m *Uqda) StartAutoconfigure() error

StartAutoconfigure starts a node with a randomly generated config

func (*Uqda) StartJSON

func (m *Uqda) 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 (*Uqda) Stop

func (m *Uqda) Stop() error

Stop the mobile Uqda instance

Jump to

Keyboard shortcuts

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