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.

July 31, 2008

#SNMP Design: Refresh Delayed

Because of a discussion session, I suddenly found a critical bug in #SNMP library. Therefore, a new Work Item is added and I am going to work it out before releasing the UnicornHorn Refresh.

I am not sure if there is a lot to be fixed but hope that I can resolve all this weekend. Stay tuned.

BTW, brianb, thank you for reporting this bug.Open-mouthed

July 30, 2008

#SNMP Design: UnicornHorn Refresh

There are two significant bugs inside UnicornHorn release that are fixed lately. Thus, I plan to release an refresh release this weekend. The version number should be 1.1.

Major changes are,

Even though the MIB browser has been updated lately, it is still an Alpha baby.Sad

Stay tuned.

July 27, 2008

#SNMP Design: Browser Update

Since TwinTower release (1.5) is going to have a basic MIB browser, I started to finish the task step by step last week just after releasing UnicornHorn (1.0).

The very first thing I try to accomplish was the MIB tree feature. The 1.0 release already has a tree structure done, so this time a module list is added.

It is easy now to add new MIB documents by clicking Add button on module panel. Parsing a problematic document will trigger a few error dialogues with detailed error information. Please pay attention to the panel because it also tells you which modules are not loaded because of dependency issues. And pending modules are listed in gray. Every time new documents are parsed, the tree panel will be updated automatically.

There is a lot of room for improvements. Some of them are,
  • store new documents so no need to add new documents every time you launch the browser. (I do not yet decide where to store these documents but I promise soon it will be done.)
  • allow to remove documents. (but default ones cannot be deleted.)
  • provide more information about pending documents. (for example which dependencies are missing.)
But now I have moved on to design the agent profile section to store SNMP agent information. This section also needs a place to save data. Therefore, I am going to develop a common data storage for all browser features. Although I have done similar things before for Alex and CBC, this time I am not yet sure which way is better.

Stay tuned.

July 26, 2008

#SNMP Design: Parser Update

I know that it is impossible to write a perfect MIB parser in a few months, but I am still satisfied about the simple parser I wrote for #SNMP library in May and June as it successfully parses 70 Net-SNMP bundled MIB documents without an exception.

However, I know there are bugs inside because Net-SNMP bundles nice MIB documents with consistent format. Yes, other MIB documents may cause an exception just because its format is cripple. That’s my fault, because I never knew how ugly a MIB document might be.

During the development of #SNMP MIB Browser (especially the MIB tree feature), I have to enhance the parser from time to time to parse a few MIB documents downloaded from the Internet. Luckily, the changes are small, so I think my original design is not too bad.

And today, I can announce that this parser can parse over 100 different MIB documents without an exception. Stay tuned.

#SNMP Design: Weaker Validation on Table OID

Maybe I should not have designed Manager.GetTable that way, isn’t it? The trouble I got is more. So how to change the original design at this moment? Take a look at source code of Change Set 14707, and you will see my decision.

The Old Design

Once upon a time (in this April), there was no validation in GetTable. But I added a basic case as soon as I noticed the necessity. This old validation required the OID passed to GetTable could be translated to textual form and ended with “Table”. It is such a natural rule that all tables defined in standard MIB documents follow it.

The Problem It Brings 

The old validation is too strong because not all OID can be validated like this. For example, if you try to access a table defined inside a private MIB document and probably #SNMP fails to parse this document, you are stuck! Sorry for the inconvenience.

After hearing of this critical bug, I admitted that I made a mistake when closing Issue and a solution must be presented as soon as possible.

The New Implementation

I think a weaker validation is preferred before I fix all possible issues in the parser. Thus, a new rule is added to the validation,

  • If the OID cannot be translated to textual form, it is assumed as a valid table OID (hi, this means you have to validate it yourself!).
  • If the textual form is available, this validation falls back to the old design. Only if the names ended with “Table” are valid.

Hope you like this change. Stay tuned.

#SNMP Design: Table Manipulation

I believe the table manipulation is one of the hardest things in SNMP world. Therefore, I have tried my best to make it simple for #SNMP users.

Have you tried Manager.GetTable method? In most cases, a simple call to this method provides you the rows and columns. But I want you to pay attention to some points.

Table OID

The OID you pass to this method must be a valid OID for a table. If you pass in an entry OID or other, I cannot guarantee you get what you want.

Sparse Table

Some SNMP agent does not fill in gaps inside tables. In such cases, #SNMP cannot generate a correct output matrix so the result is wrong. I am already aware of this bug but I do not have time to further investigate this issue at this moment.

The Implementation

The current implementation of GetTable is based on GET NEXT operation. Thus, it is not the most efficient but I hope I can tune it later.

Stay tuned.

GrapeVine Voice: Castalia Author’s Post

