libIEC61850  0.8.3
Open-source IEC 61850 MMS/GOOSE server and client library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
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
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(void);
93 
94 void
95 IsoServer_setTcpPort(IsoServer self, int port);
96 
97 void
98 IsoServer_setLocalIpAddress(IsoServer self, char* ipAddress);
99 
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 void
117 IsoServer_startListening(IsoServer self);
118 
119 void
120 IsoServer_stopListening(IsoServer self);
121 
122 
123 void
124 IsoServer_startListeningThreadless(IsoServer self);
125 
129 void
130 IsoServer_processIncomingMessages(IsoServer self);
131 
132 int
133 IsoServer_waitReady(IsoServer self, unsigned int timeoutMs);
134 
135 void
136 IsoServer_stopListeningThreadless(IsoServer self);
137 
138 void
139 IsoServer_closeConnection(IsoServer self, IsoConnection isoConnection);
140 
141 void
142 IsoServer_destroy(IsoServer self);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
150 #endif /* ISO_SERVER_H_ */