vpn

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

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 Logger

func Logger(l log.StandardLogger) func(cfg *Config) error

func NetLinkBootstrap

func NetLinkBootstrap(b bool) func(cfg *Config) error

func Register added in v0.7.2

func Register(p ...Option) ([]node.Option, error)

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 *water.Interface) func(cfg *Config) error

func WithInterfaceAddress

func WithInterfaceAddress(i string) func(cfg *Config) error

func WithInterfaceMTU

func WithInterfaceMTU(i int) func(cfg *Config) error

func WithInterfaceName

func WithInterfaceName(i string) func(cfg *Config) error

func WithInterfaceType

func WithInterfaceType(d water.DeviceType) func(cfg *Config) error

func WithLedgerAnnounceTime

func WithLedgerAnnounceTime(t time.Duration) func(cfg *Config) error

func WithMaxStreams added in v0.9.0

func WithMaxStreams(i int) func(cfg *Config) error

func WithPacketMTU

func WithPacketMTU(i int) func(cfg *Config) error

func WithRouterAddress

func WithRouterAddress(i string) func(cfg *Config) error

Types

type Config

type Config struct {
	Interface        *water.Interface
	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
}

func (*Config) Apply

func (cfg *Config) Apply(opts ...Option) error

Apply applies the given options to the config, returning the first error encountered (if any).

type Option

type Option func(cfg *Config) error
var LowProfile Option = func(cfg *Config) error {
	cfg.lowProfile = true

	return nil
}

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.

func WithChannelBufferSize

func WithChannelBufferSize(i int) Option

func WithConcurrency

func WithConcurrency(i int) Option

func WithTimeout

func WithTimeout(s string) Option

Jump to

Keyboard shortcuts

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