Compare commits
No commits in common. "1109fed17edd1f23e8086b41cd7b9baaf089a407" and "6c5e9b87161f87af12c2955047cf7f7274a5845f" have entirely different histories.
1109fed17e
...
6c5e9b8716
6 changed files with 9 additions and 8 deletions
|
@ -62,7 +62,8 @@ public class Dhcp6Server : IDhcpServer, IDisposable
|
|||
MacAddress = null
|
||||
};
|
||||
|
||||
await _addrProvider.GetAddress(ctx);
|
||||
|
||||
_addrProvider.GetAddress(ctx);
|
||||
|
||||
//TODO
|
||||
}
|
||||
|
|
|
@ -12,9 +12,9 @@ public class DecoupledIPAddressProvider : IAddressProvider<AddressRequestContext
|
|||
|
||||
private readonly HttpClient _http;
|
||||
|
||||
public async Task<IPAddress> GetAddress(AddressRequestContext ctx)
|
||||
public IPAddress GetAddress(AddressRequestContext ctx)
|
||||
{
|
||||
var resp = await _http.GetAsync($"/api/request/{(ctx.IsV6 ? "6" : "4")}/free");
|
||||
_http.GetAsync($"/api/request/{(ctx.IsV6 ? "6" : "4")}/free");
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Net.Sockets;
|
|||
|
||||
namespace IPMeow.Lib.Address;
|
||||
|
||||
public readonly struct IPv6Address
|
||||
public class IPv6Address
|
||||
{
|
||||
public IPv6Address(byte[] address)
|
||||
{
|
||||
|
|
|
@ -2,9 +2,9 @@ using System.Net;
|
|||
|
||||
namespace IPMeow.Lib.Address;
|
||||
|
||||
public abstract class Prefix
|
||||
public abstract class Network
|
||||
{
|
||||
public abstract bool IsInNetwork(IPAddress addr);
|
||||
|
||||
public abstract bool IsSubnetOf(Prefix n);
|
||||
public abstract bool IsSubnetOf(Network n);
|
||||
};
|
|
@ -4,5 +4,5 @@ namespace IPMeow.Lib.Request;
|
|||
|
||||
public interface IAddressProvider<T> where T : AddressRequestContext
|
||||
{
|
||||
public Task<IPAddress> GetAddress(T ctx);
|
||||
public IPAddress GetAddress(T ctx);
|
||||
}
|
||||
|
|
|
@ -9,5 +9,5 @@ public class Network
|
|||
[Key]
|
||||
public required string Name { get; set; }
|
||||
public virtual ICollection<DnsServer> DnsServers { get; set; }
|
||||
public virtual ICollection<Prefix> Networks { get; set; }
|
||||
public virtual ICollection<Address.Network> Networks { get; set; }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue