Skip to content

A tiny .net standard library to help you find your friendly neighborhood endpoint in the sea of vEthernets and npcap loopback points

License

Notifications You must be signed in to change notification settings

tomzorz/WhoseEndpointIsItAnyway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WhoseEndpointIsItAnyway

Whose Endpoint Is It Anyway, the library where every result is helpful and the expectations against code without pop culture references do not matter mhm.. cough... what I meant to say was:

A tiny .net standard library to help you find your friendly neighborhood endpoint in the sea of vEthernets and npcap loopback points.

Usage

For most usecases you only need 2 lines.

using WhoseEndpointIsItAnyway;
// ...
var ep = NetworkHelper.GetFriendlyNeighborhoodEndpoint();

Console.WriteLine($"What you're looking for is: {ep.Unicast} {ep.Broadcast} {ep.IsWan}");

You can also pass a true to the method above to return the WAN address if the device has one.

Ranking system

You can also ask for a ranked (and sorted) list of all the operational endpoints.

var ranked = NetworkHelper.RankEndpoints();

Every returned endpoint has a Rank property that can range from 0 to 6 as follows:

  1. WAN
  2. probably what you want (usually home, small office)
  3. probably what you want (usually enterprise)
  4. might be what you want, but probably infrastructure for virtual machines or something similar
  5. most definitely infrastructure for virtual machines or something similar
  6. link local addresses
  7. something wrong, don't use it

About

A tiny .net standard library to help you find your friendly neighborhood endpoint in the sea of vEthernets and npcap loopback points

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages