ScanTargetExpander

Expands single addresses, CIDR blocks (10.0.0.0/24) and inclusive ranges (10.0.0.5-10.0.0.9) into concrete IPv4 addresses. Counts before it materializes, so a mistyped prefix fails fast instead of allocating millions of addresses.

public sealed class ScanTargetExpander : IScanTargetExpander

1. Constructors

1.1. ScanTargetExpander()

Initializes a new instance of the ScanTargetExpander class using MaxTargets as the ceiling.

public ScanTargetExpander()

1.2. ScanTargetExpander(int)

Initializes a new instance of the ScanTargetExpander class.

public ScanTargetExpander(int maxTargets)
Table 1. Parameters
Name Type Description

maxTargets

int

Refuse to expand beyond this many addresses.

2. Methods

2.1. Expand(IReadOnlyCollection<string>)

Expand every specifier - single address, CIDR block, inclusive range - into addresses, de-duplicated and in ascending order.

public IReadOnlyList<IP> Expand(IReadOnlyCollection<string> targets)
Table 2. Parameters
Name Type Description

targets

IReadOnlyCollection<string>

Raw specifiers.

Returns: IReadOnlyList<IP>