Re: Problem with defining custom data type (TEXTUAL-CONVENTION)

Manfred Wassmann <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On Mon, 21 Jan 2008, Dave Shield wrote:

> If you will only have one instance of this "myVersion" value,
> then define two scalar objects - myVersionDigits and
> myVersion.  If you might have multiple instances of these
> values, then you'd define a table with these as the columns.
>
> But part of the "Simple" in SNMP is that it doesn't actually
> support user-defined structures - you've got single instances
> and tables, and nothing else.
>   Any higher-level structuring needs to be imposed on top
> of this, by suitable MIB-specific applications.   As far as the
> MIB and agent are concerned, the version number and the
> state are separate objects.

Hello Dave,

TNX for your answer. I actually have at least two instances of myVersion 
but they have to have different access clauses, so I guess I can't put 
them into one table. I rewrote my MIB to define myVersionDigits and 
myVersionState as seperate entities and it works so far. Yet I wonder why 
I can't combine them into a third entity like it is done in the 
UCD-SNMP-MIB:

logMatchEntry OBJECT-TYPE
         SYNTAX LogMatchEntry
[...]
LogMatchEntry ::=
         SEQUENCE {
                 logMatchIndex
                         Integer32,
[...]

This is accepted by smilint but when I try the following smilint tells
me: "MY-MIB.txt:91: [2] type `MyCompoundVersion' of node
`myVersionNumber' does not resolve to a known base type"

---8<----------------------------------------------------------------------
VersionDigits ::= TEXTUAL-CONVENTION
DISPLAY-HINT "1d.2d.2d"
STATUS current
DESCRIPTION
"A version number composed of a major, minor and patch number."
SYNTAX OCTET STRING (SIZE (5))

VersionState ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION "Release state."
SYNTAX INTEGER {
     unknown(1),
     alpha(8),
     beta(9),
     candidate(10),
     final(11)
}

[...]
myVersion OBJECT IDENTIFIER ::= { myStatus 1 }

myVersionDigits OBJECT-TYPE
SYNTAX VersionDigits
MAX-ACCESS read-only
STATUS     current
DESCRIPTION "My version number major, minor and patch number parts."
::= { myVersion 1 }

myVersionState OBJECT-TYPE
SYNTAX VersionState
MAX-ACCESS read-only
STATUS     current
DESCRIPTION "My version release state."
::= { myVersion 2 }

myVersionNumber OBJECT-TYPE
SYNTAX MyCompoundVersion
MAX-ACCESS read-only
STATUS     current
DESCRIPTION "My complete version number."
::= { myVersion 3 }

MyCompoundVersion ::= SEQUENCE {
     myVersionDigits VersionDigits,
     myVersionState VersionState
}

regards manfred

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.