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