It is a really interesting question why Gendarme think Listener.HandleMessage is a large function. But now I have the answer and today I finally refactored on this function, and designed a few new classes.
Listener Adapters
For an SNMP v1 manager, actually only TRAP v1 message is useful. So why it needs to be bothered by other versions of messages? Now you can use a simple listener adapter for v1 manager and hook it to the Listener object.
Yes, it sounds like filters for incoming messages. That's it.
I have also created a default adapter for backward compatibility, too. You can check how to use it in the samples.
Breaking Change Notice
Now all events for Listener component are obsolete except that one for exceptions. So you must follow the samples to update your code as so to adapt the changes.
Stay tuned.
2009/06/01
Trident Sign: Listener Adapters
Posted by
Lex Li
at
6:57 AM
0
comments
Links to this post
Labels: #SNMP, .NET, Open Source
2009/05/29
CrossRoad Billboard: More on IP v6 and 2.1
Here is the technical details about work item 4016 and release 2.1.
Background
I bought my notebook in 2007, which ships with Windows Vista Home Basic, so from then on I have worked on IP v6 enabled platforms (Windows Vista and Windows 7).
Before the release of 2.0 final, when I tried to make the library IP v6 compatible, I had a lot of tests executed on Windows 7. So I didn't realize that such tests are not enough.
Yes, I did learn a few key points about Windows XP and Windows Server 2003 in March. But I simply neglected them that day and left the bug there. (Next time surely I will do some tests on Windows XP.
Report
BACON report this bug on April 29th (three days after the release day), which soon drew my attention.
This is one of the best bug reports I ever saw, in which not only the problem description was comprehensive, but the solution was presented as well. Soon we closed the work item (on May 1).
I must thank BACON again as he/she did a great job.
Extra
The report was about the library, but in fact there was another relevant issue in the browser.
When I designed the notification panel, it also made use of IP v6 so that all TRAP and INFORM messages can be correctly handled. If we only fixed the library, the browser would still fail to work.
The good news is that both issues are addressed, and 2.1 contains both patches.
Side Notes
First, what if your application only targets Windows 6.0 (Vista and Server 2008) and the upcoming Windows 7 (Windows Server 2008 R2 as well)? Do you need to upgrade? I think you can continue using release 2.0.
Second, as I removed most obsolete items in 2.1 release, please compile your code against 2.0 and follow the migration suggestions. After those changes, you can move on to compile against 2.1.
If you meet any problem with 2.0/2.1, feel free to let me know via this blog or the discussion board.
Posted by
Lex Li
at
7:12 AM
0
comments
Links to this post
Labels: #SNMP, .NET, Open Source
2009/05/25
CrossRoad Billboard: CrossRoad Refresh (2.1)
This is a silent release, as it only contains important bug fixes for Windows XP/Server 2003, which do not have IP v6 installed by default.
Posted by
Lex Li
at
9:37 AM
0
comments
Links to this post
Labels: #SNMP, .NET, Open Source
Trident Sign: Broken Builds
Is it OK to follow #SNMP builds at CodePlex.com? Probably not. The reason is quite simple, that I just can guarantee the builds can be compiled and that's all.
Posted by
Lex Li
at
9:37 AM
0
comments
Links to this post
Labels: #SNMP
2009/05/09
Trident Sign: Driving the Fast Car
I am rushed to my feet to explore on SNMP v3. Actually this time with good materials such as Essential SNMP, Net-SNMP agent, and Snmp#Net, the progress is unexpectedly smooth.
I plan to provide a detailed report once I finish the first revision of full SNMP v3 support. Now I just focus on snmpget command line tool and already finish noAuthNoPriv and authNoPriv modes. Tomorrow I will try to finish authPriv mode.
snmpget -v=3 -l=noAuthNoPriv -u=lextm localhost 1.3.6.1.2.1.1.1.0
snmpget -v=3 -l=authNoPriv -u=lexli -a=MD5 -A=testpass localhost 1.3.6.1.2.1.1.1.0
snmpget -v=3 -l=authNoPriv -u=lextudio -a=sha -A=passtest localhost 1.3.6.1.2.1.1.1.0Above are the test command lines I use to test snmpget against Net-SNMP agent, and you may notice that I choose a style similar to Net-SNMP snmpget.
I do not yet have a driver license, but I think now I have control of this v3 fast car. :)
Stay tuned.
Posted by
Lex Li
at
8:42 PM
0
comments
Links to this post
Labels: #SNMP, Open Source
2009/05/03
Trident Sign: SNMP v3 Packet Format
RFC 3412 is the document who defines SNMP v3 packet format. This format is much more complicated than v1 and v2c, and it took me a long time to carefully analyze the structure.
http://www.ietf.org/rfc/rfc3412.txt
Well, actually parsing the entities from packets are easy, as the data types are the same. But v1 and v2c share the same format, which contains a small number of entities, while v3 packets have more entities to provide authentication and privacy features. Then it is rather hard to enhance GetRequestMessage class to support v3, without breaking existing v1 and v2c test cases.
Suddenly, I noticed that I can find v1 and v2c fields from v3 format.
http://www.tcpipguide.com/free/t_SNMPVersion3SNMPv3MessageFormat.htm
For example, community name is just like message user name, and PDU is part of scoped PDU. Therefore, finally I inserted a suite of segment classes into the library. For example, header segment contains necessary fields for v3, but it becomes null for v1 and v2c; security parameters segment becomes community name for v1 and v2c; scope PDU downgrades to PDU.
Well, luckily I still have enough test cases available to ensure my changes do not break existing code. Cool
Posted by
Lex Li
at
8:14 PM
0
comments
Links to this post
Labels: #SNMP, .NET, Open Source
2009/05/01
Trident Sign: Another Open Source SNMP Library via C#
I just came across another open source SNMP library for .NET, named SnmpSharpNet. Although this project is still a one-man show, and it started around November last year (well, younger than #SNMP), it did implement something missing in our project.
Posted by
Lex Li
at
1:18 PM
0
comments
Links to this post
Labels: #SNMP, .NET, Open Source
2009/04/26
Trident Sign: Road to SNMP v3
We shall finally come to work on SNMP v3. But how to go there step by step? I have a list below and hope that following it we can reach the land.
- Configure Net-SNMP agent so that I can test #SNMP against it.
- Develop an SNMP v3 compliant manager to talk to that agent.
- Design necessary agent parts so that it can perform basic functions like its Net-SNMP counterpart.
Posted by
Lex Li
at
7:46 PM
0
comments
Links to this post
Labels: #SNMP, .NET, Open Source
