Forewords
Sharp SNMP Suite (#SNMP) is a suite of SNMP tools consisting of open source code primarily targeting freelance developers who cannot afford expensive commercial products.
(TODO)
Chapter One: Suite Overview
Time after time, new pieces were added to this suite. Now four major pieces on the road map are the Library, the Browser, the Compiler, and a few command line utilities.
The Library, is the core component of this suite, which provides an open source implementation of SNMP protocol. It enables other components in the suite to send and receive SNMP messages.
The Browser, is a useful component that displays managed objects extracted from MIB documents. It also offers a simple way to do SNMP operations with configured devices.
The Compiler, is an individual components that manipulates MIB documents. It helps detect errors in MIB documents and parses managed objects into a format that the Browser understands.
Picture 1. Suite Components
Chapter Two: The Library
1 Overview
The Library is designed to be used in all kinds of applications such as WinForms (including .NET Compact Framework), ASP.NET, and WPF* running on Microsoft .NET and Novell Mono platforms.
*not including Silverlight as SL3 lacks a lot of socket support that #SNMP relies on
It can be separated first into two parts, Messaging and MIB. The Messaging part focuses on SNMP messages while the MIB part focuses on SNMP MIB documents.
2 Messaging Part
The Messaging part can be further divided into three layers each of which contains a group of related classes and interfaces. The three layers are, Data, Message, and Component.
Picture 3. Three Layers in Messaging
2.1 Data Layer
SNMP protocol defines a lot of basic data types to construct messages. These types are,
OCTET STRING (OctetString.cs)
INTEGER (Integer32.cs)
TimeTicks (TimeTicks.cs)
COUNTER (Counter32.cs)
GAUGE (Gauge32.cs)
IP Address (IP.cs)
NULL (Null.cs)
Object Identifier (ObjectIdentifier.cs)
Opaque (Opaque.cs)
Counter64 (Counter64.cs)
All types are defined since SNMP v1 except Counter64 (Counter64 is added in SNMP v2c). NULL is a special type and mainly used in request messages.
There are other special types named exceptions defined in SNMP v2c. They are,
End of MIB view (EndOfMibView.cs)
No such instance (NoSuchInstance.cs)
No such object (NoSuchObject.cs)
All these types implement a useful interface, ISnmpData (ISnmpData.cs).
2.2 Message Layer
In this layer we provide a few useful data containers are,
SEQUENCE (Sequence.cs)
SNMP PDU (*Pdu.cs)
SNMP messages (*Message.cs)
Sequence container is used to group up basic data types to variable bindings. PDU containers are used to form SNMP PDU. Message containers are used to construct complete SNMP messages.
PDU classes implement the ISnmpPdu interface (ISnmpPdu.cs) while message classes implement ISnmpMessage interface (ISnmpMessage.cs). ISnmpPdu is derived from ISnmpData.
2.3 Component Layer
Only two components are categorized into this layer. They are Manager and Agent. Both of them are Component descendent.
2.4 Connectors
OK, the layers can be connected in a few cases. For example, when there is an incoming message, some classes must be responsible to decompose it into smaller elements. The decomposition process involves all elements in the three layers. So the message factory (SnmpMessageFactory.cs) and data factory (SnmpDataFactory.cs) stand out.
3 MIB Part
This part can also be roughly divided into three groups. They are, MIB Constructs, Parser Related and Tree Related.
3.1 MIB Constructs
These classes all implement IContruct interface (IConstruct.cs). Most of them are place holders because of current parser/compiler design. The key classes all implement IEntity interface (IEntity.cs) and can be used to construct the object tree. Of course, IEntity is derived from IConstruct.
3.2 Parser Related
Classes in this group are so useful that they consume MIB documents and produce data structures that represent those managed objects. Some classes represent MIB documents and modules defined in the documents, such as MibDocument (MibDocument.cs) and MibModule (MibModule.cs). Lexer (Lexer.cs) is a class that decomposes a MIB document into small Symbol instances (Symbol.cs). The Parser class (Parser.cs) combines all above classes together.
3.3 Assembler/Tree Related
The ObjectTree class (ObjectTree.cs) holds all managed objects known. These objects are instances of Definition class (Definition.cs). Surely the Definition objects are generated from IEntity instances. The Assembler class is used to assemble all objects into the tree.
3.4 Others
ObjectRegistry is another important class in other #SNMP components. It behaviours as a Façade for all other MIB classes.
Chapter Three: The Browser
The #SNMP MIB Browser is used to load compiled MIB modules into an object repository. Then you can use the GUI to manage those objects on your SNMP agent.
The Panels
The Internals
Chapter Four: The Compiler
Well, this is not a single compiler such as csc.exe but a complete IDE for MIB document authoring.
The Panels
The Internals