wire

package
v0.0.0-...-9ed9f2e Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevelSilent = iota
	LogLevelError
	LogLevelVerbose
)

Variables

This section is empty.

Functions

func FromArgs

func FromArgs(args ...interface{}) (values map[string]string)

func GetPath

func GetPath(pa string) string

func GetValue

func GetValue(args map[string]string, keys ...string) (value string, ok bool)

func ParsePair

func ParsePair(s string) (key, value string)

func ParseSocks

func ParseSocks(metadata ...string) (string, error)

func Split

func Split(s, sep string) (elements []string)

func Trim

func Trim(s string) string

func TrimSpace

func TrimSpace(s string) string

Types

type DeviceConfig

type DeviceConfig struct {
	SecretKey  string        `json:"PrivateKey"`
	Endpoint   []netip.Addr  `json:"Address"`
	Peers      []*PeerConfig `json:"Peers"`
	DNS        []netip.Addr  `json:"DNS"`
	MTU        int           `json:"MTU"`
	ListenPort int           `json:"ListenPort"`
}

func FromBytes

func FromBytes(b []byte) (*DeviceConfig, error)

func FromFile

func FromFile(file string) (*DeviceConfig, error)

func ParseInterface

func ParseInterface(metadata ...string) (device *DeviceConfig, err error)

func (*DeviceConfig) DeviceAddr

func (d *DeviceConfig) DeviceAddr() []netip.Addr

func (*DeviceConfig) IPCRequest

func (d *DeviceConfig) IPCRequest() string

func (*DeviceConfig) Up

func (d *DeviceConfig) Up(level int) (*VirtualTun, error)

type DeviceSetting

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

type PeerConfig

type PeerConfig struct {
	PublicKey    string         `json:"PublicKey"`
	PreSharedKey string         `json:"PreSharedKey"`
	Endpoint     string         `json:"Endpoint "`
	KeepAlive    int            `json:"PersistentKeepalive"`
	AllowedIPs   []netip.Prefix `json:"AllowedIPs"`
}

func ParsePeers

func ParsePeers(metadata ...string) (peer *PeerConfig, err error)

type VirtualTun

type VirtualTun struct {
	Tnet *netstack.Net
}

Jump to

Keyboard shortcuts

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