Hi All, 
  I am trying to extend the net-snmp agent v5.4.1 of net-snmp using the
mib2c.mfd.conf file and have run into 
some problems. I was wondering if anyone might be able to help me out.
The mib file I am trying to implement is 
a "simple" table based mib with a scalar index ( I must also say that if
anyone has an example of such a table that 
has compiled, linked and done some walks/gets/sets then that would be a
great help also -- All the examples that 
I have found use some other mib2c*.conf file and/or a different net-snmp
version). 

Steps I have taken
1) ran the file ( ENTABLE-MIB.txt) thru mib2c and got the resulting
files  -- mib2c -c mib2c.mfd.conf entable 
    Note that I just accepted the defaults given by mib2c 

2) gen the makefile for  the above mib file
-- mib2c  -c mfd-makefile.m2m entable 
3) gen the entable_subagent file
-- mib2c -c subagent.m2c entable 

I also verified that snmptranslate could find and parse my mib file
correcly, and that there were 
no warnings 

i.e. snmptranslate -PW -IR entable 
 
When I try to compile the code, I got errors related to duplicate  (
below ) 

entable_interface.c: In function _ledTable_get_column
entable_interface.c:792: error: duplicate case value
entable_interface.c:774: error: previously used here
entable_interface.c: In function _ledTable_check_column
entable_interface.c:1032: error: duplicate case value
entable_interface.c:998: error: previously used here
entable_interface.c: In function _ledTable_container_col_save
entable_interface.c:2444: warning: pointer targets in passing argument 2
of read_config_save_octet_string differ in signedness
make: *** [entable_interface.o] Error 1
So, I looked in entable_oids.h and LEDINDEX_COLUMN and LED2_COLUMN are
defined as the same value ( huh ???)

 


I am assuming that this is an operator error of some sort. I have
included the ENTABLE-MIB.txt file. 

 

Again, I passed the mib file thru snmptranslate with the -PW options,
and everything seemed OK 

 

Any help appreciated 

 

Thanks 

 

Victor 

 





 

ENTABLE-MIB DEFINITIONS ::= BEGIN

-- MIB of the ENSEIRB School of electrical Engineering

IMPORTS
        enterprises, OBJECT-TYPE              FROM SNMPv2-SMI,
        MODULE-IDENTITY                       FROM SNMPv2-SMI
        MODULE-COMPLIANCE, OBJECT-GROUP       FROM SNMPv2-CONF
        DisplayString                         FROM SNMPv2-TC; 

--
-- A brief description and update information about this mib.
--
entable MODULE-IDENTITY
    LAST-UPDATED "0104010000Z"            -- 01 Apr 2001, midnight
    ORGANIZATION "ENSEIRB"
    CONTACT-INFO "
                  Author:     Patrice Kadionik
                              ENSEIRB, School of Electrical Engineering
                  postal:     PO Box 99
                              33402 TALENCE CEDEX
                              FRANCE
                  email:      [EMAIL PROTECTED]
                  phone:      +33-5-56-84-65-00
                 "
    DESCRIPTION  "MIB for remote control by SNMP
                 "
    ::= { enterprises 9363 }
--    ::= { enterprises 9362 }

--leds               OBJECT IDENTIFIER ::= {  entable 1 }
--reserved           OBJECT IDENTIFIER ::= { entable 2 }

-- added in to re-implement the original functionality of the enseirb module as 
a table 
-- defines the object ledTable, tells what this ledTable is made up of 
-- rows of ledTable are made up of columns which are defined by the object type 
LedEntry 

ledTable OBJECT-TYPE 
         SYNTAX SEQUENCE OF LedEntry 
         MAX-ACCESS not-accessible
         STATUS     current 
         DESCRIPTION 
                           "A list of objects contained within the ledTable. 
                                    Re-implementation of functionality in 
enseirb module"
                ::= { entable 1 }

