On Fri,  5 Nov 2004 11:29:19 +0000 [EMAIL PROTECTED] wrote:
RRP> The netsnmp_index i'm passing to creat_row is something like (i confirmed
RRP> it in a mail on this list):
RRP> 
RRP>     netsnmp_index net_idx;
RRP>     net_idx.oids = (oid *)&intCurField;
RRP>     net_idx.len = sizeof(intCurdField);

The length of the OID is not in bytes, so if there is just a single integer,
the length would be 1, not sizeof(int).


RRP> 1. The value you pass to .oids must be the same that you assign to key
RRP> field? Or just any unique integer?

The oids must be the indexes for the row. This field is used to sort the array
and find rows, so if you use random unqiue values, the rows will be in random
order. This is probably not what you want.

RRP> 2. If it must be the value you assign to the key field, what should i pass
RRP> when the key field is a STING? Is my MIB wrong, to have a key field of
RRP> type string?

You have to set a sub-id for each character. For example, if the string is
"Hi", then:

  oid tmp[3];
  idx.oids = tmp;
  tmp[0] = 2; // length
  tmp[1] = 'H';
  tmp[2] = 'i';


-- 
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

Reply via email to