- User's authentication method now can be configured from console
[public/netxms.git] / include / nxclapi.h
1 /*
2 ** NetXMS - Network Management System
3 ** Client Library API
4 ** Copyright (C) 2004, 2005, 2006 Victor Kirhenshtein
5 **
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 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 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 #include <nms_common.h>
28 #include <nms_util.h>
29 #include <nxevent.h>
30 #include <nximage.h>
31 #include <nxcscpapi.h>
32 #include <nxtools.h>
33 #include <nxlog.h>
34 #include <uuid.h>
35
36 #ifdef _WIN32
37 #ifdef LIBNXCL_EXPORTS
38 #define LIBNXCL_EXPORTABLE __declspec(dllexport)
39 #else
40 #define LIBNXCL_EXPORTABLE __declspec(dllimport)
41 #endif
42 #else /* _WIN32 */
43 #define LIBNXCL_EXPORTABLE
44 #endif
45
46
47 //
48 // Session handle type
49 //
50
51 typedef void * NXC_SESSION;
52
53
54 //
55 // Some constants
56 //
57
58 #define MAX_COMMUNITY_LENGTH 32
59 #define MAX_OID_LENGTH 1024
60 #define MAX_EVENT_MSG_LENGTH 256
61 #define MAX_EVENT_NAME 64
62 #define MAX_USER_NAME 64
63 #define MAX_USER_FULLNAME 128
64 #define MAX_USER_DESCR 256
65 #define MAX_ITEM_NAME 256
66 #define MAX_STRING_VALUE 256
67 #define MAX_VARIABLE_NAME 256
68 #define MAX_AGENT_VERSION_LEN 64
69 #define MAX_PLATFORM_NAME_LEN 64
70 #define MAX_PACKAGE_NAME_LEN 64
71 #define GROUP_EVERYONE ((DWORD)0x80000000)
72 #define INVALID_UID ((DWORD)0xFFFFFFFF)
73 #define OBJECT_STATUS_COUNT 9
74 #define MAX_RCPT_ADDR_LEN 256
75 #define MAX_EMAIL_SUBJECT_LEN 256
76 #define MAC_ADDR_LENGTH 6
77 #define CURRENT_USER ((DWORD)0xFFFFFFFF)
78
79
80 //
81 // Module flags
82 //
83
84 #define MODFLAG_DISABLED 0x0001
85 #define MODFLAG_ACCEPT_ALL_COMMANDS 0x0002
86
87
88 //
89 // Image formats
90 //
91
92 #define IMAGE_FORMAT_ICO 0
93 #define IMAGE_FORMAT_PNG 1
94
95
96 //
97 // Authentication methods
98 //
99
100 #define AUTH_NONE 0
101 #define AUTH_PLAINTEXT 1
102 #define AUTH_MD5_HASH 2
103 #define AUTH_SHA1_HASH 3
104
105
106 //
107 // Forced poll types
108 //
109
110 #define POLL_STATUS 1
111 #define POLL_CONFIGURATION 2
112
113
114 //
115 // Object types
116 //
117
118 #define OBJECT_GENERIC 0
119 #define OBJECT_SUBNET 1
120 #define OBJECT_NODE 2
121 #define OBJECT_INTERFACE 3
122 #define OBJECT_NETWORK 4
123 #define OBJECT_CONTAINER 5
124 #define OBJECT_ZONE 6
125 #define OBJECT_SERVICEROOT 7
126 #define OBJECT_TEMPLATE 8
127 #define OBJECT_TEMPLATEGROUP 9
128 #define OBJECT_TEMPLATEROOT 10
129 #define OBJECT_NETWORKSERVICE 11
130 #define OBJECT_VPNCONNECTOR 12
131
132
133 //
134 // Object's status
135 //
136
137 #define STATUS_NORMAL 0
138 #define STATUS_WARNING 1
139 #define STATUS_MINOR 2
140 #define STATUS_MAJOR 3
141 #define STATUS_CRITICAL 4
142 #define STATUS_UNKNOWN 5
143 #define STATUS_UNMANAGED 6
144 #define STATUS_DISABLED 7
145 #define STATUS_TESTING 8
146
147
148 //
149 // Event and alarm severity
150 //
151
152 #define SEVERITY_NORMAL 0
153 #define SEVERITY_WARNING 1
154 #define SEVERITY_MINOR 2
155 #define SEVERITY_MAJOR 3
156 #define SEVERITY_CRITICAL 4
157 #define SEVERITY_FROM_EVENT 5
158 #define SEVERITY_NONE 6
159
160
161 //
162 // Node flags
163 //
164
165 #define NF_SYSTEM_FLAGS 0x0000FFFF
166 #define NF_USER_FLAGS 0xFFFF0000
167
168 #define NF_IS_SNMP 0x00000001
169 #define NF_IS_NATIVE_AGENT 0x00000002
170 #define NF_IS_BRIDGE 0x00000004
171 #define NF_IS_ROUTER 0x00000008
172 #define NF_IS_LOCAL_MGMT 0x00000010
173 #define NF_IS_PRINTER 0x00000020
174 #define NF_IS_OSPF 0x00000040
175 #define NF_BEHIND_NAT 0x00000080
176 #define NF_IS_CPSNMP 0x00000100 /* CheckPoint SNMP agent on port 260 */
177
178 #define NF_DISABLE_SNMP 0x01000000
179 #define NF_DISABLE_NXCP 0x02000000
180 #define NF_DISABLE_ICMP 0x04000000
181
182
183 //
184 // Status calculation and propagation algorithms
185 //
186
187 #define SA_CALCULATE_DEFAULT 0
188 #define SA_CALCULATE_MOST_CRITICAL 1
189 #define SA_CALCULATE_SINGLE_THRESHOLD 2
190 #define SA_CALCULATE_MULTIPLE_THRESHOLDS 3
191
192 #define SA_PROPAGATE_DEFAULT 0
193 #define SA_PROPAGATE_UNCHANGED 1
194 #define SA_PROPAGATE_FIXED 2
195 #define SA_PROPAGATE_RELATIVE 3
196 #define SA_PROPAGATE_TRANSLATED 4
197
198
199 //
200 // Service types
201 //
202
203 enum
204 {
205 NETSRV_CUSTOM,
206 NETSRV_SSH,
207 NETSRV_POP3,
208 NETSRV_SMTP,
209 NETSRV_FTP,
210 NETSRV_HTTP,
211 NETSRV_TELNET,
212 };
213
214
215 //
216 // Events
217 //
218
219 #define NXC_EVENT_ERROR 1
220 #define NXC_EVENT_NEW_ELOG_RECORD 2
221 #define NXC_EVENT_USER_DB_CHANGED 3
222 #define NXC_EVENT_OBJECT_CHANGED 4
223 #define NXC_EVENT_NOTIFICATION 5
224 #define NXC_EVENT_DEPLOYMENT_STATUS 6
225 #define NXC_EVENT_NEW_SYSLOG_RECORD 7
226 #define NXC_EVENT_NEW_SNMP_TRAP 8
227
228
229 //
230 // Errors
231 //
232
233 #define NXC_ERR_INTERNAL 1
234
235
236 //
237 // States (used both by client library and server)
238 //
239
240 #define STATE_DISCONNECTED 0
241 #define STATE_CONNECTING 1
242 #define STATE_CONNECTED 2
243 #define STATE_AUTHENTICATED 3
244
245
246 //
247 // Notification codes
248 //
249
250 #define NX_NOTIFY_SHUTDOWN 1
251 #define NX_NOTIFY_EVENTDB_CHANGED 2
252 #define NX_NOTIFY_ALARM_DELETED 3
253 #define NX_NOTIFY_NEW_ALARM 4
254 #define NX_NOTIFY_ALARM_ACKNOWLEGED 5
255 #define NX_NOTIFY_ACTION_CREATED 6
256 #define NX_NOTIFY_ACTION_MODIFIED 7
257 #define NX_NOTIFY_ACTION_DELETED 8
258 #define NX_NOTIFY_OBJTOOLS_CHANGED 9
259
260
261 //
262 // Request completion codes
263 //
264
265 #define RCC_SUCCESS ((DWORD)0)
266 #define RCC_COMPONENT_LOCKED ((DWORD)1)
267 #define RCC_ACCESS_DENIED ((DWORD)2)
268 #define RCC_INVALID_REQUEST ((DWORD)3)
269 #define RCC_TIMEOUT ((DWORD)4)
270 #define RCC_OUT_OF_STATE_REQUEST ((DWORD)5)
271 #define RCC_DB_FAILURE ((DWORD)6)
272 #define RCC_INVALID_OBJECT_ID ((DWORD)7)
273 #define RCC_ALREADY_EXIST ((DWORD)8)
274 #define RCC_COMM_FAILURE ((DWORD)9)
275 #define RCC_SYSTEM_FAILURE ((DWORD)10)
276 #define RCC_INVALID_USER_ID ((DWORD)11)
277 #define RCC_INVALID_ARGUMENT ((DWORD)12)
278 #define RCC_DUPLICATE_DCI ((DWORD)13)
279 #define RCC_INVALID_DCI_ID ((DWORD)14)
280 #define RCC_OUT_OF_MEMORY ((DWORD)15)
281 #define RCC_IO_ERROR ((DWORD)16)
282 #define RCC_INCOMPATIBLE_OPERATION ((DWORD)17)
283 #define RCC_OBJECT_CREATION_FAILED ((DWORD)18)
284 #define RCC_OBJECT_LOOP ((DWORD)19)
285 #define RCC_INVALID_OBJECT_NAME ((DWORD)20)
286 #define RCC_INVALID_ALARM_ID ((DWORD)21)
287 #define RCC_INVALID_ACTION_ID ((DWORD)22)
288 #define RCC_OPERATION_IN_PROGRESS ((DWORD)23)
289 #define RCC_DCI_COPY_ERRORS ((DWORD)24)
290 #define RCC_INVALID_EVENT_CODE ((DWORD)25)
291 #define RCC_NO_WOL_INTERFACES ((DWORD)26)
292 #define RCC_NO_MAC_ADDRESS ((DWORD)27)
293 #define RCC_NOT_IMPLEMENTED ((DWORD)28)
294 #define RCC_INVALID_TRAP_ID ((DWORD)29)
295 #define RCC_DCI_NOT_SUPPORTED ((DWORD)30)
296 #define RCC_VERSION_MISMATCH ((DWORD)31)
297 #define RCC_NPI_PARSE_ERROR ((DWORD)32)
298 #define RCC_DUPLICATE_PACKAGE ((DWORD)33)
299 #define RCC_PACKAGE_FILE_EXIST ((DWORD)34)
300 #define RCC_RESOURCE_BUSY ((DWORD)35)
301 #define RCC_INVALID_PACKAGE_ID ((DWORD)36)
302 #define RCC_INVALID_IP_ADDR ((DWORD)37)
303 #define RCC_ACTION_IN_USE ((DWORD)38)
304 #define RCC_VARIABLE_NOT_FOUND ((DWORD)39)
305 #define RCC_BAD_PROTOCOL ((DWORD)40)
306 #define RCC_ADDRESS_IN_USE ((DWORD)41)
307 #define RCC_NO_CIPHERS ((DWORD)42)
308 #define RCC_INVALID_PUBLIC_KEY ((DWORD)43)
309 #define RCC_INVALID_SESSION_KEY ((DWORD)44)
310 #define RCC_NO_ENCRYPTION_SUPPORT ((DWORD)45)
311 #define RCC_INTERNAL_ERROR ((DWORD)46)
312 #define RCC_EXEC_FAILED ((DWORD)47)
313 #define RCC_INVALID_TOOL_ID ((DWORD)48)
314 #define RCC_SNMP_ERROR ((DWORD)49)
315 #define RCC_BAD_REGEXP ((DWORD)50)
316 #define RCC_UNKNOWN_PARAMETER ((DWORD)51)
317 #define RCC_FILE_IO_ERROR ((DWORD)52)
318 #define RCC_CORRUPTED_MIB_FILE ((DWORD)53)
319 #define RCC_TRANSFER_IN_PROGRESS ((DWORD)54)
320 #define RCC_INVALID_LPP_ID ((DWORD)55)
321 #define RCC_INVALID_SCRIPT_ID ((DWORD)56)
322 #define RCC_INVALID_SCRIPT_NAME ((DWORD)57)
323 #define RCC_UNKNOWN_MAP_NAME ((DWORD)58)
324 #define RCC_INVALID_MAP_ID ((DWORD)59)
325 #define RCC_ACCOUNT_DISABLED ((DWORD)60)
326 #define RCC_NO_GRACE_LOGINS ((DWORD)61)
327
328
329 //
330 // Mask bits for NXCModifyEventTemplate()
331 //
332
333 #define EM_SEVERITY ((DWORD)0x01)
334 #define EM_FLAGS ((DWORD)0x02)
335 #define EM_NAME ((DWORD)0x04)
336 #define EM_MESSAGE ((DWORD)0x08)
337 #define EM_DESCRIPTION ((DWORD)0x10)
338 #define EM_ALL ((DWORD)0x1F)
339
340
341 //
342 // Mask bits (flags) for NXCModifyObject()
343 //
344
345 #define OBJ_UPDATE_NAME ((DWORD)0x000001)
346 #define OBJ_UPDATE_AGENT_PORT ((DWORD)0x000002)
347 #define OBJ_UPDATE_AGENT_AUTH ((DWORD)0x000004)
348 #define OBJ_UPDATE_AGENT_SECRET ((DWORD)0x000008)
349 #define OBJ_UPDATE_SNMP_VERSION ((DWORD)0x000010)
350 #define OBJ_UPDATE_SNMP_COMMUNITY ((DWORD)0x000020)
351 #define OBJ_UPDATE_ACL ((DWORD)0x000040)
352 #define OBJ_UPDATE_IMAGE ((DWORD)0x000080)
353 #define OBJ_UPDATE_DESCRIPTION ((DWORD)0x000100)
354 #define OBJ_UPDATE_SERVICE_TYPE ((DWORD)0x000200)
355 #define OBJ_UPDATE_IP_PROTO ((DWORD)0x000400)
356 #define OBJ_UPDATE_IP_PORT ((DWORD)0x000800)
357 #define OBJ_UPDATE_CHECK_REQUEST ((DWORD)0x001000)
358 #define OBJ_UPDATE_CHECK_RESPONSE ((DWORD)0x002000)
359 #define OBJ_UPDATE_POLLER_NODE ((DWORD)0x004000)
360 #define OBJ_UPDATE_IP_ADDR ((DWORD)0x008000)
361 #define OBJ_UPDATE_PEER_GATEWAY ((DWORD)0x010000)
362 #define OBJ_UPDATE_NETWORK_LIST ((DWORD)0x020000)
363 #define OBJ_UPDATE_STATUS_ALG ((DWORD)0x040000)
364 #define OBJ_UPDATE_PROXY_NODE ((DWORD)0x080000)
365 #define OBJ_UPDATE_NODE_FLAGS ((DWORD)0x100000)
366
367 #define OBJ_UPDATE_NODE_ALL ((DWORD)0x1C41FF)
368 #define OBJ_UPDATE_NETSRV_ALL ((DWORD)0x04FEC1)
369
370
371 //
372 // Global user rights
373 //
374
375 #define SYSTEM_ACCESS_MANAGE_USERS 0x000001
376 #define SYSTEM_ACCESS_SERVER_CONFIG 0x000002
377 #define SYSTEM_ACCESS_CONFIGURE_TRAPS 0x000004
378 #define SYSTEM_ACCESS_MANAGE_SESSIONS 0x000008
379 #define SYSTEM_ACCESS_VIEW_EVENT_DB 0x000010
380 #define SYSTEM_ACCESS_EDIT_EVENT_DB 0x000020
381 #define SYSTEM_ACCESS_EPP 0x000040
382 #define SYSTEM_ACCESS_MANAGE_ACTIONS 0x000080
383 #define SYSTEM_ACCESS_DELETE_ALARMS 0x000100
384 #define SYSTEM_ACCESS_MANAGE_PACKAGES 0x000200
385 #define SYSTEM_ACCESS_MANAGE_LPP 0x000400
386 #define SYSTEM_ACCESS_MANAGE_TOOLS 0x000800
387 #define SYSTEM_ACCESS_MANAGE_SCRIPTS 0x001000
388 #define SYSTEM_ACCESS_VIEW_TRAP_LOG 0x002000
389 #define SYSTEM_ACCESS_MANAGE_MODULES 0x004000
390
391 #define SYSTEM_ACCESS_FULL 0x007FFF
392
393
394 //
395 // Object access rights
396 //
397
398 #define OBJECT_ACCESS_READ 0x00000001
399 #define OBJECT_ACCESS_MODIFY 0x00000002
400 #define OBJECT_ACCESS_CREATE 0x00000004
401 #define OBJECT_ACCESS_DELETE 0x00000008
402 #define OBJECT_ACCESS_READ_ALARMS 0x00000010
403 #define OBJECT_ACCESS_ACL 0x00000020
404 #define OBJECT_ACCESS_ACK_ALARMS 0x00000040
405 #define OBJECT_ACCESS_SEND_EVENTS 0x00000080
406 #define OBJECT_ACCESS_CONTROL 0x00000100
407
408
409 //
410 // User/group flags
411 //
412
413 #define UF_MODIFIED 0x0001
414 #define UF_DELETED 0x0002
415 #define UF_DISABLED 0x0004
416 #define UF_CHANGE_PASSWORD 0x0008
417 #define UF_CANNOT_CHANGE_PASSWORD 0x0010
418
419
420 //
421 // User database change notification types
422 //
423
424 #define USER_DB_CREATE 0
425 #define USER_DB_DELETE 1
426 #define USER_DB_MODIFY 2
427
428
429 //
430 // Data sources
431 //
432
433 #define DS_INTERNAL 0
434 #define DS_NATIVE_AGENT 1
435 #define DS_SNMP_AGENT 2
436 #define DS_CHECKPOINT_AGENT 3
437
438
439 //
440 // Item status
441 //
442
443 #define ITEM_STATUS_ACTIVE 0
444 #define ITEM_STATUS_DISABLED 1
445 #define ITEM_STATUS_NOT_SUPPORTED 2
446
447
448 //
449 // Delta calculation methods for DCIs
450 //
451
452 #define DCM_ORIGINAL_VALUE 0
453 #define DCM_SIMPLE 1
454 #define DCM_AVERAGE_PER_SECOND 2
455 #define DCM_AVERAGE_PER_MINUTE 3
456
457
458 //
459 // Threshold functions and operations
460 //
461
462 #define F_LAST 0
463 #define F_AVERAGE 1
464 #define F_DEVIATION 2
465 #define F_DIFF 3
466
467 #define OP_LE 0
468 #define OP_LE_EQ 1
469 #define OP_EQ 2
470 #define OP_GT_EQ 3
471 #define OP_GT 4
472 #define OP_NE 5
473 #define OP_LIKE 6
474 #define OP_NOTLIKE 7
475
476
477 //
478 // Event policy rule flags
479 //
480
481 #define RF_STOP_PROCESSING 0x0001
482 #define RF_NEGATED_SOURCE 0x0002
483 #define RF_NEGATED_EVENTS 0x0004
484 #define RF_GENERATE_ALARM 0x0008
485 #define RF_DISABLED 0x0010
486 #define RF_SEVERITY_INFO 0x0100
487 #define RF_SEVERITY_WARNING 0x0200
488 #define RF_SEVERITY_MINOR 0x0400
489 #define RF_SEVERITY_MAJOR 0x0800
490 #define RF_SEVERITY_CRITICAL 0x1000
491
492
493 //
494 // Action types
495 //
496
497 #define ACTION_EXEC 0
498 #define ACTION_REMOTE 1
499 #define ACTION_SEND_EMAIL 2
500 #define ACTION_SEND_SMS 3
501
502
503 //
504 // Deployment manager status codes
505 //
506
507 #define DEPLOYMENT_STATUS_PENDING 0
508 #define DEPLOYMENT_STATUS_TRANSFER 1
509 #define DEPLOYMENT_STATUS_INSTALLATION 2
510 #define DEPLOYMENT_STATUS_COMPLETED 3
511 #define DEPLOYMENT_STATUS_FAILED 4
512 #define DEPLOYMENT_STATUS_INITIALIZE 5
513 #define DEPLOYMENT_STATUS_FINISHED 255
514
515
516 //
517 // Session subscription codes (data channels)
518 //
519
520 #define NXC_CHANNEL_EVENTS 0x0001
521 #define NXC_CHANNEL_SYSLOG 0x0002
522 #define NXC_CHANNEL_ALARMS 0x0004
523 #define NXC_CHANNEL_OBJECTS 0x0008
524 #define NXC_CHANNEL_SNMP_TRAPS 0x0010
525
526
527 //
528 // IP network
529 //
530
531 typedef struct
532 {
533 DWORD dwAddr;
534 DWORD dwMask;
535 } IP_NETWORK;
536
537
538 //
539 // Agent's parameter information
540 //
541
542 typedef struct
543 {
544 TCHAR szName[MAX_PARAM_NAME];
545 TCHAR szDescription[MAX_DB_STRING];
546 int iDataType;
547 } NXC_AGENT_PARAM;
548
549
550 //
551 // Action structure
552 //
553
554 typedef struct
555 {
556 DWORD dwId;
557 int iType;
558 BOOL bIsDisabled;
559 TCHAR szName[MAX_OBJECT_NAME];
560 TCHAR szRcptAddr[MAX_RCPT_ADDR_LEN];
561 TCHAR szEmailSubject[MAX_EMAIL_SUBJECT_LEN];
562 TCHAR *pszData;
563 } NXC_ACTION;
564
565
566 //
567 // Alarm structure
568 //
569
570 typedef struct
571 {
572 DWORD dwAlarmId; // Unique alarm ID
573 DWORD dwTimeStamp; // Timestamp in time() format
574 DWORD dwSourceObject; // Source object ID
575 DWORD dwSourceEventCode;// Originating event code
576 QWORD qwSourceEventId; // Originating event ID
577 TCHAR szMessage[MAX_DB_STRING];
578 TCHAR szKey[MAX_DB_STRING];
579 WORD wSeverity; // Alarm's severity
580 WORD wIsAck; // Non-zero if acknowleged
581 DWORD dwAckByUser; // Id of user who acknowleges this alarm (0 for system)
582 void *pUserData; // Can be freely used by client application
583 } NXC_ALARM;
584
585
586 //
587 // Event log record structure
588 //
589
590 typedef struct
591 {
592 QWORD qwEventId;
593 DWORD dwTimeStamp;
594 DWORD dwEventCode;
595 DWORD dwSourceId;
596 DWORD dwSeverity;
597 #ifdef UNICODE
598 WCHAR szMessage[MAX_EVENT_MSG_LENGTH];
599 #else
600 char szMessage[MAX_EVENT_MSG_LENGTH * sizeof(WCHAR)];
601 #endif
602 } NXC_EVENT;
603
604
605 //
606 // Image information
607 //
608
609 typedef struct
610 {
611 DWORD dwId;
612 TCHAR szName[MAX_OBJECT_NAME];
613 BYTE hash[MD5_DIGEST_SIZE];
614 } NXC_IMAGE;
615
616
617 //
618 // Image list
619 //
620
621 typedef struct
622 {
623 DWORD dwNumImages;
624 NXC_IMAGE *pImageList;
625 } NXC_IMAGE_LIST;
626
627
628 //
629 // Trap parameter mapping entry
630 //
631
632 struct NXC_OID_MAP
633 {
634 DWORD *pdwObjectId; // Trap OID
635 DWORD dwOidLen; // Trap OID length
636 TCHAR szDescription[MAX_DB_STRING];
637 };
638
639
640 //
641 // Trap configuration entry
642 //
643
644 struct NXC_TRAP_CFG_ENTRY
645 {
646 DWORD dwId; // Entry ID
647 DWORD *pdwObjectId; // Trap OID
648 DWORD dwOidLen; // Trap OID length
649 DWORD dwEventCode; // Event code
650 DWORD dwNumMaps; // Number of parameter mappings
651 NXC_OID_MAP *pMaps;
652 TCHAR szDescription[MAX_DB_STRING];
653 };
654
655
656 /********************************************************************
657 * Following part of this file shouldn't be included by server code *
658 ********************************************************************/
659
660 #ifndef LIBNXCL_NO_DECLARATIONS
661
662
663 //
664 // Callbacks data types
665 //
666
667 typedef void (* NXC_EVENT_HANDLER)(NXC_SESSION hSession, DWORD dwEvent, DWORD dwCode, void *pArg);
668 typedef void (* NXC_DEBUG_CALLBACK)(TCHAR *pMsg);
669
670
671 //
672 // Syslog record structure
673 //
674
675 typedef struct
676 {
677 QWORD qwMsgId;
678 DWORD dwTimeStamp;
679 WORD wFacility;
680 WORD wSeverity;
681 DWORD dwSourceObject;
682 TCHAR szHost[MAX_SYSLOG_HOSTNAME_LEN];
683 TCHAR szTag[MAX_SYSLOG_TAG_LEN];
684 TCHAR *pszText;
685 } NXC_SYSLOG_RECORD;
686
687
688 //
689 // Server's configuration variable
690 //
691
692 typedef struct
693 {
694 TCHAR szName[MAX_OBJECT_NAME];
695 TCHAR szValue[MAX_DB_STRING];
696 BOOL bNeedRestart;
697 } NXC_SERVER_VARIABLE;
698
699
700 //
701 // Agent package information
702 //
703
704 typedef struct
705 {
706 DWORD dwId;
707 TCHAR szName[MAX_PACKAGE_NAME_LEN];
708 TCHAR szVersion[MAX_AGENT_VERSION_LEN];
709 TCHAR szPlatform[MAX_PLATFORM_NAME_LEN];
710 TCHAR szFileName[MAX_DB_STRING];
711 TCHAR szDescription[MAX_DB_STRING];
712 } NXC_PACKAGE_INFO;
713
714
715 //
716 // Event configuration structure
717 //
718
719 typedef struct
720 {
721 DWORD dwCode;
722 DWORD dwSeverity;
723 DWORD dwFlags;
724 TCHAR szName[MAX_EVENT_NAME];
725 TCHAR *pszMessage;
726 TCHAR *pszDescription;
727 } NXC_EVENT_TEMPLATE;
728
729
730 //
731 // Entry in object's ACL
732 //
733
734 typedef struct
735 {
736 DWORD dwUserId;
737 DWORD dwAccessRights;
738 } NXC_ACL_ENTRY;
739
740
741 //
742 // Network object structure
743 //
744
745 typedef struct
746 {
747 DWORD dwId; // Unique object's identifier
748 int iClass; // Object's class
749 int iStatus; // Object's status
750 DWORD dwIpAddr; // IP address
751 TCHAR szName[MAX_OBJECT_NAME];
752 DWORD dwNumParents;
753 DWORD *pdwParentList;
754 DWORD dwNumChilds;
755 DWORD *pdwChildList;
756 BOOL bIsDeleted; // TRUE for deleted objects
757 BOOL bInheritRights;
758 DWORD dwAclSize;
759 NXC_ACL_ENTRY *pAccessList;
760 DWORD dwImage; // Image ID or IMG_DEFAULT for default image
761 int iStatusCalcAlg; // Status calculation algorithm
762 int iStatusPropAlg; // Status propagation alhorithm
763 int iFixedStatus; // Status to be propagated if alg = SA_PROPAGATE_FIXED
764 int iStatusShift; // Status shift for SA_PROPAGATE_RELATIVE
765 int iStatusTrans[4];
766 int iStatusSingleTh;
767 int iStatusThresholds[4];
768 union
769 {
770 struct
771 {
772 DWORD dwIpNetMask; // Ip netmask.
773 DWORD dwIfIndex; // Interface index.
774 DWORD dwIfType; // Interface type
775 BYTE bMacAddr[MAC_ADDR_LENGTH];
776 } iface;
777 struct
778 {
779 DWORD dwFlags;
780 DWORD dwDiscoveryFlags;
781 DWORD dwNodeType;
782 DWORD dwPollerNode;
783 DWORD dwProxyNode;
784 DWORD dwZoneGUID;
785 TCHAR szSharedSecret[MAX_SECRET_LENGTH];
786 TCHAR szCommunityString[MAX_COMMUNITY_LENGTH];
787 TCHAR szObjectId[MAX_OID_LENGTH];
788 WORD wAgentPort; // Listening TCP port for native agent
789 WORD wAuthMethod; // Native agent's authentication method
790 TCHAR *pszDescription;
791 TCHAR szAgentVersion[MAX_AGENT_VERSION_LEN];
792 TCHAR szPlatformName[MAX_PLATFORM_NAME_LEN];
793 WORD wSNMPVersion;
794 } node;
795 struct
796 {
797 DWORD dwIpNetMask;
798 DWORD dwZoneGUID;
799 } subnet;
800 struct
801 {
802 DWORD dwCategory;
803 TCHAR *pszDescription;
804 } container;
805 struct
806 {
807 DWORD dwVersion;
808 TCHAR *pszDescription;
809 } dct;
810 struct
811 {
812 int iServiceType;
813 WORD wProto;
814 WORD wPort;
815 DWORD dwPollerNode;
816 TCHAR *pszRequest;
817 TCHAR *pszResponse;
818 } netsrv;
819 struct
820 {
821 DWORD dwZoneGUID;
822 DWORD dwControllerIpAddr;
823 DWORD dwAddrListSize;
824 DWORD *pdwAddrList;
825 TCHAR *pszDescription;
826 WORD wZoneType;
827 } zone;
828 struct
829 {
830 DWORD dwPeerGateway;
831 DWORD dwNumLocalNets;
832 DWORD dwNumRemoteNets;
833 IP_NETWORK *pLocalNetList;
834 IP_NETWORK *pRemoteNetList;
835 } vpnc; // VPN connector
836 };
837 } NXC_OBJECT;
838
839
840 //
841 // Structure with data for NXCModifyObject
842 //
843
844 typedef struct
845 {
846 DWORD dwObjectId;
847 DWORD dwFlags;
848 TCHAR *pszName;
849 TCHAR *pszDescription;
850 int iAgentPort;
851 int iAuthType;
852 TCHAR *pszSecret;
853 TCHAR *pszCommunity;
854 BOOL bInheritRights;
855 DWORD dwImage;
856 DWORD dwAclSize;
857 NXC_ACL_ENTRY *pAccessList;
858 WORD wSNMPVersion;
859 int iServiceType;
860 WORD wProto;
861 WORD wPort;
862 DWORD dwPollerNode;
863 TCHAR *pszRequest;
864 TCHAR *pszResponse;
865 DWORD dwIpAddr;
866 DWORD dwPeerGateway;
867 DWORD dwNumLocalNets;
868 DWORD dwNumRemoteNets;
869 IP_NETWORK *pLocalNetList;
870 IP_NETWORK *pRemoteNetList;
871 int iStatusCalcAlg; // Status calculation algorithm
872 int iStatusPropAlg; // Status propagation alhorithm
873 int iFixedStatus; // Status to be propagated if alg = SA_PROPAGATE_FIXED
874 int iStatusShift; // Status shift for SA_PROPAGATE_RELATIVE
875 int iStatusTrans[4];
876 int iStatusSingleTh;
877 int iStatusThresholds[4];
878 DWORD dwProxyNode;
879 DWORD dwNodeFlags;
880 } NXC_OBJECT_UPDATE;
881
882
883 //
884 // NetXMS user information structure
885 //
886
887 typedef struct
888 {
889 TCHAR szName[MAX_USER_NAME];
890 uuid_t guid;
891 DWORD dwId;
892 WORD wFlags;
893 WORD wSystemRights;
894 int nAuthMethod; // Only for users
895 DWORD dwNumMembers; // Only for groups
896 DWORD *pdwMemberList; // Only for groups
897 TCHAR szFullName[MAX_USER_FULLNAME]; // Only for users
898 TCHAR szDescription[MAX_USER_DESCR];
899 } NXC_USER;
900
901
902 //
903 // Data collection item threshold structure
904 //
905
906 typedef struct
907 {
908 DWORD dwId;
909 DWORD dwEvent;
910 WORD wFunction;
911 WORD wOperation;
912 DWORD dwArg1;
913 DWORD dwArg2;
914 union
915 {
916 DWORD dwInt32;
917 INT64 qwInt64;
918 double dFloat;
919 TCHAR szString[MAX_STRING_VALUE];
920 } value;
921 } NXC_DCI_THRESHOLD;
922
923
924 //
925 // Data collection item structure
926 //
927
928 typedef struct
929 {
930 DWORD dwId;
931 DWORD dwTemplateId;
932 TCHAR szName[MAX_ITEM_NAME];
933 TCHAR szDescription[MAX_DB_STRING];
934 TCHAR szInstance[MAX_DB_STRING];
935 int iPollingInterval;
936 int iRetentionTime;
937 BYTE iSource;
938 BYTE iDataType;
939 BYTE iStatus;
940 BYTE iDeltaCalculation;
941 BYTE iAdvSchedule;
942 DWORD dwNumThresholds;
943 NXC_DCI_THRESHOLD *pThresholdList;
944 TCHAR *pszFormula;
945 DWORD dwNumSchedules;
946 TCHAR **ppScheduleList;
947 } NXC_DCI;
948
949
950 //
951 // Node's data collection list information
952 //
953
954 typedef struct
955 {
956 DWORD dwNodeId;
957 DWORD dwNumItems;
958 NXC_DCI *pItems;
959 } NXC_DCI_LIST;
960
961
962 //
963 // Row structure
964 //
965
966 #pragma pack(1)
967
968 typedef struct
969 {
970 DWORD dwTimeStamp;
971 union
972 {
973 DWORD dwInt32;
974 INT64 qwInt64;
975 double dFloat;
976 TCHAR szString[MAX_STRING_VALUE];
977 } value;
978 } NXC_DCI_ROW;
979
980 #pragma pack()
981
982
983 //
984 // DCI's collected data
985 //
986
987 typedef struct
988 {
989 DWORD dwNodeId; // Owner's node id
990 DWORD dwItemId; // Item id
991 DWORD dwNumRows; // Number of rows in set
992 WORD wDataType; // Data type (integer, string, etc.)
993 WORD wRowSize; // Size of single row in bytes
994 NXC_DCI_ROW *pRows; // Array of rows
995 } NXC_DCI_DATA;
996
997
998 //
999 // MIB file list
1000 //
1001
1002 typedef struct
1003 {
1004 DWORD dwNumFiles;
1005 TCHAR **ppszName;
1006 BYTE **ppHash;
1007 } NXC_MIB_LIST;
1008
1009
1010 //
1011 // Event processing policy rule
1012 //
1013
1014 typedef struct
1015 {
1016 DWORD dwFlags;
1017 DWORD dwId;
1018 DWORD dwNumActions;
1019 DWORD dwNumEvents;
1020 DWORD dwNumSources;
1021 DWORD *pdwActionList;
1022 DWORD *pdwEventList;
1023 DWORD *pdwSourceList;
1024 TCHAR *pszComment;
1025 TCHAR szAlarmKey[MAX_DB_STRING];
1026 TCHAR szAlarmAckKey[MAX_DB_STRING];
1027 TCHAR szAlarmMessage[MAX_DB_STRING];
1028 WORD wAlarmSeverity;
1029 } NXC_EPP_RULE;
1030
1031
1032 //
1033 // Event processing policy
1034 //
1035
1036 typedef struct
1037 {
1038 DWORD dwNumRules;
1039 NXC_EPP_RULE *pRuleList;
1040 } NXC_EPP;
1041
1042
1043 //
1044 // Package deployment status information
1045 //
1046
1047 typedef struct
1048 {
1049 DWORD dwNodeId;
1050 DWORD dwStatus;
1051 TCHAR *pszErrorMessage;
1052 } NXC_DEPLOYMENT_STATUS;
1053
1054
1055 //
1056 // Object creation information structure
1057 //
1058
1059 typedef struct
1060 {
1061 int iClass;
1062 DWORD dwParentId;
1063 TCHAR *pszName;
1064 union
1065 {
1066 struct
1067 {
1068 DWORD dwIpAddr;
1069 DWORD dwNetMask;
1070 } node;
1071 struct
1072 {
1073 DWORD dwCategory;
1074 TCHAR *pszDescription;
1075 } container;
1076 struct
1077 {
1078 TCHAR *pszDescription;
1079 } templateGroup;
1080 struct
1081 {
1082 int iServiceType;
1083 WORD wProto;
1084 WORD wPort;
1085 TCHAR *pszRequest;
1086 TCHAR *pszResponse;
1087 } netsrv;
1088 } cs;
1089 } NXC_OBJECT_CREATE_INFO;
1090
1091
1092 //
1093 // Container category
1094 //
1095
1096 typedef struct
1097 {
1098 DWORD dwId;
1099 DWORD dwImageId;
1100 TCHAR szName[MAX_OBJECT_NAME];
1101 TCHAR *pszDescription;
1102 } NXC_CONTAINER_CATEGORY;
1103
1104
1105 //
1106 // Container categories list
1107 //
1108
1109 typedef struct
1110 {
1111 DWORD dwNumElements;
1112 NXC_CONTAINER_CATEGORY *pElements;
1113 } NXC_CC_LIST;
1114
1115
1116 //
1117 // DCI information and last value for NXCGetLastValues()
1118 //
1119
1120 typedef struct
1121 {
1122 DWORD dwId;
1123 DWORD dwTimestamp;
1124 TCHAR szName[MAX_ITEM_NAME];
1125 TCHAR szDescription[MAX_DB_STRING];
1126 TCHAR szValue[MAX_DB_STRING];
1127 int iDataType;
1128 int iSource;
1129 } NXC_DCI_VALUE;
1130
1131
1132 //
1133 // Object tool
1134 //
1135
1136 typedef struct
1137 {
1138 DWORD dwId;
1139 DWORD dwFlags;
1140 WORD wType;
1141 TCHAR szName[MAX_DB_STRING];
1142 TCHAR szDescription[MAX_DB_STRING];
1143 TCHAR *pszMatchingOID;
1144 TCHAR *pszData;
1145 } NXC_OBJECT_TOOL;
1146
1147
1148 //
1149 // Results of table object tool execution
1150 //
1151
1152 typedef struct
1153 {
1154 DWORD dwNumCols;
1155 DWORD dwNumRows;
1156 TCHAR *pszTitle; // Table's title
1157 TCHAR **ppszColNames;
1158 LONG *pnColFormat;
1159 TCHAR **ppszData;
1160 } NXC_TABLE_DATA;
1161
1162
1163 //
1164 // Object tool column information
1165 //
1166
1167 typedef struct
1168 {
1169 TCHAR szName[MAX_DB_STRING];
1170 TCHAR szOID[MAX_DB_STRING];
1171 int nFormat;
1172 int nSubstr;
1173 } NXC_OBJECT_TOOL_COLUMN;
1174
1175
1176 //
1177 // Object tool detailed information
1178 //
1179
1180 typedef struct
1181 {
1182 DWORD dwId;
1183 DWORD dwFlags;
1184 TCHAR szName[MAX_DB_STRING];
1185 TCHAR szDescription[MAX_DB_STRING];
1186 TCHAR *pszMatchingOID;
1187 TCHAR *pszData;
1188 DWORD *pdwACL;
1189 DWORD dwACLSize;
1190 WORD wType;
1191 WORD wNumColumns;
1192 NXC_OBJECT_TOOL_COLUMN *pColList;
1193 } NXC_OBJECT_TOOL_DETAILS;
1194
1195
1196 //
1197 // Log processing policy info
1198 //
1199
1200 typedef struct
1201 {
1202 DWORD dwId;
1203 TCHAR szName[MAX_OBJECT_NAME];
1204 DWORD dwVersion;
1205 DWORD dwFlags;
1206 } NXC_LPP_INFO;
1207
1208
1209 //
1210 // Log processing policy list
1211 //
1212
1213 typedef struct
1214 {
1215 DWORD dwNumEntries;
1216 NXC_LPP_INFO *pList;
1217 } NXC_LPP_LIST;
1218
1219
1220 //
1221 // Log processing policy rule
1222 //
1223
1224 typedef struct
1225 {
1226 DWORD dwMsgIdStart;
1227 DWORD dwMsgIdEnd;
1228 DWORD dwSeverity;
1229 TCHAR szSourceName[MAX_DB_STRING];
1230 TCHAR szMsgText[MAX_DB_STRING];
1231 DWORD dwEventCode;
1232 } NXC_LPP_RULE;
1233
1234
1235 //
1236 // Log processing policy
1237 //
1238
1239 typedef struct
1240 {
1241 DWORD dwId;
1242 TCHAR szName[MAX_OBJECT_NAME];
1243 DWORD dwVersion;
1244 DWORD dwFlags;
1245 TCHAR szLogFile[MAX_DB_STRING];
1246 DWORD dwNumNodes;
1247 DWORD *pdwNodeList;
1248 DWORD dwNumRules;
1249 NXC_LPP_RULE *pRuleList;
1250 } NXC_LPP;
1251
1252
1253 //
1254 // Server stats
1255 //
1256
1257 typedef struct
1258 {
1259 DWORD dwNumAlarms;
1260 DWORD dwAlarmsBySeverity[5];
1261 DWORD dwNumObjects;
1262 DWORD dwNumNodes;
1263 DWORD dwNumDCI;
1264 DWORD dwNumClientSessions;
1265 DWORD dwServerUptime;
1266 DWORD dwServerProcessVMSize;
1267 DWORD dwServerProcessWorkSet;
1268 TCHAR szServerVersion[MAX_DB_STRING];
1269 } NXC_SERVER_STATS;
1270
1271
1272 //
1273 // Script info
1274 //
1275
1276 typedef struct
1277 {
1278 DWORD dwId;
1279 TCHAR szName[MAX_DB_STRING];
1280 } NXC_SCRIPT_INFO;
1281
1282
1283 //
1284 // Client session information
1285 //
1286
1287 typedef struct
1288 {
1289 DWORD dwSessionId;
1290 int nCipher;
1291 TCHAR szUserName[MAX_USER_NAME];
1292 TCHAR szClientApp[MAX_DB_STRING];
1293 } NXC_CLIENT_SESSION_INFO;
1294
1295
1296 //
1297 // Trap log records
1298 //
1299
1300 typedef struct
1301 {
1302 QWORD qwId;
1303 DWORD dwTimeStamp;
1304 DWORD dwIpAddr;
1305 DWORD dwObjectId;
1306 TCHAR szTrapOID[MAX_DB_STRING];
1307 TCHAR *pszTrapVarbinds;
1308 } NXC_SNMP_TRAP_LOG_RECORD;
1309
1310
1311 //
1312 // Map information
1313 //
1314
1315 typedef struct
1316 {
1317 DWORD dwMapId;
1318 DWORD dwObjectId;
1319 DWORD dwAccess; // Access rights to the map for current user
1320 TCHAR szName[MAX_DB_STRING];
1321 } NXC_MAP_INFO;
1322
1323
1324 //
1325 // Module information
1326 //
1327
1328 typedef struct
1329 {
1330 DWORD dwModuleId;
1331 DWORD dwFlags;
1332 TCHAR *pszName;
1333 TCHAR *pszExecutable;
1334 TCHAR *pszLicenseKey;
1335 TCHAR *pszDescription;
1336 } NXC_SERVER_MODULE_INFO;
1337
1338
1339 //
1340 // Module list
1341 //
1342
1343 typedef struct
1344 {
1345 DWORD dwNumModules;
1346 NXC_SERVER_MODULE_INFO *pModules;
1347 } NXC_SERVER_MODULE_LIST;
1348
1349
1350 //
1351 // Functions
1352 //
1353
1354 #ifdef __cplusplus
1355 extern "C" {
1356 #endif
1357
1358 DWORD LIBNXCL_EXPORTABLE NXCGetVersion(void);
1359 const TCHAR LIBNXCL_EXPORTABLE *NXCGetErrorText(DWORD dwError);
1360
1361 BOOL LIBNXCL_EXPORTABLE NXCInitialize(void);
1362 void LIBNXCL_EXPORTABLE NXCShutdown(void);
1363 void LIBNXCL_EXPORTABLE NXCSetDebugCallback(NXC_DEBUG_CALLBACK pFunc);
1364
1365 DWORD LIBNXCL_EXPORTABLE NXCConnect(TCHAR *szServer, TCHAR *szLogin,
1366 TCHAR *szPassword, NXC_SESSION *phSession,
1367 TCHAR *pszClientInfo, BOOL bExactVersionMatch,
1368 BOOL bEncrypt);
1369 void LIBNXCL_EXPORTABLE NXCDisconnect(NXC_SESSION hSession);
1370 void LIBNXCL_EXPORTABLE NXCSetEventHandler(NXC_SESSION hSession, NXC_EVENT_HANDLER pHandler);
1371 void LIBNXCL_EXPORTABLE NXCSetCommandTimeout(NXC_SESSION hSession, DWORD dwTimeout);
1372 void LIBNXCL_EXPORTABLE NXCGetServerID(NXC_SESSION hSession, BYTE *pbsId);
1373 DWORD LIBNXCL_EXPORTABLE NXCSubscribe(NXC_SESSION hSession, DWORD dwChannels);
1374 DWORD LIBNXCL_EXPORTABLE NXCUnsubscribe(NXC_SESSION hSession, DWORD dwChannels);
1375
1376 void LIBNXCL_EXPORTABLE *NXCGetClientData(NXC_SESSION hSession);
1377 void LIBNXCL_EXPORTABLE NXCSetClientData(NXC_SESSION hSession, void *pData);
1378
1379 DWORD LIBNXCL_EXPORTABLE NXCSyncObjects(NXC_SESSION hSession);
1380 DWORD LIBNXCL_EXPORTABLE NXCSyncObjectsEx(NXC_SESSION hSession, TCHAR *pszCacheFile);
1381 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectById(NXC_SESSION hSession, DWORD dwId);
1382 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByIdNoLock(NXC_SESSION hSession, DWORD dwId);
1383 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByName(NXC_SESSION hSession, TCHAR *pszName);
1384 void LIBNXCL_EXPORTABLE NXCEnumerateObjects(NXC_SESSION hSession, BOOL (* pHandler)(NXC_OBJECT *));
1385 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTopologyRootObject(NXC_SESSION hSession);
1386 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetServiceRootObject(NXC_SESSION hSession);
1387 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTemplateRootObject(NXC_SESSION hSession);
1388 void LIBNXCL_EXPORTABLE *NXCGetObjectIndex(NXC_SESSION hSession, DWORD *pdwNumObjects);
1389 void LIBNXCL_EXPORTABLE NXCLockObjectIndex(NXC_SESSION hSession);
1390 void LIBNXCL_EXPORTABLE NXCUnlockObjectIndex(NXC_SESSION hSession);
1391 DWORD LIBNXCL_EXPORTABLE NXCModifyObject(NXC_SESSION hSession, NXC_OBJECT_UPDATE *pData);
1392 DWORD LIBNXCL_EXPORTABLE NXCSetObjectMgmtStatus(NXC_SESSION hSession, DWORD dwObjectId, BOOL bIsManaged);
1393 DWORD LIBNXCL_EXPORTABLE NXCChangeNodeIP(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwIpAddr);
1394 DWORD LIBNXCL_EXPORTABLE NXCCreateObject(NXC_SESSION hSession, NXC_OBJECT_CREATE_INFO *pCreateInfo, DWORD *pdwObjectId);
1395 DWORD LIBNXCL_EXPORTABLE NXCBindObject(NXC_SESSION hSession, DWORD dwParentObject, DWORD dwChildObject);
1396 DWORD LIBNXCL_EXPORTABLE NXCUnbindObject(NXC_SESSION hSession, DWORD dwParentObject, DWORD dwChildObject);
1397 DWORD LIBNXCL_EXPORTABLE NXCRemoveTemplate(NXC_SESSION hSession, DWORD dwTemplateId,
1398 DWORD dwNodeId, BOOL bRemoveDCI);
1399 DWORD LIBNXCL_EXPORTABLE NXCDeleteObject(NXC_SESSION hSession, DWORD dwObject);
1400 DWORD LIBNXCL_EXPORTABLE NXCPollNode(NXC_SESSION hSession, DWORD dwObjectId, int iPollType,
1401 void (* pCallback)(TCHAR *, void *), void *pArg);
1402 DWORD LIBNXCL_EXPORTABLE NXCWakeUpNode(NXC_SESSION hSession, DWORD dwObjectId);
1403 DWORD LIBNXCL_EXPORTABLE NXCGetSupportedParameters(NXC_SESSION hSession, DWORD dwNodeId,
1404 DWORD *pdwNumParams,
1405 NXC_AGENT_PARAM **ppParamList);
1406 void LIBNXCL_EXPORTABLE NXCGetComparableObjectName(NXC_SESSION hSession, DWORD dwObjectId,
1407 TCHAR *pszName);
1408 void LIBNXCL_EXPORTABLE NXCGetComparableObjectNameEx(NXC_OBJECT *pObject, TCHAR *pszName);
1409 DWORD LIBNXCL_EXPORTABLE NXCSaveObjectCache(NXC_SESSION hSession, TCHAR *pszFile);
1410 DWORD LIBNXCL_EXPORTABLE NXCGetAgentConfig(NXC_SESSION hSession, DWORD dwNodeId,
1411 TCHAR **ppszConfig);
1412 DWORD LIBNXCL_EXPORTABLE NXCUpdateAgentConfig(NXC_SESSION hSession, DWORD dwNodeId,
1413 TCHAR *pszConfig, BOOL bApply);
1414 DWORD LIBNXCL_EXPORTABLE NXCExecuteAction(NXC_SESSION hSession, DWORD dwObjectId,
1415 TCHAR *pszAction);
1416
1417 DWORD LIBNXCL_EXPORTABLE NXCLoadCCList(NXC_SESSION hSession, NXC_CC_LIST **ppList);
1418 void LIBNXCL_EXPORTABLE NXCDestroyCCList(NXC_CC_LIST *pList);
1419
1420 DWORD LIBNXCL_EXPORTABLE NXCSyncEvents(NXC_SESSION hSession, DWORD dwMaxRecords);
1421 DWORD LIBNXCL_EXPORTABLE NXCLoadEventDB(NXC_SESSION hSession);
1422 DWORD LIBNXCL_EXPORTABLE NXCSetEventInfo(NXC_SESSION hSession, NXC_EVENT_TEMPLATE *pArg);
1423 DWORD LIBNXCL_EXPORTABLE NXCGenerateEventCode(NXC_SESSION hSession, DWORD *pdwEventCode);
1424 void LIBNXCL_EXPORTABLE NXCAddEventTemplate(NXC_SESSION hSession, NXC_EVENT_TEMPLATE *pEventTemplate);
1425 void LIBNXCL_EXPORTABLE NXCDeleteEDBRecord(NXC_SESSION hSession, DWORD dwEventCode);
1426 DWORD LIBNXCL_EXPORTABLE NXCDeleteEventTemplate(NXC_SESSION hSession, DWORD dwEventCode);
1427 DWORD LIBNXCL_EXPORTABLE NXCLockEventDB(NXC_SESSION hSession);
1428 DWORD LIBNXCL_EXPORTABLE NXCUnlockEventDB(NXC_SESSION hSession);
1429 BOOL LIBNXCL_EXPORTABLE NXCGetEventDB(NXC_SESSION hSession, NXC_EVENT_TEMPLATE ***pppTemplateList, DWORD *pdwNumRecords);
1430 const TCHAR LIBNXCL_EXPORTABLE *NXCGetEventName(NXC_SESSION hSession, DWORD dwId);
1431 BOOL LIBNXCL_EXPORTABLE NXCGetEventNameEx(NXC_SESSION hSession, DWORD dwId, TCHAR *pszBuffer, DWORD dwBufSize);
1432 int LIBNXCL_EXPORTABLE NXCGetEventSeverity(NXC_SESSION hSession, DWORD dwId);
1433 BOOL LIBNXCL_EXPORTABLE NXCGetEventText(NXC_SESSION hSession, DWORD dwId, TCHAR *pszBuffer, DWORD dwBufSize);
1434 DWORD LIBNXCL_EXPORTABLE NXCSendEvent(NXC_SESSION hSession, DWORD dwEventCode, DWORD dwObjectId, int iNumArgs, TCHAR **pArgList);
1435
1436 DWORD LIBNXCL_EXPORTABLE NXCSyncSyslog(NXC_SESSION hSession, DWORD dwMaxRecords);
1437
1438 DWORD LIBNXCL_EXPORTABLE NXCLoadUserDB(NXC_SESSION hSession);
1439 NXC_USER LIBNXCL_EXPORTABLE *NXCFindUserById(NXC_SESSION hSession, DWORD dwId);
1440 BOOL LIBNXCL_EXPORTABLE NXCGetUserDB(NXC_SESSION hSession, NXC_USER **ppUserList, DWORD *pdwNumUsers);
1441 DWORD LIBNXCL_EXPORTABLE NXCLockUserDB(NXC_SESSION hSession);
1442 DWORD LIBNXCL_EXPORTABLE NXCUnlockUserDB(NXC_SESSION hSession);
1443 DWORD LIBNXCL_EXPORTABLE NXCCreateUser(NXC_SESSION hSession, TCHAR *pszName, BOOL bIsGroup, DWORD *pdwNewId);
1444 DWORD LIBNXCL_EXPORTABLE NXCDeleteUser(NXC_SESSION hSession, DWORD dwId);
1445 DWORD LIBNXCL_EXPORTABLE NXCModifyUser(NXC_SESSION hSession, NXC_USER *pUserInfo);
1446 DWORD LIBNXCL_EXPORTABLE NXCSetPassword(NXC_SESSION hSession, DWORD dwUserId, TCHAR *pszNewPassword);
1447 BOOL LIBNXCL_EXPORTABLE NXCNeedPasswordChange(NXC_SESSION hSession);
1448 DWORD LIBNXCL_EXPORTABLE NXCGetUserVariable(NXC_SESSION hSession, DWORD dwUserId,
1449 TCHAR *pszVarName, TCHAR *pszValue, DWORD dwSize);
1450 DWORD LIBNXCL_EXPORTABLE NXCSetUserVariable(NXC_SESSION hSession, DWORD dwUserId,
1451 TCHAR *pszVarName, TCHAR *pszValue);
1452 DWORD LIBNXCL_EXPORTABLE NXCCopyUserVariable(NXC_SESSION hSession, DWORD dwSrcUserId,
1453 DWORD dwDstUserId, TCHAR *pszVarName,
1454 BOOL bMove);
1455 DWORD LIBNXCL_EXPORTABLE NXCEnumUserVariables(NXC_SESSION hSession, DWORD dwUserId,
1456 TCHAR *pszPattern, DWORD *pdwNumVars,
1457 TCHAR ***pppszVarList);
1458 DWORD LIBNXCL_EXPORTABLE NXCDeleteUserVariable(NXC_SESSION hSession, DWORD dwUserId,
1459 TCHAR *pszVarName);
1460 DWORD LIBNXCL_EXPORTABLE NXCGetSessionList(NXC_SESSION hSession, DWORD *pdwNumSessions,
1461 NXC_CLIENT_SESSION_INFO **ppList);
1462 DWORD LIBNXCL_EXPORTABLE NXCKillSession(NXC_SESSION hSession, DWORD dwSessionId);
1463 DWORD LIBNXCL_EXPORTABLE NXCGetCurrentUserId(NXC_SESSION hSession);
1464 DWORD LIBNXCL_EXPORTABLE NXCGetCurrentSystemAccess(NXC_SESSION hSession);
1465
1466 DWORD LIBNXCL_EXPORTABLE NXCOpenNodeDCIList(NXC_SESSION hSession, DWORD dwNodeId, NXC_DCI_LIST **ppItemList);
1467 DWORD LIBNXCL_EXPORTABLE NXCCloseNodeDCIList(NXC_SESSION hSession, NXC_DCI_LIST *pItemList);
1468 DWORD LIBNXCL_EXPORTABLE NXCCreateNewDCI(NXC_SESSION hSession, NXC_DCI_LIST *pItemList, DWORD *pdwItemId);
1469 DWORD LIBNXCL_EXPORTABLE NXCUpdateDCI(NXC_SESSION hSession, DWORD dwNodeId, NXC_DCI *pItem);
1470 DWORD LIBNXCL_EXPORTABLE NXCDeleteDCI(NXC_SESSION hSession, NXC_DCI_LIST *pItemList, DWORD dwItemId);
1471 DWORD LIBNXCL_EXPORTABLE NXCSetDCIStatus(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwNumItems,
1472 DWORD *pdwItemList, int iStatus);
1473 DWORD LIBNXCL_EXPORTABLE NXCCopyDCI(NXC_SESSION hSession, DWORD dwSrcNodeId, DWORD dwDstNodeId,
1474 DWORD dwNumItems, DWORD *pdwItemList);
1475 DWORD LIBNXCL_EXPORTABLE NXCApplyTemplate(NXC_SESSION hSession, DWORD dwTemplateId, DWORD dwNodeId);
1476 DWORD LIBNXCL_EXPORTABLE NXCItemIndex(NXC_DCI_LIST *pItemList, DWORD dwItemId);
1477 DWORD LIBNXCL_EXPORTABLE NXCGetDCIData(NXC_SESSION hSession, DWORD dwNodeId, DWORD dwItemId, DWORD dwMaxRows,
1478 DWORD dwTimeFrom, DWORD dwTimeTo, NXC_DCI_DATA **ppData);
1479 void LIBNXCL_EXPORTABLE NXCDestroyDCIData(NXC_DCI_DATA *pData);
1480 NXC_DCI_ROW LIBNXCL_EXPORTABLE *NXCGetRowPtr(NXC_DCI_DATA *pData, DWORD dwRow);
1481 DWORD LIBNXCL_EXPORTABLE NXCGetLastValues(NXC_SESSION hSession, DWORD dwNodeId,
1482 DWORD *pdwNumItems, NXC_DCI_VALUE **ppValueList);
1483 DWORD LIBNXCL_EXPORTABLE NXCAddThresholdToItem(NXC_DCI *pItem, NXC_DCI_THRESHOLD *pThreshold);
1484 BOOL LIBNXCL_EXPORTABLE NXCDeleteThresholdFromItem(NXC_DCI *pItem, DWORD dwIndex);
1485 BOOL LIBNXCL_EXPORTABLE NXCSwapThresholds(NXC_DCI *pItem, DWORD dwIndex1, DWORD dwIndex2);
1486 DWORD LIBNXCL_EXPORTABLE NXCQueryParameter(NXC_SESSION hSession, DWORD dwNodeId, int iOrigin, TCHAR *pszParameter,
1487 TCHAR *pszBuffer, DWORD dwBufferSize);
1488
1489 DWORD LIBNXCL_EXPORTABLE NXCGetMIBFileTimeStamp(NXC_SESSION hSession, DWORD *pdwTimeStamp);
1490 DWORD LIBNXCL_EXPORTABLE NXCDownloadMIBFile(NXC_SESSION hSession, TCHAR *pszName);
1491
1492 DWORD LIBNXCL_EXPORTABLE NXCOpenEventPolicy(NXC_SESSION hSession, NXC_EPP **ppEventPolicy);
1493 DWORD LIBNXCL_EXPORTABLE NXCCloseEventPolicy(NXC_SESSION hSession);
1494 DWORD LIBNXCL_EXPORTABLE NXCSaveEventPolicy(NXC_SESSION hSession, NXC_EPP *pEventPolicy);
1495 void LIBNXCL_EXPORTABLE NXCDestroyEventPolicy(NXC_EPP *pEventPolicy);
1496 void LIBNXCL_EXPORTABLE NXCDeletePolicyRule(NXC_EPP *pEventPolicy, DWORD dwRule);
1497
1498 DWORD LIBNXCL_EXPORTABLE NXCSyncImages(NXC_SESSION hSession, NXC_IMAGE_LIST **ppImageList, TCHAR *pszCacheDir, WORD wFormat);
1499 DWORD LIBNXCL_EXPORTABLE NXCLoadImageFile(NXC_SESSION hSession, DWORD dwImageId, TCHAR *pszCacheDir, WORD wFormat);
1500 void LIBNXCL_EXPORTABLE NXCDestroyImageList(NXC_IMAGE_LIST *pImageList);
1501 DWORD LIBNXCL_EXPORTABLE NXCLoadDefaultImageList(NXC_SESSION hSession, DWORD *pdwListSize,
1502 DWORD **ppdwClassId, DWORD **ppdwImageId);
1503
1504 DWORD LIBNXCL_EXPORTABLE NXCLoadAllAlarms(NXC_SESSION hSession, BOOL bIncludeAck, DWORD *pdwNumAlarms, NXC_ALARM **ppAlarmList);
1505 DWORD LIBNXCL_EXPORTABLE NXCAcknowlegeAlarm(NXC_SESSION hSession, DWORD dwAlarmId);
1506 DWORD LIBNXCL_EXPORTABLE NXCDeleteAlarm(NXC_SESSION hSession, DWORD dwAlarmId);
1507
1508 DWORD LIBNXCL_EXPORTABLE NXCLoadActions(NXC_SESSION hSession, DWORD *pdwNumActions, NXC_ACTION **ppActionList);
1509 DWORD LIBNXCL_EXPORTABLE NXCLockActionDB(NXC_SESSION hSession);
1510 DWORD LIBNXCL_EXPORTABLE NXCUnlockActionDB(NXC_SESSION hSession);
1511 DWORD LIBNXCL_EXPORTABLE NXCCreateAction(NXC_SESSION hSession, TCHAR *pszName, DWORD *pdwNewId);
1512 DWORD LIBNXCL_EXPORTABLE NXCModifyAction(NXC_SESSION hSession, NXC_ACTION *pAction);
1513 DWORD LIBNXCL_EXPORTABLE NXCDeleteAction(NXC_SESSION hSession, DWORD dwActionId);
1514
1515 DWORD LIBNXCL_EXPORTABLE NXCLockTrapCfg(NXC_SESSION hSession);
1516 DWORD LIBNXCL_EXPORTABLE NXCUnlockTrapCfg(NXC_SESSION hSession);
1517 DWORD LIBNXCL_EXPORTABLE NXCLoadTrapCfg(NXC_SESSION hSession, DWORD *pdwNumTraps, NXC_TRAP_CFG_ENTRY **ppTrapList);
1518 void LIBNXCL_EXPORTABLE NXCDestroyTrapList(DWORD dwNumTraps, NXC_TRAP_CFG_ENTRY *pTrapList);
1519 DWORD LIBNXCL_EXPORTABLE NXCCreateTrap(NXC_SESSION hSession, DWORD *pdwTrapId);
1520 DWORD LIBNXCL_EXPORTABLE NXCModifyTrap(NXC_SESSION hSession, NXC_TRAP_CFG_ENTRY *pTrap);
1521 DWORD LIBNXCL_EXPORTABLE NXCDeleteTrap(NXC_SESSION hSession, DWORD dwTrapId);
1522 DWORD LIBNXCL_EXPORTABLE NXCSyncSNMPTrapLog(NXC_SESSION hSession, DWORD dwMaxRecords);
1523
1524 DWORD LIBNXCL_EXPORTABLE NXCLockPackageDB(NXC_SESSION hSession);
1525 DWORD LIBNXCL_EXPORTABLE NXCUnlockPackageDB(NXC_SESSION hSession);
1526 DWORD LIBNXCL_EXPORTABLE NXCGetPackageList(NXC_SESSION hSession, DWORD *pdwNumPackages,
1527 NXC_PACKAGE_INFO **ppList);
1528 DWORD LIBNXCL_EXPORTABLE NXCInstallPackage(NXC_SESSION hSession, NXC_PACKAGE_INFO *pInfo,
1529 TCHAR *pszFullPkgPath);
1530 DWORD LIBNXCL_EXPORTABLE NXCRemovePackage(NXC_SESSION hSession, DWORD dwPkgId);
1531 DWORD LIBNXCL_EXPORTABLE NXCParseNPIFile(TCHAR *pszInfoFile, NXC_PACKAGE_INFO *pInfo);
1532 DWORD LIBNXCL_EXPORTABLE NXCDeployPackage(NXC_SESSION hSession, DWORD dwPkgId,
1533 DWORD dwNumObjects, DWORD *pdwObjectList,
1534 DWORD *pdwRqId);
1535
1536 DWORD LIBNXCL_EXPORTABLE NXCGetServerStats(NXC_SESSION hSession, NXC_SERVER_STATS *pStats);
1537 DWORD LIBNXCL_EXPORTABLE NXCGetServerVariables(NXC_SESSION hSession,
1538 NXC_SERVER_VARIABLE **ppVarList,
1539 DWORD *pdwNumVars);
1540 DWORD LIBNXCL_EXPORTABLE NXCSetServerVariable(NXC_SESSION hSession, TCHAR *pszVarName,
1541 TCHAR *pszValue);
1542 DWORD LIBNXCL_EXPORTABLE NXCDeleteServerVariable(NXC_SESSION hSession, TCHAR *pszVarName);
1543
1544 DWORD LIBNXCL_EXPORTABLE NXCGetObjectTools(NXC_SESSION hSession, DWORD *pdwNumTools,
1545 NXC_OBJECT_TOOL **ppToolList);
1546 void LIBNXCL_EXPORTABLE NXCDestroyObjectToolList(DWORD dwNumTools, NXC_OBJECT_TOOL *pList);
1547 DWORD LIBNXCL_EXPORTABLE NXCExecuteTableTool(NXC_SESSION hSession, DWORD dwNodeId,
1548 DWORD dwToolId, NXC_TABLE_DATA **ppData);
1549 void LIBNXCL_EXPORTABLE NXCDestroyTableData(NXC_TABLE_DATA *pData);
1550 DWORD LIBNXCL_EXPORTABLE NXCLockObjectTools(NXC_SESSION hSession);
1551 DWORD LIBNXCL_EXPORTABLE NXCUnlockObjectTools(NXC_SESSION hSession);
1552 DWORD LIBNXCL_EXPORTABLE NXCGetObjectToolDetails(NXC_SESSION hSession, DWORD dwToolId,
1553 NXC_OBJECT_TOOL_DETAILS **ppData);
1554 void LIBNXCL_EXPORTABLE NXCDestroyObjectToolDetails(NXC_OBJECT_TOOL_DETAILS *pData);
1555 DWORD LIBNXCL_EXPORTABLE NXCDeleteObjectTool(NXC_SESSION hSession, DWORD dwToolId);
1556 DWORD LIBNXCL_EXPORTABLE NXCGenerateObjectToolId(NXC_SESSION hSession, DWORD *pdwToolId);
1557 DWORD LIBNXCL_EXPORTABLE NXCUpdateObjectTool(NXC_SESSION hSession,
1558 NXC_OBJECT_TOOL_DETAILS *pData);
1559 BOOL LIBNXCL_EXPORTABLE NXCIsAppropriateTool(NXC_OBJECT_TOOL *pTool, NXC_OBJECT *pObject);
1560
1561 DWORD LIBNXCL_EXPORTABLE NXCLoadLPPList(NXC_SESSION hSession, NXC_LPP_LIST **ppList);
1562 void LIBNXCL_EXPORTABLE NXCDestroyLPPList(NXC_LPP_LIST *pList);
1563 DWORD LIBNXCL_EXPORTABLE NXCRequestNewLPPID(NXC_SESSION hSession, DWORD *pdwId);
1564 DWORD LIBNXCL_EXPORTABLE NXCOpenLPP(NXC_SESSION hSession, NXC_LPP **ppPolicy);
1565 void LIBNXCL_EXPORTABLE NXCDestroyLPP(NXC_LPP *pPolicy);
1566
1567 DWORD LIBNXCL_EXPORTABLE NXCGetScriptList(NXC_SESSION hSession, DWORD *pdwNumScrpts,
1568 NXC_SCRIPT_INFO **ppList);
1569 DWORD LIBNXCL_EXPORTABLE NXCGetScript(NXC_SESSION hSession, DWORD dwId, TCHAR **ppszCode);
1570 DWORD LIBNXCL_EXPORTABLE NXCUpdateScript(NXC_SESSION hSession, DWORD *pdwId,
1571 TCHAR *pszName, TCHAR *pszCode);
1572 DWORD LIBNXCL_EXPORTABLE NXCRenameScript(NXC_SESSION hSession, DWORD dwId,
1573 TCHAR *pszName);
1574 DWORD LIBNXCL_EXPORTABLE NXCDeleteScript(NXC_SESSION hSession, DWORD dwId);
1575
1576 DWORD LIBNXCL_EXPORTABLE NXCSnmpWalk(NXC_SESSION hSession, DWORD dwNode,
1577 TCHAR *pszRootOID, void *pUserData,
1578 void (* pfCallback)(TCHAR *, DWORD, TCHAR *, void *));
1579
1580 DWORD LIBNXCL_EXPORTABLE NXCGetMapList(NXC_SESSION hSession, DWORD *pdwNumMaps,
1581 NXC_MAP_INFO **ppMapList);
1582 DWORD LIBNXCL_EXPORTABLE NXCSaveMap(NXC_SESSION hSession, void *pMap);
1583 DWORD LIBNXCL_EXPORTABLE NXCLoadMap(NXC_SESSION hSession, DWORD dwMapId, void **ppMap);
1584 DWORD LIBNXCL_EXPORTABLE NXCDeleteMap(NXC_SESSION hSession, DWORD dwMapId);
1585 DWORD LIBNXCL_EXPORTABLE NXCResolveMapName(NXC_SESSION hSession, TCHAR *pszMapName,
1586 DWORD *pdwMapId);
1587 DWORD LIBNXCL_EXPORTABLE NXCUploadSubmapBkImage(NXC_SESSION hSession, DWORD dwMapId,
1588 DWORD dwSubmapId, TCHAR *pszFile);
1589 DWORD LIBNXCL_EXPORTABLE NXCDownloadSubmapBkImage(NXC_SESSION hSession, DWORD dwMapId,
1590 DWORD dwSubmapId, TCHAR *pszFile);
1591
1592 DWORD LIBNXCL_EXPORTABLE NXCGetServerModuleList(NXC_SESSION hSession,
1593 NXC_SERVER_MODULE_LIST **ppModuleList);
1594 void LIBNXCL_EXPORTABLE NXCDestroyModuleList(NXC_SERVER_MODULE_LIST *pModuleList);
1595
1596 #ifdef __cplusplus
1597 }
1598 #endif
1599
1600 #endif /* LIBNXCL_NO_DECLARATIONS */
1601
1602 #endif /* _nxclapi_h_ */