intermediate commit
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 23 May 2012 21:43:41 +0000 (21:43 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 23 May 2012 21:43:41 +0000 (21:43 +0000)
.gitattributes
netxms.sln
src/server/drivers/procurve/Makefile.am [new file with mode: 0644]
src/server/drivers/procurve/procurve.cpp [new file with mode: 0644]
src/server/drivers/procurve/procurve.h [new file with mode: 0644]
src/server/drivers/procurve/procurve.vcproj [new file with mode: 0644]
src/server/libnxsrv/ndd.cpp

index fc93b35..30e35f6 100644 (file)
@@ -2070,6 +2070,7 @@ src/server/drivers/lib/avaya-ers/Makefile.am -text
 src/server/drivers/lib/avaya-ers/avaya-ers.vcproj -text
 src/server/drivers/lib/cisco/cisco.vcproj -text
 src/server/drivers/netscreen/netscreen.vcproj -text
+src/server/drivers/procurve/procurve.vcproj -text
 src/server/include/Makefile.am -text
 src/server/include/nxcore_smclp.h -text
 src/server/libnxsrv/apinfo.cpp -text
index 59f7a36..b330991 100644 (file)
@@ -510,6 +510,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxapush", "src\agent\tools\
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "procurve", "src\server\drivers\procurve\procurve.vcproj", "{B51F1406-AF43-4396-96C0-31176DDAA3FB}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1170,6 +1172,12 @@ Global
                {68B9F17F-A292-4DAB-8EA9-B87473BB0436}.Release|Win32.ActiveCfg = Release|Win32
                {68B9F17F-A292-4DAB-8EA9-B87473BB0436}.Release|Win32.Build.0 = Release|Win32
                {68B9F17F-A292-4DAB-8EA9-B87473BB0436}.Release|x64.ActiveCfg = Release|Win32
+               {B51F1406-AF43-4396-96C0-31176DDAA3FB}.Debug|Win32.ActiveCfg = Debug|Win32
+               {B51F1406-AF43-4396-96C0-31176DDAA3FB}.Debug|Win32.Build.0 = Debug|Win32
+               {B51F1406-AF43-4396-96C0-31176DDAA3FB}.Debug|x64.ActiveCfg = Debug|Win32
+               {B51F1406-AF43-4396-96C0-31176DDAA3FB}.Release|Win32.ActiveCfg = Release|Win32
+               {B51F1406-AF43-4396-96C0-31176DDAA3FB}.Release|Win32.Build.0 = Release|Win32
+               {B51F1406-AF43-4396-96C0-31176DDAA3FB}.Release|x64.ActiveCfg = Release|Win32
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
@@ -1263,6 +1271,7 @@ Global
                {FEEF505B-75AE-4E52-8177-51FFC4AB2ED2} = {53997B2A-D94C-428C-816D-938C297A1866}
                {500DE9BF-6FC1-4ACB-91A9-308BA1D37F37} = {53997B2A-D94C-428C-816D-938C297A1866}
                {F343CDCB-1DB5-4563-86DF-6AF1596090B2} = {53997B2A-D94C-428C-816D-938C297A1866}
+               {B51F1406-AF43-4396-96C0-31176DDAA3FB} = {53997B2A-D94C-428C-816D-938C297A1866}
                {DA651576-4E4F-448C-A0A3-9EDD15C81078} = {D73BB67D-032B-4FB7-AEB8-5795B246A072}
                {375F95BD-EFBA-4AA3-8DA3-E79779A12896} = {D73BB67D-032B-4FB7-AEB8-5795B246A072}
                {68B9F17F-A292-4DAB-8EA9-B87473BB0436} = {896A7CDA-423A-460A-83E2-6ED37DAE187C}
diff --git a/src/server/drivers/procurve/Makefile.am b/src/server/drivers/procurve/Makefile.am
new file mode 100644 (file)
index 0000000..4592a8b
--- /dev/null
@@ -0,0 +1,20 @@
+INCLUDES=-I@top_srcdir@/include -I@top_srcdir@/src/server/include
+
+DRIVER = procurve
+
+pkglib_LTLIBRARIES = procurve.la
+procurve_la_SOURCES = procurve.cpp
+procurve_la_LDFLAGS = -module -avoid-version
+procurve_la_LIBADD = ../../../libnetxms/libnetxms.la \
+                     ../../../snmp/libnxsnmp/libnxsnmp.la \
+                     ../../libnxsrv/libnxsrv.la
+
+EXTRA_DIST = \
+       procurve.vcproj \
+       procurve.h
+
+install-exec-hook:
+       if test "x`uname -s`" = "xAIX" ; then OBJECT_MODE=@OBJECT_MODE@ $(AR) x $(DESTDIR)$(pkglibdir)/$(DRIVER).a $(DESTDIR)$(pkglibdir)/$(DRIVER).so ; rm -f $(DESTDIR)$(pkglibdir)/$(DRIVER).a ; fi
+       mkdir -p $(DESTDIR)$(pkglibdir)/ndd
+       mv $(DESTDIR)$(pkglibdir)/$(DRIVER).so $(DESTDIR)$(pkglibdir)/ndd/$(DRIVER).ndd
+       rm -f $(DESTDIR)$(pkglibdir)/$(DRIVER).la
diff --git a/src/server/drivers/procurve/procurve.cpp b/src/server/drivers/procurve/procurve.cpp
new file mode 100644 (file)
index 0000000..c5cd43c
--- /dev/null
@@ -0,0 +1,118 @@
+/* 
+** NetXMS - Network Management System
+** Driver for HP ProCurve switches
+** 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: procurve.cpp
+**/
+
+#include "procurve.h"
+
+
+//
+// Static data
+//
+
+static TCHAR s_driverName[] = _T("PROCURVE");
+static TCHAR s_driverVersion[] = NETXMS_VERSION_STRING;
+
+
+/**
+ * Get driver name
+ */
+const TCHAR *ProcurveDriver::getName()
+{
+       return s_driverName;
+}
+
+/**
+ * Get driver version
+ */
+const TCHAR *ProcurveDriver::getVersion()
+{
+       return s_driverVersion;
+}
+
+/**
+ * Check if given device can be potentially supported by driver
+ *
+ * @param oid Device OID
+ */
+int ProcurveDriver::isPotentialDevice(const TCHAR *oid)
+{
+       return (_tcsncmp(oid, _T(".1.3.6.1.4.1.11.2.3.7.11"), 24) == 0) ? 127 : 0;
+}
+
+/**
+ * Check if given device is supported by driver
+ *
+ * @param snmp SNMP transport
+ * @param oid Device OID
+ */
+bool ProcurveDriver::isDeviceSupported(SNMP_Transport *snmp, const TCHAR *oid)
+{
+       return true;
+}
+
+/**
+ * Do additional checks on the device required by driver.
+ * Driver can set device's custom attributes from within
+ * this function.
+ *
+ * @param snmp SNMP transport
+ * @param attributes Node's custom attributes
+ */
+void ProcurveDriver::analyzeDevice(SNMP_Transport *snmp, const TCHAR *oid, StringMap *attributes)
+{
+}
+
+/**
+ * Get list of interfaces for given node
+ *
+ * @param snmp SNMP transport
+ * @param attributes Node's custom attributes
+ */
+InterfaceList *ProcurveDriver::getInterfaces(SNMP_Transport *snmp, StringMap *attributes, int useAliases, bool useIfXTable)
+{
+       // Get interface list from standard MIB
+       InterfaceList *ifList = NetworkDeviceDriver::getInterfaces(snmp, attributes, useAliases, useIfXTable);
+       if (ifList == NULL)
+               return NULL;
+
+       // Find physical ports
+
+       return ifList;
+}
+
+/**
+ * Driver entry point
+ */
+DECLARE_NDD_ENTRY_POINT(s_driverName, ProcurveDriver);
+
+/**
+ * DLL entry point
+ */
+#ifdef _WIN32
+
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+       if (dwReason == DLL_PROCESS_ATTACH)
+               DisableThreadLibraryCalls(hInstance);
+       return TRUE;
+}
+
+#endif
diff --git a/src/server/drivers/procurve/procurve.h b/src/server/drivers/procurve/procurve.h
new file mode 100644 (file)
index 0000000..5e439be
--- /dev/null
@@ -0,0 +1,45 @@
+/* 
+** NetXMS - Network Management System
+** Driver for HP ProCurve switches
+** 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: procurve.h
+**
+**/
+
+#ifndef _procurve_h_
+#define _procurve_h_
+
+#include <nddrv.h>
+
+
+/**
+ * Driver's class
+ */
+class ProCurveDriver : public NetworkDeviceDriver
+{
+public:
+       virtual const TCHAR *getName();
+       virtual const TCHAR *getVersion();
+
+       virtual int isPotentialDevice(const TCHAR *oid);
+       virtual bool isDeviceSupported(SNMP_Transport *snmp, const TCHAR *oid);
+       virtual void analyzeDevice(SNMP_Transport *snmp, const TCHAR *oid, StringMap *attributes);
+       virtual InterfaceList *getInterfaces(SNMP_Transport *snmp, StringMap *attributes, int useAliases, bool useIfXTable);
+};
+
+#endif
diff --git a/src/server/drivers/procurve/procurve.vcproj b/src/server/drivers/procurve/procurve.vcproj
new file mode 100644 (file)
index 0000000..95bafb8
--- /dev/null
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="windows-1251"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="procurve"\r
+       ProjectGUID="{B51F1406-AF43-4396-96C0-31176DDAA3FB}"\r
+       RootNamespace="procurve"\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
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PROCURVE_EXPORTS"\r
+                               MinimalRebuild="true"\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
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PROCURVE_EXPORTS"\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=".\procurve.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="..\..\include\nddrv.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\include\nxsrvapi.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\procurve.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
index d0c9012..a8a95b1 100644 (file)
 #include <nddrv.h>\r
 \r
 \r
-//\r
-// Constructor\r
-//\r
-\r
+/**\r
+ * Constructor\r
+ */\r
 NetworkDeviceDriver::NetworkDeviceDriver()\r
 {\r
 }\r
 \r
-\r
-//\r
-// Destructor\r
-//\r
-\r
+/**\r
+ * Destructor\r
+ */\r
 NetworkDeviceDriver::~NetworkDeviceDriver()\r
 {\r
 }\r