Table of Contents

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

sniEventId EventId

The 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

IReadOnlyList<DomainObservation>

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

domainName string

The name, or null or empty, which records nothing.

action FilterAction

The verdict the name got.

protocol DomainObservationProtocol

The protocol of the flow in which the name was seen.

destinationEndPoint IpEndPointValue?

The flow's destination, which is only logged.