config

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeCfg

func InitializeCfg()

InitializeCfg - intializes all the variables and sets defaults

func NatAutoSwitchDone added in v0.18.1

func NatAutoSwitchDone() bool

NatAutoSwitchDone - check if nat automatically swithed on already for devices behind NAT

func Reset

func Reset()

Reset - resets Config // to be called only when proxy is shutting down

func SetNatAutoSwitch added in v0.18.1

func SetNatAutoSwitch()

SetNatAutoSwitch - set NAT auto switch to true

Types

type Config

type Config struct {
	HostInfo    proxy.HostInfo
	ProxyStatus bool
	// contains filtered or unexported fields
}

Config - struct for proxy config

func GetCfg

func GetCfg() *Config

GetCfg - fethes Config

func (*Config) CheckIfPeerExists

func (c *Config) CheckIfPeerExists(peerPubKey string) bool

Config.CheckIfPeerExists - checks if peer exists in the config

func (*Config) CheckIfRelayedNodeExists

func (c *Config) CheckIfRelayedNodeExists(peerHash string) bool

Config.CheckIfRelayedNodeExists - checks if relayed node exists

func (*Config) DeleteExtClientInfo

func (c *Config) DeleteExtClientInfo(udpAddr *net.UDPAddr)

Config.DeleteExtClientInfo - deletes the ext. client info from the config

func (*Config) DeleteExtWaitCfg

func (c *Config) DeleteExtWaitCfg(peerKey string)

Config.DeleteExtWaitCfg - deletes ext. wait cfg

func (*Config) DeleteNoProxyPeer

func (c *Config) DeleteNoProxyPeer(peerIP string)

Config.DeleteNoProxyPeer - deletes no proxy peers from config

func (*Config) DeletePeerHash

func (c *Config) DeletePeerHash(peerKey string)

Config.DeletePeerHash - deletes peer by its pubkey hash from config

func (*Config) DeleteRelayedPeers

func (c *Config) DeleteRelayedPeers()

Config.DeleteRelayedPeers - deletes relayed peer info

func (*Config) GetAllPeersIDsAndAddrs

func (c *Config) GetAllPeersIDsAndAddrs() map[string]nm_models.HostPeerMap

Config.GetAllPeersIDsAndAddrs - get all peers

func (*Config) GetAllProxyPeers

func (c *Config) GetAllProxyPeers() models.PeerConnMap

Config.GetAllProxyPeers - fetches all peers in the network

func (*Config) GetDeviceKeyHash

func (c *Config) GetDeviceKeyHash() string

Config.GetDeviceKeyHash - gets the interface pubkey hash

func (*Config) GetDeviceKeys

func (c *Config) GetDeviceKeys() (privateKey wgtypes.Key, publicKey wgtypes.Key)

Config.GetDeviceKeys - fetches interface private,pubkey

func (*Config) GetDevicePubKey

func (c *Config) GetDevicePubKey() (publicKey wgtypes.Key)

Config.GetDevicePubKey - fetches device public key

func (*Config) GetExtClientInfo

func (c *Config) GetExtClientInfo(udpAddr *net.UDPAddr) (models.RemotePeer, bool)

Config.GetExtClientInfo - fetches ext. client from the config by it's endpoint

func (*Config) GetExtClientWaitCfg

func (c *Config) GetExtClientWaitCfg(peerKey string) (models.RemotePeer, bool)

Config.GetExtClientWaitCfg - fetches the ext. info from wait config

func (*Config) GetFwStatus

func (c *Config) GetFwStatus() bool

Config.GetFwStatus - gets the firewall status

func (*Config) GetHostInfo

func (c *Config) GetHostInfo() proxy.HostInfo

Config.GetHostInfo - gets the host info

func (*Config) GetIface

func (c *Config) GetIface() *wg.WGIface

Config.GetIface - gets the interface config

func (*Config) GetIfaceDevice

func (c *Config) GetIfaceDevice() wgtypes.Device

Config.GetGetIfaceDeviceIface - gets the wg device value

func (*Config) GetInterfaceListenPort

