7c49c23d52dbdfc32c8458d07c52ab5fb991e989
[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
539 /**
540 * Mask bits for NXCModifyEventTemplate()
541 */
542 #define EM_SEVERITY ((UINT32)0x01)
543 #define EM_FLAGS ((UINT32)0x02)
544 #define EM_NAME ((UINT32)0x04)
545 #define EM_MESSAGE ((UINT32)0x08)
546 #define EM_DESCRIPTION ((UINT32)0x10)
547 #define EM_ALL ((UINT32)0x1F)
548
549 /**
550 * Mask bits (flags) for NXCModifyObject()
551 */
552 #define OBJ_UPDATE_NAME ((QWORD)_ULL(0x0000000001))
553 #define OBJ_UPDATE_AGENT_PORT ((QWORD)_ULL(0x0000000002))
554 #define OBJ_UPDATE_AGENT_AUTH ((QWORD)_ULL(0x0000000004))
555 #define OBJ_UPDATE_AGENT_SECRET ((QWORD)_ULL(0x0000000008))
556 #define OBJ_UPDATE_SNMP_VERSION ((QWORD)_ULL(0x0000000010))
557 #define OBJ_UPDATE_SNMP_AUTH ((QWORD)_ULL(0x0000000020))
558 #define OBJ_UPDATE_ACL ((QWORD)_ULL(0x0000000040))
559 #define OBJ_UPDATE_GEOLOCATION ((QWORD)_ULL(0x0000000080))
560 #define OBJ_UPDATE_SYNC_NETS ((QWORD)_ULL(0x0000000100))
561 #define OBJ_UPDATE_SERVICE_TYPE ((QWORD)_ULL(0x0000000200))
562 #define OBJ_UPDATE_IP_PROTO ((QWORD)_ULL(0x0000000400))
563 #define OBJ_UPDATE_IP_PORT ((QWORD)_ULL(0x0000000800))
564 #define OBJ_UPDATE_CHECK_REQUEST ((QWORD)_ULL(0x0000001000))
565 #define OBJ_UPDATE_CHECK_RESPONSE ((QWORD)_ULL(0x0000002000))
566 #define OBJ_UPDATE_POLLER_NODE ((QWORD)_ULL(0x0000004000))
567 #define OBJ_UPDATE_IP_ADDR ((QWORD)_ULL(0x0000008000))
568 #define OBJ_UPDATE_PEER_GATEWAY ((QWORD)_ULL(0x0000010000))
569 #define OBJ_UPDATE_NETWORK_LIST ((QWORD)_ULL(0x0000020000))
570 #define OBJ_UPDATE_STATUS_ALG ((QWORD)_ULL(0x0000040000))
571 #define OBJ_UPDATE_PROXY_NODE ((QWORD)_ULL(0x0000080000))
572 #define OBJ_UPDATE_FLAGS ((QWORD)_ULL(0x0000100000))
573 #define OBJ_UPDATE_ACT_EVENT ((QWORD)_ULL(0x0000200000))
574 #define OBJ_UPDATE_DEACT_EVENT ((QWORD)_ULL(0x0000400000))
575 #define OBJ_UPDATE_SOURCE_OBJECT ((QWORD)_ULL(0x0000800000))
576 #define OBJ_UPDATE_ACTIVE_STATUS ((QWORD)_ULL(0x0001000000))
577 #define OBJ_UPDATE_INACTIVE_STATUS ((QWORD)_ULL(0x0002000000))
578 #define OBJ_UPDATE_DCI_LIST ((QWORD)_ULL(0x0004000000))
579 #define OBJ_UPDATE_SCRIPT ((QWORD)_ULL(0x0008000000))
580 #define OBJ_UPDATE_CLUSTER_TYPE ((QWORD)_ULL(0x0010000000))
581 #define OBJ_UPDATE_RESOURCES ((QWORD)_ULL(0x0020000000))
582 #define OBJ_UPDATE_SNMP_PROXY ((QWORD)_ULL(0x0040000000))
583 #define OBJ_UPDATE_REQUIRED_POLLS ((QWORD)_ULL(0x0080000000))
584 #define OBJ_UPDATE_TRUSTED_NODES ((QWORD)_ULL(0x0100000000))
585 #define OBJ_UPDATE_CUSTOM_ATTRS ((QWORD)_ULL(0x0200000000))
586 #define OBJ_UPDATE_USE_IFXTABLE ((QWORD)_ULL(0x0400000000))
587 #define OBJ_UPDATE_AUTOBIND ((QWORD)_ULL(0x1000000000))
588 #define OBJ_UPDATE_SNMP_PORT ((QWORD)_ULL(0x2000000000))
589 #define OBJ_UPDATE_PRIMARY_NAME ((QWORD)_ULL(0x4000000000))
590
591
592 //
593 // Global user rights
594 //
595
596 #ifndef LIBNXCL_CUSTOM_USER_RIGHTS
597
598 #define SYSTEM_ACCESS_MANAGE_USERS _ULL(0x00000001)
599 #define SYSTEM_ACCESS_SERVER_CONFIG _ULL(0x00000002)
600 #define SYSTEM_ACCESS_CONFIGURE_TRAPS _ULL(0x00000004)
601 #define SYSTEM_ACCESS_MANAGE_SESSIONS _ULL(0x00000008)
602 #define SYSTEM_ACCESS_VIEW_EVENT_DB _ULL(0x00000010)
603 #define SYSTEM_ACCESS_EDIT_EVENT_DB _ULL(0x00000020)
604 #define SYSTEM_ACCESS_EPP _ULL(0x00000040)
605 #define SYSTEM_ACCESS_MANAGE_ACTIONS _ULL(0x00000080)
606 #define SYSTEM_ACCESS_DELETE_ALARMS _ULL(0x00000100)
607 #define SYSTEM_ACCESS_MANAGE_PACKAGES _ULL(0x00000200)
608 #define SYSTEM_ACCESS_VIEW_EVENT_LOG _ULL(0x00000400)
609 #define SYSTEM_ACCESS_MANAGE_TOOLS _ULL(0x00000800)
610 #define SYSTEM_ACCESS_MANAGE_SCRIPTS _ULL(0x00001000)
611 #define SYSTEM_ACCESS_VIEW_TRAP_LOG _ULL(0x00002000)
612 #define SYSTEM_ACCESS_VIEW_AUDIT_LOG _ULL(0x00004000)
613 #define SYSTEM_ACCESS_MANAGE_AGENT_CFG _ULL(0x00008000)
614 #define SYSTEM_ACCESS_MANAGE_SITUATIONS _ULL(0x00010000)
615 #define SYSTEM_ACCESS_SEND_SMS _ULL(0x00020000)
616 #define SYSTEM_ACCESS_MOBILE_DEVICE_LOGIN _ULL(0x00040000)
617 #define SYSTEM_ACCESS_REGISTER_AGENTS _ULL(0x00080000)
618 #define SYSTEM_ACCESS_READ_FILES _ULL(0x00100000)
619 #define SYSTEM_ACCESS_SERVER_CONSOLE _ULL(0x00200000)
620 #define SYSTEM_ACCESS_MANAGE_FILES _ULL(0x00400000)
621 #define SYSTEM_ACCESS_MANAGE_MAPPING_TBLS _ULL(0x00800000)
622 #define SYSTEM_ACCESS_MANAGE_SUMMARY_TBLS _ULL(0x01000000)
623 #define SYSTEM_ACCESS_REPORTING_SERVER _ULL(0x02000000)
624 #define SYSTEM_ACCESS_XMPP_COMMANDS _ULL(0x04000000)
625 #define SYSTEM_ACCESS_MANAGE_IMAGE_LIB _ULL(0x08000000)
626 #define SYSTEM_ACCESS_UNLINK_ISSUES _ULL(0x10000000)
627
628 #define SYSTEM_ACCESS_FULL _ULL(0x1FFFFFFF)
629
630 #endif /* LIBNXCL_CUSTOM_USER_RIGHTS */
631
632 /**
633 * Object access rights
634 */
635 #define OBJECT_ACCESS_READ 0x00000001
636 #define OBJECT_ACCESS_MODIFY 0x00000002
637 #define OBJECT_ACCESS_CREATE 0x00000004
638 #define OBJECT_ACCESS_DELETE 0x00000008
639 #define OBJECT_ACCESS_READ_ALARMS 0x00000010
640 #define OBJECT_ACCESS_ACL 0x00000020
641 #define OBJECT_ACCESS_UPDATE_ALARMS 0x00000040
642 #define OBJECT_ACCESS_SEND_EVENTS 0x00000080
643 #define OBJECT_ACCESS_CONTROL 0x00000100
644 #define OBJECT_ACCESS_TERM_ALARMS 0x00000200
645 #define OBJECT_ACCESS_PUSH_DATA 0x00000400
646 #define OBJECT_ACCESS_CREATE_ISSUE 0x00000800
647 #define OBJECT_ACCESS_DOWNLOAD 0x00001000
648 #define OBJECT_ACCESS_UPLOAD 0x00002000
649 #define OBJECT_ACCESS_MANAGE_FILES 0x00004000
650
651 /**
652 * Object sync flags
653 */
654 #define OBJECT_SYNC_SEND_UPDATES 0x0001
655 #define OBJECT_SYNC_DUAL_CONFIRM 0x0002
656
657 /**
658 * User/group flags
659 */
660 #define UF_MODIFIED 0x0001
661 #define UF_DELETED 0x0002
662 #define UF_DISABLED 0x0004
663 #define UF_CHANGE_PASSWORD 0x0008
664 #define UF_CANNOT_CHANGE_PASSWORD 0x0010
665 #define UF_INTRUDER_LOCKOUT 0x0020
666 #define UF_PASSWORD_NEVER_EXPIRES 0x0040
667 #define UF_LDAP_USER 0x0080
668 #define UF_SYNC_EXCEPTION 0x0100
669
670 /**
671 * Fields for NXCModifyUserEx
672 */
673 #define USER_MODIFY_LOGIN_NAME 0x00000001
674 #define USER_MODIFY_DESCRIPTION 0x00000002
675 #define USER_MODIFY_FULL_NAME 0x00000004
676 #define USER_MODIFY_FLAGS 0x00000008
677 #define USER_MODIFY_ACCESS_RIGHTS 0x00000010
678 #define USER_MODIFY_MEMBERS 0x00000020
679 #define USER_MODIFY_CERT_MAPPING 0x00000040
680 #define USER_MODIFY_AUTH_METHOD 0x00000080
681 #define USER_MODIFY_PASSWD_LENGTH 0x00000100
682 #define USER_MODIFY_TEMP_DISABLE 0x00000200
683 #define USER_MODIFY_CUSTOM_ATTRIBUTES 0x00000400
684 #define USER_MODIFY_XMPP_ID 0x00000800
685 #define USER_MODIFY_GROUP_MEMBERSHIP 0x00001000
686
687 /**
688 * User certificate mapping methods
689 */
690 #define USER_MAP_CERT_BY_SUBJECT 0
691 #define USER_MAP_CERT_BY_PUBKEY 1
692 #define USER_MAP_CERT_BY_CN 2
693
694 /**
695 * User database change notification types
696 */
697 #define USER_DB_CREATE 0
698 #define USER_DB_DELETE 1
699 #define USER_DB_MODIFY 2
700
701 /**
702 * Situation change notification types
703 */
704 #define SITUATION_CREATE 1
705 #define SITUATION_DELETE 2
706 #define SITUATION_UPDATE 3
707 #define SITUATION_INSTANCE_UPDATE 4
708 #define SITUATION_INSTANCE_DELETE 5
709
710 /**
711 * Report rendering formats
712 */
713 #define REPORT_FORMAT_PDF 1
714 #define REPORT_FORMAT_HTML 2
715
716 /**
717 * Data collection object types
718 */
719 #define DCO_TYPE_GENERIC 0
720 #define DCO_TYPE_ITEM 1
721 #define DCO_TYPE_TABLE 2
722
723 /**
724 * DCI flags
725 */
726 #define DCF_ADVANCED_SCHEDULE ((UINT16)0x0001)
727 #define DCF_ALL_THRESHOLDS ((UINT16)0x0002)
728 #define DCF_RAW_VALUE_OCTET_STRING ((UINT16)0x0004)
729 #define DCF_SHOW_ON_OBJECT_TOOLTIP ((UINT16)0x0008)
730 #define DCF_AGGREGATE_FUNCTION_MASK ((UINT16)0x0070)
731 #define DCF_AGGREGATE_ON_CLUSTER ((UINT16)0x0080)
732 #define DCF_TRANSFORM_AGGREGATED ((UINT16)0x0100)
733 #define DCF_NO_STORAGE ((UINT16)0x0200)
734
735 /**
736 * Get cluster aggregation function from DCI flags
737 */
738 #define DCF_GET_AGGREGATION_FUNCTION(flags) (((flags) & DCF_AGGREGATE_FUNCTION_MASK) >> 4)
739 #define DCF_SET_AGGREGATION_FUNCTION(flags,func) (((flags) & ~DCF_AGGREGATE_FUNCTION_MASK) | (((func) & 0x07) << 4))
740
741 /**
742 * DCTable column flags
743 */
744 #define TCF_DATA_TYPE_MASK ((UINT16)0x000F)
745 #define TCF_AGGREGATE_FUNCTION_MASK ((UINT16)0x0070)
746 #define TCF_INSTANCE_COLUMN ((UINT16)0x0100)
747 #define TCF_INSTANCE_LABEL_COLUMN ((UINT16)0x0200)
748
749 /**
750 * Get cluster aggregation function from column flags
751 */
752 #define TCF_GET_AGGREGATION_FUNCTION(flags) (((flags) & TCF_AGGREGATE_FUNCTION_MASK) >> 4)
753 #define TCF_SET_AGGREGATION_FUNCTION(flags,func) (((flags) & ~DCF_AGGREGATE_FUNCTION_MASK) | (((func) & 0x07) << 4))
754
755 /**
756 * Get data type from column flags
757 */
758 #define TCF_GET_DATA_TYPE(flags) ((flags) & TCF_DATA_TYPE_MASK)
759 #define TCF_SET_DATA_TYPE(flags,dt) (((flags) & ~TCF_DATA_TYPE_MASK) | ((dt) & 0x0F))
760
761 /**
762 * Aggregation functions
763 */
764 #define DCF_FUNCTION_SUM 0
765 #define DCF_FUNCTION_AVG 1
766 #define DCF_FUNCTION_MIN 2
767 #define DCF_FUNCTION_MAX 3
768
769 /**
770 * SNMP raw types
771 */
772 #define SNMP_RAWTYPE_NONE 0
773 #define SNMP_RAWTYPE_INT32 1
774 #define SNMP_RAWTYPE_UINT32 2
775 #define SNMP_RAWTYPE_INT64 3
776 #define SNMP_RAWTYPE_UINT64 4
777 #define SNMP_RAWTYPE_DOUBLE 5
778 #define SNMP_RAWTYPE_IP_ADDR 6
779 #define SNMP_RAWTYPE_MAC_ADDR 7
780
781 /**
782 * Data sources
783 */
784 #define DS_INTERNAL 0
785 #define DS_NATIVE_AGENT 1
786 #define DS_SNMP_AGENT 2
787 #define DS_CHECKPOINT_AGENT 3
788 #define DS_PUSH_AGENT 4
789 #define DS_WINPERF 5
790 #define DS_SMCLP 6
791
792 /**
793 * Item status
794 */
795 #define ITEM_STATUS_ACTIVE 0
796 #define ITEM_STATUS_DISABLED 1
797 #define ITEM_STATUS_NOT_SUPPORTED 2
798
799 /**
800 * Delta calculation methods for DCIs
801 */
802 #define DCM_ORIGINAL_VALUE 0
803 #define DCM_SIMPLE 1
804 #define DCM_AVERAGE_PER_SECOND 2
805 #define DCM_AVERAGE_PER_MINUTE 3
806
807 /**
808 * Threshold functions
809 */
810 #define F_LAST 0
811 #define F_AVERAGE 1
812 #define F_DEVIATION 2
813 #define F_DIFF 3
814 #define F_ERROR 4
815 #define F_SUM 5
816 #define F_SCRIPT 6
817
818 /**
819 * Threshold operations
820 */
821 #define OP_LE 0
822 #define OP_LE_EQ 1
823 #define OP_EQ 2
824 #define OP_GT_EQ 3
825 #define OP_GT 4
826 #define OP_NE 5
827 #define OP_LIKE 6
828 #define OP_NOTLIKE 7
829
830 /**
831 * DCI base units
832 */
833 #define DCI_BASEUNITS_OTHER 0
834 #define DCI_BASEUNITS_CUSTOM 1
835 #define DCI_BASEUNITS_BYTES 2
836 #define DCI_BASEUNITS_BITS 3
837 #define DCI_BASEUNITS_SECONDS 4
838 #define DCI_BASEUNITS_PERCENTS 5
839 #define DCI_BASEUNITS_BITS_PER_SECOND 6
840 #define DCI_BASEUNITS_BYTES_PER_SECOND 7
841
842 /**
843 * DCI instance discovery methods
844 */
845 #define IDM_NONE 0
846 #define IDM_AGENT_LIST 1
847 #define IDM_AGENT_TABLE 2
848 #define IDM_SNMP_WALK_VALUES 3
849 #define IDM_SNMP_WALK_OIDS 4
850
851 /**
852 * Event policy rule flags
853 */
854 #define RF_STOP_PROCESSING 0x0001
855 #define RF_NEGATED_SOURCE 0x0002
856 #define RF_NEGATED_EVENTS 0x0004
857 #define RF_GENERATE_ALARM 0x0008
858 #define RF_DISABLED 0x0010
859 #define RF_TERMINATE_BY_REGEXP 0x0020
860 #define RF_SEVERITY_INFO 0x0100
861 #define RF_SEVERITY_WARNING 0x0200
862 #define RF_SEVERITY_MINOR 0x0400
863 #define RF_SEVERITY_MAJOR 0x0800
864 #define RF_SEVERITY_CRITICAL 0x1000
865
866 /**
867 * Action types
868 */
869 #define ACTION_EXEC 0
870 #define ACTION_REMOTE 1
871 #define ACTION_SEND_EMAIL 2
872 #define ACTION_SEND_SMS 3
873 #define ACTION_FORWARD_EVENT 4
874 #define ACTION_NXSL_SCRIPT 5
875 #define ACTION_XMPP_MESSAGE 6
876
877 /**
878 * Network map types
879 */
880 #define NETMAP_USER_DEFINED 0
881 #define NETMAP_IP_TOPOLOGY 1
882 #define NETMAP_L2_TOPOLOGY 2
883
884 /**
885 * Network map flags
886 */
887 #define MF_SHOW_STATUS_ICON 0x00000001
888 #define MF_SHOW_STATUS_FRAME 0x00000002
889 #define MF_SHOW_STATUS_BKGND 0x00000004
890 #define MF_SHOW_END_NODES 0x00000008
891 #define MF_CALCULATE_STATUS 0x00000010
892
893 /**
894 * Network map layouts
895 */
896 #define MAP_LAYOUT_MANUAL 0x7FFF
897 #define MAP_LAYOUT_SPRING 0
898 #define MAP_LAYOUT_RADIAL 1
899 #define MAP_LAYOUT_HTREE 2
900 #define MAP_LAYOUT_VTREE 3
901 #define MAP_LAYOUT_SPARSE_VTREE 4
902
903
904 //
905 // Deployment manager status codes
906 //
907
908 #define DEPLOYMENT_STATUS_PENDING 0
909 #define DEPLOYMENT_STATUS_TRANSFER 1
910 #define DEPLOYMENT_STATUS_INSTALLATION 2
911 #define DEPLOYMENT_STATUS_COMPLETED 3
912 #define DEPLOYMENT_STATUS_FAILED 4
913 #define DEPLOYMENT_STATUS_INITIALIZE 5
914 #define DEPLOYMENT_STATUS_FINISHED 255
915
916 /**
917 * Session subscription codes (data channels)
918 */
919 #define NXC_CHANNEL_EVENTS 0x00000001
920 #define NXC_CHANNEL_SYSLOG 0x00000002
921 #define NXC_CHANNEL_ALARMS 0x00000004
922 #define NXC_CHANNEL_OBJECTS 0x00000008
923 #define NXC_CHANNEL_SNMP_TRAPS 0x00000010
924 #define NXC_CHANNEL_AUDIT_LOG 0x00000020
925 #define NXC_CHANNEL_SITUATIONS 0x00000040
926
927
928 //
929 // Node creation flags
930 //
931
932 #define NXC_NCF_DISABLE_ICMP 0x0001
933 #define NXC_NCF_DISABLE_NXCP 0x0002
934 #define NXC_NCF_DISABLE_SNMP 0x0004
935 #define NXC_NCF_CREATE_UNMANAGED 0x0008
936
937
938 //
939 // Server components
940 //
941
942 #define SRV_COMPONENT_DISCOVERY_MGR 1
943
944
945 //
946 // Configuration import flags
947 //
948
949 #define CFG_IMPORT_REPLACE_EVENT_BY_CODE 0x0001
950 #define CFG_IMPORT_REPLACE_EVENT_BY_NAME 0x0002
951
952
953 //
954 // Graph access flags
955 //
956
957 #define NXGRAPH_ACCESS_READ 0x01
958 #define NXGRAPH_ACCESS_WRITE 0x02
959
960
961 //
962 // Cluster types
963 //
964
965 #define CLUSTER_TYPE_GENERIC 0
966
967
968 //
969 // SNMP trap flags
970 //
971
972 #define TRAP_VARBIND_FORCE_TEXT 0x0001
973
974 /**
975 * IP network
976 */
977 typedef struct
978 {
979 UINT32 dwAddr;
980 UINT32 dwMask;
981 } IP_NETWORK;
982
983 /**
984 * Agent's parameter information
985 */
986 typedef struct
987 {
988 TCHAR szName[MAX_PARAM_NAME];
989 TCHAR szDescription[MAX_DB_STRING];
990 int iDataType;
991 } NXC_AGENT_PARAM;
992
993 /**
994 * Server action definition structure
995 */
996 typedef struct
997 {
998 UINT32 dwId;
999 int iType;
1000 BOOL bIsDisabled;
1001 TCHAR szName[MAX_OBJECT_NAME];
1002 TCHAR szRcptAddr[MAX_RCPT_ADDR_LEN];
1003 TCHAR szEmailSubject[MAX_EMAIL_SUBJECT_LEN];
1004 TCHAR *pszData;
1005 } NXC_ACTION;
1006
1007 /**
1008 * Alarm structure
1009 */
1010 typedef struct
1011 {
1012 QWORD qwSourceEventId; // Originating event ID
1013 UINT32 dwAlarmId; // Unique alarm ID
1014 UINT32 dwCreationTime; // Alarm creation time in UNIX time format
1015 UINT32 dwLastChangeTime; // Alarm's last change time in UNIX time format
1016 UINT32 dwSourceObject; // Source object ID
1017 UINT32 dwSourceEventCode;// Originating event code
1018 BYTE nCurrentSeverity; // Alarm's current severity
1019 BYTE nOriginalSeverity; // Alarm's original severity
1020 BYTE nState; // Current state
1021 BYTE nHelpDeskState; // State of alarm in helpdesk system
1022 UINT32 dwAckByUser; // ID of user who was acknowledged this alarm (0 for system)
1023 UINT32 dwResolvedByUser; // ID of user who was resolved this alarm (0 for system)
1024 UINT32 dwTermByUser; // ID of user who was terminated this alarm (0 for system)
1025 UINT32 dwRepeatCount;
1026 UINT32 dwTimeout;
1027 UINT32 dwTimeoutEvent;
1028 TCHAR szMessage[MAX_EVENT_MSG_LENGTH];
1029 TCHAR szKey[MAX_DB_STRING];
1030 TCHAR szHelpDeskRef[MAX_HELPDESK_REF_LEN];
1031 void *pUserData; // Can be freely used by client application
1032 UINT32 noteCount; // Number of notes added to alarm
1033 UINT32 ackTimeout; // Sticky acknowledgment end time. If acknowladgmant without timeout put 0
1034 } NXC_ALARM;
1035
1036 /**
1037 * Trap parameter mapping entry
1038 */
1039 typedef struct
1040 {
1041 UINT32 *pdwObjectId; // Trap OID
1042 UINT32 dwOidLen; // Trap OID length (if highest bit is set, then it's a position)
1043 UINT32 dwFlags;
1044 TCHAR szDescription[MAX_DB_STRING];
1045 } NXC_OID_MAP;
1046
1047 /**
1048 * Trap configuration entry
1049 */
1050 typedef struct
1051 {
1052 UINT32 dwId; // Entry ID
1053 UINT32 *pdwObjectId; // Trap OID
1054 UINT32 dwOidLen; // Trap OID length
1055 UINT32 dwEventCode; // Event code
1056 UINT32 dwNumMaps; // Number of parameter mappings
1057 NXC_OID_MAP *pMaps;
1058 TCHAR szDescription[MAX_DB_STRING];
1059 TCHAR szUserTag[MAX_USERTAG_LENGTH];
1060 } NXC_TRAP_CFG_ENTRY;
1061
1062 /**
1063 * Condition's input DCI definition
1064 */
1065 typedef struct
1066 {
1067 UINT32 id;
1068 UINT32 nodeId;
1069 int function; // Average, last, diff
1070 int polls; // Number of polls used for average
1071 } INPUT_DCI;
1072
1073 /**
1074 * Cluster resource
1075 */
1076 typedef struct
1077 {
1078 UINT32 dwId;
1079 TCHAR szName[MAX_DB_STRING];
1080 UINT32 dwIpAddr;
1081 UINT32 dwCurrOwner;
1082 } CLUSTER_RESOURCE;
1083
1084
1085 /********************************************************************
1086 * Following part of this file shouldn't be included by server code *
1087 ********************************************************************/
1088
1089 #ifndef LIBNXCL_NO_DECLARATIONS
1090
1091
1092 //
1093 // NXCConnect flags
1094 //
1095
1096 #define NXCF_DEFAULT 0
1097 #define NXCF_ENCRYPT 0x0001
1098 #define NXCF_EXACT_VERSION_MATCH 0x0002
1099 #define NXCF_USE_CERTIFICATE 0x0004
1100 #define NXCF_IGNORE_PROTOCOL_VERSION 0x0008
1101
1102
1103 //
1104 // Node dynamic flags useful for client
1105 //
1106
1107 #ifndef __NDF_FLAGS_DEFINED
1108 #define NDF_UNREACHABLE 0x0004
1109 #define NDF_AGENT_UNREACHABLE 0x0008
1110 #define NDF_SNMP_UNREACHABLE 0x0010
1111 #define NDF_CPSNMP_UNREACHABLE 0x0200
1112 #define NDF_POLLING_DISABLED 0x0800
1113 #endif
1114
1115
1116 //
1117 // Callbacks data types
1118 //
1119
1120 typedef void (* NXC_EVENT_HANDLER)(NXC_SESSION hSession, UINT32 dwEvent, UINT32 dwCode, void *pArg);
1121 typedef void (* NXC_DEBUG_CALLBACK)(TCHAR *pMsg);
1122
1123 /**
1124 * Event log record structure
1125 */
1126 typedef struct
1127 {
1128 QWORD qwEventId;
1129 UINT32 dwTimeStamp;
1130 UINT32 dwEventCode;
1131 UINT32 dwSourceId;
1132 UINT32 dwSeverity;
1133 TCHAR szMessage[MAX_EVENT_MSG_LENGTH];
1134 TCHAR szUserTag[MAX_USERTAG_LENGTH];
1135 } NXC_EVENT;
1136
1137 /**
1138 * Syslog record structure
1139 */
1140 typedef struct
1141 {
1142 QWORD qwMsgId;
1143 UINT32 dwTimeStamp;
1144 WORD wFacility;
1145 WORD wSeverity;
1146 UINT32 dwSourceObject;
1147 TCHAR szHost[MAX_SYSLOG_HOSTNAME_LEN];
1148 TCHAR szTag[MAX_SYSLOG_TAG_LEN];
1149 TCHAR *pszText;
1150 } NXC_SYSLOG_RECORD;
1151
1152 /**
1153 * Server's configuration variable
1154 */
1155 typedef struct
1156 {
1157 TCHAR szName[MAX_OBJECT_NAME];
1158 TCHAR szValue[MAX_DB_STRING];
1159 BOOL bNeedRestart;
1160 } NXC_SERVER_VARIABLE;
1161
1162 /**
1163 * Agent package information
1164 */
1165 typedef struct
1166 {
1167 UINT32 dwId;
1168 TCHAR szName[MAX_PACKAGE_NAME_LEN];
1169 TCHAR szVersion[MAX_AGENT_VERSION_LEN];
1170 TCHAR szPlatform[MAX_PLATFORM_NAME_LEN];
1171 TCHAR szFileName[MAX_DB_STRING];
1172 TCHAR szDescription[MAX_DB_STRING];
1173 } NXC_PACKAGE_INFO;
1174
1175 /**
1176 * Event configuration structure
1177 */
1178 typedef struct
1179 {
1180 UINT32 dwCode;
1181 UINT32 dwSeverity;
1182 UINT32 dwFlags;
1183 TCHAR szName[MAX_EVENT_NAME];
1184 TCHAR *pszMessage;
1185 TCHAR *pszDescription;
1186 } NXC_EVENT_TEMPLATE;
1187
1188
1189 //
1190 // Entry in object's ACL
1191 //
1192
1193 typedef struct
1194 {
1195 UINT32 dwUserId;
1196 UINT32 dwAccessRights;
1197 } NXC_ACL_ENTRY;
1198
1199
1200 //
1201 // Network object structure
1202 //
1203
1204 struct __nxc_object_iface
1205 {
1206 UINT32 dwFlags;
1207 UINT32 dwIpNetMask; // Ip netmask.
1208 UINT32 dwIfIndex; // Interface index.
1209 UINT32 dwIfType; // Interface type
1210 UINT32 dwSlot; // Slot number
1211 UINT32 dwPort; // Port number
1212 BYTE bMacAddr[MAC_ADDR_LENGTH];
1213 WORD wRequiredPollCount;
1214 BYTE adminState;
1215 BYTE operState;
1216 };
1217
1218 struct __nxc_object_node
1219 {
1220 TCHAR szPrimaryName[MAX_DNS_NAME];
1221 UINT32 dwFlags;
1222 UINT32 dwRuntimeFlags;
1223 UINT32 dwNodeType;
1224 UINT32 dwPollerNode;
1225 UINT32 dwProxyNode;
1226 UINT32 dwSNMPProxy;
1227 UINT32 dwZoneId;
1228 TCHAR szSharedSecret[MAX_SECRET_LENGTH];
1229 TCHAR *pszAuthName; // SNMP authentication name
1230 TCHAR *pszAuthPassword; // SNMP v3 USM auth password
1231 TCHAR *pszPrivPassword; // SNMP v3 USM privacy password
1232 TCHAR *pszSnmpObjectId;
1233 WORD wSnmpAuthMethod;
1234 WORD wSnmpPrivMethod;
1235 WORD wSnmpPort;
1236 WORD wAgentPort; // Listening TCP port for native agent
1237 WORD wAuthMethod; // Native agent's authentication method
1238 TCHAR szAgentVersion[MAX_AGENT_VERSION_LEN];
1239 TCHAR szPlatformName[MAX_PLATFORM_NAME_LEN];
1240 BYTE nUseIfXTable;
1241 BYTE nSNMPVersion;
1242 WORD wRequiredPollCount;
1243 TCHAR szSysDescription[MAX_DB_STRING];
1244 BYTE bridgeBaseAddress[MAC_ADDR_LENGTH];
1245 };
1246
1247 struct __nxc_object_subnet
1248 {
1249 UINT32 dwIpNetMask;
1250 UINT32 dwZoneId;
1251 };
1252
1253 struct __nxc_object_container
1254 {
1255 UINT32 dwCategory;
1256 UINT32 dwFlags;
1257 TCHAR *pszAutoBindFilter;
1258 };
1259
1260 struct __nxc_object_dct
1261 {
1262 UINT32 dwVersion;
1263 UINT32 dwFlags;
1264 TCHAR *pszAutoApplyFilter;
1265 };
1266
1267 struct __nxc_object_netsrv
1268 {
1269 int iServiceType;
1270 WORD wProto;
1271 WORD wPort;
1272 UINT32 dwPollerNode;
1273 TCHAR *pszRequest;
1274 TCHAR *pszResponse;
1275 WORD wRequiredPollCount;
1276 };
1277
1278 struct __nxc_object_zone
1279 {
1280 UINT32 dwZoneId;
1281 UINT32 dwAgentProxy;
1282 UINT32 dwSnmpProxy;
1283 UINT32 dwIcmpProxy;
1284 };
1285
1286 struct __nxc_object_vpnc
1287 {
1288 UINT32 dwPeerGateway;
1289 UINT32 dwNumLocalNets;
1290 UINT32 dwNumRemoteNets;
1291 IP_NETWORK *pLocalNetList;
1292 IP_NETWORK *pRemoteNetList;
1293 };
1294
1295 struct __nxc_object_cond
1296 {
1297 TCHAR *pszScript;
1298 UINT32 dwActivationEvent;
1299 UINT32 dwDeactivationEvent;
1300 UINT32 dwSourceObject;
1301 WORD wActiveStatus;
1302 WORD wInactiveStatus;
1303 UINT32 dwNumDCI;
1304 INPUT_DCI *pDCIList;
1305 };
1306
1307 struct __nxc_object_cluster
1308 {
1309 UINT32 dwZoneId;
1310 UINT32 dwClusterType;
1311 UINT32 dwNumSyncNets;
1312 IP_NETWORK *pSyncNetList;
1313 UINT32 dwNumResources;
1314 CLUSTER_RESOURCE *pResourceList;
1315 };
1316
1317 struct __nxc_geolocation
1318 {
1319 int type;
1320 double latitude;
1321 double longitude;
1322 };
1323
1324 typedef struct
1325 {
1326 UINT32 dwId; // Unique object's identifier
1327 int iClass; // Object's class
1328 int iStatus; // Object's status
1329 UINT32 dwIpAddr; // IP address
1330 TCHAR szName[MAX_OBJECT_NAME];
1331 UINT32 dwNumParents;
1332 UINT32 *pdwParentList;
1333 UINT32 dwNumChilds;
1334 UINT32 *pdwChildList;
1335 BOOL bIsDeleted; // TRUE for deleted objects
1336 BOOL bInheritRights;
1337 UINT32 dwAclSize;
1338 NXC_ACL_ENTRY *pAccessList;
1339 int iStatusCalcAlg; // Status calculation algorithm
1340 int iStatusPropAlg; // Status propagation alhorithm
1341 int iFixedStatus; // Status to be propagated if alg = SA_PROPAGATE_FIXED
1342 int iStatusShift; // Status shift for SA_PROPAGATE_RELATIVE
1343 int iStatusTrans[4];
1344 int iStatusSingleTh;
1345 int iStatusThresholds[4];
1346 TCHAR *pszComments;
1347 UINT32 dwNumTrustedNodes;
1348 UINT32 *pdwTrustedNodes;
1349 struct __nxc_geolocation geolocation;
1350 #ifdef __cplusplus
1351 StringMap *pCustomAttrs;
1352 #else
1353 void *pCustomAttrs;
1354 #endif
1355 union
1356 {
1357 struct __nxc_object_iface iface;
1358 struct __nxc_object_node node;
1359 struct __nxc_object_subnet subnet;
1360 struct __nxc_object_container container;
1361 struct __nxc_object_dct dct;
1362 struct __nxc_object_netsrv netsrv;
1363 struct __nxc_object_zone zone;
1364 struct __nxc_object_vpnc vpnc; // VPN connector
1365 struct __nxc_object_cond cond; // Condition
1366 struct __nxc_object_cluster cluster;
1367 };
1368 } NXC_OBJECT;
1369
1370
1371 //
1372 // Structure with data for NXCModifyObject
1373 //
1374
1375 typedef struct
1376 {
1377 QWORD qwFlags;
1378 UINT32 dwObjectId;
1379 const TCHAR *pszName;
1380 const TCHAR *pszPrimaryName;
1381 int iAgentPort;
1382 int iAuthType;
1383 const TCHAR *pszSecret;
1384 const TCHAR *pszAuthName;
1385 const TCHAR *pszAuthPassword;
1386 const TCHAR *pszPrivPassword;
1387 WORD wSnmpAuthMethod;
1388 WORD wSnmpPrivMethod;
1389 BOOL bInheritRights;
1390 UINT32 dwAclSize;
1391 NXC_ACL_ENTRY *pAccessList;
1392 WORD wSNMPVersion;
1393 int iServiceType;
1394 WORD wProto;
1395 WORD wPort;
1396 WORD wSnmpPort;
1397 UINT32 dwPollerNode;
1398 const TCHAR *pszRequest;
1399 const TCHAR *pszResponse;
1400 UINT32 dwIpAddr;
1401 UINT32 dwPeerGateway;
1402 UINT32 dwNumLocalNets;
1403 UINT32 dwNumRemoteNets;
1404 IP_NETWORK *pLocalNetList;
1405 IP_NETWORK *pRemoteNetList;
1406 int iStatusCalcAlg; // Status calculation algorithm
1407 int iStatusPropAlg; // Status propagation alhorithm
1408 int iFixedStatus; // Status to be propagated if alg = SA_PROPAGATE_FIXED
1409 int iStatusShift; // Status shift for SA_PROPAGATE_RELATIVE
1410 int iStatusTrans[4];
1411 int iStatusSingleTh;
1412 int iStatusThresholds[4];
1413 UINT32 dwProxyNode;
1414 UINT32 dwSNMPProxy;
1415 UINT32 dwObjectFlags;
1416 UINT32 dwActivationEvent;
1417 UINT32 dwDeactivationEvent;
1418 UINT32 dwSourceObject;
1419 int nActiveStatus;
1420 int nInactiveStatus;
1421 UINT32 dwNumDCI;
1422 INPUT_DCI *pDCIList;
1423 const TCHAR *pszScript;
1424 UINT32 dwClusterType;
1425 UINT32 dwNumSyncNets;
1426 IP_NETWORK *pSyncNetList;
1427 UINT32 dwNumResources;
1428 CLUSTER_RESOURCE *pResourceList;
1429 WORD wRequiredPollCount;
1430 UINT32 dwNumTrustedNodes;
1431 UINT32 *pdwTrustedNodes;
1432 int nUseIfXTable;
1433 const TCHAR *pszAutoBindFilter;
1434 struct __nxc_geolocation geolocation;
1435 #ifdef __cplusplus
1436 StringMap *pCustomAttrs;
1437 #else
1438 void *pCustomAttrs;
1439 #endif
1440 } NXC_OBJECT_UPDATE;
1441
1442
1443 //
1444 // NetXMS user information structure
1445 //
1446
1447 typedef struct
1448 {
1449 TCHAR szName[MAX_USER_NAME];
1450 uuid_t guid;
1451 UINT32 dwId;
1452 UINT64 dwSystemRights;
1453 WORD wFlags;
1454 WORD nAuthMethod; // Only for users
1455 UINT32 dwNumMembers; // Only for groups
1456 UINT32 *pdwMemberList; // Only for groups
1457 TCHAR szFullName[MAX_USER_FULLNAME]; // Only for users
1458 TCHAR szDescription[MAX_USER_DESCR];
1459 int nCertMappingMethod; // Only for users
1460 TCHAR *pszCertMappingData; // Only for users
1461 } NXC_USER;
1462
1463 /**
1464 * Data collection item threshold structure
1465 */
1466 typedef struct
1467 {
1468 UINT32 id;
1469 UINT32 activationEvent;
1470 UINT32 rearmEvent;
1471 WORD function;
1472 WORD operation;
1473 UINT32 sampleCount;
1474 TCHAR *script;
1475 LONG repeatInterval;
1476 TCHAR value[MAX_STRING_VALUE];
1477 } NXC_DCI_THRESHOLD;
1478
1479 /**
1480 * Data collection item structure
1481 */
1482 typedef struct
1483 {
1484 UINT32 dwId;
1485 UINT32 dwTemplateId;
1486 UINT32 dwResourceId;
1487 TCHAR szName[MAX_ITEM_NAME];
1488 TCHAR szDescription[MAX_DB_STRING];
1489 TCHAR szInstance[MAX_DB_STRING];
1490 TCHAR szSystemTag[MAX_DB_STRING];
1491 int iPollingInterval;
1492 int iRetentionTime;
1493 BYTE iSource;
1494 BYTE iDataType;
1495 BYTE iStatus;
1496 BYTE iDeltaCalculation;
1497 WORD wFlags;
1498 UINT32 dwNumThresholds;
1499 NXC_DCI_THRESHOLD *pThresholdList;
1500 TCHAR *pszFormula;
1501 UINT32 dwNumSchedules;
1502 TCHAR **ppScheduleList;
1503 UINT32 dwProxyNode;
1504 int nBaseUnits;
1505 int nMultiplier;
1506 TCHAR *pszCustomUnitName;
1507 TCHAR *pszPerfTabSettings;
1508 WORD nSnmpPort;
1509 WORD wSnmpRawType;
1510 } NXC_DCI;
1511
1512
1513 //
1514 // Node's data collection list information
1515 //
1516
1517 typedef struct
1518 {
1519 UINT32 dwNodeId;
1520 UINT32 dwNumItems;
1521 NXC_DCI *pItems;
1522 } NXC_DCI_LIST;
1523
1524
1525 //
1526 // Row structure
1527 //
1528
1529 #pragma pack(1)
1530
1531 typedef struct
1532 {
1533 UINT32 dwTimeStamp;
1534 union
1535 {
1536 UINT32 dwInt32;
1537 TCHAR szString[MAX_STRING_VALUE];
1538 struct
1539 {
1540 INT32 padding;
1541 union
1542 {
1543 INT64 qwInt64;
1544 double dFloat;
1545 } v64;
1546 } ext;
1547 } value;
1548 } NXC_DCI_ROW;
1549
1550 #pragma pack()
1551
1552
1553 //
1554 // DCI's collected data
1555 //
1556
1557 typedef struct
1558 {
1559 UINT32 dwNodeId; // Owner's node id
1560 UINT32 dwItemId; // Item id
1561 UINT32 dwNumRows; // Number of rows in set
1562 WORD wDataType; // Data type (integer, string, etc.)
1563 WORD wRowSize; // Size of single row in bytes
1564 NXC_DCI_ROW *pRows; // Array of rows
1565 } NXC_DCI_DATA;
1566
1567
1568 //
1569 // MIB file list
1570 //
1571
1572 typedef struct
1573 {
1574 UINT32 dwNumFiles;
1575 TCHAR **ppszName;
1576 BYTE **ppHash;
1577 } NXC_MIB_LIST;
1578
1579
1580 //
1581 // Event processing policy rule
1582 //
1583
1584 typedef struct
1585 {
1586 UINT32 dwFlags;
1587 UINT32 dwId;
1588 UINT32 dwNumActions;
1589 UINT32 dwNumEvents;
1590 UINT32 dwNumSources;
1591 UINT32 *pdwActionList;
1592 UINT32 *pdwEventList;
1593 UINT32 *pdwSourceList;
1594 TCHAR *pszComment;
1595 TCHAR *pszScript;
1596 TCHAR szAlarmKey[MAX_DB_STRING];
1597 TCHAR szAlarmMessage[MAX_DB_STRING];
1598 WORD wAlarmSeverity;
1599 UINT32 dwAlarmTimeout;
1600 UINT32 dwAlarmTimeoutEvent;
1601 UINT32 dwSituationId;
1602 TCHAR szSituationInstance[MAX_DB_STRING];
1603 #ifdef __cplusplus
1604 StringMap *pSituationAttrList;
1605 #else
1606 void *pSituationAttrList;
1607 #endif
1608 } NXC_EPP_RULE;
1609
1610
1611 //
1612 // Event processing policy
1613 //
1614
1615 typedef struct
1616 {
1617 UINT32 dwNumRules;
1618 NXC_EPP_RULE *pRuleList;
1619 } NXC_EPP;
1620
1621
1622 //
1623 // Package deployment status information
1624 //
1625
1626 typedef struct
1627 {
1628 UINT32 dwNodeId;
1629 UINT32 dwStatus;
1630 TCHAR *pszErrorMessage;
1631 } NXC_DEPLOYMENT_STATUS;
1632
1633
1634 //
1635 // Object creation information structure
1636 //
1637
1638 typedef struct
1639 {
1640 int iClass;
1641 UINT32 dwParentId;
1642 TCHAR *pszName;
1643 TCHAR *pszComments;
1644 union
1645 {
1646 struct
1647 {
1648 const TCHAR *pszPrimaryName;
1649 UINT32 dwIpAddr;
1650 UINT32 dwNetMask;
1651 UINT32 dwCreationFlags;
1652 UINT32 dwProxyNode;
1653 UINT32 dwSNMPProxy;
1654 } node;
1655 struct
1656 {
1657 UINT32 dwCategory;
1658 } container;
1659 struct
1660 {
1661 int iServiceType;
1662 WORD wProto;
1663 WORD wPort;
1664 TCHAR *pszRequest;
1665 TCHAR *pszResponse;
1666 bool createStatusDci;
1667 } netsrv;
1668 } cs;
1669 } NXC_OBJECT_CREATE_INFO;
1670
1671
1672 //
1673 // Container category
1674 //
1675
1676 typedef struct
1677 {
1678 UINT32 dwId;
1679 TCHAR szName[MAX_OBJECT_NAME];
1680 TCHAR *pszDescription;
1681 } NXC_CONTAINER_CATEGORY;
1682
1683
1684 //
1685 // Container categories list
1686 //
1687
1688 typedef struct
1689 {
1690 UINT32 dwNumElements;
1691 NXC_CONTAINER_CATEGORY *pElements;
1692 } NXC_CC_LIST;
1693
1694
1695 //
1696 // DCI information and last value for NXCGetLastValues()
1697 //
1698
1699 typedef struct
1700 {
1701 UINT32 dwId;
1702 UINT32 dwTimestamp;
1703 TCHAR szName[MAX_ITEM_NAME];
1704 TCHAR szDescription[MAX_DB_STRING];
1705 TCHAR szValue[MAX_DB_STRING];
1706 BYTE nDataType;
1707 BYTE nSource;
1708 BYTE nStatus;
1709 } NXC_DCI_VALUE;
1710
1711
1712 //
1713 // Object tool
1714 //
1715
1716 typedef struct
1717 {
1718 UINT32 dwId;
1719 UINT32 dwFlags;
1720 WORD wType;
1721 TCHAR szName[MAX_DB_STRING];
1722 TCHAR szDescription[MAX_DB_STRING];
1723 TCHAR *pszMatchingOID;
1724 TCHAR *pszData;
1725 TCHAR *pszConfirmationText;
1726 } NXC_OBJECT_TOOL;
1727
1728
1729 //
1730 // Object tool column information
1731 //
1732
1733 typedef struct
1734 {
1735 TCHAR szName[MAX_DB_STRING];
1736 TCHAR szOID[MAX_DB_STRING];
1737 int nFormat;
1738 int nSubstr;
1739 } NXC_OBJECT_TOOL_COLUMN;
1740
1741
1742 //
1743 // Object tool detailed information
1744 //
1745
1746 typedef struct
1747 {
1748 UINT32 dwId;
1749 UINT32 dwFlags;
1750 TCHAR szName[MAX_DB_STRING];
1751 TCHAR szDescription[MAX_DB_STRING];
1752 TCHAR *pszMatchingOID;
1753 TCHAR *pszData;
1754 TCHAR *pszConfirmationText;
1755 UINT32 *pdwACL;
1756 UINT32 dwACLSize;
1757 WORD wType;
1758 WORD wNumColumns;
1759 NXC_OBJECT_TOOL_COLUMN *pColList;
1760 } NXC_OBJECT_TOOL_DETAILS;
1761
1762
1763 //
1764 // Server stats
1765 //
1766
1767 typedef struct
1768 {
1769 UINT32 dwNumAlarms;
1770 UINT32 dwAlarmsBySeverity[5];
1771 UINT32 dwNumObjects;
1772 UINT32 dwNumNodes;
1773 UINT32 dwNumDCI;
1774 UINT32 dwNumClientSessions;
1775 UINT32 dwServerUptime;
1776 UINT32 dwServerProcessVMSize;
1777 UINT32 dwServerProcessWorkSet;
1778 TCHAR szServerVersion[MAX_DB_STRING];
1779 UINT32 dwQSizeConditionPoller;
1780 UINT32 dwQSizeConfPoller;
1781 UINT32 dwQSizeDCIPoller;
1782 UINT32 dwQSizeDBWriter;
1783 UINT32 dwQSizeEvents;
1784 UINT32 dwQSizeDiscovery;
1785 UINT32 dwQSizeNodePoller;
1786 UINT32 dwQSizeRoutePoller;
1787 UINT32 dwQSizeStatusPoller;
1788 } NXC_SERVER_STATS;
1789
1790
1791 //
1792 // Script info
1793 //
1794
1795 typedef struct
1796 {
1797 UINT32 dwId;
1798 TCHAR szName[MAX_DB_STRING];
1799 } NXC_SCRIPT_INFO;
1800
1801
1802 //
1803 // Client session information
1804 //
1805
1806 typedef struct
1807 {
1808 UINT32 dwSessionId;
1809 int nCipher;
1810 TCHAR szUserName[MAX_USER_NAME];
1811 TCHAR szClientApp[MAX_DB_STRING];
1812 } NXC_CLIENT_SESSION_INFO;
1813
1814
1815 //
1816 // Trap log records
1817 //
1818
1819 typedef struct
1820 {
1821 QWORD qwId;
1822 UINT32 dwTimeStamp;
1823 UINT32 dwIpAddr;
1824 UINT32 dwObjectId;
1825 TCHAR szTrapOID[MAX_DB_STRING];
1826 TCHAR *pszTrapVarbinds;
1827 } NXC_SNMP_TRAP_LOG_RECORD;
1828
1829
1830 //
1831 // Agent configuration info
1832 //
1833
1834 typedef struct
1835 {
1836 UINT32 dwId;
1837 UINT32 dwSequence;
1838 TCHAR szName[MAX_DB_STRING];
1839 } NXC_AGENT_CONFIG_INFO;
1840
1841
1842 //
1843 // Agent configuration - all data
1844 //
1845
1846 typedef struct
1847 {
1848 UINT32 dwId;
1849 UINT32 dwSequence;
1850 TCHAR szName[MAX_DB_STRING];
1851 TCHAR *pszText;
1852 TCHAR *pszFilter;
1853 } NXC_AGENT_CONFIG;
1854
1855
1856 //
1857 // DCI push data
1858 //
1859
1860 typedef struct
1861 {
1862 UINT32 dwId; // DCI ID or 0 if name is used
1863 TCHAR *pszName;
1864 UINT32 dwNodeId; // Node ID or 0 if name is used
1865 TCHAR *pszNodeName;
1866 TCHAR *pszValue;
1867 } NXC_DCI_PUSH_DATA;
1868
1869
1870 //
1871 // Address entry for address list
1872 //
1873
1874 typedef struct
1875 {
1876 UINT32 dwAddr1;
1877 UINT32 dwAddr2;
1878 UINT32 dwType; // 0 = address/mask, 1 = address range
1879 } NXC_ADDR_ENTRY;
1880
1881
1882 //
1883 // Graph ACL element
1884 //
1885
1886 typedef struct
1887 {
1888 UINT32 dwUserId;
1889 UINT32 dwAccess;
1890 } NXC_GRAPH_ACL_ENTRY;
1891
1892
1893 //
1894 // Graph information
1895 //
1896
1897 typedef struct
1898 {
1899 UINT32 dwId;
1900 TCHAR *pszName;
1901 TCHAR *pszConfig;
1902 UINT32 dwOwner;
1903 UINT32 dwAclSize;
1904 NXC_GRAPH_ACL_ENTRY *pACL;
1905 } NXC_GRAPH;
1906
1907
1908 //
1909 // System DCI information
1910 //
1911
1912 typedef struct
1913 {
1914 UINT32 dwId;
1915 TCHAR szName[MAX_DB_STRING];
1916 int nStatus;
1917 TCHAR *pszSettings;
1918 } NXC_PERFTAB_DCI;
1919
1920
1921 //
1922 // Certificate information
1923 //
1924
1925 typedef struct
1926 {
1927 UINT32 dwId;
1928 int nType;
1929 TCHAR *pszSubject;
1930 TCHAR *pszComments;
1931 } NXC_CERT_INFO;
1932
1933
1934 //
1935 // Certificate list
1936 //
1937
1938 typedef struct
1939 {
1940 UINT32 dwNumElements;
1941 NXC_CERT_INFO *pElements;
1942 } NXC_CERT_LIST;
1943
1944
1945 //
1946 // SNMP USM credential
1947 //
1948
1949 typedef struct
1950 {
1951 TCHAR name[MAX_DB_STRING];
1952 int authMethod;
1953 int privMethod;
1954 TCHAR authPassword[MAX_DB_STRING];
1955 TCHAR privPassword[MAX_DB_STRING];
1956 } NXC_SNMP_USM_CRED;
1957
1958
1959 //
1960 // Connection point information
1961 //
1962
1963 typedef struct
1964 {
1965 UINT32 localNodeId;
1966 UINT32 localInterfaceId;
1967 BYTE localMacAddr[MAC_ADDR_LENGTH];
1968 UINT32 remoteNodeId;
1969 UINT32 remoteInterfaceId;
1970 UINT32 remoteIfIndex;
1971 } NXC_CONNECTION_POINT;
1972
1973
1974 // All situation stuff will be available only in C++
1975 #ifdef __cplusplus
1976
1977 //
1978 // Situation instance
1979 //
1980
1981 typedef struct
1982 {
1983 TCHAR *m_name;
1984 StringMap *m_attrList;
1985 } NXC_SITUATION_INSTANCE;
1986
1987
1988 //
1989 // Situation
1990 //
1991
1992 typedef struct
1993 {
1994 UINT32 m_id;
1995 TCHAR *m_name;
1996 TCHAR *m_comments;
1997 int m_instanceCount;
1998 NXC_SITUATION_INSTANCE *m_instanceList;
1999 } NXC_SITUATION;
2000
2001
2002 //
2003 // Situation list
2004 //
2005
2006 typedef struct
2007 {
2008 int m_count;
2009 NXC_SITUATION *m_situations;
2010 } NXC_SITUATION_LIST;
2011
2012 #endif /* __cplusplus */
2013
2014
2015 //
2016 // Functions
2017 //
2018
2019 #ifdef __cplusplus
2020 extern "C" {
2021 #endif
2022
2023 /** Library info/management **/
2024 UINT32 LIBNXCL_EXPORTABLE NXCGetVersion(void);
2025 const TCHAR LIBNXCL_EXPORTABLE *NXCGetErrorText(UINT32 dwError);
2026
2027 BOOL LIBNXCL_EXPORTABLE NXCInitialize(void);
2028 void LIBNXCL_EXPORTABLE NXCShutdown(void);
2029 void LIBNXCL_EXPORTABLE NXCSetDebugCallback(NXC_DEBUG_CALLBACK pFunc);
2030
2031 /** Low-level messaging **/
2032 UINT32 LIBNXCL_EXPORTABLE NXCGenerateMessageId(NXC_SESSION hSession);
2033 BOOL LIBNXCL_EXPORTABLE NXCSendMessage(NXC_SESSION hSession, CSCPMessage *msg);
2034 CSCPMessage LIBNXCL_EXPORTABLE *NXCWaitForMessage(NXC_SESSION hSession, WORD wCode, UINT32 dwRqId);
2035 UINT32 LIBNXCL_EXPORTABLE NXCWaitForRCC(NXC_SESSION hSession, UINT32 dwRqId);
2036
2037 /** Session management **/
2038 UINT32 LIBNXCL_EXPORTABLE NXCConnect(UINT32 dwFlags, const TCHAR *pszServer, const TCHAR *pszLogin,
2039 const TCHAR *pszPassword, UINT32 dwCertLen,
2040 BOOL (* pfSign)(BYTE *, UINT32, BYTE *, UINT32 *, void *),
2041 void *pSignArg, NXC_SESSION *phSession, const TCHAR *pszClientInfo,
2042 TCHAR **ppszUpgradeURL);
2043 void LIBNXCL_EXPORTABLE NXCDisconnect(NXC_SESSION hSession);
2044 void LIBNXCL_EXPORTABLE NXCStartWatchdog(NXC_SESSION hSession);
2045 void LIBNXCL_EXPORTABLE NXCSetEventHandler(NXC_SESSION hSession, NXC_EVENT_HANDLER pHandler);
2046 void LIBNXCL_EXPORTABLE NXCSetCommandTimeout(NXC_SESSION hSession, UINT32 dwTimeout);
2047 void LIBNXCL_EXPORTABLE NXCGetServerID(NXC_SESSION hSession, BYTE *pbsId);
2048 BOOL LIBNXCL_EXPORTABLE NXCIsDBConnLost(NXC_SESSION hSession);
2049 UINT32 LIBNXCL_EXPORTABLE NXCSubscribe(NXC_SESSION hSession, UINT32 dwChannels);
2050 UINT32 LIBNXCL_EXPORTABLE NXCUnsubscribe(NXC_SESSION hSession, UINT32 dwChannels);
2051 void LIBNXCL_EXPORTABLE NXCGetLastLockOwner(NXC_SESSION hSession, TCHAR *pszBuffer,
2052 int nBufSize);
2053 const TCHAR LIBNXCL_EXPORTABLE *NXCGetServerTimeZone(NXC_SESSION hSession);
2054 UINT32 LIBNXCL_EXPORTABLE NXCCheckConnection(NXC_SESSION hSession);
2055
2056 /** SMS **/
2057 UINT32 LIBNXCL_EXPORTABLE NXCSendSMS(NXC_SESSION hSession, TCHAR *phone, TCHAR *message);
2058
2059 /** Get/set client data associated with session **/
2060 void LIBNXCL_EXPORTABLE *NXCGetClientData(NXC_SESSION hSession);
2061 void LIBNXCL_EXPORTABLE NXCSetClientData(NXC_SESSION hSession, void *pData);
2062
2063 /** Objects **/
2064 UINT32 LIBNXCL_EXPORTABLE NXCSyncObjects(NXC_SESSION hSession);
2065 UINT32 LIBNXCL_EXPORTABLE NXCSyncObjectsEx(NXC_SESSION hSession, const TCHAR *pszCacheFile, BOOL bSyncComments);
2066 UINT32 LIBNXCL_EXPORTABLE NXCSyncObjectSet(NXC_SESSION hSession, UINT32 *idList, UINT32 length, bool syncComments, WORD flags);
2067 UINT32 LIBNXCL_EXPORTABLE NXCSyncSingleObject(NXC_SESSION hSession, UINT32 objectId);
2068 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectById(NXC_SESSION hSession, UINT32 dwId);
2069 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByIdNoLock(NXC_SESSION hSession, UINT32 dwId);
2070 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByName(NXC_SESSION hSession, const TCHAR *pszName, UINT32 dwCurrObject);
2071 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByComments(NXC_SESSION hSession, const TCHAR *comments, UINT32 dwCurrObject);
2072 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByIPAddress(NXC_SESSION hSession, UINT32 dwIpAddr, UINT32 dwCurrObject);
2073 void LIBNXCL_EXPORTABLE NXCEnumerateObjects(NXC_SESSION hSession, BOOL (* pHandler)(NXC_OBJECT *));
2074 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTopologyRootObject(NXC_SESSION hSession);
2075 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetServiceRootObject(NXC_SESSION hSession);
2076 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTemplateRootObject(NXC_SESSION hSession);
2077 void LIBNXCL_EXPORTABLE *NXCGetObjectIndex(NXC_SESSION hSession, UINT32 *pdwNumObjects);
2078 void LIBNXCL_EXPORTABLE NXCLockObjectIndex(NXC_SESSION hSession);
2079 void LIBNXCL_EXPORTABLE NXCUnlockObjectIndex(NXC_SESSION hSession);
2080 UINT32 LIBNXCL_EXPORTABLE NXCModifyObject(NXC_SESSION hSession, NXC_OBJECT_UPDATE *pData);
2081 UINT32 LIBNXCL_EXPORTABLE NXCSetObjectMgmtStatus(NXC_SESSION hSession, UINT32 dwObjectId, BOOL bIsManaged);
2082 UINT32 LIBNXCL_EXPORTABLE NXCCreateObject(NXC_SESSION hSession, NXC_OBJECT_CREATE_INFO *pCreateInfo, UINT32 *pdwObjectId);
2083 UINT32 LIBNXCL_EXPORTABLE NXCBindObject(NXC_SESSION hSession, UINT32 dwParentObject, UINT32 dwChildObject);
2084 UINT32 LIBNXCL_EXPORTABLE NXCUnbindObject(NXC_SESSION hSession, UINT32 dwParentObject, UINT32 dwChildObject);
2085 UINT32 LIBNXCL_EXPORTABLE NXCAddClusterNode(NXC_SESSION hSession, UINT32 clusterId, UINT32 nodeId);
2086 UINT32 LIBNXCL_EXPORTABLE NXCRemoveTemplate(NXC_SESSION hSession, UINT32 dwTemplateId,
2087 UINT32 dwNodeId, BOOL bRemoveDCI);
2088 UINT32 LIBNXCL_EXPORTABLE NXCDeleteObject(NXC_SESSION hSession, UINT32 dwObject);
2089 UINT32 LIBNXCL_EXPORTABLE NXCPollNode(NXC_SESSION hSession, UINT32 dwObjectId, int iPollType,
2090 void (* pCallback)(TCHAR *, void *), void *pArg);
2091 UINT32 LIBNXCL_EXPORTABLE NXCWakeUpNode(NXC_SESSION hSession, UINT32 dwObjectId);
2092 UINT32 LIBNXCL_EXPORTABLE NXCGetSupportedParameters(NXC_SESSION hSession, UINT32 dwNodeId,
2093 UINT32 *pdwNumParams,
2094 NXC_AGENT_PARAM **ppParamList);
2095 void LIBNXCL_EXPORTABLE NXCGetComparableObjectName(NXC_SESSION hSession, UINT32 dwObjectId,
2096 TCHAR *pszName);
2097 void LIBNXCL_EXPORTABLE NXCGetComparableObjectNameEx(NXC_OBJECT *pObject, TCHAR *pszName);
2098 UINT32 LIBNXCL_EXPORTABLE NXCSaveObjectCache(NXC_SESSION hSession, const TCHAR *pszFile);
2099 UINT32 LIBNXCL_EXPORTABLE NXCGetAgentConfig(NXC_SESSION hSession, UINT32 dwNodeId,
2100 TCHAR **ppszConfig);
2101 UINT32 LIBNXCL_EXPORTABLE NXCUpdateAgentConfig(NXC_SESSION hSession, UINT32 dwNodeId,
2102 TCHAR *pszConfig, BOOL bApply);
2103 UINT32 LIBNXCL_EXPORTABLE NXCExecuteAction(NXC_SESSION hSession, UINT32 dwObjectId,
2104 TCHAR *pszAction);
2105 UINT32 LIBNXCL_EXPORTABLE NXCGetObjectComments(NXC_SESSION hSession,
2106 UINT32 dwObjectId, TCHAR **ppszText);
2107 UINT32 LIBNXCL_EXPORTABLE NXCUpdateObjectComments(NXC_SESSION hSession,
2108 UINT32 dwObjectId, TCHAR *pszText);
2109 BOOL LIBNXCL_EXPORTABLE NXCIsParent(NXC_SESSION hSession, UINT32 dwParent, UINT32 dwChild);
2110 UINT32 LIBNXCL_EXPORTABLE NXCGetDCIEventsList(NXC_SESSION hSession, UINT32 dwObjectId,
2111 UINT32 **ppdwList, UINT32 *pdwListSize);
2112 UINT32 LIBNXCL_EXPORTABLE NXCGetDCIInfo(NXC_SESSION hSession, UINT32 dwNodeId,
2113 UINT32 dwItemId, NXC_DCI *pInfo);
2114 UINT32 LIBNXCL_EXPORTABLE NXCGetDCIThresholds(NXC_SESSION hSession, UINT32 dwNodeId, UINT32 dwItemId,
2115 NXC_DCI_THRESHOLD **ppList, UINT32 *pdwSize);
2116
2117 /** Container categories **/
2118 UINT32 LIBNXCL_EXPORTABLE NXCLoadCCList(NXC_SESSION hSession, NXC_CC_LIST **ppList);
2119 void LIBNXCL_EXPORTABLE NXCDestroyCCList(NXC_CC_LIST *pList);
2120
2121 /** Events **/
2122 UINT32 LIBNXCL_EXPORTABLE NXCSyncEvents(NXC_SESSION hSession, UINT32 dwMaxRecords);
2123 UINT32 LIBNXCL_EXPORTABLE NXCLoadEventDB(NXC_SESSION hSession);
2124 UINT32 LIBNXCL_EXPORTABLE NXCModifyEventTemplate(NXC_SESSION hSession, NXC_EVENT_TEMPLATE *pArg);
2125 UINT32 LIBNXCL_EXPORTABLE NXCGenerateEventCode(NXC_SESSION hSession, UINT32 *pdwEventCode);
2126 void LIBNXCL_EXPORTABLE NXCAddEventTemplate(NXC_SESSION hSession, NXC_EVENT_TEMPLATE *pEventTemplate);
2127 void LIBNXCL_EXPORTABLE NXCDeleteEDBRecord(NXC_SESSION hSession, UINT32 dwEventCode);
2128 UINT32 LIBNXCL_EXPORTABLE NXCDeleteEventTemplate(NXC_SESSION hSession, UINT32 dwEventCode);
2129 BOOL LIBNXCL_EXPORTABLE NXCGetEventDB(NXC_SESSION hSession, NXC_EVENT_TEMPLATE ***pppTemplateList, UINT32 *pdwNumRecords);
2130 const TCHAR LIBNXCL_EXPORTABLE *NXCGetEventName(NXC_SESSION hSession, UINT32 dwId);
2131 BOOL LIBNXCL_EXPORTABLE NXCGetEventNameEx(NXC_SESSION hSession, UINT32 dwId, TCHAR *pszBuffer, UINT32 dwBufSize);
2132 int LIBNXCL_EXPORTABLE NXCGetEventSeverity(NXC_SESSION hSession, UINT32 dwId);
2133 BOOL LIBNXCL_EXPORTABLE NXCGetEventText(NXC_SESSION hSession, UINT32 dwId, TCHAR *pszBuffer, UINT32 dwBufSize);
2134 UINT32 LIBNXCL_EXPORTABLE NXCSendEvent(NXC_SESSION hSession, UINT32 dwEventCode, const TCHAR *eventName, UINT32 dwObjectId,
2135 int iNumArgs, TCHAR **pArgList, TCHAR *pszUserTag);
2136
2137 /** Syslog **/
2138 UINT32 LIBNXCL_EXPORTABLE NXCSyncSyslog(NXC_SESSION hSession, UINT32 dwMaxRecords);
2139
2140 /** User management **/
2141 UINT32 LIBNXCL_EXPORTABLE NXCLoadUserDB(NXC_SESSION hSession);
2142 NXC_USER LIBNXCL_EXPORTABLE *NXCFindUserById(NXC_SESSION hSession, UINT32 dwId);
2143 BOOL LIBNXCL_EXPORTABLE NXCGetUserDB(NXC_SESSION hSession, NXC_USER **ppUserList, UINT32 *pdwNumUsers);
2144 UINT32 LIBNXCL_EXPORTABLE NXCLockUserDB(NXC_SESSION hSession);
2145 UINT32 LIBNXCL_EXPORTABLE NXCUnlockUserDB(NXC_SESSION hSession);
2146 UINT32 LIBNXCL_EXPORTABLE NXCCreateUser(NXC_SESSION hSession, TCHAR *pszName, BOOL bIsGroup, UINT32 *pdwNewId);
2147 UINT32 LIBNXCL_EXPORTABLE NXCDeleteUser(NXC_SESSION hSession, UINT32 dwId);
2148 UINT32 LIBNXCL_EXPORTABLE NXCModifyUser(NXC_SESSION hSession, NXC_USER *pUserInfo);
2149 UINT32 LIBNXCL_EXPORTABLE NXCModifyUserEx(NXC_SESSION hSession, NXC_USER *pUserInfo, UINT32 dwFields);
2150 UINT32 LIBNXCL_EXPORTABLE NXCSetPassword(NXC_SESSION hSession, UINT32 userId, const TCHAR *newPassword, const TCHAR *oldPassword);
2151 BOOL LIBNXCL_EXPORTABLE NXCNeedPasswordChange(NXC_SESSION hSession);
2152 UINT32 LIBNXCL_EXPORTABLE NXCGetUserVariable(NXC_SESSION hSession, UINT32 dwUserId,
2153 TCHAR *pszVarName, TCHAR *pszValue, UINT32 dwSize);
2154 UINT32 LIBNXCL_EXPORTABLE NXCSetUserVariable(NXC_SESSION hSession, UINT32 dwUserId,
2155 TCHAR *pszVarName, TCHAR *pszValue);
2156 UINT32 LIBNXCL_EXPORTABLE NXCCopyUserVariable(NXC_SESSION hSession, UINT32 dwSrcUserId,
2157 UINT32 dwDstUserId, TCHAR *pszVarName,
2158 BOOL bMove);
2159 UINT32 LIBNXCL_EXPORTABLE NXCEnumUserVariables(NXC_SESSION hSession, UINT32 dwUserId,
2160 TCHAR *pszPattern, UINT32 *pdwNumVars,
2161 TCHAR ***pppszVarList);
2162 UINT32 LIBNXCL_EXPORTABLE NXCDeleteUserVariable(NXC_SESSION hSession, UINT32 dwUserId,
2163 TCHAR *pszVarName);
2164 UINT32 LIBNXCL_EXPORTABLE NXCGetSessionList(NXC_SESSION hSession, UINT32 *pdwNumSessions,
2165 NXC_CLIENT_SESSION_INFO **ppList);
2166 UINT32 LIBNXCL_EXPORTABLE NXCKillSession(NXC_SESSION hSession, UINT32 dwSessionId);
2167 UINT32 LIBNXCL_EXPORTABLE NXCGetCurrentUserId(NXC_SESSION hSession);
2168 UINT32 LIBNXCL_EXPORTABLE NXCGetCurrentSystemAccess(NXC_SESSION hSession);
2169
2170 /** Data collection **/
2171 UINT32 LIBNXCL_EXPORTABLE NXCOpenNodeDCIList(NXC_SESSION hSession, UINT32 dwNodeId, NXC_DCI_LIST **ppItemList);
2172 UINT32 LIBNXCL_EXPORTABLE NXCCloseNodeDCIList(NXC_SESSION hSession, NXC_DCI_LIST *pItemList);
2173 UINT32 LIBNXCL_EXPORTABLE NXCCreateNewDCI(NXC_SESSION hSession, NXC_DCI_LIST *pItemList, UINT32 *pdwItemId);
2174 UINT32 LIBNXCL_EXPORTABLE NXCUpdateDCI(NXC_SESSION hSession, UINT32 dwNodeId, NXC_DCI *pItem);
2175 UINT32 LIBNXCL_EXPORTABLE NXCDeleteDCI(NXC_SESSION hSession, NXC_DCI_LIST *pItemList, UINT32 dwItemId);
2176 UINT32 LIBNXCL_EXPORTABLE NXCSetDCIStatus(NXC_SESSION hSession, UINT32 dwNodeId, UINT32 dwNumItems,
2177 UINT32 *pdwItemList, int iStatus);
2178 UINT32 LIBNXCL_EXPORTABLE NXCCopyDCI(NXC_SESSION hSession, UINT32 dwSrcNodeId, UINT32 dwDstNodeId,
2179 UINT32 dwNumItems, UINT32 *pdwItemList, BOOL bMove);
2180 UINT32 LIBNXCL_EXPORTABLE NXCApplyTemplate(NXC_SESSION hSession, UINT32 dwTemplateId, UINT32 dwNodeId);
2181 UINT32 LIBNXCL_EXPORTABLE NXCItemIndex(NXC_DCI_LIST *pItemList, UINT32 dwItemId);
2182 UINT32 LIBNXCL_EXPORTABLE NXCGetDCIData(NXC_SESSION hSession, UINT32 dwNodeId, UINT32 dwItemId, UINT32 dwMaxRows,
2183 UINT32 dwTimeFrom, UINT32 dwTimeTo, NXC_DCI_DATA **ppData);
2184 UINT32 LIBNXCL_EXPORTABLE NXCGetDCIDataEx(NXC_SESSION hSession, UINT32 dwNodeId, UINT32 dwItemId,
2185 UINT32 dwMaxRows, UINT32 dwTimeFrom, UINT32 dwTimeTo,
2186 NXC_DCI_DATA **ppData, NXC_DCI_THRESHOLD **thresholds, UINT32 *numThresholds);
2187 void LIBNXCL_EXPORTABLE NXCDestroyDCIData(NXC_DCI_DATA *pData);
2188 NXC_DCI_ROW LIBNXCL_EXPORTABLE *NXCGetRowPtr(NXC_DCI_DATA *pData, UINT32 dwRow);
2189 UINT32 LIBNXCL_EXPORTABLE NXCGetLastValues(NXC_SESSION hSession, UINT32 dwNodeId,
2190 UINT32 *pdwNumItems, NXC_DCI_VALUE **ppValueList);
2191 UINT32 LIBNXCL_EXPORTABLE NXCClearDCIData(NXC_SESSION hSession, UINT32 dwNodeId, UINT32 dwItemId);
2192 UINT32 LIBNXCL_EXPORTABLE NXCAddThresholdToItem(NXC_DCI *pItem, NXC_DCI_THRESHOLD *pThreshold);
2193 BOOL LIBNXCL_EXPORTABLE NXCDeleteThresholdFromItem(NXC_DCI *pItem, UINT32 dwIndex);
2194 BOOL LIBNXCL_EXPORTABLE NXCSwapThresholds(NXC_DCI *pItem, UINT32 dwIndex1, UINT32 dwIndex2);
2195 UINT32 LIBNXCL_EXPORTABLE NXCQueryParameter(NXC_SESSION hSession, UINT32 dwNodeId, int iOrigin, TCHAR *pszParameter,
2196 TCHAR *pszBuffer, UINT32 dwBufferSize);
2197 UINT32 LIBNXCL_EXPORTABLE NXCResolveDCINames(NXC_SESSION hSession, UINT32 dwNumDCI,
2198 INPUT_DCI *pDCIList, TCHAR ***pppszNames);
2199 UINT32 LIBNXCL_EXPORTABLE NXCGetPerfTabDCIList(NXC_SESSION hSession, UINT32 dwNodeId,
2200 UINT32 *pdwNumItems, NXC_PERFTAB_DCI **ppList);
2201 UINT32 LIBNXCL_EXPORTABLE NXCPushDCIData(NXC_SESSION hSession, UINT32 dwNumItems,
2202 NXC_DCI_PUSH_DATA *pItems, UINT32 *pdwIndex);
2203 UINT32 LIBNXCL_EXPORTABLE NXCTestDCITransformation(NXC_SESSION hSession, UINT32 dwNodeId, UINT32 dwItemId,
2204 const TCHAR *script, const TCHAR *value, BOOL *execStatus,
2205 TCHAR *execResult, size_t resultBufSize);
2206
2207 /** MIB files **/
2208 UINT32 LIBNXCL_EXPORTABLE NXCGetMIBFileTimeStamp(NXC_SESSION hSession, UINT32 *pdwTimeStamp);
2209 UINT32 LIBNXCL_EXPORTABLE NXCDownloadMIBFile(NXC_SESSION hSession, const TCHAR *pszName);
2210
2211 /** Event processing policy **/
2212 NXC_EPP LIBNXCL_EXPORTABLE *NXCCreateEmptyEventPolicy();
2213 UINT32 LIBNXCL_EXPORTABLE NXCOpenEventPolicy(NXC_SESSION hSession, NXC_EPP **ppEventPolicy);
2214 UINT32 LIBNXCL_EXPORTABLE NXCCloseEventPolicy(NXC_SESSION hSession);
2215 UINT32 LIBNXCL_EXPORTABLE NXCSaveEventPolicy(NXC_SESSION hSession, NXC_EPP *pEventPolicy);
2216 void LIBNXCL_EXPORTABLE NXCDestroyEventPolicy(NXC_EPP *pEventPolicy);
2217 void LIBNXCL_EXPORTABLE NXCAddPolicyRule(NXC_EPP *policy, NXC_EPP_RULE *rule, BOOL dynAllocated);
2218 void LIBNXCL_EXPORTABLE NXCDeletePolicyRule(NXC_EPP *pEventPolicy, UINT32 dwRule);
2219 NXC_EPP_RULE LIBNXCL_EXPORTABLE *NXCCopyEventPolicyRule(NXC_EPP_RULE *src);
2220 void LIBNXCL_EXPORTABLE NXCCopyEventPolicyRuleToBuffer(NXC_EPP_RULE *dst, NXC_EPP_RULE *src);
2221
2222 /** Alarms **/
2223 UINT32 LIBNXCL_EXPORTABLE NXCLoadAllAlarms(NXC_SESSION hSession, UINT32 *pdwNumAlarms, NXC_ALARM **ppAlarmList);
2224 UINT32 LIBNXCL_EXPORTABLE NXCAcknowledgeAlarm(NXC_SESSION hSession, UINT32 alarmId);
2225 UINT32 LIBNXCL_EXPORTABLE NXCAcknowledgeAlarmEx(NXC_SESSION hSession, UINT32 alarmId, bool sticky, UINT32 timeout);
2226 UINT32 LIBNXCL_EXPORTABLE NXCTerminateAlarm(NXC_SESSION hSession, UINT32 dwAlarmId);
2227 UINT32 LIBNXCL_EXPORTABLE NXCDeleteAlarm(NXC_SESSION hSession, UINT32 dwAlarmId);
2228 UINT32 LIBNXCL_EXPORTABLE NXCOpenHelpdeskIssue(NXC_SESSION hSession, UINT32 dwAlarmId, TCHAR *pszHelpdeskRef);
2229 TCHAR LIBNXCL_EXPORTABLE *NXCFormatAlarmText(NXC_SESSION session, NXC_ALARM *alarm, TCHAR *format);
2230
2231 /** Actions **/
2232 UINT32 LIBNXCL_EXPORTABLE NXCLoadActions(NXC_SESSION hSession, UINT32 *pdwNumActions, NXC_ACTION **ppActionList);
2233 UINT32 LIBNXCL_EXPORTABLE NXCCreateAction(NXC_SESSION hSession, TCHAR *pszName, UINT32 *pdwNewId);
2234 UINT32 LIBNXCL_EXPORTABLE NXCModifyAction(NXC_SESSION hSession, NXC_ACTION *pAction);
2235 UINT32 LIBNXCL_EXPORTABLE NXCDeleteAction(NXC_SESSION hSession, UINT32 dwActionId);
2236
2237 /** SNMP trap configuration **/
2238 UINT32 LIBNXCL_EXPORTABLE NXCLoadTrapCfg(NXC_SESSION hSession, UINT32 *pdwNumTraps, NXC_TRAP_CFG_ENTRY **ppTrapList);
2239 void LIBNXCL_EXPORTABLE NXCDestroyTrapList(UINT32 dwNumTraps, NXC_TRAP_CFG_ENTRY *pTrapList);
2240 UINT32 LIBNXCL_EXPORTABLE NXCCreateTrap(NXC_SESSION hSession, UINT32 *pdwTrapId);
2241 UINT32 LIBNXCL_EXPORTABLE NXCModifyTrap(NXC_SESSION hSession, NXC_TRAP_CFG_ENTRY *pTrap);
2242 UINT32 LIBNXCL_EXPORTABLE NXCDeleteTrap(NXC_SESSION hSession, UINT32 dwTrapId);
2243 UINT32 LIBNXCL_EXPORTABLE NXCSyncSNMPTrapLog(NXC_SESSION hSession, UINT32 dwMaxRecords);
2244 UINT32 LIBNXCL_EXPORTABLE NXCGetTrapCfgRO(NXC_SESSION hSession, UINT32 *pdwNumTraps,
2245 NXC_TRAP_CFG_ENTRY **ppTrapList);
2246 NXC_TRAP_CFG_ENTRY LIBNXCL_EXPORTABLE *NXCDuplicateTrapCfgEntry(NXC_TRAP_CFG_ENTRY *src);
2247 void LIBNXCL_EXPORTABLE NXCCopyTrapCfgEntry(NXC_TRAP_CFG_ENTRY *dst, NXC_TRAP_CFG_ENTRY *src);
2248 void LIBNXCL_EXPORTABLE NXCDestroyTrapCfgEntry(NXC_TRAP_CFG_ENTRY *e);
2249
2250 /** Packages **/
2251 UINT32 LIBNXCL_EXPORTABLE NXCLockPackageDB(NXC_SESSION hSession);
2252 UINT32 LIBNXCL_EXPORTABLE NXCUnlockPackageDB(NXC_SESSION hSession);
2253 UINT32 LIBNXCL_EXPORTABLE NXCGetPackageList(NXC_SESSION hSession, UINT32 *pdwNumPackages,
2254 NXC_PACKAGE_INFO **ppList);
2255 UINT32 LIBNXCL_EXPORTABLE NXCInstallPackage(NXC_SESSION hSession, NXC_PACKAGE_INFO *pInfo,
2256 TCHAR *pszFullPkgPath);
2257 UINT32 LIBNXCL_EXPORTABLE NXCRemovePackage(NXC_SESSION hSession, UINT32 dwPkgId);
2258 UINT32 LIBNXCL_EXPORTABLE NXCParseNPIFile(TCHAR *pszInfoFile, NXC_PACKAGE_INFO *pInfo);
2259 UINT32 LIBNXCL_EXPORTABLE NXCDeployPackage(NXC_SESSION hSession, UINT32 dwPkgId,
2260 UINT32 dwNumObjects, UINT32 *pdwObjectList,
2261 UINT32 *pdwRqId);
2262
2263 /** Server management **/
2264 UINT32 LIBNXCL_EXPORTABLE NXCResetServerComponent(NXC_SESSION hSession, UINT32 dwComponent);
2265 UINT32 LIBNXCL_EXPORTABLE NXCGetServerStats(NXC_SESSION hSession, NXC_SERVER_STATS *pStats);
2266 UINT32 LIBNXCL_EXPORTABLE NXCGetServerVariables(NXC_SESSION hSession,
2267 NXC_SERVER_VARIABLE **ppVarList,
2268 UINT32 *pdwNumVars);
2269 UINT32 LIBNXCL_EXPORTABLE NXCSetServerVariable(NXC_SESSION hSession, const TCHAR *pszVarName,
2270 const TCHAR *pszValue);
2271 UINT32 LIBNXCL_EXPORTABLE NXCDeleteServerVariable(NXC_SESSION hSession, const TCHAR *pszVarName);
2272 UINT32 LIBNXCL_EXPORTABLE NXCGetServerConfigCLOB(NXC_SESSION hSession, const TCHAR *name, TCHAR **value);
2273 UINT32 LIBNXCL_EXPORTABLE NXCSetServerConfigCLOB(NXC_SESSION hSession, const TCHAR *name, const TCHAR *value);
2274
2275 /** Object tools **/
2276 UINT32 LIBNXCL_EXPORTABLE NXCGetObjectTools(NXC_SESSION hSession, UINT32 *pdwNumTools,
2277 NXC_OBJECT_TOOL **ppToolList);
2278 void LIBNXCL_EXPORTABLE NXCDestroyObjectToolList(UINT32 dwNumTools, NXC_OBJECT_TOOL *pList);
2279 #ifdef __cplusplus
2280 UINT32 LIBNXCL_EXPORTABLE NXCExecuteTableTool(NXC_SESSION hSession, UINT32 dwNodeId,
2281 UINT32 dwToolId, Table **ppData);
2282 #endif
2283 UINT32 LIBNXCL_EXPORTABLE NXCGetObjectToolDetails(NXC_SESSION hSession, UINT32 dwToolId,
2284 NXC_OBJECT_TOOL_DETAILS **ppData);
2285 void LIBNXCL_EXPORTABLE NXCDestroyObjectToolDetails(NXC_OBJECT_TOOL_DETAILS *pData);
2286 UINT32 LIBNXCL_EXPORTABLE NXCDeleteObjectTool(NXC_SESSION hSession, UINT32 dwToolId);
2287 UINT32 LIBNXCL_EXPORTABLE NXCGenerateObjectToolId(NXC_SESSION hSession, UINT32 *pdwToolId);
2288 UINT32 LIBNXCL_EXPORTABLE NXCUpdateObjectTool(NXC_SESSION hSession,
2289 NXC_OBJECT_TOOL_DETAILS *pData);
2290 BOOL LIBNXCL_EXPORTABLE NXCIsAppropriateTool(NXC_OBJECT_TOOL *pTool, NXC_OBJECT *pObject);
2291 UINT32 LIBNXCL_EXPORTABLE NXCExecuteServerCommand(NXC_SESSION hSession, UINT32 nodeId, const TCHAR *command);
2292
2293 /** Script library **/
2294 UINT32 LIBNXCL_EXPORTABLE NXCGetScriptList(NXC_SESSION hSession, UINT32 *pdwNumScrpts,
2295 NXC_SCRIPT_INFO **ppList);
2296 UINT32 LIBNXCL_EXPORTABLE NXCGetScript(NXC_SESSION hSession, UINT32 dwId, TCHAR **ppszCode);
2297 UINT32 LIBNXCL_EXPORTABLE NXCUpdateScript(NXC_SESSION hSession, UINT32 *pdwId,
2298 TCHAR *pszName, TCHAR *pszCode);
2299 UINT32 LIBNXCL_EXPORTABLE NXCRenameScript(NXC_SESSION hSession, UINT32 dwId,
2300 TCHAR *pszName);
2301 UINT32 LIBNXCL_EXPORTABLE NXCDeleteScript(NXC_SESSION hSession, UINT32 dwId);
2302
2303 /** SNMP **/
2304 UINT32 LIBNXCL_EXPORTABLE NXCSnmpWalk(NXC_SESSION hSession, UINT32 dwNode,
2305 TCHAR *pszRootOID, void *pUserData,
2306 void (* pfCallback)(TCHAR *, UINT32, TCHAR *, void *));
2307 UINT32 LIBNXCL_EXPORTABLE NXCGetSnmpCommunityList(NXC_SESSION hSession, UINT32 *pdwNumStrings,
2308 TCHAR ***pppszStringList);
2309 UINT32 LIBNXCL_EXPORTABLE NXCUpdateSnmpCommunityList(NXC_SESSION hSession, UINT32 dwNumStrings,
2310 TCHAR **ppszStringList);
2311 UINT32 LIBNXCL_EXPORTABLE NXCGetSnmpUsmCredentials(NXC_SESSION hSession, UINT32 *listSize, NXC_SNMP_USM_CRED **list);
2312 UINT32 LIBNXCL_EXPORTABLE NXCUpdateSnmpUsmCredentials(NXC_SESSION hSession, UINT32 count, NXC_SNMP_USM_CRED *list);
2313
2314 /** Address lists **/
2315 UINT32 LIBNXCL_EXPORTABLE NXCGetAddrList(NXC_SESSION hSession, UINT32 dwListType,
2316 UINT32 *pdwAddrCount, NXC_ADDR_ENTRY **ppAddrList);
2317 UINT32 LIBNXCL_EXPORTABLE NXCSetAddrList(NXC_SESSION hSession, UINT32 dwListType,
2318 UINT32 dwAddrCount, NXC_ADDR_ENTRY *pAddrList);
2319
2320 /** Agent configurations **/
2321 UINT32 LIBNXCL_EXPORTABLE NXCGetAgentConfigList(NXC_SESSION hSession, UINT32 *pdwNumRecs,
2322 NXC_AGENT_CONFIG_INFO **ppList);
2323 UINT32 LIBNXCL_EXPORTABLE NXCOpenAgentConfig(NXC_SESSION hSession, UINT32 dwCfgId,
2324 NXC_AGENT_CONFIG *pConfig);
2325 UINT32 LIBNXCL_EXPORTABLE NXCSaveAgentConfig(NXC_SESSION hSession, NXC_AGENT_CONFIG *pConfig);
2326 UINT32 LIBNXCL_EXPORTABLE NXCDeleteAgentConfig(NXC_SESSION hSession, UINT32 dwCfgId);
2327 UINT32 LIBNXCL_EXPORTABLE NXCSwapAgentConfigs(NXC_SESSION hSession, UINT32 dwCfgId1, UINT32 dwCfgId2);
2328
2329 /** Server configuration export/import **/
2330 UINT32 LIBNXCL_EXPORTABLE NXCExportConfiguration(NXC_SESSION hSession, TCHAR *pszDescr,
2331 UINT32 dwNumEvents, UINT32 *pdwEventList,
2332 UINT32 dwNumTemplates, UINT32 *pdwTemplateList,
2333 UINT32 dwNumTraps, UINT32 *pdwTrapList,
2334 TCHAR **ppszContent);
2335 UINT32 LIBNXCL_EXPORTABLE NXCImportConfiguration(NXC_SESSION hSession, TCHAR *pszContent,
2336 UINT32 dwFlags, TCHAR *pszErrorText, int nErrorLen);
2337
2338 /** Predefined graphs **/
2339 UINT32 LIBNXCL_EXPORTABLE NXCGetGraphList(NXC_SESSION hSession, UINT32 *pdwNumGraphs, NXC_GRAPH **ppGraphList);
2340 void LIBNXCL_EXPORTABLE NXCDestroyGraphList(UINT32 dwNumGraphs, NXC_GRAPH *pList);
2341 UINT32 LIBNXCL_EXPORTABLE NXCDefineGraph(NXC_SESSION hSession, NXC_GRAPH *pGraph);
2342 UINT32 LIBNXCL_EXPORTABLE NXCDeleteGraph(NXC_SESSION hSession, UINT32 dwGraphId);
2343
2344 /** Certificates **/
2345 UINT32 LIBNXCL_EXPORTABLE NXCAddCACertificate(NXC_SESSION hSession, UINT32 dwCertLen,
2346 BYTE *pCert, TCHAR *pszComments);
2347 UINT32 LIBNXCL_EXPORTABLE NXCUpdateCertificateComments(NXC_SESSION hSession, UINT32 dwCertId,
2348 TCHAR *pszComments);
2349 UINT32 LIBNXCL_EXPORTABLE NXCDeleteCertificate(NXC_SESSION hSession, UINT32 dwCertId);
2350 UINT32 LIBNXCL_EXPORTABLE NXCGetCertificateList(NXC_SESSION hSession, NXC_CERT_LIST **ppList);
2351 void LIBNXCL_EXPORTABLE NXCDestroyCertificateList(NXC_CERT_LIST *pList);
2352
2353 /** Layer 2 topology **/
2354 UINT32 LIBNXCL_EXPORTABLE NXCQueryL2Topology(NXC_SESSION hSession, UINT32 dwNodeId, void **ppTopology);
2355 UINT32 LIBNXCL_EXPORTABLE NXCFindConnectionPoint(NXC_SESSION hSession, UINT32 objectId, NXC_CONNECTION_POINT *cpInfo);
2356 UINT32 LIBNXCL_EXPORTABLE NXCFindMACAddress(NXC_SESSION hSession, BYTE *macAddr, NXC_CONNECTION_POINT *cpInfo);
2357
2358 /** Situations **/
2359 UINT32 LIBNXCL_EXPORTABLE NXCCreateSituation(NXC_SESSION hSession, const TCHAR *name, const TCHAR *comments, UINT32 *pdwId);
2360 UINT32 LIBNXCL_EXPORTABLE NXCModifySituation(NXC_SESSION hSession, UINT32 id,
2361 const TCHAR *name, const TCHAR *comments);
2362 UINT32 LIBNXCL_EXPORTABLE NXCDeleteSituation(NXC_SESSION hSession, UINT32 id);
2363 UINT32 LIBNXCL_EXPORTABLE NXCDeleteSituationInstance(NXC_SESSION hSession, UINT32 id, const TCHAR *instance);
2364
2365 #ifdef __cplusplus
2366 UINT32 LIBNXCL_EXPORTABLE NXCGetSituationList(NXC_SESSION hSession, NXC_SITUATION_LIST **list);
2367 void LIBNXCL_EXPORTABLE NXCDestroySituationList(NXC_SITUATION_LIST *list);
2368 void LIBNXCL_EXPORTABLE NXCUpdateSituationList(NXC_SITUATION_LIST *list, int code, NXC_SITUATION *update);
2369 #endif
2370
2371 #ifdef __cplusplus
2372 }
2373 #endif
2374
2375 #endif /* LIBNXCL_NO_DECLARATIONS */
2376
2377 #endif /* _nxclapi_h_ */