69 lines
1.7 KiB
C#
69 lines
1.7 KiB
C#
// /**
|
|
// * 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;
|
|
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;
|
|
using skyspot.radius;
|
|
namespace skyspot.session
|
|
{
|
|
public class SessionManager
|
|
{
|
|
public RadiusSecretsStore SecretsStore { get; private set; }
|
|
|
|
RadiusServer accountingRadius;
|
|
RadiusServer locatorRadius;
|
|
|
|
public SessionManager()
|
|
{
|
|
InitializeRadius();
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
}
|
|
|
|
|
|
private void InitializeRadius()
|
|
{
|
|
accountingRadius= new RadiusServer(new IPEndPoint(IPAddress.Any,1812));
|
|
.LookupSecret = LookupRadiusSecret;
|
|
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)
|
|
{
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|