diff --git a/src/IPMeow.Dhcp/AddressTable.cs b/src/IPMeow.Dhcp/AddressTable.cs new file mode 100644 index 0000000..04bc8a6 --- /dev/null +++ b/src/IPMeow.Dhcp/AddressTable.cs @@ -0,0 +1,16 @@ +using System.Net; + +namespace IPMeow.Dhcp; + +public class AddressTable +{ + public IPAddress GetFor(string host) + { + throw new NotImplementedException(); + } + + public IPAddress Next() + { + throw new NotImplementedException(); + } +} diff --git a/src/IPMeow.Dhcp/Program.cs b/src/IPMeow.Dhcp/Program.cs index 804dae1..0b99310 100644 --- a/src/IPMeow.Dhcp/Program.cs +++ b/src/IPMeow.Dhcp/Program.cs @@ -1,4 +1,3 @@ -using IPMeow.Dhcp.Server; using IPMeow.Dhcp.Server.Dhcp4; namespace IPMeow.Dhcp diff --git a/src/IPMeow.Dhcp/Server/Dhcp4/DhcpPacket.cs b/src/IPMeow.Dhcp/Server/Dhcp4/DhcpPacket.cs index bc784e9..539cfb6 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp4/DhcpPacket.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp4/DhcpPacket.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Net; -using System.Net.NetworkInformation; using System.Text; -using System.Threading.Tasks; using IPMeow.Lib; namespace IPMeow.Dhcp.Server.Dhcp4; diff --git a/src/IPMeow.Dhcp/Server/Dhcp4/DhcpServer.cs b/src/IPMeow.Dhcp/Server/Dhcp4/DhcpServer.cs index 7108bfa..a5adc83 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp4/DhcpServer.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp4/DhcpServer.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Net; using System.Net.Sockets; -using System.Threading.Tasks; namespace IPMeow.Dhcp.Server.Dhcp4; @@ -41,8 +37,6 @@ public class DhcpServer return; } - - Console.WriteLine("Solicitation: "); Console.WriteLine(packet.ToString()); } diff --git a/src/IPMeow.Dhcp/Server/AddressAssociation.cs b/src/IPMeow.Dhcp/Server/Dhcp6/AddressAssociation.cs similarity index 59% rename from src/IPMeow.Dhcp/Server/AddressAssociation.cs rename to src/IPMeow.Dhcp/Server/Dhcp6/AddressAssociation.cs index c02cedd..94addb9 100644 --- a/src/IPMeow.Dhcp/Server/AddressAssociation.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp6/AddressAssociation.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Net; -using System.Threading.Tasks; -namespace IPMeow.Dhcp.Server; +namespace IPMeow.Dhcp.Server.Dhcp6; public readonly struct AddressAssociation { diff --git a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpFields.cs b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpFields.cs index e54bce1..768aa7a 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpFields.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpFields.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - namespace IPMeow.Dhcp.Server.Dhcp6; public enum DhcpMessageType : byte diff --git a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpOption.cs b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpOption.cs index 7186bd6..01cc8bb 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpOption.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpOption.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Net; using System.Text; -using System.Threading.Tasks; namespace IPMeow.Dhcp.Server.Dhcp6; diff --git a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpPacket.cs b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpPacket.cs index c924610..f15a17c 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpPacket.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpPacket.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using IPMeow.Lib; namespace IPMeow.Dhcp.Server.Dhcp6; diff --git a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpServer.cs b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpServer.cs index 6342343..a83039e 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpServer.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpServer.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Net; using System.Net.Sockets; -using System.Threading.Tasks; -using IPMeow.Dhcp.Server.Dhcp4; namespace IPMeow.Dhcp.Server.Dhcp6; diff --git a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpStatus.cs b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpStatus.cs index 037bd90..7f86dea 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp6/DhcpStatus.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp6/DhcpStatus.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace IPMeow.Dhcp.Server.Dhcp6; @@ -30,7 +26,7 @@ public struct DhcpStatus public ushort Code { get; set; } public string? Message { get; set; } - public byte[] Serialize() + public readonly byte[] Serialize() { byte[] buf = new byte[2 + Message?.Length ?? 0]; diff --git a/src/IPMeow.Dhcp/Server/Dhcp6/Duid.cs b/src/IPMeow.Dhcp/Server/Dhcp6/Duid.cs index a540cfd..29ffb0d 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp6/Duid.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp6/Duid.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - namespace IPMeow.Dhcp.Server.Dhcp6; public enum DuidType : short diff --git a/src/IPMeow.Dhcp/Server/Dhcp6/IdentityAssociation.cs b/src/IPMeow.Dhcp/Server/Dhcp6/IdentityAssociation.cs index 1b9c58f..0881910 100644 --- a/src/IPMeow.Dhcp/Server/Dhcp6/IdentityAssociation.cs +++ b/src/IPMeow.Dhcp/Server/Dhcp6/IdentityAssociation.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - namespace IPMeow.Dhcp.Server.Dhcp6; -public struct IdentityAssociation +public readonly struct IdentityAssociation { public int IAId { get; } public int TimeToRefresh { get; } diff --git a/src/IPMeow.Dhcp/Server/Dhcp6/StateMonitor.cs b/src/IPMeow.Dhcp/Server/Dhcp6/StateMonitor.cs new file mode 100644 index 0000000..d17b92a --- /dev/null +++ b/src/IPMeow.Dhcp/Server/Dhcp6/StateMonitor.cs @@ -0,0 +1,9 @@ +namespace IPMeow.Dhcp.Server.Dhcp6; + +public class StateMonitor +{ + public bool IsAssigned(int xid) + { + throw new NotImplementedException(); + } +} diff --git a/src/IPMeow.Dhcp/Server/IDhcpServer.cs b/src/IPMeow.Dhcp/Server/IDhcpServer.cs index 84545ea..b509d35 100644 --- a/src/IPMeow.Dhcp/Server/IDhcpServer.cs +++ b/src/IPMeow.Dhcp/Server/IDhcpServer.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - namespace IPMeow.Dhcp.Server; public interface IDhcpServer diff --git a/src/IPMeow.Server/Provider/IAddressProvider.cs b/src/IPMeow.Server/Provider/IAddressProvider.cs index dcdd321..7c04ba3 100644 --- a/src/IPMeow.Server/Provider/IAddressProvider.cs +++ b/src/IPMeow.Server/Provider/IAddressProvider.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - namespace IPMeow.Server.Provider; public interface IAddressProvider diff --git a/src/IPMeow.Viewer/Program.cs b/src/IPMeow.Viewer/Program.cs index e952024..f4d6572 100644 --- a/src/IPMeow.Viewer/Program.cs +++ b/src/IPMeow.Viewer/Program.cs @@ -1,6 +1,3 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; - var builder = WebApplication.CreateBuilder(args); builder.Services.AddRazorPages();