diff --git a/Program.cs b/Program.cs index 726d286..c1d6df6 100644 --- a/Program.cs +++ b/Program.cs @@ -16,6 +16,9 @@ using System.Net.Sockets; using Newtonsoft.Json; using ln.dhcp; using ln.types.net; +using ln.http; +using ln.http.resources; +using skyspot.http; namespace skyspot { @@ -23,13 +26,9 @@ namespace skyspot { public static void Main(string[] args) { - new IPv4(0); - DHCPServer dhcpServer = new DHCPServer(); - dhcpServer.EnsureInterface(IPv4.Parse("10.119.1.1")); - dhcpServer.EnsureInterface(IPv4.Parse("10.119.0.52")); - - dhcpServer.EnsurePool("default", IPv4.Parse("10.119.1.50"), IPv4.Parse("10.119.1.99")); + dhcpServer.EnsureInterface(IPv4.Parse("10.118.200.2")); + dhcpServer.EnsurePool("default", IPv4.Parse("10.118.200.50"), IPv4.Parse("10.118.200.99")); foreach (DHCPServerInterface serverInterface in dhcpServer.Interfaces) { @@ -42,12 +41,17 @@ namespace skyspot dhcpServer.Start(); - //RadiusServer radiusServer = new RadiusServer(new IPEndPoint(IPAddress.Any, 1812)); - //radiusServer.MessageReceived = (s, m) => Logging.Log("JO"); + HTTPServer httpServer = new HTTPServer(); + httpServer.AddEndpoint(new IPEndPoint(IPAddress.Any, 80)); - //Thread.Sleep(10000); + ResourceApplication app = new ResourceApplication(); + httpServer.DefaultApplication = app; + + DHCP httpDHCP = new DHCP(app.RootResource, dhcpServer); + + + httpServer.Start(); - //radiusServer.Close(); } } } diff --git a/bin/Debug/ln.dhcp.dll b/bin/Debug/ln.dhcp.dll index 6a6e7e6..3cb0a67 100644 Binary files a/bin/Debug/ln.dhcp.dll and b/bin/Debug/ln.dhcp.dll differ diff --git a/bin/Debug/ln.dhcp.pdb b/bin/Debug/ln.dhcp.pdb index 709bf92..cda7738 100644 Binary files a/bin/Debug/ln.dhcp.pdb and b/bin/Debug/ln.dhcp.pdb differ diff --git a/bin/Debug/ln.http.dll b/bin/Debug/ln.http.dll index ef75d96..4e6aec2 100644 Binary files a/bin/Debug/ln.http.dll and b/bin/Debug/ln.http.dll differ diff --git a/bin/Debug/ln.http.objects.dll b/bin/Debug/ln.http.objects.dll index a6674c5..518d5b8 100644 Binary files a/bin/Debug/ln.http.objects.dll and b/bin/Debug/ln.http.objects.dll differ diff --git a/bin/Debug/ln.radius.dll b/bin/Debug/ln.radius.dll index 4be6de8..db59d5b 100644 Binary files a/bin/Debug/ln.radius.dll and b/bin/Debug/ln.radius.dll differ diff --git a/bin/Debug/ln.templates.dll b/bin/Debug/ln.templates.dll index 255ea73..334afa3 100644 Binary files a/bin/Debug/ln.templates.dll and b/bin/Debug/ln.templates.dll differ diff --git a/bin/Debug/ln.types.dll b/bin/Debug/ln.types.dll index edf75ba..650415c 100644 Binary files a/bin/Debug/ln.types.dll and b/bin/Debug/ln.types.dll differ diff --git a/bin/Debug/ln.types.pdb b/bin/Debug/ln.types.pdb index a98fec4..4eb6153 100644 Binary files a/bin/Debug/ln.types.pdb and b/bin/Debug/ln.types.pdb differ diff --git a/bin/Debug/sharp.logging.dll b/bin/Debug/sharp.logging.dll index 0f2a906..3b6b9a5 100644 Binary files a/bin/Debug/sharp.logging.dll and b/bin/Debug/sharp.logging.dll differ diff --git a/bin/Debug/skyspot.exe b/bin/Debug/skyspot.exe index 05add11..4140030 100644 Binary files a/bin/Debug/skyspot.exe and b/bin/Debug/skyspot.exe differ diff --git a/bin/Debug/skyspot.pdb b/bin/Debug/skyspot.pdb index f8f17f3..cfff2c5 100644 Binary files a/bin/Debug/skyspot.pdb and b/bin/Debug/skyspot.pdb differ diff --git a/http/DHCP.cs b/http/DHCP.cs new file mode 100644 index 0000000..035615b --- /dev/null +++ b/http/DHCP.cs @@ -0,0 +1,35 @@ +// /** +// * File: HttpDHCP.cs +// * Author: haraldwolff +// * +// * This file and it's content is copyrighted by the Author and / or copyright holder. +// * Any use wihtout proper permission is illegal and may lead to legal actions. +// * +// * +// **/ +using System; +using System.Collections.Generic; +using ln.http; +using ln.http.resources; +using ln.dhcp; +namespace skyspot.http +{ + public class DHCP : BaseResource + { + public DHCPServer DHCPServer { get; set; } + + public DHCP(Resource container,DHCPServer dhcpServer) + :base(container,"DHCP") + { + DHCPServer = dhcpServer; + + Resource collections = new BaseResource(this, "collections"); + + new CollectionResource(collections, dhcpServer.leasesCollection); + new CollectionResource(collections, dhcpServer.ippoolsCollection); + new CollectionResource(collections, dhcpServer.serverInterfacesCollection); + + } + + } +} diff --git a/http/SkySpotApplication.cs b/http/SkySpotApplication.cs new file mode 100644 index 0000000..361e54b --- /dev/null +++ b/http/SkySpotApplication.cs @@ -0,0 +1,20 @@ +// /** +// * File: SkySpotApplication.cs +// * Author: haraldwolff +// * +// * This file and it's content is copyrighted by the Author and / or copyright holder. +// * Any use wihtout proper permission is illegal and may lead to legal actions. +// * +// * +// **/ +using System; +using ln.http.resources; +namespace skyspot.http +{ + public class SkySpotApplication : ResourceApplication + { + public SkySpotApplication() + { + } + } +} diff --git a/obj/x86/Debug/skyspot.csproj.CoreCompileInputs.cache b/obj/x86/Debug/skyspot.csproj.CoreCompileInputs.cache index 960d52b..5f73007 100644 --- a/obj/x86/Debug/skyspot.csproj.CoreCompileInputs.cache +++ b/obj/x86/Debug/skyspot.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -ce60d24a71dd934ca2a2af753a9fd2b0f42763f6 +92af6795df16490c0afe36b1ed1e4fe0e770e10c diff --git a/obj/x86/Debug/skyspot.csprojAssemblyReference.cache b/obj/x86/Debug/skyspot.csprojAssemblyReference.cache index f499adc..87cc5b9 100644 Binary files a/obj/x86/Debug/skyspot.csprojAssemblyReference.cache and b/obj/x86/Debug/skyspot.csprojAssemblyReference.cache differ diff --git a/obj/x86/Debug/skyspot.exe b/obj/x86/Debug/skyspot.exe index 05add11..4140030 100644 Binary files a/obj/x86/Debug/skyspot.exe and b/obj/x86/Debug/skyspot.exe differ diff --git a/obj/x86/Debug/skyspot.pdb b/obj/x86/Debug/skyspot.pdb index f8f17f3..cfff2c5 100644 Binary files a/obj/x86/Debug/skyspot.pdb and b/obj/x86/Debug/skyspot.pdb differ diff --git a/skyspot.csproj b/skyspot.csproj index f6c8ba0..69abbef 100644 --- a/skyspot.csproj +++ b/skyspot.csproj @@ -42,6 +42,8 @@ + + @@ -72,6 +74,7 @@ +