feature: Bootstrapper secure server discovery

This commit is contained in:
Gary Sharp
2026-01-22 15:26:23 +11:00
parent 71fa53bfb2
commit e1f1973520
40 changed files with 2094 additions and 460 deletions
+24
View File
@@ -0,0 +1,24 @@
using System;
using System.Net;
namespace Disco.Services.Interop.DNS
{
public class ADnsRecord : DnsRecord
{
public IPAddress Address { get; }
public ADnsRecord(string name, TimeSpan timeToLive, uint address)
: base(name, DnsRecordType.A, timeToLive, UIntToIPAddress(address).ToString())
{
Address = UIntToIPAddress(address);
}
private static IPAddress UIntToIPAddress(uint address)
{
byte[] bytes = BitConverter.GetBytes(address);
if (BitConverter.IsLittleEndian)
Array.Reverse(bytes);
return new IPAddress(bytes);
}
}
}