On Mon, 15 Nov 2004 16:05:03 +0100 Paolo wrote:
PC> I have myTable with 2 index: my Number and myName.
PC> myTableEntry OBJECT-TYPE
PC> INDEX { myNumber, myName }
PC> ::= { myTable 1 }
PC>
PC> where the 2 index types are:
PC> myNumber Unsigned32
PC> myName myString
PC> I have implemented the init_myTable to support the double index:
PC> void init_myTable(void) {
PC> myTable_context *ctx;
PC> netsnmp_index index;
PC> oid index_oid[2];
PC> int i1;
PC>
PC> index.len = 2;
PC> index_oid[0] = 1;
PC> index_oid[1] = 1;
Strings must have a length. Your first index ([0]) is fine for an integer, but
your second index ([1]) is the problem. The 1 will be interpreted as the
length of the string, but there no string following the length. Try this:
oid index_oid[3];
index.len = 2;
index_oid[0] = 1;
index_oid[1] = 1;
index_oid[2] = 'a';
Or simply set index_oid[1] to 0, to indicate a zero length string.
--
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders