Interface IIpFilter
- Namespace
- VpnHood.Core.Filtering.Abstractions
- Assembly
- VpnHood.Core.Filtering.Abstractions.dll
Defines a stage of a pipe of IP filters, which decides what happens to a flow by its protocol and destination.
public interface IIpFilter : IDisposable
- Inherited Members
Remarks
A stage may wrap the next one and combine its verdict with its own. The client sends a flow no filter objects to through the tunnel, an excluded one around it, and drops a blocked one; the server drops a blocked one.
Properties
IsEmpty
Gets a value indicating whether the pipe holds no rule, so it can only answer Default. Read it again when Changed occurs.
bool IsEmpty { get; }
Property Value
Methods
Process(IpProtocol, IpEndPointValue)
Decides what happens to a flow.
FilterAction Process(IpProtocol protocol, IpEndPointValue endPoint)
Parameters
protocolIpProtocolThe flow's protocol.
endPointIpEndPointValueThe flow's destination.
Returns
- FilterAction
The verdict; Default when the pipe has no objection.
Reconfigure(CancellationToken)
Tells the pipe that its configuration outside the program, such as a database's path, may have changed.
Task Reconfigure(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
Each stage passes it to its next one; a stage that owns such configuration reads it again and swaps its own parts, raising Changed if its verdicts may differ.
Events
Changed
Occurs when the pipe's verdicts may have changed, as when a stage swaps its rules. A stage raises its next stage's event as its own, so the event reaches the outermost stage; a stage whose verdicts never change never raises it.
event EventHandler? Changed