LocalNetworkProvider

Reads attached IPv4 networks off the machine’s own NICs. Deliberately conservative: a network only survives if the link is up, the address is a real unicast LAN address, and the prefix is no wider than the floor - so "scan the whole network" cannot silently become a million probes.

public sealed class LocalNetworkProvider : ILocalNetworkProvider

1. Constructors

1.1. LocalNetworkProvider()

Initializes a new instance of the LocalNetworkProvider class using MinimumLocalPrefixLength as the prefix floor.

public LocalNetworkProvider()

1.2. LocalNetworkProvider(int)

Initializes a new instance of the LocalNetworkProvider class.

public LocalNetworkProvider(int minimumPrefixLength)
Table 1. Parameters
Name Type Description

minimumPrefixLength

int

Networks with a shorter (wider) prefix are skipped.

2. Methods

2.1. GetLocalNetworks()

Every attached IPv4 network worth scanning, de-duplicated by CIDR. Loopback, tunnel, link-local and down interfaces are excluded, as are networks wider than the configured prefix floor - a scan of a /8 is a mistake, not a plan.

public IReadOnlyList<LocalNetwork> GetLocalNetworks()

Returns: IReadOnlyList<LocalNetwork>