ln.skyspot/session/SessionManager.cs

69 lines
1.7 KiB
C#
Raw Normal View History

2019-05-07 10:21:25 +02:00
// /**
// * File: SessionManager.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;
2019-05-07 10:21:50 +02:00
using System.Collections.Generic;
using ln.types.net;
using ln.types.btree;
using ln.radius;
using System.Net;
using ln.logging;
using ln.types.odb;
using ln.types.odb.mapped;
2019-05-07 12:54:48 +02:00
using skyspot.radius;
2019-05-07 10:21:25 +02:00
namespace skyspot.session
{
public class SessionManager
{
2019-05-07 12:54:48 +02:00
public RadiusSecretsStore SecretsStore { get; private set; }
RadiusServer accountingRadius;
RadiusServer locatorRadius;
2019-05-07 10:21:50 +02:00
2019-05-07 10:21:25 +02:00
public SessionManager()
{
2019-05-07 10:21:50 +02:00
InitializeRadius();
2019-05-07 10:21:25 +02:00
}
2019-05-07 10:21:50 +02:00
public void Start()
{
}
private void InitializeRadius()
{
2019-05-07 12:54:48 +02:00
accountingRadius= new RadiusServer(new IPEndPoint(IPAddress.Any,1812));
.LookupSecret = LookupRadiusSecret;
2019-05-07 10:21:50 +02:00
radiusServer.MessageReceived = RadiusMessageReceived;
}
byte[] LookupRadiusSecret(IPEndPoint remoteEndpoint)
{
return defaultSecret;
}
void RadiusMessageReceived(RadiusServer radiusServer, RadiusMessage radiusMessage)
{
Logging.Log(LogLevel.INFO, "Radius Message received: {0}", radiusMessage);
switch ( radiusMessage.Code)
{
case RadiusCode.AccessRequest:
AccessRequest(radiusServer, radiusMessage);
break;
}
}
void AccessRequest(RadiusServer radiusServer, RadiusMessage radiusMessage)
{
}
2019-05-07 10:21:25 +02:00
}
}