Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to define a subtree as a type in snmp?

Status
Not open for further replies.

KeJaHe

Programmer
Jan 3, 2014
1
0
0
NL
I would like to create an ASN1 definition of a tree, as a type. So I can assign this type to more than one node. If I could do that, I could create multiple, complex tree-shaped definitions (including tables), while only having to define them once. I need this, because I have a set number of complex-functions performing network interfaces, and I imagine it to look something like this (pseudo ASN1):

-- This is where I'm going to hang multiple trees under, defined once
fooInterfaces ::= oid { enterprises.foo 1 }

-- Type definition of the tree; I don't know how this step works
MyTreeType ::= oid

-- The contents of the tree (partly)

mtu ::= Unsigned32 { MyTreeType 1 }

macAddress ::= OCTET STRING { MyTreeType 2 }

ipaddressTable ::= sequence of etc. { MyTreeType 3 }

arpTable ::= sequence of etc. { MyTreeType 4 }

-- Hanging the above trees under the endpoint

interface1 ::= MyTreeType { fooInterfaces 1 }

interface2 ::= MyTreeType { fooInterfaces 2 }

Addressing the mtu for interface1 would then be as simple as enterprises.foo.1.1.1.0; MAC address for interface2 would be enterprises.foo.1.2.2.0, etc.

I don't see any way that ASN1 now allows for this kind of definition, but I'm a relative noob, so if you have some advice (other than 'you shouldn't want to do that') I'd really appreciate it.

KJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top