SNMP Subagent Programmer's Guide
Static Directory Program
2-34 119728—SNMP Subagent Programmer’s Guide
Programming Tutorials
Example 2-5. Static Directory MIB Definition
#include "typessmi"
 STATIC-DIRECTORY-TABLE DEFINITIONS ::= BEGIN
 private OBJECT IDENTIFIER ::= { iso(1) org(3) dod(6) internet(1) 4 }
 enterprises OBJECT IDENTIFIER ::= { private 1 }
 peer OBJECT IDENTIFIER ::= { enterprises 442 }
--Within the 'peer' arc, entire subtrees are dedicated to the following
 peer-products OBJECT IDENTIFIER ::= { peer 1 }
 peer-demos OBJECT IDENTIFIER ::= { peer 2 }
 staticdir OBJECT IDENTIFIER ::= { peer-demos 3 }
 -- the table group has one attribute of its own - the number of rows 
 -- in the contained table. It also contains the table of names.
 dirName OBJECT-TYPE
 SYNTAX DisplayString (SIZE (0..255))
 ACCESS read-only
 C_STRUCT directory, FIELD dir_name
 STATUS mandatory
 DESCRIPTION
 "The name of the directory from which the fileEntry
 table was build at the time this application was 
 started."
 ::= { staticdir 1 }
 dirFiles OBJECT-TYPE
 SYNTAX SEQUENCE OF FileEntry
 ACCESS not-accessible
 STATUS mandatory
 ::= { staticdir 2 }
 fileEntry OBJECT-TYPE
 SYNTAX FileEntry
 ACCESS not-accessible
 STATUS mandatory
 INDEX { fileName }
 ::= { dirFiles 1 }
 FileEntry ::=
 SEQUENCE {
 fileName
 DisplayString
 }
 fileName OBJECT-TYPE
 SYNTAX DisplayString (SIZE (0..255))
 ACCESS read-only
 C_STRUCT file_entry, FIELD file_name
 STATUS mandatory
 DESCRIPTION
 "The name of one of the files in the directory."
 ::= { fileEntry 1 }
 END










