This commit is contained in:
femsci 2023-12-11 16:55:35 +01:00
parent 6c5e9b8716
commit 42d12eb437
Signed by: femsci
GPG key ID: 08F7911F0E650C67
5 changed files with 7 additions and 8 deletions

View file

@ -62,8 +62,7 @@ public class Dhcp6Server : IDhcpServer, IDisposable
MacAddress = null
};
_addrProvider.GetAddress(ctx);
await _addrProvider.GetAddress(ctx);
//TODO
}

View file

@ -12,9 +12,9 @@ public class DecoupledIPAddressProvider : IAddressProvider<AddressRequestContext
private readonly HttpClient _http;
public IPAddress GetAddress(AddressRequestContext ctx)
public async Task<IPAddress> GetAddress(AddressRequestContext ctx)
{
_http.GetAsync($"/api/request/{(ctx.IsV6 ? "6" : "4")}/free");
var resp = await _http.GetAsync($"/api/request/{(ctx.IsV6 ? "6" : "4")}/free");
throw new NotImplementedException();
}
}

View file

@ -2,9 +2,9 @@ using System.Net;
namespace IPMeow.Lib.Address;
public abstract class Network
public abstract class Prefix
{
public abstract bool IsInNetwork(IPAddress addr);
public abstract bool IsSubnetOf(Network n);
public abstract bool IsSubnetOf(Prefix n);
};

View file

@ -4,5 +4,5 @@ namespace IPMeow.Lib.Request;
public interface IAddressProvider<T> where T : AddressRequestContext
{
public IPAddress GetAddress(T ctx);
public Task<IPAddress> GetAddress(T ctx);
}

View file

@ -9,5 +9,5 @@ public class Network
[Key]
public required string Name { get; set; }
public virtual ICollection<DnsServer> DnsServers { get; set; }
public virtual ICollection<Address.Network> Networks { get; set; }
public virtual ICollection<Prefix> Networks { get; set; }
}