All messages with codes 0x1100 - 0x11ff now forwarded to Reporting Server
[public/netxms.git] / src / server / include / nms_core.h
CommitLineData
5039dede
AK
1/*
2** NetXMS - Network Management System
6adc4a1a 3** Copyright (C) 2003-2012 Victor Kirhenshtein
5039dede
AK
4**
5** This program is free software; you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation; either version 2 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program; if not, write to the Free Software
17** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18**
19** File: nms_core.h
20**
21**/
22
23#ifndef _nms_core_h_
24#define _nms_core_h_
25
26#ifdef _WIN32
27#ifdef NXCORE_EXPORTS
28#define NXCORE_EXPORTABLE __declspec(dllexport)
29#else
30#define NXCORE_EXPORTABLE __declspec(dllimport)
31#endif
32#else /* _WIN32 */
33#define NXCORE_EXPORTABLE
34#endif
35
36#define LIBNXCL_NO_DECLARATIONS 1
37
38#include <nms_common.h>
39
40#ifndef _WIN32
41
42#if HAVE_SYS_TYPES_H
43# include <sys/types.h>
44#endif
45
46#if HAVE_DLFCN_H
47#include <dlfcn.h>
48#endif
49
50#define WSAGetLastError() (errno)
51
52#endif /* _WIN32 */
53
54#include <time.h>
55#include <stdio.h>
56#include <string.h>
57#include <stdarg.h>
58
59#define SHOW_FLAG_VALUE(x) _T(" %-32s = %d\n"), _T(#x), (g_dwFlags & x) ? 1 : 0
60
61
62//
63// Common includes
64//
65
66#include <nms_util.h>
67#include <dbdrv.h>
68#include <nms_cscp.h>
69#include <uuid.h>
70#include <nxsrvapi.h>
5039dede
AK
71#include <nxqueue.h>
72#include <nxsnmp.h>
73#include <nxmodule.h>
74#include <nxsl.h>
9d88cdc9 75#include <nxdbapi.h>
9796ce45 76#include <nddrv.h>
d41edbd3 77#include <nxcore_smclp.h>
5039dede 78
46ee6286
VK
79/**
80 * Console context
81 */
5039dede
AK
82struct __console_ctx
83{
84 SOCKET hSocket;
d3a7cf4c 85 MUTEX socketMutex;
5039dede 86 CSCPMessage *pMsg;
200d662d 87 ClientSession *session;
5039dede
AK
88};
89
90typedef __console_ctx * CONSOLE_CTX;
91
2bac37f9
VK
92/**
93 * Server includes
94 */
5039dede
AK
95#include "nms_dcoll.h"
96#include "nms_users.h"
46ee6286 97#include "nxcore_winperf.h"
5039dede 98#include "nms_objects.h"
5039dede
AK
99#include "nms_locks.h"
100#include "nms_pkg.h"
101#include "nms_topo.h"
102#include "nms_script.h"
5039dede 103#include "nxcore_situations.h"
ab621f39 104#include "nxcore_jobs.h"
e05b1945 105#include "nxcore_logs.h"
5039dede 106
2bac37f9
VK
107/**
108 * Common constants and macros
109 */
73869331
VK
110#define MAX_LINE_SIZE 4096
111#define GROUP_FLAG_BIT ((DWORD)0x80000000)
112#define CHECKPOINT_SNMP_PORT 260
113#define DEFAULT_AFFINITY_MASK 0xFFFFFFFF
5039dede
AK
114
115typedef void * HSNMPSESSION;
116
0f506caa
VK
117/**
118 * Prefixes for poller messages
119 */
df8a4ca2
VK
120#define POLLER_ERROR _T("\x7F") _T("e")
121#define POLLER_WARNING _T("\x7Fw")
122#define POLLER_INFO _T("\x7Fi")
123
0f506caa
VK
124/**
125 * Unique identifier group codes
126 */
5039dede
AK
127#define IDG_NETWORK_OBJECT 0
128#define IDG_CONTAINER_CAT 1
129#define IDG_EVENT 2
130#define IDG_ITEM 3
131#define IDG_SNMP_TRAP 4
24dc5346 132#define IDG_JOB 5
5039dede
AK
133#define IDG_ACTION 6
134#define IDG_EVENT_GROUP 7
135#define IDG_THRESHOLD 8
136#define IDG_USER 9
137#define IDG_USER_GROUP 10
138#define IDG_ALARM 11
139#define IDG_ALARM_NOTE 12
140#define IDG_PACKAGE 13
636e0c72 141#define IDG_SLM_TICKET 14
5039dede
AK
142#define IDG_OBJECT_TOOL 15
143#define IDG_SCRIPT 16
144#define IDG_AGENT_CONFIG 17
145#define IDG_GRAPH 18
146#define IDG_CERTIFICATE 19
147#define IDG_SITUATION 20
ba89fed2 148#define IDG_DCT_COLUMN 21
0f506caa 149#define IDG_MAPPING_TABLE 22
b4c2a628 150#define IDG_DCI_SUMMARY_TABLE 23
5039dede 151
0f506caa
VK
152/**
153 * Exit codes for console commands
154 */
5039dede
AK
155#define CMD_EXIT_CONTINUE 0
156#define CMD_EXIT_CLOSE_SESSION 1
157#define CMD_EXIT_SHUTDOWN 2
158
0f506caa
VK
159/**
160 * Network discovery mode
161 */
5039dede
AK
162#define DISCOVERY_DISABLED 0
163#define DISCOVERY_PASSIVE_ONLY 1
164#define DISCOVERY_ACTIVE 2
165
0f506caa
VK
166/**
167 * Client session flags
168 */
5039dede
AK
169#define CSF_EPP_LOCKED ((DWORD)0x0002)
170#define CSF_PACKAGE_DB_LOCKED ((DWORD)0x0004)
171#define CSF_USER_DB_LOCKED ((DWORD)0x0008)
172#define CSF_EPP_UPLOAD ((DWORD)0x0010)
200d662d 173#define CSF_CONSOLE_OPEN ((DWORD)0x0020)
5039dede 174#define CSF_AUTHENTICATED ((DWORD)0x0080)
5039dede
AK
175#define CSF_RECEIVING_MAP_DATA ((DWORD)0x0200)
176#define CSF_SYNC_OBJECT_COMMENTS ((DWORD)0x0400)
177
0f506caa
VK
178/**
179 * Client session states
180 */
5039dede
AK
181#define SESSION_STATE_INIT 0
182#define SESSION_STATE_IDLE 1
183#define SESSION_STATE_PROCESSING 2
184
0f506caa
VK
185/**
186 * Information categories for UPDATE_INFO structure
187 */
5039dede
AK
188#define INFO_CAT_EVENT 1
189#define INFO_CAT_OBJECT_CHANGE 2
190#define INFO_CAT_ALARM 3
191#define INFO_CAT_ACTION 4
192#define INFO_CAT_SYSLOG_MSG 5
193#define INFO_CAT_SNMP_TRAP 6
194#define INFO_CAT_AUDIT_RECORD 7
195#define INFO_CAT_SITUATION 8
624f1165 196#define INFO_CAT_LIBRARY_IMAGE 9
5039dede 197
0f506caa
VK
198/**
199 * Certificate types
200 */
5039dede
AK
201#define CERT_TYPE_TRUSTED_CA 0
202#define CERT_TYPE_USER 1
203
0f506caa
VK
204/**
205 * Audit subsystems
206 */
5039dede
AK
207#define AUDIT_SECURITY _T("SECURITY")
208#define AUDIT_OBJECTS _T("OBJECTS")
209#define AUDIT_SYSCFG _T("SYSCFG")
210#define AUDIT_CONSOLE _T("CONSOLE")
211
0f506caa
VK
212/**
213 * Event handling subsystem definitions
214 */
5039dede
AK
215#include "nms_events.h"
216#include "nms_actions.h"
217#include "nms_alarm.h"
218
0f506caa
VK
219/**
220 * New node information
221 */
5039dede
AK
222typedef struct
223{
224 DWORD dwIpAddr;
225 DWORD dwNetMask;
dc25b21c 226 DWORD zoneId;
5039dede 227 BOOL ignoreFilter;
baa5324c 228 BYTE bMacAddr[MAC_ADDR_LENGTH];
5039dede
AK
229} NEW_NODE;
230
0f506caa
VK
231/**
232 * New node flags
233 */
5039dede
AK
234#define NNF_IS_SNMP 0x0001
235#define NNF_IS_AGENT 0x0002
236#define NNF_IS_ROUTER 0x0004
237#define NNF_IS_BRIDGE 0x0008
238#define NNF_IS_PRINTER 0x0010
239#define NNF_IS_CDP 0x0020
240#define NNF_IS_SONMP 0x0040
241#define NNF_IS_LLDP 0x0080
242
0f506caa
VK
243/**
244 * Node information for autodiscovery filter
245 */
5039dede
AK
246typedef struct
247{
248 DWORD dwIpAddr;
249 DWORD dwNetMask;
250 DWORD dwSubnetAddr;
251 DWORD dwFlags;
252 int nSNMPVersion;
35f836fe
VK
253 TCHAR szObjectId[MAX_OID_LEN * 4]; // SNMP OID
254 TCHAR szAgentVersion[MAX_AGENT_VERSION_LEN];
255 TCHAR szPlatform[MAX_PLATFORM_NAME_LEN];
5039dede
AK
256} DISCOVERY_FILTER_DATA;
257
0f506caa
VK
258/**
259 * Data update structure for client sessions
260 */
5039dede
AK
261typedef struct
262{
263 DWORD dwCategory; // Data category - event, network object, etc.
264 DWORD dwCode; // Data-specific update code
265 void *pData; // Pointer to data block
266} UPDATE_INFO;
267
72f6ece2 268
534e1b83
VK
269/**
270 * Extended agent connection
271 */
5039dede
AK
272class AgentConnectionEx : public AgentConnection
273{
274protected:
d1c1c522
VK
275 DWORD m_nodeId;
276
f480bdd4
VK
277 virtual void onTrap(CSCPMessage *msg);
278 virtual void onDataPush(CSCPMessage *msg);
5039dede
AK
279
280public:
d1c1c522 281 AgentConnectionEx(DWORD nodeId, DWORD ipAddr, WORD wPort = AGENT_LISTEN_PORT,
5039dede 282 int iAuthMethod = AUTH_NONE, TCHAR *pszSecret = NULL) :
d1c1c522 283 AgentConnection(ipAddr, wPort, iAuthMethod, pszSecret) { m_nodeId = nodeId; }
5039dede 284 virtual ~AgentConnectionEx();
45d84f8a
VK
285
286 DWORD deployPolicy(AgentPolicy *policy);
93599cfd 287 DWORD uninstallPolicy(AgentPolicy *policy);
5039dede
AK
288};
289
534e1b83
VK
290/**
291 * Mobile device session
292 */
293class NXCORE_EXPORTABLE MobileDeviceSession
294{
295private:
296 SOCKET m_hSocket;
297 Queue *m_pSendQueue;
298 Queue *m_pMessageQueue;
299 DWORD m_dwIndex;
300 int m_iState;
301 WORD m_wCurrentCmd;
302 DWORD m_dwUserId;
303 DWORD m_deviceObjectId;
304 CSCP_BUFFER *m_pMsgBuffer;
305 NXCPEncryptionContext *m_pCtx;
306 BYTE m_challenge[CLIENT_CHALLENGE_SIZE];
307 THREAD m_hWriteThread;
308 THREAD m_hProcessingThread;
309 MUTEX m_mutexSocketWrite;
310 struct sockaddr *m_clientAddr;
311 TCHAR m_szHostName[256]; // IP address of name of conneced host in textual form
312 TCHAR m_szUserName[MAX_SESSION_NAME]; // String in form login_name@host
313 TCHAR m_szClientInfo[96]; // Client app info string
314 DWORD m_dwEncryptionRqId;
315 DWORD m_dwEncryptionResult;
316 CONDITION m_condEncryptionSetup;
317 DWORD m_dwRefCount;
318 bool m_isAuthenticated;
319
320 static THREAD_RESULT THREAD_CALL readThreadStarter(void *);
321 static THREAD_RESULT THREAD_CALL writeThreadStarter(void *);
322 static THREAD_RESULT THREAD_CALL processingThreadStarter(void *);
5039dede 323
534e1b83
VK
324 void readThread();
325 void writeThread();
326 void processingThread();
327
328 void setupEncryption(CSCPMessage *request);
329 void respondToKeepalive(DWORD dwRqId);
330 void debugPrintf(int level, const TCHAR *format, ...);
331 void sendServerInfo(DWORD dwRqId);
332 void login(CSCPMessage *pRequest);
333 void updateDeviceInfo(CSCPMessage *pRequest);
334 void updateDeviceStatus(CSCPMessage *pRequest);
335
336public:
337 MobileDeviceSession(SOCKET hSocket, struct sockaddr *addr);
338 ~MobileDeviceSession();
339
340 void incRefCount() { m_dwRefCount++; }
341 void decRefCount() { if (m_dwRefCount > 0) m_dwRefCount--; }
342
343 void run();
344
345 void postMessage(CSCPMessage *pMsg) { m_pSendQueue->Put(pMsg->CreateMessage()); }
346 void sendMessage(CSCPMessage *pMsg);
5039dede 347
534e1b83
VK
348 DWORD getIndex() { return m_dwIndex; }
349 void setIndex(DWORD dwIndex) { if (m_dwIndex == INVALID_INDEX) m_dwIndex = dwIndex; }
350 int getState() { return m_iState; }
351 const TCHAR *getUserName() { return m_szUserName; }
352 const TCHAR *getClientInfo() { return m_szClientInfo; }
353 const TCHAR *getHostName() { return m_szHostName; }
354 DWORD getUserId() { return m_dwUserId; }
355 bool isAuthenticated() { return m_isAuthenticated; }
356 WORD getCurrentCmd() { return m_wCurrentCmd; }
357 int getCipher() { return (m_pCtx == NULL) ? -1 : m_pCtx->getCipher(); }
358};
359
360/**
361 * Client (user) session
362 */
5039dede
AK
363#define DECLARE_THREAD_STARTER(func) static THREAD_RESULT THREAD_CALL ThreadStarter_##func(void *);
364
a0e3917e 365class NXCORE_EXPORTABLE ClientSession
5039dede
AK
366{
367private:
368 SOCKET m_hSocket;
369 Queue *m_pSendQueue;
370 Queue *m_pMessageQueue;
371 Queue *m_pUpdateQueue;
372 DWORD m_dwIndex;
373 int m_iState;
374 WORD m_wCurrentCmd;
375 DWORD m_dwUserId;
376 DWORD m_dwSystemAccess; // User's system access rights
377 DWORD m_dwFlags; // Session flags
f8c6f10f 378 int m_clientType; // Client system type - desktop, web, mobile, etc.
5039dede 379 CSCP_BUFFER *m_pMsgBuffer;
98abc9f1 380 NXCPEncryptionContext *m_pCtx;
5039dede
AK
381 BYTE m_challenge[CLIENT_CHALLENGE_SIZE];
382 THREAD m_hWriteThread;
383 THREAD m_hProcessingThread;
384 THREAD m_hUpdateThread;
d3a7cf4c 385 MUTEX m_mutexSocketWrite;
5039dede
AK
386 MUTEX m_mutexSendEvents;
387 MUTEX m_mutexSendSyslog;
388 MUTEX m_mutexSendTrapLog;
389 MUTEX m_mutexSendObjects;
390 MUTEX m_mutexSendAlarms;
391 MUTEX m_mutexSendActions;
392 MUTEX m_mutexSendAuditLog;
393 MUTEX m_mutexSendSituations;
394 MUTEX m_mutexPollerInit;
60557d06
VK
395 struct sockaddr *m_clientAddr;
396 TCHAR m_szWorkstation[256]; // IP address of name of conneced host in textual form
5039dede
AK
397 TCHAR m_szUserName[MAX_SESSION_NAME]; // String in form login_name@host
398 TCHAR m_szClientInfo[96]; // Client app info string
399 DWORD m_dwOpenDCIListSize; // Number of open DCI lists
400 DWORD *m_pOpenDCIList; // List of nodes with DCI lists open
401 DWORD m_dwNumRecordsToUpload; // Number of records to be uploaded
402 DWORD m_dwRecordsUploaded;
403 EPRule **m_ppEPPRuleList; // List of loaded EPP rules
404 int m_hCurrFile;
405 DWORD m_dwFileRqId;
406 DWORD m_dwUploadCommand;
407 DWORD m_dwUploadData;
e928a6db 408 uuid_t m_uploadImageGuid;
5039dede
AK
409 TCHAR m_szCurrFileName[MAX_PATH];
410 DWORD m_dwRefCount;
411 DWORD m_dwEncryptionRqId;
412 DWORD m_dwEncryptionResult;
413 CONDITION m_condEncryptionSetup;
414 DWORD m_dwActiveChannels; // Active data channels
200d662d 415 CONSOLE_CTX m_console; // Server console context
5039dede 416
534e1b83
VK
417 static THREAD_RESULT THREAD_CALL readThreadStarter(void *);
418 static THREAD_RESULT THREAD_CALL writeThreadStarter(void *);
419 static THREAD_RESULT THREAD_CALL processingThreadStarter(void *);
420 static THREAD_RESULT THREAD_CALL updateThreadStarter(void *);
421 static THREAD_RESULT THREAD_CALL pollerThreadStarter(void *);
5039dede 422
92c51b1d
VK
423 DECLARE_THREAD_STARTER(getCollectedData)
424 DECLARE_THREAD_STARTER(getTableCollectedData)
425 DECLARE_THREAD_STARTER(clearDCIData)
adac28be
VK
426 DECLARE_THREAD_STARTER(queryParameter)
427 DECLARE_THREAD_STARTER(queryAgentTable)
84880c89 428 DECLARE_THREAD_STARTER(queryL2Topology)
b1e9b6b3
VK
429 DECLARE_THREAD_STARTER(sendEventLog)
430 DECLARE_THREAD_STARTER(sendSyslog)
1da08bc6
VK
431 DECLARE_THREAD_STARTER(createObject)
432 DECLARE_THREAD_STARTER(getServerFile)
6f16f12d 433 DECLARE_THREAD_STARTER(getAgentFile)
e05b1945
VK
434 DECLARE_THREAD_STARTER(queryServerLog)
435 DECLARE_THREAD_STARTER(getServerLogQueryData)
e31c8e60 436 DECLARE_THREAD_STARTER(executeAction)
630e15d6 437 DECLARE_THREAD_STARTER(findNodeConnection)
06a93345 438 DECLARE_THREAD_STARTER(findMacAddress)
80e0db05 439 DECLARE_THREAD_STARTER(findIpAddress)
200d662d 440 DECLARE_THREAD_STARTER(processConsoleCommand)
b08d31f4 441 DECLARE_THREAD_STARTER(sendMib)
e12e1422 442 DECLARE_THREAD_STARTER(getReportResults)
3932fde6 443 DECLARE_THREAD_STARTER(deleteReportResults)
e12e1422 444 DECLARE_THREAD_STARTER(renderReport)
6d069676 445 DECLARE_THREAD_STARTER(getNetworkPath)
2bac37f9 446 DECLARE_THREAD_STARTER(getAlarmEvents)
d75003e1 447 DECLARE_THREAD_STARTER(forwardToReportingServer)
5039dede 448
62768df3
VK
449 void readThread();
450 void writeThread();
451 void processingThread();
452 void updateThread();
453 void pollerThread(Node *pNode, int iPollType, DWORD dwRqId);
5039dede 454
9e9d631e 455 void setupEncryption(CSCPMessage *request);
711e5e9a 456 void respondToKeepalive(DWORD dwRqId);
e05b1945 457 void onFileUpload(BOOL bSuccess);
534e1b83 458 void debugPrintf(int level, const TCHAR *format, ...);
711e5e9a
VK
459 void sendServerInfo(DWORD dwRqId);
460 void login(CSCPMessage *pRequest);
62768df3
VK
461 void sendAllObjects(CSCPMessage *pRequest);
462 void sendSelectedObjects(CSCPMessage *pRequest);
b1e9b6b3
VK
463 void sendEventLog(CSCPMessage *pRequest);
464 void sendAllConfigVars(DWORD dwRqId);
465 void setConfigVariable(CSCPMessage *pRequest);
466 void deleteConfigVariable(CSCPMessage *pRequest);
467 void sendUserDB(DWORD dwRqId);
1add6d73 468 void sendAllAlarms(DWORD dwRqId);
b1e9b6b3
VK
469 void createUser(CSCPMessage *pRequest);
470 void updateUser(CSCPMessage *pRequest);
471 void deleteUser(CSCPMessage *pRequest);
472 void setPassword(CSCPMessage *pRequest);
473 void lockUserDB(DWORD dwRqId, BOOL bLock);
8eb2d92b
VK
474 void sendEventDB(DWORD dwRqId);
475 void modifyEventTemplate(CSCPMessage *pRequest);
476 void deleteEventTemplate(CSCPMessage *pRequest);
477 void generateEventCode(DWORD dwRqId);
92c51b1d 478 void modifyObject(CSCPMessage *pRequest);
1da08bc6 479 void changeObjectMgmtStatus(CSCPMessage *pRequest);
92c51b1d
VK
480 void openNodeDCIList(CSCPMessage *pRequest);
481 void closeNodeDCIList(CSCPMessage *pRequest);
482 void modifyNodeDCI(CSCPMessage *pRequest);
483 void copyDCI(CSCPMessage *pRequest);
484 void applyTemplate(CSCPMessage *pRequest);
485 void getCollectedData(CSCPMessage *pRequest);
486 void getTableCollectedData(CSCPMessage *pRequest);
6fd6de0a 487 bool getCollectedDataFromDB(CSCPMessage *request, CSCPMessage *response, DataCollectionTarget *object, int dciType);
92c51b1d
VK
488 void clearDCIData(CSCPMessage *pRequest);
489 void changeDCIStatus(CSCPMessage *pRequest);
b9a8e081
VK
490 void getLastValues(CSCPMessage *pRequest);
491 void getTableLastValues(CSCPMessage *pRequest);
711e5e9a 492 void getThresholdSummary(CSCPMessage *request);
92c51b1d
VK
493 void openEPP(DWORD dwRqId);
494 void closeEPP(DWORD dwRqId);
495 void saveEPP(CSCPMessage *pRequest);
496 void processEPPRecord(CSCPMessage *pRequest);
497 void sendMIBTimestamp(DWORD dwRqId);
b08d31f4 498 void sendMib(CSCPMessage *request);
b1e9b6b3
VK
499 void createObject(CSCPMessage *request);
500 void changeObjectBinding(CSCPMessage *request, BOOL bBind);
501 void deleteObject(CSCPMessage *request);
502 void getAlarm(CSCPMessage *request);
503 void getAlarmEvents(CSCPMessage *request);
504 void acknowledgeAlarm(CSCPMessage *request);
505 void resolveAlarm(CSCPMessage *request, bool terminate);
506 void deleteAlarm(CSCPMessage *request);
1b94acbf
VK
507 void getAlarmNotes(CSCPMessage *pRequest);
508 void updateAlarmNote(CSCPMessage *pRequest);
509 void createAction(CSCPMessage *pRequest);
510 void updateAction(CSCPMessage *pRequest);
511 void deleteAction(CSCPMessage *pRequest);
512 void sendAllActions(DWORD dwRqId);
5039dede 513 void SendContainerCategories(DWORD dwRqId);
92c51b1d 514 void forcedNodePoll(CSCPMessage *pRequest);
b1e9b6b3
VK
515 void onTrap(CSCPMessage *pRequest);
516 void onWakeUpNode(CSCPMessage *pRequest);
adac28be
VK
517 void queryParameter(CSCPMessage *pRequest);
518 void queryAgentTable(CSCPMessage *pRequest);
fdbee7f8 519 void editTrap(int iOperation, CSCPMessage *pRequest);
5039dede 520 void LockTrapCfg(DWORD dwRqId, BOOL bLock);
fdbee7f8
VK
521 void sendAllTraps(DWORD dwRqId);
522 void sendAllTraps2(DWORD dwRqId);
5039dede
AK
523 void LockPackageDB(DWORD dwRqId, BOOL bLock);
524 void SendAllPackages(DWORD dwRqId);
525 void InstallPackage(CSCPMessage *pRequest);
526 void RemovePackage(CSCPMessage *pRequest);
527 void DeployPackage(CSCPMessage *pRequest);
074498ac 528 void getParametersList(CSCPMessage *pRequest);
fdbee7f8
VK
529 void getUserVariable(CSCPMessage *pRequest);
530 void setUserVariable(CSCPMessage *pRequest);
531 void copyUserVariable(CSCPMessage *pRequest);
532 void enumUserVariables(CSCPMessage *pRequest);
533 void deleteUserVariable(CSCPMessage *pRequest);
4c789f9e 534 void changeObjectZone(CSCPMessage *pRequest);
92c51b1d
VK
535 void getAgentConfig(CSCPMessage *pRequest);
536 void updateAgentConfig(CSCPMessage *pRequest);
e31c8e60 537 void executeAction(CSCPMessage *pRequest);
0e950f45
VK
538 void sendObjectTools(DWORD dwRqId);
539 void sendObjectToolDetails(CSCPMessage *pRequest);
540 void updateObjectTool(CSCPMessage *pRequest);
541 void deleteObjectTool(CSCPMessage *pRequest);
542 void generateObjectToolId(DWORD dwRqId);
543 void execTableTool(CSCPMessage *pRequest);
b1e9b6b3
VK
544 void changeSubscription(CSCPMessage *pRequest);
545 void sendSyslog(CSCPMessage *pRequest);
546 void sendServerStats(DWORD dwRqId);
0c7aca90
VK
547 void sendScriptList(DWORD dwRqId);
548 void sendScript(CSCPMessage *pRequest);
549 void updateScript(CSCPMessage *pRequest);
550 void renameScript(CSCPMessage *pRequest);
551 void deleteScript(CSCPMessage *pRequest);
5039dede
AK
552 void SendSessionList(DWORD dwRqId);
553 void KillSession(CSCPMessage *pRequest);
554 void SendTrapLog(CSCPMessage *pRequest);
555 void StartSnmpWalk(CSCPMessage *pRequest);
241c2740
VK
556 void resolveDCINames(CSCPMessage *pRequest);
557 DWORD resolveDCIName(DWORD dwNode, DWORD dwItem, TCHAR **ppszName);
5039dede 558 void SendConfigForAgent(CSCPMessage *pRequest);
241c2740 559 void sendAgentCfgList(DWORD dwRqId);
5039dede
AK
560 void OpenAgentConfig(CSCPMessage *pRequest);
561 void SaveAgentConfig(CSCPMessage *pRequest);
562 void DeleteAgentConfig(CSCPMessage *pRequest);
563 void SwapAgentConfigs(CSCPMessage *pRequest);
564 void SendObjectComments(CSCPMessage *pRequest);
6fd6de0a
VK
565 void updateObjectComments(CSCPMessage *pRequest);
566 void pushDCIData(CSCPMessage *pRequest);
567 void getAddrList(CSCPMessage *pRequest);
568 void setAddrList(CSCPMessage *pRequest);
92c51b1d 569 void resetComponent(CSCPMessage *pRequest);
7a46028e 570 void sendDCIEventList(CSCPMessage *request);
5039dede 571 void SendDCIInfo(CSCPMessage *pRequest);
74526d25 572 void sendPerfTabDCIList(CSCPMessage *pRequest);
a7ff20a5
VK
573 void exportConfiguration(CSCPMessage *pRequest);
574 void importConfiguration(CSCPMessage *pRequest);
5039dede
AK
575 void SendGraphList(DWORD dwRqId);
576 void DefineGraph(CSCPMessage *pRequest);
577 void DeleteGraph(CSCPMessage *pRequest);
578 void AddCACertificate(CSCPMessage *pRequest);
579 void DeleteCertificate(CSCPMessage *pRequest);
580 void UpdateCertificateComments(CSCPMessage *pRequest);
d5de1d1d 581 void getCertificateList(DWORD dwRqId);
84880c89 582 void queryL2Topology(CSCPMessage *pRequest);
b1e9b6b3 583 void sendSMS(CSCPMessage *pRequest);
5039dede
AK
584 void SendCommunityList(DWORD dwRqId);
585 void UpdateCommunityList(CSCPMessage *pRequest);
586 void SendSituationList(DWORD dwRqId);
587 void CreateSituation(CSCPMessage *pRequest);
588 void UpdateSituation(CSCPMessage *pRequest);
589 void DeleteSituation(CSCPMessage *pRequest);
590 void DeleteSituationInstance(CSCPMessage *pRequest);
1da08bc6
VK
591 void setConfigCLOB(CSCPMessage *pRequest);
592 void getConfigCLOB(CSCPMessage *pRequest);
1da08bc6
VK
593 void registerAgent(CSCPMessage *pRequest);
594 void getServerFile(CSCPMessage *pRequest);
6f16f12d 595 void getAgentFile(CSCPMessage *pRequest);
1da08bc6 596 void testDCITransformation(CSCPMessage *pRequest);
45d84f8a
VK
597 void sendJobList(DWORD dwRqId);
598 void cancelJob(CSCPMessage *pRequest);
8d9f7450
VK
599 void holdJob(CSCPMessage *pRequest);
600 void unholdJob(CSCPMessage *pRequest);
93599cfd 601 void deployAgentPolicy(CSCPMessage *pRequest, bool uninstallFlag);
d83dc1f0
VK
602 void getUserCustomAttribute(CSCPMessage *request);
603 void setUserCustomAttribute(CSCPMessage *request);
e05b1945
VK
604 void openServerLog(CSCPMessage *request);
605 void closeServerLog(CSCPMessage *request);
606 void queryServerLog(CSCPMessage *request);
607 void getServerLogQueryData(CSCPMessage *request);
df8a4ca2
VK
608 void sendUsmCredentials(DWORD dwRqId);
609 void updateUsmCredentials(CSCPMessage *pRequest);
071fd171 610 void sendDCIThresholds(CSCPMessage *request);
1da08bc6 611 void addClusterNode(CSCPMessage *request);
630e15d6 612 void findNodeConnection(CSCPMessage *request);
06a93345 613 void findMacAddress(CSCPMessage *request);
80e0db05 614 void findIpAddress(CSCPMessage *request);
e6b9439a
AK
615 void sendLibraryImage(CSCPMessage *request);
616 void updateLibraryImage(CSCPMessage *request);
617 void listLibraryImages(CSCPMessage *request);
618 void deleteLibraryImage(CSCPMessage *request);
f69c6203 619 void executeServerCommand(CSCPMessage *request);
619e5c9b 620 void uploadFileToAgent(CSCPMessage *request);
1a5e0c22 621 void listServerFileStore(CSCPMessage *request);
200d662d
VK
622 void processConsoleCommand(CSCPMessage *msg);
623 void openConsole(DWORD rqId);
624 void closeConsole(DWORD rqId);
7f632dfe 625 void getVlans(CSCPMessage *msg);
68f898c9
VK
626 void receiveFile(CSCPMessage *request);
627 void deleteFile(CSCPMessage *request);
8c5b6ed3
VK
628 void executeReport(CSCPMessage *msg);
629 void getReportResults(CSCPMessage *msg);
3932fde6 630 void deleteReportResults(CSCPMessage *msg);
e12e1422 631 void renderReport(CSCPMessage *request);
6d069676 632 void getNetworkPath(CSCPMessage *request);
8836184f 633 void getNodeComponents(CSCPMessage *request);
caa04e26 634 void getNodeSoftware(CSCPMessage *request);
46ee6286 635 void getWinPerfObjects(CSCPMessage *request);
fdbee7f8
VK
636 void listMappingTables(CSCPMessage *request);
637 void getMappingTable(CSCPMessage *request);
638 void updateMappingTable(CSCPMessage *request);
639 void deleteMappingTable(CSCPMessage *request);
d5de1d1d 640 void getWirelessStations(CSCPMessage *request);
b4c2a628
VK
641 void getSummaryTables(DWORD rqId);
642 void getSummaryTableDetails(CSCPMessage *request);
643 void modifySummaryTable(CSCPMessage *request);
644 void deleteSummaryTable(CSCPMessage *request);
645 void querySummaryTable(CSCPMessage *request);
d75003e1 646 void forwardToReportingServer(CSCPMessage *request);
5039dede
AK
647
648public:
60557d06 649 ClientSession(SOCKET hSocket, struct sockaddr *addr);
5039dede
AK
650 ~ClientSession();
651
e05b1945
VK
652 void incRefCount() { m_dwRefCount++; }
653 void decRefCount() { if (m_dwRefCount > 0) m_dwRefCount--; }
654
655 void run();
656
d3a7cf4c
VK
657 void postMessage(CSCPMessage *pMsg) { m_pSendQueue->Put(pMsg->CreateMessage()); }
658 void sendMessage(CSCPMessage *pMsg);
92c51b1d 659 void sendRawMessage(CSCP_MESSAGE *pMsg);
e05b1945
VK
660 void sendPollerMsg(DWORD dwRqId, const TCHAR *pszMsg);
661 BOOL sendFile(const TCHAR *file, DWORD dwRqId);
662
f669df41 663 DWORD getIndex() { return m_dwIndex; }
e05b1945 664 void setIndex(DWORD dwIndex) { if (m_dwIndex == INVALID_INDEX) m_dwIndex = dwIndex; }
f669df41 665 int getState() { return m_iState; }
889d7ff7
VK
666 const TCHAR *getUserName() { return m_szUserName; }
667 const TCHAR *getClientInfo() { return m_szClientInfo; }
668 const TCHAR *getWorkstation() { return m_szWorkstation; }
e05b1945
VK
669 DWORD getUserId() { return m_dwUserId; }
670 DWORD getSystemRights() { return m_dwSystemAccess; }
f669df41
VK
671 bool isAuthenticated() { return (m_dwFlags & CSF_AUTHENTICATED) ? true : false; }
672 bool isConsoleOpen() { return (m_dwFlags & CSF_CONSOLE_OPEN) ? true : false; }
673 bool isSubscribed(DWORD dwChannel) { return (m_dwActiveChannels & dwChannel) ? true : false; }
674 WORD getCurrentCmd() { return m_wCurrentCmd; }
98abc9f1 675 int getCipher() { return (m_pCtx == NULL) ? -1 : m_pCtx->getCipher(); }
f8c6f10f 676 int getClientType() { return m_clientType; }
e05b1945
VK
677
678 bool checkSysAccessRights(DWORD requiredAccess)
679 {
680 return m_dwUserId == 0 ? true :
681 ((requiredAccess & m_dwSystemAccess) ? true : false);
682 }
683
f669df41 684 void kill();
e05b1945
VK
685 void notify(DWORD dwCode, DWORD dwData = 0);
686
687 void queueUpdate(UPDATE_INFO *pUpdate) { m_pUpdateQueue->Put(pUpdate); }
688 void onNewEvent(Event *pEvent);
e0f99bf0 689 void onSyslogMessage(NX_SYSLOG_RECORD *pRec);
e05b1945
VK
690 void onNewSNMPTrap(CSCPMessage *pMsg);
691 void onObjectChange(NetObj *pObject);
692 void onUserDBUpdate(int code, DWORD id, UserDatabaseObject *user);
693 void onAlarmUpdate(DWORD dwCode, NXC_ALARM *pAlarm);
694 void onActionDBUpdate(DWORD dwCode, NXC_ACTION *pAction);
72f6ece2
AK
695 void onSituationChange(CSCPMessage *msg);
696 void onLibraryImageChange(uuid_t *guid, bool removed = false);
5039dede
AK
697};
698
2bac37f9
VK
699/**
700 * Delayed SQL request
701 */
7dad92fb
VK
702typedef struct
703{
704 TCHAR *query;
705 int bindCount;
706 BYTE *sqlTypes;
707 TCHAR *bindings[1]; /* actual size determined by bindCount field */
708} DELAYED_SQL_REQUEST;
709
2bac37f9
VK
710/**
711 * Delayed request for idata_ INSERT
712 */
f68d9eac
VK
713typedef struct
714{
715 time_t timestamp;
716 DWORD nodeId;
717 DWORD dciId;
718 TCHAR value[MAX_RESULT_LENGTH];
719} DELAYED_IDATA_INSERT;
720
2bac37f9
VK
721/**
722 * Functions
723 */
35f836fe
VK
724BOOL NXCORE_EXPORTABLE ConfigReadStr(const TCHAR *szVar, TCHAR *szBuffer, int iBufSize, const TCHAR *szDefault);
725#ifdef UNICODE
726BOOL NXCORE_EXPORTABLE ConfigReadStrA(const WCHAR *szVar, char *szBuffer, int iBufSize, const char *szDefault);
727#else
728#define ConfigReadStrA ConfigReadStr
729#endif
5039dede
AK
730int NXCORE_EXPORTABLE ConfigReadInt(const TCHAR *szVar, int iDefault);
731DWORD NXCORE_EXPORTABLE ConfigReadULong(const TCHAR *szVar, DWORD dwDefault);
732BOOL NXCORE_EXPORTABLE ConfigReadByteArray(const TCHAR *pszVar, int *pnArray,
733 int nSize, int nDefault);
734BOOL NXCORE_EXPORTABLE ConfigWriteStr(const TCHAR *szVar, const TCHAR *szValue, BOOL bCreate,
735 BOOL isVisible = TRUE, BOOL needRestart = FALSE);
736BOOL NXCORE_EXPORTABLE ConfigWriteInt(const TCHAR *szVar, int iValue, BOOL bCreate,
737 BOOL isVisible = TRUE, BOOL needRestart = FALSE);
738BOOL NXCORE_EXPORTABLE ConfigWriteULong(const TCHAR *szVar, DWORD dwValue, BOOL bCreate,
739 BOOL isVisible = TRUE, BOOL needRestart = FALSE);
740BOOL NXCORE_EXPORTABLE ConfigWriteByteArray(const TCHAR *pszVar, int *pnArray,
741 int nSize, BOOL bCreate,
742 BOOL isVisible = TRUE, BOOL needRestart = FALSE);
743TCHAR NXCORE_EXPORTABLE *ConfigReadCLOB(const TCHAR *var, const TCHAR *defValue);
744BOOL NXCORE_EXPORTABLE ConfigWriteCLOB(const TCHAR *var, const TCHAR *value, BOOL bCreate);
745
28f5b9a4
VK
746BOOL NXCORE_EXPORTABLE MetaDataReadStr(const TCHAR *szVar, TCHAR *szBuffer, int iBufSize, const TCHAR *szDefault);
747
35f836fe 748BOOL NXCORE_EXPORTABLE LoadConfig();
5039dede 749
35f836fe
VK
750void NXCORE_EXPORTABLE Shutdown();
751void NXCORE_EXPORTABLE FastShutdown();
752BOOL NXCORE_EXPORTABLE Initialize();
5039dede 753THREAD_RESULT NXCORE_EXPORTABLE THREAD_CALL Main(void *);
35f836fe
VK
754void NXCORE_EXPORTABLE ShutdownDB();
755void InitiateShutdown();
5039dede
AK
756
757BOOL NXCORE_EXPORTABLE SleepAndCheckForShutdown(int iSeconds);
758
35f836fe
VK
759void ConsolePrintf(CONSOLE_CTX pCtx, const TCHAR *pszFormat, ...);
760int ProcessConsoleCommand(const TCHAR *pszCmdLine, CONSOLE_CTX pCtx);
5039dede
AK
761
762void SaveObjects(DB_HANDLE hdb);
ff6d2c5d
VK
763void NXCORE_EXPORTABLE ObjectTransactionStart();
764void NXCORE_EXPORTABLE ObjectTransactionEnd();
5039dede 765
ce7565e7 766void NXCORE_EXPORTABLE QueueSQLRequest(const TCHAR *query);
7dad92fb 767void NXCORE_EXPORTABLE QueueSQLRequest(const TCHAR *query, int bindCount, int *sqlTypes, const TCHAR **values);
f68d9eac 768void QueueIDataInsert(time_t timestamp, DWORD nodeId, DWORD dciId, const TCHAR *value);
ce7565e7
VK
769void StartDBWriter();
770void StopDBWriter();
5039dede 771
8c08411e 772bool NXCORE_EXPORTABLE IsDatabaseRecordExist(DB_HANDLE hdb, const TCHAR *table, const TCHAR *idColumn, DWORD id);
ba89fed2 773
5039dede
AK
774void DecodeSQLStringAndSetVariable(CSCPMessage *pMsg, DWORD dwVarId, TCHAR *pszStr);
775
df8a4ca2 776SNMP_SecurityContext *SnmpCheckCommSettings(SNMP_Transport *pTransport, int *version, SNMP_SecurityContext *originalContext);
35f836fe 777void StrToMac(const TCHAR *pszStr, BYTE *pBuffer);
5039dede 778
f42b8099 779void InitLocalNetInfo();
5039dede 780
f42b8099 781ARP_CACHE *GetLocalArpCache();
5d2c5741 782ARP_CACHE *SnmpGetArpCache(DWORD dwVersion, SNMP_Transport *pTransport);
5039dede 783
98762401 784InterfaceList *GetLocalInterfaceList();
1e6b68a6 785void SnmpGetInterfaceStatus(DWORD dwVersion, SNMP_Transport *pTransport, DWORD dwIfIndex, int *adminState, int *operState);
5039dede 786
5d2c5741 787ROUTING_TABLE *SnmpGetRoutingTable(DWORD dwVersion, SNMP_Transport *pTransport);
5039dede 788
9796ce45 789void LoadNetworkDeviceDrivers();
21254a93 790NetworkDeviceDriver *FindDriverForNode(Node *node, SNMP_Transport *pTransport);
28e1575f 791NetworkDeviceDriver *FindDriverByName(const TCHAR *name);
9796ce45 792
5ad2167d 793void WatchdogInit();
5039dede
AK
794DWORD WatchdogAddThread(const TCHAR *szName, time_t tNotifyInterval);
795void WatchdogNotify(DWORD dwId);
796void WatchdogPrintStatus(CONSOLE_CTX pCtx);
797
5ad2167d 798void CheckForMgmtNode();
f1b6417b 799Node *PollNewNode(DWORD dwIpAddr, DWORD dwNetMask, DWORD dwCreationFlags, WORD agentPort,
ea12c2aa 800 WORD snmpPort, const TCHAR *pszName, DWORD dwProxyNode, DWORD dwSNMPProxy, Cluster *pCluster,
a749a70a 801 DWORD zoneId, bool doConfPoll, bool discoveredNode);
5039dede 802
b1e9b6b3 803void NXCORE_EXPORTABLE EnumerateClientSessions(void (*pHandler)(ClientSession *, void *), void *pArg);
5039dede 804void NXCORE_EXPORTABLE NotifyClientSessions(DWORD dwCode, DWORD dwData);
5ad2167d 805int GetSessionCount();
06492844 806bool IsLoggedIn(DWORD dwUserId);
5039dede 807
35f836fe
VK
808void GetSysInfoStr(TCHAR *pszBuffer, int nMaxSize);
809DWORD GetLocalIpAddr();
f7694811 810TCHAR *GetLocalHostName(TCHAR *buffer, size_t bufSize);
5039dede 811
35f836fe 812BOOL ExecCommand(TCHAR *pszCommand);
5039dede
AK
813BOOL SendMagicPacket(DWORD dwIpAddr, BYTE *pbMacAddr, int iNumPackets);
814
35f836fe 815BOOL InitIdTable();
5039dede 816DWORD CreateUniqueId(int iGroup);
35f836fe 817QWORD CreateUniqueEventId();
69bb7f47 818void SaveCurrentFreeId();
5039dede 819
35f836fe
VK
820void InitMailer();
821void ShutdownMailer();
822void NXCORE_EXPORTABLE PostMail(const TCHAR *pszRcpt, const TCHAR *pszSubject, const TCHAR *pszText);
5039dede 823
35f836fe
VK
824void InitSMSSender();
825void ShutdownSMSSender();
826void NXCORE_EXPORTABLE PostSMS(const TCHAR *pszRcpt, const TCHAR *pszText);
5039dede 827
35f836fe 828void InitTraps();
5039dede
AK
829void SendTrapsToClient(ClientSession *pSession, DWORD dwRqId);
830void CreateTrapCfgMessage(CSCPMessage &msg);
831DWORD CreateNewTrap(DWORD *pdwTrapId);
832DWORD CreateNewTrap(NXC_TRAP_CFG_ENTRY *pTrap);
833DWORD UpdateTrapFromMsg(CSCPMessage *pMsg);
834DWORD DeleteTrap(DWORD dwId);
835void CreateNXMPTrapRecord(String &str, DWORD dwId);
836
837BOOL IsTableTool(DWORD dwToolId);
838BOOL CheckObjectToolAccess(DWORD dwToolId, DWORD dwUserId);
839DWORD ExecuteTableTool(DWORD dwToolId, Node *pNode, DWORD dwRqId, ClientSession *pSession);
840DWORD DeleteObjectToolFromDB(DWORD dwToolId);
841DWORD UpdateObjectToolFromMessage(CSCPMessage *pMsg);
842
b4c2a628
VK
843DWORD ModifySummaryTable(CSCPMessage *msg, LONG *newId);
844DWORD DeleteSummaryTable(LONG tableId);
845Table *QuerySummaryTable(LONG tableId, DWORD baseObjectId, DWORD userId, DWORD *rcc);
846
e0f99bf0 847void CreateMessageFromSyslogMsg(CSCPMessage *pMsg, NX_SYSLOG_RECORD *pRec);
4262c0dc 848void ReinitializeSyslogParser();
5039dede
AK
849
850void EscapeString(String &str);
851
ce7565e7
VK
852void InitAuditLog();
853void NXCORE_EXPORTABLE WriteAuditLog(const TCHAR *subsys, BOOL isSuccess, DWORD userId,
854 const TCHAR *workstation, DWORD objectId,
855 const TCHAR *format, ...);
5039dede 856
a65c1819
VK
857bool ValidateConfig(Config *config, DWORD flags, TCHAR *errorText, int errorTextLen);
858DWORD ImportConfig(Config *config, DWORD flags);
5039dede
AK
859
860#ifdef _WITH_ENCRYPTION
861X509 *CertificateFromLoginMessage(CSCPMessage *pMsg);
a50eaebe 862BOOL ValidateUserCertificate(X509 *pCert, const TCHAR *pszLogin, BYTE *pChallenge,
5039dede 863 BYTE *pSignature, DWORD dwSigLen, int nMappingMethod,
a50eaebe 864 const TCHAR *pszMappingData);
9796ce45 865void ReloadCertificates();
5039dede
AK
866#endif
867
868#ifndef _WIN32
869THREAD_RESULT NXCORE_EXPORTABLE THREAD_CALL SignalHandler(void *);
870#endif /* not _WIN32 */
871
5039dede 872void DbgTestRWLock(RWLOCK hLock, const TCHAR *szName, CONSOLE_CTX pCtx);
534e1b83
VK
873void DumpClientSessions(CONSOLE_CTX pCtx);
874void DumpMobileDeviceSessions(CONSOLE_CTX pCtx);
5039dede 875void ShowPollerState(CONSOLE_CTX pCtx);
35f836fe 876void SetPollerInfo(int nIdx, const TCHAR *pszMsg);
5039dede 877void ShowServerStats(CONSOLE_CTX pCtx);
35f836fe 878void ShowQueueStats(CONSOLE_CTX pCtx, Queue *pQueue, const TCHAR *pszName);
5039dede
AK
879void DumpProcess(CONSOLE_CTX pCtx);
880
534e1b83
VK
881/**
882 * Global variables
883 */
5039dede
AK
884extern TCHAR NXCORE_EXPORTABLE g_szConfigFile[];
885extern TCHAR NXCORE_EXPORTABLE g_szLogFile[];
4f8998ca
VK
886extern DWORD g_dwLogRotationMode;
887extern DWORD g_dwMaxLogSize;
888extern DWORD g_dwLogHistorySize;
889extern TCHAR g_szDailyLogFileSuffix[64];
5039dede
AK
890extern TCHAR NXCORE_EXPORTABLE g_szDumpDir[];
891extern TCHAR NXCORE_EXPORTABLE g_szListenAddress[];
892#ifndef _WIN32
893extern TCHAR NXCORE_EXPORTABLE g_szPIDFile[];
894#endif
895extern TCHAR g_szDataDir[];
9796ce45 896extern TCHAR g_szLibDir[];
712dd47d 897extern TCHAR g_szJavaLibDir[];
73869331 898extern DWORD NXCORE_EXPORTABLE g_processAffinityMask;
5039dede
AK
899extern QWORD g_qwServerId;
900extern RSA *g_pServerKey;
901extern DWORD g_dwPingSize;
902extern DWORD g_dwAuditFlags;
903extern time_t g_tServerStartTime;
904extern DWORD g_dwLockTimeout;
5039dede
AK
905extern DWORD g_dwAgentCommandTimeout;
906extern DWORD g_dwThresholdRepeatInterval;
907extern int g_nRequiredPolls;
52c75f5c 908extern DWORD g_dwSlmPollingInterval;
5039dede 909
b8c1ec69
VK
910extern TCHAR g_szDbDriver[];
911extern TCHAR g_szDbDrvParams[];
912extern TCHAR g_szDbServer[];
913extern TCHAR g_szDbLogin[];
914extern TCHAR g_szDbPassword[];
915extern TCHAR g_szDbName[];
f3c30cf5 916extern TCHAR g_szDbSchema[];
712dd47d 917extern TCHAR NXCORE_EXPORTABLE g_szJavaPath[];
b8c1ec69 918extern DB_DRIVER g_dbDriver;
5039dede
AK
919extern DB_HANDLE NXCORE_EXPORTABLE g_hCoreDB;
920extern Queue *g_pLazyRequestQueue;
c9a9601c 921extern Queue *g_pIDataInsertQueue;
5039dede 922
28f5b9a4 923extern int NXCORE_EXPORTABLE g_nDBSyntax;
5039dede
AK
924
925#endif /* _nms_core_h_ */