Total Pageviews

Disclaimer

This is a personal web page. The views expressed on this blog are mine and do not necessarily reflect the views of my current employer.

I am currently employed by Morgan Stanley.

March 20, 2010

CatPaw Rumors: The Solution Files

(Updated to latest for our release 5.0 development)

We ship many solution files in #SNMP 5 codebase for different Visual Studio IDE versions (default one for VS2010, vs2008 for VS2008), and platforms (cf3 for .NET CF 3.5).

From now on I make the following rules,

1. The default VS version I use is Visual Studio 2010, so the default solution file is the standard one who contains all projects. 
2. Other solution files contain only the core projects (for #SNMP Library and so on).
3. The CF solution only contains one project. That's SharpSnmpLib.dll.
Why? Different Visual Studio versions have incompatibilities, especially in visual designers. That explains why new VS version always asks to upgrade project files created by an older version. To avoid mysterious issues related to such incompatibilities, only core projects (who has no visual parts) are shared among different solution files.

March 14, 2010

SquareRoot Puzzle: A Pity on Mono Support

A review with MoMA on the suite release shows that the Browser, Compiler and Agent all fails to support Mono due to their dependencies on Windows only libraries. 

I cannot make the Browser and Compiler without DockPanel Suite, so I think such a dependency is at least reasonable. In the next few releases, I have no plan to get rid of DockPanel Suite.

But about Unity, I have to say I have so little to change. IoC containers such as Unity (1.* and 2.0), StructureMap (latest), and Spring.NET (latest) all fail to pass MoMA tests, as they hit similar MonoTODO items. Therefore, I have no framework to switch to :(

Hope that Mono 2.8 can improve itself in this area, and then #SNMP Agent can run on it automatically. I don't believe that developers that target Mono do not use any IoC containers.

March 13, 2010

SquareRoot Puzzle: NDepend Check on #SNMP 4.0

Recently I got a license for NDepend Pro. I am going to make good use of this amazing tool.

The first thing I did is a quick analysis on what we did from 3.1 to 4.0 (4 and a half months passed except Jan at which time I was not able to code). I followed Patrick's post here.

A view of the work achieved

SELECT METHODS WHERE CodeWasChanged OR WasAdded

We changed a lot of code, which shows the suite evolution is still fast. (The Library is stable now, but the Browser, Compiler and Agent are moving fast.)



New Core Public Types

SELECT TYPES FROM ASSEMBLIES "SharpSnmpLib", "SharpSnmpLib.Controls", "SharpSnmpLib.Mib"

WHERE IsPublic AND WasAdded
Only one new types is introduced in 4.0. That is the SearchResult class. You will use it more and more in the future, as we recommend IObjectTree.Search.
New Assemblies
SELECT ASSEMBLIES WHERE WasAdded 
Only one assembly is added to our binary release package. That is snmpd.exe, our SNMP agent reference design.
New Public Types
SELECT TYPES WHERE WasAdded AND IsPublic
We have a few new types here except for SearchResult,
  • WatchDog: This is a class that works as a hardware watch dog. The Browser utilizes it to monitor the module folder for changes. Without it, changes occurring in a short period of time cause a sequence of UI updates. It can be extended to provide more functionality. (Note that this class is released under MIT license and distributed in a standalone source file.)
  • AccessFailureException: This is an exception type used snmpd for read-only or write-only SNMP objects.
New Public Namespaces
SELECT NAMESPACES WHERE WasAdded AND IsPublic
Two namespaces are added,
  1. Lextm.Common: This namespace currently only contains WatchDog class.
  2. Lextm.SharpSnmpLib.Agent: This namespace contains all agent side relevant classes, such as SnmpApplication, SnmpContext and so on.
Rambling
Our biggest improvement here is the snmpd agent. :)
I will play more with NDepend and blog more about this wonderful tool.

SquareRoot Puzzle: 4.0 Final Kick-off

Hi dear users,

Today is the time to update the suite at hand to its latest release. Yes, SquareRoot phase is over, and we have 4.0 final here,


Work on 5.0 (CatPaw) will start soon.

Regards,

March 07, 2010

SquareRoot Puzzle: Beta 2 is Ready for 4.0

#I think now we are ready to release 4.0 in March, as a lot of useful features were finally merged into the code base.

Today, Beta 2 of 4.0 is uploaded and please grab a copy. Let me know if you have any comments on the changes.

SquareRoot Puzzle: IObjectTree, Find or Search?

It is not easy to design a library, especially if the author tries to provide easy to use API. Therefore, only after so many revisions I finally have a chance to revisit a few annoying interfaces recently.

Did you use IObjectTree.Find(uint[]) method directly? It was not exposed initially, but can be accessed from IObjectRegistry.Tree.Find later due to the Browser/Compiler requirements. But it is hard to use because,

1. It throws ArgumentOutOfRangeException if the numerical form cannot be resolved by this tree.
2. It does not help much when you try to convert 1.3.6.1.1.1.0 to  iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0. 

Why cannot we make this function better? But how?

Such questions are hard to answer till today I decided we add a new Search method. This new method still accepts uint[] but it no longer navigates through the tree nodes to locate  exact matched one. Instead, we try to locate the branch first and if we cannot map all the numbers to nodes on the branch, we simply stop and return the last node located and remaining numbers in a new class, SearchResult.

Now getting textual forms (module name::object name, or parent node.[...].object name) becomes much easier and we finally achieve what net-snmp performs for a very long time.

From now on, Find is obsolete, and we should move to Search. Below is a summary,
  • Changes on Find are breaking, so you need to retest your code who relies on this function.
  • Search provides more features than Find (tolerate if the object is not in the tree).
  • Find is obsolete and will be marked as internal in our next release.
  • To get textual forms, we need to utilize SearchResult class.
Note that IDefinition.TextualForm is also obsolete. To get the same output, first construct a SearchResult using this IDefinition instance (second parameter should be "new uint[0]"). Then, SearchResult.Text is what you need, while you can also check out SearchResult.AlternativeText.

March 06, 2010

SquareRoot Puzzle: Digest #SNMP Samples, Part 1 Summary

Many samples are shipped in #SNMP Suite. But why they are that useful?

The Command Line Tools

The command line tools are small samples showing you only a few aspects of #SNMP Library. For example, snmpget tells how to send GET messages in all SNMP versions, and handle the response messages. snmpset, snmpbulkget, snmpgetnext and so on serves similarly.

Topics covered are,

1. How to send GET, SET, GET NEXT, GET BULK messages.
2. How to handle response messages.
3. What are the differences from SNMP v1/v2c and v3.
4. How to do WALK operation.
5. How to monitor incoming TRAP/INFORM messages.

The Agent

If you know the daily work of a hardware engineer, you see how important a reference design is. If the vendor provides you a reference design about a chipset, you can simply modify a few parts and use the main part if your product. This saves you a lot of efforts.

#SNMP Agent is a .NET based reference design for you, and you can make your own SNMP agent out of it by adding the features you need. 

You must notice that this reference design is interesting, as it uses a managed pipeline to handle SNMP messages. This is similar to what ASP.NET does for HTTP messages. I want you to feel like home.

Topics covered are,

1. How to monitor incoming messages.
2. How to do authentication.
3. How to do handler mapping.
4. How to query objects.
5. How to log operations.

The Compiler

The Compiler sample mainly shows you how to compile MIB documents (*.mib or *.txt) to module files (*.module) that the Browser expects. 

It rises when I started to test out hundreds of MIB documents. Though not feature complete yet, it provides basic things such as error reporting.

Topics covered are,

1. How to compile MIB documents.
2. How to report errors.

The Browser

At the very beginning, the Browser contains the Compiler. But after a while we split them, so now it only loads module files (*.module) and provides functions such as MIB tree navigation, trap monitor, basic SNMP operations.

Topics covered are,

1. How to load module files.
2. How to build the MIB tree.
3. How to listen to traps.
4. How to do basic operations.