按照下面的说明编译snmp++.net是无法通过的,原因是没有定义_IPX_ADDRESS和_MAC_ADDRESS,在snmp++的config_snmp_pp.h中打开即可。
What is SNMP++.NET?
SNMP++.NET is a set of .NET wrappers for the well-known SNMP++ library, which was originally written by Peter Mellquist of HP and now is being improved and maintained by Johen Katz and Frank Fock at Agent++ web site. Most SNMP++.NET classes are counterparts to SNMP++ classes with the same names, with (roughly) the same interface and usage scenario. SNMP++.NET comes with the same license as SNMP++, which basically means that it is completely free.
SNMP++.NET Features
SNMP++.NET supports all-high level features of SNMP++. However, some lower-level functionality (e.g., ASN.1/BER parsing) may be currently missing.
SNMP++.NET features:
SNMPv1/v2c/v3
all PDU types (Get, GetNext, GetBulk, Set, Response, Trap, v1Trap, Inform, Report)
MD-5 or SHA-1 based authentication
DES-based encryption (IDEA and AES are also available for SNMP++)
MT-safety for most SNMP++.NET classes (except Pdu)
synchronous and asynchronous interfaces (the latter follows .NET rules)
easy SNMP tables retrieval (TableReader.GetTable())
SNMP++.NET Design Choices
During the design of SNMP++.NET, the following choices have been applied:
Keep SNMP++ API: SNMP++.NET translates SNMP++ API into the .NET world but does not try to re-design it
Keep It Simple: Where possible, and where we felt it necessary, the API has been augmented with a convenient helper methods
Make It MT-Safe: SNMP++.NET should be completely MT-safe (most classes are invariant) except for the Pdu class, which should not be shared among threads
Please read MSnmpComp.cpp for more details.
SNMP++.NET ToDo List
Our ToDo list contains the following items:
Documentation: Provide implementation in the form of in-line comments.
Note: You can browse the current documentation (generated by NDoc) in the Windows help format, although only the TableReader class is really documented. Currently, Visual C++ does not support in-line code comments.
White paper: Prepare a paper that would explain all the design choices; explain problems encountered during the development and comment on employed solutions
MIB parser: Integrate a MIB parser with SNMP++.NET to allow OID resolution & values translation
Download SNMP++.NET
The package is distributed in a source form. The current version, 1.21, requires SNMP++ v. 3.2.21 or later (recommended the latest release) and compiles with no problems under VS.NET 2005 (.NET 2.0).
The package contains the following directories and files:
SnmpComp
MSnmpComp.cpp: the main component's code; contains all SNMP++.NET classes (C++)
MTypes.h: a few helpful templates (C++)
MConversion.h,cpp: a few helpful conversion functions (C++)
MLock.h: critical sections (C++)
AssemblyInfo.cpp: assembly info (Visual Studio)
auto_array_ptr.h: auto_ptr for arrays (C++ by Jack W. Reeves)
Examples
MSystemWalkExample.cs: a simple example of walking the system branch (C#)
MSystemWalkExample.vb: a simple example of walking the system branch (VB)
MSystemWalkExample.cpp: a simple example of walking the system branch (C++)
MManagerUtils.cs: a simple library, required by the manager and trap listener examples (see below) (C#)
MSnmpManager.cs: a complex example that demonstrates most advanced features and allows to test performance (C#)
MTrapListener.cs: a simple trap listener (C#)
TableReader.cs: a component that enables the retrieval of SNMP tables (C#)
VS.NET
VS.NET.sln: a solution file for MS VS.NET 2005
ReleaseNotes.txt: contains release notes on the current release
License.txt: contains the SNMP++.NET license
Snmp_ppVerify.bat: a simple script to verify the examples
Note that the package is provided "as is", without any warranty and any claims will not be respected. Please refer to the license, which is included in the distribution.
Download SNMP++.NET v. 1.21 now!
Download SNMP++.NET v. 1.16
Note: If you have any problems with the new release for .NET 2005, you can still try to compile the 1.16 version using VS.2005. You only need to replace MSnmpComp.cpp with this file and remove libcmt.lib from linker.
Build SNMP++.NET
The following steps are necessary:
Download SNMP++.NET
Download SNMP++ 3.2.17 (or newer), libdes, and MS VC 7 build files from Agent++ web site
Unpack all four archives in the same directory (e.g., c:/snmp). You will see the following directories: c:/snmp/libdes, c:/snmp/snmp++, c:/snmp/msvc, c:/snmp/snmp_ppnet
Read ReleaseNotes.txt in the snmp_ppnet directory
Open c:/snmp/msvc/staticLIB.sln solution and make libdes (the only library you have to build)
Open c:/snmp/snmp_ppnet/VS.NET/VS.NET.sln and build the component and all examplary programs in a debug mode
Finally, you can re-configure the solution to build the component and examples in a release mode
Contact the author
If you have any problems, comments or suggestions regarding SNMP++.NET or this page, contact me at [email protected].