a8773dc23163a5a9e5f3e1abf8aa5bfdcd1882a3
[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
232
233 //
234 // Mask bits for NXCModifyEventTemplate()
235 //
236
237 #define EM_SEVERITY ((DWORD)0x01)
238 #define EM_FLAGS ((DWORD)0x02)
239 #define EM_NAME ((DWORD)0x04)
240 #define EM_MESSAGE ((DWORD)0x08)
241 #define EM_DESCRIPTION ((DWORD)0x10)
242 #define EM_ALL ((DWORD)0x1F)
243
244
245 //
246 // Mask bits (flags) for NXCModifyObject()
247 //
248
249 #define OBJ_UPDATE_NAME ((DWORD)0x01)
250 #define OBJ_UPDATE_AGENT_PORT ((DWORD)0x02)
251 #define OBJ_UPDATE_AGENT_AUTH ((DWORD)0x04)
252 #define OBJ_UPDATE_AGENT_SECRET ((DWORD)0x08)
253 #define OBJ_UPDATE_SNMP_VERSION ((DWORD)0x10)
254 #define OBJ_UPDATE_SNMP_COMMUNITY ((DWORD)0x20)
255 #define OBJ_UPDATE_ACL ((DWORD)0x40)
256 #define OBJ_UPDATE_IMAGE ((DWORD)0x80)
257 #define OBJ_UPDATE_ALL ((DWORD)0xFF)
258
259
260 //
261 // Global user rights
262 //
263
264 #define SYSTEM_ACCESS_MANAGE_USERS 0x0001
265 #define SYSTEM_ACCESS_VIEW_CONFIG 0x0002
266 #define SYSTEM_ACCESS_EDIT_CONFIG 0x0004
267 #define SYSTEM_ACCESS_DROP_CONNECTIONS 0x0008
268 #define SYSTEM_ACCESS_VIEW_EVENT_DB 0x0010
269 #define SYSTEM_ACCESS_EDIT_EVENT_DB 0x0020
270 #define SYSTEM_ACCESS_EPP 0x0040
271 #define SYSTEM_ACCESS_MANAGE_ACTIONS 0x0080
272
273 #define SYSTEM_ACCESS_FULL 0x00FF
274
275
276 //
277 // Object access rights
278 //
279
280 #define OBJECT_ACCESS_READ 0x00000001
281 #define OBJECT_ACCESS_MODIFY 0x00000002
282 #define OBJECT_ACCESS_CREATE 0x00000004
283 #define OBJECT_ACCESS_DELETE 0x00000008
284 #define OBJECT_ACCESS_READ_ALARMS 0x00000010
285 #define OBJECT_ACCESS_CONTROL 0x00000020
286 #define OBJECT_ACCESS_ACK_ALARMS 0x00000040
287
288
289 //
290 // User/group flags
291 //
292
293 #define UF_MODIFIED 0x0001
294 #define UF_DELETED 0x0002
295 #define UF_DISABLED 0x0004
296 #define UF_CHANGE_PASSWORD 0x0008
297 #define UF_CANNOT_CHANGE_PASSWORD 0x0010
298
299
300 //
301 // User database change notification types
302 //
303
304 #define USER_DB_CREATE 0
305 #define USER_DB_DELETE 1
306 #define USER_DB_MODIFY 2
307
308
309 //
310 // Data types
311 //
312
313 #define DCI_DT_INT 0
314 #define DCI_DT_UINT 1
315 #define DCI_DT_INT64 2
316 #define DCI_DT_UINT64 3
317 #define DCI_DT_STRING 4
318 #define DCI_DT_FLOAT 5
319
320
321 //
322 // Data sources
323 //
324
325 #define DS_INTERNAL 0
326 #define DS_NATIVE_AGENT 1
327 #define DS_SNMP_AGENT 2
328
329
330 //
331 // Item status
332 //
333
334 #define ITEM_STATUS_ACTIVE 0
335 #define ITEM_STATUS_DISABLED 1
336 #define ITEM_STATUS_NOT_SUPPORTED 2
337
338
339 //
340 // Delta calculation methods for DCIs
341 //
342
343 #define DCM_ORIGINAL_VALUE 0
344 #define DCM_SIMPLE 1
345 #define DCM_AVERAGE_PER_SECOND 2
346 #define DCM_AVERAGE_PER_MINUTE 3
347
348
349 //
350 // Threshold functions and operations
351 //
352
353 #define F_LAST 0
354 #define F_AVERAGE 1
355 #define F_DEVIATION 2
356
357 #define OP_LE 0
358 #define OP_LE_EQ 1
359 #define OP_EQ 2
360 #define OP_GT_EQ 3
361 #define OP_GT 4
362 #define OP_NE 5
363 #define OP_LIKE 6
364 #define OP_NOTLIKE 7
365
366
367 //
368 // Event policy rule flags
369 //
370
371 #define RF_STOP_PROCESSING 0x0001
372 #define RF_NEGATED_SOURCE 0x0002
373 #define RF_NEGATED_EVENTS 0x0004
374 #define RF_GENERATE_ALARM 0x0008
375 #define RF_DISABLED 0x0010
376 #define RF_SEVERITY_INFO 0x0100
377 #define RF_SEVERITY_WARNING 0x0200
378 #define RF_SEVERITY_MINOR 0x0400
379 #define RF_SEVERITY_MAJOR 0x0800
380 #define RF_SEVERITY_CRITICAL 0x1000
381
382
383 //
384 // Action types
385 //
386
387 #define ACTION_EXEC 0
388 #define ACTION_REMOTE 1
389 #define ACTION_SEND_EMAIL 2
390 #define ACTION_SEND_SMS 3
391
392
393 //
394 // Action structure
395 //
396
397 typedef struct
398 {
399 DWORD dwId;
400 int iType;
401 BOOL bIsDisabled;
402 TCHAR szName[MAX_OBJECT_NAME];
403 TCHAR szRcptAddr[MAX_RCPT_ADDR_LEN];
404 TCHAR szEmailSubject[MAX_EMAIL_SUBJECT_LEN];
405 TCHAR *pszData;
406 } NXC_ACTION;
407
408
409 //
410 // Alarm structure
411 //
412
413 typedef struct
414 {
415 DWORD dwAlarmId; // Unique alarm ID
416 DWORD dwTimeStamp; // Timestamp in time() format
417 DWORD dwSourceObject; // Source object ID
418 DWORD dwSourceEvent; // Originating event ID
419 TCHAR szMessage[MAX_DB_STRING];
420 TCHAR szKey[MAX_DB_STRING];
421 WORD wSeverity; // Alarm's severity
422 WORD wIsAck; // Non-zero if acknowleged
423 DWORD dwAckByUser; // Id of user who acknowleges this alarm (0 for system)
424 } NXC_ALARM;
425
426
427 //
428 // Event log record structure
429 //
430
431 typedef struct
432 {
433 DWORD dwTimeStamp;
434 DWORD dwEventId;
435 DWORD dwSourceId;
436 DWORD dwSeverity;
437 TCHAR szMessage[MAX_EVENT_MSG_LENGTH];
438 } NXC_EVENT;
439
440
441 //
442 // Event name/code pair
443 //
444
445 typedef struct
446 {
447 DWORD dwEventId;
448 DWORD dwSeverity;
449 TCHAR szName[MAX_EVENT_NAME];
450 } NXC_EVENT_NAME;
451
452
453 //
454 // Image information
455 //
456
457 typedef struct
458 {
459 DWORD dwId;
460 TCHAR szName[MAX_OBJECT_NAME];
461 BYTE hash[MD5_DIGEST_SIZE];
462 } NXC_IMAGE;
463
464
465 //
466 // Image list
467 //
468
469 typedef struct
470 {
471 DWORD dwNumImages;
472 NXC_IMAGE *pImageList;
473 } NXC_IMAGE_LIST;
474
475
476 /********************************************************************
477 * Following part of this file shouldn't be included by server code *
478 ********************************************************************/
479
480 #ifndef LIBNXCL_NO_DECLARATIONS
481
482
483 //
484 // Callbacks data types
485 //
486
487 typedef void (* NXC_EVENT_HANDLER)(DWORD dwEvent, DWORD dwCode, void *pArg);
488 typedef void (* NXC_DEBUG_CALLBACK)(TCHAR *pMsg);
489
490
491 //
492 // Event configuration structure
493 //
494
495 typedef struct
496 {
497 DWORD dwCode;
498 DWORD dwSeverity;
499 DWORD dwFlags;
500 TCHAR szName[MAX_EVENT_NAME];
501 TCHAR *pszMessage;
502 TCHAR *pszDescription;
503 } NXC_EVENT_TEMPLATE;
504
505
506 //
507 // Entry in object's ACL
508 //
509
510 typedef struct
511 {
512 DWORD dwUserId;
513 DWORD dwAccessRights;
514 } NXC_ACL_ENTRY;
515
516
517 //
518 // Network object structure
519 //
520
521 typedef struct
522 {
523 DWORD dwId; // Unique object's identifier
524 int iClass; // Object's class
525 int iStatus; // Object's status
526 DWORD dwIpAddr; // IP address
527 TCHAR szName[MAX_OBJECT_NAME];
528 DWORD dwNumParents;
529 DWORD *pdwParentList;
530 DWORD dwNumChilds;
531 DWORD *pdwChildList;
532 BOOL bIsDeleted; // TRUE for deleted objects
533 BOOL bInheritRights;
534 DWORD dwAclSize;
535 NXC_ACL_ENTRY *pAccessList;
536 DWORD dwImage; // Image ID or IMG_DEFAULT for default image
537 union
538 {
539 struct
540 {
541 DWORD dwIpNetMask; // Ip netmask.
542 DWORD dwIfIndex; // Interface index.
543 DWORD dwIfType; // Interface type
544 BYTE bMacAddr[MAC_ADDR_LENGTH];
545 } iface;
546 struct
547 {
548 DWORD dwFlags;
549 DWORD dwDiscoveryFlags;
550 TCHAR szSharedSecret[MAX_SECRET_LENGTH];
551 TCHAR szCommunityString[MAX_COMMUNITY_LENGTH];
552 TCHAR szObjectId[MAX_OID_LENGTH];
553 WORD wAgentPort; // Listening TCP port for native agent
554 WORD wAuthMethod; // Native agent's authentication method
555 } node;
556 struct
557 {
558 DWORD dwIpNetMask;
559 } subnet;
560 struct
561 {
562 DWORD dwCategory;
563 TCHAR *pszDescription;
564 } container;
565 };
566 } NXC_OBJECT;
567
568
569 //
570 // Structure with data for NXCModifyObject
571 //
572
573 typedef struct
574 {
575 DWORD dwObjectId;
576 DWORD dwFlags;
577 TCHAR *pszName;
578 int iAgentPort;
579 int iAuthType;
580 TCHAR *pszSecret;
581 int iSnmpVersion;
582 TCHAR *pszCommunity;
583 BOOL bInheritRights;
584 DWORD dwImage;
585 DWORD dwAclSize;
586 NXC_ACL_ENTRY *pAccessList;
587 } NXC_OBJECT_UPDATE;
588
589
590 //
591 // NetXMS user information structure
592 //
593
594 typedef struct
595 {
596 TCHAR szName[MAX_USER_NAME];
597 DWORD dwId;
598 WORD wFlags;
599 WORD wSystemRights;
600 DWORD dwNumMembers; // Only for groups
601 DWORD *pdwMemberList; // Only for groups
602 TCHAR szFullName[MAX_USER_FULLNAME]; // Only for users
603 TCHAR szDescription[MAX_USER_DESCR];
604 } NXC_USER;
605
606
607 //
608 // Data collection item threshold structure
609 //
610
611 typedef struct
612 {
613 DWORD dwId;
614 DWORD dwEvent;
615 WORD wFunction;
616 WORD wOperation;
617 DWORD dwArg1;
618 DWORD dwArg2;
619 union
620 {
621 DWORD dwInt32;
622 INT64 qwInt64;
623 double dFloat;
624 TCHAR szString[MAX_STRING_VALUE];
625 } value;
626 } NXC_DCI_THRESHOLD;
627
628
629 //
630 // Data collection item structure
631 //
632
633 typedef struct
634 {
635 DWORD dwId;
636 DWORD dwTemplateId;
637 TCHAR szName[MAX_ITEM_NAME];
638 TCHAR szDescription[MAX_DB_STRING];
639 int iPollingInterval;
640 int iRetentionTime;
641 BYTE iSource;
642 BYTE iDataType;
643 BYTE iStatus;
644 BYTE iDeltaCalculation;
645 DWORD dwNumThresholds;
646 NXC_DCI_THRESHOLD *pThresholdList;
647 TCHAR *pszFormula;
648 } NXC_DCI;
649
650
651 //
652 // Node's data collection list information
653 //
654
655 typedef struct
656 {
657 DWORD dwNodeId;
658 DWORD dwNumItems;
659 NXC_DCI *pItems;
660 } NXC_DCI_LIST;
661
662
663 //
664 // Row structure
665 //
666
667 #pragma pack(1)
668
669 typedef struct
670 {
671 DWORD dwTimeStamp;
672 union
673 {
674 DWORD dwInt32;
675 INT64 qwInt64;
676 double dFloat;
677 TCHAR szString[MAX_STRING_VALUE];
678 } value;
679 } NXC_DCI_ROW;
680
681 #pragma pack()
682
683
684 //
685 // DCI's collected data
686 //
687
688 typedef struct
689 {
690 DWORD dwNodeId; // Owner's node id
691 DWORD dwItemId; // Item id
692 DWORD dwNumRows; // Number of rows in set
693 WORD wDataType; // Data type (integer, string, etc.)
694 WORD wRowSize; // Size of single row in bytes
695 NXC_DCI_ROW *pRows; // Array of rows
696 } NXC_DCI_DATA;
697
698
699 //
700 // MIB file list
701 //
702
703 typedef struct
704 {
705 DWORD dwNumFiles;
706 TCHAR **ppszName;
707 BYTE **ppHash;
708 } NXC_MIB_LIST;
709
710
711 //
712 // Event processing policy rule
713 //
714
715 typedef struct
716 {
717 DWORD dwFlags;
718 DWORD dwId;
719 DWORD dwNumActions;
720 DWORD dwNumEvents;
721 DWORD dwNumSources;
722 DWORD *pdwActionList;
723 DWORD *pdwEventList;
724 DWORD *pdwSourceList;
725 TCHAR *pszComment;
726 TCHAR szAlarmKey[MAX_DB_STRING];
727 TCHAR szAlarmAckKey[MAX_DB_STRING];
728 TCHAR szAlarmMessage[MAX_DB_STRING];
729 WORD wAlarmSeverity;
730 } NXC_EPP_RULE;
731
732
733 //
734 // Event processing policy
735 //
736
737 typedef struct
738 {
739 DWORD dwNumRules;
740 NXC_EPP_RULE *pRuleList;
741 } NXC_EPP;
742
743
744 //
745 // Object creation information structure
746 //
747
748 typedef struct
749 {
750 int iClass;
751 DWORD dwParentId;
752 TCHAR *pszName;
753 union
754 {
755 struct
756 {
757 DWORD dwIpAddr;
758 DWORD dwNetMask;
759 } node;
760 struct
761 {
762 DWORD dwCategory;
763 TCHAR *pszDescription;
764 } container;
765 struct
766 {
767 TCHAR *pszDescription;
768 } templateGroup;
769 } cs;
770 } NXC_OBJECT_CREATE_INFO;
771
772
773 //
774 // Container category
775 //
776
777 typedef struct
778 {
779 DWORD dwId;
780 DWORD dwImageId;
781 TCHAR szName[MAX_OBJECT_NAME];
782 TCHAR *pszDescription;
783 } NXC_CONTAINER_CATEGORY;
784
785
786 //
787 // Container categories list
788 //
789
790 typedef struct
791 {
792 DWORD dwNumElements;
793 NXC_CONTAINER_CATEGORY *pElements;
794 } NXC_CC_LIST;
795
796
797 //
798 // Functions
799 //
800
801 #ifdef __cplusplus
802 extern "C" {
803 #endif
804
805 DWORD LIBNXCL_EXPORTABLE NXCGetVersion(void);
806 const TCHAR LIBNXCL_EXPORTABLE *NXCGetErrorText(DWORD dwError);
807
808 BOOL LIBNXCL_EXPORTABLE NXCInitialize(void);
809 void LIBNXCL_EXPORTABLE NXCShutdown(void);
810
811 DWORD LIBNXCL_EXPORTABLE NXCConnect(TCHAR *szServer, TCHAR *szLogin, TCHAR *szPassword);
812 void LIBNXCL_EXPORTABLE NXCDisconnect(void);
813 void LIBNXCL_EXPORTABLE NXCSetEventHandler(NXC_EVENT_HANDLER pHandler);
814 void LIBNXCL_EXPORTABLE NXCSetDebugCallback(NXC_DEBUG_CALLBACK pFunc);
815 HREQUEST LIBNXCL_EXPORTABLE NXCRequest(DWORD dwOperation, ...);
816
817 DWORD LIBNXCL_EXPORTABLE NXCSyncObjects(void);
818 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectById(DWORD dwId);
819 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCFindObjectByName(TCHAR *pszName);
820 void LIBNXCL_EXPORTABLE NXCEnumerateObjects(BOOL (* pHandler)(NXC_OBJECT *));
821 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTopologyRootObject(void);
822 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetServiceRootObject(void);
823 NXC_OBJECT LIBNXCL_EXPORTABLE *NXCGetTemplateRootObject(void);
824 void LIBNXCL_EXPORTABLE *NXCGetObjectIndex(DWORD *pdwNumObjects);
825 void LIBNXCL_EXPORTABLE NXCLockObjectIndex(void);
826 void LIBNXCL_EXPORTABLE NXCUnlockObjectIndex(void);
827 DWORD LIBNXCL_EXPORTABLE NXCModifyObject(NXC_OBJECT_UPDATE *pData);
828 DWORD LIBNXCL_EXPORTABLE NXCSetObjectMgmtStatus(DWORD dwObjectId, BOOL bIsManaged);
829 DWORD LIBNXCL_EXPORTABLE NXCCreateObject(NXC_OBJECT_CREATE_INFO *pCreateInfo, DWORD *pdwObjectId);
830 DWORD LIBNXCL_EXPORTABLE NXCBindObject(DWORD dwParentObject, DWORD dwChildObject);
831 DWORD LIBNXCL_EXPORTABLE NXCUnbindObject(DWORD dwParentObject, DWORD dwChildObject);
832 DWORD LIBNXCL_EXPORTABLE NXCDeleteObject(DWORD dwObject);
833 DWORD LIBNXCL_EXPORTABLE NXCPollNode(DWORD dwObjectId, int iPollType,
834 void (* pCallback)(TCHAR *, void *), void *pArg);
835
836 DWORD LIBNXCL_EXPORTABLE NXCLoadCCList(NXC_CC_LIST **ppList);
837 void LIBNXCL_EXPORTABLE NXCDestroyCCList(NXC_CC_LIST *pList);
838
839 DWORD LIBNXCL_EXPORTABLE NXCSyncEvents(void);
840 DWORD LIBNXCL_EXPORTABLE NXCOpenEventDB(void);
841 DWORD LIBNXCL_EXPORTABLE NXCCloseEventDB(BOOL bSaveChanges);
842 BOOL LIBNXCL_EXPORTABLE NXCGetEventDB(NXC_EVENT_TEMPLATE ***pppTemplateList, DWORD *pdwNumRecords);
843 void LIBNXCL_EXPORTABLE NXCModifyEventTemplate(NXC_EVENT_TEMPLATE *pEvent, DWORD dwMask,
844 DWORD dwSeverity, DWORD dwFlags, const TCHAR *pszName,
845 const TCHAR *pszMessage, const TCHAR *pszDescription);
846 DWORD LIBNXCL_EXPORTABLE NXCLoadEventNames(void);
847 NXC_EVENT_NAME LIBNXCL_EXPORTABLE *NXCGetEventNamesList(DWORD *pdwNumEvents);
848 const TCHAR LIBNXCL_EXPORTABLE *NXCGetEventName(DWORD dwId);
849 int LIBNXCL_EXPORTABLE NXCGetEventSeverity(DWORD dwId);
850
851 DWORD LIBNXCL_EXPORTABLE NXCLoadUserDB(void);
852 NXC_USER LIBNXCL_EXPORTABLE *NXCFindUserById(DWORD dwId);
853 BOOL LIBNXCL_EXPORTABLE NXCGetUserDB(NXC_USER **ppUserList, DWORD *pdwNumUsers);
854 DWORD LIBNXCL_EXPORTABLE NXCLockUserDB(void);
855 DWORD LIBNXCL_EXPORTABLE NXCUnlockUserDB(void);
856 DWORD LIBNXCL_EXPORTABLE NXCCreateUser(TCHAR *pszName, BOOL bIsGroup, DWORD *pdwNewId);
857 DWORD LIBNXCL_EXPORTABLE NXCDeleteUser(DWORD dwId);
858 DWORD LIBNXCL_EXPORTABLE NXCModifyUser(NXC_USER *pUserInfo);
859 DWORD LIBNXCL_EXPORTABLE NXCSetPassword(DWORD dwUserId, TCHAR *pszNewPassword);
860
861 DWORD LIBNXCL_EXPORTABLE NXCOpenNodeDCIList(DWORD dwNodeId, NXC_DCI_LIST **ppItemList);
862 DWORD LIBNXCL_EXPORTABLE NXCCloseNodeDCIList(NXC_DCI_LIST *pItemList);
863 DWORD LIBNXCL_EXPORTABLE NXCCreateNewDCI(NXC_DCI_LIST *pItemList, DWORD *pdwItemId);
864 DWORD LIBNXCL_EXPORTABLE NXCUpdateDCI(DWORD dwNodeId, NXC_DCI *pItem);
865 DWORD LIBNXCL_EXPORTABLE NXCDeleteDCI(NXC_DCI_LIST *pItemList, DWORD dwItemId);
866 DWORD LIBNXCL_EXPORTABLE NXCCopyDCI(DWORD dwSrcNodeId, DWORD dwDstNodeId,
867 DWORD dwNumItems, DWORD *pdwItemList);
868 DWORD LIBNXCL_EXPORTABLE NXCItemIndex(NXC_DCI_LIST *pItemList, DWORD dwItemId);
869 DWORD LIBNXCL_EXPORTABLE NXCGetDCIData(DWORD dwNodeId, DWORD dwItemId, DWORD dwMaxRows,
870 DWORD dwTimeFrom, DWORD dwTimeTo, NXC_DCI_DATA **ppData);
871 void LIBNXCL_EXPORTABLE NXCDestroyDCIData(NXC_DCI_DATA *pData);
872 NXC_DCI_ROW LIBNXCL_EXPORTABLE *NXCGetRowPtr(NXC_DCI_DATA *pData, DWORD dwRow);
873 DWORD LIBNXCL_EXPORTABLE NXCAddThresholdToItem(NXC_DCI *pItem, NXC_DCI_THRESHOLD *pThreshold);
874 BOOL LIBNXCL_EXPORTABLE NXCDeleteThresholdFromItem(NXC_DCI *pItem, DWORD dwIndex);
875 BOOL LIBNXCL_EXPORTABLE NXCSwapThresholds(NXC_DCI *pItem, DWORD dwIndex1, DWORD dwIndex2);
876
877 DWORD LIBNXCL_EXPORTABLE NXCGetMIBList(NXC_MIB_LIST **ppMibList);
878 void LIBNXCL_EXPORTABLE NXCDestroyMIBList(NXC_MIB_LIST *pMibList);
879 DWORD LIBNXCL_EXPORTABLE NXCDownloadMIBFile(TCHAR *pszName, TCHAR *pszDestDir);
880
881 DWORD LIBNXCL_EXPORTABLE NXCOpenEventPolicy(NXC_EPP **ppEventPolicy);
882 DWORD LIBNXCL_EXPORTABLE NXCCloseEventPolicy(void);
883 DWORD LIBNXCL_EXPORTABLE NXCSaveEventPolicy(NXC_EPP *pEventPolicy);
884 void LIBNXCL_EXPORTABLE NXCDestroyEventPolicy(NXC_EPP *pEventPolicy);
885 void LIBNXCL_EXPORTABLE NXCDeletePolicyRule(NXC_EPP *pEventPolicy, DWORD dwRule);
886
887 DWORD LIBNXCL_EXPORTABLE NXCSyncImages(NXC_IMAGE_LIST **ppImageList, TCHAR *pszCacheDir, WORD wFormat);
888 DWORD LIBNXCL_EXPORTABLE NXCLoadImageFile(DWORD dwImageId, TCHAR *pszCacheDir, WORD wFormat);
889 void LIBNXCL_EXPORTABLE NXCDestroyImageList(NXC_IMAGE_LIST *pImageList);
890 DWORD LIBNXCL_EXPORTABLE NXCLoadDefaultImageList(DWORD *pdwListSize,
891 DWORD **ppdwClassId, DWORD **ppdwImageId);
892
893 DWORD LIBNXCL_EXPORTABLE NXCLoadAllAlarms(BOOL bIncludeAck, DWORD *pdwNumAlarms, NXC_ALARM **ppAlarmList);
894 DWORD LIBNXCL_EXPORTABLE NXCAcknowlegeAlarm(DWORD dwAlarmId);
895 DWORD LIBNXCL_EXPORTABLE NXCDeleteAlarm(DWORD dwAlarmId);
896
897 DWORD LIBNXCL_EXPORTABLE NXCLoadActions(DWORD *pdwNumActions, NXC_ACTION **ppActionList);
898 DWORD LIBNXCL_EXPORTABLE NXCLockActionDB(void);
899 DWORD LIBNXCL_EXPORTABLE NXCUnlockActionDB(void);
900 DWORD LIBNXCL_EXPORTABLE NXCCreateAction(TCHAR *pszName, DWORD *pdwNewId);
901 DWORD LIBNXCL_EXPORTABLE NXCModifyAction(NXC_ACTION *pAction);
902 DWORD LIBNXCL_EXPORTABLE NXCDeleteAction(DWORD dwActionId);
903
904 #ifdef __cplusplus
905 }
906 #endif
907
908 #endif /* LIBNXCL_NO_DECLARATIONS */
909
910 #endif /* _nxclapi_h_ */