func (c *Config) GetInterfaceListenPort() (port int)

Config.GetInterfaceListenPort - fetches interface listen port from config

func (*Config) GetMetricsCollectionStatus

func (c *Config) GetMetricsCollectionStatus() bool

Config.GetMetricsCollectionStatus - fetchs metrics collection status when proxy is disabled for host

func (*Config) GetNetworkPeerMap

func (c *Config) GetNetworkPeerMap() models.PeerConnMap

Config.GetNetworkPeerMap - fetches all peers in the network

func (*Config) GetNoProxyPeer

func (c *Config) GetNoProxyPeer(peerIp net.IP) (models.Conn, bool)

Config.GetNoProxyPeer - fetches no proxy peer

func (*Config) GetNoProxyPeers

func (c *Config) GetNoProxyPeers() models.PeerConnMap

Config.GetNoProxyPeers - fetches peers not using proxy

func (*Config) GetPeer

func (c *Config) GetPeer(peerPubKey string) (models.Conn, bool)

Config.GetPeer - fetches the peer by network and pubkey

func (*Config) GetPeerInfoByHash

func (c *Config) GetPeerInfoByHash(peerKeyHash string) (models.RemotePeer, bool)

Config.GetPeerInfoByHash - fetches the peerInfo by its pubKey hash

func (*Config) GetPeersIDsAndAddrs

func (c *Config) GetPeersIDsAndAddrs(server, peerKey string) (map[string]nm_models.IDandAddr, bool)

Config.GetPeersIDsAndAddrs - get peer conf

func (*Config) GetRelayedPeer

func (c *Config) GetRelayedPeer(srcKeyHash, dstPeerHash string) (models.RemotePeer, bool)

Config.GetRelayedPeer - fectches the relayed peer

func (*Config) GetRelayedStatus

func (c *Config) GetRelayedStatus(server string) bool

Config.GetRelayedStatus - gets relayed status

func (*Config) GetServerConn

func (c *Config) GetServerConn() *net.UDPConn

Config.GetServerConn - fetches the server connection

func (*Config) GetSettings

func (c *Config) GetSettings(server string) proxy.Settings

Config.GetSettings - fetches host settings

func (*Config) IsBehindNAT

func (c *Config) IsBehindNAT() bool

Config.IsBehindNAT - checks if proxy is running behind NAT

func (*Config) IsEgressGw

func (c *Config) IsEgressGw(server string) bool

Config.IsEgressGw - checks if egressGW by server

func (*Config) IsGlobalRelay

func (c *Config) IsGlobalRelay() bool

Config.IsGlobalRelay - checks if host relay globally

func (*Config) IsIfaceNil

func (c *Config) IsIfaceNil() bool

Config.IsIfaceNil - checks if ifconfig is nil in the memory config

func (*Config) IsIngressGw

func (c *Config) IsIngressGw(server string) bool

Config.IsIngressGw - checks if ingressGW by server

func (*Config) IsProxyRunning

func (c *Config) IsProxyRunning() bool

Config.IsProxyRunning - checks if proxy is running

func (*Config) IsRelay

func (c *Config) IsRelay(server string) bool

Config.IsRelay - fetches relay status value of the host

func (*Config) RemovePeer

func (c *Config) RemovePeer(peerPubKey string)

Config.RemovePeer - removes the peer from the network peer config

func (*Config) ResetPeer

func (c *Config) ResetPeer(peerKey string)

Config.ResetPeer - resets the peer connection to proxy

func (*Config) SaveExtClientInfo

func (c *Config) SaveExtClientInfo(peerInfo *models.RemotePeer)

Config.SaveExtClientInfo - saves the ext. client info to config

func (*Config) SaveExtclientWaitCfg

func (c *Config) SaveExtclientWaitCfg(extPeer *models.RemotePeer)

Config.SaveExtclientWaitCfg - saves extclient wait cfg

func (*Config) SaveNoProxyPeer

func (c *Config) SaveNoProxyPeer(peer *models.Conn)

Config.SaveNoProxyPeer - adds non proxy peer to config

func (*Config) SavePeer

