libiec61850  1.6.0
Typedefs | Functions
Connection handling and client authentication

Functions and callbacks to control client access and connection handling. More...

Typedefs

typedef void(* IedConnectionIndicationHandler) (IedServer self, ClientConnection connection, bool connected, void *parameter)
 User provided callback function that is invoked whenever a new client connects or an existing connection is closed or detected as lost. More...
 

Functions

LIB61850_API void IedServer_setAuthenticator (IedServer self, AcseAuthenticator authenticator, void *authenticatorParameter)
 set the authenticator for this server More...
 
LIB61850_API const char * ClientConnection_getPeerAddress (ClientConnection self)
 get the peer address of this connection as string More...
 
LIB61850_API const char * ClientConnection_getLocalAddress (ClientConnection self)
 get the local address of this connection as string More...
 
LIB61850_API void * ClientConnection_getSecurityToken (ClientConnection self)
 Get the security token associated with this connection. More...
 
LIB61850_API void IedServer_setConnectionIndicationHandler (IedServer self, IedConnectionIndicationHandler handler, void *parameter)
 set a callback function that will be called on connection events (open or close). More...
 
void IedServer_ignoreClientRequests (IedServer self, bool enable)
 Ignore all requests from clients (for testing purposes) More...
 

Detailed Description

Functions and callbacks to control client access and connection handling.

Typedef Documentation

◆ IedConnectionIndicationHandler

typedef void(* IedConnectionIndicationHandler) (IedServer self, ClientConnection connection, bool connected, void *parameter)

User provided callback function that is invoked whenever a new client connects or an existing connection is closed or detected as lost.

Parameters
selfthe instance of IedServer where the connection event occured.
connectionthe new or closed client connect object
connectedtrue if a new connection is indicated, false if the connection has been closed or detected as lost.
parametera user provided parameter

Function Documentation

◆ ClientConnection_getLocalAddress()

LIB61850_API const char* ClientConnection_getLocalAddress ( ClientConnection  self)

get the local address of this connection as string

Note
the returned string is only valid as long as the client connection exists. It is save to use the string inside of the connection indication callback function.
Parameters
selfthe ClientConnection instance
Returns
local address as C string.

◆ ClientConnection_getPeerAddress()

LIB61850_API const char* ClientConnection_getPeerAddress ( ClientConnection  self)

get the peer address of this connection as string

Note
the returned string is only valid as long as the client connection exists. It is save to use the string inside of the connection indication callback function.
Parameters
selfthe ClientConnection instance
Returns
peer address as C string.

◆ ClientConnection_getSecurityToken()

LIB61850_API void* ClientConnection_getSecurityToken ( ClientConnection  self)

Get the security token associated with this connection.

The security token is an opaque handle that is associated with the connection. It is provided by the authenticator (if one is present). If no security token is used then this function returns NULL

Parameters
selfthe ClientConnection instance
Returns
the security token or NULL

◆ IedServer_ignoreClientRequests()

void IedServer_ignoreClientRequests ( IedServer  self,
bool  enable 
)

Ignore all requests from clients (for testing purposes)

NOTE: This function will block all client requests on MMS layer

Parameters
selfthe instance of IedServer to configure.
enablewhen true all requests from clients will be ignored

◆ IedServer_setAuthenticator()

LIB61850_API void IedServer_setAuthenticator ( IedServer  self,
AcseAuthenticator  authenticator,
void *  authenticatorParameter 
)

set the authenticator for this server

This function sets a user specified authenticator that is used to identify and authenticate clients that wants to connect. The authenticator is called on each connection attempt. Depending on the return value of the authenticator the client connection is accepted or refused. If no authenticator is set all client connections are accepted.

Parameters
selfthe instance of IedServer to operate on.
authenticatorthe user provided authenticator callback
authenticatorParameteruser provided parameter that is passed to the authenticator

◆ IedServer_setConnectionIndicationHandler()

LIB61850_API void IedServer_setConnectionIndicationHandler ( IedServer  self,
IedConnectionIndicationHandler  handler,
void *  parameter 
)

set a callback function that will be called on connection events (open or close).

Parameters
selfthe instance of IedServer to operate on.
handlerthe user provided callback function
parametera user provided parameter that is passed to the callback function.