Lightweight library for working with various networking objects
var subnet = Ipv4Subnet.Parse("10.0.0.0/29");
Console.WriteLine($" Network Address: {subnet.NetworkAddress}"); // 10.0.0.0
Console.WriteLine($" First Usable: {subnet.FirstUsable}"); // 10.0.0.1
Console.WriteLine($" Last Usable: {subnet.LastUsable}"); // 10.0.0.6
Console.WriteLine($"Broadcast Address: {subnet.BroadcastAddress}"); // 10.0.0.7
Console.WriteLine($" Total Hosts: {subnet.TotalHosts}"); // 8
Console.WriteLine($" Usable Hosts: {subnet.UsableHosts}"); // 6
foreach (var address in subnet.GetUsableAddresses())
{
Console.WriteLine(address);
}
The core NetworkPrimitives
package contains the types themselves.
The package NetworkPrimitives.JsonConverters
contains converters for System.Text.Json
Overall goals are:
- Fast parsing times
- Low (preferably zero) allocations
- Overall efficiency