Constant MAX_SECRET_LENGTH moved to nms_common.h from nms_agent.h [Victor]
[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
29
30 //
31 // Events
32 //
33
34 #define NXC_EVENT_STATE_CHANGED 1
35 #define NXC_EVENT_ERROR 2
36 #define NXC_EVENT_LOGIN_RESULT 3
37
38
39 //
40 // Errors
41 //
42
43 #define NXC_ERR_INTERNAL 1
44
45
46 //
47 // States
48 //
49
50 #define STATE_DISCONNECTED 0
51 #define STATE_CONNECTING 1
52 #define STATE_IDLE 2
53 #define STATE_SYNC_OBJECTS 3
54 #define STATE_SYNC_EVENTS 4
55
56
57 //
58 // Operations
59 //
60
61 #define NXC_OP_SYNC_OBJECTS 1
62
63
64 //
65 // Event handler data type
66 //
67
68 typedef void (* NXC_EVENT_HANDLER)(DWORD dwEvent, DWORD dwCode, void *pArg);
69 typedef void (* NXC_DEBUG_CALLBACK)(char *pMsg);
70
71
72 //
73 // Functions
74 //
75
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79
80 DWORD EXPORTABLE NXCGetVersion(void);
81 BOOL EXPORTABLE NXCInitialize(void);
82 BOOL EXPORTABLE NXCConnect(char *szServer, char *szLogin, char *szPassword);
83 void EXPORTABLE NXCDisconnect(void);
84 void EXPORTABLE NXCSetEventHandler(NXC_EVENT_HANDLER pHandler);
85 void EXPORTABLE NXCSetDebugCallback(NXC_DEBUG_CALLBACK pFunc);
86 int EXPORTABLE NXCRequest(DWORD dwOperation, ...);
87 int EXPORTABLE NXCSyncRequest(DWORD dwOperation, ...);
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93
94 //
95 // Macros
96 //
97
98 #define NXCSyncObjects() NXCRequest(NXC_OP_SYNC_OBJECTS)
99
100
101 #endif /* _nxclapi_h_ */