Added support for object tools
authorVictor Kirhenshtein <victor@netxms.org>
Sun, 21 Aug 2005 20:27:09 +0000 (20:27 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Sun, 21 Aug 2005 20:27:09 +0000 (20:27 +0000)
12 files changed:
.gitattributes
include/netxmsdb.h
include/nms_cscp.h
include/nxclapi.h
include/nxtools.h [copied from include/netxmsdb.h with 68% similarity]
sql/dbinit.in
sql/schema.in
sql/setup.in
src/libnxcl/Makefile.am
src/libnxcl/libnxcl.dsp
src/libnxcl/libnxcl.vcp
src/libnxcl/objtools.cpp [new file with mode: 0644]

index 5a41af8..2f91045 100644 (file)
@@ -140,6 +140,7 @@ include/nximage.h -text
 include/nxnt.h -text
 include/nxqueue.h -text
 include/nxsnmp.h -text
+include/nxtools.h -text
 include/unicode.h -text
 m4/Makefile.am -text
 netware/Makefile.am -text
@@ -688,6 +689,7 @@ src/libnxcl/libnxcl.vcw -text
 src/libnxcl/main.cpp -text
 src/libnxcl/mib.cpp -text
 src/libnxcl/objects.cpp -text
+src/libnxcl/objtools.cpp -text
 src/libnxcl/package.cpp -text
 src/libnxcl/server.cpp -text
 src/libnxcl/session.cpp -text
index ac632c7..d1a17b6 100644 (file)
@@ -23,6 +23,6 @@
 #ifndef _netxms_db_h
 #define _netxms_db_h
 
-#define DB_FORMAT_VERSION      31
+#define DB_FORMAT_VERSION      32
 
 #endif
index 7aa6420..224fc51 100644 (file)
@@ -239,7 +239,7 @@ typedef struct
 #define CMD_EVENT_LIST_END          0x000C
 #define CMD_GET_CONFIG_VARLIST      0x000D
 #define CMD_SET_CONFIG_VARIABLE     0x000E
-//#define CMD_CONFIG_VARIABLE         0x000F
+#define CMD_GET_OBJECT_TOOLS        0x000F
 //#define CMD_CONFIG_VARLIST_END      0x0010
 #define CMD_DELETE_CONFIG_VARIABLE  0x0011
 #define CMD_NOTIFY                  0x0012
@@ -527,6 +527,7 @@ typedef struct
 #define VID_NUM_LOCAL_NETS          ((DWORD)161)
 #define VID_NUM_REMOTE_NETS         ((DWORD)162)
 #define VID_APPLY_FLAG              ((DWORD)163)
+#define VID_NUM_TOOLS               ((DWORD)164)
 
 // Variable ranges for object's ACL
 #define VID_ACL_USER_BASE           ((DWORD)0x00001000)
@@ -588,6 +589,9 @@ typedef struct
 // Base value for network list
 #define VID_VPN_NETWORK_BASE        ((DWORD)0x10000000)
 
+// Base value for network list
+#define VID_OBJECT_TOOLS_BASE       ((DWORD)0x10000000)
+
 
 //
 // Inline functions
index 78dbb60..4822fa5 100644 (file)
@@ -29,6 +29,7 @@
 #include <nxevent.h>
 #include <nximage.h>
 #include <nxcscpapi.h>
+#include <nxtools.h>
 
 #ifdef _WIN32
 #ifdef LIBNXCL_EXPORTS
@@ -1013,6 +1014,21 @@ typedef struct
 
 
 //
+// Object tool
+//
+
+typedef struct
+{
+   DWORD dwId;
+   DWORD dwFlags;
+   WORD wType;
+   TCHAR szName[MAX_DB_STRING];
+   TCHAR szDescription[MAX_DB_STRING];
+   TCHAR *pszData;
+} NXC_OBJECT_TOOL;
+
+
+//
 // Functions
 //
 
@@ -1182,6 +1198,10 @@ DWORD LIBNXCL_EXPORTABLE NXCSetServerVariable(NXC_SESSION hSession, TCHAR *pszVa
                                               TCHAR *pszValue);
 DWORD LIBNXCL_EXPORTABLE NXCDeleteServerVariable(NXC_SESSION hSession, TCHAR *pszVarName);
 
+DWORD LIBNXCL_EXPORTABLE NXCGetObjectTools(NXC_SESSION hSession, DWORD *pdwNumTools,
+                                           NXC_OBJECT_TOOL **ppToolList);
+void LIBNXCL_EXPORTABLE NXCDestroyObjectToolList(DWORD dwNumTools, NXC_OBJECT_TOOL *pList);
+
 #ifdef __cplusplus
 }
 #endif
