using RackPeek.Domain.Resources.Services.Networking; namespace RackPeek.Domain.Discovery; /// /// One responding host, as the sweep saw it. records only /// what liveness probing happened to touch — port probing stops at the first answer, /// so this is evidence the host is alive, never a port inventory. /// public sealed record NetworkHostFact( string Ip, string? Mac, string? Hostname, bool AnsweredPing, IReadOnlyList OpenPorts); /// How to sweep. The defaults suit a quiet home /24. public sealed record NetworkScanOptions { public required Cidr Cidr { get; init; } /// TCP ports probed to catch hosts that do not answer ping. public IReadOnlyList Ports { get; init; } = WellKnownPorts.Defaults; public TimeSpan PingTimeout { get; init; } = TimeSpan.FromMilliseconds(300); public TimeSpan PortTimeout { get; init; } = TimeSpan.FromMilliseconds(500); /// Cap on each alive host's reverse-DNS lookup — resolvers that silently /// drop PTR queries would otherwise stall the whole result on the OS default. public TimeSpan DnsTimeout { get; init; } = TimeSpan.FromSeconds(2); /// How many hosts are probed at once. public int Concurrency { get; init; } = 128; }