Documentation
¶
Index ¶
- func DHCPNetworkService(ip chan string, l log.StandardLogger, maxTime time.Duration, leasedir string, ...) node.NetworkService
- func Logger(l log.StandardLogger) func(cfg *Config) error
- func NetLinkBootstrap(b bool) func(cfg *Config) error
- func Register(p ...Option) ([]node.Option, error)
- func VPNNetworkService(p ...Option) node.NetworkService
- func WithInterface(i io.ReadWriteCloser) func(cfg *Config) error
- func WithInterfaceAddress(i string) func(cfg *Config) error
- func WithInterfaceMTU(i int) func(cfg *Config) error
- func WithInterfaceName(i string) func(cfg *Config) error
- func WithInterfaceType(d water.DeviceType) func(cfg *Config) error
- func WithLedgerAnnounceTime(t time.Duration) func(cfg *Config) error
- func WithMaxStreams(i int) func(cfg *Config) error
- func WithPacketMTU(i int) func(cfg *Config) error
- func WithRouterAddress(i string) func(cfg *Config) error
- type Config
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DHCPNetworkService ¶ added in v0.8.6
func DHCPNetworkService(ip chan string, l log.StandardLogger, maxTime time.Duration, leasedir string, address string) node.NetworkService
DHCPNetworkService returns a DHCP network service
func NetLinkBootstrap ¶
func Register ¶ added in v0.7.2
Start the node and the vpn. Returns an error in case of failure When starting the vpn, there is no need to start the node
func VPNNetworkService ¶ added in v0.8.6
func VPNNetworkService(p ...Option) node.NetworkService
func WithInterface ¶
func WithInterface(i io.ReadWriteCloser) func(cfg *Config) error
WithInterface sets a pre-created io.ReadWriteCloser as the tunnel interface, bypassing platform-specific interface creation entirely. When set, neither createInterface nor prepareInterface will be called. This is useful on platforms like Android where the TUN file descriptor is provided by the OS (e.g. via VpnService) and cannot be opened directly.
func WithInterfaceAddress ¶
func WithInterfaceMTU ¶
func WithInterfaceName ¶
func WithInterfaceType ¶
func WithInterfaceType(d water.DeviceType) func(cfg *Config) error
func WithMaxStreams ¶ added in v0.9.0
WithMaxStreams has no effect on the VPN, which keeps one stream per peer on the framed protocol and one per packet on the unframed one.
func WithPacketMTU ¶
func WithRouterAddress ¶
Types ¶
type Config ¶
type Config struct {
Interface io.ReadWriteCloser
InterfaceName string
InterfaceAddress string
RouterAddress string
InterfaceMTU int
MTU int
DeviceType water.DeviceType
LedgerAnnounceTime time.Duration
Logger log.StandardLogger
NetLinkBootstrap bool
// Frame timeout
Timeout time.Duration
Concurrency int
ChannelBufferSize int
MaxStreams int
// contains filtered or unexported fields
}
type Option ¶
LowProfile has no effect on the VPN, which keeps one stream per peer on the framed protocol whatever the profile.
func DHCP ¶ added in v0.8.1
func DHCP(l log.StandardLogger, maxTime time.Duration, leasedir string, address string) ([]node.Option, []Option)
DHCP returns a DHCP network service. It requires the Alive Service in order to determine available nodes. Nodes available are used to determine which needs an IP and when maxTime expires nodes are marked as offline and not considered.