diff --git a/.gitignore b/.gitignore index 5562ffbc..e78f0acf 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,6 @@ ComHTTP/HTTP.APS /SysInfo/Release/ /TestSysInfo/Debug/ /TestSysInfo/Release/ + +.vs + diff --git a/Agent/CapDownload.cpp b/Agent/CapDownload.cpp index 666901bf..96a9eec5 100644 --- a/Agent/CapDownload.cpp +++ b/Agent/CapDownload.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -267,7 +267,7 @@ BOOL CCapDownload::launch() csCmd.Format(_T("\"%s\\download.exe\" %s"), getInstallFolder(), AfxGetApp()->m_lpCmdLine); if (cmProcess.execNoWait(csCmd, getDataFolder()) != EXEC_SUCCESSFULL) { - m_pLogger->log(LOG_PRIORITY_ERROR, _T("DOWNLOAD => Can't create OCS Inventory NG Download process (%s)"), cmProcess.getOutput()); + m_pLogger->log(LOG_PRIORITY_ERROR, _T("DOWNLOAD => Can't create OCS Inventory Download process (%s)"), cmProcess.getOutput()); return FALSE; } m_pLogger->log(LOG_PRIORITY_NOTICE, _T("DOWNLOAD => Download and setup tool successfully started")); diff --git a/Agent/CapDownload.h b/Agent/CapDownload.h index 15bf72d4..82f5d8cf 100644 --- a/Agent/CapDownload.h +++ b/Agent/CapDownload.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapExecute.cpp b/Agent/CapExecute.cpp index 7002fc7e..01f67f63 100644 --- a/Agent/CapExecute.cpp +++ b/Agent/CapExecute.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapExecute.h b/Agent/CapExecute.h index ca2ed848..2a845226 100644 --- a/Agent/CapExecute.h +++ b/Agent/CapExecute.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapIpdiscover.cpp b/Agent/CapIpdiscover.cpp index 181ddd66..5fb2bf0f 100644 --- a/Agent/CapIpdiscover.cpp +++ b/Agent/CapIpdiscover.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -14,7 +14,6 @@ #include "stdafx.h" #include "CapIpdiscover.h" -#include "CapSnmp.h" #ifdef _DEBUG #define new DEBUG_NEW diff --git a/Agent/CapIpdiscover.h b/Agent/CapIpdiscover.h index 23ad7a02..4596cd58 100644 --- a/Agent/CapIpdiscover.h +++ b/Agent/CapIpdiscover.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapKeyFinder.cpp b/Agent/CapKeyFinder.cpp index 28e7ca31..f2b8c849 100644 --- a/Agent/CapKeyFinder.cpp +++ b/Agent/CapKeyFinder.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapKeyFinder.h b/Agent/CapKeyFinder.h index cc8e9997..8721a186 100644 --- a/Agent/CapKeyFinder.h +++ b/Agent/CapKeyFinder.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapRegistry.cpp b/Agent/CapRegistry.cpp index 76a1d37d..dae99e2d 100644 --- a/Agent/CapRegistry.cpp +++ b/Agent/CapRegistry.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapRegistry.h b/Agent/CapRegistry.h index 8824021d..5cfe37d8 100644 --- a/Agent/CapRegistry.h +++ b/Agent/CapRegistry.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapSnmp.cpp b/Agent/CapSnmp.cpp deleted file mode 100644 index 2b0d39cd..00000000 --- a/Agent/CapSnmp.cpp +++ /dev/null @@ -1,732 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2015 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -// Snmp.cpp => Implement snmp call interface. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "CapSnmp.h" -#include "ExecCommand.h" -#include "SnmpQuery.h" -#include "SnmpResponse.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CCapSnmp::CCapSnmp() -{ - -} - -CCapSnmp::~CCapSnmp() -{ - -} - -////////////////////////////////////////////////////////////////////// -// Call OcsSnmp.exe with ipdiscover statement -////////////////////////////////////////////////////////////////////// - -void CCapSnmp::CallSnmp(CConnexionAbstract *pConnexion, CConfig *m_pConfig){ - - // Phases objects - CString csMessage; - CSnmpQuery *pSnmp = NULL; - CSnmpResponse *pSnmpResponse = NULL; - int m_nExitCode = OCS_APP_NO_ERROR; - - /***** - * - * Launch SNMP inventory - * - ****/ - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Launch snmp scan")); - pSnmp = new CSnmpQuery(m_pConfig->isNotifyRequired()); - - /***** - * - * SNMP handler - * - ****/ - - ////////////////////////////////////////////////////////////////////////////////// - // If the snmp feature is enable on OCS Inventory => SNMP Scan for this host. // - ////////////////////////////////////////////////////////////////////////////////// - - CString csCmd; - CString Type = _T("Unknow"); - bool SnmpOk; - - // Check for additional community in OCS inventory. - - - //////////////////////// - // Test device type // - //////////////////////// - - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Create Array")); - - /////////////////////////////////////////////////////////// - // Defaults OID to scan for each SNMP responsive device // - /////////////////////////////////////////////////////////// - - // Select default oids list whatever snmp type detected - CStringArray default_oids; - default_oids.Add(_T("1.3.6.1.2.1.1.5.0")); - default_oids.Add(_T("1.3.6.1.2.1.1.1.0")); - default_oids.Add(_T("1.3.6.1.2.1.1.6.0")); - default_oids.Add(_T("1.3.6.1.2.1.1.3.0")); - default_oids.Add(_T("1.3.6.1.2.1.1.2.0")); - default_oids.Add(_T("1.3.6.1.2.1.1.4.0")); - default_oids.Add(_T("1.3.6.1.2.1.2.2.1.6.")); - default_oids.Add(_T("1.3.6.1.2.1.2.2.1.2.")); - default_oids.Add(_T("1.3.6.1.2.1.2.2.1.3")); - - // Set default name according to oids list - CStringArray default_names; - default_names.Add(_T("NAME")); - default_names.Add(_T("DESCRIPTION")); - default_names.Add(_T("LOCATION")); - default_names.Add(_T("UPTIME")); - default_names.Add(_T("SNMPDEVICEID")); //Oid Object - default_names.Add(_T("CONTACT")); - default_names.Add(_T("MACADDR")); - default_names.Add(_T("IPADDR")); //ifdescr - default_names.Add(_T("TYPE")); // iftype - - ////////////////////////////////////// - // Test if device anwser SNMP call // - ////////////////////////////////////// - - std::string line; - std::ifstream ipList("snmplist.txt"); - CString Line; - CString IP; - CString MAC; - CString Community; - CExecCommand cmProcess; - - if (ipList.is_open()) - { - while (std::getline(ipList, line)) - { - - // Format line in file - Line.Format(_T("%S"), line.c_str()); - - // Split IP / MAC - IP = Line.Left(Line.Find(_T(" "))); - Line.Replace(IP, _T("")); - Line.Replace(_T(" "), _T("")); - MAC = Line; - - // Test with default snmp request if snmp anwser to call - csCmd.Format(_T("\"%s\\OcsSnmp.exe\" %s %s"), getInstallFolder(), IP, Community); - cmProcess.execWait(csCmd, getDataFolder()); - //_wsystem(csCmd); - - // Check if device anwser default snmp community - - std::ifstream myfile("snmp.txt"); - CString c_line; - CString bad_line = _T("Timeout"); - Community = _T("public"); - - if (myfile.is_open()) - { - while (std::getline(myfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - if (c_line.Find(bad_line) != -1){ - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => %s do not anwser public snmp call, skip this host"), IP); - SnmpOk = false; - } - else{ - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => %s anwser public snmp call, initiate SNMP scan for this host"), IP); - SnmpOk = true; - } - - } - myfile.close(); - } - - // Try with other community if not ok with public community - if (!SnmpOk){ - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Try with community retrieved by ocs server")); - std::ifstream comfile("snmp_com.txt"); - while (std::getline(comfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - BOOL okCom = this->CheckOid(c_line, IP, _T("1.3.6.1.2.1.1.1.0")); - - if (okCom){ - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Custom community work on selected device, using it for scaning ...")); - Community = c_line; - SnmpOk = true; - } - - } - myfile.close(); - } - - //////////////////////////////////////////////////////////////// - // Scan defaults oids on this device if he anwser snmp calls // - //////////////////////////////////////////////////////////////// - - if (SnmpOk){ - - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Perform types check ...")); - BOOL okPrinter = this->CheckOid(Community, IP, _T("1.3.6.1.2.1.25.3.5.1.1.1")); - BOOL okPhysical = this->CheckOid(Community, IP, _T("1.3.6.1.2.1.47.1.1.1.1.5")); - CString physEnt = this->PhysicalModule(Community, IP); - //std::string physEnt = "Switches"; - - CMarkup *snmpXml = pSnmp->getXmlPointerContent(); - snmpXml->AddElem(_T("DEVICE")); - snmpXml->AddElem(_T("COMMON")); - - // Send snmp request. - for (int i = 0; i < 9; i++) - { - CString Oid = default_oids[i]; - - csCmd.Format(_T("\"%s\\OcsSnmp.exe\" %s %s %s"), getInstallFolder(), IP, Community, Oid); - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP CMD => %s"), csCmd); - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP OID => %s"), Oid); - cmProcess.execWait(csCmd, getDataFolder()); - //_wsystem(csCmd); - - std::string line; - std::ifstream myfile("snmp.txt"); - CString c_line; - - if (myfile.is_open()) - { - while (std::getline(myfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP => Result : %s"), c_line); - } - myfile.close(); - } - - if (i == 4){ - c_line = MAC; - } - if (i == 6){ - c_line = MAC; - } - if (i == 7){ - c_line = IP; - } - if (i == 8){ - - if (okPrinter){ - c_line = _T("Printer"); - } - - } - - c_line.Replace(_T("\""), _T(" ")); - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP ADD XML => %s"), c_line); - snmpXml->AddChildElem(default_names[i], c_line); - - } - - // Check for devices. - snmpXml->OutOfElem(); - - // Printer ? - if (okPrinter){ - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP => printer module executing ...")); - this->PrinterModule(Community, IP, snmpXml); - } - - // Switch ? Cards ? Fan ? - if (okPhysical){ - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP => physical module executing ...")); - this->ScanPhysicalModule(Community, IP, snmpXml, physEnt); - } - - } - - } - - } - - /***** - * - * Send inventory - * - ****/ - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Sending Inventory")); - pSnmpResponse = new CSnmpResponse(pConnexion->sendRequest(pSnmp)); - pSnmpResponse->setErrorStatus(pConnexion->getErrorStatus()); - pSnmpResponse->setErrorString(pConnexion->getErrorString()); - if (pSnmpResponse->isSuccess()) - { - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Inventory successfully sent")); - pSnmp->setSuccess(); - } - else - { - m_pLogger->log(LOG_PRIORITY_ERROR, _T("SNMP => Failed to send Inventory <%s>"), pSnmpResponse->getErrorString()); - m_nExitCode = OCS_APP_NETWORK_ERROR; - } - - /***** - * - * Writes the plain xml file on disk (for debugging purpose) - * only if the "/xml" option was provided - * - ****/ - if (m_pConfig->isXmlRequired()) - { - csMessage.Format(_T("%s\\snmp.xml"), m_pConfig->getXmlFolder(), getOcsDeviceID()->getDeviceID()); - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("AGENT => Writing standard XML file <%s> required by argument /XML"), csMessage); - WriteVoidToFile(pSnmp->getMessage(), pSnmp->getMessage().GetLength(), csMessage); - } - -} - -////////////////////////////////////////////////////////////////////// -// Printer module check and scan if needed + statut translation -////////////////////////////////////////////////////////////////////// -void CCapSnmp::PrinterModule(CString Community, CString IP, CMarkup *Xml){ - - CExecCommand cmProcess; - CString csCmd; - - // Printer basic information - CStringArray printer_oids; - printer_oids.Add(_T("1.3.6.1.2.1.43.5.1.1.16.1")); - printer_oids.Add(_T("1.3.6.1.2.1.43.5.1.1.17.1")); - printer_oids.Add(_T("1.3.6.1.2.1.43.10.2.1.4.1.1")); - printer_oids.Add(_T("1.3.6.1.2.1.25.3.5.1.1.1")); - printer_oids.Add(_T("1.3.6.1.2.1.25.3.5.1.2.1")); - - CStringArray printer_names; - printer_names.Add(_T("NAME")); - printer_names.Add(_T("SERIALNUMBER")); - printer_names.Add(_T("COUNTER")); - printer_names.Add(_T("STATUS")); - printer_names.Add(_T("ERRORSTATE")); //Oid Object - - Xml->AddElem(_T("PRINTERS")); - - for (size_t i = 0; i < 5; i++) - { - CString Oid = printer_oids[i]; - - csCmd.Format(_T("\"%s\\OcsSnmp.exe\" %s %s %s"), getInstallFolder(), IP, Community, Oid); - cmProcess.execWait(csCmd, getDataFolder()); - //_wsystem(csCmd); - - std::string line; - std::ifstream myfile("snmp.txt"); - CString c_line; - - if (myfile.is_open()) - { - while (std::getline(myfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - } - myfile.close(); - } - - if (i == 3){ - - if (c_line.Find(_T("1")) != -1) - c_line = _T("other"); - if (c_line.Find(_T("2")) != -1) - c_line = _T("unknown"); - if (c_line.Find(_T("3")) != -1) - c_line = _T("idle"); - if (c_line.Find(_T("4")) != -1) - c_line = _T("printing"); - if (c_line.Find(_T("5")) != -1) - c_line = _T("warmup"); - - } - c_line.Replace(_T("\""), _T(" ")); - Xml->AddChildElem(printer_names[i], c_line); - } - - Xml->OutOfElem(); - - BOOL okCartridges = this->CheckOid(Community, IP, _T("1.3.6.1.2.1.43.11.1.1.6")); - if (okCartridges){ - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP => cartridges module executing ...")); - this->CartridgesModule(Community,IP,Xml); - } - - BOOL okTrays = this->CheckOid(Community, IP, _T("1.3.6.1.2.1.43.8.2.1.13")); - if (okTrays){ - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP => trays module executing ...")); - this->TraysModule(Community, IP, Xml); - } - -} - -////////////////////////////////////////////////////////////////////// -// Check the exsitance of an Oid in the remote host -////////////////////////////////////////////////////////////////////// -BOOL CCapSnmp::CheckOid(CString Community, CString IP, CString Oid){ - - CExecCommand cmProcess; - CString csCmd; - std::string line; - - // Test with default snmp request if snmp anwser to call - csCmd.Format(_T("\"%s\\OcsSnmp.exe\" %s %s %s"), getInstallFolder(), IP, Community, Oid); - cmProcess.execWait(csCmd, getDataFolder()); - //_wsystem(csCmd); - - - std::ifstream myfile("snmp.txt"); - CString c_line; - CString bad_line = _T("No such name"); - CString bad_line2 = _T("Timeout"); - - if (myfile.is_open()) - { - while (std::getline(myfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - if (c_line.Find(bad_line2) != -1){ - return false; - } - if (c_line.Find(bad_line) != -1){ - return false; - } - else{ - return true; - } - - } - myfile.close(); - } - -} - -////////////////////////////////////////////////////////////////////// -// Search for Trays oid -////////////////////////////////////////////////////////////////////// -void CCapSnmp::TraysModule(CString Community, CString IP, CMarkup *Xml){ - - CExecCommand cmProcess; - CString csCmd; - std::string line; - - // trayinfo - CStringArray trays_oids; - trays_oids.Add(_T("1.3.6.1.2.1.43.8.2.1.13")); - trays_oids.Add(_T("1.3.6.1.2.1.43.8.2.1.18")); - trays_oids.Add(_T("1.3.6.1.2.1.43.8.2.1.10")); - trays_oids.Add(_T("1.3.6.1.2.1.43.8.2.1.9")); - - CStringArray trays_names; - trays_names.Add(_T("NAME")); - trays_names.Add(_T("DESCRIPTION")); - trays_names.Add(_T("LEVEL")); - trays_names.Add(_T("MAXCAPACITY")); - - Xml->AddElem(_T("TRAYS")); - - for (size_t i = 0; i < 4; i++) - { - CString Oid = trays_oids[i]; - - csCmd.Format(_T("\"%s\\OcsSnmp.exe\" %s %s %s"), getInstallFolder(), IP, Community, Oid); - cmProcess.execWait(csCmd, getDataFolder()); - //_wsystem(csCmd); - - std::string line; - std::ifstream myfile("snmp.txt"); - CString c_line; - - if (myfile.is_open()) - { - while (std::getline(myfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - } - myfile.close(); - } - - c_line.Replace(_T("\""), _T(" ")); - Xml->AddChildElem(trays_names[i], c_line); - } - - Xml->OutOfElem(); - -} - -////////////////////////////////////////////////////////////////////// -// Search for cartridges Oid -////////////////////////////////////////////////////////////////////// -void CCapSnmp::CartridgesModule(CString Community, CString IP, CMarkup *Xml){ - - CExecCommand cmProcess; - CString csCmd; - std::string line; - - // trayinfo - CStringArray cartridges_oids; - cartridges_oids.Add(_T("1.3.6.1.2.1.43.11.1.1.6")); - cartridges_oids.Add(_T("1.3.6.1.2.1.43.11.1.1.5")); - cartridges_oids.Add(_T("1.3.6.1.2.1.43.11.1.1.9")); - cartridges_oids.Add(_T("1.3.6.1.2.1.43.11.1.1.8")); - cartridges_oids.Add(_T("1.3.6.1.2.1.43.12.1.1.4")); - - CStringArray cartridges_names; - cartridges_names.Add(_T("DESCRIPTION")); - cartridges_names.Add(_T("TYPE")); - cartridges_names.Add(_T("LEVEL")); - cartridges_names.Add(_T("MAXCAPACITY")); - cartridges_names.Add(_T("COLOR")); //Oid Object - - Xml->AddElem(_T("CARTRIDGES")); - - for (size_t i = 0; i < 5; i++) - { - CString Oid = cartridges_oids[i]; - - csCmd.Format(_T("\"%s\\OcsSnmp.exe\" %s %s %s"), getInstallFolder(), IP, Community, Oid); - cmProcess.execWait(csCmd, getDataFolder()); - //_wsystem(csCmd); - - std::string line; - std::ifstream myfile("snmp.txt"); - CString c_line; - - if (myfile.is_open()) - { - while (std::getline(myfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - } - myfile.close(); - } - - c_line.Replace(_T("\""), _T(" ")); - Xml->AddChildElem(cartridges_names[i], c_line); - } - - Xml->OutOfElem(); - -} - -////////////////////////////////////////////////////////////////////// -// Search for physical entities (Switch / snmpcard etc etc ) -////////////////////////////////////////////////////////////////////// -CString CCapSnmp::PhysicalModule(CString Community, CString IP){ - - CExecCommand cmProcess; - CString Oid = _T("1.3.6.1.2.1.47.1.1.1.1.5"); - CString csCmd ; - std::string line; - CString Type; - - // Test with default snmp request if snmp anwser to call - csCmd.Format(_T("\"%s\\OcsSnmp.exe\" %s %s %s"), getInstallFolder(), IP, Community, Oid); - cmProcess.execWait(csCmd, getDataFolder()); - //_wsystem(csCmd); - - std::ifstream myfile("snmp.txt"); - CString c_line; - CString bad_line = _T("No such name"); - - if (myfile.is_open()) - { - while (std::getline(myfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP => %s ..."), c_line); - if (c_line.Find(bad_line) != -1){ - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP => None"), c_line); - Type = _T("None"); - return Type; - } - else{ - - m_pLogger->log(LOG_PRIORITY_DEBUG, _T("SNMP => %s type"), c_line); - if (c_line.Find(_T("3")) != -1){ - Type = _T("Switchs"); - } - if (c_line.Find(_T("6")) != -1){ - Type = _T("PowerSupplies"); - } - if (c_line.Find(_T("7")) != -1){ - Type = _T("Fans"); - } - if (c_line.Find(_T("9")) != -1){ - Type = _T("Cards"); - } - return Type; - - } - - } - myfile.close(); - } - -} - -////////////////////////////////////////////////////////////////////// -// Scan oif from physical entities (Switch / snmpcard etc etc ) -////////////////////////////////////////////////////////////////////// -void CCapSnmp::ScanPhysicalModule(CString Community, CString IP, CMarkup *Xml, CString Name){ - - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => phys in")); - - CExecCommand cmProcess; - CString csCmd; - std::string line; - - // trayinfo - CStringArray phys_oids; - phys_oids.Add(_T("1.3.6.1.2.1.47.1.1.1.1.2.")); - phys_oids.Add(_T("1.3.6.1.2.1.47.1.1.1.1.7.")); - phys_oids.Add(_T("1.3.6.1.2.1.47.1.1.1.1.8.")); - phys_oids.Add(_T("1.3.6.1.2.1.47.1.1.1.1.9.")); - phys_oids.Add(_T("1.3.6.1.2.1.47.1.1.1.1.10.")); - phys_oids.Add(_T("1.3.6.1.2.1.47.1.1.1.1.11.")); - phys_oids.Add(_T("1.3.6.1.2.1.47.1.1.1.1.12.")); - phys_oids.Add(_T("1.3.6.1.2.1.47.1.1.1.1.13.")); - - CStringArray phys_names; - phys_names.Add(_T("DESCRIPTION")); - phys_names.Add(_T("REFERENCE")); - phys_names.Add(_T("REVISION")); - phys_names.Add(_T("FIRMWARE")); - phys_names.Add(_T("SOFTWARE")); //Oid Object - phys_names.Add(_T("SERIALNUMBER")); - phys_names.Add(_T("MANUFACTURER")); - phys_names.Add(_T("TYPE")); - - Name.MakeUpper(); - Xml->AddElem(Name); - - for (size_t i = 0; i < 7; i++) - { - CString Oid = phys_oids[i]; - - csCmd.Format(_T("\"%s\\OcsSnmp.exe\" %s %s %s"), getInstallFolder(), IP, Community, Oid); - cmProcess.execWait(csCmd, getDataFolder()); - //_wsystem(csCmd); - - std::string line; - std::ifstream myfile("snmp.txt"); - CString c_line; - CString bad_line = _T("No such name"); - - if (myfile.is_open()) - { - while (std::getline(myfile, line)) - { - c_line.Format(_T("%S"), line.c_str()); - } - myfile.close(); - } - - if (c_line.Find(bad_line) == -1){ - c_line.Replace(_T("\""), _T(" ")); - Xml->AddChildElem(phys_names[i], c_line); - } - - } - - Xml->OutOfElem(); - -} - -////////////////////////////////////////////////////////////////////// -// Call OcsSnmp.exe with ipdiscover statement using custom mibs -////////////////////////////////////////////////////////////////////// - -void CCapSnmp::CallCustomMibs(std::string IpAddr, std::string Community){ - -} - - -/*** -* -* Retrieve the communities from prolog response -* -***/ -BOOL CCapSnmp::RetrieveCommunities() -{ - - INT_PTR nIndex = 0; - INT_PTR nCptr = 0; - CMapStringToStringArray *pQueryArray = NULL; - CMapStringToString *pQuery = NULL; - - try - { - // Retrieve the CMapStringToString array (we have to delete it) - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Get SNMP parameters from the server")); - pQueryArray = m_pPrologResp->getSnmpParameters(); - if ((pQueryArray == NULL) || pQueryArray->IsEmpty()) - { - // No registry query defined - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => No communities detected, using default (public)")); - return TRUE; - } - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Communities available using them with default one (public)")); - for (nIndex = 0; nIndexGetCount(); nIndex++) - { - CString csName, - csType; - - pQuery = pQueryArray->GetAt(nIndex); - if ((pQuery == NULL) || pQuery->IsEmpty()) - continue; - if (!pQuery->Lookup(_T("TYPE"), csType)) - csType.Empty(); - if (!pQuery->Lookup(_T("NAME"), csName)) - csName.Empty(); - - if (csType.Find(_T("COMMUNITY")) != -1 ){ - std::ofstream comlist; - comlist.open("snmp_com.txt", std::ios_base::app); - std::string name = CT2A(csName); - comlist << name << "\n"; - comlist.close(); - nCptr++; - } - - - } - delete pQueryArray; - pQueryArray = NULL; - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => %d community successfully added"), nCptr); - return TRUE; - } - catch (CException *pEx) - { - pEx->Delete(); - if (pQueryArray) - delete pQueryArray; - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("SNMP => Unknown error while executing query %d"), nIndex + 1); - return FALSE; - } - -} diff --git a/Agent/CapSnmp.h b/Agent/CapSnmp.h deleted file mode 100644 index 691cef3f..00000000 --- a/Agent/CapSnmp.h +++ /dev/null @@ -1,62 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2015 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -// Snmp.h: interface for the Snmp class -// -////////////////////////////////////////////////////////////////////// - -#pragma once -#ifndef WIN32 -#include -#define THREAD_CC -#define THREAD_TYPE pthread_t -#define THREAD_CREATE(tid, entry, arg) pthread_create(&(tid), NULL, \ - (entry), (arg)) -#else -#include -#define THREAD_CC __cdecl -#define THREAD_TYPE DWORD -#define THREAD_CREATE(tid, entry, arg) do { _beginthread((entry), 0, (arg));\ - (tid) = GetCurrentThreadId(); \ - } while (0) -#endif /* WIN32 */ - -#include "OCSInventory Front.h" -#include "CapacityAbstract.h" -#include "OCSInventory.h" -#include -#include -#include -#include -#include - -class CCapSnmp : public CCapacityAbstract -{ - -public: // Methods - - // Standard constructor.and destructor - CCapSnmp(); - ~CCapSnmp(); - - BOOL CheckOid(CString Community, CString IP, CString Oid); - - void PrinterModule(CString Community, CString IP, CMarkup *Xml); - void TraysModule(CString Community, CString IP, CMarkup *Xml); - void CartridgesModule(CString Community, CString IP, CMarkup *Xml); - CString PhysicalModule(CString Community, CString IP); - void ScanPhysicalModule(CString Community, CString IP, CMarkup *Xml, CString Name); - BOOL RetrieveCommunities(); - // Call OcsSnmp - void CallSnmp(CConnexionAbstract *pConnexion, CConfig *m_pConfig); - // Call Custom mibs files in snmp directory - void CallCustomMibs(std::string IpAddr, std::string Community); - -}; diff --git a/Agent/CapacityAbstract.cpp b/Agent/CapacityAbstract.cpp index 659e07d7..611d4a51 100644 --- a/Agent/CapacityAbstract.cpp +++ b/Agent/CapacityAbstract.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/CapacityAbstract.h b/Agent/CapacityAbstract.h index 4da25f99..9033d733 100644 --- a/Agent/CapacityAbstract.h +++ b/Agent/CapacityAbstract.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/OCSInventory.cpp b/Agent/OCSInventory.cpp index eba94220..5070eecc 100644 --- a/Agent/OCSInventory.cpp +++ b/Agent/OCSInventory.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -130,7 +130,7 @@ BOOL COCSInventoryApp::InitInstance() m_pLogger = getOcsLogger(); m_pLogger->setApplication( AfxGetAppName()); m_pLogger->log( LOG_PRIORITY_NOTICE, _T( "==============================================================================")); - m_pLogger->log( LOG_PRIORITY_NOTICE, _T( "Starting OCS Inventory NG Agent on %s."), cStartTime.Format( _T( "%#c"))); + m_pLogger->log( LOG_PRIORITY_NOTICE, _T( "Starting OCS Inventory Agent on %s."), cStartTime.Format( _T( "%#c"))); // Agent Configuration m_pConfig = getAgentConfig(); @@ -144,7 +144,6 @@ BOOL COCSInventoryApp::InitInstance() // Capacities CCapRegistry cCapRegistry; CCapIpdiscover cCapIpdiscover; - CCapSnmp cCapSnmp; CCapDownload cCapDownload; CCapExecute cCapExec; @@ -194,8 +193,8 @@ BOOL COCSInventoryApp::InitInstance() csMessage=_T( "0001"); } m_pConfig->setVersion( csMessage); - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("AGENT => Running OCS Inventory NG Agent Version %s"), csMessage); - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("AGENT => Using OCS Inventory NG FrameWork Version %s"), getFrameworkVersion()); + m_pLogger->log(LOG_PRIORITY_NOTICE, _T("AGENT => Running OCS Inventory Agent Version %s"), csMessage); + m_pLogger->log(LOG_PRIORITY_NOTICE, _T("AGENT => Using OCS Inventory FrameWork Version %s"), getFrameworkVersion()); /***** * @@ -376,7 +375,6 @@ BOOL COCSInventoryApp::InitInstance() * ****/ cCapRegistry.setProlog( pProlog); - cCapSnmp.setProlog(pProlog); cCapIpdiscover.setProlog( pProlog); cCapDownload.setProlog( pProlog); cCapExec.setProlog( pProlog); @@ -415,7 +413,6 @@ BOOL COCSInventoryApp::InitInstance() * ****/ cCapRegistry.setPrologResp( pPrologResp); - cCapSnmp.setPrologResp(pPrologResp); cCapIpdiscover.setPrologResp( pPrologResp); cCapDownload.setPrologResp( pPrologResp); cCapExec.setPrologResp( pPrologResp); @@ -468,24 +465,10 @@ BOOL COCSInventoryApp::InitInstance() { cCapRegistry.setInventory( pInventory); cCapIpdiscover.setInventory( pInventory); - cCapSnmp.setInventory(pInventory); cCapDownload.setInventory( pInventory); cCapExec.setInventory( pInventory); } - /***** - * - * Using capacities on inventory (not in notify mode) - * - ****/ - if (pPrologResp->isSnmpRequired()){ - // Remove previous snmp list files - remove("snmp.txt"); - remove("snmp_com.txt"); - remove("snmplist.txt"); - cCapSnmp.RetrieveCommunities(); - } - // Feed inventory with required registry keys (not in notify mode) if (!m_pConfig->isNotifyRequired() && pPrologResp->isRegistryRequired()) { @@ -586,16 +569,6 @@ BOOL COCSInventoryApp::InitInstance() delete pInventoryResponse; } - /***** - * - * SNMP handler - * - ****/ - if (pPrologResp->isSnmpRequired()){ - cCapSnmp.CallSnmp(pConnexion, m_pConfig); - } - - /***** * * Download (not in notify mode) diff --git a/Agent/OCSInventory.h b/Agent/OCSInventory.h index 54307792..c44ffafa 100644 --- a/Agent/OCSInventory.h +++ b/Agent/OCSInventory.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -32,7 +32,6 @@ #include "ComProvider.h" #include "CapRegistry.h" #include "CapIpdiscover.h" -#include "CapSnmp.h" #include "CapDownload.h" #include "CapExecute.h" #include "NotifyUser.h" diff --git a/Agent/OCSInventory.rc b/Agent/OCSInventory.rc index 8a961764..84ca8b58 100644 --- a/Agent/OCSInventory.rc +++ b/Agent/OCSInventory.rc @@ -34,8 +34,8 @@ IDR_MAINFRAME ICON "res\\OCSInventory.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -50,16 +50,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG Agent" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG Agent" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory Agent" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory Agent" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "OCSInventory.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OCSInventory.exe" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" diff --git a/Agent/OCSInventory.vcxproj b/Agent/OCSInventory.vcxproj index 52b65ffe..05174195 100644 --- a/Agent/OCSInventory.vcxproj +++ b/Agent/OCSInventory.vcxproj @@ -23,33 +23,33 @@ {BF43603D-08D1-4CBA-9FD3-6EBB7BBDCED9} Agent MFCProj - 10.0.18362.0 + 10.0 Application - v141 + v142 Dynamic Unicode true Application - v141 + v142 Dynamic Unicode Application - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 @@ -188,7 +188,6 @@ - @@ -205,7 +204,6 @@ - diff --git a/Agent/PluginApi.h b/Agent/PluginApi.h index aa524726..846b04e2 100644 --- a/Agent/PluginApi.h +++ b/Agent/PluginApi.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/Plugins.cpp b/Agent/Plugins.cpp index 67963bc6..11703ddb 100644 --- a/Agent/Plugins.cpp +++ b/Agent/Plugins.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/Plugins.h b/Agent/Plugins.h index ea5c6048..4707f960 100644 --- a/Agent/Plugins.h +++ b/Agent/Plugins.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/stdafx.cpp b/Agent/stdafx.cpp index 0dd1ed6f..f5d4892a 100644 --- a/Agent/stdafx.cpp +++ b/Agent/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/stdafx.h b/Agent/stdafx.h index d8e07cda..a348e4c5 100644 --- a/Agent/stdafx.h +++ b/Agent/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Agent/targetver.h b/Agent/targetver.h index 588e6914..8044e3bd 100644 --- a/Agent/targetver.h +++ b/Agent/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/CHANGELOG b/CHANGELOG index fd4b4d7f..5cabbfbd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,11 @@ -2.6.0.0 +2.7.0.0 + * Remove SNMP Feature (only on Linux agent, see documentation) + * Add countdown on dialog box when deployment is finished + +2.6.0.1 + * Improvement of powershell loader to use the 64 bits of powershell + +2.6.0.0 * Refactoring agent in 64 bits * Add deployement support for package greater than 4GB (ZipArchive library in commercial version) * Fix bug kill process OcsSystray.exe when upgrade or uninstall agent diff --git a/ComHTTP/ComHTTP.vcxproj b/ComHTTP/ComHTTP.vcxproj index 6b58eabb..2ce7a454 100644 --- a/ComHTTP/ComHTTP.vcxproj +++ b/ComHTTP/ComHTTP.vcxproj @@ -22,33 +22,33 @@ {5422560E-7CE8-43FB-816C-8A2C48F4F491} ComHTTP MFCDLLProj - 10.0.18362.0 + 10.0 DynamicLibrary - v141 + v142 Dynamic Unicode true DynamicLibrary - v141 + v142 Dynamic Unicode DynamicLibrary - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 diff --git a/ComHTTP/HTTP.cpp b/ComHTTP/HTTP.cpp index 29a2861f..ffa93e4d 100644 --- a/ComHTTP/HTTP.cpp +++ b/ComHTTP/HTTP.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/HTTP.h b/ComHTTP/HTTP.h index aa6b7067..5cf1e88f 100644 --- a/ComHTTP/HTTP.h +++ b/ComHTTP/HTTP.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/HTTP.rc b/ComHTTP/HTTP.rc index 295babc1..69bc1f91 100644 --- a/ComHTTP/HTTP.rc +++ b/ComHTTP/HTTP.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -41,16 +41,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG Communication Provider" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG cURL Communication Provider" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory Communication Provider" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory cURL Communication Provider" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "ComHTTP.dll" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "ComHTTP.dll" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" diff --git a/ComHTTP/HTTPConfig.cpp b/ComHTTP/HTTPConfig.cpp index 32912e6b..f0e5b995 100644 --- a/ComHTTP/HTTPConfig.cpp +++ b/ComHTTP/HTTPConfig.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/HTTPConfig.h b/ComHTTP/HTTPConfig.h index 066acc32..077bff1b 100644 --- a/ComHTTP/HTTPConfig.h +++ b/ComHTTP/HTTPConfig.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/HTTPConnexion.cpp b/ComHTTP/HTTPConnexion.cpp index c8fdd95f..2d367ac3 100644 --- a/ComHTTP/HTTPConnexion.cpp +++ b/ComHTTP/HTTPConnexion.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/HTTPConnexion.h b/ComHTTP/HTTPConnexion.h index 144e9b15..fbd8bfb7 100644 --- a/ComHTTP/HTTPConnexion.h +++ b/ComHTTP/HTTPConnexion.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/HTTPCrypt.cpp b/ComHTTP/HTTPCrypt.cpp index 3c74ed48..e704e114 100644 --- a/ComHTTP/HTTPCrypt.cpp +++ b/ComHTTP/HTTPCrypt.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/HTTPCrypt.h b/ComHTTP/HTTPCrypt.h index fbb6ee63..30c102dc 100644 --- a/ComHTTP/HTTPCrypt.h +++ b/ComHTTP/HTTPCrypt.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/stdafx.cpp b/ComHTTP/stdafx.cpp index c442d647..2e1f1661 100644 --- a/ComHTTP/stdafx.cpp +++ b/ComHTTP/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/stdafx.h b/ComHTTP/stdafx.h index d9020178..d0253be3 100644 --- a/ComHTTP/stdafx.h +++ b/ComHTTP/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/ComHTTP/targetver.h b/ComHTTP/targetver.h index 9fc8ea0c..40b8ed6e 100644 --- a/ComHTTP/targetver.h +++ b/ComHTTP/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Download/BlackList.cpp b/Download/BlackList.cpp index 41892974..1301736f 100644 --- a/Download/BlackList.cpp +++ b/Download/BlackList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Download/BlackList.h b/Download/BlackList.h index 41ff8270..9ecfdaa8 100644 --- a/Download/BlackList.h +++ b/Download/BlackList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Download/Download.cpp b/Download/Download.cpp index f0668ee7..0ae04bf8 100644 --- a/Download/Download.cpp +++ b/Download/Download.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -129,7 +129,7 @@ BOOL CDownloadApp::InitInstance() m_pLogger = getOcsLogger(); m_pLogger->setApplication( AfxGetAppName()); m_pLogger->log( LOG_PRIORITY_NOTICE, _T( "==============================================================================")); - m_pLogger->log( LOG_PRIORITY_NOTICE, _T( "Starting OCS Inventory NG Package Download and Setup Tool on %s."), cStartTime.Format( _T( "%#c"))); + m_pLogger->log( LOG_PRIORITY_NOTICE, _T( "Starting OCS Inventory Package Download and Setup Tool on %s."), cStartTime.Format( _T( "%#c"))); // Agent Configuration m_pConfig = getAgentConfig(); @@ -164,8 +164,8 @@ BOOL CDownloadApp::InitInstance() csMessage=_T( "0.0.0.1"); } m_pConfig->setVersion( csMessage); - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("DOWNLOAD => Running OCS Inventory NG Download Version %s"), csMessage); - m_pLogger->log(LOG_PRIORITY_NOTICE, _T("DOWNLOAD => Using OCS Inventory NG FrameWork Version %s"), getFrameworkVersion()); + m_pLogger->log(LOG_PRIORITY_NOTICE, _T("DOWNLOAD => Running OCS Inventory Download Version %s"), csMessage); + m_pLogger->log(LOG_PRIORITY_NOTICE, _T("DOWNLOAD => Using OCS Inventory FrameWork Version %s"), getFrameworkVersion()); /***** * diff --git a/Download/Download.h b/Download/Download.h index 59a613e5..335245dd 100644 --- a/Download/Download.h +++ b/Download/Download.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Download/Download.rc b/Download/Download.rc index a36bc9d6..f4faf2b3 100644 --- a/Download/Download.rc +++ b/Download/Download.rc @@ -28,8 +28,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -44,16 +44,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG Package Download and Setup Tool" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG Package Download and Setup Tool" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory Package Download and Setup Tool" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory Package Download and Setup Tool" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "Download.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "Download.exe" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" diff --git a/Download/Download.vcxproj b/Download/Download.vcxproj index a41cdf4e..968aeea4 100644 --- a/Download/Download.vcxproj +++ b/Download/Download.vcxproj @@ -22,25 +22,25 @@ {B52FAA55-4EFF-4FBD-B656-13445445DD3A} Download MFCProj - 10.0.18362.0 + 10.0 Application - v141 + v142 Dynamic Unicode true Application - v141 + v142 Dynamic Unicode Application - v141 + v142 x64 Dynamic Unicode @@ -48,7 +48,7 @@ Application - v141 + v142 diff --git a/Download/Package.cpp b/Download/Package.cpp index dda9f56a..a5317db0 100644 --- a/Download/Package.cpp +++ b/Download/Package.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -953,7 +953,7 @@ UINT64 CPackage::executePostCmd( UINT64 uCommandTimeOut) return FALSE; } // Initiate a planned restart to perform application installation. - if (!InitiateSystemShutdownEx( NULL, _T( "OCS Inventory NG must REBOOT your system after package setup"), + if (!InitiateSystemShutdownEx( NULL, _T( "OCS Inventory must REBOOT your system after package setup"), uCommandTimeOut, TRUE, TRUE, SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_INSTALLATION | SHTDN_REASON_FLAG_PLANNED)) { @@ -985,7 +985,7 @@ UINT64 CPackage::executePostCmd( UINT64 uCommandTimeOut) return FALSE; } // Initiate a planned shutdown to perform application installation. - if (!InitiateSystemShutdownEx( NULL, _T( "OCS Inventory NG must SHUTDOWN your system after package setup"), + if (!InitiateSystemShutdownEx( NULL, _T( "OCS Inventory must SHUTDOWN your system after package setup"), uCommandTimeOut, TRUE, FALSE, SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_INSTALLATION | SHTDN_REASON_FLAG_PLANNED)) { diff --git a/Download/Package.h b/Download/Package.h index 04f901f3..61798c2e 100644 --- a/Download/Package.h +++ b/Download/Package.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Download/stdafx.cpp b/Download/stdafx.cpp index 1c7ddb18..d176ccd2 100644 --- a/Download/stdafx.cpp +++ b/Download/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Download/stdafx.h b/Download/stdafx.h index a2e8f679..d9b048c6 100644 --- a/Download/stdafx.h +++ b/Download/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Download/targetver.h b/Download/targetver.h index 588e6914..8044e3bd 100644 --- a/Download/targetver.h +++ b/Download/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/External_Deps/OCS_Make_Required_Libs_x64.bat b/External_Deps/OCS_Make_Required_Libs_x64.bat index 2845c0a5..0d2a7190 100644 --- a/External_Deps/OCS_Make_Required_Libs_x64.bat +++ b/External_Deps/OCS_Make_Required_Libs_x64.bat @@ -13,7 +13,7 @@ echo. Rem ========= UPDATE CONSTANTS BELOW TO MEET YOUR CONFIGURATION NEED ========= Rem Set path to MS Visual C++ -set VC_PATH=C:\Program Files (x86)\\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build +set VC_PATH=C:\Program Files (x86)\\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build Rem Set path to MS Windows SDK, needed to build cURL set WINDOWS_SDK_PATH="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A" diff --git a/NSIS_agent_setup/Banner-ocs.bmp b/NSIS_agent_setup/Banner-ocs.bmp index 62c2ab85..e6d931de 100644 Binary files a/NSIS_agent_setup/Banner-ocs.bmp and b/NSIS_agent_setup/Banner-ocs.bmp differ diff --git a/NSIS_agent_setup/OCS-48.bmp b/NSIS_agent_setup/OCS-48.bmp new file mode 100644 index 00000000..8817ffd2 Binary files /dev/null and b/NSIS_agent_setup/OCS-48.bmp differ diff --git a/NSIS_agent_setup/OCS-NG-48.bmp b/NSIS_agent_setup/OCS-NG-48.bmp deleted file mode 100644 index 4cf84a78..00000000 Binary files a/NSIS_agent_setup/OCS-NG-48.bmp and /dev/null differ diff --git a/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup.nsi b/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup.nsi index 82e5b0c0..cc14c0cc 100644 --- a/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup.nsi +++ b/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup.nsi @@ -11,9 +11,9 @@ setcompressor /SOLID lzma ; HM NIS Edit Wizard helper defines -!define PRODUCT_NAME "OCS Inventory NG Agent" -!define PRODUCT_VERSION "2.6.0.1" -!define PRODUCT_PUBLISHER "OCS Inventory NG Team" +!define PRODUCT_NAME "OCS Inventory Agent" +!define PRODUCT_VERSION "2.7.0.0" +!define PRODUCT_PUBLISHER "OCS Inventory Team" !define PRODUCT_WEB_SITE "http://www.ocsinventory-ng.org" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\OCSInventory.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" @@ -33,7 +33,7 @@ ICON "install-ocs.ico" ; MUI Settings !define MUI_HEADERIMAGE !define MUI_WELCOMEPAGE_TITLE_3LINES -!define MUI_HEADERIMAGE_BITMAP "OCS-NG-48.bmp" ; optional +!define MUI_HEADERIMAGE_BITMAP "OCS-48.bmp" ; optional !define MUI_ABORTWARNING !define MUI_ICON "install-ocs.ico" !define MUI_UNICON "uninstall-ocs.ico" @@ -55,7 +55,7 @@ Page custom AskLocalInventory ValidateLocalInventory "" ; View before start page !insertmacro MUI_PAGE_INSTFILES ; Finshed page -!define MUI_FINISHPAGE_RUN_TEXT "Start OCS inventory NG Systray Applet" +!define MUI_FINISHPAGE_RUN_TEXT "Start OCS Inventory NG Systray Applet" !define MUI_FINISHPAGE_RUN "$INSTDIR\OcsSystray.exe" !insertmacro MUI_PAGE_FINISH ; Confirl before uninstall @@ -72,7 +72,7 @@ InstType "Network inventory" InstType "Local inventory" ; Setup log file -!define SETUP_LOG_FILE "$exedir\OCS-NG-Windows-Agent-Setup.log" +!define SETUP_LOG_FILE "$exedir\OCS-Windows-Agent-Setup.log" !define Service_Time_Out "10" @@ -86,9 +86,9 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Distributed under GNU GP VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${PRODUCT_NAME}" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" -BRANDINGTEXT "OCS Inventory NG" +BRANDINGTEXT "OCS Inventory" Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "OCS-NG-Windows-Agent-Setup.exe" +OutFile "OCS-Windows-Agent-Setup.exe" InstallDir "$PROGRAMFILES64\OCS Inventory Agent" #InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowUnInstDetails show @@ -682,12 +682,16 @@ stop_service_end_loop: ; 703 = Unable to get procedure address from KERNEL32.DLL ; 704 = CreateToolhelp32Snapshot failed sleep 1000 - KillProcDLL::KillProc "OcsSystray.exe" $R0 + nsProcess::_FindProcess "OcsSystray.exe" + StrCpy $logBuffer "Trying to find process OcsSystray.exe...Result: $R0$\r$\n" + Call Write_Log + sleep 1000 + nsProcess::_KillProcess "OcsSystray.exe" $R0 StrCpy $logBuffer "Trying to kill process OcsSystray.exe...Result: $R0$\r$\n" Call Write_Log ; If OcsSystray killed, perhaps there is another process running under another user session, ; So try to kill OcsSystray.exe until there no process or error detected - StrCmp "$R0" "0" stop_service_end_loop + StrCmp "$R0" "1" stop_service_end_loop sleep 1000 KillProcDLL::KillProc "OcsService.exe" $R0 StrCpy $logBuffer "Trying to kill process OcsService.exe...Result: $R0$\r$\n" @@ -778,7 +782,7 @@ Function un.StopService StrCpy $logBuffer "$0$\r$\n" Call un.Write_Log strcpy $1 0 -un.stop_service_loop: + un.stop_service_loop: intop $1 $1 + 1 strcmp ${Service_Time_Out} $1 un.stop_service_time_out_reached 0 sleep 950 @@ -789,12 +793,12 @@ un.stop_service_loop: StrCpy $logBuffer "$0 - waiting 1 second(s) for service to stop...$\r$\n" Call un.Write_Log strcmp $0 "YES" un.stop_service_loop un.stop_service_end_loop -un.stop_service_time_out_reached: + un.stop_service_time_out_reached: StrCpy $logBuffer "Error time out reached while waiting for service stop!$\r$\n" Call un.Write_Log StrCpy $logBuffer "Will try to kill processes..$\r$\n" Call un.Write_Log -un.stop_service_end_loop: + un.stop_service_end_loop: ; KillProcDLL ; 0 = Process was successfully terminated ; 603 = Process was not currently running @@ -1117,7 +1121,7 @@ Function .onInit Call Write_Log StrCpy $logBuffer "Checking if setup not already running..." Call Write_Log - System::Call 'kernel32::CreateMutexA(i 0, i 0, t "OcsSetupNG") i .r1 ?e' + System::Call 'kernel32::CreateMutexA(i 0, i 0, t "OcsSetup") i .r1 ?e' Pop $R0 StrCmp $R0 0 not_running StrCpy $logBuffer "Yes$\r$\nABORT: Setup already running !" @@ -1225,7 +1229,7 @@ WriteAgentSetupDone_ReadFile: FileClose $0 ; Get result code to write Pop $2 - StrCpy $logBuffer "Writing setup result <$2> for Package ID <$1> to file <$APPDATA\OCS Inventory NG\Agent\Download\OCSNG-Windows-Agent-Setup_done>...$\r$\n" + StrCpy $logBuffer "Writing setup result <$2> for Package ID <$1> to file <$APPDATA\OCS Inventory NG\Agent\Download\OCS-Windows-Agent-Setup_done>...$\r$\n" Call Write_Log ; WRITE ../done SetOutPath "$exedir" @@ -1236,7 +1240,7 @@ WriteAgentSetupDone_ReadFile: ; WRITE OCSNG-Windows-Agent-Setup_done into "$APPDATA\OCS Inventory NG\Agent\Download" directory, because in 2.0 or higher, ; package is unzipped into system TEMP directory and no more under "$APPDATA\OCS Inventory NG\Agent\Download\PackID\Temp" SetShellVarContext All - FileOpen $0 "$APPDATA\OCS Inventory NG\Agent\Download\OCSNG-Windows-Agent-Setup_done" w + FileOpen $0 "$APPDATA\OCS Inventory NG\Agent\Download\OCS-Windows-Agent-Setup_done" w FileWrite $0 "$2$\r$\n" FileWrite $0 "$1$\r$\n" FileClose $0 @@ -1263,14 +1267,14 @@ Function ConfigureFirewall StrCpy $logBuffer "Windows Advanced Firewall is enabled...$\r$\n" Call Write_Log ; Check if agent firewall exists - SimpleFC::AdvExistsRule "OCS Inventory NG Agent" + SimpleFC::AdvExistsRule "OCS Inventory Agent" Pop $0 ; return error(1)/success(0) Pop $1 ; return 1=Exists/0=Doesn�t exists StrCmp "$1" "1" ConfigureFirewall_Skip_Agent StrCpy $logBuffer "Adding custom Windows Firewall rule for <$INSTDIR\ocsinventory.exe>..." Call Write_Log ; Add Agent application to the firewall exception list - All protocol, outgoing, enabled, Networks, All Profiles, Allow, any icmp code, any group, any local port, any remote port, any local address, any remote address - SimpleFC::AdvAddRule "OCS Inventory NG Agent" "Allows any outgoing request for OCS Inventory NG Agent" "256" "2" "1" "2147483647" "1" "$INSTDIR\ocsinventory.exe" "" "" "" "" "" "" + SimpleFC::AdvAddRule "OCS Inventory Agent" "Allows any outgoing request for OCS Inventory Agent" "256" "2" "1" "2147483647" "1" "$INSTDIR\ocsinventory.exe" "" "" "" "" "" "" Pop $0 ; return error(1)/success(0) ${If} $0 > 0 StrCpy $logBuffer "Failed !$\r$\n" @@ -1281,14 +1285,14 @@ Function ConfigureFirewall ${EndIf} ConfigureFirewall_Skip_Agent: ; Check if download firewall exists - SimpleFC::AdvExistsRule "OCS Inventory NG Download and Setup tool" + SimpleFC::AdvExistsRule "OCS Inventory Download and Setup tool" Pop $0 ; return error(1)/success(0) Pop $1 ; return 1=Exists/0=Doesn�t exists StrCmp "$1" "1" ConfigureFirewall_Skip_Download StrCpy $logBuffer "Adding custom Windows Firewall rule for <$INSTDIR\download.exe>..." Call Write_Log ; Add download application to the firewall exception list - TCP protocol, outgoing, enabled, Networks, All Profiles, Allow, any icmp code, any group, any local port, any remote port, any local address, any remote address - SimpleFC::AdvAddRule "OCS Inventory NG Download and Setup tool" "Allows TCP outgoing request for OCS Inventory NG Download and Setup tool" "6" "2" "1" "2147483647" "1" "$INSTDIR\download.exe" "" "" "" "" "" "" + SimpleFC::AdvAddRule "OCS Inventory Download and Setup tool" "Allows TCP outgoing request for OCS Inventory Download and Setup tool" "6" "2" "1" "2147483647" "1" "$INSTDIR\download.exe" "" "" "" "" "" "" Pop $0 ; return error(1)/success(0) ${If} $0 > 0 StrCpy $logBuffer "Failed !$\r$\n" @@ -1310,7 +1314,7 @@ FunctionEnd ##################################################################### Function AskServerOptions ${If} ${SectionIsSelected} 3 ; Index of Network inventory section - !insertmacro MUI_HEADER_TEXT "OCS Inventory NG Server properties" "Fill in OCS Inventory NG Server address and options..." + !insertmacro MUI_HEADER_TEXT "OCS Inventory Server properties" "Fill in OCS Inventory Server address and options..." InstallOptions::dialog "$PLUGINSDIR\server.ini" ${EndIf} FunctionEnd @@ -1330,7 +1334,7 @@ FunctionEnd Function AskAgentOptions ${If} ${SectionIsSelected} 3 ; Index of Network inventory section - !insertmacro MUI_HEADER_TEXT "OCS Inventory NG Agent for Windows properties" "If needed, specify OCS Inventory NG Agent options..." + !insertmacro MUI_HEADER_TEXT "OCS Inventory Agent for Windows properties" "If needed, specify OCS Inventory Agent options..." InstallOptions::dialog "$PLUGINSDIR\agent.ini" ${EndIf} FunctionEnd @@ -1340,7 +1344,7 @@ FunctionEnd Function AskLocalInventory ${If} ${SectionIsSelected} 4 ; Index of Local inventory section - !insertmacro MUI_HEADER_TEXT "OCS Inventory NG Agent for Windows" "Choose folder to save inventory result..." + !insertmacro MUI_HEADER_TEXT "OCS Inventory Agent for Windows" "Choose folder to save inventory result..." InstallOptions::dialog "$PLUGINSDIR\local.ini" ${EndIf} FunctionEnd @@ -1616,7 +1620,7 @@ Section "OCS Inventory Agent" SEC03 clearerrors ; MSVC 9 CRT redist current for XP and higher SetOutPath "$INSTDIR" - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.CRT\msvcp140.dll" + File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.26.28720\x64\Microsoft.VC142.CRT\msvcp140.dll" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying msvcp140.dll $\r$\n" Call Write_Log @@ -1628,50 +1632,44 @@ Section "OCS Inventory Agent" SEC03 Call Write_Log strcpy $installSatus ":(" clearerrors - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.MFC\mfc140.dll" + File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.26.28720\x64\Microsoft.VC142.MFC\mfc140.dll" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying mfc140.dll $\r$\n" Call Write_Log strcpy $installSatus ":(" clearerrors - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.MFC\mfc140u.dll" + File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.26.28720\x64\Microsoft.VC142.MFC\mfc140u.dll" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying mfc140u.dll $\r$\n" Call Write_Log strcpy $installSatus ":(" clearerrors - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.MFC\mfcm140.dll" + File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.26.28720\x64\Microsoft.VC142.MFC\mfcm140.dll" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying mfcm140.dll $\r$\n" Call Write_Log strcpy $installSatus ":(" clearerrors - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.MFC\mfcm140u.dll" + File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.26.28720\x64\Microsoft.VC142.MFC\mfcm140u.dll" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying mfcm140u.dll $\r$\n" Call Write_Log strcpy $installSatus ":(" clearerrors ;Lib for Win 8.0 / 8.1 / win 10 - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.CRT\vcruntime140.dll" - Iferrors 0 +5 - StrCpy $logBuffer "$logBuffer ERROR copying vcruntime140.dll $\r$\n" - Call Write_Log - strcpy $installSatus ":(" - clearerrors - File "vcruntime140_1.dll" + File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.26.28720\x64\Microsoft.VC142.CRT\vcruntime140.dll" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying vcruntime140.dll $\r$\n" Call Write_Log strcpy $installSatus ":(" clearerrors - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.OpenMP\vcomp140.dll" + File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.26.28720\x64\Microsoft.VC142.OpenMP\vcomp140.dll" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying vcomp140.dll $\r$\n" Call Write_Log strcpy $installSatus ":(" clearerrors - File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.CXXAMP\vcamp140.dll" + File "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.26.28720\x64\Microsoft.VC142.CXXAMP\vcamp140.dll" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying vcamp140.dll $\r$\n" Call Write_Log @@ -1756,13 +1754,6 @@ Section "OCS Inventory Agent" SEC03 File "..\Release\OcsNotifyUser.exe" Iferrors 0 +5 StrCpy $logBuffer "$logBuffer ERROR copying OcsNotifyUser.exe $\r$\n" - Call Write_Log - strcpy $installSatus ":(" - clearerrors - ; SNMP - File "..\Release\OcsSnmp.exe" - Iferrors 0 +5 - StrCpy $logBuffer "$logBuffer ERROR copying OcsSnmp.exe $\r$\n" Call Write_Log strcpy $installSatus ":(" clearerrors @@ -1884,7 +1875,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Create folder to store working files (required to store computer identification, logs... Never removed)" !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Migrate configuration data from ${PRODUCT_NAME} 1.X (serie 4000) format" !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Install ${PRODUCT_NAME} files" - !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Run Agent using Service or Logon/GPO script (OCS Inventory NG Server reachable through the network)" + !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Run Agent using Service or Logon/GPO script (OCS Inventory Server reachable through the network)" !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "Run Agent in local inventory mode (write inventory to the specified folder, then remove installed files)" !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "Create uninstaller and add ${PRODUCT_NAME} to the list of installed software" !insertmacro MUI_FUNCTION_DESCRIPTION_END diff --git a/OCSInventory Front/ByteArrayStream.h b/OCSInventory Front/ByteArrayStream.h index a817931b..fd3eaf80 100644 --- a/OCSInventory Front/ByteArrayStream.h +++ b/OCSInventory Front/ByteArrayStream.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ComProvider.cpp b/OCSInventory Front/ComProvider.cpp index dd9c0893..faffb2c0 100644 --- a/OCSInventory Front/ComProvider.cpp +++ b/OCSInventory Front/ComProvider.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ComProvider.h b/OCSInventory Front/ComProvider.h index ebfcf886..fa1f1249 100644 --- a/OCSInventory Front/ComProvider.h +++ b/OCSInventory Front/ComProvider.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Config.cpp b/OCSInventory Front/Config.cpp index 7226be29..aed50c21 100644 --- a/OCSInventory Front/Config.cpp +++ b/OCSInventory Front/Config.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Config.h b/OCSInventory Front/Config.h index 516beff6..a1775f9e 100644 --- a/OCSInventory Front/Config.h +++ b/OCSInventory Front/Config.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ConnexionAbstract.cpp b/OCSInventory Front/ConnexionAbstract.cpp index cb53dade..b7ac4ff1 100644 --- a/OCSInventory Front/ConnexionAbstract.cpp +++ b/OCSInventory Front/ConnexionAbstract.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ConnexionAbstract.h b/OCSInventory Front/ConnexionAbstract.h index ea9351bd..4f6b32f1 100644 --- a/OCSInventory Front/ConnexionAbstract.h +++ b/OCSInventory Front/ConnexionAbstract.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ConnexionLocal.cpp b/OCSInventory Front/ConnexionLocal.cpp index 6169f859..0a5c06fb 100644 --- a/OCSInventory Front/ConnexionLocal.cpp +++ b/OCSInventory Front/ConnexionLocal.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ConnexionLocal.h b/OCSInventory Front/ConnexionLocal.h index 57eb2820..e4ce3554 100644 --- a/OCSInventory Front/ConnexionLocal.h +++ b/OCSInventory Front/ConnexionLocal.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Deviceid.cpp b/OCSInventory Front/Deviceid.cpp index d1afd274..e5d431ce 100644 --- a/OCSInventory Front/Deviceid.cpp +++ b/OCSInventory Front/Deviceid.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Deviceid.h b/OCSInventory Front/Deviceid.h index 7150aada..de996b6c 100644 --- a/OCSInventory Front/Deviceid.h +++ b/OCSInventory Front/Deviceid.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/DownloadRequest.cpp b/OCSInventory Front/DownloadRequest.cpp index 2ca0a5b9..d5a31068 100644 --- a/OCSInventory Front/DownloadRequest.cpp +++ b/OCSInventory Front/DownloadRequest.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/DownloadRequest.h b/OCSInventory Front/DownloadRequest.h index 3427f493..2663c918 100644 --- a/OCSInventory Front/DownloadRequest.h +++ b/OCSInventory Front/DownloadRequest.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/DownloadResponse.cpp b/OCSInventory Front/DownloadResponse.cpp index 50466f7e..b55b9247 100644 --- a/OCSInventory Front/DownloadResponse.cpp +++ b/OCSInventory Front/DownloadResponse.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/DownloadResponse.h b/OCSInventory Front/DownloadResponse.h index 690dd5b2..29107afc 100644 --- a/OCSInventory Front/DownloadResponse.h +++ b/OCSInventory Front/DownloadResponse.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ExecCommand.cpp b/OCSInventory Front/ExecCommand.cpp index b25a7f00..ade0f807 100644 --- a/OCSInventory Front/ExecCommand.cpp +++ b/OCSInventory Front/ExecCommand.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ExecCommand.h b/OCSInventory Front/ExecCommand.h index 4a4c1f4c..fa41622d 100644 --- a/OCSInventory Front/ExecCommand.h +++ b/OCSInventory Front/ExecCommand.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/FilePackageHistory.cpp b/OCSInventory Front/FilePackageHistory.cpp index 09e62b34..8c589d8a 100644 --- a/OCSInventory Front/FilePackageHistory.cpp +++ b/OCSInventory Front/FilePackageHistory.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/FilePackageHistory.h b/OCSInventory Front/FilePackageHistory.h index e0394d6e..031504d4 100644 --- a/OCSInventory Front/FilePackageHistory.h +++ b/OCSInventory Front/FilePackageHistory.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/InventoryRequest.cpp b/OCSInventory Front/InventoryRequest.cpp index dd9f8e30..c2460754 100644 --- a/OCSInventory Front/InventoryRequest.cpp +++ b/OCSInventory Front/InventoryRequest.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/InventoryRequest.h b/OCSInventory Front/InventoryRequest.h index b4a5a4d0..60c82a2d 100644 --- a/OCSInventory Front/InventoryRequest.h +++ b/OCSInventory Front/InventoryRequest.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/InventoryResponse.cpp b/OCSInventory Front/InventoryResponse.cpp index 34b41b79..196cae52 100644 --- a/OCSInventory Front/InventoryResponse.cpp +++ b/OCSInventory Front/InventoryResponse.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/InventoryResponse.h b/OCSInventory Front/InventoryResponse.h index b3ad4a26..397efc3d 100644 --- a/OCSInventory Front/InventoryResponse.h +++ b/OCSInventory Front/InventoryResponse.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Log.cpp b/OCSInventory Front/Log.cpp index a57138a8..06545ea0 100644 --- a/OCSInventory Front/Log.cpp +++ b/OCSInventory Front/Log.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Log.h b/OCSInventory Front/Log.h index 2e795430..04c7409c 100644 --- a/OCSInventory Front/Log.h +++ b/OCSInventory Front/Log.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -22,7 +22,7 @@ #include "Singleton.h" #include -/* OCS Inventory NG log modes +/* OCS Inventory log modes /DEBUG=0 => default mode /DEBUG=1 => DEBUG mode, for more detailed logs /DEBUG=2 => TRACE mode, for full logs, including XML and SysInfo logs diff --git a/OCSInventory Front/MapStringToStringArray.cpp b/OCSInventory Front/MapStringToStringArray.cpp index 0af5e529..86c29e62 100644 --- a/OCSInventory Front/MapStringToStringArray.cpp +++ b/OCSInventory Front/MapStringToStringArray.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/MapStringToStringArray.h b/OCSInventory Front/MapStringToStringArray.h index 8dfe5315..10c3389b 100644 --- a/OCSInventory Front/MapStringToStringArray.h +++ b/OCSInventory Front/MapStringToStringArray.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Markup.cpp b/OCSInventory Front/Markup.cpp index 3f56846e..52ca71b0 100644 --- a/OCSInventory Front/Markup.cpp +++ b/OCSInventory Front/Markup.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Markup.h b/OCSInventory Front/Markup.h index 9cb0fda2..550f2aef 100644 --- a/OCSInventory Front/Markup.h +++ b/OCSInventory Front/Markup.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/NotifyUser.cpp b/OCSInventory Front/NotifyUser.cpp index 6d1126f2..34fa1863 100644 --- a/OCSInventory Front/NotifyUser.cpp +++ b/OCSInventory Front/NotifyUser.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/NotifyUser.h b/OCSInventory Front/NotifyUser.h index 9928a386..d4e3149c 100644 --- a/OCSInventory Front/NotifyUser.h +++ b/OCSInventory Front/NotifyUser.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/OCSInventory Front.cpp b/OCSInventory Front/OCSInventory Front.cpp index 5b1f1ba7..2d4c8c4b 100644 --- a/OCSInventory Front/OCSInventory Front.cpp +++ b/OCSInventory Front/OCSInventory Front.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -48,9 +48,9 @@ BOOL COCSInventoryFrontApp::InitInstance() if (!CWinApp::InitInstance()) { #ifdef _DEBUG - AfxMessageBox( _T( "Unable to initialize OCS Inventory NG FrameWork instance!"), MB_ICONSTOP); + AfxMessageBox( _T( "Unable to initialize OCS Inventory FrameWork instance!"), MB_ICONSTOP); #else - _tprintf( _T( "Unable to initialize OCS Inventory NG FrameWork instance!")); + _tprintf( _T( "Unable to initialize OCS Inventory FrameWork instance!")); #endif return FALSE; } @@ -64,9 +64,9 @@ BOOL COCSInventoryFrontApp::InitInstance() if (GetModuleFileName( AfxGetInstanceHandle(), m_csInstallFolder.GetBuffer( _MAX_PATH*4+1), _MAX_PATH*4) == 0) { #ifdef _DEBUG - AfxMessageBox( _T( "Unable to initialize OCS Inventory NG installation path!"), MB_ICONSTOP); + AfxMessageBox( _T( "Unable to initialize OCS Inventory installation path!"), MB_ICONSTOP); #else - _tprintf( _T( "Unable to initialize OCS Inventory NG installation path!")); + _tprintf( _T( "Unable to initialize OCS Inventory installation path!")); #endif return FALSE; } @@ -82,9 +82,9 @@ BOOL COCSInventoryFrontApp::InitInstance() if (!SHGetSpecialFolderPath( NULL, m_csDataFolder.GetBuffer( _MAX_PATH+1), CSIDL_COMMON_APPDATA, TRUE)) { #ifdef _DEBUG - AfxMessageBox( _T( "Unable to initialize OCS Inventory NG data storage path!"), MB_ICONSTOP); + AfxMessageBox( _T( "Unable to initialize OCS Inventory data storage path!"), MB_ICONSTOP); #else - _tprintf( _T( "Unable to initialize OCS Inventory NG data storage path!")); + _tprintf( _T( "Unable to initialize OCS Inventory data storage path!")); #endif return FALSE; } @@ -94,9 +94,9 @@ BOOL COCSInventoryFrontApp::InitInstance() if (!directoryCreate( m_csDataFolder)) { #ifdef _DEBUG - AfxMessageBox( _T( "Unable to initialize OCS Inventory NG data storage path!"), MB_ICONSTOP); + AfxMessageBox( _T( "Unable to initialize OCS Inventory data storage path!"), MB_ICONSTOP); #else - _tprintf( _T( "Unable to initialize OCS Inventory NG data storage path!")); + _tprintf( _T( "Unable to initialize OCS Inventory data storage path!")); #endif return FALSE; } diff --git a/OCSInventory Front/OCSInventory Front.h b/OCSInventory Front/OCSInventory Front.h index 5c33ab18..0fa6ea5d 100644 --- a/OCSInventory Front/OCSInventory Front.h +++ b/OCSInventory Front/OCSInventory Front.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/OCSInventory Front.rc b/OCSInventory Front/OCSInventory Front.rc index eb5402cb..58509b0c 100644 --- a/OCSInventory Front/OCSInventory Front.rc +++ b/OCSInventory Front/OCSInventory Front.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -41,16 +41,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG Framework Provider" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG Framework Provider" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory Framework Provider" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory Framework Provider" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "OCSInventory Front.dll" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OCSInventory Front.dll" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" diff --git a/OCSInventory Front/OCSInventory Front.vcxproj b/OCSInventory Front/OCSInventory Front.vcxproj index 1b86a67e..d3140d74 100644 --- a/OCSInventory Front/OCSInventory Front.vcxproj +++ b/OCSInventory Front/OCSInventory Front.vcxproj @@ -22,33 +22,33 @@ {04364624-39D4-488D-A538-66CB442A5F0B} OCSInventoryFront MFCDLLProj - 10.0.18362.0 + 10.0 DynamicLibrary - v141 + v142 Dynamic Unicode true DynamicLibrary - v141 + v142 Dynamic Unicode DynamicLibrary - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 @@ -204,8 +204,6 @@ - - Create Create @@ -250,8 +248,6 @@ - - diff --git a/OCSInventory Front/OCSInventoryState.cpp b/OCSInventory Front/OCSInventoryState.cpp index 7e707f14..6dbcd490 100644 --- a/OCSInventory Front/OCSInventoryState.cpp +++ b/OCSInventory Front/OCSInventoryState.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/OCSInventoryState.h b/OCSInventory Front/OCSInventoryState.h index 3009ded0..47408adf 100644 --- a/OCSInventory Front/OCSInventoryState.h +++ b/OCSInventory Front/OCSInventoryState.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/OCSinventory Front Classes.h b/OCSInventory Front/OCSinventory Front Classes.h index d1e946d2..cee30bcf 100644 --- a/OCSInventory Front/OCSinventory Front Classes.h +++ b/OCSInventory Front/OCSinventory Front Classes.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/OcsUtils.cpp b/OCSInventory Front/OcsUtils.cpp index e4fa5bd7..20b7c176 100644 --- a/OCSInventory Front/OcsUtils.cpp +++ b/OCSInventory Front/OcsUtils.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/OcsUtils.h b/OCSInventory Front/OcsUtils.h index e4a8071d..2ecc7ac4 100644 --- a/OCSInventory Front/OcsUtils.h +++ b/OCSInventory Front/OcsUtils.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/PrologRequest.cpp b/OCSInventory Front/PrologRequest.cpp index 2a057eef..bbde5bad 100644 --- a/OCSInventory Front/PrologRequest.cpp +++ b/OCSInventory Front/PrologRequest.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/PrologRequest.h b/OCSInventory Front/PrologRequest.h index c242cf5e..0de367ec 100644 --- a/OCSInventory Front/PrologRequest.h +++ b/OCSInventory Front/PrologRequest.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/PrologResponse.cpp b/OCSInventory Front/PrologResponse.cpp index b11b610a..68951cd0 100644 --- a/OCSInventory Front/PrologResponse.cpp +++ b/OCSInventory Front/PrologResponse.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/PrologResponse.h b/OCSInventory Front/PrologResponse.h index df42fd1e..60878ea7 100644 --- a/OCSInventory Front/PrologResponse.h +++ b/OCSInventory Front/PrologResponse.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Provider Classes.h b/OCSInventory Front/Provider Classes.h index 84e0a169..872f0ba2 100644 --- a/OCSInventory Front/Provider Classes.h +++ b/OCSInventory Front/Provider Classes.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Request.cpp b/OCSInventory Front/Request.cpp index 298a796c..97fffedd 100644 --- a/OCSInventory Front/Request.cpp +++ b/OCSInventory Front/Request.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Request.h b/OCSInventory Front/Request.h index 4298cced..4213c9dd 100644 --- a/OCSInventory Front/Request.h +++ b/OCSInventory Front/Request.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/RequestAbstract.cpp b/OCSInventory Front/RequestAbstract.cpp index 36f9b41e..d03516ce 100644 --- a/OCSInventory Front/RequestAbstract.cpp +++ b/OCSInventory Front/RequestAbstract.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/RequestAbstract.h b/OCSInventory Front/RequestAbstract.h index f560aeb6..f10fac5a 100644 --- a/OCSInventory Front/RequestAbstract.h +++ b/OCSInventory Front/RequestAbstract.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Response.cpp b/OCSInventory Front/Response.cpp index b143f2c0..ac4bcdb0 100644 --- a/OCSInventory Front/Response.cpp +++ b/OCSInventory Front/Response.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Response.h b/OCSInventory Front/Response.h index 0ce5d906..fdee4a3a 100644 --- a/OCSInventory Front/Response.h +++ b/OCSInventory Front/Response.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ResponseAbstract.cpp b/OCSInventory Front/ResponseAbstract.cpp index 47e77b30..c2e2b9d7 100644 --- a/OCSInventory Front/ResponseAbstract.cpp +++ b/OCSInventory Front/ResponseAbstract.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ResponseAbstract.h b/OCSInventory Front/ResponseAbstract.h index 5267ddd1..ed2c7ed9 100644 --- a/OCSInventory Front/ResponseAbstract.h +++ b/OCSInventory Front/ResponseAbstract.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ServerConfig.cpp b/OCSInventory Front/ServerConfig.cpp index 20a0b250..a1b92f30 100644 --- a/OCSInventory Front/ServerConfig.cpp +++ b/OCSInventory Front/ServerConfig.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/ServerConfig.h b/OCSInventory Front/ServerConfig.h index b6d3d9a9..746a7354 100644 --- a/OCSInventory Front/ServerConfig.h +++ b/OCSInventory Front/ServerConfig.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Singleton.cpp b/OCSInventory Front/Singleton.cpp index 1375d543..202278c5 100644 --- a/OCSInventory Front/Singleton.cpp +++ b/OCSInventory Front/Singleton.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Singleton.h b/OCSInventory Front/Singleton.h index 040fbbee..60f300df 100644 --- a/OCSInventory Front/Singleton.h +++ b/OCSInventory Front/Singleton.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/SnmpQuery.cpp b/OCSInventory Front/SnmpQuery.cpp deleted file mode 100644 index d5022ff0..00000000 --- a/OCSInventory Front/SnmpQuery.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -#include "StdAfx.h" -#include "SnmpQuery.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -CSnmpQuery::CSnmpQuery(BOOL) -{ - //CDeviceid *pDeviceid = getOcsDeviceID(); - - setQuery(_T("SNMP")); -} - -CSnmpQuery::~CSnmpQuery(void) -{ -} - -void CSnmpQuery::setSuccess() -{ -} diff --git a/OCSInventory Front/SnmpQuery.h b/OCSInventory Front/SnmpQuery.h deleted file mode 100644 index db40f6b7..00000000 --- a/OCSInventory Front/SnmpQuery.h +++ /dev/null @@ -1,35 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2015 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -// SnmpRequest.h: interface for the CSnmpRequest class. -// -////////////////////////////////////////////////////////////////////// - - -#ifndef _INVENTORYREQUEST_H_INCLUDED_ -#define _INVENTORYREQUEST_H_INCLUDED_ - -#pragma once - -#include "OCSInventory Front Classes.h" -#include "RequestAbstract.h" - -class OCSINVENTORYFRONT_API CSnmpQuery : public CRequestAbstract -{ -public: - CSnmpQuery(BOOL); - ~CSnmpQuery(void); - - // Do some action when request successfully executed - void setSuccess(); - -}; - -#endif //_INVENTORYREQUEST_H_INCLUDED_ \ No newline at end of file diff --git a/OCSInventory Front/SnmpResponse.cpp b/OCSInventory Front/SnmpResponse.cpp deleted file mode 100644 index 87675d9e..00000000 --- a/OCSInventory Front/SnmpResponse.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -#include "stdafx.h" -#include "SnmpResponse.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -CSnmpResponse::CSnmpResponse(CByteArray *rawResponse) : CResponseAbstract(rawResponse) -{ -} - -CSnmpResponse::~CSnmpResponse(void) -{ -} \ No newline at end of file diff --git a/OCSInventory Front/SnmpResponse.h b/OCSInventory Front/SnmpResponse.h deleted file mode 100644 index 5b6c39ef..00000000 --- a/OCSInventory Front/SnmpResponse.h +++ /dev/null @@ -1,30 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2015 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -// SnmpResponse.h: interface for the CSnmpResponse class. -// -////////////////////////////////////////////////////////////////////// - -#ifndef _INVENTORYRESPONSE_H_INCLUDED_ -#define _INVENTORYRESPONSE_H_INCLUDED_ - -#pragma once - -#include "OCSInventory Front Classes.h" -#include "ResponseAbstract.h" - -class OCSINVENTORYFRONT_API CSnmpResponse : public CResponseAbstract -{ -public: - CSnmpResponse(CByteArray*); - ~CSnmpResponse(void); -}; - -#endif // _INVENTORYRESPONSE_H_INCLUDED_ \ No newline at end of file diff --git a/OCSInventory Front/XMLInteract.cpp b/OCSInventory Front/XMLInteract.cpp index bd164e29..898ff27e 100644 --- a/OCSInventory Front/XMLInteract.cpp +++ b/OCSInventory Front/XMLInteract.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/XMLInteract.h b/OCSInventory Front/XMLInteract.h index 771de4d9..235687c1 100644 --- a/OCSInventory Front/XMLInteract.h +++ b/OCSInventory Front/XMLInteract.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Zip.cpp b/OCSInventory Front/Zip.cpp index a7acc064..045eb45f 100644 --- a/OCSInventory Front/Zip.cpp +++ b/OCSInventory Front/Zip.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/Zip.h b/OCSInventory Front/Zip.h index ea166ed9..87be693f 100644 --- a/OCSInventory Front/Zip.h +++ b/OCSInventory Front/Zip.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/commonDownload.cpp b/OCSInventory Front/commonDownload.cpp index 448323be..3bfbff08 100644 --- a/OCSInventory Front/commonDownload.cpp +++ b/OCSInventory Front/commonDownload.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/commonDownload.h b/OCSInventory Front/commonDownload.h index bc987baf..d6720fad 100644 --- a/OCSInventory Front/commonDownload.h +++ b/OCSInventory Front/commonDownload.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -38,16 +38,16 @@ // This file contains package execution result #define OCS_DOWNLOAD_DONE _T( "done") // This file contains OCSNG Windows Agent Setup execution result and -// is located under %ProgramData%\OCS Inventory NG\Agent\Download +// is located under %ProgramData%\OCS Inventory\Agent\Download #define OCS_AGENT_SETUP_DONE _T( "OCSNG-Windows-Agent-Setup_done") // This file contains package ID #define OCS_DOWNLOAD_PACKAGE_ID _T( "OCSNG-Windows-Agent-PackageID") // Fragment files assembled create build.zip #define OCS_DOWNLOAD_BUILD _T( "build.zip") // HKLM registry key to store package ID and digest -#define OCS_DOWNLOAD_REGISTRY _T( "SOFTWARE\\OCS Inventory NG\\Agent\\Download") +#define OCS_DOWNLOAD_REGISTRY _T( "SOFTWARE\\OCS Inventory\\Agent\\Download") // HKLM registry key to store scheduled tasks -#define OCS_SCHEDULE_REGISTRY _T( "SOFTWARE\\OCS Inventory NG\\Agent\\Schedule") +#define OCS_SCHEDULE_REGISTRY _T( "SOFTWARE\\OCS Inventory\\Agent\\Schedule") // Download tool default configuration parameter #define FRAG_LATENCY_DEFAULT _T( "10") diff --git a/OCSInventory Front/flate.cpp b/OCSInventory Front/flate.cpp index 06200348..be00d4ad 100644 --- a/OCSInventory Front/flate.cpp +++ b/OCSInventory Front/flate.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/flate.h b/OCSInventory Front/flate.h index 4d66c4b7..0d1a5a1b 100644 --- a/OCSInventory Front/flate.h +++ b/OCSInventory Front/flate.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/stdafx.cpp b/OCSInventory Front/stdafx.cpp index 791a9eaf..b50d27bb 100644 --- a/OCSInventory Front/stdafx.cpp +++ b/OCSInventory Front/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/stdafx.h b/OCSInventory Front/stdafx.h index d9020178..d0253be3 100644 --- a/OCSInventory Front/stdafx.h +++ b/OCSInventory Front/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory Front/targetver.h b/OCSInventory Front/targetver.h index 588e6914..8044e3bd 100644 --- a/OCSInventory Front/targetver.h +++ b/OCSInventory Front/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSInventory.sln b/OCSInventory.sln index 58592782..bdf4e1da 100644 --- a/OCSInventory.sln +++ b/OCSInventory.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.645 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Agent", "Agent\OCSInventory.vcxproj", "{BF43603D-08D1-4CBA-9FD3-6EBB7BBDCED9}" EndProject @@ -24,8 +24,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCSPlugin_Example", "OCSPlu EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OcsNotifyUser", "OcsNotifyUser\OcsNotifyUser.vcxproj", "{FBFF26D5-9AC2-4B21-845F-00684A4C613B}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OcsSnmp", "OcsSnmp\snmp.vcxproj", "{4DD39232-A819-4A48-A695-E14F66667183}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -192,20 +190,6 @@ Global {FBFF26D5-9AC2-4B21-845F-00684A4C613B}.Release|Win32.Build.0 = Release|Win32 {FBFF26D5-9AC2-4B21-845F-00684A4C613B}.Release|x64.ActiveCfg = Release|x64 {FBFF26D5-9AC2-4B21-845F-00684A4C613B}.Release|x64.Build.0 = Release|x64 - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|Win32.ActiveCfg = Debug|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|Win32.Build.0 = Debug|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|x64.ActiveCfg = Debug|x64 - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|x64.Build.0 = Debug|x64 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|Any CPU.ActiveCfg = Release|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|Mixed Platforms.Build.0 = Release|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|Win32.ActiveCfg = Release|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|Win32.Build.0 = Release|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|x64.ActiveCfg = Release|x64 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OCSPlugin_Example/OCSPlugin_Example.cpp b/OCSPlugin_Example/OCSPlugin_Example.cpp index 088b0d74..72ae29e2 100644 --- a/OCSPlugin_Example/OCSPlugin_Example.cpp +++ b/OCSPlugin_Example/OCSPlugin_Example.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyleft 2007 OCS Inventory NG Team +// Copyleft 2007 OCS Inventory Team // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSPlugin_Example/OCSPlugin_Example.h b/OCSPlugin_Example/OCSPlugin_Example.h index 6659c70b..2ae451a2 100644 --- a/OCSPlugin_Example/OCSPlugin_Example.h +++ b/OCSPlugin_Example/OCSPlugin_Example.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyleft 2007 OCS Inventory NG Team +// Copyleft 2007 OCS Inventory Team // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSPlugin_Example/OCSPlugin_Example.rc b/OCSPlugin_Example/OCSPlugin_Example.rc index 6e38a1aa..71816a05 100644 --- a/OCSPlugin_Example/OCSPlugin_Example.rc +++ b/OCSPlugin_Example/OCSPlugin_Example.rc @@ -66,9 +66,9 @@ BEGIN BEGIN BLOCK "000004b0" BEGIN - VALUE "Comments", "Sample Plugin DLL for OCS Inventory NG Agent" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "Sample Plugin DLL for OCS Inventory NG Agent" + VALUE "Comments", "Sample Plugin DLL for OCS Inventory Agent" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "Sample Plugin DLL for OCS Inventory Agent" VALUE "FileVersion", "1, 0, 0, 1" VALUE "InternalName", "OCSPlugin_Example" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" diff --git a/OCSPlugin_Example/OCSPlugin_Example.vcxproj b/OCSPlugin_Example/OCSPlugin_Example.vcxproj index 15ab4543..a043585d 100644 --- a/OCSPlugin_Example/OCSPlugin_Example.vcxproj +++ b/OCSPlugin_Example/OCSPlugin_Example.vcxproj @@ -21,31 +21,31 @@ {35E43197-A12B-4C25-AEDD-5624239A0DD9} MFCProj - 10.0.18362.0 + 10.0 DynamicLibrary - v141 + v142 Dynamic Unicode DynamicLibrary - v141 - x64 + v142 + x64 Dynamic Unicode DynamicLibrary - v141 + v142 Dynamic Unicode DynamicLibrary - v141 + v142 Dynamic Unicode diff --git a/OCSPlugin_Example/StdAfx.cpp b/OCSPlugin_Example/StdAfx.cpp index 566a90a4..253dfc41 100644 --- a/OCSPlugin_Example/StdAfx.cpp +++ b/OCSPlugin_Example/StdAfx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyleft 2007 OCS Inventory NG Team +// Copyleft 2007 OCS Inventory Team // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSPlugin_Example/StdAfx.h b/OCSPlugin_Example/StdAfx.h index 6020dcd6..6e68fde4 100644 --- a/OCSPlugin_Example/StdAfx.h +++ b/OCSPlugin_Example/StdAfx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyleft 2007 OCS Inventory NG Team +// Copyleft 2007 OCS Inventory Team // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OCSPlugin_Example/targetver.h b/OCSPlugin_Example/targetver.h index 588e6914..8044e3bd 100644 --- a/OCSPlugin_Example/targetver.h +++ b/OCSPlugin_Example/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsNotifyUser/DownloadDlg.cpp b/OcsNotifyUser/DownloadDlg.cpp index 274dbd50..3a957e31 100644 --- a/OcsNotifyUser/DownloadDlg.cpp +++ b/OcsNotifyUser/DownloadDlg.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -87,7 +87,7 @@ BOOL CDownloadDlg::OnInitDialog() // Windows XP/2003/Vista/2008/Seven or + => Display HTML message using SimpleBrowser if (m_Browser.CreateFromControl( this, IDC_EDIT1)) { - csMessage.Format( _T( "OCS Inventory NG Deployment Status text

