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_connection_parameters.h
Go to the documentation of this file.
1 /*
2  * iso_connection_parameters.h
3  *
4  * Copyright 2013, 2014 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_CONNECTION_PARAMETERS_H_
25 #define ISO_CONNECTION_PARAMETERS_H_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
37 typedef enum
38 {
42 
43 
44 /* --> for compatibility with older versions (libiec61850 < 0.7.7) */
45 #ifndef AUTH_NONE
46 #define AUTH_NONE ACSE_AUTH_NONE
47 #endif
48 
49 #ifndef AUTH_PASSWORD
50 #define AUTH_PASSWORD ACSE_AUTH_PASSWORD
51 #endif
52 /* <-- for compatibility with older versions (libiec61850 < 0.7.7) */
53 
54 typedef struct sAcseAuthenticationParameter* AcseAuthenticationParameter;
55 
57 {
59  union
60  {
61  struct
62  {
63  uint8_t* octetString;
65  } password;
66  } value;
67 };
68 
69 AcseAuthenticationParameter
71 
72 void
73 AcseAuthenticationParameter_destroy(AcseAuthenticationParameter self);
74 
75 void
76 AcseAuthenticationParameter_setAuthMechanism(AcseAuthenticationParameter self, AcseAuthenticationMechanism mechanism);
77 
78 void
79 AcseAuthenticationParameter_setPassword(AcseAuthenticationParameter self, char* password);
80 
81 
91 typedef bool
92 (*AcseAuthenticator)(void* parameter, AcseAuthenticationParameter authParameter, void** securityToken);
93 
99 typedef struct {
100  uint8_t size;
101  uint8_t value[4];
102 } TSelector;
103 
105 {
106  AcseAuthenticationParameter acseAuthParameter;
107 
108  const char* hostname;
109  int tcpPort;
110 
111  uint8_t remoteApTitle[10];
114  uint32_t remotePSelector;
115  uint16_t remoteSSelector;
117 
118  uint8_t localApTitle[10];
121  uint32_t localPSelector;
122  uint16_t localSSelector;
124 
125 };
126 
127 typedef struct sIsoConnectionParameters* IsoConnectionParameters;
128 
137 IsoConnectionParameters
139 
148 void
149 IsoConnectionParameters_destroy(IsoConnectionParameters self);
150 
159 void
160 IsoConnectionParameters_setAcseAuthenticationParameter(IsoConnectionParameters self,
161  AcseAuthenticationParameter acseAuthParameter);
162 
173 void
174 IsoConnectionParameters_setTcpParameters(IsoConnectionParameters self, const char* hostname, int tcpPort);
175 
188 void
189 IsoConnectionParameters_setRemoteApTitle(IsoConnectionParameters self, const char* apTitle, int aeQualifier);
190 
203 void
204 IsoConnectionParameters_setRemoteAddresses(IsoConnectionParameters self, uint32_t pSelector, uint16_t sSelector, TSelector tSelector);
205 
218 void
219 IsoConnectionParameters_setLocalApTitle(IsoConnectionParameters self, char* apTitle, int aeQualifier);
220 
233 void
234 IsoConnectionParameters_setLocalAddresses(IsoConnectionParameters self, uint32_t pSelector, uint16_t sSelector, TSelector tSelector);
235 
238 #ifdef __cplusplus
239 }
240 #endif
241 
242 #endif /* ISO_CONNECTION_PARAMETERS_H_ */