libiec61850  1.2.0
iso_server.h
Go to the documentation of this file.
1 /*
2  * iso_server.h
3  *
4  * Copyright 2013 Michael Zillgith
5  *
6  * This file is part of libIEC61850.
7  *
8  * libIEC61850 is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * libIEC61850 is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * See COPYING file for the complete license text.
22  */
23 
24 #ifndef ISO_SERVER_H_
25 #define ISO_SERVER_H_
26 
27 #include "byte_buffer.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
38 typedef enum
39 {
45 
46 typedef struct sIsoServer* IsoServer;
47 
48 typedef enum
49 {
53 
54 typedef struct sIsoConnection* IsoConnection;
55 
56 typedef struct sIsoServerCallbacks
57 {
58  void
59  (*clientConnected)(IsoConnection connection);
61 
62 typedef void
63 (*ConnectionIndicationHandler)(IsoConnectionIndication indication,
64  void* parameter, IsoConnection connection);
65 
66 typedef void
67 (*MessageReceivedHandler)(void* parameter, ByteBuffer* message, ByteBuffer* response);
68 
69 char*
70 IsoConnection_getPeerAddress(IsoConnection self);
71 
72 void
73 IsoConnection_close(IsoConnection self);
74 
75 void
76 IsoConnection_installListener(IsoConnection self, MessageReceivedHandler handler,
77  void* parameter);
78 
79 void*
80 IsoConnection_getSecurityToken(IsoConnection self);
81 
88 void
89 IsoConnection_sendMessage(IsoConnection self, ByteBuffer* message, bool handlerMode);
90 
91 IsoServer
92 IsoServer_create(TLSConfiguration tlsConfiguration);
93 
94 void
95 IsoServer_setTcpPort(IsoServer self, int port);
96 
97 void
98 IsoServer_setLocalIpAddress(IsoServer self, const char* ipAddress);
99 
100 IsoServerState
101 IsoServer_getState(IsoServer self);
102 
103 void
105  void* parameter);
106 
107 void
108 IsoServer_setAuthenticator(IsoServer self, AcseAuthenticator authenticator, void* authenticatorParameter);
109 
111 IsoServer_getAuthenticator(IsoServer self);
112 
113 void*
115 
116 TLSConfiguration
117 IsoServer_getTLSConfiguration(IsoServer self);
118 
119 void
120 IsoServer_startListening(IsoServer self);
121 
122 void
123 IsoServer_stopListening(IsoServer self);
124 
125 
126 void
127 IsoServer_startListeningThreadless(IsoServer self);
128 
132 void
133 IsoServer_processIncomingMessages(IsoServer self);
134 
135 int
136 IsoServer_waitReady(IsoServer self, unsigned int timeoutMs);
137 
138 void
139 IsoServer_stopListeningThreadless(IsoServer self);
140 
141 void
142 IsoServer_closeConnection(IsoServer self, IsoConnection isoConnection);
143 
144 void
145 IsoServer_destroy(IsoServer self);
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
153 #endif /* ISO_SERVER_H_ */
Definition: iso_server.h:50
IsoConnectionIndication
Definition: iso_server.h:48
struct sIsoServer * IsoServer
Definition: iso_server.h:46
void IsoServer_startListening(IsoServer self)
void IsoServer_startListeningThreadless(IsoServer self)
struct sIsoConnection * IsoConnection
Definition: iso_server.h:54
void IsoServer_setConnectionHandler(IsoServer self, ConnectionIndicationHandler handler, void *parameter)
bool(* AcseAuthenticator)(void *parameter, AcseAuthenticationParameter authParameter, void **securityToken, IsoApplicationReference *appReference)
Callback function to authenticate a client.
Definition: iso_connection_parameters.h:105
Definition: iso_server.h:43
void(* MessageReceivedHandler)(void *parameter, ByteBuffer *message, ByteBuffer *response)
Definition: iso_server.h:67
IsoServerState
Definition: iso_server.h:38
AcseAuthenticator IsoServer_getAuthenticator(IsoServer self)
int IsoServer_waitReady(IsoServer self, unsigned int timeoutMs)
IsoServerState IsoServer_getState(IsoServer self)
Definition: iso_server.h:56
Definition: iso_server.h:51
TLSConfiguration IsoServer_getTLSConfiguration(IsoServer self)
Definition: iso_server.h:42
Definition: iso_server.h:40
void IsoServer_closeConnection(IsoServer self, IsoConnection isoConnection)
void IsoConnection_installListener(IsoConnection self, MessageReceivedHandler handler, void *parameter)
void IsoServer_processIncomingMessages(IsoServer self)
void IsoServer_stopListening(IsoServer self)
void * IsoServer_getAuthenticatorParameter(IsoServer self)
char * IsoConnection_getPeerAddress(IsoConnection self)
void IsoServer_stopListeningThreadless(IsoServer self)
void IsoServer_setLocalIpAddress(IsoServer self, const char *ipAddress)
void(* ConnectionIndicationHandler)(IsoConnectionIndication indication, void *parameter, IsoConnection connection)
Definition: iso_server.h:63
Definition: iso_server.h:41
void * IsoConnection_getSecurityToken(IsoConnection self)
void IsoServer_destroy(IsoServer self)
void IsoServer_setTcpPort(IsoServer self, int port)
IsoServer IsoServer_create(TLSConfiguration tlsConfiguration)
void IsoServer_setAuthenticator(IsoServer self, AcseAuthenticator authenticator, void *authenticatorParameter)
void IsoConnection_sendMessage(IsoConnection self, ByteBuffer *message, bool handlerMode)
send a message over an ISO connection
void IsoConnection_close(IsoConnection self)