Documentation
¶
Index ¶
- Constants
- Variables
- func NewConnectionAlreadyClosed(peer string) error
- func NewConnectionClosedError(peer string) error
- func NewConnectionDisconnectedError(peer string) error
- func NewConnectionTimeoutError(peer string, timeout time.Duration) error
- type Conn
- func (conn *Conn) AgentVersionString() string
- func (conn *Conn) AllowedIP() netip.Addr
- func (conn *Conn) Close(signalToRemote bool)
- func (conn *Conn) ConnID() id.ConnID
- func (conn *Conn) GetKey() string
- func (conn *Conn) IsConnected() bool
- func (conn *Conn) OnRemoteAnswer(answer OfferAnswer)
- func (conn *Conn) OnRemoteCandidate(candidate ice.Candidate, haRoutes route.HAMap)
- func (conn *Conn) OnRemoteOffer(offer OfferAnswer)
- func (conn *Conn) Open(engineCtx context.Context) error
- func (conn *Conn) SetOnConnected(...)
- func (conn *Conn) SetOnDisconnected(handler func(remotePeer string))
- func (conn *Conn) WgConfig() WgConfig
- type ConnConfig
- type ConnStatus
- type ConnectionAlreadyClosedError
- type ConnectionClosedError
- type ConnectionDisconnectedError
- type ConnectionTimeoutError
- type EndpointUpdater
- type EventListener
- type EventQueue
- type EventSubscription
- type FullStatus
- type Handshaker
- type ICEConnInfo
- type ICESessionID
- type IceCredentials
- type Listener
- type LocalPeerState
- type ManagementState
- type NSGroupState
- type OfferAnswer
- type OfferListener
- type RelayConnInfo
- type ResolvedDomainInfo
- type RosenpassConfig
- type RosenpassState
- type RouterState
- type ServiceDependencies
- type SignalState
- type Signaler
- func (s *Signaler) Ready() bool
- func (s *Signaler) SignalAnswer(offer OfferAnswer, remoteKey string) error
- func (s *Signaler) SignalICECandidate(candidate ice.Candidate, remoteKey string) error
- func (s *Signaler) SignalIdle(remoteKey string) error
- func (s *Signaler) SignalOffer(offer OfferAnswer, remoteKey string) error
- type State
- type Status
- func (d *Status) AddLocalPeerStateRoute(route string, resourceId route.ResID)
- func (d *Status) AddPeer(peerPubKey string, fqdn string, ip string) error
- func (d *Status) AddPeerStateRoute(peer string, route string, resourceId route.ResID) error
- func (d *Status) AddResolvedIPLookupEntry(prefix netip.Prefix, resourceId route.ResID)
- func (d *Status) CheckRoutes(ip netip.Addr) ([]byte, bool)
- func (d *Status) CleanLocalPeerState()
- func (d *Status) CleanLocalPeerStateRoutes()
- func (d *Status) ClientStart()
- func (d *Status) ClientStop()
- func (d *Status) ClientTeardown()
- func (d *Status) DeleteResolvedDomainsStates(domain domain.Domain)
- func (d *Status) FinishPeerListModifications()
- func (d *Status) ForwardingRules() []firewall.ForwardRule
- func (d *Status) GetDNSStates() []NSGroupState
- func (d *Status) GetEventHistory() []*proto.SystemEvent
- func (d *Status) GetFullStatus() FullStatus
- func (d *Status) GetLazyConnection() bool
- func (d *Status) GetLocalPeerState() LocalPeerState
- func (d *Status) GetManagementState() ManagementState
- func (d *Status) GetPeer(peerPubKey string) (State, error)
- func (d *Status) GetRelayStates() []relay.ProbeResult
- func (d *Status) GetResolvedDomainsStates() map[domain.Domain]ResolvedDomainInfo
- func (d *Status) GetRosenpassState() RosenpassState
- func (d *Status) GetSignalState() SignalState
- func (d *Status) IsLoginRequired() bool
- func (d *Status) MarkManagementConnected()
- func (d *Status) MarkManagementDisconnected(err error)
- func (d *Status) MarkSignalConnected()
- func (d *Status) MarkSignalDisconnected(err error)
- func (d *Status) PeerByIP(ip string) (string, bool)
- func (d *Status) PeersStatus() (*configurer.Stats, error)
- func (d *Status) PublishEvent(severity proto.SystemEvent_Severity, category proto.SystemEvent_Category, ...)
- func (d *Status) RemoveConnectionListener()
- func (d *Status) RemoveLocalPeerStateRoute(route string)
- func (d *Status) RemovePeer(peerPubKey string) error
- func (d *Status) RemovePeerStateRoute(peer string, route string) error
- func (d *Status) RemoveResolvedIPLookupEntry(route string)
- func (d *Status) ReplaceOfflinePeers(replacement []State)
- func (d *Status) SetConnectionListener(listener Listener)
- func (d *Status) SetIngressGwMgr(ingressGwMgr *ingressgw.Manager)
- func (d *Status) SetRelayMgr(manager *relayClient.Manager)
- func (d *Status) SetWgIface(wgInterface WGIfaceStatus)
- func (d *Status) SubscribeToEvents() *EventSubscription
- func (d *Status) SubscribeToPeerStateChanges(ctx context.Context, peerID string) *StatusChangeSubscription
- func (d *Status) UnsubscribeFromEvents(sub *EventSubscription)
- func (d *Status) UnsubscribePeerStateChanges(subscription *StatusChangeSubscription)
- func (d *Status) UpdateDNSStates(dnsStates []NSGroupState)
- func (d *Status) UpdateLatency(pubKey string, latency time.Duration) error
- func (d *Status) UpdateLazyConnection(enabled bool)
- func (d *Status) UpdateLocalPeerState(localPeerState LocalPeerState)
- func (d *Status) UpdateManagementAddress(mgmAddress string)
- func (d *Status) UpdatePeerFQDN(peerPubKey, fqdn string) error
- func (d *Status) UpdatePeerICEState(receivedState State) error
- func (d *Status) UpdatePeerICEStateToDisconnected(receivedState State) error
- func (d *Status) UpdatePeerRelayedState(receivedState State) error
- func (d *Status) UpdatePeerRelayedStateToDisconnected(receivedState State) error
- func (d *Status) UpdatePeerState(receivedState State) error
- func (d *Status) UpdateRelayStates(relayResults []relay.ProbeResult)
- func (d *Status) UpdateResolvedDomainsStates(originalDomain domain.Domain, resolvedDomain domain.Domain, ...)
- func (d *Status) UpdateRosenpass(rosenpassEnabled, rosenpassPermissive bool)
- func (d *Status) UpdateSignalAddress(signalURL string)
- func (d *Status) UpdateWireGuardPeerState(pubKey string, wgStats configurer.WGStats) error
- type StatusChangeSubscription
- type WGIface
- type WGIfaceStatus
- type WGInterfaceStater
- type WGWatcher
- type WgConfig
- type WorkerICE
- func (w *WorkerICE) Close()
- func (w *WorkerICE) GetLocalUserCredentials() (frag string, pwd string)
- func (w *WorkerICE) InProgress() bool
- func (w *WorkerICE) OnNewOffer(remoteOfferAnswer *OfferAnswer)
- func (w *WorkerICE) OnRemoteCandidate(candidate ice.Candidate, haRoutes route.HAMap)
- func (w *WorkerICE) SessionID() ICESessionID
- type WorkerRelay
- func (w *WorkerRelay) CloseConn()
- func (w *WorkerRelay) DisableWgWatcher()
- func (w *WorkerRelay) EnableWgWatcher(ctx context.Context)
- func (w *WorkerRelay) IsRelayConnectionSupportedWithPeer() bool
- func (w *WorkerRelay) OnNewOffer(remoteOfferAnswer *OfferAnswer)
- func (w *WorkerRelay) RelayInstanceAddress() (string, error)
- func (w *WorkerRelay) RelayIsSupportedLocally() bool
Constants ¶
const (
EnvKeyNBForceRelay = "NB_FORCE_RELAY"
)
Variables ¶
var (
ErrSignalIsNotReady = errors.New("signal is not ready")
)
Functions ¶
func NewConnectionAlreadyClosed ¶
NewConnectionAlreadyClosed creates a new ConnectionAlreadyClosedError error
func NewConnectionClosedError ¶
NewConnectionClosedError creates a new ConnectionClosedError error
func NewConnectionDisconnectedError ¶
NewConnectionDisconnectedError creates a new ConnectionDisconnectedError error
Types ¶
type Conn ¶
func NewConn ¶
func NewConn(config ConnConfig, services ServiceDependencies) (*Conn, error)
NewConn creates a new not opened Conn to the remote peer. To establish a connection run Conn.Open
func (*Conn) AgentVersionString ¶ added in v0.45.0
func (*Conn) IsConnected ¶ added in v0.45.0
IsConnected returns true if the peer is connected
func (*Conn) OnRemoteAnswer ¶
func (conn *Conn) OnRemoteAnswer(answer OfferAnswer)
OnRemoteAnswer handles an offer from the remote peer and returns true if the message was accepted, false otherwise doesn't block, discards the message if connection wasn't ready
func (*Conn) OnRemoteCandidate ¶
OnRemoteCandidate Handles ICE connection Candidate provided by the remote peer.
func (*Conn) OnRemoteOffer ¶
func (conn *Conn) OnRemoteOffer(offer OfferAnswer)
func (*Conn) Open ¶
Open opens connection to the remote peer It will try to establish a connection using ICE and in parallel with relay. The higher priority connection type will be used.
func (*Conn) SetOnConnected ¶ added in v0.25.4
func (conn *Conn) SetOnConnected(handler func(remoteWireGuardKey string, remoteRosenpassPubKey []byte, wireGuardIP string, remoteRosenpassAddr string))
SetOnConnected sets a handler function to be triggered by Conn when a new connection to a remote peer established
func (*Conn) SetOnDisconnected ¶ added in v0.25.4
SetOnDisconnected sets a handler function to be triggered by Conn when a connection to a remote disconnected
type ConnConfig ¶
type ConnConfig struct { // Key is a public key of a remote peer Key string // LocalKey is a public key of a local peer LocalKey string AgentVersion string Timeout time.Duration WgConfig WgConfig LocalWgPort int RosenpassConfig RosenpassConfig // ICEConfig ICE protocol configuration ICEConfig icemaker.Config }
ConnConfig is a peer Connection configuration
type ConnStatus ¶
type ConnStatus int32
ConnStatus describe the status of a peer's connection
const ( // StatusIdle indicate the peer is in disconnected state StatusIdle ConnStatus = iota // StatusConnecting indicate the peer is in connecting state StatusConnecting // StatusConnected indicate the peer is in connected state StatusConnected )
func (ConnStatus) String ¶
func (s ConnStatus) String() string
type ConnectionAlreadyClosedError ¶
type ConnectionAlreadyClosedError struct {
// contains filtered or unexported fields
}
ConnectionAlreadyClosedError is an error indicating that a peer Conn has been already closed and the invocation of the Close() method has been performed over a closed connection
func (*ConnectionAlreadyClosedError) Error ¶
func (e *ConnectionAlreadyClosedError) Error() string
type ConnectionClosedError ¶
type ConnectionClosedError struct {
// contains filtered or unexported fields
}
ConnectionClosedError is an error indicating that a peer Conn has been forcefully closed
func (*ConnectionClosedError) Error ¶
func (e *ConnectionClosedError) Error() string
type ConnectionDisconnectedError ¶
type ConnectionDisconnectedError struct {
// contains filtered or unexported fields
}
ConnectionDisconnectedError is an error indicating that a peer Conn has ctx from the remote
func (*ConnectionDisconnectedError) Error ¶
func (e *ConnectionDisconnectedError) Error() string
type ConnectionTimeoutError ¶
type ConnectionTimeoutError struct {
// contains filtered or unexported fields
}
ConnectionTimeoutError is an error indicating that a peer Conn has been timed out
func (*ConnectionTimeoutError) Error ¶
func (e *ConnectionTimeoutError) Error() string
type EndpointUpdater ¶ added in v0.59.1
type EndpointUpdater struct {
// contains filtered or unexported fields
}
func NewEndpointUpdater ¶ added in v0.59.1
func NewEndpointUpdater(log *logrus.Entry, wgConfig WgConfig, initiator bool) *EndpointUpdater
func (*EndpointUpdater) ConfigureWGEndpoint ¶ added in v0.59.1
ConfigureWGEndpoint sets up the WireGuard endpoint configuration. The initiator immediately configures the endpoint, while the non-initiator waits for a fallback period before configuring to avoid handshake congestion.
func (*EndpointUpdater) RemoveWgPeer ¶ added in v0.59.1
func (e *EndpointUpdater) RemoveWgPeer() error
type EventListener ¶ added in v0.37.0
type EventListener interface {
OnEvent(event *proto.SystemEvent)
}
type EventQueue ¶ added in v0.37.0
type EventQueue struct {
// contains filtered or unexported fields
}
func NewEventQueue ¶ added in v0.37.0
func NewEventQueue(size int) *EventQueue
func (*EventQueue) Add ¶ added in v0.37.0
func (q *EventQueue) Add(event *proto.SystemEvent)
func (*EventQueue) GetAll ¶ added in v0.37.0
func (q *EventQueue) GetAll() []*proto.SystemEvent
type EventSubscription ¶ added in v0.37.0
type EventSubscription struct {
// contains filtered or unexported fields
}
func (*EventSubscription) Events ¶ added in v0.37.0
func (s *EventSubscription) Events() <-chan *proto.SystemEvent
type FullStatus ¶ added in v0.14.3
type FullStatus struct { Peers []State ManagementState ManagementState SignalState SignalState LocalPeerState LocalPeerState RosenpassState RosenpassState Relays []relay.ProbeResult NSGroupStates []NSGroupState NumOfForwardingRules int LazyConnectionEnabled bool }
FullStatus contains the full state held by the Status instance
type Handshaker ¶ added in v0.29.0
type Handshaker struct {
// contains filtered or unexported fields
}
func NewHandshaker ¶ added in v0.29.0
func NewHandshaker(log *log.Entry, config ConnConfig, signaler *Signaler, ice *WorkerICE, relay *WorkerRelay) *Handshaker
func (*Handshaker) AddOnNewOfferListener ¶ added in v0.29.0
func (h *Handshaker) AddOnNewOfferListener(offer func(remoteOfferAnswer *OfferAnswer))
func (*Handshaker) Listen ¶ added in v0.29.0
func (h *Handshaker) Listen(ctx context.Context)
func (*Handshaker) OnRemoteAnswer ¶ added in v0.29.0
func (h *Handshaker) OnRemoteAnswer(answer OfferAnswer)
OnRemoteAnswer handles an offer from the remote peer and returns true if the message was accepted, false otherwise doesn't block, discards the message if connection wasn't ready
func (*Handshaker) OnRemoteOffer ¶ added in v0.29.0
func (h *Handshaker) OnRemoteOffer(offer OfferAnswer)
OnRemoteOffer handles an offer from the remote peer and returns true if the message was accepted, false otherwise doesn't block, discards the message if connection wasn't ready
func (*Handshaker) SendOffer ¶ added in v0.29.0
func (h *Handshaker) SendOffer() error
type ICEConnInfo ¶ added in v0.29.0
type ICESessionID ¶ added in v0.55.0
type ICESessionID string
func ICESessionIDFromBytes ¶ added in v0.55.0
func ICESessionIDFromBytes(b []byte) (ICESessionID, error)
func NewICESessionID ¶ added in v0.55.0
func NewICESessionID() (ICESessionID, error)
NewICESessionID generates a new session ID for distinguishing sessions
func (ICESessionID) Bytes ¶ added in v0.55.0
func (id ICESessionID) Bytes() ([]byte, error)
Bytes returns the raw bytes of the session ID for protobuf serialization
func (ICESessionID) String ¶ added in v0.55.0
func (id ICESessionID) String() string
type IceCredentials ¶
IceCredentials ICE protocol credentials struct
type Listener ¶ added in v0.14.5
type Listener interface { OnConnected() OnDisconnected() OnConnecting() OnDisconnecting() OnAddressChanged(string, string) OnPeersListChanged(int) }
Listener is a callback type about the NetBird network connection state
type LocalPeerState ¶ added in v0.14.3
type LocalPeerState struct { IP string PubKey string KernelInterface bool FQDN string Routes map[string]struct{} }
LocalPeerState contains the latest state of the local peer
func (LocalPeerState) Clone ¶ added in v0.36.0
func (l LocalPeerState) Clone() LocalPeerState
Clone returns a copy of the LocalPeerState
type ManagementState ¶ added in v0.14.3
ManagementState contains the latest state of a management connection
type NSGroupState ¶ added in v0.26.3
type NSGroupState struct { ID string Servers []netip.AddrPort Domains []string Enabled bool Error error }
NSGroupState represents the status of a DNS server group, including associated domains, whether it's enabled, and the last error message encountered during probing.
type OfferAnswer ¶ added in v0.8.12
type OfferAnswer struct { IceCredentials IceCredentials // WgListenPort is a remote WireGuard listen port. // This field is used when establishing a direct WireGuard connection without any proxy. // We can set the remote peer's endpoint with this port. WgListenPort int // Version of NetBird Agent Version string // RosenpassPubKey is the Rosenpass public key of the remote peer when receiving this message // This value is the local Rosenpass server public key when sending the message RosenpassPubKey []byte // RosenpassAddr is the Rosenpass server address (IP:port) of the remote peer when receiving this message // This value is the local Rosenpass server address when sending the message RosenpassAddr string // relay server address RelaySrvAddress string // SessionID is the unique identifier of the session, used to discard old messages SessionID *ICESessionID }
OfferAnswer represents a session establishment offer or answer
func (*OfferAnswer) SessionIDString ¶ added in v0.55.0
func (oa *OfferAnswer) SessionIDString() string
type OfferListener ¶ added in v0.56.1
type OfferListener struct {
// contains filtered or unexported fields
}
func NewOfferListener ¶ added in v0.56.1
func NewOfferListener(fn callbackFunc) *OfferListener
func (*OfferListener) Notify ¶ added in v0.56.1
func (o *OfferListener) Notify(remoteOfferAnswer *OfferAnswer)
type RelayConnInfo ¶ added in v0.29.0
type RelayConnInfo struct {
// contains filtered or unexported fields
}
type ResolvedDomainInfo ¶ added in v0.35.0
type RosenpassConfig ¶ added in v0.41.3
type RosenpassState ¶ added in v0.26.1
RosenpassState contains the latest state of the Rosenpass configuration
type RouterState ¶ added in v0.47.0
type RouterState struct { Status ConnStatus Relayed bool Latency time.Duration }
RouterState status for router peers. This contains relevant fields for route manager
type ServiceDependencies ¶ added in v0.45.0
type ServiceDependencies struct { StatusRecorder *Status Signaler *Signaler IFaceDiscover stdnet.ExternalIFaceDiscover RelayManager *relayClient.Manager SrWatcher *guard.SRWatcher Semaphore *semaphoregroup.SemaphoreGroup PeerConnDispatcher *dispatcher.ConnectionDispatcher }
type SignalState ¶ added in v0.14.3
SignalState contains the latest state of a signal connection
type Signaler ¶ added in v0.29.0
type Signaler struct {
// contains filtered or unexported fields
}
func NewSignaler ¶ added in v0.29.0
func (*Signaler) SignalAnswer ¶ added in v0.29.0
func (s *Signaler) SignalAnswer(offer OfferAnswer, remoteKey string) error
func (*Signaler) SignalICECandidate ¶ added in v0.29.0
func (*Signaler) SignalIdle ¶ added in v0.50.0
func (*Signaler) SignalOffer ¶ added in v0.29.0
func (s *Signaler) SignalOffer(offer OfferAnswer, remoteKey string) error
type State ¶ added in v0.14.3
type State struct { Mux *sync.RWMutex IP string PubKey string FQDN string ConnStatus ConnStatus ConnStatusUpdate time.Time Relayed bool LocalIceCandidateType string RemoteIceCandidateType string LocalIceCandidateEndpoint string RemoteIceCandidateEndpoint string RelayServerAddress string LastWireguardHandshake time.Time BytesTx int64 BytesRx int64 Latency time.Duration RosenpassEnabled bool // contains filtered or unexported fields }
State contains the latest state of a peer
func (*State) DeleteRoute ¶ added in v0.27.3
DeleteRoute removes a route from the network amp
type Status ¶ added in v0.14.3
type Status struct {
// contains filtered or unexported fields
}
Status holds a state of peers, signal, management connections and relays
func NewRecorder ¶ added in v0.14.3
NewRecorder returns a new Status instance
func (*Status) AddLocalPeerStateRoute ¶ added in v0.39.0
AddLocalPeerStateRoute adds a route to the local peer state
func (*Status) AddPeerStateRoute ¶ added in v0.31.1
func (*Status) AddResolvedIPLookupEntry ¶ added in v0.40.0
AddResolvedIPLookupEntry adds a resolved IP lookup entry
func (*Status) CheckRoutes ¶ added in v0.39.0
CheckRoutes checks if the source and destination addresses are within the same route and returns the resource ID of the route that contains the addresses
func (*Status) CleanLocalPeerState ¶ added in v0.14.3
func (d *Status) CleanLocalPeerState()
CleanLocalPeerState cleans local peer status
func (*Status) CleanLocalPeerStateRoutes ¶ added in v0.39.0
func (d *Status) CleanLocalPeerStateRoutes()
CleanLocalPeerStateRoutes cleans all routes from the local peer state
func (*Status) ClientStart ¶ added in v0.14.5
func (d *Status) ClientStart()
ClientStart will notify all listeners about the new service state
func (*Status) ClientStop ¶ added in v0.14.5
func (d *Status) ClientStop()
ClientStop will notify all listeners about the new service state
func (*Status) ClientTeardown ¶ added in v0.14.6
func (d *Status) ClientTeardown()
ClientTeardown will notify all listeners about the service is under teardown
func (*Status) DeleteResolvedDomainsStates ¶ added in v0.28.0
func (*Status) FinishPeerListModifications ¶ added in v0.21.5
func (d *Status) FinishPeerListModifications()
FinishPeerListModifications this event invoke the notification
func (*Status) ForwardingRules ¶ added in v0.38.0
func (d *Status) ForwardingRules() []firewall.ForwardRule
func (*Status) GetDNSStates ¶ added in v0.26.3
func (d *Status) GetDNSStates() []NSGroupState
func (*Status) GetEventHistory ¶ added in v0.37.0
func (d *Status) GetEventHistory() []*proto.SystemEvent
GetEventHistory returns all events in the queue
func (*Status) GetFullStatus ¶ added in v0.14.3
func (d *Status) GetFullStatus() FullStatus
GetFullStatus gets full status
func (*Status) GetLazyConnection ¶ added in v0.45.0
func (*Status) GetLocalPeerState ¶ added in v0.26.3
func (d *Status) GetLocalPeerState() LocalPeerState
GetLocalPeerState returns the local peer state
func (*Status) GetManagementState ¶ added in v0.25.5
func (d *Status) GetManagementState() ManagementState
func (*Status) GetRelayStates ¶ added in v0.25.5
func (d *Status) GetRelayStates() []relay.ProbeResult
GetRelayStates returns the stun/turn/permanent relay states
func (*Status) GetResolvedDomainsStates ¶ added in v0.28.0
func (d *Status) GetResolvedDomainsStates() map[domain.Domain]ResolvedDomainInfo
func (*Status) GetRosenpassState ¶ added in v0.26.1
func (d *Status) GetRosenpassState() RosenpassState
func (*Status) GetSignalState ¶ added in v0.25.5
func (d *Status) GetSignalState() SignalState
func (*Status) IsLoginRequired ¶ added in v0.26.3
IsLoginRequired determines if a peer's login has expired.
func (*Status) MarkManagementConnected ¶ added in v0.14.3
func (d *Status) MarkManagementConnected()
MarkManagementConnected sets ManagementState to connected
func (*Status) MarkManagementDisconnected ¶ added in v0.14.3
MarkManagementDisconnected sets ManagementState to disconnected
func (*Status) MarkSignalConnected ¶ added in v0.14.3
func (d *Status) MarkSignalConnected()
MarkSignalConnected sets SignalState to connected
func (*Status) MarkSignalDisconnected ¶ added in v0.14.3
MarkSignalDisconnected sets SignalState to disconnected
func (*Status) PeersStatus ¶ added in v0.46.0
func (d *Status) PeersStatus() (*configurer.Stats, error)
func (*Status) PublishEvent ¶ added in v0.37.0
func (d *Status) PublishEvent( severity proto.SystemEvent_Severity, category proto.SystemEvent_Category, msg string, userMsg string, metadata map[string]string, )
PublishEvent adds an event to the queue and distributes it to all subscribers
func (*Status) RemoveConnectionListener ¶ added in v0.14.5
func (d *Status) RemoveConnectionListener()
RemoveConnectionListener remove the listener from the notifier
func (*Status) RemoveLocalPeerStateRoute ¶ added in v0.39.0
RemoveLocalPeerStateRoute removes a route from the local peer state
func (*Status) RemovePeer ¶ added in v0.14.3
RemovePeer removes peer from Daemon status map
func (*Status) RemovePeerStateRoute ¶ added in v0.31.1
func (*Status) RemoveResolvedIPLookupEntry ¶ added in v0.40.0
RemoveResolvedIPLookupEntry removes a resolved IP lookup entry
func (*Status) ReplaceOfflinePeers ¶ added in v0.14.3
ReplaceOfflinePeers replaces
func (*Status) SetConnectionListener ¶ added in v0.15.0
SetConnectionListener set a listener to the notifier
func (*Status) SetIngressGwMgr ¶ added in v0.38.0
func (*Status) SetRelayMgr ¶ added in v0.29.0
func (d *Status) SetRelayMgr(manager *relayClient.Manager)
func (*Status) SetWgIface ¶ added in v0.46.0
func (d *Status) SetWgIface(wgInterface WGIfaceStatus)
func (*Status) SubscribeToEvents ¶ added in v0.37.0
func (d *Status) SubscribeToEvents() *EventSubscription
SubscribeToEvents returns a new event subscription
func (*Status) SubscribeToPeerStateChanges ¶ added in v0.46.0
func (d *Status) SubscribeToPeerStateChanges(ctx context.Context, peerID string) *StatusChangeSubscription
func (*Status) UnsubscribeFromEvents ¶ added in v0.37.0
func (d *Status) UnsubscribeFromEvents(sub *EventSubscription)
UnsubscribeFromEvents removes an event subscription
func (*Status) UnsubscribePeerStateChanges ¶ added in v0.46.0
func (d *Status) UnsubscribePeerStateChanges(subscription *StatusChangeSubscription)
func (*Status) UpdateDNSStates ¶ added in v0.26.3
func (d *Status) UpdateDNSStates(dnsStates []NSGroupState)
func (*Status) UpdateLatency ¶ added in v0.26.4
func (*Status) UpdateLazyConnection ¶ added in v0.45.0
func (*Status) UpdateLocalPeerState ¶ added in v0.14.3
func (d *Status) UpdateLocalPeerState(localPeerState LocalPeerState)
UpdateLocalPeerState updates local peer status
func (*Status) UpdateManagementAddress ¶ added in v0.14.5
UpdateManagementAddress update the address of the management server
func (*Status) UpdatePeerFQDN ¶ added in v0.14.3
UpdatePeerFQDN update peer's state fqdn only
func (*Status) UpdatePeerICEState ¶ added in v0.29.0
func (*Status) UpdatePeerICEStateToDisconnected ¶ added in v0.29.0
func (*Status) UpdatePeerRelayedState ¶ added in v0.29.0
func (*Status) UpdatePeerRelayedStateToDisconnected ¶ added in v0.29.0
func (*Status) UpdatePeerState ¶ added in v0.14.3
UpdatePeerState updates peer status
func (*Status) UpdateRelayStates ¶ added in v0.25.5
func (d *Status) UpdateRelayStates(relayResults []relay.ProbeResult)
func (*Status) UpdateResolvedDomainsStates ¶ added in v0.28.0
func (*Status) UpdateRosenpass ¶ added in v0.26.1
UpdateRosenpass update the Rosenpass configuration
func (*Status) UpdateSignalAddress ¶ added in v0.14.5
UpdateSignalAddress update the address of the signal server
func (*Status) UpdateWireGuardPeerState ¶ added in v0.26.1
func (d *Status) UpdateWireGuardPeerState(pubKey string, wgStats configurer.WGStats) error
UpdateWireGuardPeerState updates the WireGuard bits of the peer state
type StatusChangeSubscription ¶ added in v0.46.0
type StatusChangeSubscription struct {
// contains filtered or unexported fields
}
func (*StatusChangeSubscription) Events ¶ added in v0.46.0
func (s *StatusChangeSubscription) Events() chan map[string]RouterState
type WGIfaceStatus ¶ added in v0.46.0
type WGIfaceStatus interface {
FullStats() (*configurer.Stats, error)
}
type WGInterfaceStater ¶ added in v0.36.6
type WGInterfaceStater interface {
GetStats() (map[string]configurer.WGStats, error)
}
type WGWatcher ¶ added in v0.36.6
type WGWatcher struct {
// contains filtered or unexported fields
}
func NewWGWatcher ¶ added in v0.36.6
func NewWGWatcher(log *log.Entry, wgIfaceStater WGInterfaceStater, peerKey string, stateDump *stateDump) *WGWatcher
func (*WGWatcher) DisableWgWatcher ¶ added in v0.36.6
func (w *WGWatcher) DisableWgWatcher()
DisableWgWatcher stops the WireGuard watcher and wait for the watcher to exit
func (*WGWatcher) EnableWgWatcher ¶ added in v0.36.6
EnableWgWatcher starts the WireGuard watcher. If it is already enabled, it will return immediately and do nothing.
type WorkerICE ¶ added in v0.29.0
type WorkerICE struct {
// contains filtered or unexported fields
}
func NewWorkerICE ¶ added in v0.29.0
func (*WorkerICE) GetLocalUserCredentials ¶ added in v0.29.0
func (*WorkerICE) InProgress ¶ added in v0.55.0
func (*WorkerICE) OnNewOffer ¶ added in v0.29.0
func (w *WorkerICE) OnNewOffer(remoteOfferAnswer *OfferAnswer)
func (*WorkerICE) OnRemoteCandidate ¶ added in v0.29.0
OnRemoteCandidate Handles ICE connection Candidate provided by the remote peer.
func (*WorkerICE) SessionID ¶ added in v0.55.0
func (w *WorkerICE) SessionID() ICESessionID
type WorkerRelay ¶ added in v0.29.0
type WorkerRelay struct {
// contains filtered or unexported fields
}
func NewWorkerRelay ¶ added in v0.29.0
func NewWorkerRelay(ctx context.Context, log *log.Entry, ctrl bool, config ConnConfig, conn *Conn, relayManager *relayClient.Manager, stateDump *stateDump) *WorkerRelay
func (*WorkerRelay) CloseConn ¶ added in v0.29.0
func (w *WorkerRelay) CloseConn()
func (*WorkerRelay) DisableWgWatcher ¶ added in v0.29.0
func (w *WorkerRelay) DisableWgWatcher()
func (*WorkerRelay) EnableWgWatcher ¶ added in v0.29.0
func (w *WorkerRelay) EnableWgWatcher(ctx context.Context)
func (*WorkerRelay) IsRelayConnectionSupportedWithPeer ¶ added in v0.29.0
func (w *WorkerRelay) IsRelayConnectionSupportedWithPeer() bool
func (*WorkerRelay) OnNewOffer ¶ added in v0.29.0
func (w *WorkerRelay) OnNewOffer(remoteOfferAnswer *OfferAnswer)
func (*WorkerRelay) RelayInstanceAddress ¶ added in v0.29.0
func (w *WorkerRelay) RelayInstanceAddress() (string, error)
func (*WorkerRelay) RelayIsSupportedLocally ¶ added in v0.29.0
func (w *WorkerRelay) RelayIsSupportedLocally() bool