- All component locks moved to memory
[public/netxms.git] / include / nxclapi.h
1 /*
2 ** NetXMS - Network Management System
3 ** Client Library API
4 ** Copyright (C) 2004 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 ** $module: 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
33 #ifdef _WIN32
34 #ifdef LIBNXCL_EXPORTS
35 #define LIBNXCL_EXPORTABLE __declspec(dllexport)
36 #else
37 #define LIBNXCL_EXPORTABLE __declspec(dllimport)
38 #endif
39 #else /* _WIN32 */
40 #define LIBNXCL_EXPORTABLE
41 #endif
42
43
44 //
45 // Custom data types
46 //
47
48 typedef unsigned long HREQUEST;
49
50
51 //
52 // Some constants
53 //
54
55 #define MAX_OBJECT_NAME 64
56 #define MAX_COMMUNITY_LENGTH 32
57 #define MAX_OID_LENGTH 1024
58 #define MAX_EVENT_MSG_LENGTH 256
59 #define MAX_EVENT_NAME 64
60 #define MAX_USER_NAME 64
61 #define MAX_USER_FULLNAME 128
62 #define MAX_USER_DESCR 256
63 #define MAX_ITEM_NAME 256
64 #define MAX_STRING_VALUE 256
65 #define GROUP_FLAG ((DWORD)0x80000000)
66 #define GROUP_EVERYONE ((DWORD)0x80000000)
67 #define INVALID_UID ((DWORD)0xFFFFFFFF)
68 #define OBJECT_STATUS_COUNT 9
69 #define MAX_RCPT_ADDR_LEN 256
70 #define MAX_EMAIL_SUBJECT_LEN 256
71 #define MAC_ADDR_LENGTH 6
72
73
74 //
75 // Image formats
76 //
77
78 #define IMAGE_FORMAT_ICO 0
79 #define IMAGE_FORMAT_PNG 1
80
81
82 //
83 // Authentication methods
84 //
85
86 #define AUTH_NONE 0
87 #define AUTH_PLAINTEXT 1
88 #define AUTH_MD5_HASH 2
89 #define AUTH_SHA1_HASH 3
90
91
92 //
93 // Forced poll types
94 //
95
96 #define POLL_STATUS 1
97 #define POLL_CONFIGURATION 2
98
99
100 //
101 // Object types
102 //
103
104 #define OBJECT_GENERIC 0
105 #define OBJECT_SUBNET 1
106 #define OBJECT_NODE 2
107 #define OBJECT_INTERFACE 3
108 #define OBJECT_NETWORK 4
109 #define OBJECT_CONTAINER 5
110 #define OBJECT_ZONE 6
111 #define OBJECT_SERVICEROOT 7
112 #define OBJECT_TEMPLATE 8
113 #define OBJECT_TEMPLATEGROUP 9
114 #define OBJECT_TEMPLATEROOT 10
115
116
117 //
118 // Object's status
119 //
120
121 #define STATUS_NORMAL 0
122 #define STATUS_WARNING 1
123 #define STATUS_MINOR 2
124 #define STATUS_MAJOR 3
125 #define STATUS_CRITICAL 4
126 #define STATUS_UNKNOWN 5
127 #define STATUS_UNMANAGED 6
128 #define STATUS_DISABLED 7
129 #define STATUS_TESTING 8
130
131
132 //
133 // Event and alarm severity
134 //
135
136 #define SEVERITY_NORMAL 0
137 #define SEVERITY_WARNING 1
138 #define SEVERITY_MINOR 2
139 #define SEVERITY_MAJOR 3
140 #define SEVERITY_CRITICAL 4
141 #define SEVERITY_FROM_EVENT 5
142 #define SEVERITY_NONE 6
143
144
145 //
146 // Node flags
147 //
148
149 #define NF_IS_SNMP 0x0001
150 #define NF_IS_NATIVE_AGENT 0x0002
151 #define NF_IS_BRIDGE 0x0004
152 #define NF_IS_ROUTER 0x0008
153 #define NF_IS_LOCAL_MGMT 0x0010
154 #define NF_IS_PRINTER 0x0020
155 #define NS_IS_OSPF 0x0040
156
157
158 //
159 // Events
160 //
161
162 #define NXC_EVENT_STATE_CHANGED 1
163 #define NXC_EVENT_ERROR 2
164 #define NXC_EVENT_LOGIN_RESULT 3
165 #define NXC_EVENT_NEW_ELOG_RECORD 4
166 #define NXC_EVENT_USER_DB_CHANGED 5
167 #define NXC_EVENT_OBJECT_CHANGED 6
168 #define NXC_EVENT_NOTIFICATION 7
169
170
171 //
172 // Errors
173 //
174
175 #define NXC_ERR_INTERNAL 1
176
177
178 //
179 // States (used both by client library and server)
180 //
181
182 #define STATE_DISCONNECTED 0
183 #define STATE_CONNECTING 1
184 #define STATE_CONNECTED 2
185 #define STATE_AUTHENTICATED 3
186
187
188 //
189 // Notification codes
190 //
191
192 #define NX_NOTIFY_SHUTDOWN 1
193 #define NX_NOTIFY_EVENTDB_CHANGED 2
194 #define NX_NOTIFY_ALARM_DELETED 3
195 #define NX_NOTIFY_NEW_ALARM 4
196 #define NX_NOTIFY_ALARM_ACKNOWLEGED 5
197 #define NX_NOTIFY_ACTION_CREATED 6
198 #define NX_NOTIFY_ACTION_MODIFIED 7
199 #define NX_NOTIFY_ACTION_DELETED 8
200
201
202 //
203 // Request completion codes
204 //
205
206 #define RCC_SUCCESS ((DWORD)0)
207 #define RCC_COMPONENT_LOCKED ((DWORD)1)
208 #define RCC_ACCESS_DENIED ((DWORD)2)
209 #define RCC_INVALID_REQUEST ((DWORD)3)
210 #define RCC_TIMEOUT ((DWORD)4)
211 #define RCC_OUT_OF_STATE_REQUEST ((DWORD)5)
212 #define RCC_DB_FAILURE ((DWORD)6)
213 #define RCC_INVALID_OBJECT_ID ((DWORD)7)
214 #define RCC_ALREADY_EXIST ((DWORD)8)
215 #define RCC_COMM_FAILURE ((DWORD)9)
216 #define RCC_SYSTEM_FAILURE ((DWORD)10)
217 #define RCC_INVALID_USER_ID ((DWORD)11)
218 #define RCC_INVALID_ARGUMENT ((DWORD)12)
219 #define RCC_DUPLICATE_DCI ((DWORD)13)
220 #define RCC_INVALID_DCI_ID ((DWORD)14)
221 #define RCC_OUT_OF_MEMORY ((DWORD)15)
222 #define RCC_IO_ERROR ((DWORD)16)
223 #define RCC_INCOMPATIBLE_OPERATION ((DWORD)17)
224 #define RCC_OBJECT_CREATION_FAILED ((DWORD)18)
225 #define RCC_OBJECT_LOOP ((DWORD)19)
226 #define RCC_INVALID_OBJECT_NAME ((DWORD)20)
227 #define RCC_INVALID_ALARM_ID ((DWORD)21)
228 #define RCC_INVALID_ACTION_ID ((DWORD)22)
229 #define RCC_OPERATION_IN_PROGRESS ((DWORD)23)
230 #define RCC_DCI_COPY_ERRORS ((DWORD)24)
231 #define RCC_INVALID_EVENT_CODE ((DWORD)25)
232 #define RCC_NO_WOL_INTERFACES ((DWORD)26)
233 #define RCC_NO_MAC_ADDRESS ((DWORD)27)
234 #define RCC_NOT_IMPLEMENTED ((DWORD)28)
235
236
237 //
238 // Mask bits for NXCModifyEventTemplate()
239 //
240
241 #define EM_SEVERITY ((DWORD)0x01)
242 #define EM_FLAGS ((DWORD)0x02)
243 #define EM_NAME ((DWORD)0x04)
244 #define EM_MESSAGE ((DWORD)0x08)
245 #define EM_DESCRIPTION ((DWORD)0x10)
246 #define EM_ALL ((DWORD)0x1F)
247
248
249 //
250 // Mask bits (flags) for NXCModifyObject()
251 //
252
253 #define OBJ_UPDATE_NAME ((DWORD)0x0001)
254 #define OBJ_UPDATE_AGENT_PORT ((DWORD)0x0002)
255 #define OBJ_UPDATE_AGENT_AUTH ((DWORD)0x0004)
256 #define OBJ_UPDATE_AGENT_SECRET ((DWORD)0x0008)
257 #define OBJ_UPDATE_SNMP_VERSION ((DWORD)0x0010)
258 #define OBJ_UPDATE_SNMP_COMMUNITY ((DWORD)0x0020)
259 #define OBJ_UPDATE_ACL ((DWORD)0x0040)
260 #define OBJ_UPDATE_IMAGE ((DWORD)0x0080)
261 #define OBJ_UPDATE_DESCRIPTION ((DWORD)0x0100)
262 #define OBJ_UPDATE_ALL ((DWORD)0x01FF)
263
264
265 //
266 // Global user rights
267 //
268
269 #define SYSTEM_ACCESS_MANAGE_USERS 0x0001
270 #define SYSTEM_ACCESS_VIEW_CONFIG 0x0002
271 #define SYSTEM_ACCESS_EDIT_CONFIG 0x0004
272 #define SYSTEM_ACCESS_DROP_CONNECTIONS 0x0008
273 #define SYSTEM_ACCESS_VIEW_EVENT_DB 0x0010
274 #define SYSTEM_ACCESS_EDIT_EVENT_DB 0x0020
275 #define SYSTEM_ACCESS_EPP 0x0040
276 #define SYSTEM_ACCESS_MANAGE_ACTIONS 0x0080
277 #define SYSTEM_ACCESS_CONFIGURE_TRAPS 0x0100
278
279 #define SYSTEM_ACCESS_FULL 0x01FF
280
281
282 //
283 // Object access rights
284 //
285
286 #define OBJECT_ACCESS_READ 0x00000001
287 #define OBJECT_ACCESS_MODIFY 0x00000002
288 #define OBJECT_ACCESS_CREATE 0x00000004
289 #define OBJECT_ACCESS_DELETE 0x00000008
290 #define OBJECT_ACCESS_READ_ALARMS 0x00000010
291 #define OBJECT_ACCESS_CONTROL 0x00000020
292 #define OBJECT_ACCESS_ACK_ALARMS 0x00000040
293 #define OBJECT_ACCESS_SEND_EVENTS 0x00000080
294
295
296 //
297 // User/group flags
298 //
299
300 #define UF_MODIFIED 0x0001
301 #define UF_DELETED 0x0002
302 #define UF_DISABLED 0x0004
303 #define UF_CHANGE_PASSWORD 0x0008
304 #define UF_CANNOT_CHANGE_PASSWORD 0x0010
305
306
307 //
308 // User database change notification types
309 //
310
311 #define USER_DB_CREATE 0
312 #define USER_DB_DELETE 1
313 #define USER_DB_MODIFY 2
314
315
316 //
317 // Data types
318 //
319
320 #define DCI_DT_INT 0
321 #define DCI_DT_UINT 1
322 #define DCI_DT_INT64 2
323 #define DCI_DT_UINT64 3
324 #define DCI_DT_STRING 4
325 #define DCI_DT_FLOAT 5
326
327
328 //
329 // Data sources
330 //
331
332 #define DS_INTERNAL 0
333 #define DS_NATIVE_AGENT 1
334 #define DS_SNMP_AGENT 2
335
336
337 //
338 // Item status
339 //
340
341 #define ITEM_STATUS_ACTIVE 0
342 #define ITEM_STATUS_DISABLED 1
343 #define ITEM_STATUS_NOT_SUPPORTED 2
344
345
346 //
347 // Delta calculation methods for DCIs
348 //
349
350 #define DCM_ORIGINAL_VALUE 0
351 #define DCM_SIMPLE 1
352 #define DCM_AVERAGE_PER_SECOND 2
353 #define DCM_AVERAGE_PER_MINUTE 3
354
355
356 //
357 // Threshold functions and operations
358 //
359
360 #define F_LAST 0
361 #define F_AVERAGE 1
362 #define F_DEVIATION 2
363
364 #define OP_LE 0
365 #define OP_LE_EQ 1
366 #define OP_EQ 2
367 #define OP_GT_EQ 3
368 #define OP_GT 4
369 #define OP_NE 5
370 #define OP_LIKE 6
371 #define OP_NOTLIKE 7
372
373
374 //
375 // Event policy rule flags
376 //
377
378 #define RF_STOP_PROCESSING 0x0001
379 #define RF_NEGATED_SOURCE 0x0002
380 #define RF_NEGATED_EVENTS 0x0004
381 #define RF_GENERATE_ALARM 0x0008
382 #define RF_DISABLED 0x0010
383 #define RF_SEVERITY_INFO 0x0100
384 #define RF_SEVERITY_WARNING 0x0200
385 #define RF_SEVERITY_MINOR 0x0400
386 #define RF_SEVERITY_MAJOR 0x0800
387 #define RF_SEVERITY_CRITICAL 0x1000
388
389
390 //
391 // Action types
392 //
393
394 #define ACTION_EXEC 0
395 #define ACTION_REMOTE 1
396 #define ACTION_SEND_EMAIL 2
397 #define ACTION_SEND_SMS 3
398
399
400 //
401 // Action structure
402 //
403
404 typedef struct
405 {
406 DWORD dwId;
407 int iType;
408 BOOL bIsDisabled;
409 TCHAR szName[MAX_OBJECT_NAME];
410 TCHAR szRcptAddr[MAX_RCPT_ADDR_LEN];
411 TCHAR szEmailSubject[MAX_EMAIL_SUBJECT_LEN];
412 TCHAR *pszData;
413 } NXC_ACTION;
414
415
416 //
417 // Alarm structure
418 //
419
420 typedef struct
421 {
422 DWORD dwAlarmId; // Unique alarm ID
423 DWORD dwTimeStamp; // Timestamp in time() format
424 DWORD dwSourceObject; // Source object ID
425 DWORD dwSourceEvent; // Originating event ID
426 TCHAR szMessage[MAX_DB_STRING];
427 TCHAR szKey[MAX_DB_STRING];
428 WORD wSeverity; // Alarm's severity
429 WORD wIsAck; // Non-zero if acknowleged
430 DWORD dwAckByUser; // Id of user who acknowleges this alarm (0 for system)
431 } NXC_ALARM;
432
433
434 //
435 // Event log record structure
436 //
437
438 typedef struct
439 {
440 DWORD dwTimeStamp;
441 DWORD dwEventId;
442 DWORD dwSourceId;
443 DWORD dwSeverity;
444 TCHAR szMessage[MAX_EVENT_MSG_LENGTH];
445 } NXC_EVENT;
446
447
448 //
449 // Image information
450 //
451
452 typedef struct
453 {
454 DWORD dwId;
455 TCHAR szName[MAX_OBJECT_NAME];
456 BYTE hash[MD5_DIGEST_SIZE];
457 } NXC_IMAGE;
458
459
460 //
461 // Image list
462 //
463
464 typedef struct
465 {
466 DWORD dwNumImages;
467 NXC_IMAGE *pImageList;
468 } NXC_IMAGE_LIST;
469
470
471 /********************************************************************
472 * Following part of this file shouldn't be included by server code *
473 ********************************************************************/
474
475 #ifndef LIBNXCL_NO_DECLARATIONS
476
477
478 //
479 // Callbacks data types
480 //
481
482 typedef void (* NXC_EVENT_HANDLER)(DWORD dwEvent, DWORD dwCode, void *pArg);
483 typedef void (* NXC_DEBUG_CALLBACK)(TCHAR *pMsg);
484
485
486 //
487 // Event configuration structure
488 //
489
490 typedef struct
491 {
492 DWORD dwCode;
493 DWORD dwSeverity;
494 DWORD dwFlags;
495 TCHAR szName[MAX_EVENT_NAME];
496 TCHAR *pszMessage;
497 TCHAR *pszDescription;
498 } NXC_EVENT_TEMPLATE;
499
500
501 //
502 // Entry in object's ACL
503 //
504
505 typedef struct
506 {
507 DWORD dwUserId;
508 DWORD dwAccessRights;
509 } NXC_ACL_ENTRY;
510
511
512 //
513 // Network object structure
514 //
515
516 typedef struct
517 {
518 DWORD dwId; // Unique object's identifier
519 int iClass; // Object's class
520 int iStatus; // Object's status
521 DWORD dwIpAddr; // IP address
522 TCHAR szName[MAX_OBJECT_NAME];
523 DWORD dwNumParents;
524 DWORD *pdwParentList;
525 DWORD dwNumChilds;
526 DWORD *pdwChildList;
527 BOOL bIsDeleted; // TRUE for deleted objects
528 BOOL bInheritRights;
529 DWORD dwAclSize;
530 NXC_ACL_ENTRY *pAccessList;
531 DWORD dwImage; // Image ID or IMG_DEFAULT for default image
532 union
533 {
534 struct
535 {
536 DWORD dwIpNetMask; // Ip netmask.
537 DWORD dwIfIndex; // Interface index.
538 DWORD dwIfType; // Interface type
539 BYTE bMacAddr[MAC_ADDR_LENGTH];
540 } iface;
541 struct
542 {
543 DWORD dwFlags;
544 DWORD dwDiscoveryFlags;
545 DWORD dwNodeType;
546 TCHAR szSharedSecret[MAX_SECRET_LENGTH];
547 TCHAR szCommunityString[MAX_COMMUNITY_LENGTH];
548 TCHAR szObjectId[MAX_OID_LENGTH];
549 WORD wAgentPort; // Listening TCP port for native agent
550 WORD wAuthMethod; // Native agent's authentication method
551 TCHAR *pszDescription;
552 WORD wSNMPVersion;
553 } node;
554 struct
555 {
556 DWORD dwIpNetMask;
557 } subnet;
558 struct
559 {
560 DWORD dwCategory;
561 TCHAR *pszDescription;
562 } container;
563 struct
564 {
565 DWORD dwVersion;
566 TCHAR *pszDescription;
567 } dct;
568 };
569 } NXC_OBJECT;
570
571
572 //
573 // Structure with data for NXCModifyObject
574 //
575
576 typedef struct
577 {
578 DWORD dwObjectId;
579 DWORD dwFlags;
580 TCHAR *pszName;
581 TCHAR *pszDescription;
582 int iAgentPort;
583 int iAuthType;
584 TCHAR *pszSecret;
585 TCHAR *pszCommunity;
586 BOOL bInheritRights;
587 DWORD dwImage;
588 DWORD dwAclSize;
589 NXC_ACL_ENTRY *pAccessList;
590 WORD wSNMPVersion;
591 } NXC_OBJECT_UPDATE;
592
593
594 //
595 // NetXMS user information structure
596 //
597
598 typedef struct
599 {
600 TCHAR szName[MAX_USER_NAME];
601 DWORD dwId;
602 WORD wFlags;
603 WORD wSystemRights;
604 DWORD dwNumMembers; // Only for groups
605 DWORD *pdwMemberList; // Only for groups
606 TCHAR szFullName[MAX_USER_FULLNAME]; // Only for users
607 TCHAR szDescription[MAX_USER_DESCR];
608 } NXC_USER;
609
610
611 //
612 // Data collection item threshold structure
613 //
614
615 typedef struct
616 {
617 DWORD dwId;
618 DWORD dwEvent;
619 WORD wFunction;
620 WORD wOperation;
621 DWORD dwArg1;
622 DWORD dwArg2;
623 union
624 {
625 DWORD dwInt32;
626 INT64 qwInt64;
627 double dFloat;
628 TCHAR szString[MAX_STRING_VALUE];
629 } value;
630 } NXC_DCI_THRESHOLD;
631
632
633 //
634 // Data collection item structure
635 //
636
637 typedef struct
638 {
639 DWORD dwId;
640 DWORD dwTemplateId;
641 TCHAR szName[MAX_ITEM_NAME];
642 TCHAR szDescription[MAX_DB_STRING];
643 TCHAR szInstance[MAX_DB_STRING];
644 int iPollingInterval;
645 int iRetentionTime;
646 BYTE iSource;
647 BYTE iDataType;
648 BYTE iStatus;
649 BYTE iDeltaCalculation;
650 DWORD dwNumThresholds;
651 NXC_DCI_THRESHOLD *pThresholdList;
652 TCHAR *pszFormula;
653 } NXC_DCI;
654
655
656 //
657 // Node's data collection list information
658 //
659
660 typedef struct
661 {
662 DWORD dwNodeId;
663 DWORD dwNumItems;
664 NXC_DCI *pItems;
665 } NXC_DCI_LIST;
666
667
668 //
669 // Row structure
670 //
671
672 #pragma pack(1)
673
674 typedef struct
675 {
676 DWORD dwTimeStamp;
677 union
678 {
679 DWORD dwInt32;
680 INT64 qwInt64;
681 double dFloat;
682 TCHAR szString[MAX_STRING_VALUE];
683 } value;
684 } NXC_DCI_ROW;
685
686 #pragma pack()
687
688
689 //
690 // DCI's collected data
691 //
692
693 typedef struct
694 {
695 DWORD dwNodeId; // Owner's node id
696 DWORD dwItemId; // Item id
697 DWORD dwNumRows; // Number of rows in set
698 WORD wDataType; // Data type (integer, string, etc.)
699 WORD wRowSize; // Size of single row in bytes
700 NXC_DCI_ROW *pRows; // Array of rows
701 } NXC_DCI_DATA;
702
703
704 //
705 // MIB file list
706 //
707
708 typedef struct
709 {
710 DWORD dwNumFiles;
711 TCHAR **ppszName;
712 BYTE **ppHash;
713 } NXC_MIB_LIST;
714
715
716 //
717 // Event processing policy rule
718 //
719
720 typedef struct
721 {
722 DWORD dwFlags;
723 DWORD dwId;
724 DWORD dwNumActions;
725 DWORD dwNumEvents;
726 DWORD dwNumSources;
727 DWORD *pdwActionList;
728 DWORD *pdwEventList;
729 DWORD *pdwSourceList;
730 TCHAR *pszComment;
731 TCHAR szAlarmKey[MAX_DB_STRING];
732 TCHAR szAlarmAckKey[MAX_DB_STRING];
733 TCHAR szAlarmMessage[MAX_DB_STRING];
734 WORD wAlarmSeverity;
735 } NXC_EPP_RULE;
736
737
738 //
739 // Event processing policy
740 //
741
742 typedef struct
743 {
744 DWORD dwNumRules;
745 NXC_EPP_RULE *pRuleList;
746 } NXC_EPP;
747
748
749 //
750 // Object creation information structure
751 //
752
753 typedef struct
754 {
755 int iClass;
756 DWORD dwParentId;
757 TCHAR *pszName;
758 union
759 {
760 struct
761 {
762 DWORD dwIpAddr;
763 DWORD dwNetMask;
764 } node;
765 struct
766 {
767 DWORD dwCategory;
768 TCHAR *pszDescription;
769 } container;
770 struct
771 {
772 TCHAR *pszDescription;
773 } templateGroup;
774 } cs;
775 } NXC_OBJECT_CREATE_INFO;
776
777
778 //
779 // Container category
780 //
781
782 typedef struct
783 {
784 DWORD dwId;
785 DWORD dwImageId;
786 TCHAR szName[MAX_OBJECT_NAME];
787 TCHAR *pszDescription;
788 } NXC_CONTAINER_CATEGORY;
789
790
791 //
792 // Container categories list
793 //
794
795 typedef struct
796 {
797 DWORD dwNumElements;
798 NXC_CONTAINER_CATEGORY *pElements;
799 } NXC_CC_LIST;
800
801
802 //
803 // Functions
804 //
805
806 #ifdef __cplusplus
807 extern "C" {
808 #endif
809
810 DWORD LIBNXCL_EXPORTABLE NXCGetVersion(void);
811 const TCHAR LIBNXCL_EXPORTABLE *NXCGetErrorText(DWORD dwError);
812
813 BOOL LIBNXCL_EXPORTABLE NXCInitialize(void);
814 void LIBNXCL_EXPORTABLE NXCShutdown(void);
815 void LIBNXCL_EXPORTABLE NXCSetCommandTimeout(DWORD dwTimeout);
816
817 DWORD LIBNXCL_EXPORTABLE NXCConnect(TCHAR *szServer, TCHAR *szLogin, TCHAR *szPassword);
818 void LIBNXCL_EXPORTABLE NXCDisconnect(void);
819 void LIBNXCL_EXPORTABLE NXCSetEventHandler(NXC_EVENT_HANDLER pHandler);
820 void LIBNXCL_EXPORTABLE NXCSetDebugCallback(NXC_DEBUG_CALLBACK pFunc);
821 HREQUEST LIBNXCL_EXPORTABLE NXCRequest(DWORD dwOperation, ...);
822
823 DWORD LIBNXCL_EXPORTABLE NXCSyncObjects(void);
824 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectById(DWORD dwId);
825 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByName(TCHAR *pszName);
826 void LIBNXCL_EXPORTABLE NXCEnumerateObjects(BOOL (* pHandler)(NXC_OBJECT *));
827 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTopologyRootObject(void);
828 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetServiceRootObject(void);
829 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTemplateRootObject(void);
830 void LIBNXCL_EXPORTABLE *NXCGetObjectIndex(DWORD *pdwNumObjects);
831 void LIBNXCL_EXPORTABLE NXCLockObjectIndex(void);
832 void LIBNXCL_EXPORTABLE NXCUnlockObjectIndex(void);
833 DWORD LIBNXCL_EXPORTABLE NXCModifyObject(NXC_OBJECT_UPDATE *pData);
834 DWORD LIBNXCL_EXPORTABLE NXCSetObjectMgmtStatus(DWORD dwObjectId, BOOL bIsManaged);
835 DWORD LIBNXCL_EXPORTABLE NXCCreateObject(NXC_OBJECT_CREATE_INFO *pCreateInfo, DWORD *pdwObjectId);
836 DWORD LIBNXCL_EXPORTABLE NXCBindObject(DWORD dwParentObject, DWORD dwChildObject);
837 DWORD LIBNXCL_EXPORTABLE NXCUnbindObject(DWORD dwParentObject, DWORD dwChildObject);
838 DWORD LIBNXCL_EXPORTABLE NXCDeleteObject(DWORD dwObject);
839 DWORD LIBNXCL_EXPORTABLE NXCPollNode(DWORD dwObjectId, int iPollType,
840 void (* pCallback)(TCHAR *, void *), void *pArg);
841 DWORD LIBNXCL_EXPORTABLE NXCWakeUpNode(DWORD dwObjectId);
842
843 DWORD LIBNXCL_EXPORTABLE NXCLoadCCList(NXC_CC_LIST **ppList);
844 void LIBNXCL_EXPORTABLE NXCDestroyCCList(NXC_CC_LIST *pList);
845
846 DWORD LIBNXCL_EXPORTABLE NXCSyncEvents(void);
847 DWORD LIBNXCL_EXPORTABLE NXCLoadEventDB(void);
848 DWORD LIBNXCL_EXPORTABLE NXCSetEventInfo(NXC_EVENT_TEMPLATE *pArg);
849 DWORD LIBNXCL_EXPORTABLE NXCGenerateEventId(DWORD *pdwEventId);
850 void LIBNXCL_EXPORTABLE NXCAddEventTemplate(NXC_EVENT_TEMPLATE *pEventTemplate);
851 void LIBNXCL_EXPORTABLE NXCDeleteEDBRecord(DWORD dwEventId);
852 DWORD LIBNXCL_EXPORTABLE NXCDeleteEventTemplate(DWORD dwEventId);
853 DWORD LIBNXCL_EXPORTABLE NXCLockEventDB(void);
854 DWORD LIBNXCL_EXPORTABLE NXCUnlockEventDB(void);
855 BOOL LIBNXCL_EXPORTABLE NXCGetEventDB(NXC_EVENT_TEMPLATE ***pppTemplateList, DWORD *pdwNumRecords);
856 const TCHAR LIBNXCL_EXPORTABLE *NXCGetEventName(DWORD dwId);
857 int LIBNXCL_EXPORTABLE NXCGetEventSeverity(DWORD dwId);
858 DWORD LIBNXCL_EXPORTABLE NXCSendEvent(DWORD dwEventCode, DWORD dwObjectId, int iNumArgs, TCHAR **pArgList);
859
860 DWORD LIBNXCL_EXPORTABLE NXCLoadUserDB(void);
861 NXC_USER LIBNXCL_EXPORTABLE *NXCFindUserById(DWORD dwId);
862 BOOL LIBNXCL_EXPORTABLE NXCGetUserDB(NXC_USER **ppUserList, DWORD *pdwNumUsers);
863 DWORD LIBNXCL_EXPORTABLE NXCLockUserDB(void);
864 DWORD LIBNXCL_EXPORTABLE NXCUnlockUserDB(void);
865 DWORD LIBNXCL_EXPORTABLE NXCCreateUser(TCHAR *pszName, BOOL bIsGroup, DWORD *pdwNewId);
866 DWORD LIBNXCL_EXPORTABLE NXCDeleteUser(DWORD dwId);
867 DWORD LIBNXCL_EXPORTABLE NXCModifyUser(NXC_USER *pUserInfo);
868 DWORD LIBNXCL_EXPORTABLE NXCSetPassword(DWORD dwUserId, TCHAR *pszNewPassword);
869
870 DWORD LIBNXCL_EXPORTABLE NXCOpenNodeDCIList(DWORD dwNodeId, NXC_DCI_LIST **ppItemList);
871 DWORD LIBNXCL_EXPORTABLE NXCCloseNodeDCIList(NXC_DCI_LIST *pItemList);
872 DWORD LIBNXCL_EXPORTABLE NXCCreateNewDCI(NXC_DCI_LIST *pItemList, DWORD *pdwItemId);
873 DWORD LIBNXCL_EXPORTABLE NXCUpdateDCI(DWORD dwNodeId, NXC_DCI *pItem);
874 DWORD LIBNXCL_EXPORTABLE NXCDeleteDCI(NXC_DCI_LIST *pItemList, DWORD dwItemId);
875 DWORD LIBNXCL_EXPORTABLE NXCCopyDCI(DWORD dwSrcNodeId, DWORD dwDstNodeId,
876 DWORD dwNumItems, DWORD *pdwItemList);
877 DWORD LIBNXCL_EXPORTABLE NXCItemIndex(NXC_DCI_LIST *pItemList, DWORD dwItemId);
878 DWORD LIBNXCL_EXPORTABLE NXCGetDCIData(DWORD dwNodeId, DWORD dwItemId, DWORD dwMaxRows,
879 DWORD dwTimeFrom, DWORD dwTimeTo, NXC_DCI_DATA **ppData);
880 void LIBNXCL_EXPORTABLE NXCDestroyDCIData(NXC_DCI_DATA *pData);
881 NXC_DCI_ROW LIBNXCL_EXPORTABLE *NXCGetRowPtr(NXC_DCI_DATA *pData, DWORD dwRow);
882 DWORD LIBNXCL_EXPORTABLE NXCAddThresholdToItem(NXC_DCI *pItem, NXC_DCI_THRESHOLD *pThreshold);
883 BOOL LIBNXCL_EXPORTABLE NXCDeleteThresholdFromItem(NXC_DCI *pItem, DWORD dwIndex);
884 BOOL LIBNXCL_EXPORTABLE NXCSwapThresholds(NXC_DCI *pItem, DWORD dwIndex1, DWORD dwIndex2);
885
886 DWORD LIBNXCL_EXPORTABLE NXCGetMIBList(NXC_MIB_LIST **ppMibList);
887 void LIBNXCL_EXPORTABLE NXCDestroyMIBList(NXC_MIB_LIST *pMibList);
888 DWORD LIBNXCL_EXPORTABLE NXCDownloadMIBFile(TCHAR *pszName, TCHAR *pszDestDir);
889
890 DWORD LIBNXCL_EXPORTABLE NXCOpenEventPolicy(NXC_EPP **ppEventPolicy);
891 DWORD LIBNXCL_EXPORTABLE NXCCloseEventPolicy(void);
892 DWORD LIBNXCL_EXPORTABLE NXCSaveEventPolicy(NXC_EPP *pEventPolicy);
893 void LIBNXCL_EXPORTABLE NXCDestroyEventPolicy(NXC_EPP *pEventPolicy);
894 void LIBNXCL_EXPORTABLE NXCDeletePolicyRule(NXC_EPP *pEventPolicy, DWORD dwRule);
895
896 DWORD LIBNXCL_EXPORTABLE NXCSyncImages(NXC_IMAGE_LIST **ppImageList, TCHAR *pszCacheDir, WORD wFormat);
897 DWORD LIBNXCL_EXPORTABLE NXCLoadImageFile(DWORD dwImageId, TCHAR *pszCacheDir, WORD wFormat);
898 void LIBNXCL_EXPORTABLE NXCDestroyImageList(NXC_IMAGE_LIST *pImageList);
899 DWORD LIBNXCL_EXPORTABLE NXCLoadDefaultImageList(DWORD *pdwListSize,
900 DWORD **ppdwClassId, DWORD **ppdwImageId);
901
902 DWORD LIBNXCL_EXPORTABLE NXCLoadAllAlarms(BOOL bIncludeAck, DWORD *pdwNumAlarms, NXC_ALARM **ppAlarmList);
903 DWORD LIBNXCL_EXPORTABLE NXCAcknowlegeAlarm(DWORD dwAlarmId);
904 DWORD LIBNXCL_EXPORTABLE NXCDeleteAlarm(DWORD dwAlarmId);
905
906 DWORD LIBNXCL_EXPORTABLE NXCLoadActions(DWORD *pdwNumActions, NXC_ACTION **ppActionList);
907 DWORD LIBNXCL_EXPORTABLE NXCLockActionDB(void);
908 DWORD LIBNXCL_EXPORTABLE NXCUnlockActionDB(void);
909 DWORD LIBNXCL_EXPORTABLE NXCCreateAction(TCHAR *pszName, DWORD *pdwNewId);
910 DWORD LIBNXCL_EXPORTABLE NXCModifyAction(NXC_ACTION *pAction);
911 DWORD LIBNXCL_EXPORTABLE NXCDeleteAction(DWORD dwActionId);
912
913 #ifdef __cplusplus
914 }
915 #endif
916
917 #endif /* LIBNXCL_NO_DECLARATIONS */
918
919 #endif /* _nxclapi_h_ */