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