Well, I have to say something here about BitString class and its future.
This class was directly ported from Malcolm's code. Because I never use BIT STRING type before, I really have no idea how to use or improve this type. Therefore, when cool started this thread I initiated a research. My research ended yesterday when I came across this link. So I should stop working on this obsolete type, shouldn't I?
As a result, now this class is marked as obsolete. I won't fix any bugs myself, but if you find any bug and have a patch at hand, please feel free to contact me.
My name is Lex Li. I love pop music and badminton. Now I live in Shanghai, P.R. China.
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.
I am currently employed by Morgan Stanley.
January 31, 2009
#SNMP Design: Unity in Compiler Finally
If you have time to review our latest Browser source code, you will notice what I have done in order to fit Unity in. I moved nearly all global variables into the IoC container who helps construct every objects based on my configuration file.
However, because I spent less time on the Compiler so its design is worse. So a lot of refactorings were performed. And the output is beyond my imagination. By creating a CompilerCore class, I successfully extract a lot of code out of MainForm. I cannot believe everything works out in this way unless here it is. So is it possible to develop a command line compiler based on this new class? Yup, I would probably do that soon.
It is really nice to learn about Unity, as I have a nice ride to redesign both the Compiler and Browser step by step. Now it is time to move on, as we still have a few key items for CrossRoad release. Stay tuned.
However, because I spent less time on the Compiler so its design is worse. So a lot of refactorings were performed. And the output is beyond my imagination. By creating a CompilerCore class, I successfully extract a lot of code out of MainForm. I cannot believe everything works out in this way unless here it is. So is it possible to develop a command line compiler based on this new class? Yup, I would probably do that soon.
It is really nice to learn about Unity, as I have a nice ride to redesign both the Compiler and Browser step by step. Now it is time to move on, as we still have a few key items for CrossRoad release. Stay tuned.
Labels:
#SNMP,
.NET,
Open Source
January 28, 2009
#SNMP Design: The Ship Map Ready
Like I said in the previous post, Steve and I had a long discussion this morning and worked out a small list of items for CrossRoad. (Note that we don't count bugs, as we want to fix them all as soon as possible always.)
Now we have four items listed here in the Issue Tracker, open for CrossRoad,
Well, Steve provides 3.0 a codename of Trident. This follows our tradition that every codenames implicitly contains the version number.
We are open to any comments. Please share your ideas with us here.
Now we have four items listed here in the Issue Tracker, open for CrossRoad,
- 3709: Unity will be used in both Browser and Compiler. (done)
- 2278: I will make the Compiler 1.0 ready. (done)
- 3708: Steve will implement TRAP and INFORM support in the Browser.
- 3408: I will integrate Browser and Compiler so we can add/remove/load/unload MIB modules easily.
Well, Steve provides 3.0 a codename of Trident. This follows our tradition that every codenames implicitly contains the version number.
We are open to any comments. Please share your ideas with us here.
Labels:
#SNMP,
.NET,
Open Source
#SNMP Design: More Objects into Unity Container
I have to confess in the past we don't pay much attention to Browser structure as much as necessary. Though began as a larger demo for the Library, it now turns out to be a useful utility itself after Steve's active development. However, I have to dive in sometimes to clean up my not-so-good legacy and close work items assigned to me. Well, that was very painful before we shipped TwinTower final because then I realized we need to lay a solid ground floor at first.
Therefore, in order to make CrossRoad a real crossroad, we are going to start as early as possible. The latest changes with Unity is significant in the following aspects,
There are still issues. For example, if you close a panel, there is no way to get it back at this moment. We know most of them and hope to fix them one by one in this sprint.
Right now I will move on to our Compiler and integrate Unity with it, too. Stay tuned.
During the composition of this post, I had a nice discussion with Steve on Google Talk. I think both of us agree on a few big tasks for CrossRoad already, so the next post I will let you know more details. But we are always open to suggestions, so please don't hesitate to let us know your ideas.
Therefore, in order to make CrossRoad a real crossroad, we are going to start as early as possible. The latest changes with Unity is significant in the following aspects,
- The global resources like Manager instance, profile registry and object registry are now in the container as singleton.
- The docking panels are now managed by the container, too.
- Unity helps inject necessary resources into the panels automatically.
There are still issues. For example, if you close a panel, there is no way to get it back at this moment. We know most of them and hope to fix them one by one in this sprint.
Right now I will move on to our Compiler and integrate Unity with it, too. Stay tuned.
During the composition of this post, I had a nice discussion with Steve on Google Talk. I think both of us agree on a few big tasks for CrossRoad already, so the next post I will let you know more details. But we are always open to suggestions, so please don't hesitate to let us know your ideas.
Labels:
#SNMP,
.NET,
Open Source
January 27, 2009
#SNMP Design: Why Unity Appears in Browser and Related Changes
You may doubt why I introduced Unity Application Block in latest builds. Well, the reason is simple, "we need it".
Although IoC or DI has been a hot topic for some time, I solely understand the concepts and the basics, but never have a chance to practise with a real IoC container. So now it is good to know Unity and its power. Bet you know that it is bad to place global variables but using a IoC container, it is easy to access variables stored in this global container.
Aha, this is only the very basic usage of IoC container. Surely I will investigate concepts like AOP in the future when I need them badly. At this moment, I just make use of its XML syntax to inject objects into bigger ones in App.Config. In this way I can easily find out where to start a new refactoring.
One piece of the exciting news is that we finally get rid of Inventory class as we find a way to combine its functions with ObjectRegistry seamlessly. The direct result is that you can create a new ObjectRegistry other than ObjectRegistry.Default easier than ever. Simply pass a "folder" string to the constructor, this new instance will automatically load all MIB documents in that folder.
Finally we can get rid of embedded MIB documents and start to load whatever we want. Now the final problem is how to remove modules from the list. That will happen soon after we enhance the Compiler. Stay tuned.
You may ask why Unity. I know that I must be biased now because of my current job. :) But I really want to say that Unity is well documented and easy to use. I did try other containers in the past but when they failed me I could hardly hang myself there. Don't worry Unity will affect our open source spirit, as it is also fully "open source" under MS-PL as that license is approved by OSI.
Although IoC or DI has been a hot topic for some time, I solely understand the concepts and the basics, but never have a chance to practise with a real IoC container. So now it is good to know Unity and its power. Bet you know that it is bad to place global variables but using a IoC container, it is easy to access variables stored in this global container.
Aha, this is only the very basic usage of IoC container. Surely I will investigate concepts like AOP in the future when I need them badly. At this moment, I just make use of its XML syntax to inject objects into bigger ones in App.Config. In this way I can easily find out where to start a new refactoring.
One piece of the exciting news is that we finally get rid of Inventory class as we find a way to combine its functions with ObjectRegistry seamlessly. The direct result is that you can create a new ObjectRegistry other than ObjectRegistry.Default easier than ever. Simply pass a "folder" string to the constructor, this new instance will automatically load all MIB documents in that folder.
Finally we can get rid of embedded MIB documents and start to load whatever we want. Now the final problem is how to remove modules from the list. That will happen soon after we enhance the Compiler. Stay tuned.
You may ask why Unity. I know that I must be biased now because of my current job. :) But I really want to say that Unity is well documented and easy to use. I did try other containers in the past but when they failed me I could hardly hang myself there. Don't worry Unity will affect our open source spirit, as it is also fully "open source" under MS-PL as that license is approved by OSI.
Labels:
#SNMP,
.NET,
Microsoft,
Open Source
Product Review: feedly over Google Reader
I have been tightly bind to Reader for a long time since our Chinese ISP kindly started to block a lot of blog sites. I am pritty sure that RSS support in many web browsers and mail applications are really cool, but sadly they cannot fight against my ISP, can they? Therefore, utilizing powerful servers of a big company as my proxy is not a bad idea.
However, I always find it boring to use that "simple" UI from Google. I love simplicity but that does not mean I could not enjoy some awesome things sometimes. But now I have found what I want, feedly.
This is a cool Firefox add-on that provides a magazine view of all feeds I subscribe to. So please install and try it out yourself.
Well, it works perfect even if I use FF 3.1b2. :)
However, I always find it boring to use that "simple" UI from Google. I love simplicity but that does not mean I could not enjoy some awesome things sometimes. But now I have found what I want, feedly.
This is a cool Firefox add-on that provides a magazine view of all feeds I subscribe to. So please install and try it out yourself.
Well, it works perfect even if I use FF 3.1b2. :)
Labels:
Firefox
#SNMP Design: New Ideas about Walk and Table
I discussed with Steve several times before we shipped TwinTower. We agreed that it is a big task to finish through multiple releases, so TwinTower only contains a new implementation of Walk from Steve.
We are going to investigate more in this field, but at first I would like to ask a simple question, "why Net-SNMP does not get a table unless it has the MIB?"
You may wonder why I asked this question, as #SNMP can get such a table even if the MIB is not loaded. I have to confess I underestimate the role of MIB in the past. :(
In fact, SNMP table is a complex thing. When you understand more and more MIB documents, you will notice there are many complex tables who have a lot of indices. Therefore, without an MIB definition, it is impossible to get a complex table as its walk result may be very very weird.
I will try to post more details later after I heavily improve our MIB parser/compiler. I believe only when the parser is ready and we can extract enough information from MIB documents, we are ready to advance support on SNMP tables.
Stay tuned.
We are going to investigate more in this field, but at first I would like to ask a simple question, "why Net-SNMP does not get a table unless it has the MIB?"
You may wonder why I asked this question, as #SNMP can get such a table even if the MIB is not loaded. I have to confess I underestimate the role of MIB in the past. :(
In fact, SNMP table is a complex thing. When you understand more and more MIB documents, you will notice there are many complex tables who have a lot of indices. Therefore, without an MIB definition, it is impossible to get a complex table as its walk result may be very very weird.
I will try to post more details later after I heavily improve our MIB parser/compiler. I believe only when the parser is ready and we can extract enough information from MIB documents, we are ready to advance support on SNMP tables.
Stay tuned.
Labels:
#SNMP,
.NET,
Open Source
January 25, 2009
#SNMP Design: New Constructors in SNMP Data
Dramatic changes happened today in the repository, but you may not notice. Ha, it is normal because I only touched API you won't use, generally speaking.
This time I started to hide construtors such as public Counter32(byte[]) and expose public Counter32(int, Stream) instead. Why? After a review, I found that all the times, I created new MemoryStream objects from bytes who indirectly come from MemoryStream. So I believe passing MemoryStream directly is better.
Therefore, now everything starts with MemoryStream and ends with bytes, while nobody plays the middle man again.
By the way, now I am enjoying the Chinese spring festival. Simply wish that I could work out a plan for 2.0 release during these days. Stay tuned.
Updated:
You may notice that in our latest repository a lot of methods are removed while new methods added. And a key change is that ISnmpMessage is no longer derived from ISnmpPdu. I consider this a reasonable change as messages are not PDU in fact.
This time I started to hide construtors such as public Counter32(byte[]) and expose public Counter32(int, Stream) instead. Why? After a review, I found that all the times, I created new MemoryStream objects from bytes who indirectly come from MemoryStream. So I believe passing MemoryStream directly is better.
Therefore, now everything starts with MemoryStream and ends with bytes, while nobody plays the middle man again.
By the way, now I am enjoying the Chinese spring festival. Simply wish that I could work out a plan for 2.0 release during these days. Stay tuned.
Updated:
You may notice that in our latest repository a lot of methods are removed while new methods added. And a key change is that ISnmpMessage is no longer derived from ISnmpPdu. I consider this a reasonable change as messages are not PDU in fact.
Labels:
#SNMP,
.NET,
Open Source
January 18, 2009
#SNMP Design: Important License Change for Browser and Compiler
I think MIT is a better choice so let's stop using BSD.
Please notice this change affects our latest source code in the repository. It is a little bit late for TwinTower.
In this way, developers who want to incorporate some of our code into GPL projects may be happy.
The license for our core library remains the same. LGPL 2.1 should be nice.
Please notice this change affects our latest source code in the repository. It is a little bit late for TwinTower.
In this way, developers who want to incorporate some of our code into GPL projects may be happy.
The license for our core library remains the same. LGPL 2.1 should be nice.
Labels:
#SNMP,
.NET,
Open Source
#SNMP Design: The Logic Behind ToBytes and _raw
Well you must notice this thread and my promise there. So in this post I am going to talk about the _raw fields and why they appear in every basic data types.
OK, first do you know that every packets passed during SNMP communication is constructed by raw bytes? It is not hard to understand that because bytes are common entities every programming languages supports. So every objects of ISnmpData has a corresponding raw bytes representation.
Let's start with the simplest type, Null. What is its raw bytes part? {0x05, 0x00}. 05 is Null's type code defined in SNMP, while 00 means this data object has a length of 0. You may notice that Null class does not have a _raw field, as its length is always 0.
Now move on to another type, {0x04. 0x01, 0x61}. What's that? 04 stands for OCTET STRING, so it is an OctetString object, whose length is 1 and the data is 'a' (ASCII value 0x61 or 97). But because OctetString may contain such strings or other data, so it has a _raw field.
The simplest conclusion includes the following key points,
OK, first do you know that every packets passed during SNMP communication is constructed by raw bytes? It is not hard to understand that because bytes are common entities every programming languages supports. So every objects of ISnmpData has a corresponding raw bytes representation.
Let's start with the simplest type, Null. What is its raw bytes part? {0x05, 0x00}. 05 is Null's type code defined in SNMP, while 00 means this data object has a length of 0. You may notice that Null class does not have a _raw field, as its length is always 0.
Now move on to another type, {0x04. 0x01, 0x61}. What's that? 04 stands for OCTET STRING, so it is an OctetString object, whose length is 1 and the data is 'a' (ASCII value 0x61 or 97). But because OctetString may contain such strings or other data, so it has a _raw field.
The simplest conclusion includes the following key points,
- _raw only contains data of this object. In order to generate an object's byte form, you must call ToBytes so type code and length information are added for you.
- If you want to convert byte form to an object, DataFactory class must be used. Constructors that take "raw" only work on data, so never pass in the byte form.
- If no direct conversion between two types is provided, you can simple grab one object's _raw bytes, and pass that to another type's constructor that takes "raw".
Well, don't know if this time I make things clearer. I will soon document this topic in our specifications in a formal way. Stay tuned.
January 17, 2009
#SNMP Design: Here Comes 1.5 Final Release (TwinTower)
Finally it's here . Check it out.
Labels:
#SNMP,
.NET,
Open Source
January 12, 2009
Fast Moving Mozilla
Well, I know I should not talk too much about Firefox 3.1 or Thunderbird simply because they are still Beta. However, I just couldn't help letting you know how much I love the improvements.
Firefox 3.1b2
It is so cool that Firefox adds something Chrome has. I can easily drag a tab to its own window to I don't have to switch between two of them. I believe it is a must-have feature if you have two or more monitors. How I wish other browsers support this useful feature!
Thunderbird 3.0b1
The redesigned user interface is very neat, although the idea always to put a close button on the default tab is surely not something good. Wish they could fix this in the final.
Have to confess that this time they are both very stable. Awesome!
Firefox 3.1b2
It is so cool that Firefox adds something Chrome has. I can easily drag a tab to its own window to I don't have to switch between two of them. I believe it is a must-have feature if you have two or more monitors. How I wish other browsers support this useful feature!
Thunderbird 3.0b1
The redesigned user interface is very neat, although the idea always to put a close button on the default tab is surely not something good. Wish they could fix this in the final.
Have to confess that this time they are both very stable. Awesome!
Labels:
Firefox,
Open Source
January 11, 2009
Label Cloud for Blogger
Well, if you notice that a Label Cloud is added in this blog, you may wonder how to create that. It is simple when you follow such an excellent post. :) Enjoy it.
Now the question is why Google does not provide it as a default widget.
Forgot to share with you something important. Do you know how to tune it so the theme matches? The designer sets the colors in <script> tag, so please feel free to try out by changing the variables there. You may use this nice little tool to pick up colors you like.
Labels:
Google
Compiler Promise from Embarcadero
I still keep an eye on Delphi, though I have already stopped working on Code Beautifier Collection. Therefore, I am quite excited at this announcement . Well, it is a bit weird that such an important announcement is placed in Developer Network as a normal article.
When Gordon Li wrote the famous book 'Borland Legends' (this book only has Chinese edition), he told us a story about the Delphi compiler. Yes, as this compiler was handed over a few great hands, such as Anders Hejlsberg and Danny Thorpe, and its evolution touches multiple platforms (16 bit, 32 bit Windows, Linux, later .NET, and x64 in the future), we cannot consider it an easy to maintain project. (The C++Builder compiler is another story but should be similar.
So what would happen if the announced compiler architecture comes true? I just cannot wait to see it.
When Gordon Li wrote the famous book 'Borland Legends' (this book only has Chinese edition), he told us a story about the Delphi compiler. Yes, as this compiler was handed over a few great hands, such as Anders Hejlsberg and Danny Thorpe, and its evolution touches multiple platforms (16 bit, 32 bit Windows, Linux, later .NET, and x64 in the future), we cannot consider it an easy to maintain project. (The C++Builder compiler is another story but should be similar.
So what would happen if the announced compiler architecture comes true? I just cannot wait to see it.
January 10, 2009
#SNMP Design: Release Notes for 1.5 (TwinTower)
Well, this release takes much longer than we expected even though luckily Steve joined me. But I am sure that it worth the while because finally we have more features implemented in the suite.
The key changes are,
- SNMP v2c support is almost complete. So now we have GET BULK, INFORM and so on in the library.
- Manager component API is adjusted. Finally we have better overloading methods exposed.
- Experimental Agent component API is designed. Although it only provides limited functionalities, you can use it as a start point for your SNMP agent applications.
- Limited thread-safe support is added. Static methods of Manager component are now thread-safe.
- #SNMP MIB Browser is created. It offers basic features so you can load MIB documents and try to manipulate the managed objects.
- #SNMP Library now supports both Visual Studio 2005 and 2008. Experimental support for .NET Compact Framework 3.5 is also added.
- Experimental #SNMP MIB Compiler is created.
- Bug fixes and other enhancements.
I think now we are pretty close to the release date so it is time to publish this information ahead. Stay tuned.
Labels:
#SNMP,
.NET,
Open Source,
Visual Studio
January 01, 2009
#SNMP Design: Experimental CF 3.5 Port
Because of this discussion thread, I think it is time to try .NET CF 3.5 a little bit. Luckily SharpDevelop 3 makes things easier when I don't have Visual Studio non-Express editions at hand. So let's see what I have done.
First, it was easy to create an empty CF 3.5 project in SD3. Then I added all #SNMP Library source files into it. Well, compiling that project provides me a lot of errors and I have tried everything I can imagine to fix,
First, it was easy to create an empty CF 3.5 project in SD3. Then I added all #SNMP Library source files into it. Well, compiling that project provides me a lot of errors and I have tried everything I can imagine to fix,
- Cannot compile because an MSBuild targets file is missing. Installing .NET Compact Framework 3.5 and its Power Toys can help.
- No BackgroundWorker component in CF. To fix it I have to use Mono version of this component.
- UdpClient misses two important methods. To fix this, Mono source code is used again in UdpClientExtensions.cs.
- Socket and UdpClient miss some properties. This time I have to use conditional defines to work around them.
- A few elements are not available. Conditional defines must be used again.
- Some classes are missing. So empty classes (mocks) are created to make sure the source code still compiles.
Therefore, if you want to use this CF port, you may install SD3, .NET Compact Framework 3.5 and its Power Toys at first and then open the CF solution file. At this moment, the only thing missing is how to open and compile this project in Visual Studio. But anyway now you can check out every bits from the repository and have a test. Please feel free to report any bug. :)
Labels:
#SNMP,
.NET,
Microsoft,
Open Source,
SharpDevelop,
Visual Studio
Subscribe to:
Posts (Atom)