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