similarity index 68%
copy from include/netxmsdb.h
copy to include/nxtools.h
index ac632c7..b6865d2 100644 (file)
@@ -1,6 +1,6 @@
 /* 
 ** NetXMS - Network Management System
-** Copyright (C) 2003, 2004 Victor Kirhenshtein
+** Copyright (C) 2003, 2004, 2005 Victor Kirhenshtein
 **
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 **
-** $module: netxmsdb.h
+** $module: nxtools.h
 **
 **/
 
-#ifndef _netxms_db_h
-#define _netxms_db_h
+#ifndef _nxtools_h
+#define _nxtools_h
+
+
+//
+// Tool types
+//
+
+#define TOOL_TYPE_INTERNAL       0
+#define TOOL_TYPE_ACTION         1
+#define TOOL_TYPE_TABLE_SNMP     2
+#define TOOL_TYPE_TABLE_AGENT    3
+#define TOOL_TYPE_URL            4
+#define TOOL_TYPE_COMMAND        5
 
-#define DB_FORMAT_VERSION      31
 
 #endif
index ba4135d..ac62126 100644 (file)
@@ -16,6 +16,7 @@
 #include <nximage.h>
 #include <netxmsdb.h>
 #include <nxnt.h>
+#include <nxtools.h>
 
 // Define common macros for uncommon data types
 // and database syntax type
index b305712..e6e1070 100644 (file)
@@ -666,3 +666,31 @@ CREATE TABLE agent_pkg
        description varchar(255),
        PRIMARY KEY(pkg_id)     
 ) TABLE_TYPE;
+
+
+/*
+** Object tools
+*/
+
+CREATE TABLE object_tools
+(
+       tool_id integer not null,
+       tool_name varchar(255) not null,
+       tool_type integer not null,
+       tool_data SQL_TEXT,
+       description varchar(255),
+       flags integer not null,
+       PRIMARY KEY(tool_id)
+) TABLE_TYPE;
+
+
+/*
+** Access list for object tools
+*/
+
+CREATE TABLE object_tools_acl
+(
+       tool_id integer not null,
+       user_id integer not null,
+       PRIMARY KEY(tool_id,user_id)
+) TABLE_TYPE;
index 6f54e69..231cedb 100644 (file)
@@ -162,3 +162,22 @@ INSERT INTO container_categories (category,name,image_id,description)
 
 INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
    VALUES (0,'.1.3.6.1.4.1.2272.*',NODE_TYPE_NORTEL_ACCELAR,0);
+
+
+/*
+** Default tools
+*/
+
+INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
+       VALUES (1,'Shutdown system',TOOL_TYPE_ACTION,'System.Shutdown',0,'');
+INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
+       VALUES (2,'Shutdown restart',TOOL_TYPE_ACTION,'System.Restart',0,'');
+INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
+       VALUES (3,'Wakeup node',TOOL_TYPE_INTERNAL,'wakeup',0,'');
+INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
+       VALUES (4,'Diag->Routing table',TOOL_TYPE_INTERNAL,'RoutingTable',0,'');
+
+INSERT INTO object_tools_acl (tool_id,user_id) VALUES (1,-2147483648);
+INSERT INTO object_tools_acl (tool_id,user_id) VALUES (2,-2147483648);
+INSERT INTO object_tools_acl (tool_id,user_id) VALUES (3,-2147483648);
+INSERT INTO object_tools_acl (tool_id,user_id) VALUES (4,-2147483648);
index 589b77f..95a16c7 100644 (file)
@@ -1,7 +1,7 @@
 INCLUDES=-I@top_srcdir@/include
 
 lib_LTLIBRARIES = libnxcl.la
-libnxcl_la_SOURCES = actions.cpp alarms.cpp comm.cpp datacoll.cpp epp.cpp eventdb.cpp events.cpp image.cpp main.cpp mib.cpp objects.cpp package.cpp server.cpp session.cpp snmptrap.cpp users.cpp
+libnxcl_la_SOURCES = actions.cpp alarms.cpp comm.cpp datacoll.cpp epp.cpp eventdb.cpp events.cpp image.cpp main.cpp mib.cpp objects.cpp objtools.cpp package.cpp server.cpp session.cpp snmptrap.cpp users.cpp
 libnxcl_la_LDFLAGS = -version-info $(LIBNETXMS_LIBRARY_VERSION)
 
 EXTRA_DIST = \
index 3528210..c43e541 100644 (file)
@@ -145,6 +145,10 @@ SOURCE=.\objects.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\objtools.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\package.cpp
 # End Source File
 # Begin Source File
@@ -205,6 +209,10 @@ SOURCE=..\..\include\nxevent.h
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\include\nxtools.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\include\unicode.h
 # End Source File
 # End Group
index dab0781..765379e 100644 (file)
@@ -1177,6 +1177,7 @@ DEP_CPP_ACTIO=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -1600,6 +1601,7 @@ DEP_CPP_ALARM=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -2023,6 +2025,7 @@ DEP_CPP_COMM_=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -2446,6 +2449,7 @@ DEP_CPP_DATAC=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -2869,6 +2873,7 @@ DEP_CPP_EPP_C=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -3292,6 +3297,7 @@ DEP_CPP_EVENT=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -3715,6 +3721,7 @@ DEP_CPP_EVENTS=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -4138,6 +4145,7 @@ DEP_CPP_IMAGE=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -4561,6 +4569,7 @@ DEP_CPP_MAIN_=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -4984,6 +4993,7 @@ DEP_CPP_MIB_C=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -5407,6 +5417,7 @@ DEP_CPP_OBJEC=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -5538,6 +5549,541 @@ DEP_CPP_OBJEC=\
 # End Source File
 # Begin Source File
 
+SOURCE=.\objtools.cpp
+
+!IF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE SH4) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE SH4) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE SH3) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE SH3) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE emulator) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE emulator) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE x86) Release"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ELSEIF  "$(CFG)" == "libnxcl - Win32 (WCE x86) Debug"
+
+DEP_CPP_OBJTO=\
+       "..\..\include\config-netware.h"\
+       "..\..\include\getopt.h"\
+       "..\..\include\netxms-version.h"\
+       "..\..\include\nms_common.h"\
+       "..\..\include\nms_cscp.h"\
+       "..\..\include\nms_threads.h"\
+       "..\..\include\nms_util.h"\
+       "..\..\include\nxclapi.h"\
+       "..\..\include\nxcscpapi.h"\
+       "..\..\include\nxevent.h"\
+       "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
+       "..\..\include\unicode.h"\
+       ".\libnxcl.h"\
+       
+NODEP_CPP_OBJTO=\
+       "..\..\..\..\usr\include\pthread.h"\
+       
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
 SOURCE=.\package.cpp
 
 !IF  "$(CFG)" == "libnxcl - Win32 (WCE MIPSII_FP) Release"
