Hello!

I need table within a table. After searching the web, I learned that this is not possible.

Originaly I want something like this:

+--devices(2)
  |
  +--satTable(1)
  |  |
  |  +--satEntry(1)
  |     |  Index: satIndex
  |     |
  |     +-- -R-- Integer32 satIndex(1)
  |     |        Textual Convention: SatIndex
  |     |        Range: 1..2147483647
  |     +-- -R-- String    satName(2)
  |     |        Textual Convention: DisplayString
  |     |        Size: 0..255
  |     +-- -R-- INTEGER   satStatus(3)
  |     |
  |     +-- cameras (4)
  |         |
            +--camTable(1)
               |
               +--camEntry(1)
                  |  Index: camIndex
                  |
                  +-- -R-- Integer32 camIndex(1)
                  |        Textual Convention: CamIndex
                  |        Range: 1..2147483647
                  +-- -R-- String    camName(2)
                  |        Textual Convention: DisplayString
                  |        Size: 0..255
                  +-- -R-- INTEGER   camStatus(3)

Instead of that I tried to use two indexe. I hope the MIB (see below) is correct for this.
But when I try to generate code with mib2c (v 5.57) I get an error:

I called: mib2c devices
I answered the following choises:
- tables where the list of rows is external to the agent
- An API layer ... This API is also known as "MIBs for Dummies"

Now I get:
        using the mib2c.mfd.conf configuration file to
        generate your code.
This module can only be used with tables, not branches or entire MIBs.
Please specify and OID that is a table. (OID: devices)
y:/diva3/tools/usr/share/snmp//mib2c.mfd.conf:25 contained a line that started with a @ but did not match any mib2c configuration tokens.
(maybe missing the trailing @?)
writing to devices.h
| +-> Processing table satTable

- Set defaults now [DEFAULT]
- No, use generated [DEFAULT]
- container-cached : [DEFAULT]
- Yes. My data is TRANSIENT
- generate example code [DEFAULT]

Now I get the error.

writing to default-table-satTable.m2d
writing to default-node-satName.m2d
writing to default-node-satStatus.m2d
writing to default-node-satIndex.m2d
| +-> Processing table camTable
Can't find a configuration file called default-table-camTable.m2d
(referenced at y:/diva3/tools/usr/share/snmp/mib2c-data/m2c_setup_table.m2i:54)


Below the part of my MIB:

maku MODULE-IDENTITY
   ...
::= { enterprises 6261 }

divapro         OBJECT IDENTIFIER ::= { maku 3 }
devices         OBJECT IDENTIFIER ::= { divapro 2 }

   SatIndex ::= TEXTUAL-CONVENTION
       DISPLAY-HINT "d"
       STATUS       current
       DESCRIPTION  "A unique value, greater than zero"
       SYNTAX       Integer32 (1..2147483647)

   CamIndex ::= TEXTUAL-CONVENTION
       DISPLAY-HINT "d"
       STATUS       current
       DESCRIPTION  "A unique value, greater than zero"
       SYNTAX       Integer32 (1..2147483647)

   SatelliteEntry ::= SEQUENCE
   {
       satIndex    SatIndex,
       satName     DisplayString,
       satStatus   Integer32
   }

   satTable        OBJECT-TYPE
                       SYNTAX      SEQUENCE OF SatelliteEntry
                       MAX-ACCESS  not-accessible
                       STATUS      current
                       DESCRIPTION "A list of satellite entries. "
                   ::= { devices 1 }

   satEntry        OBJECT-TYPE
                       SYNTAX      SatelliteEntry
                       MAX-ACCESS  not-accessible
                       STATUS      current
                       DESCRIPTION "A satellite"
                       INDEX   { satIndex }
                   ::= { satTable 1 }
satIndex OBJECT-TYPE
                       SYNTAX      SatIndex
                       MAX-ACCESS  read-only
                       STATUS      current
DESCRIPTION "A unique value, greater than zero, for each satellite."
                   ::= { satEntry 1 }

   satName         OBJECT-TYPE
                       SYNTAX      DisplayString (SIZE (0..255))
                       MAX-ACCESS  read-only
                       STATUS      current
                       DESCRIPTION "Name of the satellite"
                   ::= { satEntry 2 }
satStatus OBJECT-TYPE
                       SYNTAX      Integer32
                       MAX-ACCESS  read-only
                       STATUS      current
                       DESCRIPTION "Status of the satellite"
                   ::= { satEntry 3 }
-- <SatCameras> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

   CameraEntry ::= SEQUENCE
   {
       camIndex    CamIndex,
       camName     DisplayString,
       camStatus   Integer32
   }

   camTable        OBJECT-TYPE
                       SYNTAX      SEQUENCE OF CameraEntry
                       MAX-ACCESS  not-accessible
                       STATUS      current
                       DESCRIPTION "A list of camera entries. "
                   ::= { devices 2 }

   camEntry        OBJECT-TYPE
                       SYNTAX      CameraEntry
                       MAX-ACCESS  not-accessible
                       STATUS      current
                       DESCRIPTION "A camera"
                       INDEX   { camIndex, satIndex }
                   ::= { camTable 1 }

   camIndex        OBJECT-TYPE
                       SYNTAX      CamIndex
                       MAX-ACCESS  read-only
                       STATUS      current
DESCRIPTION "A unique value, greater than zero, for each camera."
                   ::= { camEntry 1 }

   camName         OBJECT-TYPE
                       SYNTAX      DisplayString (SIZE (0..255))
                       MAX-ACCESS  read-only
                       STATUS      current
                       DESCRIPTION "Name of the camera"
                   ::= { camEntry 2 }
camStatus OBJECT-TYPE
                       SYNTAX      Integer32
                       MAX-ACCESS  read-only
                       STATUS      current
                       DESCRIPTION "Status of the camera"
                   ::= { camEntry 3 }





--


MfG,
Andreas Dunke




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to