config

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DumpSignalChan - channel to signal dump proxy conns info
	DumpSignalChan = make(chan struct{}, 5)
)

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 switched 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    proxyModels.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) DeletePeerHash

func (c *Config) DeletePeerHash(peerKey string)

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

func (*Config) DeletePeerTurnCfg added in v0.19.0

func (c *Config) DeletePeerTurnCfg(server, peerKey string)

Config.DeleteTurnCfg - deletes the turn config

func (*Config) DeleteRelayedPeers

func (c *Config) DeleteRelayedPeers()

Config.DeleteRelayedPeers - deletes relayed peer info

func (*Config) DeleteTurnCfg added in v0.19.0

func (c *Config) DeleteTurnCfg(server string)

Config.DeleteTurnCfg - sets the turn config

func (*Config) Dump added in v0.18.6

func (c *Config) Dump()

Config.Dump - dumps the proxy peer connections information

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) GetAllTurnCfg added in v0.19.0

func (c *Config) GetAllTurnCfg() map[string]models.TurnCfg

Config.GetAllTurnCfg - fetches all turn cfg

func (*Config) GetAllTurnPeersCfg added in v0.19.0

func (c *Config) GetAllTurnPeersCfg(server string) map[string]models.TurnPeerCfg

Config.GetAllTurnPeersCfg - fetches all peers using turn

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

func (c *Config) GetFwStatus() bool

Config.GetFwStatus - gets the firewall status

func (*Config) GetHostInfo

func (c *Config) GetHostInfo() proxyModels.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) 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) GetPeerTurnCfg added in v0.19.0

func (c *Config) GetPeerTurnCfg(server, peerKey string) (t models.TurnPeerCfg, ok bool)

Config.GetPeerTurnCfg - gets the peer turn cfg

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) proxyModels.Settings

Config.GetSettings - fetches host settings

func (*Config) GetTurnCfg added in v0.19.0

func (c *Config) GetTurnCfg(server string) (t models.TurnCfg, ok bool)

Config.GetTurnCfg - gets the turn config

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) 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 proxyModels.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) SetPeerTurnCfg added in v0.19.0

func (c *Config) SetPeerTurnCfg(server, peerKey string, t models.TurnPeerCfg)

Config.SetPeerTurnCfg - sets the peer turn cfg

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) SetTurnCfg added in v0.19.0

func (c *Config) SetTurnCfg(server string, t models.TurnCfg)

Config.SetTurnCfg - sets the turn config

func (*Config) ShouldUseProxy added in v0.18.3

func (c *Config) ShouldUseProxy() bool

Config.ShouldUseProxy - checks if proxy is running behind NAT

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) 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) UpdatePeerTurnAddr added in v0.19.0

func (c *Config) UpdatePeerTurnAddr(server, peerKey string, addr string)

func (*Config) UpdatePeerTurnCfg added in v0.19.0

func (c *Config) UpdatePeerTurnCfg(server, peerKey string, t models.TurnPeerCfg)

Config.UpdatePeerTurnCfg - updates the peer turn cfg

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