intermediate commit
[public/netxms.git] / src / server / drivers / procurve / procurve.cpp
CommitLineData
a56f8af3
VK
1/*
2** NetXMS - Network Management System
3** Driver for HP ProCurve switches
4** Copyright (C) 2003-2012 Victor Kirhenshtein
5**
6** This program is free software; you can redistribute it and/or modify
7** it under the terms of the GNU Lesser General Public License as published by
8** the Free Software Foundation; either version 3 of the License, or
9** (at your option) any later version.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU Lesser General Public License
17** along with this program; if not, write to the Free Software
18** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19**
20** File: procurve.cpp
21**/
22
23#include "procurve.h"
24
25
26//
27// Static data
28//
29
30static TCHAR s_driverName[] = _T("PROCURVE");
31static TCHAR s_driverVersion[] = NETXMS_VERSION_STRING;
32
33
34/**
35 * Get driver name
36 */
37const TCHAR *ProcurveDriver::getName()
38{
39 return s_driverName;
40}
41
42/**
43 * Get driver version
44 */
45const TCHAR *ProcurveDriver::getVersion()
46{
47 return s_driverVersion;
48}
49
50/**
51 * Check if given device can be potentially supported by driver
52 *
53 * @param oid Device OID
54 */
55int ProcurveDriver::isPotentialDevice(const TCHAR *oid)
56{
57 return (_tcsncmp(oid, _T(".1.3.6.1.4.1.11.2.3.7.11"), 24) == 0) ? 127 : 0;
58}
59
60/**
61 * Check if given device is supported by driver
62 *
63 * @param snmp SNMP transport
64 * @param oid Device OID
65 */
66bool ProcurveDriver::isDeviceSupported(SNMP_Transport *snmp, const TCHAR *oid)
67{
68 return true;
69}
70
71/**
72 * Do additional checks on the device required by driver.
73 * Driver can set device's custom attributes from within
74 * this function.
75 *
76 * @param snmp SNMP transport
77 * @param attributes Node's custom attributes
78 */
79void ProcurveDriver::analyzeDevice(SNMP_Transport *snmp, const TCHAR *oid, StringMap *attributes)
80{
81}
82
83/**
84 * Get list of interfaces for given node
85 *
86 * @param snmp SNMP transport
87 * @param attributes Node's custom attributes
88 */
89InterfaceList *ProcurveDriver::getInterfaces(SNMP_Transport *snmp, StringMap *attributes, int useAliases, bool useIfXTable)
90{
91 // Get interface list from standard MIB
92 InterfaceList *ifList = NetworkDeviceDriver::getInterfaces(snmp, attributes, useAliases, useIfXTable);
93 if (ifList == NULL)
94 return NULL;
95
96 // Find physical ports
97
98 return ifList;
99}
100
101/**
102 * Driver entry point
103 */
104DECLARE_NDD_ENTRY_POINT(s_driverName, ProcurveDriver);
105
106/**
107 * DLL entry point
108 */
109#ifdef _WIN32
110
111BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
112{
113 if (dwReason == DLL_PROCESS_ATTACH)
114 DisableThreadLibraryCalls(hInstance);
115 return TRUE;
116}
117
118#endif