manual map layout can be saved and restored
[public/netxms.git] / include / nxclapi.h
CommitLineData
80ffed5a
VK
1/*
2** NetXMS - Network Management System
3** Client Library API
65d2c384 4** Copyright (C) 2003-2010 Victor Kirhenshtein
80ffed5a
VK
5**
6** This program is free software; you can redistribute it and/or modify
65d2c384
VK
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
80ffed5a
VK
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**
65d2c384 16** You should have received a copy of the GNU Lesser General Public License
80ffed5a
VK
17** along with this program; if not, write to the Free Software
18** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19**
30639d32 20** File: nxclapi.h
80ffed5a
VK
21**
22**/
23
24#ifndef _nxclapi_h_
25#define _nxclapi_h_
26
e647245b
VK
27#ifdef LIBNXCL_CONSTANTS_ONLY
28
29#ifndef LIBNXCL_NO_DECLARATIONS
30#define LIBNXCL_NO_DECLARATIONS
31#endif
32
33#else
34
80ffed5a 35#include <nms_common.h>
e641b7d0 36#include <nms_util.h>
5ebea5e0 37#include <nxevent.h>
9f2ad16c 38#include <nxcpapi.h>
b7a391d7 39#include <nxtools.h>
b522b89b 40#include <nxlog.h>
95b6a1b6 41#include <uuid.h>
80ffed5a 42
8aeffdee
VK
43#ifdef _WIN32
44#ifdef LIBNXCL_EXPORTS
45#define LIBNXCL_EXPORTABLE __declspec(dllexport)
46#else
47#define LIBNXCL_EXPORTABLE __declspec(dllimport)
48#endif
49#else /* _WIN32 */
50#define LIBNXCL_EXPORTABLE
51#endif
52
e647245b
VK
53#endif /* not LIBNXCL_CONSTANTS_ONLY */
54
80ffed5a
VK
55
56//
41213c24
VK
57// Session handle type
58//
59
e647245b 60#ifndef LIBNXCL_CONSTANTS_ONLY
41213c24 61typedef void * NXC_SESSION;
e647245b 62#endif
41213c24
VK
63
64
65//
0c8bf759
VK
66// Some constants
67//
68
e6fc0e22 69#define MAX_COMMUNITY_LENGTH 128
878c92bc
VK
70#define MAX_OID_LENGTH 1024
71#define MAX_EVENT_MSG_LENGTH 256
72#define MAX_EVENT_NAME 64
0b4ebe8b 73#define MAX_USERTAG_LENGTH 64
55499dcd 74#define MAX_SESSION_NAME 256
5ac3236b 75#define MAX_USER_NAME 64
54abbe0e
VK
76#define MAX_USER_FULLNAME 128
77#define MAX_USER_DESCR 256
7ec6cca8
VK
78#define MAX_ITEM_NAME 256
79#define MAX_STRING_VALUE 256
510f1295 80#define MAX_VARIABLE_NAME 256
d096bcdd 81#define MAX_AGENT_VERSION_LEN 64
1c8b8363 82#define MAX_PLATFORM_NAME_LEN 64
257defd7 83#define MAX_PACKAGE_NAME_LEN 64
3c4ea156 84#define MAX_HELPDESK_REF_LEN 64
8c18110a
VK
85#define GROUP_EVERYONE ((DWORD)0x80000000)
86#define INVALID_UID ((DWORD)0xFFFFFFFF)
aa3743b2 87#define OBJECT_STATUS_COUNT 9
4ae6b70e
VK
88#define MAX_RCPT_ADDR_LEN 256
89#define MAX_EMAIL_SUBJECT_LEN 256
b50f1100 90#define MAC_ADDR_LENGTH 6
a9f9c5a9 91#define CURRENT_USER ((DWORD)0xFFFFFFFF)
b0ae1c83 92#define MAX_DCI_DATA_RECORDS 200000
f2bb4aa1 93#define MAX_POLICY_CONFIG_NAME 64
aa3743b2
VK
94
95
96//
20db6aa1
VK
97// Module flags
98//
99
100#define MODFLAG_DISABLED 0x0001
101#define MODFLAG_ACCEPT_ALL_COMMANDS 0x0002
102
103
104//
4b7d8903 105// NetXMS agent authentication methods
71c18491
VK
106//
107
4de204a3
VK
108#define AUTH_NONE 0
109#define AUTH_PLAINTEXT 1
110#define AUTH_MD5_HASH 2
111#define AUTH_SHA1_HASH 3
71c18491
VK
112
113
114//
bb8136f7
VK
115// Client-server authentication types
116//
117
118#define NETXMS_AUTH_TYPE_PASSWORD 0
119#define NETXMS_AUTH_TYPE_CERTIFICATE 1
120
121
122//
0b89f5fb
VK
123// Forced poll types
124//
125
126#define POLL_STATUS 1
127#define POLL_CONFIGURATION 2
b6ca4cf8 128#define POLL_INTERFACE_NAMES 3
0b89f5fb
VK
129
130
131//
71c18491
VK
132// Object types
133//
134
f2bb4aa1
VK
135#define OBJECT_GENERIC 0
136#define OBJECT_SUBNET 1
137#define OBJECT_NODE 2
138#define OBJECT_INTERFACE 3
139#define OBJECT_NETWORK 4
140#define OBJECT_CONTAINER 5
141#define OBJECT_ZONE 6
142#define OBJECT_SERVICEROOT 7
143#define OBJECT_TEMPLATE 8
144#define OBJECT_TEMPLATEGROUP 9
145#define OBJECT_TEMPLATEROOT 10
146#define OBJECT_NETWORKSERVICE 11
147#define OBJECT_VPNCONNECTOR 12
148#define OBJECT_CONDITION 13
149#define OBJECT_CLUSTER 14
45d84f8a
VK
150#define OBJECT_POLICYGROUP 15
151#define OBJECT_POLICYROOT 16
152#define OBJECT_AGENTPOLICY 17
f2bb4aa1 153#define OBJECT_AGENTPOLICY_CONFIG 18
021dcda7
VK
154#define OBJECT_NETWORKMAPROOT 19
155#define OBJECT_NETWORKMAPGROUP 20
156#define OBJECT_NETWORKMAP 21
71c18491
VK
157
158
159//
9eb7685c
VK
160// Object's status
161//
162
4de204a3
VK
163#define STATUS_NORMAL 0
164#define STATUS_WARNING 1
165#define STATUS_MINOR 2
166#define STATUS_MAJOR 3
167#define STATUS_CRITICAL 4
168#define STATUS_UNKNOWN 5
169#define STATUS_UNMANAGED 6
170#define STATUS_DISABLED 7
171#define STATUS_TESTING 8
172
173
174//
175// Event and alarm severity
176//
177
178#define SEVERITY_NORMAL 0
179#define SEVERITY_WARNING 1
180#define SEVERITY_MINOR 2
181#define SEVERITY_MAJOR 3
182#define SEVERITY_CRITICAL 4
183#define SEVERITY_FROM_EVENT 5
fa585702 184#define SEVERITY_TERMINATE 6
9eb7685c
VK
185
186
187//
3c4ea156
VK
188// Alarm states
189//
190
191#define ALARM_STATE_OUTSTANDING 0
2b58d71e 192#define ALARM_STATE_ACKNOWLEDGED 1
3c4ea156
VK
193#define ALARM_STATE_TERMINATED 2
194
195
196//
197// Alarm state in help desk system
198//
199
200#define ALARM_HELPDESK_IGNORED 0
45b766ca 201#define ALARM_HELPDESK_OPEN 1
3c4ea156
VK
202#define ALARM_HELPDESK_CLOSED 2
203
204
205//
4d597931
VK
206// Node flags
207//
208
1b41ebe2
VK
209#define NF_SYSTEM_FLAGS 0x0000FFFF
210#define NF_USER_FLAGS 0xFFFF0000
211
212#define NF_IS_SNMP 0x00000001
213#define NF_IS_NATIVE_AGENT 0x00000002
214#define NF_IS_BRIDGE 0x00000004
215#define NF_IS_ROUTER 0x00000008
216#define NF_IS_LOCAL_MGMT 0x00000010
217#define NF_IS_PRINTER 0x00000020
218#define NF_IS_OSPF 0x00000040
219#define NF_BEHIND_NAT 0x00000080
220#define NF_IS_CPSNMP 0x00000100 /* CheckPoint SNMP agent on port 260 */
221#define NF_IS_CDP 0x00000200
222#define NF_IS_SONMP 0x00000400 /* Supports Nortel (Synoptics/Bay Networks) topology discovery */
223#define NF_IS_LLDP 0x00000800 /* Supports Link Layer Discovery Protocol */
224
225#define NF_DISABLE_SNMP 0x01000000
226#define NF_DISABLE_NXCP 0x02000000
227#define NF_DISABLE_ICMP 0x04000000
228#define NF_FORCE_ENCRYPTION 0x08000000
229#define NF_DISABLE_STATUS_POLL 0x10000000
230#define NF_DISABLE_CONF_POLL 0x20000000
231#define NF_DISABLE_ROUTE_POLL 0x40000000
232#define NF_DISABLE_DATA_COLLECT 0x80000000
4d597931
VK
233
234
235//
4d0d4896
VK
236// Node ifXTable usage mode
237//
238
239#define IFXTABLE_DEFAULT 0
240#define IFXTABLE_ENABLED 1
241#define IFXTABLE_DISABLED 2
242
243
244//
b6ce3970
VK
245// Status calculation and propagation algorithms
246//
247
248#define SA_CALCULATE_DEFAULT 0
249#define SA_CALCULATE_MOST_CRITICAL 1
250#define SA_CALCULATE_SINGLE_THRESHOLD 2
251#define SA_CALCULATE_MULTIPLE_THRESHOLDS 3
252
253#define SA_PROPAGATE_DEFAULT 0
254#define SA_PROPAGATE_UNCHANGED 1
255#define SA_PROPAGATE_FIXED 2
256#define SA_PROPAGATE_RELATIVE 3
257#define SA_PROPAGATE_TRANSLATED 4
258
259
260//
21d9d6e2
VK
261// Components that can be locked by management pack installer
262//
263
264#define NXMP_LC_EVENTDB 0
265#define NXMP_LC_EPP 1
266#define NXMP_LC_TRAPCFG 2
267
268
269//
bebf4833
VK
270// Service types
271//
272
a9b9d730
AK
273enum
274{
275 NETSRV_CUSTOM,
276 NETSRV_SSH,
277 NETSRV_POP3,
278 NETSRV_SMTP,
279 NETSRV_FTP,
280 NETSRV_HTTP,
44bccbbc 281 NETSRV_TELNET
a9b9d730 282};
bebf4833
VK
283
284
285//
e2ce7f94
VK
286// Address list types
287//
288
289#define ADDR_LIST_DISCOVERY_TARGETS 1
290#define ADDR_LIST_DISCOVERY_FILTER 2
291
292
293//
294// Discovery filter flags
295//
296
297#define DFF_ALLOW_AGENT 0x0001
298#define DFF_ALLOW_SNMP 0x0002
dd5b3364 299#define DFF_ONLY_RANGE 0x0004
e2ce7f94
VK
300
301
302//
5fad5c32
VK
303// Events
304//
305
c797ace3 306#define NXC_EVENT_CONNECTION_BROKEN 1
41213c24
VK
307#define NXC_EVENT_NEW_ELOG_RECORD 2
308#define NXC_EVENT_USER_DB_CHANGED 3
309#define NXC_EVENT_OBJECT_CHANGED 4
310#define NXC_EVENT_NOTIFICATION 5
e4cfb9f3 311#define NXC_EVENT_DEPLOYMENT_STATUS 6
23b8cd4f 312#define NXC_EVENT_NEW_SYSLOG_RECORD 7
30639d32 313#define NXC_EVENT_NEW_SNMP_TRAP 8
35dfcebd 314#define NXC_EVENT_SITUATION_UPDATE 9
ab621f39 315#define NXC_EVENT_JOB_CHANGE 10
71f8d3d7
VK
316
317
318//
39d7a7ed 319// States (used both by client library and server)
54481027
VK
320//
321
322#define STATE_DISCONNECTED 0
323#define STATE_CONNECTING 1
39d7a7ed
VK
324#define STATE_CONNECTED 2
325#define STATE_AUTHENTICATED 3
7e986059
VK
326
327
328//
b601b1fa
VK
329// Notification codes
330//
331
3421c063
VK
332#define NX_NOTIFY_SHUTDOWN 1
333#define NX_NOTIFY_EVENTDB_CHANGED 2
4de204a3
VK
334#define NX_NOTIFY_ALARM_DELETED 3
335#define NX_NOTIFY_NEW_ALARM 4
3c4ea156 336#define NX_NOTIFY_ALARM_CHANGED 5
c9363772
VK
337#define NX_NOTIFY_ACTION_CREATED 6
338#define NX_NOTIFY_ACTION_MODIFIED 7
339#define NX_NOTIFY_ACTION_DELETED 8
f026c0f7 340#define NX_NOTIFY_OBJTOOLS_CHANGED 9
a695bb77 341#define NX_NOTIFY_DBCONN_STATUS 10
3c4ea156 342#define NX_NOTIFY_ALARM_TERMINATED 11
0aa59db6 343#define NX_NOTIFY_GRAPHS_CHANGED 12
870d2546
VK
344#define NX_NOTIFY_ETMPL_CHANGED 13
345#define NX_NOTIFY_ETMPL_DELETED 14
0e950f45 346#define NX_NOTIFY_OBJTOOL_DELETED 15
15edffbf
VK
347#define NX_NOTIFY_TRAPCFG_CREATED 16
348#define NX_NOTIFY_TRAPCFG_MODIFIED 17
349#define NX_NOTIFY_TRAPCFG_DELETED 18
878c92bc
VK
350
351
352//
353// Request completion codes
354//
355
356#define RCC_SUCCESS ((DWORD)0)
357#define RCC_COMPONENT_LOCKED ((DWORD)1)
358#define RCC_ACCESS_DENIED ((DWORD)2)
359#define RCC_INVALID_REQUEST ((DWORD)3)
360#define RCC_TIMEOUT ((DWORD)4)
605d2931
VK
361#define RCC_OUT_OF_STATE_REQUEST ((DWORD)5)
362#define RCC_DB_FAILURE ((DWORD)6)
effb51ab 363#define RCC_INVALID_OBJECT_ID ((DWORD)7)
34d95c13 364#define RCC_ALREADY_EXIST ((DWORD)8)
2e29457d 365#define RCC_COMM_FAILURE ((DWORD)9)
0d9c1b96 366#define RCC_SYSTEM_FAILURE ((DWORD)10)
62f3f072 367#define RCC_INVALID_USER_ID ((DWORD)11)
7ec6cca8 368#define RCC_INVALID_ARGUMENT ((DWORD)12)
9ed4eaff
VK
369#define RCC_DUPLICATE_DCI ((DWORD)13)
370#define RCC_INVALID_DCI_ID ((DWORD)14)
a7d07192
VK
371#define RCC_OUT_OF_MEMORY ((DWORD)15)
372#define RCC_IO_ERROR ((DWORD)16)
e6b958c4 373#define RCC_INCOMPATIBLE_OPERATION ((DWORD)17)
917aa2e6
VK
374#define RCC_OBJECT_CREATION_FAILED ((DWORD)18)
375#define RCC_OBJECT_LOOP ((DWORD)19)
8f7e2482 376#define RCC_INVALID_OBJECT_NAME ((DWORD)20)
9e41df77 377#define RCC_INVALID_ALARM_ID ((DWORD)21)
15b8d488 378#define RCC_INVALID_ACTION_ID ((DWORD)22)
0b89f5fb 379#define RCC_OPERATION_IN_PROGRESS ((DWORD)23)
933aee5c 380#define RCC_DCI_COPY_ERRORS ((DWORD)24)
b562fca8 381#define RCC_INVALID_EVENT_CODE ((DWORD)25)
ed1140dc
VK
382#define RCC_NO_WOL_INTERFACES ((DWORD)26)
383#define RCC_NO_MAC_ADDRESS ((DWORD)27)
37c4d6aa 384#define RCC_NOT_IMPLEMENTED ((DWORD)28)
106e7ae3 385#define RCC_INVALID_TRAP_ID ((DWORD)29)
2e0596dd 386#define RCC_DCI_NOT_SUPPORTED ((DWORD)30)
693119d6 387#define RCC_VERSION_MISMATCH ((DWORD)31)
17322e0b 388#define RCC_NPI_PARSE_ERROR ((DWORD)32)
257defd7
VK
389#define RCC_DUPLICATE_PACKAGE ((DWORD)33)
390#define RCC_PACKAGE_FILE_EXIST ((DWORD)34)
391#define RCC_RESOURCE_BUSY ((DWORD)35)
f6aa542e 392#define RCC_INVALID_PACKAGE_ID ((DWORD)36)
6c60ff91 393#define RCC_INVALID_IP_ADDR ((DWORD)37)
d72d004b 394#define RCC_ACTION_IN_USE ((DWORD)38)
510f1295 395#define RCC_VARIABLE_NOT_FOUND ((DWORD)39)
5b7b9f00 396#define RCC_BAD_PROTOCOL ((DWORD)40)
d0d4f8d7 397#define RCC_ADDRESS_IN_USE ((DWORD)41)
e44ac467
VK
398#define RCC_NO_CIPHERS ((DWORD)42)
399#define RCC_INVALID_PUBLIC_KEY ((DWORD)43)
400#define RCC_INVALID_SESSION_KEY ((DWORD)44)
9c0619bd 401#define RCC_NO_ENCRYPTION_SUPPORT ((DWORD)45)
3c2c7839 402#define RCC_INTERNAL_ERROR ((DWORD)46)
4a68a447 403#define RCC_EXEC_FAILED ((DWORD)47)
795ebf32 404#define RCC_INVALID_TOOL_ID ((DWORD)48)
53902f72 405#define RCC_SNMP_ERROR ((DWORD)49)
180bef1e
VK
406#define RCC_BAD_REGEXP ((DWORD)50)
407#define RCC_UNKNOWN_PARAMETER ((DWORD)51)
1dcd1bee
VK
408#define RCC_FILE_IO_ERROR ((DWORD)52)
409#define RCC_CORRUPTED_MIB_FILE ((DWORD)53)
410#define RCC_TRANSFER_IN_PROGRESS ((DWORD)54)
f40831eb 411#define RCC_INVALID_JOB_ID ((DWORD)55)
3b4689f6
VK
412#define RCC_INVALID_SCRIPT_ID ((DWORD)56)
413#define RCC_INVALID_SCRIPT_NAME ((DWORD)57)
8b56eec1
VK
414#define RCC_UNKNOWN_MAP_NAME ((DWORD)58)
415#define RCC_INVALID_MAP_ID ((DWORD)59)
d46f2345
VK
416#define RCC_ACCOUNT_DISABLED ((DWORD)60)
417#define RCC_NO_GRACE_LOGINS ((DWORD)61)
c797ace3 418#define RCC_CONNECTION_BROKEN ((DWORD)62)
45542367 419#define RCC_INVALID_CONFIG_ID ((DWORD)63)
a695bb77 420#define RCC_DB_CONNECTION_LOST ((DWORD)64)
45b766ca
VK
421#define RCC_ALARM_OPEN_IN_HELPDESK ((DWORD)65)
422#define RCC_ALARM_NOT_OUTSTANDING ((DWORD)66)
62461481 423#define RCC_NOT_PUSH_DCI ((DWORD)67)
86920454
VK
424#define RCC_CONFIG_PARSE_ERROR ((DWORD)68)
425#define RCC_CONFIG_VALIDATION_ERROR ((DWORD)69)
ce5592b2 426#define RCC_INVALID_GRAPH_ID ((DWORD)70)
bb8136f7
VK
427#define RCC_LOCAL_CRYPTO_ERROR ((DWORD)71)
428#define RCC_UNSUPPORTED_AUTH_TYPE ((DWORD)72)
429#define RCC_BAD_CERTIFICATE ((DWORD)73)
7767fbb8 430#define RCC_INVALID_CERT_ID ((DWORD)74)
ce5592b2 431#define RCC_SNMP_FAILURE ((DWORD)75)
0e0da2f1 432#define RCC_NO_L2_TOPOLOGY_SUPPORT ((DWORD)76)
431f302b
VK
433#define RCC_INVALID_SITUATION_ID ((DWORD)77)
434#define RCC_INSTANCE_NOT_FOUND ((DWORD)78)
7f92ea2a
VK
435#define RCC_INVALID_EVENT_ID ((DWORD)79)
436#define RCC_AGENT_ERROR ((DWORD)80)
aa6cc51e 437#define RCC_UNKNOWN_VARIABLE ((DWORD)81)
ce5592b2 438#define RCC_RESOURCE_NOT_AVAILABLE ((DWORD)82)
f40831eb 439#define RCC_JOB_CANCEL_FAILED ((DWORD)83)
45d84f8a 440#define RCC_INVALID_POLICY_ID ((DWORD)84)
e05b1945
VK
441#define RCC_UNKNOWN_LOG_NAME ((DWORD)85)
442#define RCC_INVALID_LOG_HANDLE ((DWORD)86)
ab185583
VK
443#define RCC_WEAK_PASSWORD ((DWORD)87)
444#define RCC_REUSED_PASSWORD ((DWORD)88)
67a736f0 445#define RCC_INVALID_SESSION_HANDLE ((DWORD)89)
6459f9b7 446#define RCC_CLUSTER_MEMBER_ALREADY ((DWORD)90)
878c92bc
VK
447
448
449//
d9152256
VK
450// Mask bits for NXCModifyEventTemplate()
451//
452
453#define EM_SEVERITY ((DWORD)0x01)
454#define EM_FLAGS ((DWORD)0x02)
455#define EM_NAME ((DWORD)0x04)
456#define EM_MESSAGE ((DWORD)0x08)
457#define EM_DESCRIPTION ((DWORD)0x10)
458#define EM_ALL ((DWORD)0x1F)
459
460
461//
effb51ab
VK
462// Mask bits (flags) for NXCModifyObject()
463//
464
f1e6a179
VK
465#define OBJ_UPDATE_NAME ((QWORD)_ULL(0x0000000001))
466#define OBJ_UPDATE_AGENT_PORT ((QWORD)_ULL(0x0000000002))
467#define OBJ_UPDATE_AGENT_AUTH ((QWORD)_ULL(0x0000000004))
468#define OBJ_UPDATE_AGENT_SECRET ((QWORD)_ULL(0x0000000008))
469#define OBJ_UPDATE_SNMP_VERSION ((QWORD)_ULL(0x0000000010))
4b7d8903 470#define OBJ_UPDATE_SNMP_AUTH ((QWORD)_ULL(0x0000000020))
f1e6a179 471#define OBJ_UPDATE_ACL ((QWORD)_ULL(0x0000000040))
a01fa678 472#define OBJ_UPDATE_GEOLOCATION ((QWORD)_ULL(0x0000000080))
f1e6a179
VK
473#define OBJ_UPDATE_SYNC_NETS ((QWORD)_ULL(0x0000000100))
474#define OBJ_UPDATE_SERVICE_TYPE ((QWORD)_ULL(0x0000000200))
475#define OBJ_UPDATE_IP_PROTO ((QWORD)_ULL(0x0000000400))
476#define OBJ_UPDATE_IP_PORT ((QWORD)_ULL(0x0000000800))
477#define OBJ_UPDATE_CHECK_REQUEST ((QWORD)_ULL(0x0000001000))
478#define OBJ_UPDATE_CHECK_RESPONSE ((QWORD)_ULL(0x0000002000))
479#define OBJ_UPDATE_POLLER_NODE ((QWORD)_ULL(0x0000004000))
480#define OBJ_UPDATE_IP_ADDR ((QWORD)_ULL(0x0000008000))
481#define OBJ_UPDATE_PEER_GATEWAY ((QWORD)_ULL(0x0000010000))
482#define OBJ_UPDATE_NETWORK_LIST ((QWORD)_ULL(0x0000020000))
483#define OBJ_UPDATE_STATUS_ALG ((QWORD)_ULL(0x0000040000))
484#define OBJ_UPDATE_PROXY_NODE ((QWORD)_ULL(0x0000080000))
485#define OBJ_UPDATE_NODE_FLAGS ((QWORD)_ULL(0x0000100000))
486#define OBJ_UPDATE_ACT_EVENT ((QWORD)_ULL(0x0000200000))
487#define OBJ_UPDATE_DEACT_EVENT ((QWORD)_ULL(0x0000400000))
488#define OBJ_UPDATE_SOURCE_OBJECT ((QWORD)_ULL(0x0000800000))
489#define OBJ_UPDATE_ACTIVE_STATUS ((QWORD)_ULL(0x0001000000))
490#define OBJ_UPDATE_INACTIVE_STATUS ((QWORD)_ULL(0x0002000000))
491#define OBJ_UPDATE_DCI_LIST ((QWORD)_ULL(0x0004000000))
492#define OBJ_UPDATE_SCRIPT ((QWORD)_ULL(0x0008000000))
493#define OBJ_UPDATE_CLUSTER_TYPE ((QWORD)_ULL(0x0010000000))
494#define OBJ_UPDATE_RESOURCES ((QWORD)_ULL(0x0020000000))
495#define OBJ_UPDATE_SNMP_PROXY ((QWORD)_ULL(0x0040000000))
496#define OBJ_UPDATE_REQUIRED_POLLS ((QWORD)_ULL(0x0080000000))
497#define OBJ_UPDATE_TRUSTED_NODES ((QWORD)_ULL(0x0100000000))
0b16a7bf 498#define OBJ_UPDATE_CUSTOM_ATTRS ((QWORD)_ULL(0x0200000000))
4d0d4896 499#define OBJ_UPDATE_USE_IFXTABLE ((QWORD)_ULL(0x0400000000))
ccc34207
VK
500#define OBJ_UPDATE_AUTO_APPLY ((QWORD)_ULL(0x0800000000))
501#define OBJ_UPDATE_AUTO_BIND ((QWORD)_ULL(0x1000000000))
65e2005b 502#define OBJ_UPDATE_SNMP_PORT ((QWORD)_ULL(0x2000000000))
383b42a1 503
effb51ab
VK
504
505//
5ac3236b
VK
506// Global user rights
507//
508
11606542
VK
509#ifndef LIBNXCL_CUSTOM_USER_RIGHTS
510
d2d7327c
VK
511#define SYSTEM_ACCESS_MANAGE_USERS 0x00000001
512#define SYSTEM_ACCESS_SERVER_CONFIG 0x00000002
513#define SYSTEM_ACCESS_CONFIGURE_TRAPS 0x00000004
514#define SYSTEM_ACCESS_MANAGE_SESSIONS 0x00000008
515#define SYSTEM_ACCESS_VIEW_EVENT_DB 0x00000010
516#define SYSTEM_ACCESS_EDIT_EVENT_DB 0x00000020
517#define SYSTEM_ACCESS_EPP 0x00000040
518#define SYSTEM_ACCESS_MANAGE_ACTIONS 0x00000080
519#define SYSTEM_ACCESS_DELETE_ALARMS 0x00000100
520#define SYSTEM_ACCESS_MANAGE_PACKAGES 0x00000200
e05b1945 521#define SYSTEM_ACCESS_VIEW_EVENT_LOG 0x00000400
d2d7327c
VK
522#define SYSTEM_ACCESS_MANAGE_TOOLS 0x00000800
523#define SYSTEM_ACCESS_MANAGE_SCRIPTS 0x00001000
524#define SYSTEM_ACCESS_VIEW_TRAP_LOG 0x00002000
c5730807 525#define SYSTEM_ACCESS_VIEW_AUDIT_LOG 0x00004000
d2d7327c 526#define SYSTEM_ACCESS_MANAGE_AGENT_CFG 0x00008000
431f302b
VK
527#define SYSTEM_ACCESS_MANAGE_SITUATIONS 0x00010000
528#define SYSTEM_ACCESS_SEND_SMS 0x00020000
56c58457 529#define SYSTEM_ACCESS_MANAGE_MAPS 0x00040000
522f6f07
VK
530#define SYSTEM_ACCESS_REGISTER_AGENTS 0x00080000
531#define SYSTEM_ACCESS_READ_FILES 0x00100000
d2d7327c 532
522f6f07 533#define SYSTEM_ACCESS_FULL 0x001FFFFF
911dbb64 534
11606542
VK
535#endif /* LIBNXCL_CUSTOM_USER_RIGHTS */
536
5ac3236b
VK
537
538//
539// Object access rights
540//
541
542#define OBJECT_ACCESS_READ 0x00000001
543#define OBJECT_ACCESS_MODIFY 0x00000002
544#define OBJECT_ACCESS_CREATE 0x00000004
545#define OBJECT_ACCESS_DELETE 0x00000008
03482383 546#define OBJECT_ACCESS_READ_ALARMS 0x00000010
c8686da4 547#define OBJECT_ACCESS_ACL 0x00000020
03482383 548#define OBJECT_ACCESS_ACK_ALARMS 0x00000040
b562fca8 549#define OBJECT_ACCESS_SEND_EVENTS 0x00000080
c8686da4 550#define OBJECT_ACCESS_CONTROL 0x00000100
4e3e69ce
VK
551#define OBJECT_ACCESS_TERM_ALARMS 0x00000200
552#define OBJECT_ACCESS_PUSH_DATA 0x00000400
5ac3236b
VK
553
554
555//
556// User/group flags
557//
558
559#define UF_MODIFIED 0x0001
560#define UF_DELETED 0x0002
561#define UF_DISABLED 0x0004
562#define UF_CHANGE_PASSWORD 0x0008
8c18110a 563#define UF_CANNOT_CHANGE_PASSWORD 0x0010
ab185583 564#define UF_INTRUDER_LOCKOUT 0x0020
5ac3236b
VK
565
566
567//
c20ec6c6
VK
568// Fields for NXCModifyUserEx
569//
570
571#define USER_MODIFY_LOGIN_NAME 0x00000001
572#define USER_MODIFY_DESCRIPTION 0x00000002
573#define USER_MODIFY_FULL_NAME 0x00000004
574#define USER_MODIFY_FLAGS 0x00000008
575#define USER_MODIFY_ACCESS_RIGHTS 0x00000010
576#define USER_MODIFY_MEMBERS 0x00000020
577#define USER_MODIFY_CERT_MAPPING 0x00000040
578#define USER_MODIFY_AUTH_METHOD 0x00000080
ab185583 579#define USER_MODIFY_PASSWD_LENGTH 0x00000100
dfe38557 580#define USER_MODIFY_TEMP_DISABLE 0x00000200
c20ec6c6
VK
581
582
583//
1f4cd940
VK
584// User certificate mapping methods
585//
586
587#define USER_MAP_CERT_BY_SUBJECT 0
588#define USER_MAP_CERT_BY_PUBKEY 1
589
590
591//
984542f8
VK
592// User database change notification types
593//
594
595#define USER_DB_CREATE 0
596#define USER_DB_DELETE 1
597#define USER_DB_MODIFY 2
598
599
600//
35dfcebd
VK
601// Situation change notification types
602//
603
604#define SITUATION_CREATE 1
605#define SITUATION_DELETE 2
606#define SITUATION_UPDATE 3
607#define SITUATION_INSTANCE_UPDATE 4
608#define SITUATION_INSTANCE_DELETE 5
609
610
611//
7ec6cca8 612// Data sources
54481027
VK
613//
614
d5c52377
VK
615#define DS_INTERNAL 0
616#define DS_NATIVE_AGENT 1
617#define DS_SNMP_AGENT 2
618#define DS_CHECKPOINT_AGENT 3
4e3e69ce 619#define DS_PUSH_AGENT 4
54481027
VK
620
621
622//
7ec6cca8 623// Item status
878c92bc
VK
624//
625
7ec6cca8
VK
626#define ITEM_STATUS_ACTIVE 0
627#define ITEM_STATUS_DISABLED 1
628#define ITEM_STATUS_NOT_SUPPORTED 2
878c92bc
VK
629
630
631//
333ece94
VK
632// Delta calculation methods for DCIs
633//
634
635#define DCM_ORIGINAL_VALUE 0
636#define DCM_SIMPLE 1
637#define DCM_AVERAGE_PER_SECOND 2
638#define DCM_AVERAGE_PER_MINUTE 3
639
640
641//
d0e94572
VK
642// Threshold functions and operations
643//
644
645#define F_LAST 0
646#define F_AVERAGE 1
647#define F_DEVIATION 2
cf85ad81 648#define F_DIFF 3
658ed570 649#define F_ERROR 4
d0e94572
VK
650
651#define OP_LE 0
652#define OP_LE_EQ 1
653#define OP_EQ 2
654#define OP_GT_EQ 3
655#define OP_GT 4
656#define OP_NE 5
657#define OP_LIKE 6
658#define OP_NOTLIKE 7
659
660
661//
ccc34207
VK
662// DCI base units
663//
664
665#define DCI_BASEUNITS_OTHER 0
666#define DCI_BASEUNITS_CUSTOM 1
667#define DCI_BASEUNITS_BYTES 2
668#define DCI_BASEUNITS_BITS 3
669#define DCI_BASEUNITS_SECONDS 4
670#define DCI_BASEUNITS_PERCENTS 5
671#define DCI_BASEUNITS_BITS_PER_SECOND 6
672#define DCI_BASEUNITS_BYTES_PER_SECOND 7
673
674
675//
99180ed6
VK
676// Event policy rule flags
677//
678
53d7d5ae
VK
679#define RF_STOP_PROCESSING 0x0001
680#define RF_NEGATED_SOURCE 0x0002
681#define RF_NEGATED_EVENTS 0x0004
682#define RF_GENERATE_ALARM 0x0008
683#define RF_DISABLED 0x0010
684#define RF_TERMINATE_BY_REGEXP 0x0020
685#define RF_SEVERITY_INFO 0x0100
686#define RF_SEVERITY_WARNING 0x0200
687#define RF_SEVERITY_MINOR 0x0400
688#define RF_SEVERITY_MAJOR 0x0800
689#define RF_SEVERITY_CRITICAL 0x1000
99180ed6
VK
690
691
692//
4ae6b70e
VK
693// Action types
694//
695
c7863da1
VK
696#define ACTION_EXEC 0
697#define ACTION_REMOTE 1
4ae6b70e 698#define ACTION_SEND_EMAIL 2
c7863da1 699#define ACTION_SEND_SMS 3
7da41bdd 700#define ACTION_FORWARD_EVENT 4
4ae6b70e
VK
701
702
703//
021dcda7
VK
704// Network map types
705//
706
707#define NETMAP_USER_DEFINED 0
708#define NETMAP_IP_TOPOLOGY 1
709#define NETMAP_L2_TOPOLOGY 2
710
711
712//
713// Network map layouts
714//
715
5e736ee5
VK
716#define MAP_LAYOUT_MANUAL 0x7FFF
717#define MAP_LAYOUT_SPRING 0
718#define MAP_LAYOUT_RADIAL 1
719#define MAP_LAYOUT_HTREE 2
720#define MAP_LAYOUT_VTREE 3
721#define MAP_LAYOUT_SPARSE_VTREE 4
021dcda7
VK
722
723
724//
4d92bf3c
VK
725// Deployment manager status codes
726//
727
728#define DEPLOYMENT_STATUS_PENDING 0
729#define DEPLOYMENT_STATUS_TRANSFER 1
730#define DEPLOYMENT_STATUS_INSTALLATION 2
731#define DEPLOYMENT_STATUS_COMPLETED 3
732#define DEPLOYMENT_STATUS_FAILED 4
094b9fa8 733#define DEPLOYMENT_STATUS_INITIALIZE 5
8494c011 734#define DEPLOYMENT_STATUS_FINISHED 255
4d92bf3c
VK
735
736
737//
50b7854e
VK
738// Session subscription codes (data channels)
739//
740
741#define NXC_CHANNEL_EVENTS 0x0001
742#define NXC_CHANNEL_SYSLOG 0x0002
743#define NXC_CHANNEL_ALARMS 0x0004
744#define NXC_CHANNEL_OBJECTS 0x0008
30639d32 745#define NXC_CHANNEL_SNMP_TRAPS 0x0010
cef5ceff 746#define NXC_CHANNEL_AUDIT_LOG 0x0020
35dfcebd 747#define NXC_CHANNEL_SITUATIONS 0x0040
50b7854e
VK
748
749
750//
f74a7ee9
VK
751// Node creation flags
752//
753
754#define NXC_NCF_DISABLE_ICMP 0x0001
755#define NXC_NCF_DISABLE_NXCP 0x0002
756#define NXC_NCF_DISABLE_SNMP 0x0004
757#define NXC_NCF_CREATE_UNMANAGED 0x0008
758
759
760//
dd5b3364
VK
761// Server components
762//
763
764#define SRV_COMPONENT_DISCOVERY_MGR 1
765
766
767//
86920454 768// Configuration import flags
21d9d6e2
VK
769//
770
86920454
VK
771#define CFG_IMPORT_REPLACE_EVENT_BY_CODE 0x0001
772#define CFG_IMPORT_REPLACE_EVENT_BY_NAME 0x0002
21d9d6e2
VK
773
774
775//
0aa59db6
VK
776// Graph access flags
777//
778
779#define NXGRAPH_ACCESS_READ 0x01
780#define NXGRAPH_ACCESS_WRITE 0x02
781
782
783//
2b58d71e
VK
784// Cluster types
785//
786
787#define CLUSTER_TYPE_GENERIC 0
788
789
790//
1a7c67a9
VK
791// IP network
792//
793
794typedef struct
795{
796 DWORD dwAddr;
797 DWORD dwMask;
798} IP_NETWORK;
799
800
801//
125c0e81
VK
802// Agent's parameter information
803//
804
805typedef struct
806{
807 TCHAR szName[MAX_PARAM_NAME];
808 TCHAR szDescription[MAX_DB_STRING];
809 int iDataType;
810} NXC_AGENT_PARAM;
811
812
813//
4ae6b70e
VK
814// Action structure
815//
816
817typedef struct
818{
819 DWORD dwId;
820 int iType;
c9363772 821 BOOL bIsDisabled;
b900a78b
VK
822 TCHAR szName[MAX_OBJECT_NAME];
823 TCHAR szRcptAddr[MAX_RCPT_ADDR_LEN];
824 TCHAR szEmailSubject[MAX_EMAIL_SUBJECT_LEN];
825 TCHAR *pszData;
4ae6b70e 826} NXC_ACTION;
333ece94
VK
827
828
4ae6b70e 829//
2260ffe5
VK
830// Alarm structure
831//
832
833typedef struct
834{
3c4ea156 835 QWORD qwSourceEventId; // Originating event ID
2260ffe5 836 DWORD dwAlarmId; // Unique alarm ID
3c4ea156
VK
837 DWORD dwCreationTime; // Alarm creation time in UNIX time format
838 DWORD dwLastChangeTime; // Alarm's last change time in UNIX time format
2260ffe5 839 DWORD dwSourceObject; // Source object ID
c19b2871 840 DWORD dwSourceEventCode;// Originating event code
3c4ea156
VK
841 BYTE nCurrentSeverity; // Alarm's current severity
842 BYTE nOriginalSeverity; // Alarm's original severity
843 BYTE nState; // Current state
844 BYTE nHelpDeskState; // State of alarm in helpdesk system
2b58d71e 845 DWORD dwAckByUser; // Id of user who was acknowledged this alarm (0 for system)
3c4ea156
VK
846 DWORD dwTermByUser; // ID of user who was terminated this alarm (0 for system)
847 DWORD dwRepeatCount;
fa585702
VK
848 DWORD dwTimeout;
849 DWORD dwTimeoutEvent;
b40371d4
AK
850 TCHAR szMessage[MAX_DB_STRING];
851 TCHAR szKey[MAX_DB_STRING];
3c4ea156 852 TCHAR szHelpDeskRef[MAX_HELPDESK_REF_LEN];
dfa113cf 853 void *pUserData; // Can be freely used by client application
2260ffe5
VK
854} NXC_ALARM;
855
856
857//
840eb902
VK
858// Trap parameter mapping entry
859//
860
9f2ad16c 861typedef struct
840eb902
VK
862{
863 DWORD *pdwObjectId; // Trap OID
a65c1819 864 DWORD dwOidLen; // Trap OID length (if highest bit is set, than it's a position)
565f6f86 865 TCHAR szDescription[MAX_DB_STRING];
9f2ad16c 866} NXC_OID_MAP;
840eb902
VK
867
868
869//
870// Trap configuration entry
871//
872
9f2ad16c 873typedef struct
840eb902
VK
874{
875 DWORD dwId; // Entry ID
876 DWORD *pdwObjectId; // Trap OID
a65c1819 877 DWORD dwOidLen; // Trap OID length
c19b2871 878 DWORD dwEventCode; // Event code
840eb902 879 DWORD dwNumMaps; // Number of parameter mappings
565f6f86
VK
880 NXC_OID_MAP *pMaps;
881 TCHAR szDescription[MAX_DB_STRING];
0b4ebe8b 882 TCHAR szUserTag[MAX_USERTAG_LENGTH];
9f2ad16c 883} NXC_TRAP_CFG_ENTRY;
840eb902
VK
884
885
383b42a1
VK
886//
887// Condition's input DCI definition
888//
889
9f2ad16c 890typedef struct
383b42a1
VK
891{
892 DWORD dwId;
893 DWORD dwNodeId;
894 int nFunction; // Average, last, diff
895 int nPolls; // Number of polls used for average
9f2ad16c 896} INPUT_DCI;
383b42a1
VK
897
898
6f512367
VK
899//
900// Cluster resource
901//
902
903typedef struct
904{
905 DWORD dwId;
906 TCHAR szName[MAX_DB_STRING];
907 DWORD dwIpAddr;
908 DWORD dwCurrOwner;
909} CLUSTER_RESOURCE;
910
911
7ec6cca8
VK
912/********************************************************************
913 * Following part of this file shouldn't be included by server code *
914 ********************************************************************/
915
916#ifndef LIBNXCL_NO_DECLARATIONS
917
918
919//
bb8136f7
VK
920// NXCConnect flags
921//
922
6a2679e5
VK
923#define NXCF_DEFAULT 0
924#define NXCF_ENCRYPT 0x0001
925#define NXCF_EXACT_VERSION_MATCH 0x0002
926#define NXCF_USE_CERTIFICATE 0x0004
927#define NXCF_IGNORE_PROTOCOL_VERSION 0x0008
bb8136f7
VK
928
929
930//
d41923e1
VK
931// Node dynamic flags useful for client
932//
933
934#ifndef __NDF_FLAGS_DEFINED
935#define NDF_UNREACHABLE 0x0004
936#define NDF_AGENT_UNREACHABLE 0x0008
937#define NDF_SNMP_UNREACHABLE 0x0010
938#define NDF_CPSNMP_UNREACHABLE 0x0200
939#define NDF_POLLING_DISABLED 0x0800
940#endif
941
942
943//
7ec6cca8
VK
944// Callbacks data types
945//
946
41213c24 947typedef void (* NXC_EVENT_HANDLER)(NXC_SESSION hSession, DWORD dwEvent, DWORD dwCode, void *pArg);
b40371d4 948typedef void (* NXC_DEBUG_CALLBACK)(TCHAR *pMsg);
7ec6cca8
VK
949
950
951//
240ab52a
VK
952// Event log record structure
953//
954
955typedef struct
956{
957 QWORD qwEventId;
958 DWORD dwTimeStamp;
959 DWORD dwEventCode;
960 DWORD dwSourceId;
961 DWORD dwSeverity;
962 TCHAR szMessage[MAX_EVENT_MSG_LENGTH];
963 TCHAR szUserTag[MAX_USERTAG_LENGTH];
964} NXC_EVENT;
965
966
967//
23b8cd4f
VK
968// Syslog record structure
969//
970
971typedef struct
972{
973 QWORD qwMsgId;
974 DWORD dwTimeStamp;
975 WORD wFacility;
976 WORD wSeverity;
977 DWORD dwSourceObject;
978 TCHAR szHost[MAX_SYSLOG_HOSTNAME_LEN];
979 TCHAR szTag[MAX_SYSLOG_TAG_LEN];
980 TCHAR *pszText;
981} NXC_SYSLOG_RECORD;
982
983
984//
5c9947dc
VK
985// Server's configuration variable
986//
987
988typedef struct
989{
990 TCHAR szName[MAX_OBJECT_NAME];
991 TCHAR szValue[MAX_DB_STRING];
992 BOOL bNeedRestart;
993} NXC_SERVER_VARIABLE;
994
995
996//
1c8b8363
VK
997// Agent package information
998//
999
1000typedef struct
1001{
1002 DWORD dwId;
257defd7 1003 TCHAR szName[MAX_PACKAGE_NAME_LEN];
1c8b8363
VK
1004 TCHAR szVersion[MAX_AGENT_VERSION_LEN];
1005 TCHAR szPlatform[MAX_PLATFORM_NAME_LEN];
1006 TCHAR szFileName[MAX_DB_STRING];
257defd7 1007 TCHAR szDescription[MAX_DB_STRING];
1c8b8363
VK
1008} NXC_PACKAGE_INFO;
1009
1010
1011//
7ec6cca8
VK
1012// Event configuration structure
1013//
1014
1015typedef struct
1016{
1017 DWORD dwCode;
1018 DWORD dwSeverity;
1019 DWORD dwFlags;
b900a78b
VK
1020 TCHAR szName[MAX_EVENT_NAME];
1021 TCHAR *pszMessage;
1022 TCHAR *pszDescription;
7ec6cca8
VK
1023} NXC_EVENT_TEMPLATE;
1024
1025
a1dc75b0 1026//
effb51ab
VK
1027// Entry in object's ACL
1028//
1029
1030typedef struct
1031{
1032 DWORD dwUserId;
1033 DWORD dwAccessRights;
1034} NXC_ACL_ENTRY;
1035
1036
1037//
0c8bf759
VK
1038// Network object structure
1039//
1040
e39c2880
VK
1041struct __nxc_object_iface
1042{
1043 DWORD dwIpNetMask; // Ip netmask.
1044 DWORD dwIfIndex; // Interface index.
1045 DWORD dwIfType; // Interface type
1046 BYTE bMacAddr[MAC_ADDR_LENGTH];
7c2ea1c1 1047 WORD wRequiredPollCount;
e39c2880
VK
1048};
1049
1050struct __nxc_object_node
1051{
1052 DWORD dwFlags;
fa6173b9 1053 DWORD dwRuntimeFlags;
e39c2880
VK
1054 DWORD dwNodeType;
1055 DWORD dwPollerNode;
1056 DWORD dwProxyNode;
48d28327 1057 DWORD dwSNMPProxy;
e39c2880
VK
1058 DWORD dwZoneGUID;
1059 TCHAR szSharedSecret[MAX_SECRET_LENGTH];
4b7d8903
VK
1060 TCHAR *pszAuthName; // SNMP authentication name
1061 TCHAR *pszAuthPassword; // SNMP v3 USM auth password
1062 TCHAR *pszPrivPassword; // SNMP v3 USM privacy password
1063 TCHAR *pszSnmpObjectId;
1064 WORD wSnmpAuthMethod;
1065 WORD wSnmpPrivMethod;
65e2005b 1066 WORD wSnmpPort;
e39c2880
VK
1067 WORD wAgentPort; // Listening TCP port for native agent
1068 WORD wAuthMethod; // Native agent's authentication method
e39c2880
VK
1069 TCHAR szAgentVersion[MAX_AGENT_VERSION_LEN];
1070 TCHAR szPlatformName[MAX_PLATFORM_NAME_LEN];
4d0d4896
VK
1071 BYTE nUseIfXTable;
1072 BYTE nSNMPVersion;
7c2ea1c1 1073 WORD wRequiredPollCount;
72c0e661 1074 TCHAR szSysDescription[MAX_DB_STRING];
e39c2880
VK
1075};
1076
1077struct __nxc_object_subnet
1078{
1079 DWORD dwIpNetMask;
1080 DWORD dwZoneGUID;
1081};
1082
1083struct __nxc_object_container
1084{
1085 DWORD dwCategory;
ccc34207
VK
1086 BOOL isAutoBindEnabled;
1087 TCHAR *pszAutoBindFilter;
e39c2880
VK
1088};
1089
1090struct __nxc_object_dct
1091{
1092 DWORD dwVersion;
ccc34207
VK
1093 BOOL isAutoApplyEnabled;
1094 TCHAR *pszAutoApplyFilter;
e39c2880
VK
1095};
1096
1097struct __nxc_object_netsrv
1098{
1099 int iServiceType;
1100 WORD wProto;
1101 WORD wPort;
1102 DWORD dwPollerNode;
1103 TCHAR *pszRequest;
1104 TCHAR *pszResponse;
7c2ea1c1 1105 WORD wRequiredPollCount;
e39c2880
VK
1106};
1107
1108struct __nxc_object_zone
1109{
1110 DWORD dwZoneGUID;
1111 DWORD dwControllerIpAddr;
1112 DWORD dwAddrListSize;
1113 DWORD *pdwAddrList;
e39c2880
VK
1114 WORD wZoneType;
1115};
1116
1117struct __nxc_object_vpnc
1118{
1119 DWORD dwPeerGateway;
1120 DWORD dwNumLocalNets;
1121 DWORD dwNumRemoteNets;
1122 IP_NETWORK *pLocalNetList;
1123 IP_NETWORK *pRemoteNetList;
1124};
1125
1126struct __nxc_object_cond
1127{
1128 TCHAR *pszScript;
1129 DWORD dwActivationEvent;
1130 DWORD dwDeactivationEvent;
1131 DWORD dwSourceObject;
1132 WORD wActiveStatus;
1133 WORD wInactiveStatus;
1134 DWORD dwNumDCI;
1135 INPUT_DCI *pDCIList;
1136};
1137
2b58d71e
VK
1138struct __nxc_object_cluster
1139{
1140 DWORD dwClusterType;
1141 DWORD dwNumSyncNets;
1142 IP_NETWORK *pSyncNetList;
6f512367
VK
1143 DWORD dwNumResources;
1144 CLUSTER_RESOURCE *pResourceList;
2b58d71e
VK
1145};
1146
a01fa678
VK
1147struct __nxc_geolocation
1148{
1149 int type;
1150 double latitude;
1151 double longitude;
1152};
1153
0c8bf759
VK
1154typedef struct
1155{
1156 DWORD dwId; // Unique object's identifier
1157 int iClass; // Object's class
1158 int iStatus; // Object's status
1159 DWORD dwIpAddr; // IP address
b900a78b 1160 TCHAR szName[MAX_OBJECT_NAME];
0c8bf759
VK
1161 DWORD dwNumParents;
1162 DWORD *pdwParentList;
1163 DWORD dwNumChilds;
1164 DWORD *pdwChildList;
4d597931 1165 BOOL bIsDeleted; // TRUE for deleted objects
effb51ab
VK
1166 BOOL bInheritRights;
1167 DWORD dwAclSize;
1168 NXC_ACL_ENTRY *pAccessList;
b6ce3970
VK
1169 int iStatusCalcAlg; // Status calculation algorithm
1170 int iStatusPropAlg; // Status propagation alhorithm
1171 int iFixedStatus; // Status to be propagated if alg = SA_PROPAGATE_FIXED
1172 int iStatusShift; // Status shift for SA_PROPAGATE_RELATIVE
1173 int iStatusTrans[4];
1174 int iStatusSingleTh;
1175 int iStatusThresholds[4];
c402ee3e 1176 TCHAR *pszComments;
d51ccc0d
VK
1177 DWORD dwNumTrustedNodes;
1178 DWORD *pdwTrustedNodes;
a01fa678 1179 struct __nxc_geolocation geolocation;
0b16a7bf
VK
1180#ifdef __cplusplus
1181 StringMap *pCustomAttrs;
1182#else
1183 void *pCustomAttrs;
1184#endif
0c8bf759
VK
1185 union
1186 {
e39c2880
VK
1187 struct __nxc_object_iface iface;
1188 struct __nxc_object_node node;
1189 struct __nxc_object_subnet subnet;
1190 struct __nxc_object_container container;
1191 struct __nxc_object_dct dct;
1192 struct __nxc_object_netsrv netsrv;
1193 struct __nxc_object_zone zone;
1194 struct __nxc_object_vpnc vpnc; // VPN connector
1195 struct __nxc_object_cond cond; // Condition
2b58d71e 1196 struct __nxc_object_cluster cluster;
0c8bf759
VK
1197 };
1198} NXC_OBJECT;
1199
1200
1201//
effb51ab
VK
1202// Structure with data for NXCModifyObject
1203//
1204
1205typedef struct
1206{
d51ccc0d 1207 QWORD qwFlags;
effb51ab 1208 DWORD dwObjectId;
ccc34207 1209 const TCHAR *pszName;
effb51ab
VK
1210 int iAgentPort;
1211 int iAuthType;
ccc34207 1212 const TCHAR *pszSecret;
4b7d8903
VK
1213 const TCHAR *pszAuthName;
1214 const TCHAR *pszAuthPassword;
1215 const TCHAR *pszPrivPassword;
1216 WORD wSnmpAuthMethod;
1217 WORD wSnmpPrivMethod;
effb51ab
VK
1218 BOOL bInheritRights;
1219 DWORD dwAclSize;
1220 NXC_ACL_ENTRY *pAccessList;
37c4d6aa 1221 WORD wSNMPVersion;
d780a7bc
VK
1222 int iServiceType;
1223 WORD wProto;
1224 WORD wPort;
65e2005b 1225 WORD wSnmpPort;
d780a7bc 1226 DWORD dwPollerNode;
ccc34207
VK
1227 const TCHAR *pszRequest;
1228 const TCHAR *pszResponse;
89ced6da 1229 DWORD dwIpAddr;
1a7c67a9 1230 DWORD dwPeerGateway;
d0c8be78
VK
1231 DWORD dwNumLocalNets;
1232 DWORD dwNumRemoteNets;
1233 IP_NETWORK *pLocalNetList;
1234 IP_NETWORK *pRemoteNetList;
b6ce3970
VK
1235 int iStatusCalcAlg; // Status calculation algorithm
1236 int iStatusPropAlg; // Status propagation alhorithm
1237 int iFixedStatus; // Status to be propagated if alg = SA_PROPAGATE_FIXED
1238 int iStatusShift; // Status shift for SA_PROPAGATE_RELATIVE
1239 int iStatusTrans[4];
1240 int iStatusSingleTh;
1241 int iStatusThresholds[4];
c8686da4 1242 DWORD dwProxyNode;
48d28327 1243 DWORD dwSNMPProxy;
8f85380b 1244 DWORD dwNodeFlags;
383b42a1
VK
1245 DWORD dwActivationEvent;
1246 DWORD dwDeactivationEvent;
1247 DWORD dwSourceObject;
1248 int nActiveStatus;
1249 int nInactiveStatus;
1250 DWORD dwNumDCI;
1251 INPUT_DCI *pDCIList;
ccc34207 1252 const TCHAR *pszScript;
2b58d71e
VK
1253 DWORD dwClusterType;
1254 DWORD dwNumSyncNets;
1255 IP_NETWORK *pSyncNetList;
6f512367
VK
1256 DWORD dwNumResources;
1257 CLUSTER_RESOURCE *pResourceList;
7c2ea1c1 1258 WORD wRequiredPollCount;
d51ccc0d
VK
1259 DWORD dwNumTrustedNodes;
1260 DWORD *pdwTrustedNodes;
4d0d4896 1261 int nUseIfXTable;
ccc34207
VK
1262 BOOL isAutoApplyEnabled;
1263 const TCHAR *pszAutoApplyFilter;
1264 BOOL isAutoBindEnabled;
1265 const TCHAR *pszAutoBindFilter;
a01fa678 1266 struct __nxc_geolocation geolocation;
0b16a7bf
VK
1267#ifdef __cplusplus
1268 StringMap *pCustomAttrs;
1269#else
1270 void *pCustomAttrs;
1271#endif
effb51ab
VK
1272} NXC_OBJECT_UPDATE;
1273
1274
1275//
5ac3236b
VK
1276// NetXMS user information structure
1277//
1278
1279typedef struct
1280{
b900a78b 1281 TCHAR szName[MAX_USER_NAME];
95b6a1b6 1282 uuid_t guid;
5ac3236b 1283 DWORD dwId;
431f302b 1284 DWORD dwSystemRights;
5ac3236b 1285 WORD wFlags;
431f302b 1286 WORD nAuthMethod; // Only for users
5ac3236b
VK
1287 DWORD dwNumMembers; // Only for groups
1288 DWORD *pdwMemberList; // Only for groups
b900a78b
VK
1289 TCHAR szFullName[MAX_USER_FULLNAME]; // Only for users
1290 TCHAR szDescription[MAX_USER_DESCR];
3d1058ed
VK
1291 int nCertMappingMethod; // Only for users
1292 TCHAR *pszCertMappingData; // Only for users
5ac3236b
VK
1293} NXC_USER;
1294
1295
1296//
f86ffdd2
VK
1297// Data collection item threshold structure
1298//
1299
1300typedef struct
1301{
1302 DWORD dwId;
1303 DWORD dwEvent;
625ad507 1304 DWORD dwRearmEvent;
f86ffdd2
VK
1305 WORD wFunction;
1306 WORD wOperation;
1307 DWORD dwArg1;
1308 DWORD dwArg2;
fe41ef92 1309 LONG nRepeatInterval;
d9ae1904 1310 TCHAR szValue[MAX_STRING_VALUE];
f86ffdd2
VK
1311} NXC_DCI_THRESHOLD;
1312
1313
1314//
7ec6cca8
VK
1315// Data collection item structure
1316//
1317
1318typedef struct
1319{
1320 DWORD dwId;
333ece94 1321 DWORD dwTemplateId;
48d28327 1322 DWORD dwResourceId;
b40371d4
AK
1323 TCHAR szName[MAX_ITEM_NAME];
1324 TCHAR szDescription[MAX_DB_STRING];
22c38feb 1325 TCHAR szInstance[MAX_DB_STRING];
80d3565a 1326 TCHAR szSystemTag[MAX_DB_STRING];
7ec6cca8
VK
1327 int iPollingInterval;
1328 int iRetentionTime;
1329 BYTE iSource;
1330 BYTE iDataType;
1331 BYTE iStatus;
333ece94 1332 BYTE iDeltaCalculation;
b9ce1c9d 1333 BYTE iAdvSchedule;
625ad507 1334 BYTE iProcessAllThresholds;
f86ffdd2
VK
1335 DWORD dwNumThresholds;
1336 NXC_DCI_THRESHOLD *pThresholdList;
b40371d4 1337 TCHAR *pszFormula;
b9ce1c9d
VK
1338 DWORD dwNumSchedules;
1339 TCHAR **ppScheduleList;
a852b4fb 1340 DWORD dwProxyNode;
ccc34207
VK
1341 int nBaseUnits;
1342 int nMultiplier;
1343 TCHAR *pszCustomUnitName;
1344 TCHAR *pszPerfTabSettings;
8cad4ebb 1345 int nSnmpPort;
7ec6cca8
VK
1346} NXC_DCI;
1347
1348
1349//
1350// Node's data collection list information
1351//
1352
1353typedef struct
1354{
1355 DWORD dwNodeId;
1356 DWORD dwNumItems;
1357 NXC_DCI *pItems;
1358} NXC_DCI_LIST;
1359
1360
1361//
b9b4ec17
VK
1362// Row structure
1363//
1364
9f20696e
VK
1365#pragma pack(1)
1366
b9b4ec17
VK
1367typedef struct
1368{
1369 DWORD dwTimeStamp;
1370 union
1371 {
1372 DWORD dwInt32;
cb17745c 1373 INT64 qwInt64;
b9b4ec17 1374 double dFloat;
b40371d4 1375 TCHAR szString[MAX_STRING_VALUE];
b9b4ec17
VK
1376 } value;
1377} NXC_DCI_ROW;
1378
9f20696e
VK
1379#pragma pack()
1380
b9b4ec17
VK
1381
1382//
1383// DCI's collected data
1384//
1385
1386typedef struct
1387{
1388 DWORD dwNodeId; // Owner's node id
1389 DWORD dwItemId; // Item id
1390 DWORD dwNumRows; // Number of rows in set
1391 WORD wDataType; // Data type (integer, string, etc.)
1392 WORD wRowSize; // Size of single row in bytes
1393 NXC_DCI_ROW *pRows; // Array of rows
1394} NXC_DCI_DATA;
1395
1396
1397//
a7d07192
VK
1398// MIB file list
1399//
1400
1401typedef struct
1402{
1403 DWORD dwNumFiles;
b40371d4 1404 TCHAR **ppszName;
a7d07192
VK
1405 BYTE **ppHash;
1406} NXC_MIB_LIST;
1407
1408
1409//
1410// Event processing policy rule
1411//
1412
1413typedef struct
1414{
1415 DWORD dwFlags;
1416 DWORD dwId;
1417 DWORD dwNumActions;
1418 DWORD dwNumEvents;
1419 DWORD dwNumSources;
1420 DWORD *pdwActionList;
1421 DWORD *pdwEventList;
1422 DWORD *pdwSourceList;
b40371d4 1423 TCHAR *pszComment;
edafd5a1 1424 TCHAR *pszScript;
b40371d4 1425 TCHAR szAlarmKey[MAX_DB_STRING];
b40371d4 1426 TCHAR szAlarmMessage[MAX_DB_STRING];
a7d07192 1427 WORD wAlarmSeverity;
fa585702
VK
1428 DWORD dwAlarmTimeout;
1429 DWORD dwAlarmTimeoutEvent;
40b7416c
VK
1430 DWORD dwSituationId;
1431 TCHAR szSituationInstance[MAX_DB_STRING];
1432#ifdef __cplusplus
1433 StringMap *pSituationAttrList;
1434#else
1435 void *pSituationAttrList;
1436#endif
a7d07192
VK
1437} NXC_EPP_RULE;
1438
1439
1440//
1441// Event processing policy
1442//
1443
1444typedef struct
1445{
1446 DWORD dwNumRules;
1447 NXC_EPP_RULE *pRuleList;
1448} NXC_EPP;
1449
1450
1451//
e4cfb9f3
VK
1452// Package deployment status information
1453//
1454
1455typedef struct
1456{
1457 DWORD dwNodeId;
1458 DWORD dwStatus;
1459 TCHAR *pszErrorMessage;
1460} NXC_DEPLOYMENT_STATUS;
1461
1462
1463//
917aa2e6
VK
1464// Object creation information structure
1465//
1466
1467typedef struct
1468{
1469 int iClass;
1470 DWORD dwParentId;
b40371d4 1471 TCHAR *pszName;
7f79b20d 1472 TCHAR *pszComments;
917aa2e6
VK
1473 union
1474 {
1475 struct
1476 {
1477 DWORD dwIpAddr;
1478 DWORD dwNetMask;
f74a7ee9
VK
1479 DWORD dwCreationFlags;
1480 DWORD dwProxyNode;
90f48abb 1481 DWORD dwSNMPProxy;
917aa2e6
VK
1482 } node;
1483 struct
1484 {
1485 DWORD dwCategory;
917aa2e6 1486 } container;
62d11997
VK
1487 struct
1488 {
b61fe31e
VK
1489 int iServiceType;
1490 WORD wProto;
1491 WORD wPort;
1492 TCHAR *pszRequest;
1a17feb0 1493 TCHAR *pszResponse;
b61fe31e 1494 } netsrv;
917aa2e6
VK
1495 } cs;
1496} NXC_OBJECT_CREATE_INFO;
1497
1498
1499//
6849d9be
VK
1500// Container category
1501//
1502
1503typedef struct
1504{
1505 DWORD dwId;
b40371d4
AK
1506 TCHAR szName[MAX_OBJECT_NAME];
1507 TCHAR *pszDescription;
6849d9be
VK
1508} NXC_CONTAINER_CATEGORY;
1509
1510
1511//
1512// Container categories list
1513//
1514
1515typedef struct
1516{
1517 DWORD dwNumElements;
1518 NXC_CONTAINER_CATEGORY *pElements;
1519} NXC_CC_LIST;
1520
1521
1522//
20aaa307
VK
1523// DCI information and last value for NXCGetLastValues()
1524//
1525
1526typedef struct
1527{
1528 DWORD dwId;
1529 DWORD dwTimestamp;
1530 TCHAR szName[MAX_ITEM_NAME];
1531 TCHAR szDescription[MAX_DB_STRING];
1532 TCHAR szValue[MAX_DB_STRING];
023951b1
VK
1533 BYTE nDataType;
1534 BYTE nSource;
1535 BYTE nStatus;
20aaa307
VK
1536} NXC_DCI_VALUE;
1537
1538
1539//
b7a391d7
VK
1540// Object tool
1541//
1542
1543typedef struct
1544{
1545 DWORD dwId;
1546 DWORD dwFlags;
1547 WORD wType;
1548 TCHAR szName[MAX_DB_STRING];
1549 TCHAR szDescription[MAX_DB_STRING];
1b282e44 1550 TCHAR *pszMatchingOID;
b7a391d7 1551 TCHAR *pszData;
a463d430 1552 TCHAR *pszConfirmationText;
b7a391d7
VK
1553} NXC_OBJECT_TOOL;
1554
1555
1556//
c4096dd8
VK
1557// Object tool column information
1558//
1559
1560typedef struct
1561{
1562 TCHAR szName[MAX_DB_STRING];
1563 TCHAR szOID[MAX_DB_STRING];
1564 int nFormat;
1565 int nSubstr;
1566} NXC_OBJECT_TOOL_COLUMN;
1567
1568
1569//
1570// Object tool detailed information
1571//
1572
1573typedef struct
1574{
1575 DWORD dwId;
1576 DWORD dwFlags;
1577 TCHAR szName[MAX_DB_STRING];
1578 TCHAR szDescription[MAX_DB_STRING];
1b282e44 1579 TCHAR *pszMatchingOID;
c4096dd8 1580 TCHAR *pszData;
a463d430 1581 TCHAR *pszConfirmationText;
c4096dd8
VK
1582 DWORD *pdwACL;
1583 DWORD dwACLSize;
1584 WORD wType;
1585 WORD wNumColumns;
1586 NXC_OBJECT_TOOL_COLUMN *pColList;
1587} NXC_OBJECT_TOOL_DETAILS;
1588
1589
1590//
64a495ad
VK
1591// Server stats
1592//
1593
1594typedef struct
1595{
f42f158b
VK
1596 DWORD dwNumAlarms;
1597 DWORD dwAlarmsBySeverity[5];
1598 DWORD dwNumObjects;
1599 DWORD dwNumNodes;
1600 DWORD dwNumDCI;
1601 DWORD dwNumClientSessions;
1602 DWORD dwServerUptime;
1603 DWORD dwServerProcessVMSize;
1604 DWORD dwServerProcessWorkSet;
1605 TCHAR szServerVersion[MAX_DB_STRING];
1606 DWORD dwQSizeConditionPoller;
1607 DWORD dwQSizeConfPoller;
1608 DWORD dwQSizeDCIPoller;
1609 DWORD dwQSizeDBWriter;
1610 DWORD dwQSizeEvents;
1611 DWORD dwQSizeDiscovery;
1612 DWORD dwQSizeNodePoller;
1613 DWORD dwQSizeRoutePoller;
1614 DWORD dwQSizeStatusPoller;
64a495ad
VK
1615} NXC_SERVER_STATS;
1616
1617
1618//
e0e45119
VK
1619// Script info
1620//
1621
1622typedef struct
1623{
1624 DWORD dwId;
1625 TCHAR szName[MAX_DB_STRING];
1626} NXC_SCRIPT_INFO;
1627
1628
1629//
1de1b062
VK
1630// Client session information
1631//
1632
1633typedef struct
1634{
1635 DWORD dwSessionId;
1636 int nCipher;
1637 TCHAR szUserName[MAX_USER_NAME];
1638 TCHAR szClientApp[MAX_DB_STRING];
1639} NXC_CLIENT_SESSION_INFO;
1640
1641
1642//
30639d32
VK
1643// Trap log records
1644//
1645
1646typedef struct
1647{
1648 QWORD qwId;
1649 DWORD dwTimeStamp;
1650 DWORD dwIpAddr;
1651 DWORD dwObjectId;
1652 TCHAR szTrapOID[MAX_DB_STRING];
1653 TCHAR *pszTrapVarbinds;
1654} NXC_SNMP_TRAP_LOG_RECORD;
1655
1656
1657//
8b56eec1
VK
1658// Map information
1659//
1660
1661typedef struct
1662{
1663 DWORD dwMapId;
1664 DWORD dwObjectId;
1665 DWORD dwAccess; // Access rights to the map for current user
1666 TCHAR szName[MAX_DB_STRING];
1667} NXC_MAP_INFO;
1668
1669
1670//
48ad2f8d
VK
1671// Agent configuration info
1672//
1673
1674typedef struct
1675{
1676 DWORD dwId;
1677 DWORD dwSequence;
1678 TCHAR szName[MAX_DB_STRING];
1679} NXC_AGENT_CONFIG_INFO;
1680
1681
1682//
1683// Agent configuration - all data
1684//
1685
1686typedef struct
1687{
1688 DWORD dwId;
1689 DWORD dwSequence;
1690 TCHAR szName[MAX_DB_STRING];
1691 TCHAR *pszText;
1692 TCHAR *pszFilter;
1693} NXC_AGENT_CONFIG;
1694
1695
1696//
4e3e69ce
VK
1697// DCI push data
1698//
1699
1700typedef struct
1701{
1702 DWORD dwId; // DCI ID or 0 if name is used
1703 TCHAR *pszName;
1704 DWORD dwNodeId; // Node ID or 0 if name is used
1705 TCHAR *pszNodeName;
1706 TCHAR *pszValue;
1707} NXC_DCI_PUSH_DATA;
1708
1709
1710//
e2ce7f94
VK
1711// Address entry for address list
1712//
1713
1714typedef struct
1715{
1716 DWORD dwAddr1;
1717 DWORD dwAddr2;
1718 DWORD dwType; // 0 = address/mask, 1 = address range
1719} NXC_ADDR_ENTRY;
1720
1721
1722//
0aa59db6
VK
1723// Graph ACL element
1724//
1725
1726typedef struct
1727{
1728 DWORD dwUserId;
1729 DWORD dwAccess;
1730} NXC_GRAPH_ACL_ENTRY;
1731
1732
1733//
1734// Graph information
1735//
1736
1737typedef struct
1738{
1739 DWORD dwId;
1740 TCHAR *pszName;
1741 TCHAR *pszConfig;
1742 DWORD dwOwner;
1743 DWORD dwAclSize;
1744 NXC_GRAPH_ACL_ENTRY *pACL;
1745} NXC_GRAPH;
1746
1747
1748//
bb7a686c
VK
1749// System DCI information
1750//
1751
1752typedef struct
1753{
1754 DWORD dwId;
1755 TCHAR szName[MAX_DB_STRING];
1756 int nStatus;
74526d25
VK
1757 TCHAR *pszSettings;
1758} NXC_PERFTAB_DCI;
bb7a686c
VK
1759
1760
1761//
3d1058ed
VK
1762// Certificate information
1763//
1764
1765typedef struct
1766{
1767 DWORD dwId;
1768 int nType;
1769 TCHAR *pszSubject;
1770 TCHAR *pszComments;
1771} NXC_CERT_INFO;
1772
1773
1774//
1775// Certificate list
1776//
1777
1778typedef struct
1779{
1780 DWORD dwNumElements;
1781 NXC_CERT_INFO *pElements;
1782} NXC_CERT_LIST;
1783
1784
df8a4ca2
VK
1785//
1786// SNMP USM credential
1787//
1788
1789typedef struct
1790{
1791 TCHAR name[MAX_DB_STRING];
1792 int authMethod;
1793 int privMethod;
1794 TCHAR authPassword[MAX_DB_STRING];
1795 TCHAR privPassword[MAX_DB_STRING];
1796} NXC_SNMP_USM_CRED;
1797
431f302b
VK
1798
1799// All situation stuff will be available only in C++
1800#ifdef __cplusplus
1801
1802//
1803// Situation instance
1804//
1805
1806typedef struct
1807{
1808 TCHAR *m_name;
431f302b
VK
1809 StringMap *m_attrList;
1810} NXC_SITUATION_INSTANCE;
1811
1812
1813//
1814// Situation
1815//
1816
1817typedef struct
1818{
1819 DWORD m_id;
1820 TCHAR *m_name;
1821 TCHAR *m_comments;
1822 int m_instanceCount;
1823 NXC_SITUATION_INSTANCE *m_instanceList;
1824} NXC_SITUATION;
1825
1826
1827//
1828// Situation list
1829//
1830
1831typedef struct
1832{
1833 int m_count;
1834 NXC_SITUATION *m_situations;
1835} NXC_SITUATION_LIST;
1836
1837#endif /* __cplusplus */
1838
1839
3d1058ed 1840//
80ffed5a
VK
1841// Functions
1842//
1843
1844#ifdef __cplusplus
1845extern "C" {
1846#endif
1847
c6b8b813 1848/** Library info/management **/
8aeffdee 1849DWORD LIBNXCL_EXPORTABLE NXCGetVersion(void);
b40371d4 1850const TCHAR LIBNXCL_EXPORTABLE *NXCGetErrorText(DWORD dwError);
effb51ab 1851
8aeffdee 1852BOOL LIBNXCL_EXPORTABLE NXCInitialize(void);
39d7a7ed 1853void LIBNXCL_EXPORTABLE NXCShutdown(void);
44342f7b 1854void LIBNXCL_EXPORTABLE NXCSetDebugCallback(NXC_DEBUG_CALLBACK pFunc);
41213c24 1855
4e2debcc
VK
1856BOOL LIBNXCL_EXPORTABLE NXCDecryptPassword(const TCHAR *login, const TCHAR *encryptedPasswd, TCHAR *decryptedPasswd);
1857
c6b8b813 1858/** Low-level messaging **/
a535b9c7 1859DWORD LIBNXCL_EXPORTABLE NXCGenerateMessageId(NXC_SESSION hSession);
b3bea71d
VK
1860BOOL LIBNXCL_EXPORTABLE NXCSendMessage(NXC_SESSION hSession, CSCPMessage *msg);
1861CSCPMessage LIBNXCL_EXPORTABLE *NXCWaitForMessage(NXC_SESSION hSession, WORD wCode, DWORD dwRqId);
1862DWORD LIBNXCL_EXPORTABLE NXCWaitForRCC(NXC_SESSION hSession, DWORD dwRqId);
1863
c6b8b813 1864/** Session management **/
76154a95
VK
1865DWORD LIBNXCL_EXPORTABLE NXCConnect(DWORD dwFlags, const TCHAR *pszServer, const TCHAR *pszLogin,
1866 const TCHAR *pszPassword, DWORD dwCertLen,
1867 BOOL (* pfSign)(BYTE *, DWORD, BYTE *, DWORD *, void *),
1868 void *pSignArg, NXC_SESSION *phSession, const TCHAR *pszClientInfo,
1869 TCHAR **ppszUpgradeURL);
41213c24 1870void LIBNXCL_EXPORTABLE NXCDisconnect(NXC_SESSION hSession);
c797ace3 1871void LIBNXCL_EXPORTABLE NXCStartWatchdog(NXC_SESSION hSession);
41213c24 1872void LIBNXCL_EXPORTABLE NXCSetEventHandler(NXC_SESSION hSession, NXC_EVENT_HANDLER pHandler);
41213c24 1873void LIBNXCL_EXPORTABLE NXCSetCommandTimeout(NXC_SESSION hSession, DWORD dwTimeout);
510f1295 1874void LIBNXCL_EXPORTABLE NXCGetServerID(NXC_SESSION hSession, BYTE *pbsId);
a695bb77 1875BOOL LIBNXCL_EXPORTABLE NXCIsDBConnLost(NXC_SESSION hSession);
e2268bac
VK
1876DWORD LIBNXCL_EXPORTABLE NXCSubscribe(NXC_SESSION hSession, DWORD dwChannels);
1877DWORD LIBNXCL_EXPORTABLE NXCUnsubscribe(NXC_SESSION hSession, DWORD dwChannels);
55499dcd
VK
1878void LIBNXCL_EXPORTABLE NXCGetLastLockOwner(NXC_SESSION hSession, TCHAR *pszBuffer,
1879 int nBufSize);
b2e6efb0 1880const TCHAR LIBNXCL_EXPORTABLE *NXCGetServerTimeZone(NXC_SESSION hSession);
5b0fa340 1881DWORD LIBNXCL_EXPORTABLE NXCCheckConnection(NXC_SESSION hSession);
41213c24 1882
c6b8b813 1883/** SMS **/
b13fd0b7
VK
1884DWORD LIBNXCL_EXPORTABLE NXCSendSMS(NXC_SESSION hSession, TCHAR *phone, TCHAR *message);
1885
c6b8b813 1886/** Get/set client data associated with session **/
dfa113cf
VK
1887void LIBNXCL_EXPORTABLE *NXCGetClientData(NXC_SESSION hSession);
1888void LIBNXCL_EXPORTABLE NXCSetClientData(NXC_SESSION hSession, void *pData);
1889
c6b8b813 1890/** Objects **/
41213c24 1891DWORD LIBNXCL_EXPORTABLE NXCSyncObjects(NXC_SESSION hSession);
4560d8bd 1892DWORD LIBNXCL_EXPORTABLE NXCSyncObjectsEx(NXC_SESSION hSession, const TCHAR *pszCacheFile,
c402ee3e 1893 BOOL bSyncComments);
41213c24 1894NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectById(NXC_SESSION hSession, DWORD dwId);
9d3816ab 1895NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByIdNoLock(NXC_SESSION hSession, DWORD dwId);
67a736f0
VK
1896NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByName(NXC_SESSION hSession, const TCHAR *pszName, DWORD dwCurrObject);
1897NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByComments(NXC_SESSION hSession, const TCHAR *comments, DWORD dwCurrObject);
178f955b 1898NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByIPAddress(NXC_SESSION hSession, DWORD dwIpAddr, DWORD dwCurrObject);
41213c24
VK
1899void LIBNXCL_EXPORTABLE NXCEnumerateObjects(NXC_SESSION hSession, BOOL (* pHandler)(NXC_OBJECT *));
1900NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTopologyRootObject(NXC_SESSION hSession);
1901NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetServiceRootObject(NXC_SESSION hSession);
1902NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTemplateRootObject(NXC_SESSION hSession);
1903void LIBNXCL_EXPORTABLE *NXCGetObjectIndex(NXC_SESSION hSession, DWORD *pdwNumObjects);
1904void LIBNXCL_EXPORTABLE NXCLockObjectIndex(NXC_SESSION hSession);
1905void LIBNXCL_EXPORTABLE NXCUnlockObjectIndex(NXC_SESSION hSession);
1906DWORD LIBNXCL_EXPORTABLE NXCModifyObject(NXC_SESSION hSession, NXC_OBJECT_UPDATE *pData);
1907DWORD LIBNXCL_EXPORTABLE NXCSetObjectMgmtStatus(NXC_SESSION hSession, DWORD dwObjectId, BOOL bIsManaged);
d0d4f8d7 1908DWORD LIBNXCL_EXPORTABLE NXCChangeNodeIP(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwIpAddr);
41213c24
VK
1909DWORD LIBNXCL_EXPORTABLE NXCCreateObject(NXC_SESSION hSession, NXC_OBJECT_CREATE_INFO *pCreateInfo, DWORD *pdwObjectId);
1910DWORD LIBNXCL_EXPORTABLE NXCBindObject(NXC_SESSION hSession, DWORD dwParentObject, DWORD dwChildObject);
1911DWORD LIBNXCL_EXPORTABLE NXCUnbindObject(NXC_SESSION hSession, DWORD dwParentObject, DWORD dwChildObject);
1da08bc6 1912DWORD LIBNXCL_EXPORTABLE NXCAddClusterNode(NXC_SESSION hSession, DWORD clusterId, DWORD nodeId);
84adcf70
VK
1913DWORD LIBNXCL_EXPORTABLE NXCRemoveTemplate(NXC_SESSION hSession, DWORD dwTemplateId,
1914 DWORD dwNodeId, BOOL bRemoveDCI);
41213c24
VK
1915DWORD LIBNXCL_EXPORTABLE NXCDeleteObject(NXC_SESSION hSession, DWORD dwObject);
1916DWORD LIBNXCL_EXPORTABLE NXCPollNode(NXC_SESSION hSession, DWORD dwObjectId, int iPollType,
eb8b1960 1917 void (* pCallback)(TCHAR *, void *), void *pArg);
41213c24 1918DWORD LIBNXCL_EXPORTABLE NXCWakeUpNode(NXC_SESSION hSession, DWORD dwObjectId);
e6ccf59b
VK
1919DWORD LIBNXCL_EXPORTABLE NXCGetSupportedParameters(NXC_SESSION hSession, DWORD dwNodeId,
1920 DWORD *pdwNumParams,
1921 NXC_AGENT_PARAM **ppParamList);
c32b805a
VK
1922void LIBNXCL_EXPORTABLE NXCGetComparableObjectName(NXC_SESSION hSession, DWORD dwObjectId,
1923 TCHAR *pszName);
2ae5f2e0 1924void LIBNXCL_EXPORTABLE NXCGetComparableObjectNameEx(NXC_OBJECT *pObject, TCHAR *pszName);
4560d8bd 1925DWORD LIBNXCL_EXPORTABLE NXCSaveObjectCache(NXC_SESSION hSession, const TCHAR *pszFile);
a3ec64cb
VK
1926DWORD LIBNXCL_EXPORTABLE NXCGetAgentConfig(NXC_SESSION hSession, DWORD dwNodeId,
1927 TCHAR **ppszConfig);
6b1b7aed
VK
1928DWORD LIBNXCL_EXPORTABLE NXCUpdateAgentConfig(NXC_SESSION hSession, DWORD dwNodeId,
1929 TCHAR *pszConfig, BOOL bApply);
4a68a447
VK
1930DWORD LIBNXCL_EXPORTABLE NXCExecuteAction(NXC_SESSION hSession, DWORD dwObjectId,
1931 TCHAR *pszAction);
9f2ad16c
VK
1932DWORD LIBNXCL_EXPORTABLE NXCGetObjectComments(NXC_SESSION hSession,
1933 DWORD dwObjectId, TCHAR **ppszText);
1934DWORD LIBNXCL_EXPORTABLE NXCUpdateObjectComments(NXC_SESSION hSession,
1935 DWORD dwObjectId, TCHAR *pszText);
dd03812f 1936BOOL LIBNXCL_EXPORTABLE NXCIsParent(NXC_SESSION hSession, DWORD dwParent, DWORD dwChild);
97e09882
VK
1937DWORD LIBNXCL_EXPORTABLE NXCGetDCIEventsList(NXC_SESSION hSession, DWORD dwObjectId,
1938 DWORD **ppdwList, DWORD *pdwListSize);
d53161c8
VK
1939DWORD LIBNXCL_EXPORTABLE NXCGetDCIInfo(NXC_SESSION hSession, DWORD dwNodeId,
1940 DWORD dwItemId, NXC_DCI *pInfo);
071fd171
VK
1941DWORD LIBNXCL_EXPORTABLE NXCGetDCIThresholds(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwItemId,
1942 NXC_DCI_THRESHOLD **ppList, DWORD *pdwSize);
41213c24 1943
c6b8b813 1944/** Container categories **/
41213c24 1945DWORD LIBNXCL_EXPORTABLE NXCLoadCCList(NXC_SESSION hSession, NXC_CC_LIST **ppList);
babb8280 1946void LIBNXCL_EXPORTABLE NXCDestroyCCList(NXC_CC_LIST *pList);
41213c24 1947
c6b8b813 1948/** Events **/
6ffe9c6c 1949DWORD LIBNXCL_EXPORTABLE NXCSyncEvents(NXC_SESSION hSession, DWORD dwMaxRecords);
41213c24 1950DWORD LIBNXCL_EXPORTABLE NXCLoadEventDB(NXC_SESSION hSession);
8eb2d92b 1951DWORD LIBNXCL_EXPORTABLE NXCModifyEventTemplate(NXC_SESSION hSession, NXC_EVENT_TEMPLATE *pArg);
41213c24
VK
1952DWORD LIBNXCL_EXPORTABLE NXCGenerateEventCode(NXC_SESSION hSession, DWORD *pdwEventCode);
1953void LIBNXCL_EXPORTABLE NXCAddEventTemplate(NXC_SESSION hSession, NXC_EVENT_TEMPLATE *pEventTemplate);
1954void LIBNXCL_EXPORTABLE NXCDeleteEDBRecord(NXC_SESSION hSession, DWORD dwEventCode);
1955DWORD LIBNXCL_EXPORTABLE NXCDeleteEventTemplate(NXC_SESSION hSession, DWORD dwEventCode);
41213c24
VK
1956BOOL LIBNXCL_EXPORTABLE NXCGetEventDB(NXC_SESSION hSession, NXC_EVENT_TEMPLATE ***pppTemplateList, DWORD *pdwNumRecords);
1957const TCHAR LIBNXCL_EXPORTABLE *NXCGetEventName(NXC_SESSION hSession, DWORD dwId);
1958BOOL LIBNXCL_EXPORTABLE NXCGetEventNameEx(NXC_SESSION hSession, DWORD dwId, TCHAR *pszBuffer, DWORD dwBufSize);
1959int LIBNXCL_EXPORTABLE NXCGetEventSeverity(NXC_SESSION hSession, DWORD dwId);
1960BOOL LIBNXCL_EXPORTABLE NXCGetEventText(NXC_SESSION hSession, DWORD dwId, TCHAR *pszBuffer, DWORD dwBufSize);
0b4ebe8b
VK
1961DWORD LIBNXCL_EXPORTABLE NXCSendEvent(NXC_SESSION hSession, DWORD dwEventCode, DWORD dwObjectId,
1962 int iNumArgs, TCHAR **pArgList, TCHAR *pszUserTag);
41213c24 1963
c6b8b813 1964/** Syslog **/
23b8cd4f
VK
1965DWORD LIBNXCL_EXPORTABLE NXCSyncSyslog(NXC_SESSION hSession, DWORD dwMaxRecords);
1966
c6b8b813 1967/** User management **/
41213c24
VK
1968DWORD LIBNXCL_EXPORTABLE NXCLoadUserDB(NXC_SESSION hSession);
1969NXC_USER LIBNXCL_EXPORTABLE *NXCFindUserById(NXC_SESSION hSession, DWORD dwId);
1970BOOL LIBNXCL_EXPORTABLE NXCGetUserDB(NXC_SESSION hSession, NXC_USER **ppUserList, DWORD *pdwNumUsers);
1971DWORD LIBNXCL_EXPORTABLE NXCLockUserDB(NXC_SESSION hSession);
1972DWORD LIBNXCL_EXPORTABLE NXCUnlockUserDB(NXC_SESSION hSession);
1973DWORD LIBNXCL_EXPORTABLE NXCCreateUser(NXC_SESSION hSession, TCHAR *pszName, BOOL bIsGroup, DWORD *pdwNewId);
1974DWORD LIBNXCL_EXPORTABLE NXCDeleteUser(NXC_SESSION hSession, DWORD dwId);
1975DWORD LIBNXCL_EXPORTABLE NXCModifyUser(NXC_SESSION hSession, NXC_USER *pUserInfo);
c20ec6c6 1976DWORD LIBNXCL_EXPORTABLE NXCModifyUserEx(NXC_SESSION hSession, NXC_USER *pUserInfo, DWORD dwFields);
75fb79a3 1977DWORD LIBNXCL_EXPORTABLE NXCSetPassword(NXC_SESSION hSession, DWORD userId, const TCHAR *newPassword, const TCHAR *oldPassword);
d46f2345 1978BOOL LIBNXCL_EXPORTABLE NXCNeedPasswordChange(NXC_SESSION hSession);
a9f9c5a9
VK
1979DWORD LIBNXCL_EXPORTABLE NXCGetUserVariable(NXC_SESSION hSession, DWORD dwUserId,
1980 TCHAR *pszVarName, TCHAR *pszValue, DWORD dwSize);
1981DWORD LIBNXCL_EXPORTABLE NXCSetUserVariable(NXC_SESSION hSession, DWORD dwUserId,
1982 TCHAR *pszVarName, TCHAR *pszValue);
388a9d53
VK
1983DWORD LIBNXCL_EXPORTABLE NXCCopyUserVariable(NXC_SESSION hSession, DWORD dwSrcUserId,
1984 DWORD dwDstUserId, TCHAR *pszVarName,
1985 BOOL bMove);
a9f9c5a9
VK
1986DWORD LIBNXCL_EXPORTABLE NXCEnumUserVariables(NXC_SESSION hSession, DWORD dwUserId,
1987 TCHAR *pszPattern, DWORD *pdwNumVars,
1988 TCHAR ***pppszVarList);
1989DWORD LIBNXCL_EXPORTABLE NXCDeleteUserVariable(NXC_SESSION hSession, DWORD dwUserId,
1990 TCHAR *pszVarName);
1de1b062
VK
1991DWORD LIBNXCL_EXPORTABLE NXCGetSessionList(NXC_SESSION hSession, DWORD *pdwNumSessions,
1992 NXC_CLIENT_SESSION_INFO **ppList);
1993DWORD LIBNXCL_EXPORTABLE NXCKillSession(NXC_SESSION hSession, DWORD dwSessionId);
388a9d53
VK
1994DWORD LIBNXCL_EXPORTABLE NXCGetCurrentUserId(NXC_SESSION hSession);
1995DWORD LIBNXCL_EXPORTABLE NXCGetCurrentSystemAccess(NXC_SESSION hSession);
41213c24 1996
c6b8b813 1997/** Data collection **/
41213c24
VK
1998DWORD LIBNXCL_EXPORTABLE NXCOpenNodeDCIList(NXC_SESSION hSession, DWORD dwNodeId, NXC_DCI_LIST **ppItemList);
1999DWORD LIBNXCL_EXPORTABLE NXCCloseNodeDCIList(NXC_SESSION hSession, NXC_DCI_LIST *pItemList);
2000DWORD LIBNXCL_EXPORTABLE NXCCreateNewDCI(NXC_SESSION hSession, NXC_DCI_LIST *pItemList, DWORD *pdwItemId);
2001DWORD LIBNXCL_EXPORTABLE NXCUpdateDCI(NXC_SESSION hSession, DWORD dwNodeId, NXC_DCI *pItem);
2002DWORD LIBNXCL_EXPORTABLE NXCDeleteDCI(NXC_SESSION hSession, NXC_DCI_LIST *pItemList, DWORD dwItemId);
2003DWORD LIBNXCL_EXPORTABLE NXCSetDCIStatus(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwNumItems,
2185f431 2004 DWORD *pdwItemList, int iStatus);
41213c24 2005DWORD LIBNXCL_EXPORTABLE NXCCopyDCI(NXC_SESSION hSession, DWORD dwSrcNodeId, DWORD dwDstNodeId,
a5a0cf7b 2006 DWORD dwNumItems, DWORD *pdwItemList, BOOL bMove);
b5b72be8 2007DWORD LIBNXCL_EXPORTABLE NXCApplyTemplate(NXC_SESSION hSession, DWORD dwTemplateId, DWORD dwNodeId);
7ac0c0a8 2008DWORD LIBNXCL_EXPORTABLE NXCItemIndex(NXC_DCI_LIST *pItemList, DWORD dwItemId);
41213c24 2009DWORD LIBNXCL_EXPORTABLE NXCGetDCIData(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwItemId, DWORD dwMaxRows,
b9b4ec17 2010 DWORD dwTimeFrom, DWORD dwTimeTo, NXC_DCI_DATA **ppData);
92aef3ef
VK
2011DWORD LIBNXCL_EXPORTABLE NXCGetDCIDataEx(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwItemId,
2012 DWORD dwMaxRows, DWORD dwTimeFrom, DWORD dwTimeTo,
2013 NXC_DCI_DATA **ppData, NXC_DCI_THRESHOLD **thresholds, DWORD *numThresholds);
4c20673b
VK
2014void LIBNXCL_EXPORTABLE NXCDestroyDCIData(NXC_DCI_DATA *pData);
2015NXC_DCI_ROW LIBNXCL_EXPORTABLE *NXCGetRowPtr(NXC_DCI_DATA *pData, DWORD dwRow);
b5b72be8
VK
2016DWORD LIBNXCL_EXPORTABLE NXCGetLastValues(NXC_SESSION hSession, DWORD dwNodeId,
2017 DWORD *pdwNumItems, NXC_DCI_VALUE **ppValueList);
c83f8219 2018DWORD LIBNXCL_EXPORTABLE NXCClearDCIData(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwItemId);
899f2093
VK
2019DWORD LIBNXCL_EXPORTABLE NXCAddThresholdToItem(NXC_DCI *pItem, NXC_DCI_THRESHOLD *pThreshold);
2020BOOL LIBNXCL_EXPORTABLE NXCDeleteThresholdFromItem(NXC_DCI *pItem, DWORD dwIndex);
2021BOOL LIBNXCL_EXPORTABLE NXCSwapThresholds(NXC_DCI *pItem, DWORD dwIndex1, DWORD dwIndex2);
41213c24 2022DWORD LIBNXCL_EXPORTABLE NXCQueryParameter(NXC_SESSION hSession, DWORD dwNodeId, int iOrigin, TCHAR *pszParameter,
2e0596dd 2023 TCHAR *pszBuffer, DWORD dwBufferSize);
4473ffc5
VK
2024DWORD LIBNXCL_EXPORTABLE NXCResolveDCINames(NXC_SESSION hSession, DWORD dwNumDCI,
2025 INPUT_DCI *pDCIList, TCHAR ***pppszNames);
74526d25
VK
2026DWORD LIBNXCL_EXPORTABLE NXCGetPerfTabDCIList(NXC_SESSION hSession, DWORD dwNodeId,
2027 DWORD *pdwNumItems, NXC_PERFTAB_DCI **ppList);
4e3e69ce 2028DWORD LIBNXCL_EXPORTABLE NXCPushDCIData(NXC_SESSION hSession, DWORD dwNumItems,
b95506f7 2029 NXC_DCI_PUSH_DATA *pItems, DWORD *pdwIndex);
ccc34207
VK
2030DWORD LIBNXCL_EXPORTABLE NXCTestDCITransformation(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwItemId,
2031 const TCHAR *script, const TCHAR *value, BOOL *execStatus,
2032 TCHAR *execResult, size_t resultBufSize);
7ec6cca8 2033
c6b8b813 2034/** MIB files **/
1dcd1bee 2035DWORD LIBNXCL_EXPORTABLE NXCGetMIBFileTimeStamp(NXC_SESSION hSession, DWORD *pdwTimeStamp);
7bdbe5a2 2036DWORD LIBNXCL_EXPORTABLE NXCDownloadMIBFile(NXC_SESSION hSession, const TCHAR *pszName);
a7d07192 2037
c6b8b813 2038/** Event processing policy **/
6990ef35 2039NXC_EPP LIBNXCL_EXPORTABLE *NXCCreateEmptyEventPolicy();
41213c24
VK
2040DWORD LIBNXCL_EXPORTABLE NXCOpenEventPolicy(NXC_SESSION hSession, NXC_EPP **ppEventPolicy);
2041DWORD LIBNXCL_EXPORTABLE NXCCloseEventPolicy(NXC_SESSION hSession);
2042DWORD LIBNXCL_EXPORTABLE NXCSaveEventPolicy(NXC_SESSION hSession, NXC_EPP *pEventPolicy);
a7d07192 2043void LIBNXCL_EXPORTABLE NXCDestroyEventPolicy(NXC_EPP *pEventPolicy);
6990ef35 2044void LIBNXCL_EXPORTABLE NXCAddPolicyRule(NXC_EPP *policy, NXC_EPP_RULE *rule, BOOL dynAllocated);
ef44d5ea 2045void LIBNXCL_EXPORTABLE NXCDeletePolicyRule(NXC_EPP *pEventPolicy, DWORD dwRule);
6990ef35
VK
2046NXC_EPP_RULE LIBNXCL_EXPORTABLE *NXCCopyEventPolicyRule(NXC_EPP_RULE *src);
2047void LIBNXCL_EXPORTABLE NXCCopyEventPolicyRuleToBuffer(NXC_EPP_RULE *dst, NXC_EPP_RULE *src);
a7d07192 2048
c6b8b813 2049/** Alarms **/
41213c24 2050DWORD LIBNXCL_EXPORTABLE NXCLoadAllAlarms(NXC_SESSION hSession, BOOL bIncludeAck, DWORD *pdwNumAlarms, NXC_ALARM **ppAlarmList);
2b58d71e 2051DWORD LIBNXCL_EXPORTABLE NXCAcknowledgeAlarm(NXC_SESSION hSession, DWORD dwAlarmId);
45b766ca 2052DWORD LIBNXCL_EXPORTABLE NXCTerminateAlarm(NXC_SESSION hSession, DWORD dwAlarmId);
41213c24 2053DWORD LIBNXCL_EXPORTABLE NXCDeleteAlarm(NXC_SESSION hSession, DWORD dwAlarmId);
c94fa5c2
VK
2054DWORD LIBNXCL_EXPORTABLE NXCOpenAlarm(NXC_SESSION hSession, DWORD dwAlarmId, TCHAR *pszHelpdeskRef);
2055DWORD LIBNXCL_EXPORTABLE NXCCloseAlarm(NXC_SESSION hSession, DWORD dwAlarmId);
2056TCHAR LIBNXCL_EXPORTABLE *NXCFormatAlarmText(NXC_SESSION session, NXC_ALARM *alarm, TCHAR *format);
03482383 2057
c6b8b813 2058/** Actions **/
41213c24 2059DWORD LIBNXCL_EXPORTABLE NXCLoadActions(NXC_SESSION hSession, DWORD *pdwNumActions, NXC_ACTION **ppActionList);
41213c24
VK
2060DWORD LIBNXCL_EXPORTABLE NXCCreateAction(NXC_SESSION hSession, TCHAR *pszName, DWORD *pdwNewId);
2061DWORD LIBNXCL_EXPORTABLE NXCModifyAction(NXC_SESSION hSession, NXC_ACTION *pAction);
2062DWORD LIBNXCL_EXPORTABLE NXCDeleteAction(NXC_SESSION hSession, DWORD dwActionId);
5bfcf934 2063
c6b8b813 2064/** SNMP trap configuration **/
41213c24 2065DWORD LIBNXCL_EXPORTABLE NXCLoadTrapCfg(NXC_SESSION hSession, DWORD *pdwNumTraps, NXC_TRAP_CFG_ENTRY **ppTrapList);
840eb902 2066void LIBNXCL_EXPORTABLE NXCDestroyTrapList(DWORD dwNumTraps, NXC_TRAP_CFG_ENTRY *pTrapList);
41213c24
VK
2067DWORD LIBNXCL_EXPORTABLE NXCCreateTrap(NXC_SESSION hSession, DWORD *pdwTrapId);
2068DWORD LIBNXCL_EXPORTABLE NXCModifyTrap(NXC_SESSION hSession, NXC_TRAP_CFG_ENTRY *pTrap);
2069DWORD LIBNXCL_EXPORTABLE NXCDeleteTrap(NXC_SESSION hSession, DWORD dwTrapId);
319a91b3 2070DWORD LIBNXCL_EXPORTABLE NXCSyncSNMPTrapLog(NXC_SESSION hSession, DWORD dwMaxRecords);
25d36474
VK
2071DWORD LIBNXCL_EXPORTABLE NXCGetTrapCfgRO(NXC_SESSION hSession, DWORD *pdwNumTraps,
2072 NXC_TRAP_CFG_ENTRY **ppTrapList);
15edffbf
VK
2073NXC_TRAP_CFG_ENTRY LIBNXCL_EXPORTABLE *NXCDuplicateTrapCfgEntry(NXC_TRAP_CFG_ENTRY *src);
2074void LIBNXCL_EXPORTABLE NXCCopyTrapCfgEntry(NXC_TRAP_CFG_ENTRY *dst, NXC_TRAP_CFG_ENTRY *src);
2075void LIBNXCL_EXPORTABLE NXCDestroyTrapCfgEntry(NXC_TRAP_CFG_ENTRY *e);
840eb902 2076
c6b8b813 2077/** Packages **/
5be45ff2
VK
2078DWORD LIBNXCL_EXPORTABLE NXCLockPackageDB(NXC_SESSION hSession);
2079DWORD LIBNXCL_EXPORTABLE NXCUnlockPackageDB(NXC_SESSION hSession);
1c8b8363
VK
2080DWORD LIBNXCL_EXPORTABLE NXCGetPackageList(NXC_SESSION hSession, DWORD *pdwNumPackages,
2081 NXC_PACKAGE_INFO **ppList);
257defd7
VK
2082DWORD LIBNXCL_EXPORTABLE NXCInstallPackage(NXC_SESSION hSession, NXC_PACKAGE_INFO *pInfo,
2083 TCHAR *pszFullPkgPath);
19acf449 2084DWORD LIBNXCL_EXPORTABLE NXCRemovePackage(NXC_SESSION hSession, DWORD dwPkgId);
93e33892 2085DWORD LIBNXCL_EXPORTABLE NXCParseNPIFile(TCHAR *pszInfoFile, NXC_PACKAGE_INFO *pInfo);
e4cfb9f3
VK
2086DWORD LIBNXCL_EXPORTABLE NXCDeployPackage(NXC_SESSION hSession, DWORD dwPkgId,
2087 DWORD dwNumObjects, DWORD *pdwObjectList,
2088 DWORD *pdwRqId);
1c8b8363 2089
c6b8b813 2090/** Server management **/
dd5b3364 2091DWORD LIBNXCL_EXPORTABLE NXCResetServerComponent(NXC_SESSION hSession, DWORD dwComponent);
64a495ad 2092DWORD LIBNXCL_EXPORTABLE NXCGetServerStats(NXC_SESSION hSession, NXC_SERVER_STATS *pStats);
5c9947dc
VK
2093DWORD LIBNXCL_EXPORTABLE NXCGetServerVariables(NXC_SESSION hSession,
2094 NXC_SERVER_VARIABLE **ppVarList,
2095 DWORD *pdwNumVars);
ce7565e7
VK
2096DWORD LIBNXCL_EXPORTABLE NXCSetServerVariable(NXC_SESSION hSession, const TCHAR *pszVarName,
2097 const TCHAR *pszValue);
2098DWORD LIBNXCL_EXPORTABLE NXCDeleteServerVariable(NXC_SESSION hSession, const TCHAR *pszVarName);
c6b8b813
VK
2099DWORD LIBNXCL_EXPORTABLE NXCGetServerConfigCLOB(NXC_SESSION hSession, const TCHAR *name, TCHAR **value);
2100DWORD LIBNXCL_EXPORTABLE NXCSetServerConfigCLOB(NXC_SESSION hSession, const TCHAR *name, const TCHAR *value);
5c9947dc 2101
c6b8b813 2102/** Object tools **/
b7a391d7
VK
2103DWORD LIBNXCL_EXPORTABLE NXCGetObjectTools(NXC_SESSION hSession, DWORD *pdwNumTools,
2104 NXC_OBJECT_TOOL **ppToolList);
2105void LIBNXCL_EXPORTABLE NXCDestroyObjectToolList(DWORD dwNumTools, NXC_OBJECT_TOOL *pList);
e31c8e60 2106#ifdef __cplusplus
53902f72 2107DWORD LIBNXCL_EXPORTABLE NXCExecuteTableTool(NXC_SESSION hSession, DWORD dwNodeId,
e31c8e60
VK
2108 DWORD dwToolId, Table **ppData);
2109#endif
c4096dd8
VK
2110DWORD LIBNXCL_EXPORTABLE NXCGetObjectToolDetails(NXC_SESSION hSession, DWORD dwToolId,
2111 NXC_OBJECT_TOOL_DETAILS **ppData);
2112void LIBNXCL_EXPORTABLE NXCDestroyObjectToolDetails(NXC_OBJECT_TOOL_DETAILS *pData);
2113DWORD LIBNXCL_EXPORTABLE NXCDeleteObjectTool(NXC_SESSION hSession, DWORD dwToolId);
d3637d82
VK
2114DWORD LIBNXCL_EXPORTABLE NXCGenerateObjectToolId(NXC_SESSION hSession, DWORD *pdwToolId);
2115DWORD LIBNXCL_EXPORTABLE NXCUpdateObjectTool(NXC_SESSION hSession,
2116 NXC_OBJECT_TOOL_DETAILS *pData);
1b282e44 2117BOOL LIBNXCL_EXPORTABLE NXCIsAppropriateTool(NXC_OBJECT_TOOL *pTool, NXC_OBJECT *pObject);
b7a391d7 2118
c6b8b813 2119/** Script library **/
e0e45119
VK
2120DWORD LIBNXCL_EXPORTABLE NXCGetScriptList(NXC_SESSION hSession, DWORD *pdwNumScrpts,
2121 NXC_SCRIPT_INFO **ppList);
2122DWORD LIBNXCL_EXPORTABLE NXCGetScript(NXC_SESSION hSession, DWORD dwId, TCHAR **ppszCode);
269e3aca 2123DWORD LIBNXCL_EXPORTABLE NXCUpdateScript(NXC_SESSION hSession, DWORD *pdwId,
e0e45119 2124 TCHAR *pszName, TCHAR *pszCode);
1f0cfca5
VK
2125DWORD LIBNXCL_EXPORTABLE NXCRenameScript(NXC_SESSION hSession, DWORD dwId,
2126 TCHAR *pszName);
2127DWORD LIBNXCL_EXPORTABLE NXCDeleteScript(NXC_SESSION hSession, DWORD dwId);
e0e45119 2128
c6b8b813 2129/** SNMP **/
f3010fc1
VK
2130DWORD LIBNXCL_EXPORTABLE NXCSnmpWalk(NXC_SESSION hSession, DWORD dwNode,
2131 TCHAR *pszRootOID, void *pUserData,
2132 void (* pfCallback)(TCHAR *, DWORD, TCHAR *, void *));
72c0e661
VK
2133DWORD LIBNXCL_EXPORTABLE NXCGetSnmpCommunityList(NXC_SESSION hSession, DWORD *pdwNumStrings,
2134 TCHAR ***pppszStringList);
2135DWORD LIBNXCL_EXPORTABLE NXCUpdateSnmpCommunityList(NXC_SESSION hSession, DWORD dwNumStrings,
2136 TCHAR **ppszStringList);
df8a4ca2
VK
2137DWORD LIBNXCL_EXPORTABLE NXCGetSnmpUsmCredentials(NXC_SESSION hSession, DWORD *listSize, NXC_SNMP_USM_CRED **list);
2138DWORD LIBNXCL_EXPORTABLE NXCUpdateSnmpUsmCredentials(NXC_SESSION hSession, DWORD count, NXC_SNMP_USM_CRED *list);
f3010fc1 2139
c6b8b813 2140/** Maps **/
8b56eec1
VK
2141DWORD LIBNXCL_EXPORTABLE NXCGetMapList(NXC_SESSION hSession, DWORD *pdwNumMaps,
2142 NXC_MAP_INFO **ppMapList);
2143DWORD LIBNXCL_EXPORTABLE NXCSaveMap(NXC_SESSION hSession, void *pMap);
2144DWORD LIBNXCL_EXPORTABLE NXCLoadMap(NXC_SESSION hSession, DWORD dwMapId, void **ppMap);
8b56eec1
VK
2145DWORD LIBNXCL_EXPORTABLE NXCResolveMapName(NXC_SESSION hSession, TCHAR *pszMapName,
2146 DWORD *pdwMapId);
a2cdb3a4
VK
2147DWORD LIBNXCL_EXPORTABLE NXCUploadSubmapBkImage(NXC_SESSION hSession, DWORD dwMapId,
2148 DWORD dwSubmapId, TCHAR *pszFile);
2149DWORD LIBNXCL_EXPORTABLE NXCDownloadSubmapBkImage(NXC_SESSION hSession, DWORD dwMapId,
2150 DWORD dwSubmapId, TCHAR *pszFile);
56c58457
VK
2151DWORD LIBNXCL_EXPORTABLE NXCCreateMap(NXC_SESSION hSession, DWORD dwRootObj,
2152 TCHAR *pszName, DWORD *pdwMapId);
2153DWORD LIBNXCL_EXPORTABLE NXCDeleteMap(NXC_SESSION hSession, DWORD dwMapId);
3992452b 2154DWORD LIBNXCL_EXPORTABLE NXCRenameMap(NXC_SESSION hSession, DWORD dwMapId, const TCHAR *pszName);
8b56eec1 2155
c6b8b813 2156/** Address lists **/
e2ce7f94
VK
2157DWORD LIBNXCL_EXPORTABLE NXCGetAddrList(NXC_SESSION hSession, DWORD dwListType,
2158 DWORD *pdwAddrCount, NXC_ADDR_ENTRY **ppAddrList);
2159DWORD LIBNXCL_EXPORTABLE NXCSetAddrList(NXC_SESSION hSession, DWORD dwListType,
2160 DWORD dwAddrCount, NXC_ADDR_ENTRY *pAddrList);
2161
c6b8b813 2162/** Agent configurations **/
48ad2f8d
VK
2163DWORD LIBNXCL_EXPORTABLE NXCGetAgentConfigList(NXC_SESSION hSession, DWORD *pdwNumRecs,
2164 NXC_AGENT_CONFIG_INFO **ppList);
2165DWORD LIBNXCL_EXPORTABLE NXCOpenAgentConfig(NXC_SESSION hSession, DWORD dwCfgId,
2166 NXC_AGENT_CONFIG *pConfig);
2167DWORD LIBNXCL_EXPORTABLE NXCSaveAgentConfig(NXC_SESSION hSession, NXC_AGENT_CONFIG *pConfig);
2168DWORD LIBNXCL_EXPORTABLE NXCDeleteAgentConfig(NXC_SESSION hSession, DWORD dwCfgId);
a3c76aba 2169DWORD LIBNXCL_EXPORTABLE NXCSwapAgentConfigs(NXC_SESSION hSession, DWORD dwCfgId1, DWORD dwCfgId2);
48ad2f8d 2170
a7ff20a5
VK
2171/** Server configuration export/import **/
2172DWORD LIBNXCL_EXPORTABLE NXCExportConfiguration(NXC_SESSION hSession, TCHAR *pszDescr,
2173 DWORD dwNumEvents, DWORD *pdwEventList,
2174 DWORD dwNumTemplates, DWORD *pdwTemplateList,
2175 DWORD dwNumTraps, DWORD *pdwTrapList,
2176 TCHAR **ppszContent);
2177DWORD LIBNXCL_EXPORTABLE NXCImportConfiguration(NXC_SESSION hSession, TCHAR *pszContent,
2178 DWORD dwFlags, TCHAR *pszErrorText, int nErrorLen);
8bad8476 2179
c6b8b813 2180/** Predefined graphs **/
0aa59db6
VK
2181DWORD LIBNXCL_EXPORTABLE NXCGetGraphList(NXC_SESSION hSession, DWORD *pdwNumGraphs, NXC_GRAPH **ppGraphList);
2182void LIBNXCL_EXPORTABLE NXCDestroyGraphList(DWORD dwNumGraphs, NXC_GRAPH *pList);
2183DWORD LIBNXCL_EXPORTABLE NXCDefineGraph(NXC_SESSION hSession, NXC_GRAPH *pGraph);
2184DWORD LIBNXCL_EXPORTABLE NXCDeleteGraph(NXC_SESSION hSession, DWORD dwGraphId);
2185
c6b8b813 2186/** Certificates **/
3d1058ed
VK
2187DWORD LIBNXCL_EXPORTABLE NXCAddCACertificate(NXC_SESSION hSession, DWORD dwCertLen,
2188 BYTE *pCert, TCHAR *pszComments);
7767fbb8
VK
2189DWORD LIBNXCL_EXPORTABLE NXCUpdateCertificateComments(NXC_SESSION hSession, DWORD dwCertId,
2190 TCHAR *pszComments);
3d1058ed
VK
2191DWORD LIBNXCL_EXPORTABLE NXCDeleteCertificate(NXC_SESSION hSession, DWORD dwCertId);
2192DWORD LIBNXCL_EXPORTABLE NXCGetCertificateList(NXC_SESSION hSession, NXC_CERT_LIST **ppList);
2193void LIBNXCL_EXPORTABLE NXCDestroyCertificateList(NXC_CERT_LIST *pList);
2194
c6b8b813 2195/** Layer 2 topology **/
0e0da2f1
VK
2196DWORD LIBNXCL_EXPORTABLE NXCQueryL2Topology(NXC_SESSION hSession, DWORD dwNodeId, void **ppTopology);
2197
c6b8b813 2198/** Situations **/
431f302b
VK
2199DWORD LIBNXCL_EXPORTABLE NXCCreateSituation(NXC_SESSION hSession, const TCHAR *name, const TCHAR *comments, DWORD *pdwId);
2200DWORD LIBNXCL_EXPORTABLE NXCModifySituation(NXC_SESSION hSession, DWORD id,
2201 const TCHAR *name, const TCHAR *comments);
2202DWORD LIBNXCL_EXPORTABLE NXCDeleteSituation(NXC_SESSION hSession, DWORD id);
2203DWORD LIBNXCL_EXPORTABLE NXCDeleteSituationInstance(NXC_SESSION hSession, DWORD id, const TCHAR *instance);
2204
2205#ifdef __cplusplus
2206DWORD LIBNXCL_EXPORTABLE NXCGetSituationList(NXC_SESSION hSession, NXC_SITUATION_LIST **list);
2207void LIBNXCL_EXPORTABLE NXCDestroySituationList(NXC_SITUATION_LIST *list);
35dfcebd 2208void LIBNXCL_EXPORTABLE NXCUpdateSituationList(NXC_SITUATION_LIST *list, int code, NXC_SITUATION *update);
431f302b
VK
2209#endif
2210
80ffed5a
VK
2211#ifdef __cplusplus
2212}
2213#endif
2214
7ec6cca8
VK
2215#endif /* LIBNXCL_NO_DECLARATIONS */
2216
80ffed5a 2217#endif /* _nxclapi_h_ */