Compare commits
2 commits
6c5e9b8716
...
1109fed17e
Author | SHA1 | Date | |
---|---|---|---|
1109fed17e | |||
42d12eb437 |
6 changed files with 8 additions and 9 deletions
|
@ -62,8 +62,7 @@ public class Dhcp6Server : IDhcpServer, IDisposable
|
||||||
MacAddress = null
|
MacAddress = null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
await _addrProvider.GetAddress(ctx);
|
||||||
_addrProvider.GetAddress(ctx);
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,9 @@ public class DecoupledIPAddressProvider : IAddressProvider<AddressRequestContext
|
||||||
|
|
||||||
private readonly HttpClient _http;
|
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();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Net.Sockets;
|
||||||
|
|
||||||
namespace IPMeow.Lib.Address;
|
namespace IPMeow.Lib.Address;
|
||||||
|
|
||||||
public class IPv6Address
|
public readonly struct IPv6Address
|
||||||
{
|
{
|
||||||
public IPv6Address(byte[] address)
|
public IPv6Address(byte[] address)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,9 +2,9 @@ using System.Net;
|
||||||
|
|
||||||
namespace IPMeow.Lib.Address;
|
namespace IPMeow.Lib.Address;
|
||||||
|
|
||||||
public abstract class Network
|
public abstract class Prefix
|
||||||
{
|
{
|
||||||
public abstract bool IsInNetwork(IPAddress addr);
|
public abstract bool IsInNetwork(IPAddress addr);
|
||||||
|
|
||||||
public abstract bool IsSubnetOf(Network n);
|
public abstract bool IsSubnetOf(Prefix n);
|
||||||
};
|
};
|
|
@ -4,5 +4,5 @@ namespace IPMeow.Lib.Request;
|
||||||
|
|
||||||
public interface IAddressProvider<T> where T : AddressRequestContext
|
public interface IAddressProvider<T> where T : AddressRequestContext
|
||||||
{
|
{
|
||||||
public IPAddress GetAddress(T ctx);
|
public Task<IPAddress> GetAddress(T ctx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,5 +9,5 @@ public class Network
|
||||||
[Key]
|
[Key]
|
||||||
public required string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
public virtual ICollection<DnsServer> DnsServers { get; set; }
|
public virtual ICollection<DnsServer> DnsServers { get; set; }
|
||||||
public virtual ICollection<Address.Network> Networks { get; set; }
|
public virtual ICollection<Prefix> Networks { get; set; }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue