added global variable $dci to transformation scripts; initial work on storage discove...
authorVictor Kirhenshtein <victor@netxms.org>
Fri, 28 Sep 2012 15:07:41 +0000 (15:07 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Fri, 28 Sep 2012 15:07:41 +0000 (15:07 +0000)
21 files changed:
.gitattributes
configure.ac
include/Makefile.am
include/nms_common.h
include/nxsdapi.h [new file with mode: 0644]
netxms.sln
src/agent/Makefile.am
src/agent/core/Makefile.am
src/agent/core/extagent.cpp
src/agent/core/nxagentd.cpp
src/agent/core/nxagentd.h
src/agent/core/nxagentd.vcproj
src/agent/core/push.cpp
src/agent/libnxsd/attr.cpp [new file with mode: 0644]
src/agent/libnxsd/libnxsd.h [new file with mode: 0644]
src/agent/libnxsd/libnxsd.vcproj [new file with mode: 0644]
src/agent/libnxsd/main.cpp [new file with mode: 0644]
src/java/netxms-client/src/main/java/org/netxms/client/Table.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/NXMCWorkbenchWindowAdvisor.java
src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/WidgetHelper.java
src/server/core/dcitem.cpp

index f532e2b..ca68647 100644 (file)
@@ -287,6 +287,7 @@ src/agent/core/epp.cpp -text
 src/agent/core/nxagentd-unicode.vcproj -text
 src/agent/core/nxagentd.vcproj -text
 src/agent/core/push.cpp -text
+src/agent/libnxsd/libnxsd.vcproj -text
 src/agent/subagents/aix/cpu.cpp -text
 src/agent/subagents/aix/iostat.cpp -text
 src/agent/subagents/ecs/ecs.vcproj -text
index f070b31..840ad2f 100644 (file)
@@ -2070,6 +2070,7 @@ AC_CONFIG_FILES([
        src/agent/Makefile
        src/agent/core/Makefile
        src/agent/install/Makefile
+       src/agent/libnxsd/Makefile
        src/agent/subagents/Makefile
        src/agent/subagents/aix/Makefile
        src/agent/subagents/ecs/Makefile
index 2e82129..5a2d2f3 100644 (file)
@@ -37,6 +37,7 @@ EXTRA_DIST = \
        nxlpapi.h \
        nxmbapi.h \
        nxqueue.h \
+       nxsdapi.h \
        nxsl_classes.h \
        nxsl.h \
        nxsm_ext.h \
index c769b58..5096b60 100644 (file)
@@ -1,6 +1,6 @@
 /* 
 ** NetXMS - Network Management System
-** Copyright (C) 2003-2010 Victor Kirhenshtein
+** Copyright (C) 2003-2012 Victor Kirhenshtein
 **
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU Lesser General Public License as published by
diff --git a/include/nxsdapi.h b/include/nxsdapi.h
new file mode 100644 (file)
index 0000000..8454b30
--- /dev/null
@@ -0,0 +1,104 @@
+/* 
+** NetXMS - Network Management System
+** Copyright (C) 2003-2012 Victor Kirhenshtein
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU Lesser General Public License as published by
+** the Free Software Foundation; either version 3 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 Lesser General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+** File: nxsdapi.h
+**
+**/
+
+#ifndef _nxsdapi_h_
+#define _nxsdapi_h_
+
+#ifdef _WIN32
+#ifdef LIBNXSD_EXPORTS
+#define LIBNXSD_EXPORTABLE __declspec(dllexport)
+#else
+#define LIBNXSD_EXPORTABLE __declspec(dllimport)
+#endif
+#else    /* _WIN32 */
+#define LIBNXSD_EXPORTABLE
+#endif
+
+
+#include "nms_common.h"
+
+
+/**
+ * Storage element GUID structure
+ */
+#ifdef __HP_aCC
+#pragma pack 1
+#else
+#pragma pack(1)
+#endif
+
+typedef struct __sguid
+{
+       BYTE typeAndFlags;
+       BYTE data[31];
+} SGUID;
+
+#ifdef __HP_aCC
+#pragma pack
+#else
+#pragma pack()
+#endif
+
+/**
+ * Attribute set
+ */
+typedef struct __attribute_set
+{
+       SGUID guid;
+       int count;
+       int allocated;
+       char **names;
+       char **values;
+} ATTRIBUTE_SET;
+
+/**
+ * API functions
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void LIBNXSD_EXPORTABLE SerialToSGUID(const char *serial, BOOL isFake, SGUID *guid);
+void LIBNXSD_EXPORTABLE DevicePathToSGUID(const char *path, SGUID *guid);
+void LIBNXSD_EXPORTABLE ParseSGUID(SGUID *guid, int *type, char *data, int *isFake);
+
+int LIBNXSD_EXPORTABLE CreateStorageElement(SGUID *guid, int deviceType, const char *name, const char *serial, const char *path);
+int LIBNXSD_EXPORTABLE RemoveStorageElement(SGUID *guid);
+
+ATTRIBUTE_SET LIBNXSD_EXPORTABLE *CreateAttributeSet(SGUID *guid);
+void LIBNXSD_EXPORTABLE SetAttribute(ATTRIBUTE_SET *set, const char *attr, const char *value);
+void LIBNXSD_EXPORTABLE SetAttributeInt32(ATTRIBUTE_SET *set, const char *attr, LONG value);
+void LIBNXSD_EXPORTABLE SetAttributeUInt32(ATTRIBUTE_SET *set, const char *attr, DWORD value);
+void LIBNXSD_EXPORTABLE SetAttributeInt64(ATTRIBUTE_SET *set, const char *attr, INT64 value);
+void LIBNXSD_EXPORTABLE SetAttributeUInt64(ATTRIBUTE_SET *set, const char *attr, QWORD value);
+int LIBNXSD_EXPORTABLE UpdateAttributes(ATTRIBUTE_SET *set);
+void LIBNXSD_EXPORTABLE DeleteAttributeSet(ATTRIBUTE_SET *set);
+
+int LIBNXSD_EXPORTABLE LinkStorageElement(SGUID *element, SGUID *parent);
+int LIBNXSD_EXPORTABLE UnlinkStorageElement(SGUID *element, SGUID *parent);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index fea6e46..970a973 100644 (file)
@@ -483,6 +483,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cisco-esw", "src\server\dri
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsd", "src\agent\libnxsd\libnxsd.vcproj", "{DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1115,6 +1117,12 @@ Global
                {15B67A25-48BB-4A05-8FF5-9FE747F6D3EB}.Release|Win32.Build.0 = Release|Win32
                {15B67A25-48BB-4A05-8FF5-9FE747F6D3EB}.Release|x64.ActiveCfg = Release|x64
                {15B67A25-48BB-4A05-8FF5-9FE747F6D3EB}.Release|x64.Build.0 = Release|x64
+               {DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A}.Debug|Win32.ActiveCfg = Debug|Win32
+               {DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A}.Debug|Win32.Build.0 = Debug|Win32
+               {DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A}.Debug|x64.ActiveCfg = Debug|Win32
+               {DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A}.Release|Win32.ActiveCfg = Release|Win32
+               {DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A}.Release|Win32.Build.0 = Release|Win32
+               {DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A}.Release|x64.ActiveCfg = Release|Win32
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
@@ -1132,6 +1140,7 @@ Global
                {451F583D-C2DB-4414-870C-7FA0189BE7DD} = {8BC9D64D-347C-41BE-A506-D21C8FB72D56}
                {57598B02-3295-4FE8-9322-94CE871CC84D} = {8BC9D64D-347C-41BE-A506-D21C8FB72D56}
                {896A7CDA-423A-460A-83E2-6ED37DAE187C} = {8BC9D64D-347C-41BE-A506-D21C8FB72D56}
+               {DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A} = {8BC9D64D-347C-41BE-A506-D21C8FB72D56}
                {E95263B5-A248-4163-95F3-E33CA679AEB3} = {451F583D-C2DB-4414-870C-7FA0189BE7DD}
                {EE54BC06-6B0F-4B91-9FC6-A5BB9ECBE577} = {451F583D-C2DB-4414-870C-7FA0189BE7DD}
                {4E190DD5-70DA-41EC-8D05-5EE8D74F3709} = {451F583D-C2DB-4414-870C-7FA0189BE7DD}
index e50cbde..8f32b86 100644 (file)
@@ -8,4 +8,4 @@
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-SUBDIRS = subagents core install tools
+SUBDIRS = libnxsd subagents core install tools
index 7260178..83eaffc 100644 (file)
@@ -3,9 +3,9 @@ INCLUDES=-I@top_srcdir@/include
 bin_PROGRAMS = nxagentd
 nxagentd_SOURCES = messages.c actions.cpp comm.cpp config.cpp epp.cpp exec.cpp \
                    extagent.cpp getparam.cpp master.cpp nxagentd.cpp \
-                   policy.cpp push.cpp register.cpp session.cpp snmpproxy.cpp \
-                   static_subagents.cpp subagent.cpp sysinfo.cpp tools.cpp \
-                   trap.cpp upgrade.cpp watchdog.cpp
+                   policy.cpp push.cpp register.cpp sd.cpp session.cpp \
+                   snmpproxy.cpp static_subagents.cpp subagent.cpp \
+                   sysinfo.cpp tools.cpp trap.cpp upgrade.cpp watchdog.cpp
 if USE_INTERNAL_EXPAT
 nxagentd_LDADD = @top_srcdir@/src/libnetxms/libnetxms.la @top_srcdir@/src/db/libnxdb/libnxdb.la @top_srcdir@/src/libexpat/libexpat/libnxexpat.la @SUBAGENT_LIBS@
 else
index 06554a5..b0b364d 100644 (file)
 
 #include "nxagentd.h"
 
-#ifdef _WIN32
-#include <aclapi.h>
-#endif
-
 
 /**
  *Static data
index 74beef9..bb4eff5 100644 (file)
@@ -984,6 +984,7 @@ BOOL Initialize()
                m_thSessionWatchdog = ThreadCreateEx(SessionWatchdog, 0, NULL);
                m_thTrapSender = ThreadCreateEx(TrapSender, 0, NULL);
                StartPushConnector();
+               StartStorageDiscoveryConnector();
        }
 
 #if defined(_WIN32)
index 9fc024e..9d2a6b2 100644 (file)
 #undef SEVERITY_CRITICAL
 #endif
 
+#ifdef _WIN32
+#include <aclapi.h>
+#else
+#include <sys/socket.h>
+#include <sys/un.h>
+#endif
+
+#ifndef SUN_LEN
+#define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
+#endif
+
 
 //
 // Version
@@ -444,6 +455,8 @@ void CloseRegistry(bool modified);
 void StartPushConnector();
 BOOL PushData(const TCHAR *parameter, const TCHAR *value);
 
+void StartStorageDiscoveryConnector();
+
 
 #ifdef _WIN32
 
index 0b3b29e..8cc1251 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath=".\sd.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath=".\service.cpp"\r
                                >\r
                        </File>\r
index f62f8d0..59cdf3c 100644 (file)
 \r
 #include "nxagentd.h"\r
 \r
-#ifdef _WIN32\r
-#include <aclapi.h>\r
-#else\r
-#include <sys/socket.h>\r
-#include <sys/un.h>\r
-#endif\r
-\r
-#ifndef SUN_LEN\r
-#define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))\r
-#endif\r
-\r
 \r
 /**\r
  * Push parameter's data\r
diff --git a/src/agent/libnxsd/attr.cpp b/src/agent/libnxsd/attr.cpp
new file mode 100644 (file)
index 0000000..ed82be4
--- /dev/null
@@ -0,0 +1,55 @@
+/* 
+** NetXMS storage discovery API
+** Copyright (C) 2003-2012 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.
+**
+** File: attr.cpp
+**
+**/
+
+#include "libnxsd.h"
+
+
+/**
+ * Create attribute set
+ */
+ATTRIBUTE_SET LIBNXSD_EXPORTABLE *CreateAttributeSet(SGUID *guid)
+{
+       ATTRIBUTE_SET *set = (ATTRIBUTE_SET *)malloc(sizeof(ATTRIBUTE_SET));
+       memcpy(&set->guid, guid, sizeof(SGUID));
+       set->count = 0;
+       set->allocated = 64;
+       set->names = (char **)malloc(sizeof(char *) * set->allocated);
+       set->values = (char **)malloc(sizeof(char *) * set->allocated);
+       return set;
+}
+
+/**
+ * Delete attribute set
+ */
+void LIBNXSD_EXPORTABLE DeleteAttributeSet(ATTRIBUTE_SET *set)
+{
+       if (set == NULL)
+               return;
+       for(int i = 0; i < set->count; i++)
+       {
+               safe_free(set->names[i]);
+               safe_free(set->values[i]);
+       }
+       safe_free(set->names);
+       safe_free(set->values);
+       free(set);
+}
diff --git a/src/agent/libnxsd/libnxsd.h b/src/agent/libnxsd/libnxsd.h
new file mode 100644 (file)
index 0000000..15d2e72
--- /dev/null
@@ -0,0 +1,28 @@
+/* 
+** NetXMS - Network Management System
+** Copyright (C) 2003-2012 Victor Kirhenshtein
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU Lesser General Public License as published by
+** the Free Software Foundation; either version 3 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 Lesser General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+** File: libnxsd.h
+**
+**/
+
+#ifndef _libnxsd_h_
+#define _libnxsd_h_
+
+#include <nxsdapi.h>
+
+#endif
diff --git a/src/agent/libnxsd/libnxsd.vcproj b/src/agent/libnxsd/libnxsd.vcproj
new file mode 100644 (file)
index 0000000..42f7f08
--- /dev/null
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="libnxsd"\r
+       ProjectGUID="{DFE2F1AF-D5E5-49DD-B2AD-4F4FB8651D8A}"\r
+       RootNamespace="libnxsd"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBNXSD_EXPORTS"\r
+                               MinimalRebuild="true"\r
+                               ExceptionHandling="0"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBNXSD_EXPORTS"\r
+                               ExceptionHandling="0"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\attr.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\main.cpp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\libnxsd.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\netxms-version.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nms_agent.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nms_common.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nms_util.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nxsdapi.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/src/agent/libnxsd/main.cpp b/src/agent/libnxsd/main.cpp
new file mode 100644 (file)
index 0000000..3457e64
--- /dev/null
@@ -0,0 +1,37 @@
+/* 
+** NetXMS storage discovery API
+** Copyright (C) 2003-2012 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.
+**
+** File: main.cpp
+**
+**/
+
+#include "libnxsd.h"
+
+/**
+ * DLL entry point
+ */
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+   if (dwReason == DLL_PROCESS_ATTACH)
+      DisableThreadLibraryCalls(hInstance);
+   return TRUE;
+}
+
+#endif   /* _WIN32 */
index 56619f1..00cab1c 100644 (file)
@@ -207,7 +207,7 @@ public class Table
        \r
        /**\r
         * Get all rows as an array of List<String>. Method returns Object[] because\r
-        * Java forbids craetion of generic arrays.\r
+        * Java forbids creation of generic arrays.\r
         * \r
         * @return Array of all rows in a table\r
         */\r
index 6caf975..cf161ed 100644 (file)
@@ -21,6 +21,7 @@ package org.netxms.ui.eclipse.console;
 import java.lang.reflect.InvocationTargetException;
 
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
@@ -102,18 +103,48 @@ public class NXMCWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor
                IDialogSettings settings = Activator.getDefault().getDialogSettings();
                final Shell shell = getWindowConfigurer().getWindow().getShell();
                boolean success = false;
+               boolean autoConnect = false;
+               String password = "";
+               
+               for(String s : Platform.getCommandLineArgs())
+               {
+                       if (s.startsWith("-server="))
+                       {
+                     settings.put("Connect.Server", s.substring(8)); //$NON-NLS-1$
+                       }
+                       else if (s.startsWith("-login="))
+                       {
+                               settings.put("Connect.Login", s.substring(7)); //$NON-NLS-1$
+                       }
+                       else if (s.startsWith("-password=")) //$NON-NLS-1$
+                       {
+                               password = s.substring(10);
+                       }
+                       else if (s.equals("-auto")) //$NON-NLS-1$
+                       {
+                               autoConnect = true;
+                       }
+               }
 
                LoginDialog loginDialog;
                do
                {
-                       loginDialog = new LoginDialog(shell);
-                       if (loginDialog.open() != Window.OK)
-                               System.exit(0); // TODO: do we need to use more graceful method?
+                       if (!autoConnect)
+                       {
+                               loginDialog = new LoginDialog(shell);
+                               if (loginDialog.open() != Window.OK)
+                                       System.exit(0); // TODO: do we need to use more graceful method?
+                               password = loginDialog.getPassword();
+                       }
+                       else
+                       {
+                               autoConnect = false;    // only do auto connect first time
+                       }
 
                        try
                        {
                                LoginJob job = new LoginJob(display, settings.get("Connect.Server"), //$NON-NLS-1$ 
-                                                           settings.get("Connect.Login"), loginDialog.getPassword(), //$NON-NLS-1$
+                                                           settings.get("Connect.Login"), password, //$NON-NLS-1$
                                                            settings.getBoolean("Connect.Encrypt")); //$NON-NLS-1$
 
                                new ProgressMonitorDialog(shell).run(true, true, job);
@@ -144,7 +175,7 @@ public class NXMCWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor
                                final PasswordExpiredDialog dlg = new PasswordExpiredDialog(shell);
                                if (dlg.open() == Window.OK)
                                {
-                                       final String currentPassword = loginDialog.getPassword();
+                                       final String currentPassword = password;
                                        IRunnableWithProgress job = new IRunnableWithProgress() {
                                                @Override
                                                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
index e4b7458..921792f 100644 (file)
@@ -213,7 +213,6 @@ public class WidgetHelper
                return combo;\r
        }\r
        \r
-\r
        /**\r
     * Create pair of label and spinner, with label above\r
         * \r
index c0e7bc9..d162266 100644 (file)
@@ -1111,6 +1111,7 @@ void DCItem::transform(ItemValue &value, time_t nElapsedTime)
       pValue = new NXSL_Value((const TCHAR *)value);
       pEnv = new NXSL_ServerEnv;
       m_pScript->setGlobalVariable(_T("$node"), new NXSL_Value(new NXSL_Object(&g_nxslNodeClass, m_pNode)));
+      m_pScript->setGlobalVariable(_T("$dci"), new NXSL_Value(new NXSL_Object(&g_nxslDciClass, this)));
        
       if (m_pScript->run(pEnv, 1, &pValue) == 0)
       {