Skip to content

Repository files navigation

NetworkPrimitives

Lightweight library for working with various networking objects

Basic usage

varsubnet=Ipv4Subnet.Parse("10.0.0.0/29");Console.WriteLine($" Network Address: {subnet.NetworkAddress}");// 10.0.0.0Console.WriteLine($" First Usable: {subnet.FirstUsable}");// 10.0.0.1Console.WriteLine($" Last Usable: {subnet.LastUsable}");// 10.0.0.6Console.WriteLine($"Broadcast Address: {subnet.BroadcastAddress}");// 10.0.0.7Console.WriteLine($" Total Hosts: {subnet.TotalHosts}");// 8Console.WriteLine($" Usable Hosts: {subnet.UsableHosts}");// 6foreach(varaddressinsubnet.GetUsableAddresses()){Console.WriteLine(address);}

Download

The core NetworkPrimitives package contains the types themselves.

NetworkPrimitives (Nuget)NetworkPrimitives (Nuget)

The package NetworkPrimitives.JsonConverters contains converters for System.Text.Json

NetworkPrimitives.JsonConverters (Nuget)NetworkPrimitives.JsonConverters (Nuget)

Performance

Overall goals are:

  1. Fast parsing times
  2. Low (preferably zero) allocations
  3. Overall efficiency

Detailed usage

About

No description, website, or topics provided.

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages