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