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

This is a discussion on Re: Problem with defining custom data type (TEXTUAL-CONVENTION) within the SNMP Users forums, part of the Networking and Network Related category; On Mon, 21 Jan 2008, Dave Shield wrote: > If you will only have one instance of this "myVersion&...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-21-2008
Manfred Wassmann
 
Posts: n/a
Default Re: Problem with defining custom data type (TEXTUAL-CONVENTION)

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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:06 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0