Class DomainObserver
- Namespace
- VpnHood.Core.Filtering.DomainFiltering.Observation
- Assembly
- VpnHood.Core.Filtering.DomainFiltering.dll
Keeps a record of the domain names the client's domain filter has seen, one entry a name.
public class DomainObserver
- Inheritance
-
DomainObserver
- Inherited Members
Remarks
Names are compared ignoring case. Its methods are safe to call from several threads, and update the entries under the observer's own lock; the entries Observations returns are the record's own, so a caller's reads of them are not synchronized with those updates.
Constructors
DomainObserver(EventId)
Keeps a record of the domain names the client's domain filter has seen, one entry a name.
public DomainObserver(EventId sniEventId)
Parameters
sniEventIdEventIdThe event ID under which each name recorded is logged.
Remarks
Names are compared ignoring case. Its methods are safe to call from several threads, and update the entries under the observer's own lock; the entries Observations returns are the record's own, so a caller's reads of them are not synchronized with those updates.
Properties
Observations
Gets a copy of the list of the names recorded. The entries in it are the record's own, which later sightings update.
public IReadOnlyList<DomainObservation> Observations { get; }
Property Value
Methods
Clear()
Removes every name from the record.
public void Clear()
Track(string?, FilterAction, DomainObservationProtocol, IpEndPointValue?)
Records a sighting of a domain name: a new entry, or the name's entry counted once more, with the verdict and protocol of this sighting.
public void Track(string? domainName, FilterAction action, DomainObservationProtocol protocol, IpEndPointValue? destinationEndPoint = null)
Parameters
domainNamestringThe name, or null or empty, which records nothing.
actionFilterActionThe verdict the name got.
protocolDomainObservationProtocolThe protocol of the flow in which the name was seen.
destinationEndPointIpEndPointValue?The flow's destination, which is only logged.