libiec61850  1.2.0
Data Structures | Macros | Typedefs | Enumerations | Functions
MMS server API (for IEC 61850 use IEC 61850 server API instead!)

Data Structures

struct  IsoServerCallbacks
 
struct  MmsNamedVariableList
 

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 struct sMmsServerConnection * MmsServerConnection
 
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 MmsError(* MmsNamedVariableListChangedHandler) (void *parameter, bool create, MmsVariableListType listType, MmsDomain *domain, char *listName, MmsServerConnection connection)
 callback handler that is called whenever a named variable list changes More...
 
typedef bool(* MmsObtainFileHandler) (void *parameter, MmsServerConnection connection, const char *sourceFilename, const char *destinationFilename)
 ObtainFile service callback handler. More...
 
typedef void(* MmsGetFileCompleteHandler) (void *parameter, MmsServerConnection connection, const char *destinationFilename)
 Get file complete (obtainFile service terminated) callback handler. More...
 
typedef MmsError(* MmsFileAccessHandler) (void *parameter, MmsServerConnection connection, MmsFileServiceType service, const char *localFilename, const char *otherFilename)
 MmsFileAccessHandler callback function. Use to monitor and control file access. More...
 
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)
 

Enumerations

enum  MmsServerEvent { MMS_SERVER_NEW_CONNECTION, MMS_SERVER_CONNECTION_CLOSED }
 
enum  MmsVariableListType { MMS_DOMAIN_SPECIFIC, MMS_ASSOCIATION_SPECIFIC, MMS_VMD_SPECIFIC }
 
enum  MmsFileServiceType {
  MMS_FILE_ACCESS_TYPE_READ_DIRECTORY, MMS_FILE_ACCESS_TYPE_OPEN, MMS_FILE_ACCESS_TYPE_OBTAIN, MMS_FILE_ACCESS_TYPE_DELETE,
  MMS_FILE_ACCESS_TYPE_RENAME
}
 
enum  IsoServerState { ISO_SVR_STATE_IDLE, ISO_SVR_STATE_RUNNING, ISO_SVR_STATE_STOPPED, ISO_SVR_STATE_ERROR }
 
enum  IsoConnectionIndication { ISO_CONNECTION_OPENED, ISO_CONNECTION_CLOSED }
 

Functions

MmsDomain * MmsDomain_create (char *domainName)
 Create a new MmsDomain instance. More...
 
char * MmsDomain_getName (MmsDomain *self)
 
void MmsDomain_addJournal (MmsDomain *self, const char *name)
 
MmsJournal MmsDomain_getJournal (MmsDomain *self, const char *name)
 
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, const 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...
 
MmsDeviceMmsDevice_create (char *deviceName)
 Create a new MmsDevice instance. More...
 
void MmsDevice_destroy (MmsDevice *self)
 Delete the MmsDevice instance. More...
 
MmsDomain * MmsDevice_getDomain (MmsDevice *self, const 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)
 
MmsNamedVariableList MmsDevice_getNamedVariableListWithName (MmsDevice *self, const char *variableListName)
 
MmsJournal MmsJournal_create (const char *name)
 
void MmsJournal_destroy (MmsJournal self)
 
MmsServer MmsServer_create (MmsDevice *device, TLSConfiguration tlsConfiguration)
 
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_setLocalIpAddress (MmsServer self, const char *localIpAddress)
 
bool MmsServer_isRunning (MmsServer self)
 
void MmsServer_installConnectionHandler (MmsServer self, MmsConnectionHandler, void *parameter)
 
void MmsServer_setClientAuthenticator (MmsServer self, AcseAuthenticator authenticator, void *authenticatorParameter)
 
MmsDeviceMmsServer_getDevice (MmsServer self)
 
MmsValueMmsServer_getValueFromCache (MmsServer self, MmsDomain *domain, const char *itemId)
 
bool MmsServer_isLocked (MmsServer self)
 
void MmsServer_installVariableListChangedHandler (MmsServer self, MmsNamedVariableListChangedHandler handler, void *parameter)
 Install callback handler that is called when a named variable list changes (is created or deleted) More...
 
void MmsServer_installObtainFileHandler (MmsServer self, MmsObtainFileHandler handler, void *parameter)
 Install callback handler that is invoked when the file upload (obtainFile service) is invoked by the client. More...
 
void MmsServer_installGetFileCompleteHandler (MmsServer self, MmsGetFileCompleteHandler handler, void *parameter)
 Install callback handler that is invoked when the file upload (obtainFile service) is completed and the file has been uploaded. More...
 
void MmsServer_installFileAccessHandler (MmsServer self, MmsFileAccessHandler handler, void *parameter)
 Install a callback handler this is invoked when the client requests a file server. This function can be used to monitor and control file access. More...
 
