WIP
parent
e015275006
commit
e8bdb4fb0b
24
Program.cs
24
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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<DHCPLease>(collections, dhcpServer.leasesCollection);
|
||||
new CollectionResource<IPPool>(collections, dhcpServer.ippoolsCollection);
|
||||
new CollectionResource<DHCPServerInterface>(collections, dhcpServer.serverInterfacesCollection);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
ce60d24a71dd934ca2a2af753a9fd2b0f42763f6
|
||||
92af6795df16490c0afe36b1ed1e4fe0e770e10c
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -42,6 +42,8 @@
|
|||
<Compile Include="users\RegistrationType.cs" />
|
||||
<Compile Include="users\TrafficProfile.cs" />
|
||||
<Compile Include="session\HotspotVolume.cs" />
|
||||
<Compile Include="http\DHCP.cs" />
|
||||
<Compile Include="http\SkySpotApplication.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ln.http\ln.http.csproj">
|
||||
|
@ -72,6 +74,7 @@
|
|||
<ItemGroup>
|
||||
<Folder Include="session\" />
|
||||
<Folder Include="users\" />
|
||||
<Folder Include="http\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
|
Loading…
Reference in New Issue