可移植性最好的SNMP引擎

时间:2021-06-03 22:00:02
我在学校做项目时,基于C++网络中间件ACE(http://www.cs.wustl.edu/~schmidt/ACE.html)实现了SNMP引擎(我称之为yaSNMP,Yet Another SNMP engine)。ACE将多种平台在网络编程方面的Native C API封装在一致的C++类,并且提供了多种框架(参考《面向模式的软件体系结构,卷2:用于并发和网络化对象的模式》)。这使得我的SNMP引擎极具可移植性,目前已经在Linux和Window上测试通过。

我已经打包好了源代码和文档。有兴趣参考或扩展yaSNMP的同志请联系我。本人Email为yuzhichang@gmail.com

下面是yaSNMP的README:

================================================================================
Introduction
================================================================================
yaSNMP is a multi-threaded SNMPv3 engine. It supports only the Simple Network Management Protocol version 3 currently. In particular, it is designed to match the architecture of the Internet Engineering Task Force SNMPv3 standard (RFCs 3410-15).

yaSNMP can be used to develop command generator and command receiver (they are named manager and agent in SNMPv1/vc2). It has been tested on LINUX and windows 2000/XP. Since yaSNMP is based on ACE, it may be used with other platforms which ACE supports.

Features:
(1) easy to port to other platforms.
(2) only support SNMPv3.
(3) complex SNMP application, for example, the combine of command generator and command receiver, can use only one SNMP engine.
(4) support MD5 and SHA1 authentication.

TODO:
(1) develop ready to use classes which implement a lot of (system independent) standard MIBs. =>refer Agent++
(2) persistent storage support. =>refer NetSNMP
(3) DES support. =>refer opensnmp
(4) SNMP v1/vc2 support. =>refer SNMP++
(5) MIB parsing. =>refer opensnmp

I shall implement these features in the future. If you are interested in using or extending yaSNMP, please let my known. My email is <yuzhichang@gmail.com>.

Some useful links:
(1) ACE: http://www.cs.wustl.edu/~schmidt/ACE.html
yasnmp's origin is ASNMP, which is a example included in ACE.
(2) SNNMP++/Agent++: http://www.agentpp.com/
These two package may be the most popular one among SNMP development packages. They are free even for commercial uses.
They are written in C++ and support SNMP v1/v2c/v3. AGENT++ includes ready to use classes which implement a lot of (system independent) standard MIBs.
They support multiple platform such as Linux, HPUX and Windows. Since there are some platform specific macros, for example "WIN32" in threads.h, it may be difficult to port them to new platforms.
(3) opensnmp: http://sourceforge.net/projects/opensnmp/
It's written in C++ and only support SNMP v3. It has been tested on several different UNIX platforms (LINUX, SOLARIS, BSD).
(4)PySNMP: http://pysnmp.sourceforge.net/
This project aims at developing SNMP v1/v2c/v3 engine written in Python programming language.

================================================================================
Compile and install
================================================================================
(1) Install SCons on your system. It's a wonderful build system. yaSNMP's build procedure is based on it.
(2) Download the latest ACE and compile it. Please install it as follow:
[1] copy the ACE library (libACE.so on Linux, ACE.dll on Windows) to one of the system default library paths.
[2] cope $(ACE_ROOT)/ace entirely to one of the system default header file search paths. Then delete other files in the dest path but remain all .h/.inl/.cpp files and subdirectories.
(3) Install CppUnit on your system. Or if you are not interested in yaSNMP unit test, please modify SConstruct to comment out the following line by prepending a '#' to the line:
SConscript(["test/SConscript"])