ln.skyspot/Program.cs

58 lines
1.5 KiB
C#
Raw Normal View History

2019-04-23 09:24:56 +02:00
// /**
// * File: Program.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.radius;
using System.Net;
using System.Threading;
using ln.logging;
using System.Net.Sockets;
using Newtonsoft.Json;
using ln.dhcp;
using ln.types.net;
2019-04-24 07:13:56 +02:00
using ln.http;
using ln.http.resources;
using skyspot.http;
2019-04-23 09:24:56 +02:00
namespace skyspot
{
class MainClass
{
public static void Main(string[] args)
{
DHCPServer dhcpServer = new DHCPServer();
2019-04-24 07:13:56 +02:00
dhcpServer.EnsureInterface(IPv4.Parse("10.118.200.2"));
dhcpServer.EnsurePool("default", IPv4.Parse("10.118.200.50"), IPv4.Parse("10.118.200.99"));
2019-04-23 09:24:56 +02:00
2019-04-23 12:59:40 +02:00
foreach (DHCPServerInterface serverInterface in dhcpServer.Interfaces)
2019-04-23 09:24:56 +02:00
{
2019-04-23 12:59:40 +02:00
if (serverInterface.Pool == null)
{
serverInterface.Pool = dhcpServer.IPPools[0];
dhcpServer.Commit(serverInterface);
}
2019-04-23 09:24:56 +02:00
}
dhcpServer.Start();
2019-04-24 07:13:56 +02:00
HTTPServer httpServer = new HTTPServer();
httpServer.AddEndpoint(new IPEndPoint(IPAddress.Any, 80));
ResourceApplication app = new ResourceApplication();
httpServer.DefaultApplication = app;
DHCP httpDHCP = new DHCP(app.RootResource, dhcpServer);
2019-04-23 09:24:56 +02:00
2019-04-24 07:13:56 +02:00
httpServer.Start();
2019-04-23 09:24:56 +02:00
}
}
}