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