libIEC61850
0.8.2
Open-source IEC 61850 MMS/GOOSE server and client library
|
Classes | |
struct | MmsServerConnection |
struct | IsoServerCallbacks |
struct | sMmsNamedVariableList |
Macros | |
#define | MMS_LOGICAL_STATE_STATE_CHANGES_ALLOWED 0 |
#define | MMS_LOGICAL_STATE_NO_STATE_CHANGES_ALLOWED 1 |
#define | MMS_LOGICAL_STATE_LIMITED_SERVICES_PERMITTED 2 |
#define | MMS_LOGICAL_STATE_SUPPORT_SERVICES_ALLOWED 3 |
#define | MMS_PHYSICAL_STATE_OPERATIONAL 0 |
#define | MMS_PHYSICAL_STATE_PARTIALLY_OPERATIONAL 1 |
#define | MMS_PHYSICAL_STATE_INOPERATIONAL 2 |
#define | MMS_PHYSICAL_STATE_NEEDS_COMMISSIONING 3 |
Typedefs | |
typedef struct sMmsServer * | MmsServer |
typedef MmsValue *(* | MmsReadVariableHandler )(void *parameter, MmsDomain *domain, char *variableId, MmsServerConnection *connection) |
typedef MmsDataAccessError(* | MmsReadAccessHandler )(void *parameter, MmsDomain *domain, char *variableId, MmsServerConnection *connection) |
typedef MmsDataAccessError(* | MmsWriteVariableHandler )(void *parameter, MmsDomain *domain, char *variableId, MmsValue *value, MmsServerConnection *connection) |
typedef void(* | MmsConnectionHandler )(void *parameter, MmsServerConnection *connection, MmsServerEvent event) |
typedef void(* | MmsStatusRequestListener )(void *parameter, MmsServer mmsServer, MmsServerConnection *connection, bool extendedDerivation) |
User provided handler that is invoked on a MMS status request. More... | |
typedef struct sIsoServer * | IsoServer |
typedef struct sIsoConnection * | IsoConnection |
typedef void(* | ConnectionIndicationHandler )(IsoConnectionIndication indication, void *parameter, IsoConnection connection) |
typedef void(* | MessageReceivedHandler )(void *parameter, ByteBuffer *message, ByteBuffer *response) |
Functions | |
MmsDomain * | MmsDomain_create (char *domainName) |
Create a new MmsDomain instance. More... | |
char * | MmsDomain_getName (MmsDomain *self) |
void | MmsDomain_destroy (MmsDomain *self) |
bool | MmsDomain_addNamedVariableList (MmsDomain *self, MmsNamedVariableList variableList) |
Add a new MMS Named Variable List (Data set) to a MmsDomain instance. More... | |
void | MmsDomain_deleteNamedVariableList (MmsDomain *self, char *variableListName) |
Delete a MMS Named Variable List from this MmsDomain instance. More... | |
MmsNamedVariableList | MmsDomain_getNamedVariableList (MmsDomain *self, char *variableListName) |
LinkedList | MmsDomain_getNamedVariableLists (MmsDomain *self) |
LinkedList | MmsDomain_getNamedVariableListValues (MmsDomain *self, char *variableListName) |
LinkedList | MmsDomain_createNamedVariableListValues (MmsDomain *self, char *variableListName) |
MmsVariableSpecification * | MmsDomain_getNamedVariable (MmsDomain *self, char *nameId) |
Get the MmsTypeSpecification instance of a MMS named variable. More... | |
MmsDevice * | MmsDevice_create (char *deviceName) |
Create a new MmsDevice instance. More... | |
void | MmsDevice_destroy (MmsDevice *self) |
Delete the MmsDevice instance. More... | |
MmsDomain * | MmsDevice_getDomain (MmsDevice *self, char *domainId) |
Get the MmsDomain object with the specified MMS domain name. More... | |
MmsVariableSpecification * | MmsDevice_getNamedVariable (MmsDevice *self, char *variableName) |
Get the MmsTypeSpecification instance of a MMS named variable of VMD scope. More... | |
LinkedList | MmsDevice_getNamedVariableLists (MmsDevice *self) |
MmsServer | MmsServer_create (IsoServer isoServer, MmsDevice *device) |
void | MmsServer_destroy (MmsServer self) |
void | MmsServer_installReadHandler (MmsServer self, MmsReadVariableHandler, void *parameter) |
void | MmsServer_installReadAccessHandler (MmsServer self, MmsReadAccessHandler, void *parameter) |
void | MmsServer_installWriteHandler (MmsServer self, MmsWriteVariableHandler, void *parameter) |
void | MmsServer_installConnectionHandler (MmsServer self, MmsConnectionHandler, void *parameter) |
void | MmsServer_setClientAuthenticator (MmsServer self, AcseAuthenticator authenticator, void *authenticatorParameter) |
MmsDevice * | MmsServer_getDevice (MmsServer self) |
MmsValue * | MmsServer_getValueFromCache (MmsServer self, MmsDomain *domain, char *itemId) |
bool | MmsServer_isLocked (MmsServer self) |
void | MmsServer_lockModel (MmsServer self) |
lock the cached server data model More... | |
void | MmsServer_unlockModel (MmsServer self) |
unlock the cached server data model More... | |
void | MmsServer_insertIntoCache (MmsServer self, MmsDomain *domain, char *itemId, MmsValue *value) |
void | MmsServer_setDevice (MmsServer self, MmsDevice *device) |
void | MmsServer_startListening (MmsServer self, int tcpPort) |
Start a new server thread and listen for incoming connections. More... | |
void | MmsServer_stopListening (MmsServer self) |
Stop server thread an all open connection threads. More... | |
void | MmsServer_startListeningThreadless (MmsServer self, int tcpPort) |
Start a new server in non-threaded operation mode. More... | |
int | MmsServer_waitReady (MmsServer self, unsigned int timeoutMs) |
Wait for the server to come ready in non-threaded operation mode. More... | |
void | MmsServer_handleIncomingMessages (MmsServer self) |
Handle client connections (for non-threaded operation mode) More... | |
void | MmsServer_stopListeningThreadless (MmsServer self) |
Stop the server (for non-threaded operation mode) More... | |
void | MmsServer_setServerIdentity (MmsServer self, char *vendorName, char *modelName, char *revision) |
set the values that the server will give as response for an MMS identify request More... | |
char * | MmsServer_getVendorName (MmsServer self) |
get the vendor name attribute of the VMD identity More... | |
char * | MmsServer_getModelName (MmsServer self) |
get the model name attribute of the VMD identity More... | |
char * | MmsServer_getRevision (MmsServer self) |
get the revision attribute of the VMD identity More... | |
void | MmsServer_setVMDStatus (MmsServer self, int vmdLogicalStatus, int vmdPhysicalStatus) |
set the VMD state values for the VMD status service More... | |
int | MmsServer_getVMDLogicalStatus (MmsServer self) |
get the logical status attribute of the VMD More... | |
int | MmsServer_getVMDPhysicalStatus (MmsServer self) |
get the physical status attribute of the VMD More... | |
void | MmsServer_setStatusRequestListener (MmsServer self, MmsStatusRequestListener listener, void *parameter) |
set the MmsStatusRequestListener for this MmsServer More... | |
char * | IsoConnection_getPeerAddress (IsoConnection self) |
void | IsoConnection_close (IsoConnection self) |
void | IsoConnection_installListener (IsoConnection self, MessageReceivedHandler handler, void *parameter) |
void * | IsoConnection_getSecurityToken (IsoConnection self) |
void | IsoConnection_sendMessage (IsoConnection self, ByteBuffer *message, bool handlerMode) |
send a message over an ISO connection More... | |
IsoServer | IsoServer_create (void) |
void | IsoServer_setTcpPort (IsoServer self, int port) |
void | IsoServer_setLocalIpAddress (IsoServer self, char *ipAddress) |
IsoServerState | IsoServer_getState (IsoServer self) |
void | IsoServer_setConnectionHandler (IsoServer self, ConnectionIndicationHandler handler, void *parameter) |
void | IsoServer_setAuthenticator (IsoServer self, AcseAuthenticator authenticator, void *authenticatorParameter) |
AcseAuthenticator | IsoServer_getAuthenticator (IsoServer self) |
void * | IsoServer_getAuthenticatorParameter (IsoServer self) |
void | IsoServer_startListening (IsoServer self) |
void | IsoServer_stopListening (IsoServer self) |
void | IsoServer_startListeningThreadless (IsoServer self) |
void | IsoServer_processIncomingMessages (IsoServer self) |
int | IsoServer_waitReady (IsoServer self, unsigned int timeoutMs) |
void | IsoServer_stopListeningThreadless (IsoServer self) |
void | IsoServer_closeConnection (IsoServer self, IsoConnection isoConnection) |
void | IsoServer_destroy (IsoServer self) |
MmsNamedVariableListEntry | MmsNamedVariableListEntry_create (MmsAccessSpecifier accessSpecifier) |
void | MmsNamedVariableListEntry_destroy (MmsNamedVariableListEntry self) |
MmsDomain * | MmsNamedVariableListEntry_getDomain (MmsNamedVariableListEntry self) |
char * | MmsNamedVariableListEntry_getVariableName (MmsNamedVariableListEntry self) |
MmsNamedVariableList | MmsNamedVariableList_create (char *name, bool deletable) |
char * | MmsNamedVariableList_getName (MmsNamedVariableList self) |
bool | MmsNamedVariableList_isDeletable (MmsNamedVariableList self) |
void | MmsNamedVariableList_addVariable (MmsNamedVariableList self, MmsNamedVariableListEntry variable) |
LinkedList | MmsNamedVariableList_getVariableList (MmsNamedVariableList self) |
void | MmsNamedVariableList_destroy (MmsNamedVariableList self) |
#define MMS_LOGICAL_STATE_LIMITED_SERVICES_PERMITTED 2 |
#define MMS_LOGICAL_STATE_NO_STATE_CHANGES_ALLOWED 1 |
#define MMS_LOGICAL_STATE_STATE_CHANGES_ALLOWED 0 |
#define MMS_LOGICAL_STATE_SUPPORT_SERVICES_ALLOWED 3 |
#define MMS_PHYSICAL_STATE_INOPERATIONAL 2 |
#define MMS_PHYSICAL_STATE_NEEDS_COMMISSIONING 3 |
#define MMS_PHYSICAL_STATE_OPERATIONAL 0 |
#define MMS_PHYSICAL_STATE_PARTIALLY_OPERATIONAL 1 |
typedef void(* ConnectionIndicationHandler)(IsoConnectionIndication indication, void *parameter, IsoConnection connection) |
typedef struct sIsoConnection* IsoConnection |
typedef struct sIsoServer* IsoServer |
typedef void(* MessageReceivedHandler)(void *parameter, ByteBuffer *message, ByteBuffer *response) |
typedef void(* MmsConnectionHandler)(void *parameter, MmsServerConnection *connection, MmsServerEvent event) |
typedef MmsDataAccessError(* MmsReadAccessHandler)(void *parameter, MmsDomain *domain, char *variableId, MmsServerConnection *connection) |
typedef MmsValue*(* MmsReadVariableHandler)(void *parameter, MmsDomain *domain, char *variableId, MmsServerConnection *connection) |
typedef struct sMmsServer* MmsServer |
typedef void(* MmsStatusRequestListener)(void *parameter, MmsServer mmsServer, MmsServerConnection *connection, bool extendedDerivation) |
User provided handler that is invoked on a MMS status request.
The extendedDerivation parameter indicates that the client requests the server to perform self diagnosis tests before answering the request.
parameter | is a user provided parameter |
mmsServer | is the MmsServer instance |
connection | is the MmsServerConnection instance that received the MMS status request |
extendedDerivation | indicates if the request contains the extendedDerivation parameter |
typedef MmsDataAccessError(* MmsWriteVariableHandler)(void *parameter, MmsDomain *domain, char *variableId, MmsValue *value, MmsServerConnection *connection) |
enum IsoServerState |
enum MmsServerEvent |
void IsoConnection_close | ( | IsoConnection | self) |
char* IsoConnection_getPeerAddress | ( | IsoConnection | self) |
void* IsoConnection_getSecurityToken | ( | IsoConnection | self) |
void IsoConnection_installListener | ( | IsoConnection | self, |
MessageReceivedHandler | handler, | ||
void * | parameter | ||
) |
void IsoConnection_sendMessage | ( | IsoConnection | self, |
ByteBuffer * | message, | ||
bool | handlerMode | ||
) |
send a message over an ISO connection
handlerMode | specifies if this function is used in the context of the connection handling thread (handlerMode) |
void IsoServer_closeConnection | ( | IsoServer | self, |
IsoConnection | isoConnection | ||
) |
IsoServer IsoServer_create | ( | void | ) |
void IsoServer_destroy | ( | IsoServer | self) |
AcseAuthenticator IsoServer_getAuthenticator | ( | IsoServer | self) |
void* IsoServer_getAuthenticatorParameter | ( | IsoServer | self) |
IsoServerState IsoServer_getState | ( | IsoServer | self) |
void IsoServer_processIncomingMessages | ( | IsoServer | self) |
for non-threaded operation
void IsoServer_setAuthenticator | ( | IsoServer | self, |
AcseAuthenticator | authenticator, | ||
void * | authenticatorParameter | ||
) |
void IsoServer_setConnectionHandler | ( | IsoServer | self, |
ConnectionIndicationHandler | handler, | ||
void * | parameter | ||
) |
void IsoServer_setLocalIpAddress | ( | IsoServer | self, |
char * | ipAddress | ||
) |
void IsoServer_setTcpPort | ( | IsoServer | self, |
int | port | ||
) |
void IsoServer_startListening | ( | IsoServer | self) |
void IsoServer_startListeningThreadless | ( | IsoServer | self) |
void IsoServer_stopListening | ( | IsoServer | self) |
void IsoServer_stopListeningThreadless | ( | IsoServer | self) |
int IsoServer_waitReady | ( | IsoServer | self, |
unsigned int | timeoutMs | ||
) |
MmsDevice* MmsDevice_create | ( | char * | deviceName) |
MmsDomain* MmsDevice_getDomain | ( | MmsDevice * | self, |
char * | domainId | ||
) |
Get the MmsDomain object with the specified MMS domain name.
deviceName | the name of the MMS device or NULL if the device has no name. |
MmsVariableSpecification* MmsDevice_getNamedVariable | ( | MmsDevice * | self, |
char * | variableName | ||
) |
Get the MmsTypeSpecification instance of a MMS named variable of VMD scope.
self | instance of MmsDevice to operate on |
variableName | name of the named variable |
LinkedList MmsDevice_getNamedVariableLists | ( | MmsDevice * | self) |
bool MmsDomain_addNamedVariableList | ( | MmsDomain * | self, |
MmsNamedVariableList | variableList | ||
) |
Add a new MMS Named Variable List (Data set) to a MmsDomain instance.
The passed MmsNamedVariableList instance will be handled by the MmsDomain instance and will be destroyed if the MmsDomain_destroy function on this MmsDomain instance is called.
self | instance of MmsDomain to operate on |
variableList | new named variable list that will be added to this MmsDomain |
MmsDomain* MmsDomain_create | ( | char * | domainName) |
Create a new MmsDomain instance.
This method should not be invoked by client code!
domainName | the name of the MMS domain |
LinkedList MmsDomain_createNamedVariableListValues | ( | MmsDomain * | self, |
char * | variableListName | ||
) |
void MmsDomain_deleteNamedVariableList | ( | MmsDomain * | self, |
char * | variableListName | ||
) |
Delete a MMS Named Variable List from this MmsDomain instance.
A call to this function will also destroy the MmsNamedVariableList instance.
self | instance of MmsDomain to operate on |
variableListName | the name of the variable list to delete. |
void MmsDomain_destroy | ( | MmsDomain * | self) |
Delete a MmsDomain instance
This method should not be invoked by client code!
char* MmsDomain_getName | ( | MmsDomain * | self) |
MmsVariableSpecification* MmsDomain_getNamedVariable | ( | MmsDomain * | self, |
char * | nameId | ||
) |
Get the MmsTypeSpecification instance of a MMS named variable.
self | instance of MmsDomain to operate on |
nameId | name of the named variable |
MmsNamedVariableList MmsDomain_getNamedVariableList | ( | MmsDomain * | self, |
char * | variableListName | ||
) |
LinkedList MmsDomain_getNamedVariableLists | ( | MmsDomain * | self) |
LinkedList MmsDomain_getNamedVariableListValues | ( | MmsDomain * | self, |
char * | variableListName | ||
) |
void MmsNamedVariableList_addVariable | ( | MmsNamedVariableList | self, |
MmsNamedVariableListEntry | variable | ||
) |
MmsNamedVariableList MmsNamedVariableList_create | ( | char * | name, |
bool | deletable | ||
) |
void MmsNamedVariableList_destroy | ( | MmsNamedVariableList | self) |
char* MmsNamedVariableList_getName | ( | MmsNamedVariableList | self) |
LinkedList MmsNamedVariableList_getVariableList | ( | MmsNamedVariableList | self) |
bool MmsNamedVariableList_isDeletable | ( | MmsNamedVariableList | self) |
MmsNamedVariableListEntry MmsNamedVariableListEntry_create | ( | MmsAccessSpecifier | accessSpecifier) |
void MmsNamedVariableListEntry_destroy | ( | MmsNamedVariableListEntry | self) |
MmsDomain* MmsNamedVariableListEntry_getDomain | ( | MmsNamedVariableListEntry | self) |
char* MmsNamedVariableListEntry_getVariableName | ( | MmsNamedVariableListEntry | self) |
void MmsServer_destroy | ( | MmsServer | self) |
char* MmsServer_getModelName | ( | MmsServer | self) |
get the model name attribute of the VMD identity
self | the MmsServer instance to operate on |
char* MmsServer_getRevision | ( | MmsServer | self) |
get the revision attribute of the VMD identity
self | the MmsServer instance to operate on |
char* MmsServer_getVendorName | ( | MmsServer | self) |
get the vendor name attribute of the VMD identity
self | the MmsServer instance to operate on |
int MmsServer_getVMDLogicalStatus | ( | MmsServer | self) |
get the logical status attribute of the VMD
self | the MmsServer instance to operate on |
int MmsServer_getVMDPhysicalStatus | ( | MmsServer | self) |
get the physical status attribute of the VMD
self | the MmsServer instance to operate on |
void MmsServer_handleIncomingMessages | ( | MmsServer | self) |
Handle client connections (for non-threaded operation mode)
This function is listening for new client connections and handles incoming requests for existing client connections.
self | the MmsServer instance to operate on |
void MmsServer_insertIntoCache | ( | MmsServer | self, |
MmsDomain * | domain, | ||
char * | itemId, | ||
MmsValue * | value | ||
) |
void MmsServer_installConnectionHandler | ( | MmsServer | self, |
MmsConnectionHandler | , | ||
void * | parameter | ||
) |
A connection handler will be invoked whenever a new client connection is opened or closed
void MmsServer_installReadAccessHandler | ( | MmsServer | self, |
MmsReadAccessHandler | , | ||
void * | parameter | ||
) |
void MmsServer_installReadHandler | ( | MmsServer | self, |
MmsReadVariableHandler | , | ||
void * | parameter | ||
) |
void MmsServer_installWriteHandler | ( | MmsServer | self, |
MmsWriteVariableHandler | , | ||
void * | parameter | ||
) |
bool MmsServer_isLocked | ( | MmsServer | self) |
void MmsServer_lockModel | ( | MmsServer | self) |
lock the cached server data model
NOTE: This method should never be called inside of a library callback function. In the context of a library callback the data model is always already locked! Calling this function inside of a library callback may lead to a deadlock condition.
self | the MmsServer instance to operate on |
void MmsServer_setClientAuthenticator | ( | MmsServer | self, |
AcseAuthenticator | authenticator, | ||
void * | authenticatorParameter | ||
) |
void MmsServer_setServerIdentity | ( | MmsServer | self, |
char * | vendorName, | ||
char * | modelName, | ||
char * | revision | ||
) |
set the values that the server will give as response for an MMS identify request
With this function the VMD identity attributes can be set programmatically. If not set by this function the default values form stack_config.h are used.
self | the MmsServer instance to operate on |
vendorName | the vendor name attribute of the VMD |
modelName | the model name attribute of the VMD |
revision | the revision attribute of the VMD |
void MmsServer_setStatusRequestListener | ( | MmsServer | self, |
MmsStatusRequestListener | listener, | ||
void * | parameter | ||
) |
set the MmsStatusRequestListener for this MmsServer
With this function the API user can register a listener that is invoked whenever a MMS status request is received from a client. Inside of the handler the user can provide new status values with the MmsServer_setVMDStatus function.
self | the MmsServer instance to operate on |
listener | the listener that is called when a MMS status request is received |
parameter | a user provided parameter that is handed over to the listener |
void MmsServer_setVMDStatus | ( | MmsServer | self, |
int | vmdLogicalStatus, | ||
int | vmdPhysicalStatus | ||
) |
set the VMD state values for the VMD status service
self | the MmsServer instance to operate on |
vmdLogicalStatus | the logical status attribute of the VMD |
vmdPhysicalStatus | the physical status attribute of the VMD |
void MmsServer_startListening | ( | MmsServer | self, |
int | tcpPort | ||
) |
Start a new server thread and listen for incoming connections.
self | the MmsServer instance to operate on |
tcpPort | the TCP port the server is listening on. |
void MmsServer_startListeningThreadless | ( | MmsServer | self, |
int | tcpPort | ||
) |
Start a new server in non-threaded operation mode.
self | the MmsServer instance to operate on |
tcpPort | the TCP port the server is listening on. |
void MmsServer_stopListening | ( | MmsServer | self) |
Stop server thread an all open connection threads.
self | the MmsServer instance to operate on |
void MmsServer_stopListeningThreadless | ( | MmsServer | self) |
Stop the server (for non-threaded operation mode)
self | the MmsServer instance to operate on |
void MmsServer_unlockModel | ( | MmsServer | self) |
unlock the cached server data model
NOTE: This method should never be called inside of a library callback function. In the context of a library callback the data model is always already locked!
self | the MmsServer instance to operate on |
int MmsServer_waitReady | ( | MmsServer | self, |
unsigned int | timeoutMs | ||
) |
Wait for the server to come ready in non-threaded operation mode.
self | the MmsServer instance to operate on |
timeoutMs | maximum number of milliseconds to wait |