router

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPeer

func AddPeer(public wgtypes.Key, username string) (string, error)

AddPeer the device to wireguard

func Deauthenticate

func Deauthenticate(address string) error

func GetAllAuthorised

func GetAllAuthorised() ([]string, error)

func GetBPFHash added in v1.4.1

func GetBPFHash() string

func GetPeerRealIp

func GetPeerRealIp(address string) (string, error)

func GetRules

func GetRules() (map[string]FirewallRules, error)

func GetTimeStamp

func GetTimeStamp() uint64

func IsAuthed

func IsAuthed(address string) bool

func Pin added in v1.4.1

func Pin() error

func RefreshConfiguration

func RefreshConfiguration() []error

func RemovePeer

func RemovePeer(internalAddress string) error

Remove a wireguard peer from database and wg device

func ServerDetails

func ServerDetails() (key wgtypes.Key, port int, err error)

func SetAuthorized

func SetAuthorized(internalAddress string) error

func Setup

func Setup(error chan<- error, iptables bool) (err error)

func TearDown

func TearDown()

func Unpin added in v1.4.1

func Unpin() error

Types

type FirewallRules added in v1.4.1

type FirewallRules struct {
	IsAuthorized        bool
	LastPacketTimestamp uint64
	Expiry              uint64
	MFA                 []string
	Public              []string
}

type IfAddrmsg added in v1.4.1

type IfAddrmsg struct {
	Family    uint8
	Prefixlen uint8
	Flags     uint8
	Scope     uint8
	Index     uint32
}

func (*IfAddrmsg) Serialize added in v1.4.1

func (msg *IfAddrmsg) Serialize() []byte

type IfInfomsg added in v1.4.1

type IfInfomsg struct {
	Family uint8

	Type   uint16
	Index  int32
	Flags  uint32
	Change uint32
	// contains filtered or unexported fields
}

func (*IfInfomsg) Serialize added in v1.4.1

func (msg *IfInfomsg) Serialize() []byte

type Key

type Key struct {

	// first member must be a prefix u32 wide
	// rest can are arbitrary
	Prefixlen uint32
	IP        net.IP
}

func (Key) Bytes

func (l Key) Bytes() []byte

func (Key) String

func (l Key) String() string

func (*Key) Unpack

func (l *Key) Unpack(b []byte) error

Jump to

Keyboard shortcuts

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