lib60870-C  2.3.2
C source code library for the IEC 60870-5-101/104 protocols
Typedefs | Enumerations | Functions
cs104_slave.h File Reference

CS 104 slave side definitions. More...

#include "iec60870_slave.h"
Include dependency graph for cs104_slave.h:

Go to the source code of this file.

Typedefs

typedef struct sCS104_Slave * CS104_Slave
 
typedef struct sCS104_RedundancyGroup * CS104_RedundancyGroup
 
typedef bool(* CS104_ConnectionRequestHandler) (void *parameter, const char *ipAddress)
 Connection request handler is called when a client tries to connect to the server. More...
 
typedef void(* CS104_ConnectionEventHandler) (void *parameter, IMasterConnection connection, CS104_PeerConnectionEvent event)
 Handler that is called when a peer connection is established or closed, or START_DT/STOP_DT is issued. More...
 
typedef void(* CS104_SlaveRawMessageHandler) (void *parameter, IMasterConnection connection, uint8_t *msg, int msgSize, bool send)
 Callback handler for sent and received messages. More...
 

Enumerations

enum  CS104_ServerMode { CS104_MODE_SINGLE_REDUNDANCY_GROUP , CS104_MODE_CONNECTION_IS_REDUNDANCY_GROUP , CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS }
 
enum  eCS104_IPAddressType { IP_ADDRESS_TYPE_IPV4 , IP_ADDRESS_TYPE_IPV6 }
 
enum  CS104_PeerConnectionEvent { CS104_CON_EVENT_CONNECTION_OPENED = 0 , CS104_CON_EVENT_CONNECTION_CLOSED = 1 , CS104_CON_EVENT_ACTIVATED = 2 , CS104_CON_EVENT_DEACTIVATED = 3 }
 

Functions

CS104_Slave CS104_Slave_create (int maxLowPrioQueueSize, int maxHighPrioQueueSize)
 Create a new instance of a CS104 slave (server) More...
 
CS104_Slave CS104_Slave_createSecure (int maxLowPrioQueueSize, int maxHighPrioQueueSize, TLSConfiguration tlsConfig)
 Create a new instance of a CS104 slave (server) with TLS enabled. More...
 
void CS104_Slave_addPlugin (CS104_Slave self, CS101_SlavePlugin plugin)
 
void CS104_Slave_setLocalAddress (CS104_Slave self, const char *ipAddress)
 Set the local IP address to bind the server use "0.0.0.0" to bind to all interfaces. More...
 
void CS104_Slave_setLocalPort (CS104_Slave self, int tcpPort)
 Set the local TCP port to bind the server. More...
 
int CS104_Slave_getOpenConnections (CS104_Slave self)
 Get the number of connected clients. More...
 
void CS104_Slave_setMaxOpenConnections (CS104_Slave self, int maxOpenConnections)
 set the maximum number of open client connections allowed More...
 
void CS104_Slave_setServerMode (CS104_Slave self, CS104_ServerMode serverMode)
 Set one of the server modes. More...
 
void CS104_Slave_setConnectionRequestHandler (CS104_Slave self, CS104_ConnectionRequestHandler handler, void *parameter)
 Set the connection request handler. More...
 
void CS104_Slave_setConnectionEventHandler (CS104_Slave self, CS104_ConnectionEventHandler handler, void *parameter)
 Set the connection event handler. More...
 
void CS104_Slave_setInterrogationHandler (CS104_Slave self, CS101_InterrogationHandler handler, void *parameter)
 
void CS104_Slave_setCounterInterrogationHandler (CS104_Slave self, CS101_CounterInterrogationHandler handler, void *parameter)
 
void CS104_Slave_setReadHandler (CS104_Slave self, CS101_ReadHandler handler, void *parameter)
 set handler for read request (C_RD_NA_1 - 102)
 
void CS104_Slave_setASDUHandler (CS104_Slave self, CS101_ASDUHandler handler, void *parameter)
 
void CS104_Slave_setClockSyncHandler (CS104_Slave self, CS101_ClockSynchronizationHandler handler, void *parameter)
 
void CS104_Slave_setRawMessageHandler (CS104_Slave self, CS104_SlaveRawMessageHandler handler, void *parameter)
 Set the raw message callback (called when a message is sent or received) More...
 
CS104_APCIParameters CS104_Slave_getConnectionParameters (CS104_Slave self)
 Get the APCI parameters instance. APCI parameters are CS 104 specific parameters.
 
CS101_AppLayerParameters CS104_Slave_getAppLayerParameters (CS104_Slave self)
 Get the application layer parameters instance..
 
void CS104_Slave_start (CS104_Slave self)
 Start the CS 104 slave. The slave (server) will listen on the configured TCP/IP port. More...
 
bool CS104_Slave_isRunning (CS104_Slave self)
 Check if slave is running. More...
 
void CS104_Slave_stop (CS104_Slave self)
 Stop the server. More...
 
void CS104_Slave_startThreadless (CS104_Slave self)
 Start the slave (server) in non-threaded mode. More...
 
void CS104_Slave_stopThreadless (CS104_Slave self)
 Stop the server in non-threaded mode. More...
 
void CS104_Slave_tick (CS104_Slave self)
 Protocol stack tick function for non-threaded mode. More...
 
int CS104_Slave_getNumberOfQueueEntries (CS104_Slave self, CS104_RedundancyGroup redGroup)
 
void CS104_Slave_enqueueASDU (CS104_Slave self, CS101_ASDU asdu)
 Add an ASDU to the low-priority queue of the slave (use for periodic and spontaneous messages) More...
 
void CS104_Slave_addRedundancyGroup (CS104_Slave self, CS104_RedundancyGroup redundancyGroup)
 Add a new redundancy group to the server. More...
 
void CS104_Slave_destroy (CS104_Slave self)
 Delete the slave instance. Release all resources.
 
CS104_RedundancyGroup CS104_RedundancyGroup_create (const char *name)
 Create a new redundancy group. More...
 
void CS104_RedundancyGroup_addAllowedClient (CS104_RedundancyGroup self, const char *ipAddress)
 Add an allowed client to the redundancy group. More...
 
void CS104_RedundancyGroup_addAllowedClientEx (CS104_RedundancyGroup self, const uint8_t *ipAddress, eCS104_IPAddressType addressType)
 Add an allowed client to the redundancy group. More...
 
void CS104_RedundancyGroup_destroy (CS104_RedundancyGroup self)
 Destroy the instance and release all resources. More...
 

Detailed Description

CS 104 slave side definitions.