Skip to main content
.NETFramework4.5.1.NETStandard2.0

C# wrapper library for IpHlpApi

Published
Mar 28, 2022
4y ago
Total Downloads
16.1K
16,140

Install

dotnet add package H.IpHlpApi --version 0.9.5
ProductVersions
.NET Standard
netstandard2.0
Other
.NETFramework4.5.1

README

A set of C# libraries for VPN implementation

Language License Requirements Build Status

A set of C# libraries for VPN implementation

Features

Nuget

NuGet
NuGet
NuGet
NuGet
NuGet

Usage

H.Firewall

Forbids for 15 seconds everything except LAN/DNS/Localhost requests and Chrome applications.
NOTE: The application that runs this must have administrator rights.
Else you will get the following error: 0x8032000D. The call must be made from within an explicit transaction.

using var firewall = new HFirewall();

firewall.Start();
firewall.RunTransaction(ptr =>
{
    var (providerKey, subLayerKey) = firewall.RegisterKeys();
    firewall.PermitAppId(
        providerKey,
        subLayerKey,
        @"C:\Users\haven\AppData\Local\Google\Chrome\Application\chrome.exe",
        15);

    firewall.PermitLan(providerKey, subLayerKey, 12);
    firewall.PermitDns(providerKey, subLayerKey, 11, 10);
    firewall.PermitLocalhost(providerKey, subLayerKey, 1);

    // Block everything not allowed explicitly
    firewall.BlockAll(providerKey, subLayerKey, 0);
});

await Task.Delay(TimeSpan.FromSeconds(15));

Usage

Contacts

Changes from Previous Version

No structural changes between v0.9.4 and v0.9.5.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.