I have been reading posts about upcoming Delphi 2009 (code name Tiburon) for weeks, but I love this post from Castalia’s author Jacob.

Yes, because Unicode will be everywhere necessary inside Tiburon (compiler,  RTL, VCL, and IDE), Jacob have to update Castalia source code somewhere. I don’t know if the GExperts maintainers have a blog but I know that they have to update GExperts for Unicode, too.

Do I need to update Code Beautifier Collection for Tiburon? I have no idea this time. CBC is written in C# and .NET, so it is already Unicode based. Therefore, if there is no significant changes in the OTA for .NET, I hope I can release a build for Tiburon soon after its birth.

Stay tuned.

July 22, 2008

#SNMP Design: UnicornHorn and Known Issues

Finally the 1.0 release is here.Open-mouthed

However, soon I found more issues inside the simple MIB parser with some MIB documents and there were a bug report in the discussion board, too. So, there is still a lot ahead.

I hope I can fix the parser at first and then move on to the MIB browser. Stay tuned.

July 18, 2008

#SNMP Design: Source Analysis

I have been using Matt’s StyleCop Addin for SharpDevelop for almost two weeks and it is wonderful. So from now on, I am going to enhance #SNMP source files to make the code look better.

Luckily #SNMP is not a too large project and I am just getting 10,000 warnings from StyleCop. Hope that I can clean most of them up this weekend and deliver you UnicornHorn by then.

Stay tuned.Smile

Oh Cops, I Love You

It is really hard to master coding, because you are not just simply implementing a feature of your project. Writing solid code, secure code, and beautiful code is not a day dream.

At this moment, I feel like upgrading my coding style, so I find myself resort to Effective C# a lot. But, it is not always easy to find bad code just by my eyes. Then I feel luckily as a C# developer, because there is a lot of cops around me to help.

Microsoft Code Analysis (FxCop)

This was a popular GotDotNet project, and from the old days I have forced myself to fix most violations it report. Generally speaking, FxCop points out best practices you should follow when using and designing elements. I love the name checker a lot, and also the localization helper.

Because Microsoft decides to merge FxCop functions into Visual Studio (for above-Pro editions only), I am afraid that one day I may not be able to get help from FxCop.

The latest version from Microsoft is 1.36

Microsoft Source Analysis (StyleCop)

StyleCop focuses on source files. It helps you to develop a common coding style with others easily.

The latest version from Microsoft is 4.2. By default it only supports non-Express VS, but there is also an addin for SharpDevelop 3 here.

Novell Mono Gendarme

Gendarme implements certain amount of FxCop features while providing new rules. Because it is open source, you can feel free to extend it whenever suitable.

At this moment, 0.2 is released for Windows. You can find it in Google Group for Gendarme.

NDepend

NDepend provides a powerful query language named Code Query Language for you to query information from MSIL. It is a perfect way to dig deeper under the surface. However, I always find it hard to master because there are so many important features and tricks. Hope some day I can spare a whole week playing with it to investigate all its abilities.

Conclusion

You’d better start new projects with these cops so they can help you from day one. And if you use them to analyze a legacy project, there might be thousands of violations.

July 17, 2008

Social Networks: LinkedIn

I had a Facebook account, but I rarely used it because I found out that I do not like the FB way of communication. I did not touch MySpace or others until I found LinkedIn on Marco Cantu’s blog. Therefore, I keep updating my profile there and hope that some day an opportunity can reach me. It is always hard to find someone who knows my skills well.Sad

By the way, if you have a LinkedIn profile and want some recommendation from me, leave me a message.Smile

July 16, 2008

#SNMP Design: MIB Browser Status

Lately I did not update the browser, and of course users met issues with it and posted on the discussion board here. Thank you so much for posting your ideas. They helps me sharp the browser in design.

But before the 1.0 release scheduled this weekend, I think I have no time to update the browser. Thus in my last post, I proposed a 1.5 release to address the browser issues. As a result, when you see 1.0 some day, don’t blame me for the browser quality.Wink

I talked about the browser plan in details, so if you have any suggestions to add, please append your words there.

Stay tuned.

July 15, 2008

#SNMP Design: Laziness and Craziness

Lately I have been fighting against the heat around me at home because it is so hot here at Shanghai this summer. Therefore, I did not add new stuffs to the browser. However, did you notice the updates in SNMP v2 support inside the library such as exceptions and TRAP v2 support? Sometimes I feel it much easier to add things in a library than an application.Open-mouthed

After so many changes underlying, I think now it is time to prepare the 1.0 release of #SNMP. In the current plan, this release still focuses on the library itself (the browser and other samples are only available in source code form). And I’d like to release the first full feature MIB browser in a new release called TwinTower (1.5).

Stay tuned.

July 10, 2008

#SNMP Design: Update on Agent Side

