fixed VC++ 19 compatibility issues
[public/netxms.git] / include / nxcldefs.h
CommitLineData
bf6fb6c3
VK
1/*
2** NetXMS - Network Management System
3** Common defines for client library and server
4** Copyright (C) 2003-2014 Victor Kirhenshtein
5**
6** This program is free software; you can redistribute it and/or modify
7** it under the terms of the GNU Lesser General Public License as published by
8** the Free Software Foundation; either version 3 of the License, or
9** (at your option) any later version.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU Lesser General Public License
17** along with this program; if not, write to the Free Software
18** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19**
20** File: nxcldefs.h
21**
22**/
23
24#ifndef _nxcldefs_h_
25#define _nxcldefs_h_
26
27#include <nxlog.h>
0207b7dd 28#include <uuid.h>
bf6fb6c3
VK
29
30/**
31 * Some constants
32 */
33#define MAX_COMMUNITY_LENGTH 128
34#define MAX_OID_LENGTH 1024
35#define MAX_EVENT_MSG_LENGTH 2000
36#define MAX_EVENT_NAME 64
37#define MAX_USERTAG_LENGTH 64
38#define MAX_SESSION_NAME 256
39#define MAX_USER_NAME 64
40#define MAX_USER_FULLNAME 128
41#define MAX_USER_DESCR 256
42#define MAX_ITEM_NAME 1024
43#define MAX_STRING_VALUE 256
44#define MAX_VARIABLE_NAME 256
45#define MAX_AGENT_VERSION_LEN 64
46#define MAX_PLATFORM_NAME_LEN 64
47#define MAX_PACKAGE_NAME_LEN 64
e980db40 48#define MAX_NODE_SUBTYPE_LENGTH 128
bf6fb6c3
VK
49#define GROUP_EVERYONE ((UINT32)0x80000000)
50#define INVALID_UID ((UINT32)0xFFFFFFFF)
51#define OBJECT_STATUS_COUNT 9
52#define MAX_RCPT_ADDR_LEN 256
53#define MAX_EMAIL_SUBJECT_LEN 256
54#define MAC_ADDR_LENGTH 6
55#define CURRENT_USER ((UINT32)0xFFFFFFFF)
56#define MAX_DCI_DATA_RECORDS 200000
57#define MAX_POLICY_CONFIG_NAME 64
ce9e00cc 58#define MAX_INT32 0x7FFFFFFF
bf6fb6c3
VK
59
60/**
61 * NetXMS agent authentication methods
62 */
63#define AUTH_NONE 0
64#define AUTH_PLAINTEXT 1
65#define AUTH_MD5_HASH 2
66#define AUTH_SHA1_HASH 3
67
68/**
69 * Client-server authentication types
70 */
71#define NETXMS_AUTH_TYPE_PASSWORD 0
72#define NETXMS_AUTH_TYPE_CERTIFICATE 1
73#define NETXMS_AUTH_TYPE_SSO_TICKET 2
74
75/**
76 * Client type
77 */
78#define CLIENT_TYPE_DESKTOP 0
79#define CLIENT_TYPE_WEB 1
80#define CLIENT_TYPE_MOBILE 2
81#define CLIENT_TYPE_TABLET 3
82#define CLIENT_TYPE_APPLICATION 4
83
84/**
85 * Forced poll types
86 */
f7e3eb5a
VK
87#define POLL_STATUS 1
88#define POLL_CONFIGURATION_FULL 2
89#define POLL_INTERFACE_NAMES 3
90#define POLL_TOPOLOGY 4
91#define POLL_CONFIGURATION_NORMAL 5
92#define POLL_INSTANCE_DISCOVERY 6
bf6fb6c3
VK
93
94/**
95 * Object types
96 */
3df8bccd
Z
97#define OBJECT_GENERIC 0
98#define OBJECT_SUBNET 1
99#define OBJECT_NODE 2
100#define OBJECT_INTERFACE 3
101#define OBJECT_NETWORK 4
102#define OBJECT_CONTAINER 5
103#define OBJECT_ZONE 6
104#define OBJECT_SERVICEROOT 7
105#define OBJECT_TEMPLATE 8
106#define OBJECT_TEMPLATEGROUP 9
107#define OBJECT_TEMPLATEROOT 10
108#define OBJECT_NETWORKSERVICE 11
109#define OBJECT_VPNCONNECTOR 12
110#define OBJECT_CONDITION 13
111#define OBJECT_CLUSTER 14
112#define OBJECT_POLICYGROUP 15
113#define OBJECT_POLICYROOT 16
114#define OBJECT_AGENTPOLICY 17
115#define OBJECT_AGENTPOLICY_CONFIG 18
116#define OBJECT_NETWORKMAPROOT 19
117#define OBJECT_NETWORKMAPGROUP 20
118#define OBJECT_NETWORKMAP 21
119#define OBJECT_DASHBOARDROOT 22
120#define OBJECT_DASHBOARD 23
121#define OBJECT_BUSINESSSERVICEROOT 27
122#define OBJECT_BUSINESSSERVICE 28
123#define OBJECT_NODELINK 29
124#define OBJECT_SLMCHECK 30
125#define OBJECT_MOBILEDEVICE 31
126#define OBJECT_RACK 32
127#define OBJECT_ACCESSPOINT 33
128#define OBJECT_AGENTPOLICY_LOGPARSER 34
e4926628 129#define OBJECT_CHASSIS 35
d28084ec 130#define OBJECT_DASHBOARDGROUP 36
ce9e00cc 131#define OBJECT_SENSOR 37
bf6fb6c3
VK
132
133/** Base value for custom object classes */
e4926628 134#define OBJECT_CUSTOM 10000
bf6fb6c3
VK
135
136/**
137 * Object's status
138 */
139#define STATUS_NORMAL 0
140#define STATUS_WARNING 1
141#define STATUS_MINOR 2
142#define STATUS_MAJOR 3
143#define STATUS_CRITICAL 4
144#define STATUS_UNKNOWN 5
145#define STATUS_UNMANAGED 6
146#define STATUS_DISABLED 7
147#define STATUS_TESTING 8
148
149/**
150 * Event and alarm severity
151 */
152#define SEVERITY_NORMAL 0
153#define SEVERITY_WARNING 1
154#define SEVERITY_MINOR 2
155#define SEVERITY_MAJOR 3
156#define SEVERITY_CRITICAL 4
157#define SEVERITY_FROM_EVENT 5
158#define SEVERITY_TERMINATE 6
159#define SEVERITY_RESOLVE 7
160
161/**
162 * Alarm states
163 */
164#define ALARM_STATE_OUTSTANDING 0x00
165#define ALARM_STATE_ACKNOWLEDGED 0x01
166#define ALARM_STATE_RESOLVED 0x02
167#define ALARM_STATE_TERMINATED 0x03
168#define ALARM_STATE_MASK 0x0F /* mask for selecting alarm state */
169#define ALARM_STATE_STICKY 0x10 /* bit flag indicating sticky state */
170
171/**
172 * Alarm state in help desk system
173 */
174#define ALARM_HELPDESK_IGNORED 0
175#define ALARM_HELPDESK_OPEN 1
176#define ALARM_HELPDESK_CLOSED 2
177
178/**
8c433c4f 179 * Node capabilities
bf6fb6c3 180 */
91b3cba9 181#define NC_IS_SNMP 0x00000001
182#define NC_IS_NATIVE_AGENT 0x00000002
183#define NC_IS_BRIDGE 0x00000004
184#define NC_IS_ROUTER 0x00000008
185#define NC_IS_LOCAL_MGMT 0x00000010
186#define NC_IS_PRINTER 0x00000020
187#define NC_IS_OSPF 0x00000040
188#define NC_IS_CPSNMP 0x00000080 /* CheckPoint SNMP agent on port 260 */
189#define NC_IS_CDP 0x00000100
190#define NC_IS_NDP 0x00000200 /* Supports Nortel (Synoptics/Bay Networks) topology discovery */ /* SONMP is an old name for NDP */
191#define NC_IS_LLDP 0x00000400 /* Supports Link Layer Discovery Protocol */
192#define NC_IS_VRRP 0x00000800 /* VRRP support */
193#define NC_HAS_VLANS 0x00001000 /* VLAN information available */
194#define NC_IS_8021X 0x00002000 /* 802.1x support enabled on node */
195#define NC_IS_STP 0x00004000 /* Spanning Tree (IEEE 802.1d) enabled on node */
196#define NC_HAS_ENTITY_MIB 0x00008000 /* Supports ENTITY-MIB */
197#define NC_HAS_IFXTABLE 0x00010000 /* Supports ifXTable */
198#define NC_HAS_AGENT_IFXCOUNTERS 0x00020000 /* Agent supports 64-bit interface counters */
199#define NC_HAS_WINPDH 0x00040000 /* Node supports Windows PDH parameters */
200#define NC_IS_WIFI_CONTROLLER 0x00080000 /* Node is wireless network controller */
201#define NC_IS_SMCLP 0x00100000 /* Node supports SMCLP protocol */
202
203/**
204 * Flag separator
205 */
206#define DCF_COLLECTION_FLAGS 0x0000FFFF
8c433c4f
VK
207
208/**
209 * Node flags
210 */
91b3cba9 211#define NF_REMOTE_AGENT 0x00010000
212#define NF_DISABLE_DISCOVERY_POLL 0x00020000
213#define NF_DISABLE_TOPOLOGY_POLL 0x00040000
214#define NF_DISABLE_SNMP 0x00080000
215#define NF_DISABLE_NXCP 0x00100000
216#define NF_DISABLE_ICMP 0x00200000
217#define NF_FORCE_ENCRYPTION 0x00400000
218#define NF_DISABLE_ROUTE_POLL 0x00800000
219
220/**
221 * Data Collection flags first half of int
222 */
223#define DCF_DISABLE_STATUS_POLL 0x00000001
224#define DCF_DISABLE_CONF_POLL 0x00000002
225#define DCF_DISABLE_DATA_COLLECT 0x00000004
226
227
228/**
229 * Data Collection Object runtime (dynamic) flags first half of int
230 */
231#define DCDF_QUEUED_FOR_STATUS_POLL 0x0001
232#define DCDF_QUEUED_FOR_CONFIGURATION_POLL 0x0002
233#define DCDF_QUEUED_FOR_INSTANCE_POLL 0x0004
234#define DCDF_DELETE_IN_PROGRESS 0x0008
235#define DCDF_FORCE_STATUS_POLL 0x0010
236#define DCDF_FORCE_CONFIGURATION_POLL 0x0020
237#define DCDF_CONFIGURATION_POLL_PASSED 0x0040
238
239/**
240 * Node runtime (dynamic) flags
241 */
242#define NDF_QUEUED_FOR_TOPOLOGY_POLL 0x00010000
243#define NDF_QUEUED_FOR_DISCOVERY_POLL 0x00020000
244#define NDF_QUEUED_FOR_ROUTE_POLL 0x00040000
245#define NDF_RECHECK_CAPABILITIES 0x00100000
246
247/**
248 * Cluster status flags
249 */
250#define CLSF_DOWN 0x000001
251
252/**
253 * Node status flags
254 */
255#define NSF_UNREACHABLE 0x000001
256#define NSF_AGENT_UNREACHABLE 0x000002
257#define NSF_SNMP_UNREACHABLE 0x000004
258#define NSF_CPSNMP_UNREACHABLE 0x000020
259#define NSF_NETWORK_PATH_PROBLEM 0x000100
260#define NSF_CACHE_MODE_NOT_SUPPORTED 0x000200
261
262/**
263 * Sensor status flags
264 */
265#define SSF_PROVISIONED 0x000001
266#define SSF_REGISTERED 0x000002
267#define SSF_ACTIVE 0x000004
268#define SSF_CONF_UPDATE_PENDING 0x000008
269#define SSF_AGENT_UNREACHABLE 0x000010
bf6fb6c3
VK
270
271/**
272 * Template flags
273 */
274#define TF_AUTO_APPLY 0x00000001
275#define TF_AUTO_REMOVE 0x00000002
276
277/**
278 * Container flags
279 */
280#define CF_AUTO_BIND 0x00000001
281#define CF_AUTO_UNBIND 0x00000002
282
283/**
32a400d9
VK
284 * Chassis flags
285 */
286#define CHF_BIND_UNDER_CONTROLLER 0x00000001
287
288/**
bf6fb6c3
VK
289 * Interface flags
290 */
291#define IF_SYNTHETIC_MASK 0x00000001
292#define IF_PHYSICAL_PORT 0x00000002
293#define IF_EXCLUDE_FROM_TOPOLOGY 0x00000004
294#define IF_LOOPBACK 0x00000008
295#define IF_CREATED_MANUALLY 0x00000010
296#define IF_PEER_REFLECTION 0x00000020 /* topology information obtained by reflection */
297#define IF_EXPECTED_STATE_MASK 0x30000000 /* 2-bit field holding expected interface state */
298#define IF_USER_FLAGS_MASK (IF_EXCLUDE_FROM_TOPOLOGY) /* flags that can be changed by user */
299
300/**
301 * Expected interface states
302 */
303#define IF_EXPECTED_STATE_UP 0
304#define IF_EXPECTED_STATE_DOWN 1
305#define IF_EXPECTED_STATE_IGNORE 2
c908b63b
VK
306#define IF_EXPECTED_STATE_AUTO 3
307
308/**
309 * Default expected state for new interface creation
310 */
311#define IF_DEFAULT_EXPECTED_STATE_UP 0
312#define IF_DEFAULT_EXPECTED_STATE_AUTO 1
313#define IF_DEFAULT_EXPECTED_STATE_IGNORE 2
bf6fb6c3
VK
314
315/**
316 * Interface administrative states
317 */
42c6d15b
VK
318enum InterfaceAdminState
319{
320 IF_ADMIN_STATE_UNKNOWN = 0,
321 IF_ADMIN_STATE_UP = 1,
322 IF_ADMIN_STATE_DOWN = 2,
323 IF_ADMIN_STATE_TESTING = 3
324};
bf6fb6c3
VK
325
326/**
327 * Interface operational states
328 */
42c6d15b
VK
329enum InterfaceOperState
330{
dd50e399
VK
331 IF_OPER_STATE_UNKNOWN = 0,
332 IF_OPER_STATE_UP = 1,
333 IF_OPER_STATE_DOWN = 2,
334 IF_OPER_STATE_TESTING = 3,
335 IF_OPER_STATE_DORMANT = 4,
336 IF_OPER_STATE_NOT_PRESENT = 5
42c6d15b 337};
bf6fb6c3
VK
338
339/**
340 * Node ifXTable usage mode
341 */
342#define IFXTABLE_DEFAULT 0
343#define IFXTABLE_ENABLED 1
344#define IFXTABLE_DISABLED 2
345
346/**
347 * Status calculation and propagation algorithms
348 */
349#define SA_CALCULATE_DEFAULT 0
350#define SA_CALCULATE_MOST_CRITICAL 1
351#define SA_CALCULATE_SINGLE_THRESHOLD 2
352#define SA_CALCULATE_MULTIPLE_THRESHOLDS 3
353
354#define SA_PROPAGATE_DEFAULT 0
355#define SA_PROPAGATE_UNCHANGED 1
356#define SA_PROPAGATE_FIXED 2
357#define SA_PROPAGATE_RELATIVE 3
358#define SA_PROPAGATE_TRANSLATED 4
359
360/**
361 * Network map types
362 */
363#define MAP_TYPE_CUSTOM 0
364#define MAP_TYPE_LAYER2_TOPOLOGY 1
365#define MAP_TYPE_IP_TOPOLOGY 2
366
367/**
368 * Components that can be locked by management pack installer
369 */
370#define NXMP_LC_EVENTDB 0
371#define NXMP_LC_EPP 1
372#define NXMP_LC_TRAPCFG 2
373
374/**
375 * Network service types
376 */
377enum
378{
379 NETSRV_CUSTOM,
380 NETSRV_SSH,
381 NETSRV_POP3,
382 NETSRV_SMTP,
383 NETSRV_FTP,
384 NETSRV_HTTP,
385 NETSRV_HTTPS,
386 NETSRV_TELNET
387};
388
389/**
390 * Address list types
391 */
392#define ADDR_LIST_DISCOVERY_TARGETS 1
393#define ADDR_LIST_DISCOVERY_FILTER 2
394
395/**
396 * Discovery filter flags
397 */
398#define DFF_ALLOW_AGENT 0x0001
399#define DFF_ALLOW_SNMP 0x0002
400#define DFF_ONLY_RANGE 0x0004
401
402/**
403 * Connection point types
404 */
405#define CP_TYPE_INDIRECT 0
406#define CP_TYPE_DIRECT 1
407#define CP_TYPE_WIRELESS 2
a395910c 408#define CP_TYPE_UNKNOWN 3
bf6fb6c3
VK
409
410/**
411 * Events
412 */
413#define NXC_EVENT_CONNECTION_BROKEN 1
414#define NXC_EVENT_NEW_ELOG_RECORD 2
415#define NXC_EVENT_USER_DB_CHANGED 3
416#define NXC_EVENT_OBJECT_CHANGED 4
417#define NXC_EVENT_NOTIFICATION 5
418#define NXC_EVENT_DEPLOYMENT_STATUS 6
419#define NXC_EVENT_NEW_SYSLOG_RECORD 7
420#define NXC_EVENT_NEW_SNMP_TRAP 8
00420032 421//#define NXC_EVENT_SITUATION_UPDATE 9
bf6fb6c3
VK
422#define NXC_EVENT_JOB_CHANGE 10
423
424/**
425 * Session states (used both by client library and server)
426 */
427enum SessionState
428{
429 STATE_DISCONNECTED = 0,
430 STATE_CONNECTING = 1,
431 STATE_CONNECTED = 2,
432 STATE_AUTHENTICATED = 3
433};
434
435/**
436 * Notification codes
437 */
438#define NX_NOTIFY_SHUTDOWN 1
8d9ee864 439#define NX_NOTIFY_RELOAD_EVENT_DB 2
bf6fb6c3
VK
440#define NX_NOTIFY_ALARM_DELETED 3
441#define NX_NOTIFY_NEW_ALARM 4
442#define NX_NOTIFY_ALARM_CHANGED 5
443#define NX_NOTIFY_ACTION_CREATED 6
444#define NX_NOTIFY_ACTION_MODIFIED 7
445#define NX_NOTIFY_ACTION_DELETED 8
446#define NX_NOTIFY_OBJTOOLS_CHANGED 9
447#define NX_NOTIFY_DBCONN_STATUS 10
448#define NX_NOTIFY_ALARM_TERMINATED 11
449#define NX_NOTIFY_GRAPHS_CHANGED 12
450#define NX_NOTIFY_ETMPL_CHANGED 13
451#define NX_NOTIFY_ETMPL_DELETED 14
452#define NX_NOTIFY_OBJTOOL_DELETED 15
453#define NX_NOTIFY_TRAPCFG_CREATED 16
454#define NX_NOTIFY_TRAPCFG_MODIFIED 17
455#define NX_NOTIFY_TRAPCFG_DELETED 18
456#define NX_NOTIFY_MAPTBL_CHANGED 19
457#define NX_NOTIFY_MAPTBL_DELETED 20
458#define NX_NOTIFY_DCISUMTBL_CHANGED 21
459#define NX_NOTIFY_DCISUMTBL_DELETED 22
460#define NX_NOTIFY_CERTIFICATE_CHANGED 23
461#define NX_NOTIFY_ALARM_STATUS_FLOW_CHANGED 24
462#define NX_NOTIFY_FILE_LIST_CHANGED 25
463#define NX_NOTIFY_FILE_MONITORING_FAILED 26
464#define NX_NOTIFY_SESSION_KILLED 27
8284dc9a 465#define NX_NOTIFY_GRAPHS_DELETED 28
b3beb7f4 466#define NX_NOTIFY_SCHEDULE_UPDATE 29
6a6b96c0
EJ
467#define NX_NOTIFY_ALARM_CATEGORY_UPDATE 30
468#define NX_NOTIFY_ALARM_CATEGORY_DELETE 31
a881eafa
VK
469#define NX_NOTIFY_MULTIPLE_ALARMS_TERMINATED 32
470#define NX_NOTIFY_MULTIPLE_ALARMS_RESOLVED 33
6da535d9 471#define NX_NOTIFY_FORCE_DCI_POLL 34
bf6fb6c3
VK
472
473/**
474 * Request completion codes
475 */
3b89a4c1
VK
476#define RCC_SUCCESS ((UINT32)0)
477#define RCC_COMPONENT_LOCKED ((UINT32)1)
478#define RCC_ACCESS_DENIED ((UINT32)2)
479#define RCC_INVALID_REQUEST ((UINT32)3)
480#define RCC_TIMEOUT ((UINT32)4)
481#define RCC_OUT_OF_STATE_REQUEST ((UINT32)5)
482#define RCC_DB_FAILURE ((UINT32)6)
483#define RCC_INVALID_OBJECT_ID ((UINT32)7)
484#define RCC_ALREADY_EXIST ((UINT32)8)
485#define RCC_COMM_FAILURE ((UINT32)9)
486#define RCC_SYSTEM_FAILURE ((UINT32)10)
487#define RCC_INVALID_USER_ID ((UINT32)11)
488#define RCC_INVALID_ARGUMENT ((UINT32)12)
489#define RCC_DUPLICATE_DCI ((UINT32)13)
490#define RCC_INVALID_DCI_ID ((UINT32)14)
491#define RCC_OUT_OF_MEMORY ((UINT32)15)
492#define RCC_IO_ERROR ((UINT32)16)
493#define RCC_INCOMPATIBLE_OPERATION ((UINT32)17)
494#define RCC_OBJECT_CREATION_FAILED ((UINT32)18)
495#define RCC_OBJECT_LOOP ((UINT32)19)
496#define RCC_INVALID_OBJECT_NAME ((UINT32)20)
497#define RCC_INVALID_ALARM_ID ((UINT32)21)
498#define RCC_INVALID_ACTION_ID ((UINT32)22)
499#define RCC_OPERATION_IN_PROGRESS ((UINT32)23)
500#define RCC_DCI_COPY_ERRORS ((UINT32)24)
501#define RCC_INVALID_EVENT_CODE ((UINT32)25)
502#define RCC_NO_WOL_INTERFACES ((UINT32)26)
503#define RCC_NO_MAC_ADDRESS ((UINT32)27)
504#define RCC_NOT_IMPLEMENTED ((UINT32)28)
505#define RCC_INVALID_TRAP_ID ((UINT32)29)
506#define RCC_DCI_NOT_SUPPORTED ((UINT32)30)
507#define RCC_VERSION_MISMATCH ((UINT32)31)
508#define RCC_NPI_PARSE_ERROR ((UINT32)32)
509#define RCC_DUPLICATE_PACKAGE ((UINT32)33)
510#define RCC_PACKAGE_FILE_EXIST ((UINT32)34)
511#define RCC_RESOURCE_BUSY ((UINT32)35)
512#define RCC_INVALID_PACKAGE_ID ((UINT32)36)
513#define RCC_INVALID_IP_ADDR ((UINT32)37)
514#define RCC_ACTION_IN_USE ((UINT32)38)
515#define RCC_VARIABLE_NOT_FOUND ((UINT32)39)
516#define RCC_BAD_PROTOCOL ((UINT32)40)
517#define RCC_ADDRESS_IN_USE ((UINT32)41)
518#define RCC_NO_CIPHERS ((UINT32)42)
519#define RCC_INVALID_PUBLIC_KEY ((UINT32)43)
520#define RCC_INVALID_SESSION_KEY ((UINT32)44)
521#define RCC_NO_ENCRYPTION_SUPPORT ((UINT32)45)
522#define RCC_INTERNAL_ERROR ((UINT32)46)
523#define RCC_EXEC_FAILED ((UINT32)47)
524#define RCC_INVALID_TOOL_ID ((UINT32)48)
525#define RCC_SNMP_ERROR ((UINT32)49)
526#define RCC_BAD_REGEXP ((UINT32)50)
527#define RCC_UNKNOWN_PARAMETER ((UINT32)51)
528#define RCC_FILE_IO_ERROR ((UINT32)52)
529#define RCC_CORRUPTED_MIB_FILE ((UINT32)53)
530#define RCC_TRANSFER_IN_PROGRESS ((UINT32)54)
531#define RCC_INVALID_JOB_ID ((UINT32)55)
532#define RCC_INVALID_SCRIPT_ID ((UINT32)56)
533#define RCC_INVALID_SCRIPT_NAME ((UINT32)57)
534#define RCC_UNKNOWN_MAP_NAME ((UINT32)58)
535#define RCC_INVALID_MAP_ID ((UINT32)59)
536#define RCC_ACCOUNT_DISABLED ((UINT32)60)
537#define RCC_NO_GRACE_LOGINS ((UINT32)61)
538#define RCC_CONNECTION_BROKEN ((UINT32)62)
539#define RCC_INVALID_CONFIG_ID ((UINT32)63)
540#define RCC_DB_CONNECTION_LOST ((UINT32)64)
541#define RCC_ALARM_OPEN_IN_HELPDESK ((UINT32)65)
542#define RCC_ALARM_NOT_OUTSTANDING ((UINT32)66)
543#define RCC_NOT_PUSH_DCI ((UINT32)67)
544#define RCC_CONFIG_PARSE_ERROR ((UINT32)68)
545#define RCC_CONFIG_VALIDATION_ERROR ((UINT32)69)
546#define RCC_INVALID_GRAPH_ID ((UINT32)70)
547#define RCC_LOCAL_CRYPTO_ERROR ((UINT32)71)
548#define RCC_UNSUPPORTED_AUTH_TYPE ((UINT32)72)
549#define RCC_BAD_CERTIFICATE ((UINT32)73)
550#define RCC_INVALID_CERT_ID ((UINT32)74)
551#define RCC_SNMP_FAILURE ((UINT32)75)
552#define RCC_NO_L2_TOPOLOGY_SUPPORT ((UINT32)76)
553#define RCC_INVALID_PSTORAGE_KEY ((UINT32)77)
554#define RCC_NO_SUCH_INSTANCE ((UINT32)78)
555#define RCC_INVALID_EVENT_ID ((UINT32)79)
556#define RCC_AGENT_ERROR ((UINT32)80)
557#define RCC_UNKNOWN_VARIABLE ((UINT32)81)
558#define RCC_RESOURCE_NOT_AVAILABLE ((UINT32)82)
559#define RCC_JOB_CANCEL_FAILED ((UINT32)83)
560#define RCC_INVALID_POLICY_ID ((UINT32)84)
561#define RCC_UNKNOWN_LOG_NAME ((UINT32)85)
562#define RCC_INVALID_LOG_HANDLE ((UINT32)86)
563#define RCC_WEAK_PASSWORD ((UINT32)87)
564#define RCC_REUSED_PASSWORD ((UINT32)88)
565#define RCC_INVALID_SESSION_HANDLE ((UINT32)89)
566#define RCC_CLUSTER_MEMBER_ALREADY ((UINT32)90)
567#define RCC_JOB_HOLD_FAILED ((UINT32)91)
568#define RCC_JOB_UNHOLD_FAILED ((UINT32)92)
569#define RCC_ZONE_ID_ALREADY_IN_USE ((UINT32)93)
570#define RCC_INVALID_ZONE_ID ((UINT32)94)
571#define RCC_ZONE_NOT_EMPTY ((UINT32)95)
572#define RCC_NO_COMPONENT_DATA ((UINT32)96)
573#define RCC_INVALID_ALARM_NOTE_ID ((UINT32)97)
574#define RCC_ENCRYPTION_ERROR ((UINT32)98)
575#define RCC_INVALID_MAPPING_TABLE_ID ((UINT32)99)
576#define RCC_NO_SOFTWARE_PACKAGE_DATA ((UINT32)100)
577#define RCC_INVALID_SUMMARY_TABLE_ID ((UINT32)101)
578#define RCC_USER_LOGGED_IN ((UINT32)102)
579#define RCC_XML_PARSE_ERROR ((UINT32)103)
580#define RCC_HIGH_QUERY_COST ((UINT32)104)
581#define RCC_LICENSE_VIOLATION ((UINT32)105)
582#define RCC_CLIENT_LICENSE_EXCEEDED ((UINT32)106)
583#define RCC_OBJECT_ALREADY_EXISTS ((UINT32)107)
584#define RCC_NO_HDLINK ((UINT32)108)
585#define RCC_HDLINK_COMM_FAILURE ((UINT32)109)
586#define RCC_HDLINK_ACCESS_DENIED ((UINT32)110)
587#define RCC_HDLINK_INTERNAL_ERROR ((UINT32)111)
588#define RCC_NO_LDAP_CONNECTION ((UINT32)112)
589#define RCC_NO_ROUTING_TABLE ((UINT32)113)
590#define RCC_NO_FDB ((UINT32)114)
591#define RCC_NO_LOCATION_HISTORY ((UINT32)115)
592#define RCC_OBJECT_IN_USE ((UINT32)116)
593#define RCC_NXSL_COMPILATION_ERROR ((UINT32)117)
594#define RCC_NXSL_EXECUTION_ERROR ((UINT32)118)
595#define RCC_UNKNOWN_CONFIG_VARIABLE ((UINT32)119)
596#define RCC_UNSUPPORTED_AUTH_METHOD ((UINT32)120)
597#define RCC_NAME_ALEARDY_EXISTS ((UINT32)121)
598#define RCC_CATEGORY_IN_USE ((UINT32)122)
599#define RCC_CATEGORY_NAME_EMPTY ((UINT32)123)
600#define RCC_AGENT_FILE_DOWNLOAD_ERROR ((UINT32)124)
601#define RCC_INVALID_TUNNEL_ID ((UINT32)125)
8ad8cbe8 602#define RCC_FILE_ALREADY_EXISTS ((UINT32)126)
603#define RCC_FOLDER_ALREADY_EXISTS ((UINT32)127)
bf6fb6c3
VK
604
605/**
606 * Mask bits for NXCModifyEventTemplate()
607 */
608#define EM_SEVERITY ((UINT32)0x01)
609#define EM_FLAGS ((UINT32)0x02)
610#define EM_NAME ((UINT32)0x04)
611#define EM_MESSAGE ((UINT32)0x08)
612#define EM_DESCRIPTION ((UINT32)0x10)
613#define EM_ALL ((UINT32)0x1F)
614
615/**
616 * Mask bits (flags) for NXCModifyObject()
617 */
618#define OBJ_UPDATE_NAME ((QWORD)_ULL(0x0000000001))
619#define OBJ_UPDATE_AGENT_PORT ((QWORD)_ULL(0x0000000002))
620#define OBJ_UPDATE_AGENT_AUTH ((QWORD)_ULL(0x0000000004))
621#define OBJ_UPDATE_AGENT_SECRET ((QWORD)_ULL(0x0000000008))
622#define OBJ_UPDATE_SNMP_VERSION ((QWORD)_ULL(0x0000000010))
623#define OBJ_UPDATE_SNMP_AUTH ((QWORD)_ULL(0x0000000020))
624#define OBJ_UPDATE_ACL ((QWORD)_ULL(0x0000000040))
625#define OBJ_UPDATE_GEOLOCATION ((QWORD)_ULL(0x0000000080))
626#define OBJ_UPDATE_SYNC_NETS ((QWORD)_ULL(0x0000000100))
627#define OBJ_UPDATE_SERVICE_TYPE ((QWORD)_ULL(0x0000000200))
628#define OBJ_UPDATE_IP_PROTO ((QWORD)_ULL(0x0000000400))
629#define OBJ_UPDATE_IP_PORT ((QWORD)_ULL(0x0000000800))
630#define OBJ_UPDATE_CHECK_REQUEST ((QWORD)_ULL(0x0000001000))
631#define OBJ_UPDATE_CHECK_RESPONSE ((QWORD)_ULL(0x0000002000))
632#define OBJ_UPDATE_POLLER_NODE ((QWORD)_ULL(0x0000004000))
633#define OBJ_UPDATE_IP_ADDR ((QWORD)_ULL(0x0000008000))
634#define OBJ_UPDATE_PEER_GATEWAY ((QWORD)_ULL(0x0000010000))
635#define OBJ_UPDATE_NETWORK_LIST ((QWORD)_ULL(0x0000020000))
636#define OBJ_UPDATE_STATUS_ALG ((QWORD)_ULL(0x0000040000))
637#define OBJ_UPDATE_PROXY_NODE ((QWORD)_ULL(0x0000080000))
638#define OBJ_UPDATE_FLAGS ((QWORD)_ULL(0x0000100000))
639#define OBJ_UPDATE_ACT_EVENT ((QWORD)_ULL(0x0000200000))
640#define OBJ_UPDATE_DEACT_EVENT ((QWORD)_ULL(0x0000400000))
641#define OBJ_UPDATE_SOURCE_OBJECT ((QWORD)_ULL(0x0000800000))
642#define OBJ_UPDATE_ACTIVE_STATUS ((QWORD)_ULL(0x0001000000))
643#define OBJ_UPDATE_INACTIVE_STATUS ((QWORD)_ULL(0x0002000000))
644#define OBJ_UPDATE_DCI_LIST ((QWORD)_ULL(0x0004000000))
645#define OBJ_UPDATE_SCRIPT ((QWORD)_ULL(0x0008000000))
646#define OBJ_UPDATE_CLUSTER_TYPE ((QWORD)_ULL(0x0010000000))
647#define OBJ_UPDATE_RESOURCES ((QWORD)_ULL(0x0020000000))
648#define OBJ_UPDATE_SNMP_PROXY ((QWORD)_ULL(0x0040000000))
649#define OBJ_UPDATE_REQUIRED_POLLS ((QWORD)_ULL(0x0080000000))
650#define OBJ_UPDATE_TRUSTED_NODES ((QWORD)_ULL(0x0100000000))
651#define OBJ_UPDATE_CUSTOM_ATTRS ((QWORD)_ULL(0x0200000000))
652#define OBJ_UPDATE_USE_IFXTABLE ((QWORD)_ULL(0x0400000000))
653#define OBJ_UPDATE_AUTOBIND ((QWORD)_ULL(0x1000000000))
654#define OBJ_UPDATE_SNMP_PORT ((QWORD)_ULL(0x2000000000))
655#define OBJ_UPDATE_PRIMARY_NAME ((QWORD)_ULL(0x4000000000))
656
657/**
658 * Global user rights
659 */
660#ifndef NETXMS_CUSTOM_USER_RIGHTS
661
6a6b96c0
EJ
662#define SYSTEM_ACCESS_MANAGE_USERS _ULL(0x000000000001)
663#define SYSTEM_ACCESS_SERVER_CONFIG _ULL(0x000000000002)
664#define SYSTEM_ACCESS_CONFIGURE_TRAPS _ULL(0x000000000004)
665#define SYSTEM_ACCESS_MANAGE_SESSIONS _ULL(0x000000000008)
666#define SYSTEM_ACCESS_VIEW_EVENT_DB _ULL(0x000000000010)
667#define SYSTEM_ACCESS_EDIT_EVENT_DB _ULL(0x000000000020)
668#define SYSTEM_ACCESS_EPP _ULL(0x000000000040)
669#define SYSTEM_ACCESS_MANAGE_ACTIONS _ULL(0x000000000080)
670#define SYSTEM_ACCESS_DELETE_ALARMS _ULL(0x000000000100)
671#define SYSTEM_ACCESS_MANAGE_PACKAGES _ULL(0x000000000200)
672#define SYSTEM_ACCESS_VIEW_EVENT_LOG _ULL(0x000000000400)
673#define SYSTEM_ACCESS_MANAGE_TOOLS _ULL(0x000000000800)
674#define SYSTEM_ACCESS_MANAGE_SCRIPTS _ULL(0x000000001000)
675#define SYSTEM_ACCESS_VIEW_TRAP_LOG _ULL(0x000000002000)
676#define SYSTEM_ACCESS_VIEW_AUDIT_LOG _ULL(0x000000004000)
677#define SYSTEM_ACCESS_MANAGE_AGENT_CFG _ULL(0x000000008000)
085c017a 678#define SYSTEM_ACCESS_PERSISTENT_STORAGE _ULL(0x000000010000)
6a6b96c0
EJ
679#define SYSTEM_ACCESS_SEND_SMS _ULL(0x000000020000)
680#define SYSTEM_ACCESS_MOBILE_DEVICE_LOGIN _ULL(0x000000040000)
681#define SYSTEM_ACCESS_REGISTER_AGENTS _ULL(0x000000080000)
682#define SYSTEM_ACCESS_READ_SERVER_FILES _ULL(0x000000100000)
683#define SYSTEM_ACCESS_SERVER_CONSOLE _ULL(0x000000200000)
684#define SYSTEM_ACCESS_MANAGE_SERVER_FILES _ULL(0x000000400000)
685#define SYSTEM_ACCESS_MANAGE_MAPPING_TBLS _ULL(0x000000800000)
686#define SYSTEM_ACCESS_MANAGE_SUMMARY_TBLS _ULL(0x000001000000)
687#define SYSTEM_ACCESS_REPORTING_SERVER _ULL(0x000002000000)
688#define SYSTEM_ACCESS_XMPP_COMMANDS _ULL(0x000004000000)
689#define SYSTEM_ACCESS_MANAGE_IMAGE_LIB _ULL(0x000008000000)
690#define SYSTEM_ACCESS_UNLINK_ISSUES _ULL(0x000010000000)
691#define SYSTEM_ACCESS_VIEW_SYSLOG _ULL(0x000020000000)
692#define SYSTEM_ACCESS_USER_SCHEDULED_TASKS _ULL(0x000040000000)
693#define SYSTEM_ACCESS_OWN_SCHEDULED_TASKS _ULL(0x000080000000)
694#define SYSTEM_ACCESS_ALL_SCHEDULED_TASKS _ULL(0x000100000000)
695#define SYSTEM_ACCESS_SCHEDULE_SCRIPT _ULL(0x000200000000)
696#define SYSTEM_ACCESS_SCHEDULE_FILE_UPLOAD _ULL(0x000400000000)
697#define SYSTEM_ACCESS_SCHEDULE_MAINTENANCE _ULL(0x000800000000)
698#define SYSTEM_ACCESS_MANAGE_REPOSITORIES _ULL(0x001000000000)
699#define SYSTEM_ACCESS_VIEW_REPOSITORIES _ULL(0x002000000000)
700#define SYSTEM_ACCESS_VIEW_ALL_ALARMS _ULL(0x004000000000)
701
702#define SYSTEM_ACCESS_FULL _ULL(0x007FFFFFFFFF)
bf6fb6c3
VK
703
704#endif /* NETXMS_CUSTOM_USER_RIGHTS */
705
706/**
707 * Object access rights
708 */
709#define OBJECT_ACCESS_READ 0x00000001
710#define OBJECT_ACCESS_MODIFY 0x00000002
711#define OBJECT_ACCESS_CREATE 0x00000004
712#define OBJECT_ACCESS_DELETE 0x00000008
713#define OBJECT_ACCESS_READ_ALARMS 0x00000010
714#define OBJECT_ACCESS_ACL 0x00000020
715#define OBJECT_ACCESS_UPDATE_ALARMS 0x00000040
716#define OBJECT_ACCESS_SEND_EVENTS 0x00000080
717#define OBJECT_ACCESS_CONTROL 0x00000100
718#define OBJECT_ACCESS_TERM_ALARMS 0x00000200
719#define OBJECT_ACCESS_PUSH_DATA 0x00000400
720#define OBJECT_ACCESS_CREATE_ISSUE 0x00000800
721#define OBJECT_ACCESS_DOWNLOAD 0x00001000
722#define OBJECT_ACCESS_UPLOAD 0x00002000
723#define OBJECT_ACCESS_MANAGE_FILES 0x00004000
b97ddf57 724#define OBJECT_ACCESS_MAINTENANCE 0x00008000
bf6fb6c3
VK
725
726/**
727 * Object sync flags
728 */
729#define OBJECT_SYNC_SEND_UPDATES 0x0001
730#define OBJECT_SYNC_DUAL_CONFIRM 0x0002
731
732/**
733 * User/group flags
734 */
735#define UF_MODIFIED 0x0001
736#define UF_DELETED 0x0002
737#define UF_DISABLED 0x0004
738#define UF_CHANGE_PASSWORD 0x0008
739#define UF_CANNOT_CHANGE_PASSWORD 0x0010
740#define UF_INTRUDER_LOCKOUT 0x0020
741#define UF_PASSWORD_NEVER_EXPIRES 0x0040
742#define UF_LDAP_USER 0x0080
743#define UF_SYNC_EXCEPTION 0x0100
27858eaa 744#define UF_CLOSE_OTHER_SESSIONS 0x0200
bf6fb6c3
VK
745
746/**
747 * Fields for NXCModifyUserEx
748 */
749#define USER_MODIFY_LOGIN_NAME 0x00000001
750#define USER_MODIFY_DESCRIPTION 0x00000002
751#define USER_MODIFY_FULL_NAME 0x00000004
752#define USER_MODIFY_FLAGS 0x00000008
753#define USER_MODIFY_ACCESS_RIGHTS 0x00000010
754#define USER_MODIFY_MEMBERS 0x00000020
755#define USER_MODIFY_CERT_MAPPING 0x00000040
756#define USER_MODIFY_AUTH_METHOD 0x00000080
757#define USER_MODIFY_PASSWD_LENGTH 0x00000100
758#define USER_MODIFY_TEMP_DISABLE 0x00000200
759#define USER_MODIFY_CUSTOM_ATTRIBUTES 0x00000400
760#define USER_MODIFY_XMPP_ID 0x00000800
761#define USER_MODIFY_GROUP_MEMBERSHIP 0x00001000
762
763/**
764 * User certificate mapping methods
765 */
766#define USER_MAP_CERT_BY_SUBJECT 0
767#define USER_MAP_CERT_BY_PUBKEY 1
768#define USER_MAP_CERT_BY_CN 2
769
770/**
771 * User database change notification types
772 */
773#define USER_DB_CREATE 0
774#define USER_DB_DELETE 1
775#define USER_DB_MODIFY 2
776
777/**
bf6fb6c3
VK
778 * Data collection object types
779 */
780#define DCO_TYPE_GENERIC 0
781#define DCO_TYPE_ITEM 1
782#define DCO_TYPE_TABLE 2
87fff547 783#define DCO_TYPE_LIST 3
bf6fb6c3
VK
784
785/**
786 * DCI flags
787 */
788#define DCF_ADVANCED_SCHEDULE ((UINT16)0x0001)
789#define DCF_ALL_THRESHOLDS ((UINT16)0x0002)
790#define DCF_RAW_VALUE_OCTET_STRING ((UINT16)0x0004)
791#define DCF_SHOW_ON_OBJECT_TOOLTIP ((UINT16)0x0008)
792#define DCF_AGGREGATE_FUNCTION_MASK ((UINT16)0x0070)
793#define DCF_AGGREGATE_ON_CLUSTER ((UINT16)0x0080)
794#define DCF_TRANSFORM_AGGREGATED ((UINT16)0x0100)
795#define DCF_NO_STORAGE ((UINT16)0x0200)
1fa2ca0e
VK
796#define DCF_CALCULATE_NODE_STATUS ((UINT16)0x0400)
797#define DCF_SHOW_IN_OBJECT_OVERVIEW ((UINT16)0x0800)
9708eff4 798#define DCF_CACHE_MODE_MASK ((UINT16)0x3000)
b9a4ef7c 799#define DCF_AGGREGATE_WITH_ERRORS ((UINT16)0x4000)
bf6fb6c3
VK
800
801/**
802 * Get cluster aggregation function from DCI flags
803 */
804#define DCF_GET_AGGREGATION_FUNCTION(flags) (((flags) & DCF_AGGREGATE_FUNCTION_MASK) >> 4)
9708eff4
VK
805
806/**
807 * Set cluster aggregation function in DCI flags
808 */
bf6fb6c3
VK
809#define DCF_SET_AGGREGATION_FUNCTION(flags,func) (((flags) & ~DCF_AGGREGATE_FUNCTION_MASK) | (((func) & 0x07) << 4))
810
811/**
9708eff4
VK
812 * Get cache mode from DCI flags
813 */
814#define DCF_GET_CACHE_MODE(flags) (((flags) & DCF_CACHE_MODE_MASK) >> 12)
815
816/**
817 * Set cache mode in DCI flags
818 */
819#define DCF_SET_CACHE_MODE(flags,mode) (((flags) & ~DCF_CACHE_MODE_MASK) | (((mode) & 0x03) << 12))
820
821/**
bf6fb6c3
VK
822 * DCTable column flags
823 */
824#define TCF_DATA_TYPE_MASK ((UINT16)0x000F)
825#define TCF_AGGREGATE_FUNCTION_MASK ((UINT16)0x0070)
826#define TCF_INSTANCE_COLUMN ((UINT16)0x0100)
827#define TCF_INSTANCE_LABEL_COLUMN ((UINT16)0x0200)
828
829/**
830 * Get cluster aggregation function from column flags
831 */
832#define TCF_GET_AGGREGATION_FUNCTION(flags) (((flags) & TCF_AGGREGATE_FUNCTION_MASK) >> 4)
833#define TCF_SET_AGGREGATION_FUNCTION(flags,func) (((flags) & ~DCF_AGGREGATE_FUNCTION_MASK) | (((func) & 0x07) << 4))
834
835/**
836 * Get data type from column flags
837 */
838#define TCF_GET_DATA_TYPE(flags) ((flags) & TCF_DATA_TYPE_MASK)
839#define TCF_SET_DATA_TYPE(flags,dt) (((flags) & ~TCF_DATA_TYPE_MASK) | ((dt) & 0x0F))
840
841/**
842 * Aggregation functions
843 */
844#define DCF_FUNCTION_SUM 0
845#define DCF_FUNCTION_AVG 1
846#define DCF_FUNCTION_MIN 2
847#define DCF_FUNCTION_MAX 3
848
849/**
850 * SNMP raw types
851 */
852#define SNMP_RAWTYPE_NONE 0
853#define SNMP_RAWTYPE_INT32 1
854#define SNMP_RAWTYPE_UINT32 2
855#define SNMP_RAWTYPE_INT64 3
856#define SNMP_RAWTYPE_UINT64 4
857#define SNMP_RAWTYPE_DOUBLE 5
858#define SNMP_RAWTYPE_IP_ADDR 6
859#define SNMP_RAWTYPE_MAC_ADDR 7
860
861/**
862 * Data sources
863 */
864#define DS_INTERNAL 0
865#define DS_NATIVE_AGENT 1
866#define DS_SNMP_AGENT 2
867#define DS_CHECKPOINT_AGENT 3
868#define DS_PUSH_AGENT 4
869#define DS_WINPERF 5
870#define DS_SMCLP 6
871#define DS_SCRIPT 7
241541f4 872#define DS_SSH 8
453d3387 873#define DS_MQTT 9
bf6fb6c3
VK
874
875/**
876 * Item status
877 */
878#define ITEM_STATUS_ACTIVE 0
879#define ITEM_STATUS_DISABLED 1
880#define ITEM_STATUS_NOT_SUPPORTED 2
881
882/**
883 * Delta calculation methods for DCIs
884 */
885#define DCM_ORIGINAL_VALUE 0
886#define DCM_SIMPLE 1
887#define DCM_AVERAGE_PER_SECOND 2
888#define DCM_AVERAGE_PER_MINUTE 3
889
890/**
891 * Threshold functions
892 */
893#define F_LAST 0
894#define F_AVERAGE 1
895#define F_DEVIATION 2
896#define F_DIFF 3
897#define F_ERROR 4
898#define F_SUM 5
899#define F_SCRIPT 6
900
901/**
902 * DCI aggregation functions
903 */
904enum AggregationFunction
905{
906 DCI_AGG_LAST = 0,
907 DCI_AGG_MIN = 1,
908 DCI_AGG_MAX = 2,
909 DCI_AGG_AVG = 3,
910 DCI_AGG_SUM = 4
911};
912
913/**
914 * Threshold operations
915 */
916#define OP_LE 0
917#define OP_LE_EQ 1
918#define OP_EQ 2
919#define OP_GT_EQ 3
920#define OP_GT 4
921#define OP_NE 5
922#define OP_LIKE 6
923#define OP_NOTLIKE 7
924
925/**
926 * DCI base units
927 */
928#define DCI_BASEUNITS_OTHER 0
929#define DCI_BASEUNITS_CUSTOM 1
930#define DCI_BASEUNITS_BYTES 2
931#define DCI_BASEUNITS_BITS 3
932#define DCI_BASEUNITS_SECONDS 4
933#define DCI_BASEUNITS_PERCENTS 5
934#define DCI_BASEUNITS_BITS_PER_SECOND 6
935#define DCI_BASEUNITS_BYTES_PER_SECOND 7
936
937/**
938 * DCI instance discovery methods
939 */
940#define IDM_NONE 0
941#define IDM_AGENT_LIST 1
942#define IDM_AGENT_TABLE 2
943#define IDM_SNMP_WALK_VALUES 3
944#define IDM_SNMP_WALK_OIDS 4
d32e7ef1 945#define IDM_SCRIPT 5
bf6fb6c3
VK
946
947/**
948 * Event policy rule flags
949 */
950#define RF_STOP_PROCESSING 0x0001
951#define RF_NEGATED_SOURCE 0x0002
952#define RF_NEGATED_EVENTS 0x0004
953#define RF_GENERATE_ALARM 0x0008
954#define RF_DISABLED 0x0010
955#define RF_TERMINATE_BY_REGEXP 0x0020
956#define RF_SEVERITY_INFO 0x0100
957#define RF_SEVERITY_WARNING 0x0200
958#define RF_SEVERITY_MINOR 0x0400
959#define RF_SEVERITY_MAJOR 0x0800
960#define RF_SEVERITY_CRITICAL 0x1000
89d684e3 961#define RF_CREATE_TICKET 0x2000
bf6fb6c3
VK
962
963/**
964 * Action types
965 */
966#define ACTION_EXEC 0
967#define ACTION_REMOTE 1
968#define ACTION_SEND_EMAIL 2
969#define ACTION_SEND_SMS 3
970#define ACTION_FORWARD_EVENT 4
971#define ACTION_NXSL_SCRIPT 5
972#define ACTION_XMPP_MESSAGE 6
973
974/**
975 * Network map types
976 */
977#define NETMAP_USER_DEFINED 0
978#define NETMAP_IP_TOPOLOGY 1
979#define NETMAP_L2_TOPOLOGY 2
980
981/**
982 * Network map flags
983 */
984#define MF_SHOW_STATUS_ICON 0x00000001
985#define MF_SHOW_STATUS_FRAME 0x00000002
986#define MF_SHOW_STATUS_BKGND 0x00000004
987#define MF_SHOW_END_NODES 0x00000008
988#define MF_CALCULATE_STATUS 0x00000010
53e39123 989#define MF_FILTER_OBJECTS 0x00000020
bf6fb6c3
VK
990
991/**
992 * Network map layouts
993 */
994#define MAP_LAYOUT_MANUAL 0x7FFF
995#define MAP_LAYOUT_SPRING 0
996#define MAP_LAYOUT_RADIAL 1
997#define MAP_LAYOUT_HTREE 2
998#define MAP_LAYOUT_VTREE 3
999#define MAP_LAYOUT_SPARSE_VTREE 4
1000
1001
1002//
1003// Deployment manager status codes
1004//
1005
1006#define DEPLOYMENT_STATUS_PENDING 0
1007#define DEPLOYMENT_STATUS_TRANSFER 1
1008#define DEPLOYMENT_STATUS_INSTALLATION 2
1009#define DEPLOYMENT_STATUS_COMPLETED 3
1010#define DEPLOYMENT_STATUS_FAILED 4
1011#define DEPLOYMENT_STATUS_INITIALIZE 5
1012#define DEPLOYMENT_STATUS_FINISHED 255
1013
1014/**
c044d4f3
VK
1015 * Core subscription channels
1016 */
1017#define NXC_CHANNEL_EVENTS _T("Core.Events")
1018#define NXC_CHANNEL_SYSLOG _T("Core.Syslog")
1019#define NXC_CHANNEL_ALARMS _T("Core.Alarms")
1020#define NXC_CHANNEL_OBJECTS _T("Core.Objects")
1021#define NXC_CHANNEL_SNMP_TRAPS _T("Core.SNMP.Traps")
1022#define NXC_CHANNEL_AUDIT_LOG _T("Core.Audit")
25880ae2 1023#define NXC_CHANNEL_USERDB _T("Core.UserDB")
bf6fb6c3 1024
9708eff4
VK
1025/**
1026 * Node creation flags
1027 */
bf6fb6c3
VK
1028#define NXC_NCF_DISABLE_ICMP 0x0001
1029#define NXC_NCF_DISABLE_NXCP 0x0002
1030#define NXC_NCF_DISABLE_SNMP 0x0004
1031#define NXC_NCF_CREATE_UNMANAGED 0x0008
1032
9708eff4
VK
1033/**
1034 * Agent data cache modes
1035 */
55d81770 1036#define AGENT_CACHE_DEFAULT 0
9708eff4 1037#define AGENT_CACHE_ON 1
55d81770 1038#define AGENT_CACHE_OFF 2
bf6fb6c3 1039
9708eff4
VK
1040/**
1041 * Server components
1042 */
bf6fb6c3
VK
1043#define SRV_COMPONENT_DISCOVERY_MGR 1
1044
9708eff4
VK
1045/**
1046 * Configuration import flags
1047 */
bf6fb6c3
VK
1048#define CFG_IMPORT_REPLACE_EVENT_BY_CODE 0x0001
1049#define CFG_IMPORT_REPLACE_EVENT_BY_NAME 0x0002
1050
6a6b96c0
EJ
1051/**
1052* Alarm category flags
1053*/
1054#define ALARM_MODIFY_CATEGORY 0x0001
1055#define ALARM_MODIFY_ACCESS_LIST 0x0002
bf6fb6c3
VK
1056
1057//
1058// Graph access flags
1059//
1060
1061#define NXGRAPH_ACCESS_READ 0x01
1062#define NXGRAPH_ACCESS_WRITE 0x02
1063
1064
1065//
1066// Cluster types
1067//
1068
1069#define CLUSTER_TYPE_GENERIC 0
1070
1071
1072//
1073// SNMP trap flags
1074//
1075
1076#define TRAP_VARBIND_FORCE_TEXT 0x0001
1077
4e5a9b7b
VK
1078#ifdef __cplusplus
1079
bf6fb6c3
VK
1080/**
1081 * IP network
1082 */
1083typedef struct
1084{
1085 UINT32 dwAddr;
1086 UINT32 dwMask;
1087} IP_NETWORK;
1088
1089/**
1090 * Agent's parameter information
1091 */
1092typedef struct
1093{
1094 TCHAR szName[MAX_PARAM_NAME];
1095 TCHAR szDescription[MAX_DB_STRING];
1096 int iDataType;
1097} NXC_AGENT_PARAM;
1098
1099/**
1100 * Server action definition structure
1101 */
1102typedef struct
1103{
1104 UINT32 dwId;
1105 int iType;
1106 BOOL bIsDisabled;
1107 TCHAR szName[MAX_OBJECT_NAME];
1108 TCHAR szRcptAddr[MAX_RCPT_ADDR_LEN];
1109 TCHAR szEmailSubject[MAX_EMAIL_SUBJECT_LEN];
1110 TCHAR *pszData;
1111} NXC_ACTION;
1112
1113/**
1114 * Alarm structure
1115 */
1116typedef struct
1117{
d727efe6 1118 UINT64 sourceEventId; // Originating event ID
65ce7452
VK
1119 UINT32 alarmId; // Unique alarm ID
1120 UINT32 creationTime; // Alarm creation time in UNIX time format
1121 UINT32 lastChangeTime; // Alarm's last change time in UNIX time format
1122 UINT32 sourceObject; // Source object ID
1123 UINT32 sourceEventCode; // Originating event code
1124 UINT32 dciId; // related DCI ID
1125 BYTE currentSeverity; // Alarm's current severity
1126 BYTE originalSeverity; // Alarm's original severity
1127 BYTE state; // Current state
1128 BYTE helpDeskState; // State of alarm in helpdesk system
1129 UINT32 ackByUser; // ID of user who was acknowledged this alarm (0 for system)
1130 UINT32 resolvedByUser; // ID of user who was resolved this alarm (0 for system)
1131 UINT32 termByUser; // ID of user who was terminated this alarm (0 for system)
1132 UINT32 repeatCount;
1133 UINT32 timeout;
1134 UINT32 timeoutEvent;
1135 TCHAR message[MAX_EVENT_MSG_LENGTH];
1136 TCHAR key[MAX_DB_STRING];
1137 TCHAR helpDeskRef[MAX_HELPDESK_REF_LEN];
1138 void *userData; // Can be freely used by client application
1139 UINT32 noteCount; // Number of notes added to alarm
1140 UINT32 ackTimeout; // Sticky acknowledgment end time. If acknowladgmant without timeout put 0
bf6fb6c3
VK
1141} NXC_ALARM;
1142
1143/**
bf6fb6c3
VK
1144 * Condition's input DCI definition
1145 */
1146typedef struct
1147{
1148 UINT32 id;
1149 UINT32 nodeId;
1150 int function; // Average, last, diff
1151 int polls; // Number of polls used for average
1152} INPUT_DCI;
1153
1154/**
1155 * Cluster resource
1156 */
1157typedef struct
1158{
1159 UINT32 dwId;
1160 TCHAR szName[MAX_DB_STRING];
c75e9ee4 1161 InetAddress ipAddr;
bf6fb6c3
VK
1162 UINT32 dwCurrOwner;
1163} CLUSTER_RESOURCE;
1164
4e5a9b7b
VK
1165#endif /* __cplusplus */
1166
bf6fb6c3 1167#endif /* _nxcldefs_h_ */