void MmsServer_setFilestoreBasepath (MmsServer self, const char *basepath)
 Set the virtual filestore basepath for the MMS file services. More...
 
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_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_handleBackgroundTasks (MmsServer self)
 Handle MmsServer background task. 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 * MmsServerConnection_getClientAddress (MmsServerConnection self)
 
IsoConnection MmsServerConnection_getIsoConnection (MmsServerConnection self)
 
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 (TLSConfiguration tlsConfiguration)
 
void IsoServer_setTcpPort (IsoServer self, int port)
 
void IsoServer_setLocalIpAddress (IsoServer self, const 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)
 
TLSConfiguration IsoServer_getTLSConfiguration (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 (MmsDomain *domain, char *name, bool deletable)
 
char * MmsNamedVariableList_getName (MmsNamedVariableList self)
 
MmsDomain * MmsNamedVariableList_getDomain (MmsNamedVariableList self)
 
bool MmsNamedVariableList_isDeletable (MmsNamedVariableList self)
 
void MmsNamedVariableList_addVariable (MmsNamedVariableList self, MmsNamedVariableListEntry variable)
 
LinkedList MmsNamedVariableList_getVariableList (MmsNamedVariableList self)
 
void MmsNamedVariableList_destroy (MmsNamedVariableList self)
 

Detailed Description

Macro Definition Documentation

#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 Documentation

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 MmsError(* MmsFileAccessHandler) (void *parameter, MmsServerConnection connection, MmsFileServiceType service, const char *localFilename, const char *otherFilename)

MmsFileAccessHandler callback function. Use to monitor and control file access.

Parameters
parameteruser provided parameter that is passed to the callback handler
connectionthe connection that requested the service
servicethe requested file service
localFilenamethe requested file or directory name at the server
otherFilenamea second file name parameter (e.g. source file of the ObtainFile or new file of rename file)
Returns
MMS_ERROR_NONE when the request is accepted, otherwise use the appropriate error code (e.g. MMS_ERROR_FILE_FILE_ACCESS_DENIED)
typedef void(* MmsGetFileCompleteHandler) (void *parameter, MmsServerConnection connection, const char *destinationFilename)

Get file complete (obtainFile service terminated) callback handler.

This handler can be used to invoke some actions after a file upload is complete.

Parameters
parameteruser provided parameter that is passed to the callback handler
connectionthe connection that requested the service
destinationFilenamethe target file name on the server side system
typedef MmsError(* MmsNamedVariableListChangedHandler) (void *parameter, bool create, MmsVariableListType listType, MmsDomain *domain, char *listName, MmsServerConnection connection)

callback handler that is called whenever a named variable list changes

Parameters
parametera user provided parameter
createif true the the request if a request to create a new variable list, false is a delete request
listTypethe type (scope) of the named variable list (either domain, association or VMD specific)
domainthe MMS domain the list is belonging to (is NULL for association or VMD specific lists!)
listNamethe name
connectionclient connection that requests the creation of deletion of the variable list
Returns
MMS_ERROR_NONE if the request is accepted, otherwise the MmsError value that has to be sent back to the client
typedef bool(* MmsObtainFileHandler) (void *parameter, MmsServerConnection connection, const char *sourceFilename, const char *destinationFilename)

ObtainFile service callback handler.

This is invoked when the obtainFile service is requested by the client. It can be used to accept or deny the write access to the file system based on the client connection.

Parameters
parameteruser provided parameter that is passed to the callback handler
connectionthe connection that requested the service
sourceFilenamethe source file name on the client side system
destinationFilenamethe target file name on the server side system
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 struct sMmsServerConnection* MmsServerConnection
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.

Parameters
parameteris a user provided parameter
mmsServeris the MmsServer instance
connectionis the MmsServerConnection instance that received the MMS status request
extendedDerivationindicates if the request contains the extendedDerivation parameter
typedef MmsDataAccessError(* MmsWriteVariableHandler) (void *parameter, MmsDomain *domain, char *variableId, MmsValue *value, MmsServerConnection connection)

Enumeration Type Documentation

Enumerator
ISO_CONNECTION_OPENED 
ISO_CONNECTION_CLOSED 
Enumerator
ISO_SVR_STATE_IDLE 
ISO_SVR_STATE_RUNNING 
ISO_SVR_STATE_STOPPED 
ISO_SVR_STATE_ERROR 
Enumerator
MMS_FILE_ACCESS_TYPE_READ_DIRECTORY 
MMS_FILE_ACCESS_TYPE_OPEN 
MMS_FILE_ACCESS_TYPE_OBTAIN 
MMS_FILE_ACCESS_TYPE_DELETE 
MMS_FILE_ACCESS_TYPE_RENAME 
Enumerator
MMS_SERVER_NEW_CONNECTION 
MMS_SERVER_CONNECTION_CLOSED 
Enumerator
MMS_DOMAIN_SPECIFIC 
MMS_ASSOCIATION_SPECIFIC 
MMS_VMD_SPECIFIC 

Function Documentation

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

Parameters
handlerModespecifies if this function is used in the context of the connection handling thread (handlerMode)
void IsoServer_closeConnection ( IsoServer  self,
IsoConnection  isoConnection 
)
IsoServer IsoServer_create ( TLSConfiguration  tlsConfiguration)
void IsoServer_destroy ( IsoServer  self)
AcseAuthenticator IsoServer_getAuthenticator ( IsoServer  self)
void* IsoServer_getAuthenticatorParameter ( IsoServer  self)
IsoServerState IsoServer_getState ( IsoServer  self)
TLSConfiguration IsoServer_getTLSConfiguration ( 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,
const 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)

Create a new MmsDevice instance.

MmsDevice objects are the root objects of the address space of an MMS server.

An MmsDevice object can contain one or more MmsDomain instances.

Parameters
deviceNamethe name of the MMS device or NULL if the device has no name.
Returns
the new MmsDevice instance
void MmsDevice_destroy ( MmsDevice self)

Delete the MmsDevice instance.

MmsDomain* MmsDevice_getDomain ( MmsDevice self,
const char *  domainId 
)

Get the MmsDomain object with the specified MMS domain name.

Parameters
deviceNamethe name of the MMS device or NULL if the device has no name.
Returns
the new MmsDevice instance
MmsVariableSpecification* MmsDevice_getNamedVariable ( MmsDevice self,
char *  variableName 
)

Get the MmsTypeSpecification instance of a MMS named variable of VMD scope.

Parameters
selfinstance of MmsDevice to operate on
variableNamename of the named variable
Returns
MmsTypeSpecification instance of the named variable
LinkedList MmsDevice_getNamedVariableLists ( MmsDevice self)
MmsNamedVariableList MmsDevice_getNamedVariableListWithName ( MmsDevice self,
const char *  variableListName 
)
void MmsDomain_addJournal ( MmsDomain *  self,
const char *  name 
)
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.

Parameters
selfinstance of MmsDomain to operate on
variableListnew named variable list that will be added to this MmsDomain
Returns
true if operation was successful.
MmsDomain* MmsDomain_create ( char *  domainName)

Create a new MmsDomain instance.

This method should not be invoked by client code!

Parameters
domainNamethe name of the MMS domain
Returns
the new MmsDomain instance
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.

Parameters
selfinstance of MmsDomain to operate on
variableListNamethe 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!

MmsJournal MmsDomain_getJournal ( MmsDomain *  self,
const char *  name 
)
char* MmsDomain_getName ( MmsDomain *  self)
MmsVariableSpecification* MmsDomain_getNamedVariable ( MmsDomain *  self,
char *  nameId 
)

Get the MmsTypeSpecification instance of a MMS named variable.

Parameters
selfinstance of MmsDomain to operate on
nameIdname of the named variable
Returns
MmsTypeSpecification instance of the named variable
MmsNamedVariableList MmsDomain_getNamedVariableList ( MmsDomain *  self,
const char *  variableListName 
)
LinkedList MmsDomain_getNamedVariableLists ( MmsDomain *  self)
LinkedList MmsDomain_getNamedVariableListValues ( MmsDomain *  self,
char *  variableListName 
)
MmsJournal MmsJournal_create ( const char *  name)
void MmsJournal_destroy ( MmsJournal  self)
void MmsNamedVariableList_addVariable ( MmsNamedVariableList  self,
MmsNamedVariableListEntry  variable 
)
MmsNamedVariableList MmsNamedVariableList_create ( MmsDomain *  domain,
char *  name,
bool  deletable 
)
void MmsNamedVariableList_destroy ( MmsNamedVariableList  self)
MmsDomain* MmsNamedVariableList_getDomain ( 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)
MmsServer MmsServer_create ( MmsDevice device,
TLSConfiguration  tlsConfiguration 
)
void MmsServer_destroy ( MmsServer  self)
MmsDevice* MmsServer_getDevice ( MmsServer  self)
char* MmsServer_getModelName ( MmsServer  self)

get the model name attribute of the VMD identity

Parameters
selfthe MmsServer instance to operate on
Returns
the model name attribute of the VMD as C string
char* MmsServer_getRevision ( MmsServer  self)

get the revision attribute of the VMD identity

Parameters
selfthe MmsServer instance to operate on
Returns
the revision attribute of the VMD as C string
MmsValue* MmsServer_getValueFromCache ( MmsServer  self,
MmsDomain *  domain,
const char *  itemId 
)
char* MmsServer_getVendorName ( MmsServer  self)

get the vendor name attribute of the VMD identity

Parameters
selfthe MmsServer instance to operate on
Returns
the vendor name attribute of the VMD as C string
int MmsServer_getVMDLogicalStatus ( MmsServer  self)

get the logical status attribute of the VMD

Parameters
selfthe MmsServer instance to operate on
int MmsServer_getVMDPhysicalStatus ( MmsServer  self)

get the physical status attribute of the VMD

Parameters
selfthe MmsServer instance to operate on
void MmsServer_handleBackgroundTasks ( MmsServer  self)

Handle MmsServer background task.

Parameters
selfthe 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.

Parameters
selfthe 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_installFileAccessHandler ( MmsServer  self,
MmsFileAccessHandler  handler,
void *  parameter 
)

Install a callback handler this is invoked when the client requests a file server. This function can be used to monitor and control file access.

Parameters
selfthe MmsServer instance
handlerthe callback handler function
parameteruser provided parameter that is passed to the callback handler
void MmsServer_installGetFileCompleteHandler ( MmsServer  self,
MmsGetFileCompleteHandler  handler,
void *  parameter 
)

Install callback handler that is invoked when the file upload (obtainFile service) is completed and the file has been uploaded.

Parameters
selfthe MmsServer instance
handlerthe callback handler function
parameteruser provided parameter that is passed to the callback handler
void MmsServer_installObtainFileHandler ( MmsServer  self,
MmsObtainFileHandler  handler,
void *  parameter 
)

Install callback handler that is invoked when the file upload (obtainFile service) is invoked by the client.

This handler can be used to apply access restrictions on the file upload (obtainFile) service

Parameters
selfthe MmsServer instance to operate on
handlerthe callback handler function
parameteruser provided parameter that is passed to the callback handler
void MmsServer_installReadAccessHandler ( MmsServer  self,
MmsReadAccessHandler  ,
void *  parameter 
)
void MmsServer_installReadHandler ( MmsServer  self,
MmsReadVariableHandler  ,
void *  parameter 
)
void MmsServer_installVariableListChangedHandler ( MmsServer  self,
MmsNamedVariableListChangedHandler  handler,
void *  parameter 
)

Install callback handler that is called when a named variable list changes (is created or deleted)

Parameters
selfthe MmsServer instance to operate on
handlerthe callback handler function
parameteruser provided parameter that is passed to the callback handler
void MmsServer_installWriteHandler ( MmsServer  self,
MmsWriteVariableHandler  ,
void *  parameter 
)
bool MmsServer_isLocked ( MmsServer  self)
bool MmsServer_isRunning ( 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.

Parameters
selfthe MmsServer instance to operate on
void MmsServer_setClientAuthenticator ( MmsServer  self,
AcseAuthenticator  authenticator,
void *  authenticatorParameter 
)
void MmsServer_setFilestoreBasepath ( MmsServer  self,
const char *  basepath 
)

Set the virtual filestore basepath for the MMS file services.

All external file service accesses will be mapped to paths relative to the base directory. NOTE: This function is only available when the CONFIG_SET_FILESTORE_BASEPATH_AT_RUNTIME option in stack_config.h is set.

Parameters
selfthe MmsServer instance
basepaththe new virtual filestore basepath
void MmsServer_setLocalIpAddress ( MmsServer  self,
const char *  localIpAddress 
)
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.

Parameters
selfthe MmsServer instance to operate on
vendorNamethe vendor name attribute of the VMD
modelNamethe model name attribute of the VMD
revisionthe 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.

Parameters
selfthe MmsServer instance to operate on
listenerthe listener that is called when a MMS status request is received
parametera 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

Parameters
selfthe MmsServer instance to operate on
vmdLogicalStatusthe logical status attribute of the VMD
vmdPhysicalStatusthe physical status attribute of the VMD
void MmsServer_startListening ( MmsServer  self,
int  tcpPort 
)

Start a new server thread and listen for incoming connections.

Parameters
selfthe MmsServer instance to operate on
tcpPortthe TCP port the server is listening on.
void MmsServer_startListeningThreadless ( MmsServer  self,
int  tcpPort 
)

Start a new server in non-threaded operation mode.

Parameters
selfthe MmsServer instance to operate on
tcpPortthe TCP port the server is listening on.
void MmsServer_stopListening ( MmsServer  self)

Stop server thread an all open connection threads.

Parameters
selfthe MmsServer instance to operate on
void MmsServer_stopListeningThreadless ( MmsServer  self)

Stop the server (for non-threaded operation mode)

Parameters
selfthe 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!

Parameters
selfthe 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.

Parameters
selfthe MmsServer instance to operate on
timeoutMsmaximum number of milliseconds to wait
Returns
1 if the server is ready, 0 if not or -1 on error
char* MmsServerConnection_getClientAddress ( MmsServerConnection  self)
IsoConnection MmsServerConnection_getIsoConnection ( MmsServerConnection  self)