User Tools

Site Tools


using_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
using_api [2014/07/01 23:27]
admin
using_api [2023/08/14 06:41] (current)
Line 5: Line 5:
 **Business Class** \\ **Business Class** \\
 When creating the DLL, you must at least create one class named Business. This Class is the bridge between Evolynx RADIUS and your billing software. Evolynx RADIUS will call specific methods of this Class to exchange information with database. A typical Business Class will look like this: When creating the DLL, you must at least create one class named Business. This Class is the bridge between Evolynx RADIUS and your billing software. Evolynx RADIUS will call specific methods of this Class to exchange information with database. A typical Business Class will look like this:
- 
-<code vb> 
-Imports System 
-Imports Evolynx.RADIUS.Common 
- 
-Public Class Business 
-    Implements IBusiness 
- 
-    Public Sub AccountingOther(ByVal Packet As RadiusPacket) Implements IBusiness.AccountingOther 
-        Throw New NotImplementedException() 
-    End Sub 
- 
-    Public Sub AccountingStart(ByVal Packet As RadiusPacket) Implements IBusiness.AccountingStart 
-        Throw New NotImplementedException() 
-    End Sub 
- 
-    Public Sub AccountingStop(ByVal Packet As RadiusPacket) Implements IBusiness.AccountingStop 
-        Throw New NotImplementedException() 
-    End Sub 
- 
-    Public Function Authenticate(ByVal Packet As RadiusPacket) As Integer Implements IBusiness.Authenticate 
-        Throw New NotImplementedException() 
-    End Function 
- 
-    Public Function LoadClients() As ClientCollection Implements IBusiness.LoadClients 
-        Throw New NotImplementedException() 
-    End Function 
- 
-    Public Sub NotifyByEmail(ByVal State As Object) Implements IBusiness.NotifyByEmail 
-        Throw New NotImplementedException() 
-    End Sub 
- 
-    Public Sub OnForwardAccounting(ByVal Packet As RadiusPacket,​ ByVal TargetIP As String) Implements IBusiness.OnForwardAccounting 
-        Throw New NotImplementedException() 
-    End Sub 
- 
-    Public Sub OnForwardRequest(ByVal Packet As RadiusPacket,​ ByVal TargetIP As String) Implements IBusiness.OnForwardRequest 
-        Throw New NotImplementedException() 
-    End Sub 
- 
-    Public Sub OnForwardToNAS(ByVal Packet As RadiusPacket,​ ByVal TargetIP As String) Implements IBusiness.OnForwardToNAS 
-        Throw New NotImplementedException() 
-    End Sub 
- 
-    Public Sub ScheduledMaintenance(ByVal State As Object) Implements IBusiness.ScheduledMaintenance 
-        Throw New NotImplementedException() 
-    End Sub 
- 
-    Public Function WriteError(ByVal Message As String, ByVal ErrorID As Long) As Long Implements IBusiness.WriteError 
-        Throw New NotImplementedException() 
-    End Function 
-End Class 
-</​code>​ 
  
 <code c#> <code c#>
Line 123: Line 70:
         }         }
  
 +        public long WriteError(LogEvent le, long ErrorID)
 +        {
 +            throw new NotImplementedException();​
 +        }
     }     }
 } }
Line 135: Line 86:
   -. In Solution Explorer, right click on References and select "Add Reference"​   -. In Solution Explorer, right click on References and select "Add Reference"​
   -. On Browse tab, select "​Evolynx.RADIUS.Common.dll"​ which is located in Evolynx RADIUS directory, and click ok   -. On Browse tab, select "​Evolynx.RADIUS.Common.dll"​ which is located in Evolynx RADIUS directory, and click ok
-  -. Copy the code from the box above (Depending the language ​you chose) to your project +  -. Copy the code from the box above (which is in C#, modify for your target ​language) to your project 
-  -. Add code to any of the methods you want+  -. Add code to any of the methods you need to implement
   -. When you are finished debugging your DLL, Build and copy your bug free DLL to Evolynx RADIUS directory (RADIUS Service should be stopped)   -. When you are finished debugging your DLL, Build and copy your bug free DLL to Evolynx RADIUS directory (RADIUS Service should be stopped)
  
Line 163: Line 114:
 We have prepared a very simple example with minimum functionality to show how you can use the Evolynx API to create a DLL which authenticates users with a MS-Access database. In order to run this example, you need to re-define the Reference to "​Definitions.dll"​ and set the "​Output Path" in Project Properties. The mdb file must be placed in Evolynx RADIUS directory. We have prepared a very simple example with minimum functionality to show how you can use the Evolynx API to create a DLL which authenticates users with a MS-Access database. In order to run this example, you need to re-define the Reference to "​Definitions.dll"​ and set the "​Output Path" in Project Properties. The mdb file must be placed in Evolynx RADIUS directory.
  
-[[http://​www.evolynx.com/​download/​ApiSample.zip|API Example (Visual Studio ​2008, C  - source code)]] \\+[[http://​www.evolynx.com/​download/​ApiSample.zip|API Example (Visual Studio ​2019, C- source code)]] \\
  
 **How to control Evolynx RADIUS Service** \\ **How to control Evolynx RADIUS Service** \\
using_api.1404257248.txt.gz · Last modified: 2023/08/14 06:41 (external edit)