wboxserver

package
v0.0.0-...-d60fec0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main() int

Types

type ClientCfg

type ClientCfg struct {
	ServerIf string

	TunEndpoint4 net.IP
	TunEndpoint6 net.IP
	TunPort      int

	Addrs  []net.IPNet
	Routes []Route
}

type ClientOverrides

type ClientOverrides struct {
	TunPort      int    `toml:"tun-port"`
	TunEndpoint4 IPAddr `toml:"tun-endpoint4"`
	TunEndpoint6 IPAddr `toml:"tun-endpoint6"`

	If string `toml:"if"`

	Addrs  []IPAddr `toml:"addrs"`
	Routes []Route  `toml:"client_routes"`
}

type IPAddr

type IPAddr struct {
	net.IP
}

func (IPAddr) String

func (a IPAddr) String() string

func (*IPAddr) UnmarshalText

func (a *IPAddr) UnmarshalText(text []byte) error

type IPNet

type IPNet struct {
	net.IPNet
}

func (IPNet) String

func (a IPNet) String() string

func (*IPNet) UnmarshalText

func (a *IPNet) UnmarshalText(text []byte) error

type Route

type Route struct {
	Src  *IPNet `toml:"src"`
	Dest *IPNet `toml:"dest"`
}

type Server

type Server struct {
	MasterLink linkmgr.Link

	// Whether the ConfLink was created on startup and hence should be removed
	// afterwards.
	DelMasterLink bool

	Cfg SrvConfig

	// List of tunnel interfaces configured for clients.
	Tunnels []linkmgr.Link

	// List of newly created tunnel interface. These should be deleted on shutdown.
	NewTunnels []linkmgr.Link

	ClientCfgs  map[wgtypes.Key]ClientCfg
	SolictConns []*net.UDPConn
	// contains filtered or unexported fields
}

func (*Server) Close

func (s *Server) Close() error

func (*Server) GoServe

func (s *Server) GoServe() (stop func())

type SrvConfig

type SrvConfig struct {
	If   string `toml:"if"`
	PtMP bool   `toml:"ptmp"`

	Subnet4 IPNet `toml:"subnet4"`
	Subnet6 IPNet `toml:"subnet6"`

	PrivateKey wirebox.PeerKey `toml:"private-key"`
	Server4    IPAddr          `toml:"server4"`
	Server6    IPAddr          `toml:"server6"`

	TunEndpoint4 IPAddr `toml:"advertised-endpoint4"`
	TunEndpoint6 IPAddr `toml:"advertised-endpoint6"`

	PortLow  int `toml:"port-low"`
	PortHigh int `toml:"port-high"`

	// Network configuration for dynamically configured clients.
	Pool6        IPNet   `toml:"pool6"`
	Pool6Offset  uint64  `toml:"pool6-offset"`
	Pool4        IPNet   `toml:"pool4"`
	Pool4Offset  uint64  `toml:"pool4-offset"`
	ClientRoutes []Route `toml:"client-routes"`

	AuthFile string `toml:"authorized-keys"`

	// Overrides for static configuration.
	Clients map[string]ClientOverrides `toml:"clients"`
}

func (SrvConfig) Validate

func (c SrvConfig) Validate() error

Jump to

Keyboard shortcuts

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