Functions and callbacks to control client access and connection handling.
More...
Functions and callbacks to control client access and connection handling.
◆ 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
-
self | the instance of IedServer where the connection event occured. |
connection | the new or closed client connect object |
connected | true if a new connection is indicated, false if the connection has been closed or detected as lost. |
parameter | a user provided parameter |
◆ 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
-
self | the 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
-
self | the ClientConnection instance |
- Returns
- peer address as C string.
◆ ClientConnection_getSecurityToken()
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
-
self | the 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
-
self | the instance of IedServer to configure. |
enable | when true all requests from clients will be ignored |
◆ IedServer_setAuthenticator()
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
-
self | the instance of IedServer to operate on. |
authenticator | the user provided authenticator callback |
authenticatorParameter | user provided parameter that is passed to the authenticator |
◆ IedServer_setConnectionIndicationHandler()
set a callback function that will be called on connection events (open or close).
- Parameters
-
self | the instance of IedServer to operate on. |
handler | the user provided callback function |
parameter | a user provided parameter that is passed to the callback function. |