vpn

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: GPL-3.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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

	Timeout           time.Duration
	Concurrency       int
	ChannelBufferSize int
}

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

func DHCP added in v0.8.1

func DHCP(l log.StandardLogger, announcetime time.Duration, leasedir string, address string) ([]node.Option, []Option)

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