For a long time, #SNMP focuses on SNMP manager side. Therefore, when one user asked if he/she could send out TRAP with #SNMP, I was surprised.

And today, I am so glad to see two votes on my poll that my work last night is not meaninglessWink

If you check out the latest source code, you can see a new project named TestSendTrap. This project illustrates how to send a TRAP with #SNMP. I hope it is a good start on #SNMP agent side support.

The development last night went on quite well because TrapMessage class and TrapV1Pdu already provides the skeleton. All I needed to do is copy one constructor from GetRequestMessage and then paste into TrapMessage. After a few modification, a new constructor for TrapMessage was there. This constructor helps you to construct a TrapMessage from all information you want to send (including enterprise, generic, specific, and so on). At last, a Send method was added to TrapMessage, too. You can simply call this method to send the TrapMessage instance out via UDP.

 (please notice I renamed TrapMessage to TrapV1Message because there comes a TrapV2Message)

This TestSendTrap project can be tested against TestTrap project and it worked fine last night.

After all, it is not too hard to add agent side support into #SNMP. However, because of the complexity of SNMP agents, there is a lot to be done. Stay tuned.

July 08, 2008

#SNMP Design: Will You Do An Agent in C#?

Today a post in the Discussions section asked if #SNMP library can be used to send out TRAP message. You can read my reply here because I don’t want to copy myself. But this is really a question I don’t have the answer. So how many C# developers are doing SNMP agent development?
I have just created a poll at my blog. So if you are doing C# SNMP agent, vote it. If there are enough requirement, I am going to enhance #SNMP library in that field.

(Updated: Now #SNMP 4 introduced an agent reference design, #SNMP Agent. We already did a lot of improvement in version 5 development phase, and now it is much more powerful and Mono/openSUSE compliant. Please check out http://www.lextm.com/2010/04/catpaw-rumors-we-are-truly-mono-ready.html)

July 05, 2008

#SNMP Design: Project Renamed

Today, I changed the project name to Sharp SNMP Suite. Because I am going to complete a MIB browser in 1.0 release, this project is no longer a library only. So from now on, #SNMP Suite = #SNMP Library + #SNMP MIB Browser.

Please notice the two have different licenses. The library is released under LGPL while the browser is under BSD. Using BSD for the browser is because it is also used as a demo for the library (in this case I think a less strict license is better).

Because of ISP issues, I can no longer use my SVN setup for CodePlex. Luckily, I am not stuck because Teamprise Explorer still works. Therefore, after several test check ins, now I can continue my work on #SNMP and Alex. Thank Goodness.

Well ISP Known Issues Here

I have been forced to give up Windows Live Writer (for my Blogger account), SF.net and SVNBridge (for Alex and #SNMP on CodePlex) at home. According to some rumors, that all ISPs here must limit access to certain Internet materials. Therefore, I am sad.

The everyday tasks I can no longer do in a few months are,
  1. Check in changes of #SNMP and Alex.
  2. Write posts in WLW and publish directly.
  3. Keep a track of updates on SF.net.
So sad.

Product Review: Pulse Up

I did try Pulse a long time ago, but I was not happy with that. However, after Eclipse 3.4 announcement I tried Pulse again, and the new version, is excellent!

I just could believe so many things were changed by the team,

  • The performance for non-broadband computers like mine is fine tuned. Since multi-thread/site download is supported, this time I can finally install Eclipse RCP via Pulse.
  • The user interface looks nicer.
  • This time more add-ons are available.

I guess I would no longer download Eclipse without Pulse :-)

(Updated: please notice if you want to use Pulse free, you should read the first comment below carefully to make yourself comfortable :-))

July 04, 2008

Maybe Microsoft Changes Post-Gates

When I wrote this post, I was upset. And I never knew that Microsoft would change, after Bill Gates’ retirement.

Now, Sandcastle is back to CodePlex, WITH SOURCE CODE. Open-mouthedAnd I think I can see Sandcastle inside SharpDevelop 3.0 soon.

July 01, 2008

#SNMP Design: Turn On The Light

To develop a MIB browser was my ultimate goal on #SNMP. However, at this moment, I find that the hardest thing in fact is the MIB compiler. Why? If you notice, a #SNMP MIB Browser is already on its way to hit you.

Day by day, I keep adding new code to make it more powerful. Yesterday, I have completed the MIB tree panel user interface. So for the first time you can see what MIB objects are parsed from the 70 Net-SNMP MIB documents, and see their types (Object, Table, Entry, Column, and others).

A few bugs were found during the development and fixed immediately. Luckily these issues should not affect normal SNMP operations, and they only affects #SNMP MIB Browser.

Another good news is that I am going to publish the source code of this #SNMP MIB Browser under a more friendly license, the BSD license.

Stay tuned.