-- how to describe the ledEntry OBJECT-TYPE 
ledEntry OBJECT-TYPE 
                 SYNTAX      LedEntry 
                 MAX-ACCESS   not-accessible 
                 STATUS      current 
                 DESCRIPTION 
                           " Entry containing management info application to 
led system" 
                 INDEX     {ledIndex }
                 ::= { ledTable 1 }

-- now define the structure of the LedEntry object 
-- members of the LedEntry object are defined after the definition of LedEntry 
object 

LedEntry ::= 
         SEQUENCE {
                           ledIndex    Integer32, 
                           led0        Integer32,
                           led1        Integer32, 
                           led2        Integer32,
                           led3        Integer32,
                           led4        Integer32,
                           led5        Integer32,
                           led6        Integer32, 
                           led7        Integer32,
                           ledDesc     DisplayString
                   }

-- now need to define the structure of the individual objects of the LedEntry 
object 
-- the objects that make up the column of the LedEntry table

ledIndex OBJECT-TYPE 
         SYNTAX  INTEGER { 0..32768}
         MAX-ACCESS read-write
         STATUS current 
         DESCRIPTION 
                   "defines the index into the LedEntry table object. How is 
this settable ??"
                ::= { ledEntry 2 }

led0 OBJECT-TYPE 
      SYNTAX Integer32 {0..1}
          MAX-ACCESS read-write 
          STATUS current 
          DESCRIPTION "Led 0 connected to bit 0 of parallel port. Table 
implementation"
          DEFVAL { 0 } 
          ::= { ledEntry 3 }

led1 OBJECT-TYPE 
      SYNTAX Integer32 {0..1}
          MAX-ACCESS read-write 
          STATUS current 
          DESCRIPTION "Led 1 connected to bit 1 of parallel port. Table 
implementation"
          DEFVAL { 0 } 
          ::= { ledEntry 4 }

led2 OBJECT-TYPE 
      SYNTAX Integer32 {0..1}
          MAX-ACCESS read-write 
          STATUS current 
          DESCRIPTION "Led 2 connected to bit 2 of parallel port. Table 
implementation"
          DEFVAL { 0 } 
          ::= { ledEntry 5 }

led3 OBJECT-TYPE 
      SYNTAX Integer32 {0..1}
          MAX-ACCESS read-write 
          STATUS current 
          DESCRIPTION "Led 3 connected to bit 3 of parallel port. Table 
implementation"
          DEFVAL { 0 } 
          ::= { ledEntry 6 }

led4 OBJECT-TYPE 
      SYNTAX Integer32 {0..1}
          MAX-ACCESS read-write 
          STATUS current 
          DESCRIPTION "Led 4 connected to bit 4 of parallel port. Table 
implementation"
          DEFVAL { 0 } 
          ::= { ledEntry 7 }

led5 OBJECT-TYPE 
      SYNTAX Integer32 {0..1}
          MAX-ACCESS read-write 
          STATUS current 
          DESCRIPTION "Led 5 connected to bit 5 of parallel port. Table 
implementation"
          DEFVAL { 0 } 
          ::= { ledEntry 8 }

led6 OBJECT-TYPE 
      SYNTAX Integer32 {0..1}
          MAX-ACCESS read-write 
          STATUS current 
          DESCRIPTION "Led 6 connected to bit 6 of parallel port. Table 
implementation"
          DEFVAL { 0 } 
          ::= { ledEntry 9 }

led7 OBJECT-TYPE 
      SYNTAX Integer32 {0..1}
          MAX-ACCESS read-write 
          STATUS current 
          DESCRIPTION "Led 6 connected to bit 6 of parallel port. Table 
implementation"
          DEFVAL { 0 } 
          ::= { ledEntry 10 }

ledDesc OBJECT-TYPE 
       SYNTAX DisplayString (SIZE(0..255))
           MAX-ACCESS read-write
           STATUS current 
           DESCRIPTION "Description of this led interface entry. Table 
implementation"
           DEFVAL {""} 
           ::= { ledEntry 11 }

-- end of enseirb table implementation 

END 
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to