hi list!
i created my own MIB file with name TEST-MIB.txt at
/usr/local/share/snmp/mibs
-------------------------------------------------------
TEST-ENTERPRISE-MIB DEFINITIONS ::= BEGIN
IMPORTS
enterprises
FROM RFC1155-SMI
MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
TimeTicks, Counter32, snmpModules, mib-2
FROM SNMPv2-SMI
DisplayString, TestAndIncr, TimeStamp
FROM SNMPv2-TC
MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
FROM SNMPv2-CONF;
-- iso(1).org(3).dod(6).internet(1)
-- |
-- private(4)
-- |
-- enterprises(1)
-- |
-- TEST(100)
-- |
-- ._______________.________________.
-- | |
-- system(1)
--
--
TEST OBJECT IDENTIFIER ::= { enterprises 100 }
TESTsystem OBJECT IDENTIFIER ::= { TEST 1 }
Namesys OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"An administratively-assigned name for this managed
node. By convention, this is the node's fully-qualified
domain name. If the name is unknown, the value is
the zero-length string."
::= { TESTsystem 1 }
END
-------------------------
i compiled it using mib2c command and it generated two files .c and h of
object Namesys.
mib2c -c mib2c.scalar.conf Namesys
i move all files at PATH net-snmp.5.7/agents/mibgroups/mibII.
and run configure command with add module command
./configure --with-mib-module="test/Namesys"
it was okay, then i run make command and i got following errors
--------------------
test/Namesys.c: In function 'handle_Namesys':
test/Namesys.c:43: error: expected expression before ',' token
test/Namesys.c:63: error: expected expression before ')' token
test/Namesys.c:76: error: expected expression before ')' token
test/Namesys.c:83: error: expected expression before ')' token
test/Namesys.c:91: error: expected expression before ')' token
make[2]: *** [test/Namesys.lo] Error 1
make[2]: Leaving directory
`/home/nsl/Downloads/net-snmp-5.7.1.pre1/agent/mibgroup'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/nsl/Downloads/net-snmp-5.7.1.pre1/agent'
make: *** [subdirs] Error 1
----------------------------------------------
I tried to fix above error but i could not. below i pasted mentioned lines
of errror.
line 43 of Namesys.c is switch(reqinfo->mode) {
case MODE_GET:
*snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
/* XXX: a pointer to the scalar's data
*/,
/* XXX: the length of the data in bytes
*/);*
break;
lines no. 63..-65
case MODE_SET_RESERVE2:
/* XXX malloc "undo" storage buffer */
*if (/* XXX if malloc, or whatever, failed: */) {
netsnmp_set_request_error(reqinfo, requests,
SNMP_ERR_RESOURCEUNAVAILABLE);*
}
any one can tell me what is wrong? should i change it in the code generated
by mib2c
Regards
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
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/listinfo/net-snmp-users