@@ -5890,6 +6436,7 @@ DEP_CPP_PACKA=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -6401,6 +6948,7 @@ DEP_CPP_SERVE=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -6912,6 +7460,7 @@ DEP_CPP_SESSI=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -7423,6 +7972,7 @@ DEP_CPP_SNMPT=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
@@ -7874,6 +8424,7 @@ DEP_CPP_USERS=\
        "..\..\include\nxcscpapi.h"\
        "..\..\include\nxevent.h"\
        "..\..\include\nximage.h"\
+       "..\..\include\nxtools.h"\
        "..\..\include\unicode.h"\
        ".\libnxcl.h"\
        
diff --git a/src/libnxcl/objtools.cpp b/src/libnxcl/objtools.cpp
new file mode 100644 (file)
index 0000000..24710fe
--- /dev/null
@@ -0,0 +1,89 @@
+/* 
+** NetXMS - Network Management System
+** Client Library
+** Copyright (C) 2004, 2005 Victor Kirhenshtein
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+** $module: objtools.cpp
+**
+**/
+
+#include "libnxcl.h"
+
+
+//
+// Get list of object tools
+//
+
+DWORD LIBNXCL_EXPORTABLE NXCGetObjectTools(NXC_SESSION hSession, DWORD *pdwNumTools,
+                                           NXC_OBJECT_TOOL **ppToolList)
+{
+   CSCPMessage msg, *pResponse;
+   DWORD i, dwResult, dwRqId, dwId;
+
+   dwRqId = ((NXCL_Session *)hSession)->CreateRqId();
+
+   msg.SetCode(CMD_GET_OBJECT_TOOLS);
+   msg.SetId(dwRqId);
+   ((NXCL_Session *)hSession)->SendMsg(&msg);
+
+   *pdwNumTools = 0;
+   *ppToolList = NULL;
+
+   pResponse = ((NXCL_Session *)hSession)->WaitForMessage(CMD_REQUEST_COMPLETED, dwRqId);
+   if (pResponse != NULL)
+   {
+      dwResult = pResponse->GetVariableLong(VID_RCC);
+      if (dwResult == RCC_SUCCESS)
+      {
+         *pdwNumTools = pResponse->GetVariableLong(VID_NUM_TOOLS);
+         *ppToolList = (NXC_OBJECT_TOOL *)malloc(sizeof(NXC_OBJECT_TOOL) * (*pdwNumTools));
+         memset(*ppToolList, 0, sizeof(NXC_OBJECT_TOOL) * (*pdwNumTools));
+         for(i = 0, dwId = VID_OBJECT_TOOLS_BASE; i < *pdwNumTools; i++, dwId += 10)
+         {
+            (*ppToolList)[i].dwId = pResponse->GetVariableLong(dwId);
+            pResponse->GetVariableStr(dwId + 1, (*ppToolList)[i].szName, MAX_DB_STRING);
+            (*ppToolList)[i].wType = pResponse->GetVariableShort(dwId + 2);
+            (*ppToolList)[i].pszData = pResponse->GetVariableStr(dwId + 3);
+            (*ppToolList)[i].dwFlags = pResponse->GetVariableLong(dwId + 4);
+            pResponse->GetVariableStr(dwId + 5, (*ppToolList)[i].szDescription, MAX_DB_STRING);
+         }
+      }
+      delete pResponse;
+   }
+   else
+   {
+      dwResult = RCC_TIMEOUT;
+   }
+   return dwResult;
+}
+
+
+//
+// Destroy list of object tools previously created by NXCGetObjectTools
+//
+
+void LIBNXCL_EXPORTABLE NXCDestroyObjectToolList(DWORD dwNumTools, NXC_OBJECT_TOOL *pList)
+{
+   DWORD i;
+
+   if (pList != NULL)
+   {
+      for(i = 0; i < dwNumTools; i++)
+         safe_free(pList[i].pszData);
+      free(pList);
+   }
+}