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