Documentation
¶
Index ¶
- func InitializeCfg()
- func NatAutoSwitchDone() bool
- func Reset()
- func SetNatAutoSwitch()
- type Config
- func (c *Config) CheckIfPeerExists(peerPubKey string) bool
- func (c *Config) CheckIfRelayedNodeExists(peerHash string) bool
- func (c *Config) DeletePeerHash(peerKey string)
- func (c *Config) DeleteRelayedPeers()
- func (c *Config) GetAllPeersIDsAndAddrs() map[string]nm_models.HostPeerMap
- func (c *Config) GetAllProxyPeers() models.PeerConnMap
- func (c *Config) GetDeviceKeyHash() string
- func (c *Config) GetDeviceKeys() (privateKey wgtypes.Key, publicKey wgtypes.Key)
- func (c *Config) GetDevicePubKey() (publicKey wgtypes.Key)
- func (c *Config) GetFwStatus() bool
- func (c *Config) GetHostInfo() proxy.HostInfo
- func (c *Config) GetIface() *wg.WGIface
- func (c *Config) GetIfaceDevice() wgtypes.Device
- func (c *Config) GetInterfaceListenPort() (port int)
- func (c *Config) GetMetricsCollectionStatus() bool
- func (c *Config) GetNetworkPeerMap() models.PeerConnMap
- func (c *Config) GetPeer(peerPubKey string) (models.Conn, bool)
- func (c *Config) GetPeerInfoByHash(peerKeyHash string) (models.RemotePeer, bool)
- func (c *Config) GetPeersIDsAndAddrs(server, peerKey string) (map[string]nm_models.IDandAddr, bool)
- func (c *Config) GetRelayedPeer(srcKeyHash, dstPeerHash string) (models.RemotePeer, bool)
- func (c *Config) GetRelayedStatus(server string) bool
- func (c *Config) GetServerConn() *net.UDPConn
- func (c *Config) GetSettings(server string) proxy.Settings
- func (c *Config) IsEgressGw(server string) bool
- func (c *Config) IsGlobalRelay() bool
- func (c *Config) IsIfaceNil() bool
- func (c *Config) IsIngressGw(server string) bool
- func (c *Config) IsProxyRunning() bool
- func (c *Config) IsRelay(server string) bool
- func (c *Config) RemovePeer(peerPubKey string)
- func (c *Config) ResetPeer(peerKey string)
- func (c *Config) SavePeer(connConf *models.Conn)
- func (c *Config) SavePeerByHash(peerInfo *models.RemotePeer)
- func (c *Config) SaveRelayedPeer(relayedNodePubKey string, peer *models.RemotePeer)
- func (c *Config) SetEgressGwStatus(server string, value bool)
- func (c *Config) SetFwCloseFunc(fwFlush func())
- func (c *Config) SetFwStatus(s bool)
- func (c *Config) SetHostInfo(hostInfo proxy.HostInfo)
- func (c *Config) SetIface(iface *wg.WGIface)
- func (c *Config) SetIngressGwStatus(server string, value bool)
- func (c *Config) SetMetricsThreadCtx(cancelFunc context.CancelFunc)
- func (c *Config) SetPeersIDsAndAddrs(server string, peers nm_models.HostPeerMap)
- func (c *Config) SetRelayStatus(server string, value bool)
- func (c *Config) SetRelayedStatus(server string, value bool)
- func (c *Config) SetServerConn(conn *net.UDPConn)
- func (c *Config) ShouldUseProxy() bool
- func (c *Config) StopFw()
- func (c *Config) StopMetricsCollectionThread()
- func (c *Config) UpdateListenPortForRelayedPeer(port int, srcKeyHash, dstPeerHash string)
- func (c *Config) UpdatePeer(updatedPeer *models.Conn)
- func (c *Config) UpdatePeerNetwork(peerPubKey, network string, setting models.Settings)
- func (c *Config) UpdateProxyPeers(peers *models.PeerConnMap)
- func (c *Config) UpdateSettings(server string, settings proxy.Settings)
- func (c *Config) UpdateWgIface(wgIface *wg.WGIface)
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 switched on already for devices behind NAT
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 (*Config) CheckIfPeerExists ¶
Config.CheckIfPeerExists - checks if peer exists in the config
func (*Config) CheckIfRelayedNodeExists ¶
Config.CheckIfRelayedNodeExists - checks if relayed node exists
func (*Config) DeletePeerHash ¶
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 ¶
Config.GetDeviceKeyHash - gets the interface pubkey hash
func (*Config) GetDeviceKeys ¶
Config.GetDeviceKeys - fetches interface private,pubkey
func (*Config) GetDevicePubKey ¶
Config.GetDevicePubKey - fetches device public key
func (*Config) GetFwStatus ¶
Config.GetFwStatus - gets the firewall status
func (*Config) GetHostInfo ¶
Config.GetHostInfo - gets the host info
func (*Config) GetIfaceDevice ¶
Config.GetGetIfaceDeviceIface - gets the wg device value
func (*Config) GetInterfaceListenPort ¶
Config.GetInterfaceListenPort - fetches interface listen port from config
func (*Config) GetMetricsCollectionStatus ¶
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) GetPeerInfoByHash ¶
func (c *Config) GetPeerInfoByHash(peerKeyHash string) (models.RemotePeer, bool)
Config.GetPeerInfoByHash - fetches the peerInfo by its pubKey hash
func (*Config) GetPeersIDsAndAddrs ¶
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 ¶
Config.GetRelayedStatus - gets relayed status
func (*Config) GetServerConn ¶
Config.GetServerConn - fetches the server connection
func (*Config) GetSettings ¶
Config.GetSettings - fetches host settings
func (*Config) IsEgressGw ¶
Config.IsEgressGw - checks if egressGW by server
func (*Config) IsGlobalRelay ¶
Config.IsGlobalRelay - checks if host relay globally
func (*Config) IsIfaceNil ¶
Config.IsIfaceNil - checks if ifconfig is nil in the memory config
func (*Config) IsIngressGw ¶
Config.IsIngressGw - checks if ingressGW by server
func (*Config) IsProxyRunning ¶
Config.IsProxyRunning - checks if proxy is running
func (*Config) RemovePeer ¶
Config.RemovePeer - removes the peer from the network peer 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 ¶
Config.SetEgressGwStatus - sets egressGW status
func (*Config) SetFwCloseFunc ¶
func (c *Config) SetFwCloseFunc(fwFlush func())
Config.SetFwCloseFunc - sets the firewall flush func
func (*Config) SetFwStatus ¶
Config.SetFwStatus - sets the firewall status
func (*Config) SetHostInfo ¶
Config.SetHostInfo - sets host info
func (*Config) SetIngressGwStatus ¶
Config.SetIngressGwStatus - sets ingressGW status
func (*Config) SetMetricsThreadCtx ¶
func (c *Config) SetMetricsThreadCtx(cancelFunc context.CancelFunc)
Config.SetMetricsThreadCtx - sets the metrics thread ctx
func (*Config) SetPeersIDsAndAddrs ¶
func (c *Config) SetPeersIDsAndAddrs(server string, peers nm_models.HostPeerMap)
Config.SetPeersIDsAndAddrs - sets the peers in the config
func (*Config) SetRelayStatus ¶
Config.SetRelayStatus - sets host relay status
func (*Config) SetRelayedStatus ¶
Config.SetRelayedStatus - sets relayed status
func (*Config) SetServerConn ¶
Config.SetServerConn - sets server connection
func (*Config) ShouldUseProxy ¶ added in v0.18.3
Config.ShouldUseProxy - checks if proxy is running behind NAT
func (*Config) StopMetricsCollectionThread ¶
func (c *Config) StopMetricsCollectionThread()
Config.StopMetricsCollectionThread - stops the metrics thread // only when host proxy is disabled
func (*Config) UpdateListenPortForRelayedPeer ¶
Config.UpdateListenPortForRelayedPeer - updates listen port for the relayed peer
func (*Config) UpdatePeer ¶
Config.UpdatePeer - updates peer by network
func (*Config) UpdatePeerNetwork ¶
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 ¶
Config.UpdateSettings - updates network settings
func (*Config) UpdateWgIface ¶
Config.UpdateWgIface - updates iface config in memory