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