%s

"), + csMessage.Format( _T( "OCS Inventory Deployment Status text

%s

"), m_csEdit); m_Browser.Write( csMessage); } @@ -97,7 +97,7 @@ BOOL CDownloadDlg::OnInitDialog() { csMessage.Format( IDS_REBOOT_REQUIRED_STRING); SetDlgItemText( IDC_STATUS, csMessage); - csMessage.Insert( 0, _T( "OCS Inventory NG - ")); + csMessage.Insert( 0, _T( "OCS Inventory - ")); SetWindowText( csMessage); } // Bring window to front @@ -206,7 +206,7 @@ void CDownloadDlg::OnTimer(UINT_PTR nIDEvent) else csMessage.Format( IDS_AUTO_VALIDATE_STRING, szUseless); SetDlgItemText( IDC_STATUS, csMessage); - csMessage.Insert( 0, _T( "OCS Inventory NG - ")); + csMessage.Insert( 0, _T( "OCS Inventory - ")); SetWindowText( csMessage); BringWindowToTop(); SetWindowPos( &wndTopMost, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_SHOWWINDOW); diff --git a/OcsNotifyUser/DownloadDlg.h b/OcsNotifyUser/DownloadDlg.h index 4ce5a7f4..ac8e1904 100644 --- a/OcsNotifyUser/DownloadDlg.h +++ b/OcsNotifyUser/DownloadDlg.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsNotifyUser/OcsNotifyUser.cpp b/OcsNotifyUser/OcsNotifyUser.cpp index e992b383..d1e903b7 100644 --- a/OcsNotifyUser/OcsNotifyUser.cpp +++ b/OcsNotifyUser/OcsNotifyUser.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -83,7 +83,7 @@ BOOL COcsNotifyUserApp::InitInstance() return FALSE; m_pLogger->log( LOG_PRIORITY_DEBUG, _T( "==============================================================================")); - m_pLogger->log( LOG_PRIORITY_DEBUG, _T( "Starting OCS Inventory NG User Notification Tool on %s."), cStartTime.Format( _T( "%#c"))); + m_pLogger->log( LOG_PRIORITY_DEBUG, _T( "Starting OCS Inventory User Notification Tool on %s."), cStartTime.Format( _T( "%#c"))); /***** * @@ -111,8 +111,8 @@ BOOL COcsNotifyUserApp::InitInstance() m_pLogger->log( LOG_PRIORITY_DEBUG, _T("Notification Tool => Failed to retrieve Notification Tool version from file. Version 0.0.0.1 assumed")); csMessage=_T( "0.0.0.1"); } - m_pLogger->log( LOG_PRIORITY_DEBUG, _T("Notification Tool => Running OCS Inventory NG Notification Tool Version %s"), csMessage); - m_pLogger->log( LOG_PRIORITY_DEBUG, _T("Notification Tool => Using OCS Inventory NG FrameWork Version %s"), getFrameworkVersion()); + m_pLogger->log( LOG_PRIORITY_DEBUG, _T("Notification Tool => Running OCS Inventory Notification Tool Version %s"), csMessage); + m_pLogger->log( LOG_PRIORITY_DEBUG, _T("Notification Tool => Using OCS Inventory FrameWork Version %s"), getFrameworkVersion()); /***** * @@ -296,7 +296,7 @@ BOOL COcsNotifyUserApp::displayPostinstallDialogBox() cDlg.setAbortAllowed( FALSE); cDlg.setDelayAllowed( m_bDelay); cDlg.setRebootRequired( m_bReboot); - cDlg.setTimeOut( m_uTimeOut); + cDlg.setTimeOut(30); cDlg.setNotification( m_csMessage); switch (cDlg.DoModal()) { diff --git a/OcsNotifyUser/OcsNotifyUser.h b/OcsNotifyUser/OcsNotifyUser.h index 29f91465..df146044 100644 --- a/OcsNotifyUser/OcsNotifyUser.h +++ b/OcsNotifyUser/OcsNotifyUser.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsNotifyUser/OcsNotifyUser.rc b/OcsNotifyUser/OcsNotifyUser.rc index a253f9ff..04508264 100644 --- a/OcsNotifyUser/OcsNotifyUser.rc +++ b/OcsNotifyUser/OcsNotifyUser.rc @@ -30,36 +30,36 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL IDD_WAIT_SETUP_DIALOG DIALOGEX 0, 0, 318, 119 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_NOACTIVATE -CAPTION "OCS Inventory NG for Windows Notification" +CAPTION "OCS Inventory for Windows Notification" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LTEXT "OCS Inventory NG for Windows Notification\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,34,7,259,25 + LTEXT "OCS Inventory for Windows Notification\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,34,7,259,25 ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 CTEXT "Your keyboard and mouse are locked while Setup is running.\n\nPlease, wait... ",IDC_STATUS,7,59,304,53 END IDD_CU DIALOGEX 0, 0, 283, 142 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION -CAPTION "OCS Inventory NG" +CAPTION "OCS Inventory" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN EDITTEXT IDC_VAL,13,73,257,28,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,101,115,80,20 LTEXT "Please, fill in TAG value.",IDC_LABEL_TEXT,13,47,257,19,SS_CENTERIMAGE ICON IDR_MAINFRAME,IDC_STATIC,7,5,20,20 - LTEXT "OCS Inventory NG\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,2,240,25 + LTEXT "OCS Inventory\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,2,240,25 GROUPBOX "",IDC_STATIC,7,33,269,76 END IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 400, 220 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION EXSTYLE WS_EX_APPWINDOW -CAPTION "OCS Inventory NG for Windows Notification" +CAPTION "OCS Inventory for Windows Notification" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - LTEXT "OCS Inventory NG for Windows Notification\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,7,260,25 + LTEXT "OCS Inventory for Windows Notification\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,7,260,25 ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 - GROUPBOX "Message from OCS Inventory NG Agent Package Setup...",IDC_STATIC,7,46,386,142 + GROUPBOX "Message from OCS Inventory Agent Package Setup...",IDC_STATIC,7,46,386,142 EDITTEXT IDC_EDIT1,13,63,374,100,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP LTEXT "",IDC_STATUS,13,168,373,12 PUSHBUTTON "OK",IDOK,7,196,80,20 @@ -124,7 +124,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "OCS Inventory NG for Windows Notification" + AFX_IDS_APP_TITLE "OCS Inventory for Windows Notification" END #endif // English resources @@ -146,10 +146,10 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 400, 220 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION EXSTYLE WS_EX_APPWINDOW -CAPTION "OCS Inventory NG for Windows Notification" +CAPTION "OCS Inventory for Windows Notification" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - LTEXT "OCS Inventory NG: Paquete de instalación\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,7,260,25 + LTEXT "OCS Inventory: Paquete de instalación\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,7,260,25 ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 GROUPBOX "Mensaje desde el paquete de instalación del Agente OCS...",IDC_STATIC,7,46,386,142 EDITTEXT IDC_EDIT1,13,63,374,100,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP @@ -162,24 +162,24 @@ END IDD_WAIT_SETUP_DIALOG DIALOGEX 0, 0, 318, 119 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_NOACTIVATE -CAPTION "OCS Inventory NG for Windows Notification" +CAPTION "OCS Inventory for Windows Notification" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LTEXT "OCS Inventory NG: Paquete de instalación\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,34,7,259,25 + LTEXT "OCS Inventory: Paquete de instalación\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,34,7,259,25 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 CTEXT "Su teclado y ratón están bloqueados durante la instalación.\n\nPor favor, espere... ",IDC_STATUS,7,59,304,53 END IDD_CU DIALOGEX 0, 0, 283, 142 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION -CAPTION "OCS Inventory NG" +CAPTION "OCS Inventory" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN EDITTEXT IDC_VAL,13,73,257,28,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,101,115,80,20 LTEXT "Por favor, introduzca el texto en el campo TAG.",IDC_LABEL_TEXT,13,47,257,19,SS_CENTERIMAGE ICON IDR_MAINFRAME,IDC_STATIC,7,5,20,20 - LTEXT "OCS Inventory NG\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,2,240,25 + LTEXT "OCS Inventory\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,2,240,25 GROUPBOX "",IDC_STATIC,7,33,269,76 END @@ -240,7 +240,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "OCS Inventory NG for Windows Notification" + AFX_IDS_APP_TITLE "OCS Inventory for Windows Notification" END #endif // Spanish resources @@ -262,10 +262,10 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL IDD_WAIT_SETUP_DIALOG DIALOGEX 0, 0, 318, 119 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_NOACTIVATE -CAPTION "OCS Inventory NG for Windows Notification" +CAPTION "OCS Inventory for Windows Notification" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LTEXT "OCS Inventory NG Agent Package Setup Tool\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,34,7,259,25 + LTEXT "OCS Inventory Agent Package Setup Tool\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,34,7,259,25 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 CTEXT "Votre souris et votre clavier sont bloqués pendant l'installation.\n\nMerci de patienter... ",IDC_STATUS,7,59,304,53 END @@ -273,12 +273,12 @@ END IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 400, 220 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION EXSTYLE WS_EX_APPWINDOW -CAPTION "OCS Inventory NG for Windows Notification" +CAPTION "OCS Inventory for Windows Notification" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - LTEXT "OCS Inventory NG for Windows Notification\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,7,260,25 + LTEXT "OCS Inventory for Windows Notification\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,7,260,25 ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 - GROUPBOX "Message d'information d'OCS Inventory NG Agent Package Setup...",IDC_STATIC,7,46,386,141 + GROUPBOX "Message d'information d'OCS Inventory Agent Package Setup...",IDC_STATIC,7,46,386,141 EDITTEXT IDC_EDIT1,13,63,374,100,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP LTEXT "",IDC_STATUS,13,168,374,12 PUSHBUTTON "OK",IDOK,7,196,80,20 @@ -288,14 +288,14 @@ END IDD_CU DIALOGEX 0, 0, 283, 142 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION -CAPTION "OCS Inventory NG" +CAPTION "OCS Inventory" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN EDITTEXT IDC_VAL,13,73,257,28,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,101,115,80,20 LTEXT "Merci de saisir la valeur du TAG.",IDC_LABEL_TEXT,13,47,257,19,SS_CENTERIMAGE ICON IDR_MAINFRAME,IDC_STATIC,7,5,20,20 - LTEXT "OCS Inventory NG\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,2,240,25 + LTEXT "OCS Inventory\n\nWeb site: http://www.ocsinventory-ng.org",IDC_STATIC,36,2,240,25 GROUPBOX "",IDC_STATIC,7,33,269,76 END @@ -356,7 +356,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "OCS Inventory NG for Windows Notification" + AFX_IDS_APP_TITLE "OCS Inventory for Windows Notification" END #endif // French resources @@ -385,8 +385,8 @@ IDR_MAINFRAME ICON "..\\Agent\\res\\OCSInventory.ic // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -401,16 +401,16 @@ BEGIN BEGIN BLOCK "040004e4" BEGIN - VALUE "Comments", "OCS Inventory NG User Notification Provider" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG User Notification Provider" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory User Notification Provider" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory User Notification Provider" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "OcsNotifyUser.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OcsNotifyUser.exe" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" @@ -438,10 +438,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN IDD_WAIT_SETUP_DIALOG DIALOGEX 0, 0, 318, 119 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_NOACTIVATE -CAPTION "OCS Inventory NG for Windows Notification" +CAPTION "OCS Inventory for Windows Notification" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LTEXT "OCS Inventory NG: Softwareverteilung\n\nInternetseite: http://www.ocsinventory-ng.org",IDC_STATIC,34,7,259,25 + LTEXT "OCS Inventory: Softwareverteilung\n\nInternetseite: http://www.ocsinventory-ng.org",IDC_STATIC,34,7,259,25 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 CTEXT "Ihre Maus und Tastatur sind gesperrt, solange die Installation ausgeführt wird.\n\nBitte warten... ",IDC_STATUS,7,59,304,53 END @@ -449,12 +449,12 @@ END IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 400, 220 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION EXSTYLE WS_EX_APPWINDOW -CAPTION "OCS Inventory NG for Windows Notification" +CAPTION "OCS Inventory for Windows Notification" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - LTEXT "OCS Inventory NG: Softwareverteilung\n\nInternetseite: http://www.ocsinventory-ng.org",IDC_STATIC,36,7,260,25 + LTEXT "OCS Inventory: Softwareverteilung\n\nInternetseite: http://www.ocsinventory-ng.org",IDC_STATIC,36,7,260,25 ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 - GROUPBOX "Nachricht von OCS Inventory NG: Softwareverteilung...",IDC_STATIC,7,46,386,142 + GROUPBOX "Nachricht von OCS Inventory: Softwareverteilung...",IDC_STATIC,7,46,386,142 EDITTEXT IDC_EDIT1,13,63,374,100,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP LTEXT "",IDC_STATUS,13,168,374,12 PUSHBUTTON "OK",IDOK,7,196,80,20 @@ -464,14 +464,14 @@ END IDD_CU DIALOGEX 0, 0, 283, 142 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION -CAPTION "OCS Inventory NG" +CAPTION "OCS Inventory" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN EDITTEXT IDC_VAL,13,73,257,28,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,101,115,80,20 LTEXT "Bitte tragen Sie eine TAG-Bezeichnung ein.",IDC_LABEL_TEXT,13,47,257,19,SS_CENTERIMAGE ICON IDR_MAINFRAME,IDC_STATIC,7,5,20,20 - LTEXT "OCS Inventory NG\n\nInternetseite: http://www.ocsinventory-ng.org",IDC_STATIC,36,2,240,25 + LTEXT "OCS Inventory\n\nInternetseite: http://www.ocsinventory-ng.org",IDC_STATIC,36,2,240,25 GROUPBOX "",IDC_STATIC,7,33,269,76 END @@ -532,7 +532,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "OCS Inventory NG for Windows Notification" + AFX_IDS_APP_TITLE "OCS Inventory for Windows Notification" END #endif // German (Germany) resources diff --git a/OcsNotifyUser/OcsNotifyUser.vcxproj b/OcsNotifyUser/OcsNotifyUser.vcxproj index 27b2ea98..bf04030b 100644 --- a/OcsNotifyUser/OcsNotifyUser.vcxproj +++ b/OcsNotifyUser/OcsNotifyUser.vcxproj @@ -22,33 +22,33 @@ {FBFF26D5-9AC2-4B21-845F-00684A4C613B} OcsNotifyUser MFCProj - 10.0.18362.0 + 10.0 Application - v141 + v142 Dynamic Unicode true Application - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 Dynamic Unicode Application - v141 + v142 Dynamic Unicode diff --git a/OcsNotifyUser/TagInputDlg.cpp b/OcsNotifyUser/TagInputDlg.cpp index 01ffeb36..a4f1f470 100644 --- a/OcsNotifyUser/TagInputDlg.cpp +++ b/OcsNotifyUser/TagInputDlg.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsNotifyUser/TagInputDlg.h b/OcsNotifyUser/TagInputDlg.h index 7ecdacb2..711b16fc 100644 --- a/OcsNotifyUser/TagInputDlg.h +++ b/OcsNotifyUser/TagInputDlg.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsNotifyUser/stdafx.cpp b/OcsNotifyUser/stdafx.cpp index 1666e43a..54b6b8fe 100644 --- a/OcsNotifyUser/stdafx.cpp +++ b/OcsNotifyUser/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsNotifyUser/stdafx.h b/OcsNotifyUser/stdafx.h index d755f0f7..133a0551 100644 --- a/OcsNotifyUser/stdafx.h +++ b/OcsNotifyUser/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsNotifyUser/targetver.h b/OcsNotifyUser/targetver.h index 9cd597e6..0436e90d 100644 --- a/OcsNotifyUser/targetver.h +++ b/OcsNotifyUser/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSnmp/OcsSnmp.aps b/OcsSnmp/OcsSnmp.aps deleted file mode 100644 index 1fc45e1b..00000000 Binary files a/OcsSnmp/OcsSnmp.aps and /dev/null differ diff --git a/OcsSnmp/OcsSnmp.rc b/OcsSnmp/OcsSnmp.rc deleted file mode 100644 index bee43bfe..00000000 Binary files a/OcsSnmp/OcsSnmp.rc and /dev/null differ diff --git a/OcsSnmp/SNMPException.cpp b/OcsSnmp/SNMPException.cpp deleted file mode 100644 index 842c3ddc..00000000 --- a/OcsSnmp/SNMPException.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPException.h" - -#define __VER__ "1.0" - - -SNMPException::SNMPException( std::string message, - SNMPException * prev, - const char * file, - int line, - const char * date, - const char * time, - const char * ver) { - _previous = prev; - _message = message; - std::stringstream ss; - if(file) { - ss << file; - ss << "(" << line << ")"; - if(ver) { - ss << " v" << ver; - } - if(date) { - ss << " " << date; - } - if(time) { - ss << " " << time; - } - } - _source = ss.str(); -} - -SNMPException::~SNMPException() { - if(_previous) { - delete _previous; - } -} - -std::string SNMPException::toStringStack() { - std::stringstream ss; - ss << toString(); - if(_previous) { - ss << "\n "; - ss << _previous->toStringStack(); - } - return ss.str(); -} - -std::string SNMPException::toString() { - std::stringstream ss; - ss << _message << "."; - if(_source != "") { - ss << " [" << _source << "]"; - } - return ss.str(); -} - - - - -SNMPErrorException::SNMPErrorException(int number, int level, std::string message, SNMPException * prev, const char * file, int line, const char * date, const char * time, const char * ver) : SNMPException(message, prev, file, line, date, time, ver) { - _number = number; - _level = level; -} - -SNMPErrorException::~SNMPErrorException() { -} - -std::string SNMPErrorException::toString() { - std::stringstream ss; - if(SNMP_WARNING == _level) { - ss << "warning SNMP"; - } else { - ss << "error SNMP"; - } - ss << _number << ": " << SNMPException::toString(); - return ss.str(); -} diff --git a/OcsSnmp/SNMPException.h b/OcsSnmp/SNMPException.h deleted file mode 100644 index e1da7a52..00000000 --- a/OcsSnmp/SNMPException.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include -#include - -#include "SNMPTracer.h" - -#define SNMP_THROW_BASE(e) { SNMPException * psnmpe = e; SNMPTRACE(psnmpe->toString()); throw psnmpe; } - -#define SNMP_THROW_EXCEPTION(message) SNMP_THROW_BASE(new SNMPException(message, NULL, __FILE__, __LINE__, __DATE__, __TIME__, __VER__)) -#define SNMP_RETHROW_EXCEPTION(message, exception) SNMP_THROW_BASE(new SNMPException(, exception, __FILE__, __LINE__, __DATE__, __TIME__, __VER__)) - -#define SNMP_THROW_ERROR(message, number, level) SNMP_THROW_BASE(new SNMPErrorException(number, level, message, NULL, __FILE__, __LINE__, __DATE__, __TIME__, __VER__)) -#define SNMP_RETHROW_ERROR(message, exception, number, level) SNMP_THROW_BASE(new SNMPErrorException(number, level, message, exception, __FILE__, __LINE__, __DATE__, __TIME__, __VER__)) - - -class SNMPException { -protected: - std::string _message; - std::string _source; - SNMPException * _previous; -public: - SNMPException( std::string message = "", - SNMPException * prev = NULL, - const char * file = NULL, - int line = 0, - const char * date = NULL, - const char * time = NULL, - const char * ver = NULL); - virtual ~SNMPException(); - virtual std::string toString(); - virtual std::string toStringStack(); -}; - - -#define SNMP_ERROR 0 -#define SNMP_WARNING 1 - - -class SNMPErrorException : public SNMPException { -protected: - int _level; - int _number; -public: - SNMPErrorException(int number = SNMPAPI_OTHER_ERROR, int level = SNMP_WARNING, std::string message = "", SNMPException * prev = NULL, const char * file = NULL, int line = 0, const char * date = NULL, const char * time = NULL, const char * ver = NULL); - virtual ~SNMPErrorException(); - virtual std::string toString(); -}; - - - diff --git a/OcsSnmp/SNMPLogger.cpp b/OcsSnmp/SNMPLogger.cpp deleted file mode 100644 index 38b92586..00000000 --- a/OcsSnmp/SNMPLogger.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "SNMPLogger.h" - -#include -#include - -int SNMPLogger::_level = 0; - -void SNMPLogger::Log(int type, std::string msg, unsigned long number, const char * file, const char * date, const char * time) { - std::stringstream ss; - switch(type) { - case SNMP_LOG_INFO_TYPE: - ss << "INFO SNMP"; - break; - case SNMP_LOG_WARNING_TYPE: - ss << "WARNING SNMP"; - break; - // case SNMP_LOG_ERROR_TYPE: - default: - ss << "ERROR SNMP"; - break; - } - if(type != SNMP_LOG_INFO_TYPE) { - ss << number << ": " << msg; - } else { - ss << ": " << msg; - } - if(file) { - ss << " at \"file://" << file << "\""; - } - if(date) { - ss << " compiled on " << date << " "; - } - if(date) { - ss << " " << time; - } - if(_level >= type) { - std::cout << "\n" << ss.str() << "\n"; - } -} - diff --git a/OcsSnmp/SNMPLogger.h b/OcsSnmp/SNMPLogger.h deleted file mode 100644 index d382e5a9..00000000 --- a/OcsSnmp/SNMPLogger.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include - -#define SNMP_LOG_INFO_TYPE 3 -#define SNMP_LOG_WARNING_TYPE 2 -#define SNMP_LOG_ERROR_TYPE 1 - -#define SNMP_LOG_INFO(msg) SNMPLogger::Log(SNMP_LOG_INFO_TYPE, msg, 0, __FILE__, __DATE__, __TIME__) -#define SNMP_LOG_WARNING(msg, n) SNMPLogger::Log(SNMP_LOG_WARNING_TYPE, msg, n, __FILE__, __DATE__, __TIME__) -#define SNMP_LOG_ERROR(msg, n) SNMPLogger::Log(SNMP_LOG_ERROR_TYPE, msg, n, __FILE__, __DATE__, __TIME__) - -class SNMPLogger { -protected: - static int _level; -public: - static void Log(int type, std::string msg, unsigned long number, const char * file = NULL, const char * date = NULL, const char * time = NULL); - static setLevel(int lev) { _level = lev; } -}; - - diff --git a/OcsSnmp/SNMPManager.cpp b/OcsSnmp/SNMPManager.cpp deleted file mode 100644 index 17e6fa7f..00000000 --- a/OcsSnmp/SNMPManager.cpp +++ /dev/null @@ -1,281 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPManager.h" -#include "SNMPException.h" - -#include -#include - -#define __VER__ "1.0" - -#pragma warning(disable : 4996) - -SNMPManager SNMPManager::_snmpManager; - -SNMPManager::SNMPManager() { - _init = false; - _nMajorVersion = 0; - _nMinorVersion = 0; - _nLevel = 0; -} - -SNMPManager::~SNMPManager() { - cleanUp(); -} - -void SNMPManager::startup() { - if(!_init) { - smiUINT32 nTranslateMode; - smiUINT32 nRetransmitMode; - if(SnmpStartup(&_nMajorVersion, &_nMinorVersion, &_nLevel, &nTranslateMode, &nRetransmitMode) != SNMPAPI_SUCCESS) { - SNMP_THROW_ERROR("Could not start WinSNMP API", SnmpGetLastError(NULL), SNMP_ERROR); - } - SnmpSetTranslateMode(SNMPAPI_UNTRANSLATED_V1); - SnmpSetRetransmitMode(SNMPAPI_OFF); - _init = true; - } -} - - -std::string SNMPManager::getDisplayInformation() const -{ - std::stringstream ss; - ss << "WinSNMP API v" << _nMajorVersion << "." << _nMinorVersion << " level " << _nLevel; - smiVENDORINFO vi; - if(SnmpGetVendorInfo(&vi) == SNMPAPI_SUCCESS) { - ss << " - " << vi.vendorName << " (" << vi.vendorEnterprise << ") " << vi.vendorContact; - ss << " - API " << vi.vendorVersionId << " " << vi.vendorVersionDate; - } else { - ss << " - Vendor and API information not available"; - } - - smiUINT32 nRetransmitMode; - ss << " - (r="; - if(SnmpGetRetransmitMode(&nRetransmitMode) == SNMPAPI_SUCCESS) { - switch(nRetransmitMode) { - case SNMPAPI_ON: - ss << "ON"; - break; - case SNMPAPI_OFF: - ss << "OFF"; - break; - default: - ss << "?"; - break; - } - } else { - ss << "n/a"; - } - smiUINT32 nTranslateMode; - ss << "; t="; - if(SnmpGetTranslateMode(&nTranslateMode) == SNMPAPI_SUCCESS) { - switch(nRetransmitMode) { - case SNMPAPI_TRANSLATED: - ss << "T"; - break; - case SNMPAPI_UNTRANSLATED_V2 : - ss << "UV2"; - break; - case SNMPAPI_UNTRANSLATED_V1 : - ss << "UV1"; - break; - default: - ss << "?"; - break; - } - } else { - ss << "n/a"; - } - ss << ")"; - return ss.str(); -} - -void SNMPManager::cleanUp() { - if(_init) { - _init = false; - std::map::iterator i; - while((i=_sessions.begin()) != _sessions.end()) { - delete (*i).second; - } - SnmpCleanup(); - } -} - -void SNMPManager::unregisterSession(SNMPSession * session) -{ - _sessions.erase(session->getHandle()); -} - -void SNMPManager::registerSession(SNMPSession * session) -{ - _sessions[session->getHandle()] = session; -} - -SNMPSession * SNMPManager::getSession(HSNMP_SESSION handle) -{ - std::map::const_iterator pos; - pos = _sessions.find(handle); - if(pos == _sessions.end()) { - return NULL; - } - return pos->second; -} - - -std::string SNMPManager::pduToStr( HSNMP_ENTITY hDstEntity, - HSNMP_ENTITY hSrcEntity, - HSNMP_CONTEXT hContext, - smiINT32 pduType, - smiINT32 pduId, - smiINT32 pduError, - HSNMP_VBL hVbl, - bool leftToRight) { - std::stringstream ss; - // direction - char dstbuf[256]; - dstbuf[0] = '\0'; - if(hDstEntity) { - if(SnmpEntityToStr(hDstEntity, 255, dstbuf) == SNMPAPI_FAILURE) { - dstbuf[0] = '\0'; - } - } - char srcbuf[256]; - srcbuf[0] = '\0'; - if(hSrcEntity) { - if(SnmpEntityToStr(hSrcEntity, 255, srcbuf) == SNMPAPI_FAILURE) { - srcbuf[0] = '\0'; - } - } - if(leftToRight) { - ss << srcbuf; - if(srcbuf[0] != '\0') { - ss << " "; - } - ss << ">"; - if(dstbuf[0] != '\0') { - ss << " "; - } - ss << dstbuf; - ss << " "; - } else { - ss << dstbuf; - if(dstbuf[0] != '\0') { - ss << " "; - } - ss << "<"; - if(srcbuf[0] != '\0') { - ss << " "; - } - ss << srcbuf; - ss << " "; - } - // head - ss << SNMPManager::pduTypeToStr(pduType) << "(" << pduId << ", " << SNMPManager::pduErrorToStr(pduError) << ", "; - smiOCTETS ctxString; - if(SnmpContextToStr(hContext, &ctxString) == SNMPAPI_SUCCESS) { - strncpy(srcbuf, (char*)ctxString.ptr, ctxString.len > 255 ? 255 : ctxString.len); - srcbuf[ctxString.len > 255 ? 255 : ctxString.len] ='\0'; - ss << srcbuf << ", "; - SnmpFreeDescriptor(SNMP_SYNTAX_OCTETS, &ctxString); - } else { - ss << "?, "; - } - // objects - smiOID dRetName; - smiVALUE dRetValue; - int count = SnmpCountVbl(hVbl); - if(count) { - char szName[MAXOBJIDSTRSIZE+1]; - szName[0] = szName[MAXOBJIDSTRSIZE] = '\0'; - for(int i=0; i - - -class SNMPManager { - -friend class SNMPSession; -friend class SNMPRequest; -friend class SNMPRemoteAgent; - -protected: - static SNMPManager _snmpManager; - - static std::string pduTypeToStr(int type); - static std::string pduErrorToStr(int error); - static std::string pduToStr( HSNMP_ENTITY hDstEntity, - HSNMP_ENTITY hSrcEntity, - HSNMP_CONTEXT hContext, - smiINT32 pduType, - smiINT32 pduId, - smiINT32 pduError, - HSNMP_VBL hVbl, - bool leftToRight = true); - - bool _init; - smiUINT32 _nMajorVersion; - smiUINT32 _nMinorVersion; - smiUINT32 _nLevel; - - SNMPManager(); - ~SNMPManager(); - void cleanUp(); - - std::map _sessions; - void unregisterSession(SNMPSession * session); - void registerSession(SNMPSession * session); - SNMPSession * getSession(HSNMP_SESSION handle); - -public: - static SNMPManager * getManager() { return &_snmpManager; } - - void startup(); - std::string getDisplayInformation() const; -}; - - diff --git a/OcsSnmp/SNMPObject.cpp b/OcsSnmp/SNMPObject.cpp deleted file mode 100644 index 1aae3d3b..00000000 --- a/OcsSnmp/SNMPObject.cpp +++ /dev/null @@ -1,716 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPObject.h" -#include "SNMPException.h" - -#include -#include - -#define __VER__ "1.0" - -#pragma warning(disable : 4996) - - -SNMPObject::SNMPObject(const SNMPObject & other) { - *this = other; -} - -SNMPObject & SNMPObject::operator=(const SNMPObject & other) { - _syntax = other._syntax; - _bInit = other._bInit; - _binary = other._binary; - std::string oid = other.getOID(); - setOID(oid); - _int = other._int; - _uint = other._uint; - _string = other._string; - _octetsLen = 0; - _octets = NULL; - setOctets(other._octets, other._octetsLen); - return *this; -} - -SNMPObject::SNMPObject(std::string oid) { - _bInit = false; - _binary = false; - _int = 0; - _uint = 0; - _string = ""; - _octets = NULL; - _octetsLen = 0; - _syntax = SNMP_SYNTAX_NULL; - setOID(oid); -} - -void SNMPObject::setOID(std::string oid) { - if(_bInit) { - SnmpFreeDescriptor(SNMP_SYNTAX_OCTETS, (smiLPOPAQUE)&_oid); - _bInit = false; - } - if(oid != "") { - if(SnmpStrToOid(oid.c_str(), &_oid) == SNMPAPI_FAILURE) { - SNMP_THROW_ERROR("Could not convert OID from string representation", SnmpGetLastError(NULL), SNMP_ERROR); - } - _bInit = true; - } -} - -int SNMPObject::compareOID(SNMPObject * pOther) const -{ - if(!_bInit || !pOther->_bInit) { - SNMP_THROW_ERROR("SNMP object OID(s) not initialized", SNMPAPI_OTHER_ERROR, SNMP_ERROR); - } - smiINT res = 0; - if(SnmpOidCompare(&_oid, &(pOther->_oid), 0, &res) != SNMPAPI_SUCCESS) { - SNMP_THROW_ERROR("Could not compare OIDs", SnmpGetLastError(NULL), SNMP_ERROR); - } - return (int)res; -} - -int SNMPObject::compareOID(std::string oid) const -{ - if(!_bInit) { - SNMP_THROW_ERROR("SNMP object OID not initialized", SNMPAPI_OTHER_ERROR, SNMP_ERROR); - return 0; - } - smiOID otherOid; - if(SnmpStrToOid(oid.c_str(), &otherOid) == SNMPAPI_FAILURE) { - SNMP_THROW_ERROR("Could not convert OID from string representation", SnmpGetLastError(NULL), SNMP_ERROR); - } - smiINT res = 0; - if(SnmpOidCompare(&_oid, &otherOid, 0, &res) != SNMPAPI_SUCCESS) { - SnmpFreeDescriptor(SNMP_SYNTAX_OCTETS, (smiLPOPAQUE)&otherOid); - SNMP_THROW_ERROR("Could not compare OIDs", SnmpGetLastError(NULL), SNMP_ERROR); - } - SnmpFreeDescriptor(SNMP_SYNTAX_OCTETS, (smiLPOPAQUE)&otherOid); - return (int)res; -} - -SNMPObject::~SNMPObject() { - if(_octets) { - free(_octets); - } - if(_bInit) { - SnmpFreeDescriptor(SNMP_SYNTAX_OCTETS, (smiLPOPAQUE)&_oid); - } -} - -void SNMPObject::setOctets(unsigned char * pValue, unsigned int nValue) { - if(_octets) { - free(_octets); - } - if(pValue == NULL || nValue == 0) { - _octets = NULL; - _octetsLen = 0; - } else { - _octets = (unsigned char*)malloc(sizeof(unsigned char)*nValue); - _octetsLen = nValue; - memcpy(_octets, pValue, _octetsLen); - } -} - -#define DAY ((unsigned __int64)(24L*60L*60L)) -#define HOUR ((unsigned __int64)(60L*60L)) -#define MINUTE ((unsigned __int64)(60L)) -#define HUNDRED ((unsigned __int64)(100L)) -std::string SNMPObject::getValueAsString() const { - std::stringstream ss; - switch(_syntax) { - case SNMP_SYNTAX_INT: - ss << getInt(); - break; - case SNMP_SYNTAX_OCTETS: - case SNMP_SYNTAX_OPAQUE: - case SNMP_SYNTAX_BITS: - if(_binary) { - if(getOctets() && getOctetsLen()) { - unsigned int i; - char buf[25]; - for(i=0; igetValueAsString()); - case SNMP_SYNTAX_INT: - if(getInt() < pOther->getInt()) { - return -1; - } else if(getInt() == pOther->getInt()) { - return 0; - } else { - return 1; - } - case SNMP_SYNTAX_CNTR64: - case SNMP_SYNTAX_CNTR32: - case SNMP_SYNTAX_GAUGE32: - case SNMP_SYNTAX_UINT32: - case SNMP_SYNTAX_TIMETICKS: - if(getUInt() < pOther->getUInt()) { - return -1; - } else if(getUInt() == pOther->getUInt()) { - return 0; - } else { - return 1; - } - case SNMP_SYNTAX_NULL: - case SNMP_SYNTAX_NOSUCHOBJECT: - case SNMP_SYNTAX_NOSUCHINSTANCE: - case SNMP_SYNTAX_ENDOFMIBVIEW: - return 0; - } - return 0; -} - - - -std::string SNMPObject::getDisplayInformation() const { - std::stringstream ss; - //ss << getOID() << " = " << getValueAsString() << " [" << getSyntaxAsString() + "]"; - ss << getValueAsString(); - return ss.str(); -} - -smiOID * SNMPObject::getBinaryOID() { - if(!_bInit) { - return NULL; - } - return &_oid; -} - -std::string SNMPObject::getOID() const { - if(!_bInit) { - return ""; - } - char szName[MAXOBJIDSTRSIZE+1]; - szName[0] = szName[MAXOBJIDSTRSIZE] = '\0'; - if(SnmpOidToStr (&_oid, sizeof(szName), szName) == SNMPAPI_FAILURE) { - SNMP_THROW_ERROR("Failed to convert OID to string", SnmpGetLastError(NULL), SNMP_ERROR); - } - return std::string(szName); -} - -void SNMPObject::setSyntax(int syntax) { - switch(syntax) { - case SNMP_INT: - _syntax = SNMP_SYNTAX_INT; break; - case SNMP_OCTETS: - _syntax = SNMP_SYNTAX_OCTETS; break; - case SNMP_OPAQUE: - _syntax = SNMP_SYNTAX_OPAQUE; break; - case SNMP_BITS: - _syntax = SNMP_SYNTAX_BITS; break; - case SNMP_CNTR64: - _syntax = SNMP_SYNTAX_CNTR64; break; - case SNMP_CNTR32: - _syntax = SNMP_SYNTAX_CNTR32; break; - case SNMP_GAUGE32: - _syntax = SNMP_SYNTAX_GAUGE32; break; - case SNMP_TIMETICKS: - _syntax = SNMP_SYNTAX_TIMETICKS; break; - case SNMP_UINT32: - _syntax = SNMP_SYNTAX_UINT32; break; - case SNMP_OID: - _syntax = SNMP_SYNTAX_OID; break; - case SNMP_IPADDR: - _syntax = SNMP_SYNTAX_IPADDR; break; - default: - _syntax = SNMP_NULL; break; - } -} - -int SNMPObject::getSyntax() const { - switch(_syntax) { - case SNMP_SYNTAX_INT: - return SNMP_INT; - case SNMP_SYNTAX_OCTETS: - return SNMP_OCTETS; - case SNMP_SYNTAX_OPAQUE: - return SNMP_OPAQUE; - case SNMP_SYNTAX_BITS: - return SNMP_BITS; - case SNMP_SYNTAX_CNTR64: - return SNMP_CNTR64; - case SNMP_SYNTAX_CNTR32: - return SNMP_CNTR32; - case SNMP_SYNTAX_GAUGE32: - return SNMP_GAUGE32; - case SNMP_SYNTAX_TIMETICKS: - return SNMP_TIMETICKS; - case SNMP_SYNTAX_UINT32: - return SNMP_UINT32; - case SNMP_SYNTAX_OID: - return SNMP_OID; - case SNMP_SYNTAX_NSAPADDR: - case SNMP_SYNTAX_IPADDR: - return SNMP_IPADDR; - } - return SNMP_NULL; -} - -std::string SNMPObject::getSyntaxAsString() const { - static char * _syntaxStrMap[12] = { - "Integer", - "Octets", - "Opaque", - "Bits", - "Counter64", - "Counter32", - "Gauge32", - "UnsignedInteger32", - "TimeTicks", - "ObjectIdentifier", - "IPAddr", - "Null" }; - return _syntaxStrMap[getSyntax()]; -} - - -void SNMPObject::setValue(smiVALUE * smiVal) -{ - _syntax = (DWORD)smiVal->syntax; - switch(smiVal->syntax) { - - case SNMP_SYNTAX_INT: - setInt((__int64)smiVal->value.sNumber); - break; - - case SNMP_SYNTAX_OCTETS: - case SNMP_SYNTAX_OPAQUE: - case SNMP_SYNTAX_BITS: - { - unsigned int i; - unsigned char cB; - bool binary = false; - for (i=0; ivalue.string.len; i++) { - cB = (unsigned char)smiVal->value.string.ptr[i]; - if((cB < 0x20 && (cB != 0x0A && cB != 0x0D)) || cB > 0x7E) { - binary = true; - break; - } - } - _binary = binary; - if(binary) { - setOctets(smiVal->value.string.ptr, smiVal->value.string.len); - } else { - std::stringstream ss; - for (i=0; ivalue.string.len; i++) { - ss << (unsigned char)smiVal->value.string.ptr[i]; - } - setString(ss.str()); - } - } - break; - - case SNMP_SYNTAX_CNTR64: - setUInt( (((unsigned __int64)(smiVal->value.hNumber.hipart)) << 32) | ((unsigned __int64)(smiVal->value.hNumber.lopart)) ); - break; - - case SNMP_SYNTAX_CNTR32: - case SNMP_SYNTAX_GAUGE32: - case SNMP_SYNTAX_TIMETICKS: - case SNMP_SYNTAX_UINT32: - setUInt((unsigned __int64)smiVal->value.uNumber); - break; - - case SNMP_SYNTAX_OID: - { - char szName[MAXOBJIDSTRSIZE+1]; - szName[0] = szName[MAXOBJIDSTRSIZE] = '\0'; - if(SnmpOidToStr (&smiVal->value.oid, sizeof(szName), szName) == SNMPAPI_FAILURE) { - szName[0] = '\0'; - } - setString(szName); - } - break; - - case SNMP_SYNTAX_NSAPADDR: - case SNMP_SYNTAX_IPADDR: - { - unsigned int i; - std::stringstream ss; - for (i=0; ivalue.string.len; i++) { - ss << ((unsigned int)smiVal->value.string.ptr[i]); - if(i+1 < smiVal->value.string.len) { - ss << "."; - } - } - setString(ss.str()); - } - break; - - case SNMP_SYNTAX_NULL: - case SNMP_SYNTAX_NOSUCHOBJECT: - case SNMP_SYNTAX_NOSUCHINSTANCE: - case SNMP_SYNTAX_ENDOFMIBVIEW: - default: - break; - } -} - - -void SNMPObject::getValue(smiVALUE * smiVal) -{ - smiVal->syntax = (smiUINT32)_syntax; - switch(smiVal->syntax) { - - case SNMP_SYNTAX_INT: - smiVal->value.sNumber = (smiINT)getInt(); - break; - - case SNMP_SYNTAX_OCTETS: - case SNMP_SYNTAX_OPAQUE: - case SNMP_SYNTAX_BITS: - { - int sz = 0; - char * pChar = getValueAsOctets(&sz); - smiVal->value.string.len = sz; - if(sz) { - smiVal->value.string.ptr = (smiLPBYTE)malloc(sz); - memcpy(smiVal->value.string.ptr, pChar, sz); - } else { - smiVal->value.string.ptr = NULL; - } - } - break; - - case SNMP_SYNTAX_CNTR64: - smiVal->value.hNumber.hipart = (smiUINT32)((getUInt() >> 32) & 0x00000000FFFFFFFF); - smiVal->value.hNumber.lopart = (smiUINT32)(getUInt() & 0x00000000FFFFFFFF); - break; - - case SNMP_SYNTAX_CNTR32: - case SNMP_SYNTAX_GAUGE32: - case SNMP_SYNTAX_TIMETICKS: - case SNMP_SYNTAX_UINT32: - smiVal->value.uNumber = (smiUINT32)getUInt(); - break; - - case SNMP_SYNTAX_OID: - SnmpStrToOid(_string.c_str(), &smiVal->value.oid); - break; - - case SNMP_SYNTAX_NSAPADDR: - case SNMP_SYNTAX_IPADDR: - { - int i; - int sz = 0; - for (i=0; i<(int)_string.size(); i++) { - if(_string[i] == '.') { - sz++; - } - } - smiVal->value.string.ptr = (smiLPBYTE)malloc(sz); - smiVal->value.string.len = sz; - std::string aux; - int istore = 0; - for (i=0; i<(int)_string.size(); i++) { - if(_string[i] == '.') { - if(istore < sz) { - smiVal->value.string.ptr[istore] = (smiBYTE)atoi(aux.c_str()); - } - aux = ""; - istore++; - } else { - aux += _string[i]; - } - } - if(istore < sz) { - smiVal->value.string.ptr[istore] = (smiBYTE)atoi(aux.c_str()); - } - } - break; - - case SNMP_SYNTAX_NULL: - case SNMP_SYNTAX_NOSUCHOBJECT: - case SNMP_SYNTAX_NOSUCHINSTANCE: - case SNMP_SYNTAX_ENDOFMIBVIEW: - default: - smiVal->value.uNumber = 0; - break; - } -} diff --git a/OcsSnmp/SNMPObject.h b/OcsSnmp/SNMPObject.h deleted file mode 100644 index faaf350c..00000000 --- a/OcsSnmp/SNMPObject.h +++ /dev/null @@ -1,105 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include - -#define SNMP_INT 0 // SNMP_SYNTAX_INT, SNMP_SYNTAX_INT32 - Indicates a 32-bit signed integer variable =SNMP_SYNTAX_INT32. -#define SNMP_OCTETS 1 // SNMP_SYNTAX_OCTETS - Indicates an octet string variable that is binary or textual data. -#define SNMP_OPAQUE 2 // SNMP_SYNTAX_OPAQUE - This type provides backward compatibility, and should not be used for new object types. It supports the capability to pass arbitrary Abstract Syntax Notation One (ASN.1) syntax. -#define SNMP_BITS 3 // SNMP_SYNTAX_BITS -#define SNMP_CNTR64 4 // SNMP_SYNTAX_CNTR64 - Indicates a counter variable that increases until it reaches a maximum value of (2^64) – 1. -#define SNMP_CNTR32 5 // SNMP_SYNTAX_CNTR32 - ndicates a counter variable that increases until it reaches a maximum value of (2^32) – 1. -#define SNMP_GAUGE32 6 // SNMP_SYNTAX_GAUGE32 - Indicates a gauge variable that is a non-negative integer that can increase or decrease, but never exceed a maximum value. -#define SNMP_UINT32 7 // SNMP_SYNTAX_UINT32 - Indicates a 32-bit unsigned integer variable. -#define SNMP_TIMETICKS 8 // SNMP_SYNTAX_TIMETICKS - Indicates a counter variable that measures the time in hundredths of a second, until it reaches a maximum value of (2^32) – 1. It is a non-negative integer that is relative to a specific timer event. -#define SNMP_OID 9 // SNMP_SYNTAX_OID - Indicates an object identifier variable that is an assigned name with a maximum of 128 subidentifiers. -#define SNMP_IPADDR 10 // SNMP_SYNTAX_IPADDR, SNMP_SYNTAX_NSAPADDR - Indicates a 32-bit Internet address variable. -#define SNMP_NULL 11 // SNMP_SYNTAX_NULL, ... - Indicates a NULL value. - - -class SNMPRemoteAgent; -class SNMPSession; -class SNMPRequest; -class SNMPManager; - -class SNMPObject { - friend class SNMPRemoteAgent; - friend class SNMPSession; - friend class SNMPRequest; - friend class SNMPManager; -protected: - DWORD _syntax; - bool _bInit; - smiOID _oid; - bool _binary; - - smiOID * getBinaryOID(); - void setValue(smiVALUE * smiVal); - void getValue(smiVALUE * smiVal); - - __int64 _int; - unsigned __int64 _uint; - std::string _string; - unsigned char * _octets; - unsigned int _octetsLen; - - void setInt(__int64 value) { _int = value; } - __int64 getInt() const { return _int; } - void setUInt(unsigned __int64 value) { _uint = value; } - unsigned __int64 getUInt() const { return _uint; } - void setString(std::string value) { _string = value; } - std::string getString() const { return _string; } - unsigned char * getOctets() const { return _octets; } - unsigned int getOctetsLen() const { return _octetsLen; } - void setOctets(unsigned char * pValue, unsigned int nValue); - -public: - SNMPObject(std::string oid = ""); - SNMPObject(const SNMPObject & other); - virtual ~SNMPObject(); - SNMPObject & operator=(const SNMPObject & other); - - // OID - std::string getOID()const; - void setOID(std::string oid); - int compareOID(SNMPObject * pOther) const; - int compareOID(std::string oid) const; - - // Syntax - int getSyntax() const; - void setSyntax(int syntax); - std::string getSyntaxAsString() const; - - // Value - std::string getValueAsString() const; - void setValueAsString(std::string); - __int64 getValueAsInteger() const; - void setValueAsInteger(__int64 value); - char * getValueAsOctets(int * size = NULL) const; - void setValueAsOctets(char * value, int size); - int compareValue(SNMPObject * pOther) const; - - // Display - std::string getDisplayInformation() const; -}; - - diff --git a/OcsSnmp/SNMPRemoteAgent.cpp b/OcsSnmp/SNMPRemoteAgent.cpp deleted file mode 100644 index 4b46d934..00000000 --- a/OcsSnmp/SNMPRemoteAgent.cpp +++ /dev/null @@ -1,173 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPManager.h" -#include "SNMPRemoteAgent.h" -#include "SNMPSession.h" -#include "SNMPObject.h" -#include "SNMPException.h" -#include "SNMPRequest.h" - -#include -#include - -#define __VER__ "1.0" - - -SNMPRemoteAgent::SNMPRemoteAgent(std::string name, std::string community, unsigned int port, SNMPSession * pSession) { - _name = name; - _port = port; - _community = community; - _bInit = false; - _mySession = false; - _pSession = pSession; - _hEntity = SNMPAPI_FAILURE; - _hContext = SNMPAPI_FAILURE; - if(_pSession == NULL) { - try { - _pSession = new SNMPSession(); - } catch(SNMPException * pe) { - SNMP_RETHROW_ERROR("Could not create WinSNMP session", pe, SNMPAPI_OTHER_ERROR, SNMP_ERROR); - } - _mySession = true; - } - HSNMP_SESSION hSession = _pSession->getHandle(); - if(hSession == SNMPAPI_FAILURE) { - if(_mySession && _pSession != NULL) { - delete _pSession; - } - _pSession = NULL; - SNMP_THROW_ERROR("Invalid session", SnmpGetLastError(NULL), SNMP_ERROR); - } - _hEntity = SnmpStrToEntity(hSession, _name.c_str()); - if (_hEntity == SNMPAPI_FAILURE) { - LPHOSTENT lpHostent = gethostbyname(_name.c_str()); - IN_ADDR host; - if(!lpHostent) { - if(_mySession && _pSession != NULL) { - delete _pSession; - } - _pSession = NULL; - SNMP_THROW_ERROR("Could not get host by name", SNMPAPI_OTHER_ERROR, SNMP_ERROR); - } - memmove (&host, lpHostent->h_addr, sizeof(IN_ADDR)); - _hEntity = SnmpStrToEntity(hSession, inet_ntoa(host)); - if (_hEntity == SNMPAPI_FAILURE) { - if(_mySession && _pSession != NULL) { - delete _pSession; - } - _pSession = NULL; - SNMP_THROW_ERROR("Could not convert remote agent address to entity", SnmpGetLastError(hSession), SNMP_ERROR); - } - } - if(port != 0) { - if(SnmpSetPort(_hEntity, port) != SNMPAPI_SUCCESS) { - SnmpFreeEntity(_hEntity); - _hEntity = SNMPAPI_FAILURE; - if(_mySession && _pSession != NULL) { - delete _pSession; - } - _pSession = NULL; - SNMP_THROW_ERROR("Could not set remote agent port", SnmpGetLastError(hSession), SNMP_ERROR); - } - } - smiOCTETS dCtx; - dCtx.len = (smiUINT32)strlen(community.c_str()); - dCtx.ptr = (smiLPBYTE)community.c_str(); - _hContext = SnmpStrToContext(hSession, &dCtx); - if (_hContext == SNMPAPI_FAILURE) { - SnmpFreeEntity(_hEntity); - _hEntity = SNMPAPI_FAILURE; - if(_mySession && _pSession != NULL) { - delete _pSession; - } - _pSession = NULL; - SNMP_THROW_ERROR("Could not convert community name to context", SnmpGetLastError(hSession), SNMP_ERROR); - } - _pSession->registerRemoteAgent(this); - _bInit = true; -} - - -std::string SNMPRemoteAgent::getDisplayInformation() const -{ - std::stringstream ss; - if(_port != 0) { - ss << "Remote Agent " << _name << ":" << _port << " " << _community; - } else { - ss << "Remote Agent " << _name << " " << _community; - } - return ss.str(); -} - -SNMPRemoteAgent::~SNMPRemoteAgent() { - if(_bInit) { - _pSession->unregisterRemoteAgent(this); - SnmpFreeContext(_hContext); - SnmpFreeEntity(_hEntity); - _bInit = false; - } - if(_mySession && _pSession != NULL) { - delete _pSession; - } - std::map::iterator i; - while((i=_requestMap.begin()) != _requestMap.end()) { - cancelRequest((*i).first); - } -} - -SNMPRequest* SNMPRemoteAgent::getRequest(int id) { - std::map::const_iterator pos; - pos = _requestMap.find(id); - if(pos == _requestMap.end()) { - return NULL; - } - return pos->second; -} - -void SNMPRemoteAgent::sendRequest(SNMPRequest * pRequest) { - if(!_bInit) { - pRequest->setResult(SNMP_ERROR_GENERR); - SNMP_THROW_ERROR("Not initialized", SNMPAPI_OTHER_ERROR, SNMP_ERROR); - } - HSNMP_PDU hPDU = pRequest->_hPdu; - int id = pRequest->_requestId; - addToRequestMap(id, pRequest); - if(SNMPTRACEAENABLED()) { - std::stringstream trace; - smiINT32 lReqId, lType, lErr, lIdx; - HSNMP_VBL hVbl; - SnmpGetPduData(hPDU, &lType, &lReqId, &lErr, &lIdx, &hVbl); - trace << "tx " << SNMPManager::pduToStr(_hEntity, 0, _hContext, lType, lReqId, lErr, hVbl, true); - SnmpFreeVbl(hVbl); - SNMPTRACE(trace.str()); - } - if(SnmpSendMsg(_pSession->getHandle(), 0, _hEntity, _hContext, hPDU) == SNMPAPI_FAILURE) { - pRequest->setResult(SNMP_ERROR_GENERR); - //SNMP_THROW_ERROR("Could not send PDU", SnmpGetLastError(_pSession->getHandle()), SNMP_ERROR); - } -} - -void SNMPRemoteAgent::cancelRequest(int id) { - SNMPRequest* pRequest = getRequest(id); - if(pRequest) { - SnmpCancelMsg(_pSession->getHandle(), id); - removeFromRequestMap(id); - } -} diff --git a/OcsSnmp/SNMPRemoteAgent.h b/OcsSnmp/SNMPRemoteAgent.h deleted file mode 100644 index 96b4d292..00000000 --- a/OcsSnmp/SNMPRemoteAgent.h +++ /dev/null @@ -1,73 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include -#include -#include -#include "SNMPObject.h" - -class SNMPSession; -class SNMPRemoteAgent; -class SNMPRequest; -class SNMPRequestSet; -class SNMPTrap; - -class SNMPRemoteAgent { - friend class SNMPSession; - friend class SNMPRequest; - friend class SNMPRequestSet; - friend class SNMPTrap; -protected: - std::string _name; - std::string _community; - UINT _port; - bool _bInit; - bool _mySession; - SNMPSession * _pSession; - HSNMP_ENTITY _hEntity; - HSNMP_CONTEXT _hContext; - - HSNMP_ENTITY getCommunityHandle() { return _hEntity; } - HSNMP_CONTEXT getContextHandle() { return _hContext; } - SNMPSession * getSession() { return _pSession; } - - std::map _requestMap; - void addToRequestMap(int id, SNMPRequest* pRequest) { _requestMap[id] = pRequest; } - void removeFromRequestMap(int id) { - _requestMap.erase(id); - } - SNMPRequest* getRequest(int id); - - void sendRequest(SNMPRequest * pRequest); - void cancelRequest(int id); - -public: - SNMPRemoteAgent(std::string name, std::string community, unsigned int port = 0, SNMPSession * pSession = NULL); - ~SNMPRemoteAgent(); - - std::string getName() { return _name; } - std::string getCommunity() { return _community; } - - virtual std::string getDisplayInformation() const; -}; - - diff --git a/OcsSnmp/SNMPRemoteAgentSet.cpp b/OcsSnmp/SNMPRemoteAgentSet.cpp deleted file mode 100644 index bb7a68e0..00000000 --- a/OcsSnmp/SNMPRemoteAgentSet.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPRemoteAgentSet.h" - -#include -#include - -#define __VER__ "1.0" - - -SNMPRemoteAgentSet::SNMPRemoteAgentSet() { -} - -SNMPRemoteAgentSet::~SNMPRemoteAgentSet() { - clear(); -} - -void SNMPRemoteAgentSet::clear() { - while((int)_agents.size()) { - delete _agents[0]; - _agents.erase(_agents.begin()); - } -} - -void SNMPRemoteAgentSet::addAgent(std::string name, std::string community, unsigned int port, SNMPSession * pSession) -{ - _agents.insert(_agents.end(), new SNMPRemoteAgent(name, community, port, pSession)); -} - -std::string SNMPRemoteAgentSet::getDisplayInformation() const -{ - std::stringstream ss; - ss << "Remote Agent Set: ["; - for(int i=0; i<(int)_agents.size(); i++) { - ss << _agents[i]->getDisplayInformation(); - if(i < (int)_agents.size()-1) { - ss << ", "; - } - } - ss << "]"; - return ss.str(); -} diff --git a/OcsSnmp/SNMPRemoteAgentSet.h b/OcsSnmp/SNMPRemoteAgentSet.h deleted file mode 100644 index c80f487f..00000000 --- a/OcsSnmp/SNMPRemoteAgentSet.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include -#include -#include -#include "SNMPRemoteAgent.h" - - -class SNMPRemoteAgentSet { -protected : - std::vector _agents; -public: - SNMPRemoteAgentSet(); - virtual ~SNMPRemoteAgentSet(); - - void addAgent(std::string name, std::string community, unsigned int port = 0, SNMPSession * pSession = NULL); - int getAgentCount() { return (int)_agents.size(); } - SNMPRemoteAgent * getAgent(int i) { return _agents[i]; } - void clear(); - - std::string getDisplayInformation() const; -}; diff --git a/OcsSnmp/SNMPRequest.cpp b/OcsSnmp/SNMPRequest.cpp deleted file mode 100644 index aec3fc51..00000000 --- a/OcsSnmp/SNMPRequest.cpp +++ /dev/null @@ -1,254 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPManager.h" -#include "SNMPRequest.h" -#include "SNMPRemoteAgent.h" -#include "SNMPSession.h" -#include "SNMPObject.h" -#include "SNMPException.h" - -#include -#include - -#define __VER__ "1.0" - - -std::string SNMPRequest::getDisplayInformation() const -{ - std::stringstream ss; - ss << SNMPManager::pduTypeToStr(_pduType) << " Request: "; - switch(_state) { - case SNMP_RAREQ_STATE_NONE: ss << "NONE"; break; - case SNMP_RAREQ_STATE_ONGOING: ss << "ONGOING"; break; - case SNMP_RAREQ_STATE_TIMEDOUT: ss << "TIMEDOUT"; break; - case SNMP_RAREQ_STATE_SUCCEEDED: ss << "SUCCEEDED"; break; - case SNMP_RAREQ_STATE_ERROR: ss << "ERROR"; break; - case SNMP_RAREQ_STATE_CANCELLED: ss << "CANCELLED"; break; - default: ss << "?"; break; - } - ss << "(" << _error << ") ["; - int i; - for(i=0; i<(int)_request.size(); i++) { - ss << _request[i]->getOID(); - if(i < (int)_request.size()-1) { - ss << ", "; - } - } - ss << "] = ["; - for(i=0; i<(int)_result.size(); i++) { - ss <<_result[i]->getDisplayInformation(); - if(i < (int)_result.size()-1) { - ss << ", "; - } - } - ss << "]"; - - return ss.str(); -} - -SNMPRequest * SNMPRequest::clone() -{ - SNMPRequest * myclone = new SNMPRequest(_pduType, NULL, 0, _pRemoteAgent); - for(int i=0; i<(int)_request.size(); i++) { - myclone->_request.insert(myclone->_request.end(), new SNMPObject(*_request[i])); - } - return myclone; -} - -SNMPRequest::SNMPRequest(int pduType, SNMPObject * objects, int count, SNMPRemoteAgent * pRemoteAgent) { - _pduType = pduType; - _state = SNMP_RAREQ_STATE_NONE; - _error = SNMP_ERROR_NOERROR; - _requestId = 0; - _hWait = ::CreateEvent (NULL, TRUE, FALSE, NULL); - if(_hWait == NULL) { - _error = SNMP_ERROR_GENERR; - SNMP_THROW_ERROR("Failed to create event", _error, SNMP_ERROR); - } - _pRemoteAgent = pRemoteAgent; - for(int i=0; igetSession(); - //_requestId = session->getNextRequestId(); - smiVALUE dValue; - int i; - int count = getRequestCount(); - dValue.syntax = SNMP_SYNTAX_NULL; - dValue.value.uNumber = 0; - _hVbl = SnmpCreateVbl(session->getHandle(), NULL, NULL); - if(_hVbl == SNMPAPI_FAILURE) { - _requestId = 0; - _state = SNMP_RAREQ_STATE_ERROR; - _error = SnmpGetLastError(session->getHandle()); - SNMP_THROW_ERROR("Could not create variable bindings list", _error, SNMP_ERROR); - } - for(i=0; igetBinaryOID(); - if(_pduType == SNMP_PDU_SET) { - pObj->getValue(&dValue); - } - if(pOid==NULL || SnmpSetVb(_hVbl, 0, pOid, &dValue) == SNMPAPI_FAILURE) { - SnmpFreeVbl(_hVbl); - _requestId = 0; - _state = SNMP_RAREQ_STATE_ERROR; - _error = SNMP_ERROR_GENERR; - SNMP_THROW_ERROR("Could not add object to the variable bindings list", SnmpGetLastError(session->getHandle()), SNMP_ERROR); - } - if(_pduType == SNMP_PDU_SET) { - if(dValue.syntax == SNMP_SYNTAX_OID) { - SnmpFreeDescriptor(dValue.syntax, (smiLPOPAQUE)&dValue.value.oid); - } else if( dValue.syntax == SNMP_SYNTAX_OPAQUE || - dValue.syntax == SNMP_SYNTAX_OCTETS || - dValue.syntax == SNMP_SYNTAX_BITS || - dValue.syntax == SNMP_SYNTAX_IPADDR || - dValue.syntax == SNMP_SYNTAX_NSAPADDR) { - free(dValue.value.string.ptr); - } - } - } - _hPdu = SnmpCreatePdu(session->getHandle(), _pduType, 0, 0, 0, _hVbl); - if(_hPdu == SNMPAPI_FAILURE) { - SnmpFreeVbl(_hVbl); - _requestId = 0; - _state = SNMP_RAREQ_STATE_ERROR; - _error = SNMP_ERROR_GENERR; - SNMP_THROW_ERROR("Could not create PDU", SnmpGetLastError(session->getHandle()), SNMP_ERROR); - } - smiINT32 id; - if(SnmpGetPduData(_hPdu, NULL, &id, NULL, NULL, NULL) == SNMPAPI_FAILURE) { - SnmpFreeVbl(_hVbl); - _requestId = 0; - _state = SNMP_RAREQ_STATE_ERROR; - _error = SNMP_ERROR_GENERR; - SNMP_THROW_ERROR("Could not query PDU request id", SnmpGetLastError(session->getHandle()), SNMP_ERROR); - } - _requestId = id; - _pRemoteAgent->sendRequest(this); -} - -void SNMPRequest::cancel() { - if(isTerminated()) { - return; - } - _pRemoteAgent->cancelRequest(_requestId); - if(SNMPTRACEAENABLED()) { - std::stringstream trace; - trace << "rx < cancelled(" << _requestId << ")"; - SNMPTRACE(trace.str()); - } - _requestId = 0; - SnmpFreePdu(_hPdu); - SnmpFreeVbl(_hVbl); - _error = SNMP_ERROR_NOERROR; - _state = SNMP_RAREQ_STATE_CANCELLED; - ::ResetEvent(_hWait); -} - -void SNMPRequest::addToResult(SNMPObject & object) { - _result.insert(_result.end(), new SNMPObject(object)); -} - -void SNMPRequest::setResult(int error, bool traceIt) { - if(isTerminated()) { - return; - } - SnmpFreePdu(_hPdu); - SnmpFreeVbl(_hVbl); - _error = error; - if(_error != SNMP_ERROR_NOERROR) { - _state = SNMP_RAREQ_STATE_ERROR; - if(traceIt && SNMPTRACEAENABLED()) { - std::stringstream trace; - trace << "rx < error(" << _requestId << ", " << _error << ")"; - SNMPTRACE(trace.str()); - } - } else { - _state = SNMP_RAREQ_STATE_SUCCEEDED; - } - ::SetEvent(_hWait); -} - -void SNMPRequest::wait(DWORD timeout) { - DWORD waitRet = ::WaitForSingleObject(_hWait, timeout); - ::ResetEvent(_hWait); - // _state, _error and result set by WinSNMP! - _pRemoteAgent->cancelRequest(_requestId); - SnmpFreePdu(_hPdu); - SnmpFreeVbl(_hVbl); - if(waitRet == WAIT_FAILED) { - _state = SNMP_RAREQ_STATE_ERROR; - _error = SNMP_ERROR_GENERR; - _requestId = 0; - SNMP_THROW_ERROR("Wait failed", _error, SNMP_ERROR); - } - if(waitRet == WAIT_TIMEOUT || _state == SNMP_RAREQ_STATE_ONGOING) { - _state = SNMP_RAREQ_STATE_TIMEDOUT; - _error = SNMP_ERROR_NOERROR; - if(SNMPTRACEAENABLED()) { - std::stringstream trace; - trace << "rx < timeout(" << _requestId << ", " << timeout << ")"; - SNMPTRACE(trace.str()); - } - } - _requestId = 0; -} - - diff --git a/OcsSnmp/SNMPRequest.h b/OcsSnmp/SNMPRequest.h deleted file mode 100644 index 1cf4c906..00000000 --- a/OcsSnmp/SNMPRequest.h +++ /dev/null @@ -1,104 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include -#include -#include -#include "SNMPObject.h" -#include "SNMPManager.h" - - -class SNMPSession; -class SNMPRemoteAgent; -class SNMPRequestSet; - -#define SNMP_RAREQ_STATE_NONE 0 -#define SNMP_RAREQ_STATE_ONGOING 1 -#define SNMP_RAREQ_STATE_TIMEDOUT 3 -#define SNMP_RAREQ_STATE_SUCCEEDED 4 -#define SNMP_RAREQ_STATE_ERROR 5 -#define SNMP_RAREQ_STATE_CANCELLED 6 - -class SNMPRequest { - friend class SNMPRemoteAgent; - friend class SNMPSession; - friend class SNMPRequestSet; -protected : - std::vector _result; - std::vector _request; - HSNMP_PDU _hPdu; - HSNMP_VBL _hVbl; - HANDLE _hWait; - int _requestId; - int _error; - int _state; - int _pduType; - SNMPRemoteAgent * _pRemoteAgent; -protected : - SNMPRequest(int pduType, SNMPObject * objects, int count, SNMPRemoteAgent * pRemoteAgent); - void addToResult(SNMPObject & object); - void setResult(int error = SNMP_ERROR_NOERROR, bool traceIt = true); - int getRequestCount() { return (int)_request.size(); } - SNMPObject * getRequest(int i) { return _request[i]; } - -public: - virtual ~SNMPRequest(); - -public: - void execute(SNMPRemoteAgent * pRemoteAgent = NULL); - void cancel(); - void wait(DWORD timeout = INFINITE); - - bool isTerminated() { return _state != SNMP_RAREQ_STATE_ONGOING; } - bool timedOut() { return _state == SNMP_RAREQ_STATE_TIMEDOUT; } - bool succeeded() { return _state == SNMP_RAREQ_STATE_SUCCEEDED; } - - int getError() { return _error; } - std::string getErrorAsString(); - - int getResultCount() { return (int)_result.size(); } - SNMPObject * getResult(int i) { return _result[i]; } - - std::string getDisplayInformation() const; - - SNMPRequest * clone(); -}; - -class SNMPRemoteAgentGetRequest : public SNMPRequest { -public: - SNMPRemoteAgentGetRequest(SNMPObject * objects, int count=1, SNMPRemoteAgent * pRemoteAgent = NULL) : SNMPRequest(SNMP_PDU_GET, objects, count, pRemoteAgent) {} - virtual ~SNMPRemoteAgentGetRequest() {} -}; - -class SNMPRemoteAgentGetNextRequest : public SNMPRequest { -public: - SNMPRemoteAgentGetNextRequest(SNMPObject * objects, int count=1, SNMPRemoteAgent * pRemoteAgent = NULL) : SNMPRequest(SNMP_PDU_GETNEXT, objects, count, pRemoteAgent) {} - virtual ~SNMPRemoteAgentGetNextRequest() {} -}; - -class SNMPRemoteAgentSetRequest : public SNMPRequest { -public: - SNMPRemoteAgentSetRequest(SNMPObject * objects, int count=1, SNMPRemoteAgent * pRemoteAgent = NULL) : SNMPRequest(SNMP_PDU_SET, objects, count, pRemoteAgent) {} - virtual ~SNMPRemoteAgentSetRequest() {} -}; - - diff --git a/OcsSnmp/SNMPRequestSet.cpp b/OcsSnmp/SNMPRequestSet.cpp deleted file mode 100644 index 3815ba7c..00000000 --- a/OcsSnmp/SNMPRequestSet.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPRequestSet.h" -#include "SNMPRemoteAgent.h" -#include "SNMPSession.h" -#include "SNMPObject.h" -#include "SNMPException.h" - -#include -#include - -#define __VER__ "1.0" - - -SNMPRequestSet::SNMPRequestSet() { -} - -SNMPRequestSet::~SNMPRequestSet() { - clear(); -} - -void SNMPRequestSet::clear() { - while((int)_requests.size()) { - delete _requests[0]; - _requests.erase(_requests.begin()); - } -} - -void SNMPRequestSet::addRequest(SNMPRequest * request) -{ - _requests.insert(_requests.end(), request->clone()); -} - -void SNMPRequestSet::execute(SNMPRemoteAgent * pRemoteAgent) -{ - for(int i=0; i<(int)_requests.size(); i++) { - _requests[i]->execute(pRemoteAgent); - } -} - -void SNMPRequestSet::cancel() -{ - for(int i=0; i<(int)_requests.size(); i++) { - _requests[i]->cancel(); - } -} - - -void SNMPRequestSet::wait(DWORD timeout) -{ - int count = (int)_requests.size(); - SNMPRequest ** requests = new SNMPRequest*[count]; - HANDLE * events = new HANDLE[count]; - int cnt = 0; - int i; - for(i=0; i_hWait; - cnt++; - } - if(cnt > MAXIMUM_WAIT_OBJECTS) { - delete [] events; - delete [] requests; - SNMP_THROW_ERROR("Cannot wait for that many requests", SNMPAPI_OTHER_ERROR, SNMP_ERROR); - } - DWORD waitRet = ::WaitForMultipleObjects(cnt, events, TRUE, timeout); - for(i=0; i_hWait); - // _state, _error and result set by WinSNMP! - requests[i]->_pRemoteAgent->cancelRequest(requests[i]->_requestId); - SnmpFreePdu(requests[i]->_hPdu); - SnmpFreeVbl(requests[i]->_hVbl); - if(waitRet == WAIT_FAILED) { - requests[i]->_state = SNMP_RAREQ_STATE_ERROR; - requests[i]->_error = SNMP_ERROR_GENERR; - } - if(requests[i]->_state == SNMP_RAREQ_STATE_ONGOING) { - requests[i]->_state = SNMP_RAREQ_STATE_TIMEDOUT; - requests[i]->_error = SNMP_ERROR_NOERROR; - if(SNMPTRACEAENABLED()) { - std::stringstream trace; - trace << "rx < timeout(" << requests[i]->_requestId << ", " << timeout << ")"; - SNMPTRACE(trace.str()); - } - } - requests[i]->_requestId = 0; - } - delete [] events; - delete [] requests; - if(waitRet == WAIT_FAILED) { - SNMP_THROW_ERROR("Wait failed", SNMPAPI_OTHER_ERROR, SNMP_ERROR); - } -} - -bool SNMPRequestSet::isTerminated() -{ - bool terminated = true; - for(int i=0; i<(int)_requests.size(); i++) { - terminated &= _requests[i]->isTerminated(); - } - return terminated; -} - -std::string SNMPRequestSet::getDisplayInformation() const -{ - std::stringstream ss; - ss << "Request Set: ["; - for(int i=0; i<(int)_requests.size(); i++) { - ss << _requests[i]->getDisplayInformation(); - if(i < (int)_requests.size()-1) { - ss << ", "; - } - } - ss << "]"; - return ss.str(); -} diff --git a/OcsSnmp/SNMPRequestSet.h b/OcsSnmp/SNMPRequestSet.h deleted file mode 100644 index 27fd211c..00000000 --- a/OcsSnmp/SNMPRequestSet.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include -#include -#include -#include "SNMPRequest.h" - - -class SNMPRequestSet { -protected : - std::vector _requests; -public: - SNMPRequestSet(); - virtual ~SNMPRequestSet(); - - void addRequest(SNMPRequest * request); - int getRequestCount() { return (int)_requests.size(); } - SNMPRequest * getRequest(int i) { return _requests[i]; } - void clear(); - - void execute(SNMPRemoteAgent * pRemoteAgent = NULL); - void cancel(); - void wait(DWORD timeout = INFINITE); - - bool isTerminated(); - - std::string getDisplayInformation() const; -}; diff --git a/OcsSnmp/SNMPSession.cpp b/OcsSnmp/SNMPSession.cpp deleted file mode 100644 index abc7674c..00000000 --- a/OcsSnmp/SNMPSession.cpp +++ /dev/null @@ -1,178 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPManager.h" -#include "SNMPException.h" -#include "SNMPObject.h" -#include "SNMPTracer.h" - -#include -#include - -#define __VER__ "1.0" - - -SNMPAPI_STATUS CALLBACK snmpCallBackFunction( HSNMP_SESSION hSession, HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam, LPVOID lpClientData) { - SNMPSession * session = (SNMPSession*)lpClientData; - return session->processNotification(wParam, lParam); -} - - - -SNMPSession::SNMPSession() { - _hSession = SnmpCreateSession (0, 0, snmpCallBackFunction, this); - if(SNMPAPI_FAILURE == _hSession) { - SNMP_THROW_ERROR("Could not create WinSNMP session", SnmpGetLastError(NULL), SNMP_ERROR); - } - SNMPManager::getManager()->registerSession(this); -} - -SNMPSession::~SNMPSession() { - SNMPManager::getManager()->unregisterSession(this); - closeSession(); -} - -void SNMPSession::closeSession() { - std::map::iterator i; - while((i=_ragents.begin()) != _ragents.end()) { - delete (*i).second; - } - SnmpClose(_hSession); -} - -SNMPAPI_STATUS SNMPSession::processNotification(WPARAM wParam, LPARAM lParam) { - if(wParam == 0) { - HSNMP_PDU hPdu; - HSNMP_CONTEXT hContext; - HSNMP_ENTITY hDstEntity; - HSNMP_ENTITY hSrcEntity; - SNMPAPI_STATUS ret = SnmpRecvMsg(_hSession, &hSrcEntity, &hDstEntity, &hContext, &hPdu); - SNMPRemoteAgent * pRa = getRemoteAgent(hContext); - int requestId = (DWORD)lParam; - SNMPRequest * pRequest = NULL; - if(pRa) { - pRequest = pRa->getRequest(requestId); - } - if(ret == SNMPAPI_FAILURE) { - if(pRequest) { - pRequest->setResult(SNMP_ERROR_GENERR); - } - SnmpFreeVbl(hPdu); - return SNMPAPI_SUCCESS; - } - smiINT32 lReqId, lType, lErr, lIdx; - HSNMP_VBL hVbl; - ret = SnmpGetPduData(hPdu, &lType, &lReqId, &lErr, &lIdx, &hVbl); - if(ret == SNMPAPI_FAILURE) { - if(pRequest) { - pRequest->setResult(SNMP_ERROR_GENERR); - } - SnmpFreeVbl(hPdu); - return SNMPAPI_SUCCESS; - } - if(SNMPTRACEAENABLED()) { - std::stringstream trace; - trace << "rx " << SNMPManager::pduToStr(hDstEntity, hSrcEntity, hContext, lType, lReqId, lErr, hVbl, false); - SNMPTRACE(trace.str()); - } - if(lType != SNMP_PDU_RESPONSE) { - pRequest = NULL; - } - if(pRequest == NULL && lType != SNMP_PDU_TRAP && lType != SNMP_PDU_INFORM) { - SnmpFreeVbl(hVbl); - SnmpFreeVbl(hPdu); - return SNMPAPI_SUCCESS; - } - - smiOID dRetName; - smiVALUE dRetValue; - int count = SnmpCountVbl(hVbl); - if(count) { - char szName[MAXOBJIDSTRSIZE+1]; - szName[0] = szName[MAXOBJIDSTRSIZE] = '\0'; - for(int i=0; isetResult(SNMP_ERROR_GENERR); - } - return SNMPAPI_SUCCESS; - } - if(SnmpOidToStr(&dRetName, sizeof(szName), szName) == SNMPAPI_FAILURE) { - szName[0] = '\0'; - } - SNMPObject obj; - obj.setValue(&dRetValue); - obj.setOID(szName); - if(pRequest) { - pRequest->addToResult(obj); - } else { - processTrap(obj); - } - SnmpFreeDescriptor(SNMP_SYNTAX_OID, (smiLPOPAQUE)&dRetName); - if(dRetValue.syntax == SNMP_SYNTAX_OID) { - SnmpFreeDescriptor(dRetValue.syntax, (smiLPOPAQUE)&dRetValue.value.oid); - } else if( dRetValue.syntax == SNMP_SYNTAX_OPAQUE || - dRetValue.syntax == SNMP_SYNTAX_OCTETS || - dRetValue.syntax == SNMP_SYNTAX_BITS || - dRetValue.syntax == SNMP_SYNTAX_IPADDR || - dRetValue.syntax == SNMP_SYNTAX_NSAPADDR) { - SnmpFreeDescriptor(dRetValue.syntax, (smiLPOPAQUE)&dRetValue.value.string); - } - } - } - SnmpFreeVbl(hVbl); - SnmpFreePdu(hPdu); - if(pRequest) { - pRequest->setResult(lErr, false); - } - return SNMPAPI_SUCCESS; - } - return SNMPAPI_SUCCESS; -} - - -void SNMPSession::unregisterRemoteAgent(SNMPRemoteAgent * ragent) { - _ragents.erase(ragent->getContextHandle()); -} - -void SNMPSession::registerRemoteAgent(SNMPRemoteAgent * ragent) { - _ragents[ragent->getContextHandle()] = ragent; -} - -/* -int SNMPSession::getNextRequestId() -{ - _id++; - if(!_id) { - _id++; - } - return _id; -} -*/ - -SNMPRemoteAgent * SNMPSession::getRemoteAgent(HSNMP_CONTEXT handle) { - std::map::const_iterator pos; - pos = _ragents.find(handle); - if(pos == _ragents.end()) { - return NULL; - } - return pos->second; -} diff --git a/OcsSnmp/SNMPSession.h b/OcsSnmp/SNMPSession.h deleted file mode 100644 index 6fdcba8f..00000000 --- a/OcsSnmp/SNMPSession.h +++ /dev/null @@ -1,56 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include -#include -#include "SNMPRemoteAgent.h" -#include "SNMPRequest.h" -#include "SNMPTrap.h" - -class SNMPSession { - -friend class SNMPRemoteAgent; -friend class SNMPManager; -friend class SNMPRequest; -friend class SNMPTrap; -friend SNMPAPI_STATUS CALLBACK snmpCallBackFunction( HSNMP_SESSION hSession, HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam, LPVOID lpClientData); - -protected: - HSNMP_SESSION _hSession; - SNMPSession(HSNMP_SESSION hSession); - void closeSession(); - - std::map _ragents; - SNMPRemoteAgent * getRemoteAgent(HSNMP_CONTEXT handle); - void unregisterRemoteAgent(SNMPRemoteAgent * ragent); - void registerRemoteAgent(SNMPRemoteAgent * ragent); - SNMPAPI_STATUS processNotification(WPARAM wParam, LPARAM lParam); - - const HSNMP_SESSION getHandle() const { return _hSession; } -public: - SNMPSession(); - ~SNMPSession(); - - virtual void processTrap(const SNMPObject & object) {} -}; - - diff --git a/OcsSnmp/SNMPTracer.cpp b/OcsSnmp/SNMPTracer.cpp deleted file mode 100644 index 7d459025..00000000 --- a/OcsSnmp/SNMPTracer.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPTracer.h" - -#include -#include - -#define __VER__ "1.0" - -#pragma warning(disable : 4996) - - -SNMPTracer SNMPTracer::_snmpTracer; - -SNMPTracer::SNMPTracer() { - _active = false; - _hConsole = INVALID_HANDLE_VALUE; - _hConsoleInput = INVALID_HANDLE_VALUE; - ::AllocConsole(); - _hConsole = ::GetStdHandle(STD_OUTPUT_HANDLE); - _hConsoleInput = ::GetStdHandle(STD_INPUT_HANDLE); -} - -SNMPTracer::~SNMPTracer() { - ::CloseHandle(_hConsole); - ::CloseHandle(_hConsoleInput); - ::FreeConsole(); -} - -void SNMPTracer::trace(const std::string & message) { - if(!isEnabled() || _hConsole == INVALID_HANDLE_VALUE) { - return; - } - std::stringstream ss; - SYSTEMTIME time; - ::GetLocalTime(&time); - char timeStr[33]; - sprintf(timeStr, "%.2d:%.2d:%.2d,%.3d", time.wHour, time.wMinute, time.wSecond, time.wMilliseconds); - ss << timeStr << ": " << message << "\n"; - DWORD chars; - ::WriteConsole(_hConsole, ss.str().c_str(), (DWORD)ss.str().size(), &chars, NULL); -} diff --git a/OcsSnmp/SNMPTracer.h b/OcsSnmp/SNMPTracer.h deleted file mode 100644 index 0017ae0d..00000000 --- a/OcsSnmp/SNMPTracer.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include - -#define SNMPTRACE(a) SNMPTracer::getTracer()->trace(a) -#define SNMPTRACEAENABLED() SNMPTracer::getTracer()->isEnabled() - -class SNMPTracer { -protected: - static SNMPTracer _snmpTracer; - - HANDLE _hConsole; - HANDLE _hConsoleInput; - bool _active; - - SNMPTracer(); - ~SNMPTracer(); - -public: - static SNMPTracer * getTracer() { return &_snmpTracer; } - - void enable(bool on) { _active = on; } - bool isEnabled() const { return _active; } - void trace(const std::string & message); -}; - - diff --git a/OcsSnmp/SNMPTrap.cpp b/OcsSnmp/SNMPTrap.cpp deleted file mode 100644 index a9df4d91..00000000 --- a/OcsSnmp/SNMPTrap.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#include "SNMPTrap.h" -#include "SNMPRemoteAgent.h" -#include "SNMPSession.h" -#include "SNMPObject.h" -#include "SNMPException.h" - -#include -#include - -#define __VER__ "1.0" - - -std::string SNMPTrap::getDisplayInformation() const -{ - std::stringstream ss; - ss << "Trap: [" << _pattern << "]"; - return ss.str(); -} - -SNMPTrap * SNMPTrap::clone() -{ - SNMPTrap * myclone = new SNMPTrap(_pattern, _pRemoteAgent); - return myclone; -} - -SNMPTrap::SNMPTrap(std::string pattern, SNMPRemoteAgent * pRemoteAgent) { - _registered = false; - _pRemoteAgent = pRemoteAgent; - _pattern = pattern; - if(_pattern != "") { - if(SnmpStrToOid(_pattern.c_str(), &_oidPattern) == SNMPAPI_FAILURE) { - SNMP_THROW_ERROR("Could not convert OID from string representation", SnmpGetLastError(NULL), SNMP_ERROR); - } - } -} - -SNMPTrap::~SNMPTrap() -{ - disable(); - if(_pattern != "") { - SnmpFreeDescriptor(SNMP_SYNTAX_OCTETS, (smiLPOPAQUE)&_oidPattern); - } -} - -void SNMPTrap::disable() -{ - _registered = false; - if(!_pRemoteAgent || !_registered) { - return; - } - SNMPSession * session = _pRemoteAgent->getSession(); - smiLPCOID notification = NULL; - if(_pattern != "") { - notification = &_oidPattern; - } - if(SNMPTRACEAENABLED()) { - std::stringstream trace; - trace << "trap off < " << _pRemoteAgent->getName() << " " << _pRemoteAgent->getCommunity() << " " << _pattern; - SNMPTRACE(trace.str()); - } - if(SNMPAPI_SUCCESS != SnmpRegister( session->getHandle(), - NULL, - _pRemoteAgent->getCommunityHandle(), - _pRemoteAgent->getContextHandle(), - notification, - SNMPAPI_OFF)) { - SNMP_THROW_ERROR("Could not unregister trap", SnmpGetLastError(session->getHandle()), SNMP_ERROR); - } -} - -void SNMPTrap::enable(SNMPRemoteAgent * pRemoteAgent) { - if(pRemoteAgent != _pRemoteAgent) { - disable(); - if(pRemoteAgent != NULL) { - _pRemoteAgent = pRemoteAgent; - } - } - if(!_pRemoteAgent || _registered) { - return; - } - SNMPSession * session = _pRemoteAgent->getSession(); - smiLPCOID notification = NULL; - if(_pattern != "") { - notification = &_oidPattern; - } - if(SNMPTRACEAENABLED()) { - std::stringstream trace; - trace << "trap on < " << _pRemoteAgent->getName() << " " << _pRemoteAgent->getCommunity() << " " << _pattern; - SNMPTRACE(trace.str()); - } - if(SNMPAPI_SUCCESS != SnmpRegister( session->getHandle(), - NULL, - _pRemoteAgent->getCommunityHandle(), - _pRemoteAgent->getContextHandle(), - notification, - SNMPAPI_ON)) { - SNMP_THROW_ERROR("Could not register trap", SnmpGetLastError(session->getHandle()), SNMP_ERROR); - } -} - diff --git a/OcsSnmp/SNMPTrap.h b/OcsSnmp/SNMPTrap.h deleted file mode 100644 index 66690839..00000000 --- a/OcsSnmp/SNMPTrap.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#pragma once - -#include "Winsnmp.h" -#include -#include -#include -#include "SNMPObject.h" - - -class SNMPSession; -class SNMPRemoteAgent; - -class SNMPTrap { - friend class SNMPRemoteAgent; - friend class SNMPSession; -protected : - std::string _pattern; - smiOID _oidPattern; - SNMPRemoteAgent * _pRemoteAgent; - bool _registered; - -public: - SNMPTrap(std::string pattern, SNMPRemoteAgent * pRemoteAgent); - virtual ~SNMPTrap(); - -public: - void enable(SNMPRemoteAgent * pRemoteAgent = NULL); - void disable(); - - SNMPTrap * clone(); - - std::string getDisplayInformation() const; -}; - - diff --git a/OcsSnmp/licence.txt b/OcsSnmp/licence.txt deleted file mode 100644 index dcfa4c23..00000000 --- a/OcsSnmp/licence.txt +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/OcsSnmp/main.cpp b/OcsSnmp/main.cpp deleted file mode 100644 index 24c7f513..00000000 --- a/OcsSnmp/main.cpp +++ /dev/null @@ -1,507 +0,0 @@ -// -// SNMP - A C++ Wrapper for the WinSnmp library -// Copyright (C) 2004 Rogério Paulo, rpaulo@bigfoot.com -// -// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -// -// This is a test program set for the code wrapper. -// -// Comment/uncomment these macros to produce different applications -// Note that only one of them can be uncommented: -//#define _SNMP_SCAN_ -#define _SNMP_GET_ -//#define _SNMP_SET_ -//#define _SNMP_WALK_ -//#define _SNMP_TRAP_ -// - -#include "Winsnmp.h" -#include "SNMPManager.h" -#include "SNMPRemoteAgent.h" -#include "SNMPRemoteAgentSet.h" -#include "SNMPRequest.h" -#include "SNMPRequestSet.h" -#include "SNMPObject.h" -#include "SNMPException.h" -#include "SNMPTracer.h" - -#include -#include -using namespace std; - -#define __VER__ "1.0" - -#define IS_OPTION(c) (((c) == '-') || ((c) == '/')) - -int main(int argc, char* argv[]) { - try { - SNMPManager::getManager()->startup(); - -#ifdef _SNMP_WALK_ - std::string oid = "1.3.6.1.6.3.15.4.1.2.1.0"; - std::string host = "172.18.25.254"; - std::string community = "factorfx"; - bool compare_equal = false; - bool compare_smaller = false; - int tmo = 1000; - unsigned int port = 0; - ++argv; - --argc; - int argn = 0; - while(argc>0) { - if(IS_OPTION(**argv)) { - switch(*(*argv+1)) { - case 'h':case '?': - cout << "snmpwalk [-h?] [-T] [-c] [-t] [-p:] host [community [oid]]\n"; - cout << "Options:\n"; - cout << " h, ? - show this help screen\n"; - cout << " s - stop walk if next OID is smaller than current OID\n"; - cout << " e - stop walk if OID is repeated.\n"; - cout << " t: - set timeout to ms\n"; - cout << " p: - set remote agent port to , ex: 123\n"; - cout << " T - enable trace\n"; - cout << "Arguments:\n"; - cout << " host - address or name of agent's host\n"; - cout << " community - community name to scan for, ex: public\n"; - cout << " oid - oid name to walk from, ex: 1.3.6.1.2.1.1.1.0\n"; - return 0; - break; - case 'p': - if( (*(*argv+2)) == ':') { port = atoi(*argv+3); } break; - case 'e': - if( (*(*argv+2)) == '\0') { compare_equal = true; } break; - case 's': - if( (*(*argv+2)) == '\0') { compare_smaller = true; } break; - case 't': - if( (*(*argv+2)) == ':') { tmo = atoi(*argv+3); } break; - case 'T': - if( (*(*argv+2)) == '\0') { SNMPTracer::getTracer()->enable(true); } break; - } - } else { - switch(argn) { - case 0: host = *argv; break; - case 1: community = *argv; break; - case 2: oid = *argv; break; - } - argn++; - } - ++argv; --argc; - } - - SNMPRemoteAgent ragent(host, community, port); - - int oidcount = 1; - int response = 1; - SNMPObject * pRet = NULL; - string old_result = ""; - - bool continueWalk = true; - do { - SNMPObject sysObj(oid); - SNMPRemoteAgentGetNextRequest getReq(&sysObj); - getReq.execute(&ragent); - getReq.wait(tmo); - if(getReq.getResultCount()) { - for(int i=0; igetOID(); - if(compare_smaller) { - continueWalk &= sysObj.compareOID(oid) >= 0; - } - if(compare_equal) { - continueWalk &= sysObj.compareOID(oid) != 0; - } - if(continueWalk) { - std::cout << response << ": " << getReq.getResult(i)->getDisplayInformation() << "\n"; - - if (old_result == getReq.getResult(i)->getDisplayInformation()){ - std::cout << "-------->" << "\n"; - std::cout << old_result << "\n"; - std::cout << getReq.getResult(i)->getDisplayInformation() << "\n"; - std::cout << "Identique => FIN" << "\n"; - std::cout << "-------->" << "\n"; - continueWalk = false; - break; - } - - old_result = getReq.getResult(i)->getDisplayInformation(); - response++; - } else { - break; - } - } - } else { - continueWalk = false; - } - } while(continueWalk); - std::cout << "\n"; - return 0; -#endif - -#ifdef _SNMP_SET_ - std::string host = "172.18.15.227"; - std::string community = "public"; - int tmo = 10000; - unsigned int port = 0; - ++argv; - --argc; - std::string oid = "1.3.6.1.2.1.1.1.0"; - std::string value = "0"; - int type = SNMP_INT; - int argn = 0; - while(argc>0) { - if(IS_OPTION(**argv)) { - switch(*(*argv+1)) { - case 'h':case '?': - cout << "snmpset [-h?] [-T] [-t] [-p:] host [community [oid [value [syntax]]]\n"; - cout << "Options:\n"; - cout << " h, ? - show this help screen\n"; - cout << " t: - set timeout to ms\n"; - cout << " p: - set remote agent port to , ex: 123\n"; - cout << " T - enable trace\n"; - cout << "Arguments:\n"; - cout << " host - address or name of agent's host\n"; - cout << " community - community name to scan for, ex: public \n"; - cout << " oid - oid name to set, ex: 1.3.6.1.2.1.1.1.0 \n"; - cout << " value - value to set\n"; - cout << " syntax - value syntax\n"; - return 0; - break; - case 'p': - if( (*(*argv+2)) == ':') { port = atoi(*argv+3); } break; - case 't': - if( (*(*argv+2)) == ':') { tmo = atoi(*argv+3); } break; - case 'T': - if( (*(*argv+2)) == '\0') { SNMPTracer::getTracer()->enable(true); } break; - } - } else { - switch(argn) { - case 0: host = *argv; break; - case 1: community = *argv; break; - case 2: oid = *argv; break; - case 3: value = *argv; break; - case 4: type = atoi(*argv); break; - } - argn++; - } - ++argv; --argc; - } - - SNMPRemoteAgent ragent(host, community, port); - if(type > SNMP_NULL || type < SNMP_INT) { - type = SNMP_INT; - } - SNMPObject obj(oid); - obj.setSyntax(type); - obj.setValueAsString(value); - SNMPRemoteAgentSetRequest setReq(&obj); - setReq.execute(&ragent); - setReq.wait(tmo); - if(!setReq.succeeded()) { - if(!setReq.timedOut()) { - std::cout << setReq.getErrorAsString(); - } else { - std::cout << "timeout"; - } - } else { - for(int i=0; igetDisplayInformation() << "\n"; - } - } - std::cout << "\n"; - return 0; -#endif - -#ifdef _SNMP_GET_ - std::string host = ""; - std::string community = ""; - int tmo = 10000; - unsigned int port = 161; - ++argv; - --argc; - int oidcount = 0; - int oidi = 0; - std::string oidarray[512]; - int argn = 0; - while(argc>0) { - if(IS_OPTION(**argv)) { - switch(*(*argv+1)) { - case 'h':case '?': - cout << "OcsSnmp.exe [-h?] [-T] [-t] [-p:] host [community [oid1 [oid2 [... [oidn]]]]\n"; - cout << "Options:\n"; - cout << " h, ? - show this help screen\n"; - cout << " t: - set timeout to ms\n"; - cout << " p: - set remote agent port to , ex: 123\n"; - cout << " T - enable trace\n"; - cout << "Arguments:\n"; - cout << " host - address or name of agent's host\n"; - cout << " community - community name to scan for, ex: public \n"; - cout << " oid1..n - oid names to scan for, ex: 1.3.6.1.2.1.1.1.0 \n"; - return 0; - break; - case 'p': - if( (*(*argv+2)) == ':') { port = atoi(*argv+3); } break; - case 't': - if( (*(*argv+2)) == ':') { tmo = atoi(*argv+3); } break; - case 'T': - if( (*(*argv+2)) == '\0') { SNMPTracer::getTracer()->enable(true); } break; - } - } else { - switch(argn) { - case 0: host = *argv; break; - case 1: community = *argv; break; - default: - if(oidcount < 512 ) { - oidarray[oidi] = *argv; - oidi++; - oidcount++; - } - break; - } - argn++; - } - ++argv; --argc; - } - - SNMPRemoteAgent ragent(host, community, port); - - if(oidcount <= 0) { - oidcount = 1; - oidarray[0] = "1.3.6.1.2.1.1.1.0"; - } - - SNMPObject * oids = new SNMPObject[oidcount]; - for(int i=0; igetDisplayInformation() << "\n"; - if (myfile.is_open()) - { - myfile << getReq.getResult(i)->getDisplayInformation() << "\n"; - } - - } - myfile.close(); - - } - std::cout << "\n"; - return 0; -#endif - -#ifdef _SNMP_SCAN_ - unsigned long net = inet_addr("172.18.32.100"); - unsigned long mask = inet_addr("255.255.255.0"); - std::string community = "factorfx"; - std::string oid = "1.3.6.1.2.1.1.1.0"; - int tmo = 500; - unsigned int port = 0; - bool longOutput = false; - ++argv; - --argc; - int argn = 0; - while(argc>0) { - if(IS_OPTION(**argv)) { - switch(*(*argv+1)) { - case 'h':case '?': - cout << "snmpscan [-h?] [-T] [-t] [-p:] [-a] net mask [community [oid] ]\n"; - cout << "Options:\n"; - cout << " h, ? - show this help screen\n"; - cout << " t: - set timeout to ms\n"; - cout << " p: - set remote agent port to , ex: 123\n"; - cout << " a - print all attempts\n"; - cout << " T - enable trace\n"; - cout << "Arguments:\n"; - cout << " net - address of network to scan (x.y.z.w), ex: 1.2.128.4\n"; - cout << " mask - network mask (x.y.z.w), ex: 255,255,0,0\n"; - cout << " community - community name to scan for, ex: public \n"; - cout << " oid - oid name to scan for, ex: 1.3.6.1.2.1.1.1.0 \n"; - return 0; - break; - case 'p': - if( (*(*argv+2)) == ':') { port = atoi(*argv+3); } break; - case 't': - if( (*(*argv+2)) == ':') { tmo = atoi(*argv+3); } break; - case 'a': - if( (*(*argv+2)) == '\0') { longOutput = true; } break; - case 'T': - if( (*(*argv+2)) == '\0') { SNMPTracer::getTracer()->enable(true); } break; - } - } else { - switch(argn) { - case 0: net = inet_addr(*argv); break; - case 1: mask = inet_addr(*argv); break; - case 2: community = *argv; break; - case 3: oid = *argv; break; - } - argn++; - } - ++argv; --argc; - } - - std::string shost; - unsigned long host; - unsigned long subhost = ntohl(net & (~mask)); - unsigned long maxsubhost = ntohl(0xFFFFFFFF & (~mask)); - - unsigned long scanCount = 0; - unsigned long foundCount = 0; - DWORD tnow = ::GetTickCount(); - int maxInSet = 64; - - SNMPRemoteAgentSet agentSet; - SNMPRequestSet requestSet; - while(subhost <= maxsubhost) { - while(subhost <= maxsubhost && requestSet.getRequestCount() < maxInSet) { - if(subhost == 0) { - subhost++; - } - host = (net & mask) | htonl(subhost); - struct in_addr addr; - addr.S_un.S_addr = host; - shost = std::string(inet_ntoa(addr)); - agentSet.addAgent(shost, community, port); - SNMPObject obj; - if(oid == "") { - obj.setOID("0.0"); - SNMPRemoteAgentGetNextRequest getNextReq(&obj, 1, agentSet.getAgent(agentSet.getAgentCount()-1)); - requestSet.addRequest(&getNextReq); - } else { - obj.setOID(oid); - SNMPRemoteAgentGetRequest getReq(&obj, 1, agentSet.getAgent(agentSet.getAgentCount()-1)); - requestSet.addRequest(&getReq); - } - subhost++; - scanCount++; - } - if(requestSet.getRequestCount()) { - for(int i=0; iexecute(); - } - requestSet.wait(tmo); - - for(int i=0; igetResultCount()) { - foundCount++; - std::cout << agentSet.getAgent(i)->getName() << ": " << requestSet.getRequest(i)->getResult(0)->getValueAsString() << "\n"; - } else { - if(longOutput) { - std::cout << agentSet.getAgent(i)->getName() << ": " << "n/a\n"; - } - } - } - requestSet.clear(); - agentSet.clear(); - } - } - - tnow = ::GetTickCount() - tnow; - std::cout << "\nFound " << foundCount << "/" << scanCount << " in " << ((double)tnow)/((double)1000) << " seconds.\n"; - std::cout << "\n"; - return 0; -#endif - -#ifdef _SNMP_TRAP_ - std::string host = "172.18.200.90"; - std::string community = "public"; - ++argv; - --argc; - std::string oid = ""; - std::string oidarray[512]; - int argn = 0; - while(argc>0) { - if(IS_OPTION(**argv)) { - switch(*(*argv+1)) { - case 'h':case '?': - cout << "snmptrap [-h?] [-T] host [community [oid]]\n"; - cout << "Options:\n"; - cout << " h, ? - show this help screen\n"; - cout << " T - enable trace\n"; - cout << "Arguments:\n"; - cout << " host - address or name of agent's host\n"; - cout << " community - community name to scan for, ex: public \n"; - cout << " oid - trap filter \n"; - return 0; - break; - case 'T': - if( (*(*argv+2)) == '\0') { SNMPTracer::getTracer()->enable(true); } break; - } - } else { - switch(argn) { - case 0: host = *argv; break; - case 1: community = *argv; break; - case 2: oid = *argv; break; - } - argn++; - } - ++argv; --argc; - } - - class MySession : public SNMPSession { - public: - virtual void processTrap(const SNMPObject & obj) { - std::cout << obj.getDisplayInformation() << "\n"; - } - }; - - MySession session; - SNMPRemoteAgent ragent(host, community, 0, &session); - SNMPTrap trap(oid, &ragent); - trap.enable(); - - while(true) { - ::Sleep(1000); - } - - trap.disable(); - std::cout << "\n"; - return 0; -#endif - - } catch (SNMPException * pe) { - std::cout << "\n\n"; - std::cout << pe->toStringStack(); - std::cout << "\n"; - delete pe; - } - return 0; -} \ No newline at end of file diff --git a/OcsSnmp/resource.h b/OcsSnmp/resource.h deleted file mode 100644 index 8d0d9227..00000000 Binary files a/OcsSnmp/resource.h and /dev/null differ diff --git a/OcsSnmp/snmp.sdf b/OcsSnmp/snmp.sdf deleted file mode 100644 index c8b35657..00000000 Binary files a/OcsSnmp/snmp.sdf and /dev/null differ diff --git a/OcsSnmp/snmp.sln b/OcsSnmp/snmp.sln deleted file mode 100644 index df582fa9..00000000 --- a/OcsSnmp/snmp.sln +++ /dev/null @@ -1,26 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E1B7D168-2FA9-48CC-9AE0-E124F423D885}" - ProjectSection(SolutionItems) = preProject - snmp.vsd = snmp.vsd - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "snmp", "snmp.vcxproj", "{4DD39232-A819-4A48-A695-E14F66667183}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|Win32.ActiveCfg = Debug|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Debug|Win32.Build.0 = Debug|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|Win32.ActiveCfg = Release|Win32 - {4DD39232-A819-4A48-A695-E14F66667183}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/OcsSnmp/snmp.vcproj b/OcsSnmp/snmp.vcproj deleted file mode 100644 index 967aac3c..00000000 --- a/OcsSnmp/snmp.vcproj +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OcsSnmp/snmp.vcxproj b/OcsSnmp/snmp.vcxproj deleted file mode 100644 index b1e276b8..00000000 --- a/OcsSnmp/snmp.vcxproj +++ /dev/null @@ -1,224 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4DD39232-A819-4A48-A695-E14F66667183} - snmp - Win32Proj - OcsSnmp - 10.0.18362.0 - - - - Application - v141 - Unicode - false - - - Application - v141 - x64 - Unicode - false - - - Application - v141 - Unicode - false - - - Application - v141 - Unicode - false - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>12.0.30501.0 - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - true - $(ProjectName) - - - true - $(ProjectName) - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - false - $(ProjectName) - - - false - $(ProjectName) - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreaded - - Level3 - ProgramDatabase - %(AdditionalIncludeDirectories) - - - Wsnmp32.lib;Wsock32.lib;%(AdditionalDependencies) - $(OutDir)OcsSnmp.exe - true - $(OutDir)snmp.pdb - Console - MachineX86 - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreaded - - - Level3 - ProgramDatabase - %(AdditionalIncludeDirectories) - - - Wsnmp32.lib;Wsock32.lib;%(AdditionalDependencies) - $(OutDir)OcsSnmp.exe - true - $(OutDir)snmp.pdb - Console - - - - - MaxSpeed - OnlyExplicitInline - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - Level3 - ProgramDatabase - - - - - Wsnmp32.lib;Wsock32.lib;%(AdditionalDependencies) - $(OutDir)OcsSnmp.exe - true - Console - true - true - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - true - _WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - ProgramDatabase - - - - - Wsnmp32.lib;Wsock32.lib;%(AdditionalDependencies) - $(OutDir)OcsSnmp.exe - true - Console - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OcsSnmp/snmp.vsd b/OcsSnmp/snmp.vsd deleted file mode 100644 index 6b2f4732..00000000 Binary files a/OcsSnmp/snmp.vsd and /dev/null differ diff --git a/OcsSystray/OcsSystray.cpp b/OcsSystray/OcsSystray.cpp index 67b156e5..2fe5122f 100644 --- a/OcsSystray/OcsSystray.cpp +++ b/OcsSystray/OcsSystray.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSystray/OcsSystray.h b/OcsSystray/OcsSystray.h index 7fced7db..83e69ab5 100644 --- a/OcsSystray/OcsSystray.h +++ b/OcsSystray/OcsSystray.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSystray/OcsSystray.rc b/OcsSystray/OcsSystray.rc index f4a7533a..b651ce9c 100644 --- a/OcsSystray/OcsSystray.rc +++ b/OcsSystray/OcsSystray.rc @@ -29,16 +29,16 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL IDD_OCSSYSTRAY_DIALOG DIALOGEX 0, 0, 301, 232 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "OCS Inventory NG Agent for Windows" +CAPTION "OCS Inventory Agent for Windows" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDCANCEL,111,205,80,20 ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 - LTEXT "OCS Inventory NG Agent for Windows",IDC_STATIC,42,7,218,8 + LTEXT "OCS Inventory Agent for Windows",IDC_STATIC,42,7,218,8 LTEXT "Visit http://www.ocsinventory-ng.org",IDC_WEB_URL,42,20,218,8 - GROUPBOX "OCS Inventory NG Service Status",IDC_STATIC,7,41,287,30 + GROUPBOX "OCS Inventory Service Status",IDC_STATIC,7,41,287,30 LTEXT "Service is running...",IDC_SERVICE_STATUS,35,55,252,8 - GROUPBOX "OCS Inventory NG Components",IDC_STATIC,7,75,287,124 + GROUPBOX "OCS Inventory Components",IDC_STATIC,7,75,287,124 LTEXT "Service Version xx.xx.xx.xx",IDC_VERSION_SERVICE,35,95,252,8 LTEXT "Agent Version xx.xx.xx.xx",IDC_VERSION_AGENT,35,107,252,8 LTEXT "Download Version xx.xx.xx.xx",IDC_VERSION_DOWNLOAD,35,119,252,8 @@ -51,12 +51,12 @@ END IDD_SHOW_INVENTORY_DIALOG DIALOGEX 0, 0, 600, 400 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "OCS Inventory NG Agent for Windows" +CAPTION "OCS Inventory Agent for Windows" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "&OK",IDCANCEL,274,380,50,14 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 - LTEXT "OCS Inventory NG Agent for Windows",IDC_STATIC,42,7,218,8 + LTEXT "OCS Inventory Agent for Windows",IDC_STATIC,42,7,218,8 LTEXT "Visit http://www.ocsinventory-ng.org",IDC_WEB_URL,42,20,218,8 CTEXT "",IDC_BROWSER,13,55,572,316,SS_CENTERIMAGE | NOT WS_VISIBLE,WS_EX_STATICEDGE GROUPBOX "Inventory informations for computer...",IDC_STATIC,7,41,584,335 @@ -95,11 +95,11 @@ END IDR_MAINFRAME MENU BEGIN - POPUP "OCS Inventory NG" + POPUP "OCS Inventory" BEGIN - MENUITEM "OCS Inventory NG Agent for Windows", IDC_SYSTRAY_DISPLAY, GRAYED + MENUITEM "OCS Inventory Agent for Windows", IDC_SYSTRAY_DISPLAY, GRAYED MENUITEM SEPARATOR - MENUITEM "&Run OCS Inventory NG Agent now", IDC_SYSTRAY_RUN_AGENT + MENUITEM "&Run OCS Inventory Agent now", IDC_SYSTRAY_RUN_AGENT MENUITEM "&Show inventory informations", IDC_SYSTRAY_SHOW_INVENTORY MENUITEM SEPARATOR MENUITEM "&Exit", IDOK @@ -114,7 +114,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "OCS Inventory NG Agent for Windows" + AFX_IDS_APP_TITLE "OCS Inventory Agent for Windows" END STRINGTABLE @@ -126,7 +126,7 @@ BEGIN IDS_SERVICE_STOPPING "%s is stopping..." IDS_SERVICE_STOPPED "%s is stopped..." IDS_START_INVENTORY_SUCCESSFULL - "Start inventory notification successfully sent to OCS Inventory NG Service" + "Start inventory notification successfully sent to OCS Inventory Service" IDS_SHOW_INVENTORY_FAILED "Cannot display inventory informations !\n\nReason: %s" END @@ -149,16 +149,16 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL IDD_OCSSYSTRAY_DIALOG DIALOGEX 0, 0, 301, 232 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "OCS Inventory NG Agent for Windows" +CAPTION "OCS Inventory Agent for Windows" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDCANCEL,111,205,80,20 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 - LTEXT "Agente OCS Inventory NG para Windows",IDC_STATIC,42,7,218,8 + LTEXT "Agente OCS Inventory para Windows",IDC_STATIC,42,7,218,8 LTEXT "Visita http://www.ocsinventory-ng.org",IDC_WEB_URL,42,20,218,8 - GROUPBOX "Estado del servicio OCS Inventory NG",IDC_STATIC,7,41,287,30 + GROUPBOX "Estado del servicio OCS Inventory",IDC_STATIC,7,41,287,30 LTEXT "El servicio está en marcha...",IDC_SERVICE_STATUS,35,55,252,8 - GROUPBOX "Componentes del OCS Inventory NG",IDC_STATIC,7,75,287,124 + GROUPBOX "Componentes del OCS Inventory",IDC_STATIC,7,75,287,124 LTEXT "Versión del servicio xx.xx.xx.xx",IDC_VERSION_SERVICE,35,95,252,8 LTEXT "Versión del Agente xx.xx.xx.xx",IDC_VERSION_AGENT,35,107,252,8 LTEXT "Versión de descarga xx.xx.xx.xx",IDC_VERSION_DOWNLOAD,35,119,252,8 @@ -171,12 +171,12 @@ END IDD_SHOW_INVENTORY_DIALOG DIALOGEX 0, 0, 600, 400 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Agente OCS Inventory NG para Windows" +CAPTION "Agente OCS Inventory para Windows" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "&OK",IDCANCEL,274,380,50,14 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 - LTEXT "Agente OCS Inventory NG para Windows",IDC_STATIC,42,7,218,8 + LTEXT "Agente OCS Inventory para Windows",IDC_STATIC,42,7,218,8 LTEXT "Visita http://www.ocsinventory-ng.org",IDC_WEB_URL,42,20,218,8 CTEXT "",IDC_BROWSER,13,55,572,316,SS_CENTERIMAGE | NOT WS_VISIBLE,WS_EX_STATICEDGE GROUPBOX "Información del Inventory para el ordenador...",IDC_STATIC,7,41,584,335 @@ -215,11 +215,11 @@ END IDR_MAINFRAME MENU BEGIN - POPUP "OCS Inventory NG" + POPUP "OCS Inventory" BEGIN - MENUITEM "Agente OCS Inventory NG para Windows", IDC_SYSTRAY_DISPLAY, GRAYED + MENUITEM "Agente OCS Inventory para Windows", IDC_SYSTRAY_DISPLAY, GRAYED MENUITEM SEPARATOR - MENUITEM "&Ejecuta el Agente OCS Inventory NG ahora", IDC_SYSTRAY_RUN_AGENT + MENUITEM "&Ejecuta el Agente OCS Inventory ahora", IDC_SYSTRAY_RUN_AGENT MENUITEM "&Muestra información del inventario", IDC_SYSTRAY_SHOW_INVENTORY MENUITEM SEPARATOR MENUITEM "&Salir", IDOK @@ -234,7 +234,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "OCS Inventory NG Agent for Windows" + AFX_IDS_APP_TITLE "OCS Inventory Agent for Windows" END STRINGTABLE @@ -246,7 +246,7 @@ BEGIN IDS_SERVICE_STOPPING "%s está parando..." IDS_SERVICE_STOPPED "%s está parado..." IDS_START_INVENTORY_SUCCESSFULL - "La notificación de inicio de inventario se ha mandado correctamente al Servicio OCS Inventory NG" + "La notificación de inicio de inventario se ha mandado correctamente al Servicio OCS Inventory" IDS_SHOW_INVENTORY_FAILED "No se puede mostrar la información del inventario ! Razón: %s" END @@ -269,16 +269,16 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL IDD_OCSSYSTRAY_DIALOG DIALOGEX 0, 0, 301, 232 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "OCS Inventory NG Agent for Windows" +CAPTION "OCS Inventory Agent for Windows" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDCANCEL,111,205,80,20 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 - LTEXT "OCS Inventory NG Agent for Windows",IDC_STATIC,42,7,218,8 + LTEXT "OCS Inventory Agent for Windows",IDC_STATIC,42,7,218,8 LTEXT "Visit http://www.ocsinventory-ng.org",IDC_WEB_URL,42,20,218,8 - GROUPBOX "Etat du service OCS Inventory NG",IDC_STATIC,7,41,287,30 + GROUPBOX "Etat du service OCS Inventory",IDC_STATIC,7,41,287,30 LTEXT "Le Service est démarré...",IDC_SERVICE_STATUS,35,55,252,8 - GROUPBOX "Composants OCS Inventory NG",IDC_STATIC,7,75,287,124 + GROUPBOX "Composants OCS Inventory",IDC_STATIC,7,75,287,124 LTEXT "Service Version xx.xx.xx.xx",IDC_VERSION_SERVICE,35,95,252,8 LTEXT "Agent Version xx.xx.xx.xx",IDC_VERSION_AGENT,35,107,252,8 LTEXT "Download Version xx.xx.xx.xx",IDC_VERSION_DOWNLOAD,35,119,252,8 @@ -291,12 +291,12 @@ END IDD_SHOW_INVENTORY_DIALOG DIALOGEX 0, 0, 600, 400 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "OCS Inventory NG Agent for Windows" +CAPTION "OCS Inventory Agent for Windows" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "&OK",IDCANCEL,274,380,50,14 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 - LTEXT "OCS Inventory NG Agent for Windows",IDC_STATIC,42,7,218,8 + LTEXT "OCS Inventory Agent for Windows",IDC_STATIC,42,7,218,8 LTEXT "Visit http://www.ocsinventory-ng.org",IDC_WEB_URL,42,20,218,8 CTEXT "",IDC_BROWSER,13,55,572,316,SS_CENTERIMAGE | NOT WS_VISIBLE,WS_EX_STATICEDGE GROUPBOX "Informations d'inventaire de l'ordinateur...",IDC_STATIC,7,41,584,335 @@ -335,11 +335,11 @@ END IDR_MAINFRAME MENU BEGIN - POPUP "OCS Inventory NG" + POPUP "OCS Inventory" BEGIN - MENUITEM "OCS Inventory NG Agent for Windows", IDC_SYSTRAY_DISPLAY, GRAYED + MENUITEM "OCS Inventory Agent for Windows", IDC_SYSTRAY_DISPLAY, GRAYED MENUITEM SEPARATOR - MENUITEM "&Exécuter l'agent OCS Inventory NG maintenant", IDC_SYSTRAY_RUN_AGENT + MENUITEM "&Exécuter l'agent OCS Inventory maintenant", IDC_SYSTRAY_RUN_AGENT MENUITEM "&Afficher les informations d'inventaire", IDC_SYSTRAY_SHOW_INVENTORY MENUITEM SEPARATOR MENUITEM "&Quitter", IDOK @@ -354,7 +354,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "OCS Inventory NG Agent for Windows" + AFX_IDS_APP_TITLE "OCS Inventory Agent for Windows" END STRINGTABLE @@ -366,7 +366,7 @@ BEGIN IDS_SERVICE_STOPPING "%s est en cours d'arrêt..." IDS_SERVICE_STOPPED "%s est arrété..." IDS_START_INVENTORY_SUCCESSFULL - "La notification de démarrage d'inventaire a été envoyée avec succès au service OCS Inventory NG" + "La notification de démarrage d'inventaire a été envoyée avec succès au service OCS Inventory" IDS_SHOW_INVENTORY_FAILED "Impossible d'afficher les informations d'inventaire !\n\nRaison: %s" END @@ -388,8 +388,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -404,16 +404,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG Systray applet" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG Systray applet" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory Systray applet" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory Systray applet" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "OcsSystray.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OcsSystray.exe" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" @@ -449,16 +449,16 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN IDD_OCSSYSTRAY_DIALOG DIALOGEX 0, 0, 301, 232 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "OCS Inventory NG Agent für Windows" +CAPTION "OCS Inventory Agent für Windows" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDCANCEL,111,205,80,20 ICON IDR_MAINFRAME,IDC_STATIC,7,7,21,20 - LTEXT "OCS Inventory NG Agent für Windows",IDC_STATIC,42,7,218,8 + LTEXT "OCS Inventory Agent für Windows",IDC_STATIC,42,7,218,8 LTEXT "Visit http://www.ocsinventory-ng.org",IDC_WEB_URL,42,20,218,8 - GROUPBOX "OCS Inventory NG Dienst Status",IDC_STATIC,7,41,287,30 + GROUPBOX "OCS Inventory Dienst Status",IDC_STATIC,7,41,287,30 LTEXT "Dienst ist gestartet...",IDC_SERVICE_STATUS,35,55,252,8 - GROUPBOX "OCS Inventory NG Komponenten",IDC_STATIC,7,75,287,124 + GROUPBOX "OCS Inventory Komponenten",IDC_STATIC,7,75,287,124 LTEXT "Dienst Version xx.xx.xx.xx",IDC_VERSION_SERVICE,35,95,252,8 LTEXT "Agent Version xx.xx.xx.xx",IDC_VERSION_AGENT,35,107,252,8 LTEXT "Download Version xx.xx.xx.xx",IDC_VERSION_DOWNLOAD,35,119,252,8 @@ -471,12 +471,12 @@ END IDD_SHOW_INVENTORY_DIALOG DIALOGEX 0, 0, 600, 400 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "OCS Inventory NG Agent für Windows" +CAPTION "OCS Inventory Agent für Windows" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "&OK",IDCANCEL,274,380,50,14 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 - LTEXT "OCS Inventory NG Agent für Windows",IDC_STATIC,42,7,218,8 + LTEXT "OCS Inventory Agent für Windows",IDC_STATIC,42,7,218,8 LTEXT "Visit http://www.ocsinventory-ng.org",IDC_WEB_URL,42,20,218,8 CTEXT "",IDC_BROWSER,13,55,572,316,SS_CENTERIMAGE | NOT WS_VISIBLE,WS_EX_STATICEDGE GROUPBOX "Inventarisierungs-Informationen für Computer...",IDC_STATIC,7,41,584,335 @@ -515,11 +515,11 @@ END IDR_MAINFRAME MENU BEGIN - POPUP "OCS Inventory NG" + POPUP "OCS Inventory" BEGIN - MENUITEM "OCS Inventory NG Agent für Windows", IDC_SYSTRAY_DISPLAY, GRAYED + MENUITEM "OCS Inventory Agent für Windows", IDC_SYSTRAY_DISPLAY, GRAYED MENUITEM SEPARATOR - MENUITEM "&Jetzt OCS Inventory NG Agent starten", IDC_SYSTRAY_RUN_AGENT + MENUITEM "&Jetzt OCS Inventory Agent starten", IDC_SYSTRAY_RUN_AGENT MENUITEM "&Zeige Inventarisierungs-Informationen", IDC_SYSTRAY_SHOW_INVENTORY MENUITEM SEPARATOR MENUITEM "&Ende", IDOK @@ -534,7 +534,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "OCS Inventory NG Agent für Windows" + AFX_IDS_APP_TITLE "OCS Inventory Agent für Windows" END STRINGTABLE @@ -547,7 +547,7 @@ BEGIN IDS_SERVICE_STOPPING "%s wird gestoppt..." IDS_SERVICE_STOPPED "%s wurde gestoppt..." IDS_START_INVENTORY_SUCCESSFULL - "Die Inventarisierungsaufforderung wurde erfolgreich an den Dienst OCS Inventory NG gesendet" + "Die Inventarisierungsaufforderung wurde erfolgreich an den Dienst OCS Inventory gesendet" IDS_SHOW_INVENTORY_FAILED "Die Inventarisierungsinformationen können nicht angezeigt werden! Der Grund ist: %s" END diff --git a/OcsSystray/OcsSystray.vcxproj b/OcsSystray/OcsSystray.vcxproj index 1291462d..2e40b026 100644 --- a/OcsSystray/OcsSystray.vcxproj +++ b/OcsSystray/OcsSystray.vcxproj @@ -22,33 +22,33 @@ {6996497F-BF0D-40B5-8312-7504FB2CD818} OcsSystray MFCProj - 10.0.18362.0 + 10.0 Application - v141 + v142 Dynamic Unicode true Application - v141 + v142 Dynamic Unicode Application - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 diff --git a/OcsSystray/OcsSystrayDlg.cpp b/OcsSystray/OcsSystrayDlg.cpp index ef88ac1d..714b6fa0 100644 --- a/OcsSystray/OcsSystrayDlg.cpp +++ b/OcsSystray/OcsSystrayDlg.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSystray/OcsSystrayDlg.h b/OcsSystray/OcsSystrayDlg.h index 909442f0..7b8cfec4 100644 --- a/OcsSystray/OcsSystrayDlg.h +++ b/OcsSystray/OcsSystrayDlg.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSystray/ShowInventoryDlg.cpp b/OcsSystray/ShowInventoryDlg.cpp index 7dd128dc..88103457 100644 --- a/OcsSystray/ShowInventoryDlg.cpp +++ b/OcsSystray/ShowInventoryDlg.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyleft 2010 OCS Inventory NG Team +// Copyleft 2010 OCS Inventory Team // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSystray/ShowInventoryDlg.h b/OcsSystray/ShowInventoryDlg.h index bc60c461..4120ad19 100644 --- a/OcsSystray/ShowInventoryDlg.h +++ b/OcsSystray/ShowInventoryDlg.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyleft 2010 OCS Inventory NG Team +// Copyleft 2010 OCS Inventory Team // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSystray/stdafx.cpp b/OcsSystray/stdafx.cpp index 68bcc6a8..e129da8e 100644 --- a/OcsSystray/stdafx.cpp +++ b/OcsSystray/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSystray/stdafx.h b/OcsSystray/stdafx.h index a2e8f679..d9b048c6 100644 --- a/OcsSystray/stdafx.h +++ b/OcsSystray/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsSystray/targetver.h b/OcsSystray/targetver.h index 9fc8ea0c..40b8ed6e 100644 --- a/OcsSystray/targetver.h +++ b/OcsSystray/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsWmi/OcsWmi.cpp b/OcsWmi/OcsWmi.cpp index fb06a2c9..f476c9e6 100644 --- a/OcsWmi/OcsWmi.cpp +++ b/OcsWmi/OcsWmi.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsWmi/OcsWmi.h b/OcsWmi/OcsWmi.h index 844275db..e90347fe 100644 --- a/OcsWmi/OcsWmi.h +++ b/OcsWmi/OcsWmi.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsWmi/OcsWmi.rc b/OcsWmi/OcsWmi.rc index 5ed3fec3..8c4663e9 100644 --- a/OcsWmi/OcsWmi.rc +++ b/OcsWmi/OcsWmi.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -41,16 +41,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG WMI Provider" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG WMI Provider" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory WMI Provider" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory WMI Provider" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "OcsWmi.dll" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OcsWmi.dll" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" diff --git a/OcsWmi/OcsWmi.vcxproj b/OcsWmi/OcsWmi.vcxproj index aa441b60..69488975 100644 --- a/OcsWmi/OcsWmi.vcxproj +++ b/OcsWmi/OcsWmi.vcxproj @@ -22,33 +22,33 @@ {08DCFABA-1B27-4850-B5BF-92929CFA75B1} OcsWmi MFCDLLProj - 10.0.18362.0 + 10.0 DynamicLibrary - v141 + v142 Dynamic Unicode true DynamicLibrary - v141 + v142 Dynamic Unicode DynamicLibrary - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 diff --git a/OcsWmi/stdafx.cpp b/OcsWmi/stdafx.cpp index a65682e3..c07c8135 100644 --- a/OcsWmi/stdafx.cpp +++ b/OcsWmi/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsWmi/stdafx.h b/OcsWmi/stdafx.h index d9020178..d0253be3 100644 --- a/OcsWmi/stdafx.h +++ b/OcsWmi/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/OcsWmi/targetver.h b/OcsWmi/targetver.h index 588e6914..8044e3bd 100644 --- a/OcsWmi/targetver.h +++ b/OcsWmi/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Service/NTService.cpp b/Service/NTService.cpp index d083fa79..c325d079 100644 --- a/Service/NTService.cpp +++ b/Service/NTService.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Service/NTService.h b/Service/NTService.h index 78bfd932..72874663 100644 --- a/Service/NTService.h +++ b/Service/NTService.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Service/OcsService.cpp b/Service/OcsService.cpp index 8da6be39..54025cd2 100644 --- a/Service/OcsService.cpp +++ b/Service/OcsService.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyleft 2010 OCS Inventory NG Team +// Copyleft 2010 OCS Inventory Team // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -545,7 +545,7 @@ void COcsService::Run() bNotifyInventory = FALSE; m_iOldPrologFreq = m_iPrologFreq; writeConfig(); - csStatus.Format( _T( "OCS Inventory NG Agent executed successfully.\n\nNew service parameters: FREQ: %i, OLD_FREQ: %i, TTO_WAIT: %i, INVENTORY_ON_STARTUP: %i"), m_iPrologFreq, vOld, m_iTToWait, m_iInventoryOnStatup); + csStatus.Format( _T( "OCS Inventory Agent executed successfully.\n\nNew service parameters: FREQ: %i, OLD_FREQ: %i, TTO_WAIT: %i, INVENTORY_ON_STARTUP: %i"), m_iPrologFreq, vOld, m_iTToWait, m_iInventoryOnStatup); LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_GENERIC_MESSAGE, csStatus); } } @@ -580,7 +580,7 @@ BOOL COcsService::isInventoryStateChanged() // Changed => ask to force inventory in NOTIFY mode CString csMessage; - csMessage.Format( _T( "Inventory state change detected on:\n- network adapters\n\nOCS Inventory NG Agent will be launched in NOTIFY mode")); + csMessage.Format( _T( "Inventory state change detected on:\n- network adapters\n\nOCS Inventory Agent will be launched in NOTIFY mode")); LogEvent( EVENTLOG_INFORMATION_TYPE, EVMSG_GENERIC_MESSAGE, csMessage); return TRUE; } @@ -616,11 +616,11 @@ BOOL COcsService::runAgent( BOOL bNotify) switch (cmProcess.execWait( csCmd, getDataFolder(), FALSE)) { case EXEC_ERROR_START_COMMAND: - csMessage.Format( _T( "Can't launch OCS Inventory NG Agent (%s)"), cmProcess.getOutput()); + csMessage.Format( _T( "Can't launch OCS Inventory Agent (%s)"), cmProcess.getOutput()); LogEvent( EVENTLOG_ERROR_TYPE, EVMSG_GENERIC_ERROR, csMessage); break; case EXEC_ERROR_WAIT_COMMAND: - csMessage.Format( _T( "Can't get OCS Inventory NG Agent exit code")); + csMessage.Format( _T( "Can't get OCS Inventory Agent exit code")); LogEvent( EVENTLOG_ERROR_TYPE, EVMSG_GENERIC_ERROR, csMessage); break; default: @@ -630,7 +630,7 @@ BOOL COcsService::runAgent( BOOL bNotify) { case -1: // Exit code not available - csMessage.Format( _T( "Can't get OCS Inventory NG Agent exit code (%s)"), cmProcess.getOutput()); + csMessage.Format( _T( "Can't get OCS Inventory Agent exit code (%s)"), cmProcess.getOutput()); LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_GENERIC_ERROR, csMessage); break; case 0: @@ -639,27 +639,27 @@ BOOL COcsService::runAgent( BOOL bNotify) break; case 1: // Exit code is 1 => Generic agent Error - csMessage.Format( _T( "OCS Inventory NG Agent encounter an error (exit code is %d => Generic Agent error)"), nExitCode); + csMessage.Format( _T( "OCS Inventory Agent encounter an error (exit code is %d => Generic Agent error)"), nExitCode); LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_GENERIC_ERROR, csMessage); break; case 2: // Exit code is 2 => Agent already running - csMessage.Format( _T( "OCS Inventory NG Agent encounter an error (exit code is %d => Agent is already running)"), nExitCode); + csMessage.Format( _T( "OCS Inventory Agent encounter an error (exit code is %d => Agent is already running)"), nExitCode); LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_GENERIC_ERROR, csMessage); break; case 3: // Exit code is 3 => Failed to load/initialize Communication Provider - csMessage.Format( _T( "OCS Inventory NG Agent encounter an error (exit code is %d => Failed to load/initialize Communication Provider)"), nExitCode); + csMessage.Format( _T( "OCS Inventory Agent encounter an error (exit code is %d => Failed to load/initialize Communication Provider)"), nExitCode); LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_GENERIC_ERROR, csMessage); break; case 4: // Exit code is 4 => Network error - csMessage.Format( _T( "OCS Inventory NG Agent encounter an error (exit code is %d => Failed to talk with Communication Server)"), nExitCode); + csMessage.Format( _T( "OCS Inventory Agent encounter an error (exit code is %d => Failed to talk with Communication Server)"), nExitCode); LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_GENERIC_ERROR, csMessage); break; default: // Exit code is not a success - csMessage.Format( _T( "OCS Inventory NG Agent encounter an error (exit code is %d => Unknown code !)"), nExitCode); + csMessage.Format( _T( "OCS Inventory Agent encounter an error (exit code is %d => Unknown code !)"), nExitCode); LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_GENERIC_ERROR, csMessage); break; } @@ -813,7 +813,7 @@ BOOL COcsService::isTimeToRunScheduledTasks() if (cPack <= COleDateTime::GetCurrentTime()) { // It time to start this package - csMessage.Format( _T( "Package <%s> was scheduled on <%s>, so launching OCS Inventory NG Agent"), lpstrID, (LPTSTR)pSchedule); + csMessage.Format( _T( "Package <%s> was scheduled on <%s>, so launching OCS Inventory Agent"), lpstrID, (LPTSTR)pSchedule); LogEvent( EVENTLOG_INFORMATION_TYPE, EVMSG_GENERIC_MESSAGE, csMessage); bReturn = TRUE; } diff --git a/Service/OcsService.h b/Service/OcsService.h index 6b6f2b00..35a31ffb 100644 --- a/Service/OcsService.h +++ b/Service/OcsService.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -19,7 +19,7 @@ #include "ntservice.h" #include "ntservicemsg.h" -#define OCS_SERVICE_DESCRIPTION _T( "Service starting periodically OCS Inventory NG Agent for Windows") +#define OCS_SERVICE_DESCRIPTION _T( "Service starting periodically OCS Inventory Agent for Windows") #define OCS_SERVICE_DEPENDANCIES _T( "RpcSs\0EventLog\0Winmgmt\0Tcpip\0\0") #define OCS_SERVICE_RAND_FILE _T( "rand") diff --git a/Service/Service.rc b/Service/Service.rc index 06499daf..57fcb3ce 100644 --- a/Service/Service.rc +++ b/Service/Service.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -41,16 +41,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG Service" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG Service" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory Service" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory Service" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "OcsService.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OcsService.exe" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" @@ -103,8 +103,8 @@ LANGUAGE LANG_FRENCH, SUBLANG_FRENCH // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ICON1 ICON "C:\\Users\\Admin\\Documents\\GitHub\\WindowsAgent\\NSIS_agent_setup\\OCSInventory.ico" -IDI_ICON2 ICON "C:\\Users\\Admin\\Documents\\GitHub\\WindowsAgent\\Agent\\res\\OCSInventory.ico" +IDI_ICON1 ICON "C:\\Users\\charl\\Documents\\GitHub\\WindowsAgent\\NSIS_agent_setup\\OCSInventory.ico" +IDI_ICON2 ICON "C:\\Users\\charl\\Documents\\GitHub\\WindowsAgent\\Agent\\res\\OCSInventory.ico" #endif // French (France) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/Service/Service.vcxproj b/Service/Service.vcxproj index 1c46397c..d066ad1b 100644 --- a/Service/Service.vcxproj +++ b/Service/Service.vcxproj @@ -22,33 +22,33 @@ {5FB86B75-1840-4862-B9A8-137021D26475} Service Win32Proj - 10.0.18362.0 + 10.0 Application - v141 + v142 Dynamic Unicode true Application - v141 + v142 Dynamic Unicode Application - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 diff --git a/Service/ServiceApp.cpp b/Service/ServiceApp.cpp index 8b1dc246..3a5eb8bb 100644 --- a/Service/ServiceApp.cpp +++ b/Service/ServiceApp.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Service/ServiceApp.h b/Service/ServiceApp.h index 382e914f..5d375b1f 100644 --- a/Service/ServiceApp.h +++ b/Service/ServiceApp.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Service/stdafx.cpp b/Service/stdafx.cpp index 087e36cd..d80e3b8f 100644 --- a/Service/stdafx.cpp +++ b/Service/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Service/stdafx.h b/Service/stdafx.h index ab3677d1..17aa3830 100644 --- a/Service/stdafx.h +++ b/Service/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/Service/targetver.h b/Service/targetver.h index 588e6914..8044e3bd 100644 --- a/Service/targetver.h +++ b/Service/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/AccessLog.cpp b/SysInfo/AccessLog.cpp index 0ea21512..59bcd46a 100644 --- a/SysInfo/AccessLog.cpp +++ b/SysInfo/AccessLog.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/AccessLog.h b/SysInfo/AccessLog.h index 6f85ef5a..228bea40 100644 --- a/SysInfo/AccessLog.h +++ b/SysInfo/AccessLog.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Cpu.cpp b/SysInfo/Cpu.cpp index aa7b13e7..3c7f61f5 100644 --- a/SysInfo/Cpu.cpp +++ b/SysInfo/Cpu.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Cpu.h b/SysInfo/Cpu.h index 47768a79..9881f40e 100644 --- a/SysInfo/Cpu.h +++ b/SysInfo/Cpu.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/CpuList.cpp b/SysInfo/CpuList.cpp index 7bad0b4c..c0288d4e 100644 --- a/SysInfo/CpuList.cpp +++ b/SysInfo/CpuList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/CpuList.h b/SysInfo/CpuList.h index 16ff4f7e..6f525f96 100644 --- a/SysInfo/CpuList.h +++ b/SysInfo/CpuList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/DMI.cpp b/SysInfo/DMI.cpp index 4f44ae63..e4ff08ae 100644 --- a/SysInfo/DMI.cpp +++ b/SysInfo/DMI.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/DMI.h b/SysInfo/DMI.h index af590e49..65d62758 100644 --- a/SysInfo/DMI.h +++ b/SysInfo/DMI.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/DebugLog.cpp b/SysInfo/DebugLog.cpp index 2db200c7..48257e4a 100644 --- a/SysInfo/DebugLog.cpp +++ b/SysInfo/DebugLog.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/DebugLog.h b/SysInfo/DebugLog.h index b488573e..b1525ccf 100644 --- a/SysInfo/DebugLog.h +++ b/SysInfo/DebugLog.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/DeviceProperties.cpp b/SysInfo/DeviceProperties.cpp index d9132a6f..d1ad7992 100644 --- a/SysInfo/DeviceProperties.cpp +++ b/SysInfo/DeviceProperties.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/DeviceProperties.h b/SysInfo/DeviceProperties.h index ebd94514..8bf7a54c 100644 --- a/SysInfo/DeviceProperties.h +++ b/SysInfo/DeviceProperties.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/DiskInfo.cpp b/SysInfo/DiskInfo.cpp index 8b2c0d9f..17dd7aa4 100644 --- a/SysInfo/DiskInfo.cpp +++ b/SysInfo/DiskInfo.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/DiskInfo.h b/SysInfo/DiskInfo.h index 80bc9951..0dddf315 100644 --- a/SysInfo/DiskInfo.h +++ b/SysInfo/DiskInfo.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/EDID.cpp b/SysInfo/EDID.cpp index d81bfa9b..645fa7f5 100644 --- a/SysInfo/EDID.cpp +++ b/SysInfo/EDID.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/EDID.h b/SysInfo/EDID.h index 25c85673..6ee173bd 100644 --- a/SysInfo/EDID.h +++ b/SysInfo/EDID.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/IPHelper.cpp b/SysInfo/IPHelper.cpp index 9e1e2dec..d7243e7d 100644 --- a/SysInfo/IPHelper.cpp +++ b/SysInfo/IPHelper.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -19,8 +19,6 @@ #include "debuglog.h" #include "IPHelper.h" #include -#include -#include "snmpapi.h" #include #include #include @@ -723,4 +721,229 @@ BOOL CIPHelper::GetNetworkAdaptersJustMAC(CNetworkAdapterList *pList) } AddLog(_T("IpHlpAPI GetNetworkAdapters: Failed because no network adapter object !\n")); return FALSE; +} + +LPCTSTR CIPHelper::GetAdapterType(UINT uType) +{ + if (IsEthernet(uType)) + return ETHERNET_ADAPTER; + if (IsTokenRing(uType)) + return TOKENRING_ADAPTER; + if (IsTokenBus(uType)) + return TOKENBUS_ADAPTER; + if (IsATM(uType)) + return ATM_ADAPTER; + if (IsDialup(uType)) + return DIALUP_ADAPTER; + if (IsLoopback(uType)) + return LOOPBACK_ADAPTER; + return OTHER_ADAPTER; +} + +BOOL CIPHelper::IsEthernet(UINT uType) +{ + return ((uType == 6) || (uType == 7) || (uType == 26) || + (uType == 62) || (uType == 69) || (uType == 117)); +} + +BOOL CIPHelper::IsTokenRing(UINT uType) +{ + return ((uType == 9) || (uType == 115)); +} + +BOOL CIPHelper::IsTokenBus(UINT uType) +{ + return (uType == 8); +} + +BOOL CIPHelper::IsISDN(UINT uType) +{ + return ((uType == 20) || (uType == 21) || (uType == 63) || + (uType == 75) || (uType == 76) || (uType == 77)); +} + +BOOL CIPHelper::IsATM(UINT uType) +{ + return ((uType == 37) || (uType == 49) || (uType == 107) || + (uType == 105) || (uType == 106) || (uType == 114) || + (uType == 134)); +} + +BOOL CIPHelper::IsLAN(UINT uType) +{ + return (IsEthernet(uType) || IsTokenBus(uType) || IsTokenRing(uType) || + (uType == 11) || (uType == 15) || (uType == 55) || (uType == 59) || + (uType == 60)); +} + +BOOL CIPHelper::IsDSL(UINT uType) +{ + return ((uType == 94) || (uType == 95) || (uType == 96) || (uType == 97) || + (uType == 143)); +} + +BOOL CIPHelper::IsDialup(UINT uType) +{ + return (IsISDN(uType) || IsDSL(uType) || (uType == 23) || (uType == 81) || + (uType == 82) || (uType == 108)); +} + +BOOL CIPHelper::IsLoopback(UINT uType) +{ + return (uType == 24); +} + +LPCTSTR CIPHelper::GetIfType(UINT uType) +{ + // See http://www.iana.org/assignments/ianaiftype-mib + switch (uType) + { + case 1: return _T("Other"); + case 2: return _T("regular1822"); + case 3: return _T("hdh1822"); + case 4: return _T("ddnX25"); + case 5: return _T("rfc877x25"); + case 6: return _T("ethernetCsmacd"); + case 7: return _T("iso88023Csmacd"); + case 8: return _T("iso88024TokenBus"); + case 9: return _T("iso88025TokenRing"); + case 10: return _T("iso88026Man"); + case 11: return _T("starLan"); + case 12: return _T("proteon10Mbit"); + case 13: return _T("proteon80Mbit"); + case 14: return _T("hyperchannel"); + case 15: return _T("fddi"); + case 16: return _T("lapb"); + case 17: return _T("sdlc"); + case 18: return _T("ds1"); + case 19: return _T("e1"); + case 20: return _T("basicISDN"); + case 21: return _T("primaryISDN"); + case 22: return _T("propPointToPointSerial"); + case 23: return _T("ppp"); + case 24: return _T("softwareLoopback"); + case 25: return _T("eon"); + case 26: return _T("ethernet-3Mbit"); + case 27: return _T("nsip"); + case 28: return _T("slip"); + case 29: return _T("ultra"); + case 30: return _T("ds3"); + case 31: return _T("sip"); + case 32: return _T("frame-relay"); + case 33: return _T("rs232"); + case 34: return _T("para"); + case 35: return _T("arcnet"); + case 36: return _T("arcnetPlus"); + case 37: return _T("atm"); + case 38: return _T("miox25"); + case 39: return _T("sonet"); + case 40: return _T("x25ple"); + case 41: return _T("iso88022llc"); + case 42: return _T("localTalk"); + case 43: return _T("smdsDxi"); + case 44: return _T("frameRelayService"); + case 45: return _T("v35"); + case 46: return _T("hssi"); + case 47: return _T("hippi"); + case 48: return _T("modem"); + case 49: return _T("aal5"); + case 50: return _T("sonetPath"); + case 51: return _T("sonetVT"); + case 52: return _T("smdsIcip"); + case 53: return _T("propVirtual"); + case 54: return _T("propMultiplexor"); + case 55: return _T("100BaseVG"); + case 56: return _T("Fibre Channel"); + case 57: return _T("HIPPI Interface"); + case 58: return _T("Obsolete for FrameRelay"); + case 59: return _T("ATM Emulation of 802.3 LAN"); + case 60: return _T("ATM Emulation of 802.5 LAN"); + case 61: return _T("ATM Emulation of a Circuit"); + case 62: return _T("FastEthernet (100BaseT)"); + case 63: return _T("ISDN & X.25"); + case 64: return _T("CCITT V.11/X.21"); + case 65: return _T("CCITT V.36"); + case 66: return _T("CCITT G703 at 64Kbps"); + case 67: return _T("Obsolete G702 see DS1-MIB"); + case 68: return _T("SNA QLLC"); + case 69: return _T("Full Duplex Fast Ethernet (100BaseFX)"); + case 70: return _T("Channel"); + case 71: return _T("Radio Spread Spectrum (802.11)"); + case 72: return _T("IBM System 360/370 OEMI Channel"); + case 73: return _T("IBM Enterprise Systems Connection"); + case 74: return _T("Data Link Switching"); + case 75: return _T("ISDN S/T Interface"); + case 76: return _T("ISDN U Interface"); + case 77: return _T("Link Access Protocol D (LAPD)"); + case 78: return _T("IP Switching Opjects"); + case 79: return _T("Remote Source Route Bridging"); + case 80: return _T("ATM Logical Port"); + case 81: return _T("AT&T DS0 Point (64 Kbps)"); + case 82: return _T("AT&T Group of DS0 on a single DS1"); + case 83: return _T("BiSync Protocol (BSC)"); + case 84: return _T("Asynchronous Protocol"); + case 85: return _T("Combat Net Radio"); + case 86: return _T("ISO 802.5r DTR"); + case 87: return _T("Ext Pos Loc Report Sys"); + case 88: return _T("Apple Talk Remote Access Protocol"); + case 89: return _T("Proprietary Connectionless Protocol"); + case 90: return _T("CCITT-ITU X.29 PAD Protocol"); + case 91: return _T("CCITT-ITU X.3 PAD Facility"); + case 92: return _T("MultiProtocol Connection over Frame/Relay"); + case 93: return _T("CCITT-ITU X213"); + case 94: return _T("Asymmetric Digital Subscriber Loop (ADSL)"); + case 95: return _T("Rate-Adapt Digital Subscriber Loop (RDSL)"); + case 96: return _T("Symmetric Digital Subscriber Loop (SDSL)"); + case 97: return _T("Very High Speed Digital Subscriber Loop (HDSL)"); + case 98: return _T("ISO 802.5 CRFP"); + case 99: return _T("Myricom Myrinet"); + case 100: return _T("Voice recEive and transMit (voiceEM)"); + case 101: return _T("Voice Foreign eXchange Office (voiceFXO)"); + case 102: return _T("Voice Foreign eXchange Station (voiceFXS)"); + case 103: return _T("Voice Encapsulation"); + case 104: return _T("Voice Over IP Encapsulation"); + case 105: return _T("ATM DXI"); + case 106: return _T("ATM FUNI"); + case 107: return _T("ATM IMA"); + case 108: return _T("PPP Multilink Bundle"); + case 109: return _T("IBM IP over CDLC"); + case 110: return _T("IBM Common Link Access to Workstation"); + case 111: return _T("IBM Stack to Stack"); + case 112: return _T("IBM Virtual IP Address (VIPA)"); + case 113: return _T("IBM Multi-Protocol Channel Support"); + case 114: return _T("IBM IP over ATM"); + case 115: return _T("ISO 802.5j Fiber Token Ring"); + case 116: return _T("IBM Twinaxial Data Link Control (TDLC)"); + case 117: return _T("Gigabit Ethernet"); + case 118: return _T("Higher Data Link Control (HDLC)"); + case 119: return _T("Link Access Protocol F (LAPF)"); + case 120: return _T("CCITT V.37"); + case 121: return _T("CCITT X.25 Multi-Link Protocol"); + case 122: return _T("CCITT X.25 Hunt Group"); + case 123: return _T("Transp HDLC"); + case 124: return _T("Interleave Channel"); + case 125: return _T("Fast Channel"); + case 126: return _T("IP (for APPN HPR in IP Networks)"); + case 127: return _T("CATV MAC Layer"); + case 128: return _T("CATV Downstream Interface"); + case 129: return _T("CATV Upstream Interface"); + case 130: return _T("Avalon Parallel Processor"); + case 131: return _T("Encapsulation Interface"); + case 132: return _T("Coffee Pot"); + case 133: return _T("Circuit Emulation Service"); + case 134: return _T("ATM Sub Interface"); + case 135: return _T("Layer 2 Virtual LAN using 802.1Q"); + case 136: return _T("Layer 3 Virtual LAN using IP"); + case 137: return _T("Layer 3 Virtual LAN using IPX"); + case 138: return _T("IP Over Power Lines"); + case 139: return _T("Multi-Media Mail over IP"); + case 140: return _T("Dynamic synchronous Transfer Mode (DTM)"); + case 141: return _T("Data Communications Network"); + case 142: return _T("IP Forwarding Interface"); + case 143: return _T("Multi-rate Symmetric DSL (MSDSL)"); + case 144: return _T("IEEE1394 High Perf Serial Bus"); + case 145: return _T("TV adapter type"); + case 162: return _T("Cisco Express Forwarding Interface"); + default: return _T(""); + } } \ No newline at end of file diff --git a/SysInfo/IPHelper.h b/SysInfo/IPHelper.h index 99d749d6..7de9c314 100644 --- a/SysInfo/IPHelper.h +++ b/SysInfo/IPHelper.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -19,6 +19,14 @@ #include "SysInfoClasses.h" +#define ETHERNET_ADAPTER _T( "Ethernet") +#define TOKENBUS_ADAPTER _T( "Token Bus") +#define TOKENRING_ADAPTER _T( "Token Ring") +#define ATM_ADAPTER _T( "ATM") +#define DIALUP_ADAPTER _T( "Dialup") +#define LOOPBACK_ADAPTER _T( "Loopback") +#define OTHER_ADAPTER _T( "Other (see MIB)") + class SYSINFO_API CIPHelper { @@ -34,6 +42,19 @@ class SYSINFO_API CIPHelper ////////////////////////////////// static BOOL GetNetworkAdapters( CNetworkAdapterList *pList); static BOOL GetNetworkAdaptersJustMAC(CNetworkAdapterList *pList); + + // + static LPCTSTR GetIfType(UINT uType); + static BOOL IsEthernet(UINT uType); + static BOOL IsTokenRing(UINT uType); + static BOOL IsTokenBus(UINT uType); + static BOOL IsISDN(UINT uType); + static BOOL IsDialup(UINT uType); + static BOOL IsATM(UINT uType); + static BOOL IsLAN(UINT uType); + static BOOL IsDSL(UINT uType); + static BOOL IsLoopback(UINT uType); + static LPCTSTR GetAdapterType(UINT uType); }; #endif // !defined(AFX_IPHELPER_H__609EE787_2041_44FB_863D_75B36F337728__INCLUDED_) diff --git a/SysInfo/ISA_PNPID.cpp b/SysInfo/ISA_PNPID.cpp index 1ac82225..ba83d166 100644 --- a/SysInfo/ISA_PNPID.cpp +++ b/SysInfo/ISA_PNPID.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/ISA_PNPID.h b/SysInfo/ISA_PNPID.h index 7ebfda11..e5b744ef 100644 --- a/SysInfo/ISA_PNPID.h +++ b/SysInfo/ISA_PNPID.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/InputDevice.cpp b/SysInfo/InputDevice.cpp index ecdccfa7..70614043 100644 --- a/SysInfo/InputDevice.cpp +++ b/SysInfo/InputDevice.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/InputDevice.h b/SysInfo/InputDevice.h index fe5d4238..d298db2a 100644 --- a/SysInfo/InputDevice.h +++ b/SysInfo/InputDevice.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/InputDeviceList.cpp b/SysInfo/InputDeviceList.cpp index 5da78f23..195bfcd4 100644 --- a/SysInfo/InputDeviceList.cpp +++ b/SysInfo/InputDeviceList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/InputDeviceList.h b/SysInfo/InputDeviceList.h index cf271a36..ab91f264 100644 --- a/SysInfo/InputDeviceList.h +++ b/SysInfo/InputDeviceList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/LogicalDrive.cpp b/SysInfo/LogicalDrive.cpp index 9b213b9c..72d9614b 100644 --- a/SysInfo/LogicalDrive.cpp +++ b/SysInfo/LogicalDrive.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/LogicalDrive.h b/SysInfo/LogicalDrive.h index ecccd485..d313b6ea 100644 --- a/SysInfo/LogicalDrive.h +++ b/SysInfo/LogicalDrive.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/LogicalDriveList.cpp b/SysInfo/LogicalDriveList.cpp index 81a0a8d8..f8e78276 100644 --- a/SysInfo/LogicalDriveList.cpp +++ b/SysInfo/LogicalDriveList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/LogicalDriveList.h b/SysInfo/LogicalDriveList.h index 89fced85..425341da 100644 --- a/SysInfo/LogicalDriveList.h +++ b/SysInfo/LogicalDriveList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Memory.cpp b/SysInfo/Memory.cpp index 5d2ed877..c0e6984f 100644 --- a/SysInfo/Memory.cpp +++ b/SysInfo/Memory.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Memory.h b/SysInfo/Memory.h index ce6134fa..26890593 100644 --- a/SysInfo/Memory.h +++ b/SysInfo/Memory.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/MemorySlot.cpp b/SysInfo/MemorySlot.cpp index 3a47286a..e480b181 100644 --- a/SysInfo/MemorySlot.cpp +++ b/SysInfo/MemorySlot.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/MemorySlot.h b/SysInfo/MemorySlot.h index 4a21b3ea..979aa43e 100644 --- a/SysInfo/MemorySlot.h +++ b/SysInfo/MemorySlot.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/MemorySlotList.cpp b/SysInfo/MemorySlotList.cpp index ae767d6b..cb53ad35 100644 --- a/SysInfo/MemorySlotList.cpp +++ b/SysInfo/MemorySlotList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/MemorySlotList.h b/SysInfo/MemorySlotList.h index 9285388e..b936f330 100644 --- a/SysInfo/MemorySlotList.h +++ b/SysInfo/MemorySlotList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Modem.cpp b/SysInfo/Modem.cpp index 99101994..ada16073 100644 --- a/SysInfo/Modem.cpp +++ b/SysInfo/Modem.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Modem.h b/SysInfo/Modem.h index 82c786ae..7c916e24 100644 --- a/SysInfo/Modem.h +++ b/SysInfo/Modem.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/ModemList.cpp b/SysInfo/ModemList.cpp index f5ecfbae..06838ccb 100644 --- a/SysInfo/ModemList.cpp +++ b/SysInfo/ModemList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/ModemList.h b/SysInfo/ModemList.h index 273dfb9f..fc7677bc 100644 --- a/SysInfo/ModemList.h +++ b/SysInfo/ModemList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Monitor.cpp b/SysInfo/Monitor.cpp index 99b46ec0..7c44b83c 100644 --- a/SysInfo/Monitor.cpp +++ b/SysInfo/Monitor.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Monitor.h b/SysInfo/Monitor.h index 0a939eae..98b73f6c 100644 --- a/SysInfo/Monitor.h +++ b/SysInfo/Monitor.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/MonitorList.cpp b/SysInfo/MonitorList.cpp index 2dd98cb2..cb095b85 100644 --- a/SysInfo/MonitorList.cpp +++ b/SysInfo/MonitorList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/MonitorList.h b/SysInfo/MonitorList.h index 2b62c861..e5d34464 100644 --- a/SysInfo/MonitorList.h +++ b/SysInfo/MonitorList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/NetworkAdapter.cpp b/SysInfo/NetworkAdapter.cpp index e1106d44..ff7041f1 100644 --- a/SysInfo/NetworkAdapter.cpp +++ b/SysInfo/NetworkAdapter.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/NetworkAdapter.h b/SysInfo/NetworkAdapter.h index 060065ef..bf78ec69 100644 --- a/SysInfo/NetworkAdapter.h +++ b/SysInfo/NetworkAdapter.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/NetworkAdapterList.cpp b/SysInfo/NetworkAdapterList.cpp index 8dc76c3d..4be0c9e0 100644 --- a/SysInfo/NetworkAdapterList.cpp +++ b/SysInfo/NetworkAdapterList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/NetworkAdapterList.h b/SysInfo/NetworkAdapterList.h index af0c2af1..4d08f50d 100644 --- a/SysInfo/NetworkAdapterList.h +++ b/SysInfo/NetworkAdapterList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/OcsCrypto.cpp b/SysInfo/OcsCrypto.cpp index 3a4c65f6..abb9fa16 100644 --- a/SysInfo/OcsCrypto.cpp +++ b/SysInfo/OcsCrypto.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/OcsCrypto.h b/SysInfo/OcsCrypto.h index 3bf195bc..7425b8fa 100644 --- a/SysInfo/OcsCrypto.h +++ b/SysInfo/OcsCrypto.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/OcsProcess.cpp b/SysInfo/OcsProcess.cpp index d53778be..8dc28203 100644 --- a/SysInfo/OcsProcess.cpp +++ b/SysInfo/OcsProcess.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/OcsProcess.h b/SysInfo/OcsProcess.h index c7556ea5..803a4458 100644 --- a/SysInfo/OcsProcess.h +++ b/SysInfo/OcsProcess.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Printer.cpp b/SysInfo/Printer.cpp index df386e86..8878a5f2 100644 --- a/SysInfo/Printer.cpp +++ b/SysInfo/Printer.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Printer.h b/SysInfo/Printer.h index f5a1a261..b1336688 100644 --- a/SysInfo/Printer.h +++ b/SysInfo/Printer.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/PrinterList.cpp b/SysInfo/PrinterList.cpp index 7a73daab..b5825371 100644 --- a/SysInfo/PrinterList.cpp +++ b/SysInfo/PrinterList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/PrinterList.h b/SysInfo/PrinterList.h index 7957d713..62000a3d 100644 --- a/SysInfo/PrinterList.h +++ b/SysInfo/PrinterList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Registry.cpp b/SysInfo/Registry.cpp index 16b42456..a50ca3c2 100644 --- a/SysInfo/Registry.cpp +++ b/SysInfo/Registry.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Registry.h b/SysInfo/Registry.h index adbea393..81227845 100644 --- a/SysInfo/Registry.h +++ b/SysInfo/Registry.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/RegistryValue.cpp b/SysInfo/RegistryValue.cpp index b6286a27..4437f055 100644 --- a/SysInfo/RegistryValue.cpp +++ b/SysInfo/RegistryValue.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/RegistryValue.h b/SysInfo/RegistryValue.h index b75f4270..dacab9ab 100644 --- a/SysInfo/RegistryValue.h +++ b/SysInfo/RegistryValue.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/RegistryValueList.cpp b/SysInfo/RegistryValueList.cpp index fdda6aac..f1fd64de 100644 --- a/SysInfo/RegistryValueList.cpp +++ b/SysInfo/RegistryValueList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/RegistryValueList.h b/SysInfo/RegistryValueList.h index ecd4174c..0b2935cf 100644 --- a/SysInfo/RegistryValueList.h +++ b/SysInfo/RegistryValueList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SnmpAPI.cpp b/SysInfo/SnmpAPI.cpp deleted file mode 100644 index da97f011..00000000 --- a/SysInfo/SnmpAPI.cpp +++ /dev/null @@ -1,353 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -#include "stdafx.h" - -#include -#include "snmpapi.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -//****************************************************************** -//* -//* Copyright (C) Stas Khirman 1998. All rights reserved. -//* -//* This program is distributed WITHOUT ANY WARRANTY -//* -//****************************************************************** -//* -//* Reproduction of SNMP.LIB and SNMPAPI.LIB base -//* functions -//* -//* Author: Stas Khirman (staskh@rocketmail.com) -//* -//* -//* Free software: no warranty; use anywhere is ok; spread the -//* sources; note any modifications; share variations and -//* derivatives (including sending to staskh@rocketmail.com). -//* -//****************************************************************** - -SNMPAPI SNMP_FUNC_TYPE SnmpUtilOidCpy(OUT AsnObjectIdentifier *DstObjId, - IN AsnObjectIdentifier *SrcObjId) -{ - DstObjId->ids = (UINT *)GlobalAlloc(GMEM_ZEROINIT,SrcObjId->idLength * sizeof(UINT)); - if(!DstObjId->ids){ - SetLastError(1); - return 0; - } - - memcpy(DstObjId->ids,SrcObjId->ids,SrcObjId->idLength*sizeof(UINT)); - DstObjId->idLength = SrcObjId->idLength; - - return 1; -} - - -VOID SNMP_FUNC_TYPE SnmpUtilOidFree(IN OUT AsnObjectIdentifier *ObjId) -{ - GlobalFree(ObjId->ids); - ObjId->ids = 0; - ObjId->idLength = 0; -} - -SNMPAPI SNMP_FUNC_TYPE SnmpUtilOidNCmp(IN AsnObjectIdentifier *ObjIdA, - IN AsnObjectIdentifier *ObjIdB, IN UINT Len) -{ - UINT CmpLen; - UINT i; - int res; - - CmpLen = Len; - if(ObjIdA->idLength < CmpLen) - CmpLen = ObjIdA->idLength; - if(ObjIdB->idLength < CmpLen) - CmpLen = ObjIdB->idLength; - - for(i=0;iids[i] - ObjIdB->ids[i]; - if(res!=0) - return res; - } - return 0; -} - -VOID SNMP_FUNC_TYPE SnmpUtilVarBindFree(IN OUT RFC1157VarBind *VarBind) -{ - BYTE asnType; - // free object name - SnmpUtilOidFree(&VarBind->name); - - asnType = VarBind->value.asnType; - - if(asnType==ASN_OBJECTIDENTIFIER){ - SnmpUtilOidFree(&VarBind->value.asnValue.object); - } - else if( - (asnType==ASN_OCTETSTRING) || - (asnType==ASN_RFC1155_IPADDRESS) || - (asnType==ASN_RFC1155_OPAQUE) || - (asnType==ASN_SEQUENCE)){ - if(VarBind->value.asnValue.string.dynamic){ - GlobalFree(VarBind->value.asnValue.string.stream); - } - } - - VarBind->value.asnType = ASN_NULL; -} - -//****************************************************************** -//* -//* End of Copyright (C) Stas Khirman 1998 -//* -//****************************************************************** - -//****************************************************************** -//* -//* Following definitions are extracted from MRTG 2.9.17 -//* -//* MRTG - The Multi Router Traffic Grapher. A tool to visualise -//* network traffic via a WebPage. -//* http://www.ee.ethz.ch/~oetiker/webtools/mrtg/ -//* -//* Copyright (c) 1996-2001 Tobias Oetiker and all the Contributors -//* to MRTG -//* All rights reserved. -//* -//****************************************************************** - -LPCTSTR GetIfType( UINT uType) -{ - // See http://www.iana.org/assignments/ianaiftype-mib - switch (uType) - { - case 1: return _T( "Other"); - case 2: return _T( "regular1822"); - case 3: return _T( "hdh1822"); - case 4: return _T( "ddnX25"); - case 5: return _T( "rfc877x25"); - case 6: return _T( "ethernetCsmacd"); - case 7: return _T( "iso88023Csmacd"); - case 8: return _T( "iso88024TokenBus"); - case 9: return _T( "iso88025TokenRing"); - case 10: return _T( "iso88026Man"); - case 11: return _T( "starLan"); - case 12: return _T( "proteon10Mbit"); - case 13: return _T( "proteon80Mbit"); - case 14: return _T( "hyperchannel"); - case 15: return _T( "fddi"); - case 16: return _T( "lapb"); - case 17: return _T( "sdlc"); - case 18: return _T( "ds1"); - case 19: return _T( "e1"); - case 20: return _T( "basicISDN"); - case 21: return _T( "primaryISDN"); - case 22: return _T( "propPointToPointSerial"); - case 23: return _T( "ppp"); - case 24: return _T( "softwareLoopback"); - case 25: return _T( "eon"); - case 26: return _T( "ethernet-3Mbit"); - case 27: return _T( "nsip"); - case 28: return _T( "slip"); - case 29: return _T( "ultra"); - case 30: return _T( "ds3"); - case 31: return _T( "sip"); - case 32: return _T( "frame-relay"); - case 33: return _T( "rs232"); - case 34: return _T( "para"); - case 35: return _T( "arcnet"); - case 36: return _T( "arcnetPlus"); - case 37: return _T( "atm"); - case 38: return _T( "miox25"); - case 39: return _T( "sonet"); - case 40: return _T( "x25ple"); - case 41: return _T( "iso88022llc"); - case 42: return _T( "localTalk"); - case 43: return _T( "smdsDxi"); - case 44: return _T( "frameRelayService"); - case 45: return _T( "v35"); - case 46: return _T( "hssi"); - case 47: return _T( "hippi"); - case 48: return _T( "modem"); - case 49: return _T( "aal5"); - case 50: return _T( "sonetPath"); - case 51: return _T( "sonetVT"); - case 52: return _T( "smdsIcip"); - case 53: return _T( "propVirtual"); - case 54: return _T( "propMultiplexor"); - case 55: return _T( "100BaseVG"); - case 56: return _T( "Fibre Channel"); - case 57: return _T( "HIPPI Interface"); - case 58: return _T( "Obsolete for FrameRelay"); - case 59: return _T( "ATM Emulation of 802.3 LAN"); - case 60: return _T( "ATM Emulation of 802.5 LAN"); - case 61: return _T( "ATM Emulation of a Circuit"); - case 62: return _T( "FastEthernet (100BaseT)"); - case 63: return _T( "ISDN & X.25"); - case 64: return _T( "CCITT V.11/X.21"); - case 65: return _T( "CCITT V.36"); - case 66: return _T( "CCITT G703 at 64Kbps"); - case 67: return _T( "Obsolete G702 see DS1-MIB"); - case 68: return _T( "SNA QLLC"); - case 69: return _T( "Full Duplex Fast Ethernet (100BaseFX)"); - case 70: return _T( "Channel"); - case 71: return _T( "Radio Spread Spectrum (802.11)"); - case 72: return _T( "IBM System 360/370 OEMI Channel"); - case 73: return _T( "IBM Enterprise Systems Connection"); - case 74: return _T( "Data Link Switching"); - case 75: return _T( "ISDN S/T Interface"); - case 76: return _T( "ISDN U Interface"); - case 77: return _T( "Link Access Protocol D (LAPD)"); - case 78: return _T( "IP Switching Opjects"); - case 79: return _T( "Remote Source Route Bridging"); - case 80: return _T( "ATM Logical Port"); - case 81: return _T( "AT&T DS0 Point (64 Kbps)"); - case 82: return _T( "AT&T Group of DS0 on a single DS1"); - case 83: return _T( "BiSync Protocol (BSC)"); - case 84: return _T( "Asynchronous Protocol"); - case 85: return _T( "Combat Net Radio"); - case 86: return _T( "ISO 802.5r DTR"); - case 87: return _T( "Ext Pos Loc Report Sys"); - case 88: return _T( "Apple Talk Remote Access Protocol"); - case 89: return _T( "Proprietary Connectionless Protocol"); - case 90: return _T( "CCITT-ITU X.29 PAD Protocol"); - case 91: return _T( "CCITT-ITU X.3 PAD Facility"); - case 92: return _T( "MultiProtocol Connection over Frame/Relay"); - case 93: return _T( "CCITT-ITU X213"); - case 94: return _T( "Asymmetric Digital Subscriber Loop (ADSL)"); - case 95: return _T( "Rate-Adapt Digital Subscriber Loop (RDSL)"); - case 96: return _T( "Symmetric Digital Subscriber Loop (SDSL)"); - case 97: return _T( "Very High Speed Digital Subscriber Loop (HDSL)"); - case 98: return _T( "ISO 802.5 CRFP"); - case 99: return _T( "Myricom Myrinet"); - case 100: return _T( "Voice recEive and transMit (voiceEM)"); - case 101: return _T( "Voice Foreign eXchange Office (voiceFXO)"); - case 102: return _T( "Voice Foreign eXchange Station (voiceFXS)"); - case 103: return _T( "Voice Encapsulation"); - case 104: return _T( "Voice Over IP Encapsulation"); - case 105: return _T( "ATM DXI"); - case 106: return _T( "ATM FUNI"); - case 107: return _T( "ATM IMA"); - case 108: return _T( "PPP Multilink Bundle"); - case 109: return _T( "IBM IP over CDLC"); - case 110: return _T( "IBM Common Link Access to Workstation"); - case 111: return _T( "IBM Stack to Stack"); - case 112: return _T( "IBM Virtual IP Address (VIPA)"); - case 113: return _T( "IBM Multi-Protocol Channel Support"); - case 114: return _T( "IBM IP over ATM"); - case 115: return _T( "ISO 802.5j Fiber Token Ring"); - case 116: return _T( "IBM Twinaxial Data Link Control (TDLC)"); - case 117: return _T( "Gigabit Ethernet"); - case 118: return _T( "Higher Data Link Control (HDLC)"); - case 119: return _T( "Link Access Protocol F (LAPF)"); - case 120: return _T( "CCITT V.37"); - case 121: return _T( "CCITT X.25 Multi-Link Protocol"); - case 122: return _T( "CCITT X.25 Hunt Group"); - case 123: return _T( "Transp HDLC"); - case 124: return _T( "Interleave Channel"); - case 125: return _T( "Fast Channel"); - case 126: return _T( "IP (for APPN HPR in IP Networks)"); - case 127: return _T( "CATV MAC Layer"); - case 128: return _T( "CATV Downstream Interface"); - case 129: return _T( "CATV Upstream Interface"); - case 130: return _T( "Avalon Parallel Processor"); - case 131: return _T( "Encapsulation Interface"); - case 132: return _T( "Coffee Pot"); - case 133: return _T( "Circuit Emulation Service"); - case 134: return _T( "ATM Sub Interface"); - case 135: return _T( "Layer 2 Virtual LAN using 802.1Q"); - case 136: return _T( "Layer 3 Virtual LAN using IP"); - case 137: return _T( "Layer 3 Virtual LAN using IPX"); - case 138: return _T( "IP Over Power Lines"); - case 139: return _T( "Multi-Media Mail over IP"); - case 140: return _T( "Dynamic synchronous Transfer Mode (DTM)"); - case 141: return _T( "Data Communications Network"); - case 142: return _T( "IP Forwarding Interface"); - case 143: return _T( "Multi-rate Symmetric DSL (MSDSL)"); - case 144: return _T( "IEEE1394 High Perf Serial Bus"); - case 145: return _T( "TV adapter type"); - case 162: return _T( "Cisco Express Forwarding Interface"); - default: return _T( ""); - } -} - -BOOL IsEthernet( UINT uType) -{ - return ((uType == 6) || (uType == 7) || (uType == 26) || - (uType == 62) || (uType == 69) || (uType == 117)); -} - -BOOL IsTokenRing( UINT uType) -{ - return ((uType == 9) || (uType == 115)); -} - -BOOL IsTokenBus( UINT uType) -{ - return (uType == 8); -} - -BOOL IsISDN( UINT uType) -{ - return ((uType == 20) || (uType == 21) || (uType == 63) || - (uType == 75) || (uType == 76) || (uType == 77)); -} - -BOOL IsATM( UINT uType) -{ - return ((uType == 37) || (uType == 49) || (uType == 107) || - (uType == 105) || (uType == 106) || (uType == 114) || - (uType == 134)); -} - -BOOL IsLAN( UINT uType) -{ - return (IsEthernet( uType) || IsTokenBus( uType) || IsTokenRing( uType) || - (uType == 11) || (uType == 15) || (uType == 55) || (uType == 59) || - (uType == 60)); -} - -BOOL IsDSL( UINT uType) -{ - return ((uType == 94) || (uType == 95) || (uType == 96) || (uType == 97) || - (uType == 143)); -} - -BOOL IsDialup( UINT uType) -{ - return (IsISDN( uType) || IsDSL( uType) || (uType == 23) || (uType == 81) || - (uType == 82) || (uType == 108)); -} - -BOOL IsLoopback( UINT uType) -{ - return (uType == 24); -} - -LPCTSTR GetAdapterType( UINT uType) -{ - if (IsEthernet( uType)) - return ETHERNET_ADAPTER; - if (IsTokenRing( uType)) - return TOKENRING_ADAPTER; - if (IsTokenBus( uType)) - return TOKENBUS_ADAPTER; - if (IsATM( uType)) - return ATM_ADAPTER; - if (IsDialup( uType)) - return DIALUP_ADAPTER; - if (IsLoopback( uType)) - return LOOPBACK_ADAPTER; - return OTHER_ADAPTER; -} diff --git a/SysInfo/SnmpAPI.h b/SysInfo/SnmpAPI.h deleted file mode 100644 index 1900cace..00000000 --- a/SysInfo/SnmpAPI.h +++ /dev/null @@ -1,60 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -#ifndef _SNMPAPI_HEADER_ -#define _SNMPAPI_HEADER_ - -#pragma once - -//****************************************************************** -//* -//* Copyright (C) Stas Khirman 1998. All rights reserved. -//* -//* This program is distributed WITHOUT ANY WARRANTY -//* -//****************************************************************** - -static SNMPAPI SNMP_FUNC_TYPE UtilOidCpy(OUT AsnObjectIdentifier *DstObjId, - IN AsnObjectIdentifier *SrcObjId); - -static VOID SNMP_FUNC_TYPE UtilOidFree(IN OUT AsnObjectIdentifier *ObjId); - -static SNMPAPI SNMP_FUNC_TYPE UtilOidNCmp(IN AsnObjectIdentifier *ObjIdA, - IN AsnObjectIdentifier *ObjIdB, IN UINT Len); - -static VOID SNMP_FUNC_TYPE UtilVarBindFree(IN OUT RFC1157VarBind *VarBind); - -//****************************************************************** -//* -//* End of Copyright (C) Stas Khirman 1998 -//* -//****************************************************************** - -#define ETHERNET_ADAPTER _T( "Ethernet") -#define TOKENBUS_ADAPTER _T( "Token Bus") -#define TOKENRING_ADAPTER _T( "Token Ring") -#define ATM_ADAPTER _T( "ATM") -#define DIALUP_ADAPTER _T( "Dialup") -#define LOOPBACK_ADAPTER _T( "Loopback") -#define OTHER_ADAPTER _T( "Other (see MIB)") - -LPCTSTR GetIfType( UINT uType); -BOOL IsEthernet( UINT uType); -BOOL IsTokenRing( UINT uType); -BOOL IsTokenBus( UINT uType); -BOOL IsISDN( UINT uType); -BOOL IsDialup( UINT uType); -BOOL IsATM( UINT uType); -BOOL IsLAN( UINT uType); -BOOL IsDSL( UINT uType); -BOOL IsLoopback( UINT uType); -LPCTSTR GetAdapterType( UINT uType); - -#endif // _SNMPAPI_HEADER_ diff --git a/SysInfo/Software.cpp b/SysInfo/Software.cpp index b341aedf..5ab2d813 100644 --- a/SysInfo/Software.cpp +++ b/SysInfo/Software.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Software.h b/SysInfo/Software.h index 15d0e0e4..749df6a2 100644 --- a/SysInfo/Software.h +++ b/SysInfo/Software.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SoftwareList.cpp b/SysInfo/SoftwareList.cpp index eb3231d3..a8dd9690 100644 --- a/SysInfo/SoftwareList.cpp +++ b/SysInfo/SoftwareList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SoftwareList.h b/SysInfo/SoftwareList.h index 5fd2f8f1..e0ffe4f9 100644 --- a/SysInfo/SoftwareList.h +++ b/SysInfo/SoftwareList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SoundDevice.cpp b/SysInfo/SoundDevice.cpp index 6008773f..7f859fde 100644 --- a/SysInfo/SoundDevice.cpp +++ b/SysInfo/SoundDevice.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SoundDevice.h b/SysInfo/SoundDevice.h index d6cf3c7e..63f57352 100644 --- a/SysInfo/SoundDevice.h +++ b/SysInfo/SoundDevice.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SoundDeviceList.cpp b/SysInfo/SoundDeviceList.cpp index 52a3ddc5..4f557b26 100644 --- a/SysInfo/SoundDeviceList.cpp +++ b/SysInfo/SoundDeviceList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SoundDeviceList.h b/SysInfo/SoundDeviceList.h index b16f1abf..ea0cb96d 100644 --- a/SysInfo/SoundDeviceList.h +++ b/SysInfo/SoundDeviceList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/StoragePeripheral.cpp b/SysInfo/StoragePeripheral.cpp index eb510ff9..800a08b9 100644 --- a/SysInfo/StoragePeripheral.cpp +++ b/SysInfo/StoragePeripheral.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/StoragePeripheral.h b/SysInfo/StoragePeripheral.h index b2e03a41..1b560f08 100644 --- a/SysInfo/StoragePeripheral.h +++ b/SysInfo/StoragePeripheral.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/StoragePeripheralList.cpp b/SysInfo/StoragePeripheralList.cpp index e3b0577a..48f86402 100644 --- a/SysInfo/StoragePeripheralList.cpp +++ b/SysInfo/StoragePeripheralList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/StoragePeripheralList.h b/SysInfo/StoragePeripheralList.h index dabb0814..b8514a38 100644 --- a/SysInfo/StoragePeripheralList.h +++ b/SysInfo/StoragePeripheralList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SysInfo.cpp b/SysInfo/SysInfo.cpp index 5e0a42ef..555f84a3 100644 --- a/SysInfo/SysInfo.cpp +++ b/SysInfo/SysInfo.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source @@ -605,8 +605,6 @@ BOOL CSysInfo::getNetworkAdapters( CNetworkAdapterList *pMyList) // First try IPHelper if (CIPHelper::GetNetworkAdapters( pMyList)) return TRUE; - // Last, use SNMP - return CSNMP::GetNetworkAdapters( pMyList); } BOOL CSysInfo::getVideoAdapters( CVideoAdapterList *pMyList) diff --git a/SysInfo/SysInfo.h b/SysInfo/SysInfo.h index 98ca0d76..6834d251 100644 --- a/SysInfo/SysInfo.h +++ b/SysInfo/SysInfo.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SysInfo.rc b/SysInfo/SysInfo.rc index aa7f086f..090485c5 100644 --- a/SysInfo/SysInfo.rc +++ b/SysInfo/SysInfo.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -41,16 +41,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG System Provider" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG System Provider" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory System Provider" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory System Provider" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "SysInfo.dll" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "SysInfo.dll" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" diff --git a/SysInfo/SysInfo.vcxproj b/SysInfo/SysInfo.vcxproj index 4efae40b..760cc8d1 100644 --- a/SysInfo/SysInfo.vcxproj +++ b/SysInfo/SysInfo.vcxproj @@ -22,33 +22,33 @@ {8CD66811-C9A5-4C76-9938-1E046C2DFBAF} SysInfo MFCDLLProj - 10.0.18362.0 + 10.0 DynamicLibrary - v141 + v142 Dynamic Unicode true DynamicLibrary - v141 + v142 Dynamic Unicode DynamicLibrary - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 @@ -205,8 +205,6 @@ - - @@ -270,8 +268,6 @@ - - diff --git a/SysInfo/SysInfoClasses.h b/SysInfo/SysInfoClasses.h index 3e9dd673..6745f583 100644 --- a/SysInfo/SysInfoClasses.h +++ b/SysInfo/SysInfoClasses.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemController.cpp b/SysInfo/SystemController.cpp index 3ab44cc0..f46af07e 100644 --- a/SysInfo/SystemController.cpp +++ b/SysInfo/SystemController.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemController.h b/SysInfo/SystemController.h index 8037ddd7..fb0fb316 100644 --- a/SysInfo/SystemController.h +++ b/SysInfo/SystemController.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemControllerList.cpp b/SysInfo/SystemControllerList.cpp index 3d82025f..46cfe0da 100644 --- a/SysInfo/SystemControllerList.cpp +++ b/SysInfo/SystemControllerList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemControllerList.h b/SysInfo/SystemControllerList.h index 6fe5ecad..1faf0d5f 100644 --- a/SysInfo/SystemControllerList.h +++ b/SysInfo/SystemControllerList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemPort.cpp b/SysInfo/SystemPort.cpp index 06e929c9..c2e53bc1 100644 --- a/SysInfo/SystemPort.cpp +++ b/SysInfo/SystemPort.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemPort.h b/SysInfo/SystemPort.h index 3461dcc8..90278aee 100644 --- a/SysInfo/SystemPort.h +++ b/SysInfo/SystemPort.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemPortList.cpp b/SysInfo/SystemPortList.cpp index c0c86365..75fb8cfd 100644 --- a/SysInfo/SystemPortList.cpp +++ b/SysInfo/SystemPortList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemPortList.h b/SysInfo/SystemPortList.h index d3ca35eb..19e84871 100644 --- a/SysInfo/SystemPortList.h +++ b/SysInfo/SystemPortList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemSlot.cpp b/SysInfo/SystemSlot.cpp index 8077b6b6..42501533 100644 --- a/SysInfo/SystemSlot.cpp +++ b/SysInfo/SystemSlot.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemSlot.h b/SysInfo/SystemSlot.h index 122f724c..5e15bfb5 100644 --- a/SysInfo/SystemSlot.h +++ b/SysInfo/SystemSlot.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemSlotList.cpp b/SysInfo/SystemSlotList.cpp index 86ab6e92..5849489d 100644 --- a/SysInfo/SystemSlotList.cpp +++ b/SysInfo/SystemSlotList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/SystemSlotList.h b/SysInfo/SystemSlotList.h index 045aece6..52b1b7ca 100644 --- a/SysInfo/SystemSlotList.h +++ b/SysInfo/SystemSlotList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/VMSystem.cpp b/SysInfo/VMSystem.cpp index 6f163561..5ad71786 100644 --- a/SysInfo/VMSystem.cpp +++ b/SysInfo/VMSystem.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/VMSystem.h b/SysInfo/VMSystem.h index cfcb3cc6..3832238b 100644 --- a/SysInfo/VMSystem.h +++ b/SysInfo/VMSystem.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/VideoAdapter.cpp b/SysInfo/VideoAdapter.cpp index 512cd683..1621c998 100644 --- a/SysInfo/VideoAdapter.cpp +++ b/SysInfo/VideoAdapter.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/VideoAdapter.h b/SysInfo/VideoAdapter.h index a65a42ba..3f3ca253 100644 --- a/SysInfo/VideoAdapter.h +++ b/SysInfo/VideoAdapter.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/VideoAdapterList.cpp b/SysInfo/VideoAdapterList.cpp index 96bb292b..52d59411 100644 --- a/SysInfo/VideoAdapterList.cpp +++ b/SysInfo/VideoAdapterList.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/VideoAdapterList.h b/SysInfo/VideoAdapterList.h index 1e50b1d9..b0adc207 100644 --- a/SysInfo/VideoAdapterList.h +++ b/SysInfo/VideoAdapterList.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/WindowsSocket.cpp b/SysInfo/WindowsSocket.cpp index 7bbf7632..e6450bcd 100644 --- a/SysInfo/WindowsSocket.cpp +++ b/SysInfo/WindowsSocket.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/WindowsSocket.h b/SysInfo/WindowsSocket.h index b7611a01..02f0e976 100644 --- a/SysInfo/WindowsSocket.h +++ b/SysInfo/WindowsSocket.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Wmi.cpp b/SysInfo/Wmi.cpp index 7f435a2d..7f82e104 100644 --- a/SysInfo/Wmi.cpp +++ b/SysInfo/Wmi.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/Wmi.h b/SysInfo/Wmi.h index 43ce4b75..b4a51faa 100644 --- a/SysInfo/Wmi.h +++ b/SysInfo/Wmi.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/bios.cpp b/SysInfo/bios.cpp index 2a339490..c1b707e4 100644 --- a/SysInfo/bios.cpp +++ b/SysInfo/bios.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/bios.h b/SysInfo/bios.h index 605751e5..2bcdd532 100644 --- a/SysInfo/bios.h +++ b/SysInfo/bios.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/snmp.cpp b/SysInfo/snmp.cpp deleted file mode 100644 index c78e778a..00000000 --- a/SysInfo/snmp.cpp +++ /dev/null @@ -1,534 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -// SNMP.cpp: implementation of the CSNMP class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include "Sysinfo.h" -#include "debuglog.h" -#include -#include -#include "SnmpAPI.h" -#include "SNMP.h" -#include - - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -LPCSTR GetAnsiFromTString(LPCTSTR a_wstrString) -{ - static char szBuffer[1024*1024+1]; // 1MB buffer to handle string - - if (_tcslen( a_wstrString) > 1024*1024) - AfxThrowMemoryException(); - strcpy_s( szBuffer, 1024*1024, CT2A(a_wstrString)); - return szBuffer; -} - - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CSNMP::CSNMP() -{ - -} - -CSNMP::~CSNMP() -{ - -} - -BOOL CSNMP::GetNetworkAdapters(CNetworkAdapterList *pList) -{ - typedef BOOL(WINAPI * pSnmpExtensionInit) ( - IN DWORD dwTimeZeroReference, - OUT HANDLE * hPollForTrapEvent, - OUT AsnObjectIdentifier * supportedView); - - typedef BOOL(WINAPI * pSnmpExtensionTrap) ( - OUT AsnObjectIdentifier * enterprise, - OUT AsnInteger * genericTrap, - OUT AsnInteger * specificTrap, - OUT AsnTimeticks * timeStamp, - OUT RFC1157VarBindList * variableBindings); - - typedef BOOL(WINAPI * pSnmpExtensionQuery) ( - IN BYTE requestType, - IN OUT RFC1157VarBindList * variableBindings, - OUT AsnInteger * errorStatus, - OUT AsnInteger * errorIndex); - - typedef BOOL(WINAPI * pSnmpExtensionInitEx) ( - OUT AsnObjectIdentifier * supportedView); - - HINSTANCE hDll; - HANDLE PollForTrapEvent; - int ret, - nType; - ULONG speed; - BOOL found = FALSE; - CString csAddress, - csBuffer; - UINT uIndex = 0; - - pSnmpExtensionInit m_Init = NULL; - pSnmpExtensionInitEx m_InitEx = NULL; - pSnmpExtensionQuery m_Query = NULL; - pSnmpExtensionTrap m_Trap = NULL; - AsnObjectIdentifier SupportedView; - RFC1157VarBindList varBindList; - RFC1157VarBind varBind[6]; - AsnInteger errorStatus; - AsnInteger errorIndex; - - char str[INET_ADDRSTRLEN]; - - // Reset network adapter list content - while (!(pList->GetCount() == 0)) - pList->RemoveHead(); - // Network adapter(s) description and MAC address in - // <.iso.org.dod.internet.mgmt.mib-2.interfaces> MIB tree - // Entry for number of network interface - UINT OID_ifEntryNumber[] = { - 1, 3, 6, 1, 2, 1, 2, 1 - }; - // Entry for network interface index - UINT OID_ifEntryIndex[] = { - 1, 3, 6, 1, 2, 1, 2, 2, 1, 1 - }; - // Entry for network interface description - UINT OID_ifDesc[] = { - 1, 3, 6, 1, 2, 1, 2, 2, 1, 2 - }; - // Entry for network interface type - UINT OID_ifEntryType[] = { - 1, 3, 6, 1, 2, 1, 2, 2, 1, 3 - }; - // Entry for network interface speed - UINT OID_ifSpeed[] = { - 1, 3, 6, 1, 2, 1, 2, 2, 1, 5 - }; //, 1 ,5 }; - // Entry for network interface physical address - UINT OID_ifMACAddr[] = { - 1, 3, 6, 1, 2, 1, 2, 2, 1, 6 - }; - // Entry for network interface operational status - UINT OID_ifOperStatus[] = { - 1, 3, 6, 1, 2, 1, 2, 2, 1, 8 - }; - AsnObjectIdentifier MIB_ifMACAddr = { - sizeof(OID_ifMACAddr) / sizeof(UINT), OID_ifMACAddr - }; - AsnObjectIdentifier MIB_ifEntryType = { - sizeof(OID_ifEntryType) / sizeof(UINT), OID_ifEntryType - }; - AsnObjectIdentifier MIB_ifEntryNumber = { - sizeof(OID_ifEntryNumber) / sizeof(UINT), OID_ifEntryNumber - }; - AsnObjectIdentifier MIB_ifSpeed= { - sizeof(OID_ifSpeed) / sizeof(UINT), OID_ifSpeed - }; - AsnObjectIdentifier MIB_ifDesc= { - sizeof(OID_ifDesc) / sizeof(UINT), OID_ifDesc - }; - AsnObjectIdentifier MIB_ifIndex= { - sizeof(OID_ifEntryIndex) / sizeof(UINT), OID_ifEntryIndex - }; - AsnObjectIdentifier MIB_ifOperStatus= { - sizeof(OID_ifOperStatus) / sizeof(UINT), OID_ifOperStatus - }; - - // Network adapter(s) IP address and Net Mask in - // <.iso.org.dod.internet.mgmt.mib-2.ip.ipAddrTable> MIB tree - // Entry for network interfaces IP Address - UINT OID_ipAdEntAddr[] = { - 1, 3, 6, 1, 2, 1, 4, 20, 1, 1 - }; - // Entry for network interfaces index - UINT OID_ipAdEntIfIndex[] = { - 1, 3, 6, 1, 2, 1, 4, 20, 1, 2 - }; - // Entry for network interfaces IP Net Mask - UINT OID_ipAdEntNetMask[] = { - 1, 3, 6, 1, 2, 1, 4, 20, 1, 3 - }; - AsnObjectIdentifier MIB_ipAdEntAddr = { - sizeof(OID_ipAdEntAddr) / sizeof(UINT), OID_ipAdEntAddr - }; - AsnObjectIdentifier MIB_ipAdEntIfIndex = { - sizeof(OID_ipAdEntIfIndex) / sizeof(UINT), OID_ipAdEntIfIndex - }; - AsnObjectIdentifier MIB_ipAdEntNetMask = { - sizeof(OID_ipAdEntNetMask) / sizeof(UINT), OID_ipAdEntNetMask - }; - - AsnObjectIdentifier MIB_NULL = { - 0, 0 - }; - - // Didier LIROULET 2005-10-17 BEGIN - - // Network adapter(s) gateway in - // <.iso.org.dod.internet.mgmt.mib-2.ip.ipRouteTable> MIB tree - // Entry for IpRoute destination (0.0.0.0 for default route) - UINT OID_ipRouteDest[] = { - 1, 3, 6, 1, 2, 1, 4, 21, 1, 1 - }; - // Entry for network interface index IpRoute applies - UINT OID_ipRouteIfIndex[] = { - 1, 3, 6, 1, 2, 1, 4, 21, 1, 2 - }; - // Entry for IpRoute gateway - UINT OID_ipRouteNextHop[] = { - 1, 3, 6, 1, 2, 1, 4, 21, 1, 7 - }; - // Entry for IpRoute type (2=invalid, 3=direct, 4=indirect) - UINT OID_ipRouteType[] = { - 1, 3, 6, 1, 2, 1, 4, 21, 1, 8 - }; - AsnObjectIdentifier MIB_ipRouteDest = { - sizeof(OID_ipRouteDest) / sizeof(UINT), OID_ipRouteDest - }; - AsnObjectIdentifier MIB_ipRouteIfIndex = { - sizeof(OID_ipRouteIfIndex) / sizeof(UINT), OID_ipRouteIfIndex - }; - AsnObjectIdentifier MIB_ipRouteNextHop = { - sizeof(OID_ipRouteNextHop) / sizeof(UINT), OID_ipRouteNextHop - }; - AsnObjectIdentifier MIB_ipRouteType = { - sizeof(OID_ipRouteType) / sizeof(UINT), OID_ipRouteType - }; - // Didier LIROULET 2005-10-17 END - - AddLog( _T( "SNMP GetNetworkAdapters...\n")); - // Load the MIB dll and get the addresses of necessary functions - if ((hDll = LoadLibrary( _T( "inetmib1.dll"))) < (HINSTANCE) HINSTANCE_ERROR) - { - // Cannot load SNMP MIB - AddLog( _T( "SNMP GetNetworkAdapters: Failed to load !\n")); - hDll = NULL; - return FALSE; - } - if ((m_Init = (pSnmpExtensionInit) GetProcAddress(hDll, "SnmpExtensionInit")) == NULL) - { - // Cannot load SNMP MIB - AddLog( _T( "SNMP GetNetworkAdapters: Failed to load function from inetmib1.dll !\n")); - FreeLibrary( hDll); - hDll = NULL; - return FALSE; - } - if ((m_InitEx = (pSnmpExtensionInitEx) GetProcAddress(hDll, "SnmpExtensionInitEx")) == NULL) - { - // Cannot load SNMP MIB - AddLog( _T( "SNMP GetNetworkAdapters: Failed to load function from inetmib1.dll !\n")); - FreeLibrary( hDll); - hDll = NULL; - return FALSE; - } - if ((m_Query = (pSnmpExtensionQuery) GetProcAddress(hDll, "SnmpExtensionQuery")) == NULL) - { - // Cannot load SNMP MIB - AddLog( _T( "SNMP GetNetworkAdapters: Failed to load function from inetmib1.dll !\n")); - FreeLibrary( hDll); - hDll = NULL; - return FALSE; - } - if ((m_Trap = (pSnmpExtensionTrap) GetProcAddress(hDll, "SnmpExtensionTrap")) == NULL) - { - // Cannot load SNMP MIB - FreeLibrary( hDll); - AddLog( _T( "SNMP GetNetworkAdapters: Failed to load function from inetmib1.dll !\n")); - hDll = NULL; - return FALSE; - } - - m_Init(GetTickCount(), &PollForTrapEvent, &SupportedView); - - // Initialize the variable list to be retrieved by m_Query - - ///////////////////////////////////////////////////////////////// - // First, get network interfaces from <.iso.org.dod.internet.mgmt.mib-2.interfaces> MIB tree - ////////////////////////////////////////////////////////////////// - varBindList.list = varBind; - varBind[0].name = MIB_NULL; - varBind[1].name = MIB_NULL; - varBind[2].name = MIB_NULL; - varBind[3].name = MIB_NULL; - varBind[4].name = MIB_NULL; - varBind[5].name = MIB_NULL; - - // Copy in the OID to find the number of entries in the Interface table - varBindList.len = 1; // Only retrieving one item - SNMP_oidcpy(&varBind[0].name, &MIB_ifEntryNumber); - ret = m_Query(ASN_RFC1157_GETNEXTREQUEST, &varBindList, &errorStatus, &errorIndex); - - // Copy in the OID to retrieve interface properties in the Interface table - varBindList.len = 6; - // Copy in the OID of ifType, the type of interface - SNMP_oidcpy(&varBind[0].name, &MIB_ifEntryType); - - // Copy in the OID of ifphysAddress, the address - SNMP_oidcpy(&varBind[1].name, &MIB_ifMACAddr); - - // Copy in the OID of ifPhysSpeed, the speed - SNMP_oidcpy(&varBind[2].name, &MIB_ifSpeed); - - // Copy in the OID of ifDesc, the adapter description - SNMP_oidcpy(&varBind[3].name, &MIB_ifDesc); - - // Copy in the OID of ifIndex, the adapter index - SNMP_oidcpy(&varBind[4].name, &MIB_ifIndex); - - /* Copy in the OID of ifOperStatus, the adapter operational status */ - SNMP_oidcpy(&varBind[5].name, &MIB_ifOperStatus); - - do { - // Submit the query. Responses will be loaded into varBindList. - // We can expect this call to succeed a # of times corresponding - // to the # of adapters reported to be in the system - ret = m_Query(ASN_RFC1157_GETNEXTREQUEST, &varBindList, &errorStatus, &errorIndex); - if (!ret) - ret = 1; - else - // Confirm that the proper type has been returned - ret = SNMP_oidncmp(&varBind[0].name, &MIB_ifEntryType, MIB_ifEntryType.idLength); - if (!ret) - { - CNetworkAdapter cAdapter; - - // Get type of adapter - nType = varBind[0].value.asnValue.number; - if (IsLoopback( nType)) - { - // Loopback adapter => skip it - continue; - } - // Confirm that we have an address here - ret = SNMP_oidncmp(&varBind[1].name, &MIB_ifMACAddr, MIB_ifMACAddr.idLength); - // Get adapter speed - speed = varBind[2].value.asnValue.gauge; - if ((!ret) - && (varBind[1].value.asnValue.address.stream != NULL)) - { - csAddress.Format( _T( "%02X:%02X:%02X:%02X:%02X:%02X"), - varBind[1].value.asnValue.address.stream[0], - varBind[1].value.asnValue.address.stream[1], - varBind[1].value.asnValue.address.stream[2], - varBind[1].value.asnValue.address.stream[3], - varBind[1].value.asnValue.address.stream[4], - varBind[1].value.asnValue.address.stream[5]); - // We can save the info - csBuffer.Empty(); - for ( UINT uChar=0; uChar < varBind[3].value.asnValue.string.length; uChar++) - csBuffer.AppendFormat( _T( "%c"), varBind[3].value.asnValue.string.stream[uChar]); - cAdapter.SetIfIndex( varBind[4].value.asnValue.number); - cAdapter.SetDescription( csBuffer); - cAdapter.SetType( GetAdapterType( nType)); - cAdapter.SetTypeMIB( GetIfType( nType)); - cAdapter.SetSpeed( speed); - cAdapter.SetMACAddress( csAddress); - cAdapter.SetStatus( varBind[5].value.asnValue.number); - // IP info not available => we get them later - cAdapter.SetIPAddress( _T("")); - cAdapter.SetIPNetMask( _T("")); - AddLog( _T( "\tSNMP IfAddrEntry index=%ld, Description=%s, Type=%s, MIB Type=%s, Speed=%lu B/s, @ MAC=%s, Status=%s\n"), - cAdapter.GetIfIndex(), - cAdapter.GetDescription(), - cAdapter.GetType(), - cAdapter.GetTypeMIB(), - cAdapter.GetByteSpeed(), - cAdapter.GetMACAddress(), - cAdapter.GetOperationalStatus()); - // Add interface to list - pList->AddTail( cAdapter); - uIndex++; - } - } - } - while (!ret); - // Stop only on an error. An error will occur when we exhaust - // the list of interfaces to be examined - // Free the bindings - SNMP_FreeVarBind(&varBind[0]); - SNMP_FreeVarBind(&varBind[1]); - SNMP_FreeVarBind(&varBind[2]); - SNMP_FreeVarBind(&varBind[3]); - SNMP_FreeVarBind(&varBind[4]); - SNMP_FreeVarBind(&varBind[5]); - - ////////////////////////////////////////////////////////////////// - // Next, get network interfaces IP from <.iso.org.dod.internet.mgmt.mib-2.ip.ipAddrTable> MIB tree - ////////////////////////////////////////////////////////////////// - varBind[0].name = MIB_NULL; - varBind[1].name = MIB_NULL; - varBind[2].name = MIB_NULL; - - // Copy in the OID to retrieve interface IP properties in the IPAddr table - varBindList.len = 3; - // Copy in the OID of ipAdEntIfIndex, the index of interface - SNMP_oidcpy(&varBind[0].name, &MIB_ipAdEntIfIndex); - - // Copy in the OID of ipAdEntAddr, the IP address - SNMP_oidcpy(&varBind[1].name, &MIB_ipAdEntAddr); - - // Copy in the OID of ipAdEntNetMask, the IP Net Mask - SNMP_oidcpy(&varBind[2].name, &MIB_ipAdEntNetMask); - - do { - // Submit the query. Responses will be loaded into varBindList. - // We can expect this call to succeed a # of times corresponding - // to the # of adapters reported to be in the system - ret = m_Query(ASN_RFC1157_GETNEXTREQUEST, &varBindList, &errorStatus, &errorIndex); - if (!ret) - ret = 1; - else - // Confirm that the proper type has been returned - ret = SNMP_oidncmp(&varBind[0].name, &MIB_ipAdEntIfIndex, MIB_ipAdEntIfIndex.idLength); - if (!ret) - { - // Get IfIndex of adapter - nType = varBind[0].value.asnValue.number; - // Confirm that we have an address here - ret = SNMP_oidncmp(&varBind[1].name, &MIB_ipAdEntAddr, MIB_ipAdEntAddr.idLength); - if ((!ret) - && (varBind[1].value.asnValue.address.stream != NULL) - && (varBind[2].value.asnValue.address.stream != NULL)) - { - // We can save the info - csAddress.Format( _T( "%d.%d.%d.%d"), - varBind[1].value.asnValue.address.stream[0], - varBind[1].value.asnValue.address.stream[1], - varBind[1].value.asnValue.address.stream[2], - varBind[1].value.asnValue.address.stream[3]); - csBuffer.Format( _T( "%d.%d.%d.%d"), - varBind[2].value.asnValue.address.stream[0], - varBind[2].value.asnValue.address.stream[1], - varBind[2].value.asnValue.address.stream[2], - varBind[2].value.asnValue.address.stream[3]); - AddLog( _T( "\tSNMP IfTableEntry index=%ld, @ IP=%s, Network Mask=%s\n"), - varBind[0].value.asnValue.number, - csAddress, csBuffer); - - // Update network number - in_addr ipa; - ULONG ipAdr, ipMsk, nbRez; - CString csRez; - - inet_pton(AF_INET, GetAnsiFromTString(csAddress.GetBuffer()), &ipAdr); - inet_pton(AF_INET, GetAnsiFromTString(csBuffer), &ipMsk); - nbRez = htonl(ipAdr & ipMsk) ; - - ipa.S_un.S_addr = htonl(nbRez); - csRez = inet_ntop(AF_INET, &ipa, str, INET_ADDRSTRLEN); - - pList->SetIpAddrEntry( varBind[0].value.asnValue.number, - csAddress, csBuffer, csRez); - } - } - } - while (!ret); - // Stop only on an error. An error will occur when we exhaust - // the list of interfaces to be examined - // Free the bindings - SNMP_FreeVarBind(&varBind[0]); - SNMP_FreeVarBind(&varBind[1]); - SNMP_FreeVarBind(&varBind[2]); - - - // Didier LIROULET 2005-10-17 BEGIN - ////////////////////////////////////////////////////////////////// - // Next, get network interfaces gateway from <.iso.org.dod.internet.mgmt.mib-2.ip.ipRouteTable> MIB tree - ////////////////////////////////////////////////////////////////// - varBind[0].name = MIB_NULL; - varBind[1].name = MIB_NULL; - varBind[2].name = MIB_NULL; - varBind[3].name = MIB_NULL; - - // Copy in the OID to retrieve interface IP properties in the IpRoute table - varBindList.len = 4; - // Copy in the OID of ipRouteIfIndex, the index of interface - SNMP_oidcpy(&varBind[0].name, &MIB_ipRouteIfIndex); - - // Copy in the OID of ipRouteNextHop, the gateway IP address - SNMP_oidcpy(&varBind[1].name, &MIB_ipRouteNextHop); - - // Copy in the OID of ipRouteDest, the IP address to reach (0.0.0.0 for default) - SNMP_oidcpy(&varBind[2].name, &MIB_ipRouteDest); - - // Copy in the OID of ipRouteType, the route type (2=invalid, 3=direct, 4=indirect) - SNMP_oidcpy(&varBind[3].name, &MIB_ipRouteType); - - do { - // Submit the query. Responses will be loaded into varBindList. - // We can expect this call to succeed a # of times corresponding - // to the # of adapters reported to be in the system - ret = m_Query(ASN_RFC1157_GETNEXTREQUEST, &varBindList, &errorStatus, &errorIndex); - if (!ret) - ret = 1; - else - // Confirm that the proper type has been returned - ret = SNMP_oidncmp(&varBind[0].name, &MIB_ipRouteIfIndex, MIB_ipRouteIfIndex.idLength); - if (!ret) - { - // Get IfIndex of adapter - nType = varBind[0].value.asnValue.number; - // Confirm that we have an address here and that route is valid and - // that destination address is 0.0.0.0 - ret = SNMP_oidncmp(&varBind[1].name, &MIB_ipRouteNextHop, MIB_ipRouteNextHop.idLength); - if ((!ret) - && (varBind[3].value.asnValue.number != 2) - && (varBind[2].value.asnValue.address.stream[0] == 0) - && (varBind[2].value.asnValue.address.stream[1] == 0) - && (varBind[2].value.asnValue.address.stream[2] == 0) - && (varBind[2].value.asnValue.address.stream[3] == 0)) - { - // We can save the info - csAddress.Format( _T( "%d.%d.%d.%d"), - varBind[1].value.asnValue.address.stream[0], - varBind[1].value.asnValue.address.stream[1], - varBind[1].value.asnValue.address.stream[2], - varBind[1].value.asnValue.address.stream[3]); - AddLog( _T( "\tSNMP IfRouteEntry index=%ld, Gateway=%s\n"), - varBind[0].value.asnValue.number, - csAddress); - pList->SetIpRouteEntry( varBind[0].value.asnValue.number, - csAddress); - } - } - } - while (!ret); - // Stop only on an error. An error will occur when we exhaust - // the list of interfaces to be examined - // Free the bindings - SNMP_FreeVarBind(&varBind[0]); - SNMP_FreeVarBind(&varBind[1]); - SNMP_FreeVarBind(&varBind[2]); - SNMP_FreeVarBind(&varBind[3]); - // Didier LIROULET 2005-10-17 END - - // Unload the MIB dll library - FreeLibrary( hDll); - if (uIndex > 0) - { - AddLog( _T( "SNMP GetNetworkAdapters: OK (%u objects).\n"), uIndex); - return TRUE; - } - AddLog( _T( "SNMP GetNetworkAdapters: Failed because no network adapter SNMP object !\n")); - return FALSE; -} diff --git a/SysInfo/snmp.h b/SysInfo/snmp.h deleted file mode 100644 index 405419d6..00000000 --- a/SysInfo/snmp.h +++ /dev/null @@ -1,39 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -// SNMP.h: interface for the CSNMP class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_SNMP_H__3CFE0AD8_CC5A_4A0C_8BED_28A055A3C960__INCLUDED_) -#define AFX_SNMP_H__3CFE0AD8_CC5A_4A0C_8BED_28A055A3C960__INCLUDED_ - -#pragma once - -#include "SysInfoClasses.h" - - -class SYSINFO_API CSNMP -{ -public: // Methods - ////////////////////////////////// - // Standard constructor/destructor - ////////////////////////////////// - CSNMP(); - virtual ~CSNMP(); - - ////////////////////////////////// - // Get attributes values - ////////////////////////////////// - - static BOOL GetNetworkAdapters( CNetworkAdapterList *pList); -}; -#endif // !defined(AFX_SNMP_H__3CFE0AD8_CC5A_4A0C_8BED_28A055A3C960__INCLUDED_) - diff --git a/SysInfo/stdafx.cpp b/SysInfo/stdafx.cpp index 43ef948b..d6b7c96e 100644 --- a/SysInfo/stdafx.cpp +++ b/SysInfo/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/stdafx.h b/SysInfo/stdafx.h index d9020178..d0253be3 100644 --- a/SysInfo/stdafx.h +++ b/SysInfo/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/SysInfo/targetver.h b/SysInfo/targetver.h index 2136e187..4e31615f 100644 --- a/SysInfo/targetver.h +++ b/SysInfo/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/TestSysInfo/TestSysInfo.cpp b/TestSysInfo/TestSysInfo.cpp index cc6779cb..9a8ebc20 100644 --- a/TestSysInfo/TestSysInfo.cpp +++ b/TestSysInfo/TestSysInfo.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/TestSysInfo/TestSysInfo.h b/TestSysInfo/TestSysInfo.h index e6bf044a..17ca1672 100644 --- a/TestSysInfo/TestSysInfo.h +++ b/TestSysInfo/TestSysInfo.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/TestSysInfo/TestSysInfo.rc b/TestSysInfo/TestSysInfo.rc index 272305be..ed11f932 100644 --- a/TestSysInfo/TestSysInfo.rc +++ b/TestSysInfo/TestSysInfo.rc @@ -38,7 +38,7 @@ BEGIN PUSHBUTTON "SMBios/DMI",IDC_SMBIOS,7,317,50,14 PUSHBUTTON "WMI",IDC_WMI,77,317,50,14 PUSHBUTTON "SysInfo",IDC_SYSINFO,147,317,50,14 - LTEXT "OCS Inventory NG System Functions Testing Tool",IDC_STATIC,44,13,397,11 + LTEXT "OCS Inventory System Functions Testing Tool",IDC_STATIC,44,13,397,11 ICON IDR_MAINFRAME,IDC_STATIC,7,7,20,20 PUSHBUTTON "Load XML",IDC_LOAD_XML,217,317,50,14 PUSHBUTTON "Save XML",IDC_SAVE_XML,287,317,50,14 @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION 2,7,0,0 + PRODUCTVERSION 2,7,0,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -67,16 +67,16 @@ BEGIN BEGIN BLOCK "040004b0" BEGIN - VALUE "Comments", "OCS Inventory NG System Information Testing tool" - VALUE "CompanyName", "OCS Inventory NG" - VALUE "FileDescription", "OCS Inventory NG System Information Testing tool" - VALUE "FileVersion", "2.6.0.1" + VALUE "Comments", "OCS Inventory System Information Testing tool" + VALUE "CompanyName", "OCS Inventory" + VALUE "FileDescription", "OCS Inventory System Information Testing tool" + VALUE "FileVersion", "2.7.0.0" VALUE "InternalName", "TestSysInfo.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "TestSysInfo.exe" - VALUE "ProductName", "OCS Inventory NG Windows Agent" - VALUE "ProductVersion", "2.6.0.1" + VALUE "ProductName", "OCS Inventory Windows Agent" + VALUE "ProductVersion", "2.7.0.0" END END BLOCK "VarFileInfo" @@ -131,8 +131,8 @@ LANGUAGE LANG_FRENCH, SUBLANG_FRENCH // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ICON1 ICON "C:\\Users\\Admin\\Documents\\GitHub\\WindowsAgent\\NSIS_agent_setup\\install-ocs.ico" -IDI_ICON2 ICON "C:\\Users\\Admin\\Documents\\GitHub\\WindowsAgent\\Agent\\res\\OCSInventory.ico" +IDI_ICON1 ICON "C:\\Users\\charl\\Documents\\GitHub\\WindowsAgent\\NSIS_agent_setup\\install-ocs.ico" +IDI_ICON2 ICON "C:\\Users\\charl\\Documents\\GitHub\\WindowsAgent\\Agent\\res\\OCSInventory.ico" #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// diff --git a/TestSysInfo/TestSysInfo.vcxproj b/TestSysInfo/TestSysInfo.vcxproj index c29fd3db..f9ee9f50 100644 --- a/TestSysInfo/TestSysInfo.vcxproj +++ b/TestSysInfo/TestSysInfo.vcxproj @@ -22,33 +22,33 @@ {DBA26440-AC45-4C37-8C9B-E532B5F5F110} TestSysInfo MFCProj - 10.0.18362.0 + 10.0 Application - v141 + v142 Dynamic Unicode true Application - v141 + v142 Dynamic Unicode Application - v141 - x64 + v142 + x64 Dynamic Unicode true Application - v141 + v142 diff --git a/TestSysInfo/TestSysInfoDlg.cpp b/TestSysInfo/TestSysInfoDlg.cpp index 48dbd469..c7cd040f 100644 --- a/TestSysInfo/TestSysInfoDlg.cpp +++ b/TestSysInfo/TestSysInfoDlg.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/TestSysInfo/TestSysInfoDlg.h b/TestSysInfo/TestSysInfoDlg.h index 78eacc27..8267c081 100644 --- a/TestSysInfo/TestSysInfoDlg.h +++ b/TestSysInfo/TestSysInfoDlg.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/TestSysInfo/stdafx.cpp b/TestSysInfo/stdafx.cpp index 610712d0..b237ebc2 100644 --- a/TestSysInfo/stdafx.cpp +++ b/TestSysInfo/stdafx.cpp @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/TestSysInfo/stdafx.h b/TestSysInfo/stdafx.h index 48b7c97a..295d2f16 100644 --- a/TestSysInfo/stdafx.h +++ b/TestSysInfo/stdafx.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source diff --git a/TestSysInfo/targetver.h b/TestSysInfo/targetver.h index 9cd597e6..0436e90d 100644 --- a/TestSysInfo/targetver.h +++ b/TestSysInfo/targetver.h @@ -1,6 +1,6 @@ //==================================================================================== // Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved. +// Copyright (C) 2010 OCS Inventory Team. All rights reserved. // Web: http://www.ocsinventory-ng.org // This code is open source and may be copied and modified as long as the source