libIEC61850
0.8.4
Open-source IEC 61850 MMS/GOOSE server and client library
Main Page
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
mms
inc
mms_common.h
Go to the documentation of this file.
1
/*
2
* mms_common.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
#include "libiec61850_common_api.h"
25
26
#ifndef MMS_COMMON_H_
27
#define MMS_COMMON_H_
28
29
#ifdef __cplusplus
30
extern
"C"
{
31
#endif
32
33
//TODO move to other file
34
#define DEFAULT_MAX_SERV_OUTSTANDING_CALLING 5
35
#define DEFAULT_MAX_SERV_OUTSTANDING_CALLED 5
36
#define DEFAULT_DATA_STRUCTURE_NESTING_LEVEL 10
37
#define DEFAULT_MAX_PDU_SIZE 65000
38
39
//TODO move to other file - not required in API
40
typedef
enum
41
{
42
MMS_ERROR
,
MMS_INITIATE
,
MMS_CONFIRMED_REQUEST
,
MMS_OK
,
MMS_CONCLUDE
43
}
MmsIndication
;
44
52
typedef
enum
53
{
54
/* generic error codes */
55
MMS_ERROR_NONE
= 0,
56
MMS_ERROR_CONNECTION_REJECTED
= 1,
57
MMS_ERROR_CONNECTION_LOST
= 2,
58
MMS_ERROR_SERVICE_TIMEOUT
= 3,
59
MMS_ERROR_PARSING_RESPONSE
= 4,
60
MMS_ERROR_HARDWARE_FAULT
= 5,
61
MMS_ERROR_CONCLUDE_REJECTED
= 6,
62
MMS_ERROR_OTHER
= 9,
63
64
/* confirmed error PDU codes */
65
MMS_ERROR_VMDSTATE_OTHER
= 10,
66
67
MMS_ERROR_APPLICATION_REFERENCE_OTHER
= 20,
68
69
MMS_ERROR_DEFINITION_OTHER
= 30,
70
MMS_ERROR_DEFINITION_INVALID_ADDRESS
= 31,
71
MMS_ERROR_DEFINITION_TYPE_UNSUPPORTED
= 32,
72
MMS_ERROR_DEFINITION_TYPE_INCONSISTENT
= 33,
73
MMS_ERROR_DEFINITION_OBJECT_UNDEFINED
= 34,
74
MMS_ERROR_DEFINITION_OBJECT_EXISTS
= 35,
75
MMS_ERROR_DEFINITION_OBJECT_ATTRIBUTE_INCONSISTENT
= 36,
76
77
MMS_ERROR_RESOURCE_OTHER
= 40,
78
MMS_ERROR_RESOURCE_CAPABILITY_UNAVAILABLE
= 41,
79
80
MMS_ERROR_SERVICE_OTHER
= 50,
81
82
MMS_ERROR_SERVICE_PREEMPT_OTHER
= 60,
83
84
MMS_ERROR_TIME_RESOLUTION_OTHER
= 70,
85
86
MMS_ERROR_ACCESS_OTHER
= 80,
87
MMS_ERROR_ACCESS_OBJECT_NON_EXISTENT
= 81,
88
MMS_ERROR_ACCESS_OBJECT_ACCESS_UNSUPPORTED
= 82,
89
MMS_ERROR_ACCESS_OBJECT_ACCESS_DENIED
= 83,
90
MMS_ERROR_ACCESS_OBJECT_INVALIDATED
= 84,
91
MMS_ERROR_ACCESS_OBJECT_VALUE_INVALID
= 85,
/* for DataAccessError 11 */
92
MMS_ERROR_ACCESS_TEMPORARILY_UNAVAILABLE
= 86,
/* for DataAccessError 2 */
93
94
MMS_ERROR_FILE_OTHER
= 90,
95
MMS_ERROR_FILE_FILENAME_AMBIGUOUS
= 91,
96
MMS_ERROR_FILE_FILE_BUSY
= 92,
97
MMS_ERROR_FILE_FILENAME_SYNTAX_ERROR
= 93,
98
MMS_ERROR_FILE_CONTENT_TYPE_INVALID
= 94,
99
MMS_ERROR_FILE_POSITION_INVALID
= 95,
100
MMS_ERROR_FILE_FILE_ACCESS_DENIED
= 96,
101
MMS_ERROR_FILE_FILE_NON_EXISTENT
= 97,
102
MMS_ERROR_FILE_DUPLICATE_FILENAME
= 98,
103
MMS_ERROR_FILE_INSUFFICIENT_SPACE_IN_FILESTORE
= 99,
104
105
/* reject codes */
106
MMS_ERROR_REJECT_OTHER
= 100,
107
MMS_ERROR_REJECT_UNKNOWN_PDU_TYPE
= 101,
108
MMS_ERROR_REJECT_INVALID_PDU
= 102,
109
MMS_ERROR_REJECT_UNRECOGNIZED_SERVICE
= 103,
110
MMS_ERROR_REJECT_UNRECOGNIZED_MODIFIER
= 104,
111
MMS_ERROR_REJECT_REQUEST_INVALID_ARGUMENT
= 105
112
113
}
MmsError
;
114
115
typedef
enum
ATTRIBUTE_PACKED
116
{
118
MMS_ARRAY
= 0,
120
MMS_STRUCTURE
= 1,
122
MMS_BOOLEAN
= 2,
124
MMS_BIT_STRING
= 3,
126
MMS_INTEGER
= 4,
128
MMS_UNSIGNED
= 5,
130
MMS_FLOAT
= 6,
132
MMS_OCTET_STRING
= 7,
134
MMS_VISIBLE_STRING
= 8,
135
MMS_GENERALIZED_TIME
= 9,
136
MMS_BINARY_TIME
= 10,
137
MMS_BCD
= 11,
138
MMS_OBJ_ID
= 12,
140
MMS_STRING
= 13,
142
MMS_UTC_TIME
= 14,
144
MMS_DATA_ACCESS_ERROR
= 15
145
}
MmsType
;
146
147
typedef
struct
sMmsDomain
MmsDomain;
148
149
typedef
struct
sMmsAccessSpecifier
150
{
151
MmsDomain*
domain
;
152
char
*
variableName
;
153
int
arrayIndex
;
/* -1 --> no index present / ignore index */
154
char
*
componentName
;
155
}
MmsAccessSpecifier
;
156
157
typedef
struct
158
{
159
char
*
domainId
;
160
char
*
itemId
;
161
int32_t
arrayIndex
;
/* -1 --> no index present / ignore index */
162
char
*
componentName
;
163
}
MmsVariableAccessSpecification
;
164
165
typedef
struct
sMmsNamedVariableList
* MmsNamedVariableList;
166
typedef
struct
sMmsAccessSpecifier*
MmsNamedVariableListEntry
;
167
171
#ifdef __cplusplus
172
}
173
#endif
174
175
#endif
/* MMS_COMMON_H_ */
Generated on Mon Feb 9 2015 11:48:53 for libIEC61850 by
1.8.4