func (c *Config) SavePeer(connConf *models.Conn)

Config.SavePeer - saves peer to the config

func (*Config) SavePeerByHash

func (c *Config) SavePeerByHash(peerInfo *models.RemotePeer)

Config.SavePeerByHash - saves peer by its publicKey hash to the config

func (*Config) SaveRelayedPeer

func (c *Config) SaveRelayedPeer(relayedNodePubKey string, peer *models.RemotePeer)

Config.SaveRelayedPeer - saves relayed peer to config

func (*Config) SetEgressGwStatus

func (c *Config) SetEgressGwStatus(server string, value bool)

Config.SetEgressGwStatus - sets egressGW status

func (*Config) SetFwCloseFunc

func (c *Config) SetFwCloseFunc(fwFlush func())

Config.SetFwCloseFunc - sets the firewall flush func

func (*Config) SetFwStatus

func (c *Config) SetFwStatus(s bool)

Config.SetFwStatus - sets the firewall status

func (*Config) SetHostInfo

func (c *Config) SetHostInfo(hostInfo proxy.HostInfo)

Config.SetHostInfo - sets host info

func (*Config) SetIface

func (c *Config) SetIface(iface *wg.WGIface)

Config.SetIface - sets the iface value in the config

func (*Config) SetIngressGwStatus

func (c *Config) SetIngressGwStatus(server string, value bool)

Config.SetIngressGwStatus - sets ingressGW status

func (*Config) SetMetricsThreadCtx

func (c *Config) SetMetricsThreadCtx(cancelFunc context.CancelFunc)

Config.SetMetricsThreadCtx - sets the metrics thread ctx

func (*Config) SetNATStatus

func (c *Config) SetNATStatus()

Config.SetBehindNATStatus - sets NAT status for the device

func (*Config) SetPeersIDsAndAddrs

func (c *Config) SetPeersIDsAndAddrs(server string, peers nm_models.HostPeerMap)

Config.SetPeersIDsAndAddrs - sets the peers in the config

func (*Config) SetRelayStatus

func (c *Config) SetRelayStatus(server string, value bool)

Config.SetRelayStatus - sets host relay status

func (*Config) SetRelayedStatus

func (c *Config) SetRelayedStatus(server string, value bool)

Config.SetRelayedStatus - sets relayed status

func (*Config) SetServerConn

func (c *Config) SetServerConn(conn *net.UDPConn)

Config.SetServerConn - sets server connection

func (*Config) StopFw

func (c *Config) StopFw()

Config.StopFw - flushes all the firewall rules

func (*Config) StopMetricsCollectionThread

func (c *Config) StopMetricsCollectionThread()

Config.StopMetricsCollectionThread - stops the metrics thread // only when host proxy is disabled

func (*Config) UpdateListenPortForRelayedPeer

func (c *Config) UpdateListenPortForRelayedPeer(port int, srcKeyHash, dstPeerHash string)

Config.UpdateListenPortForRelayedPeer - updates listen port for the relayed peer

func (*Config) UpdateNoProxyPeers

func (c *Config) UpdateNoProxyPeers(peers *models.PeerConnMap)

Config.UpdateNoProxyPeers - updates no proxy peers in the config

func (*Config) UpdatePeer

func (c *Config) UpdatePeer(updatedPeer *models.Conn)

Config.UpdatePeer - updates peer by network

func (*Config) UpdatePeerNetwork

func (c *Config) UpdatePeerNetwork(peerPubKey, network string, setting models.Settings)

Config.UpdatePeerNetwork - updates the peer network settings map

func (*Config) UpdateProxyPeers

func (c *Config) UpdateProxyPeers(peers *models.PeerConnMap)

Config.UpdateProxyPeers - updates all peers in the network

func (*Config) UpdateSettings

func (c *Config) UpdateSettings(server string, settings proxy.Settings)

Config.UpdateSettings - updates network settings

func (*Config) UpdateWgIface

func (c *Config) UpdateWgIface(wgIface *wg.WGIface)

Config.UpdateWgIface - updates iface config in memory

Jump to

Keyboard shortcuts

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