Thanx Alot Dave, that really cleared every thing i had in mind.

Thanx Mike as well.

Regards.

- Muhammad Zeeshan


--- On Fri, 30/1/09, Dave Shield <d.t.shi...@liverpool.ac.uk> wrote:
From: Dave Shield <d.t.shi...@liverpool.ac.uk>
Subject: Re: Index in Table .... request for explanation
To: m.zees...@advancedims.com
Cc: net-snmp-users@lists.sourceforge.net
Date: Friday, 30 January, 2009, 1:52 PM

2009/1/29 M. Zeeshan - IMS <m.zees...@advancedims.com>:
> 3. when i generated code using mib2c with
"mib2c.create-dataset.conf" file,
> then the indexing was done with the function
> "netsnmp_table_set_add_indexes()", while the example in
data_set.c uses the
> function "netsnmp_table_row_add_index()" a bit earlier in the
code, whats
> the difference between these two functions.


netsnmp_table_set_add_indexes() is used to define the structure of the
 indexing foe the table as a whole.   It takes a list of types - specifying
 what sort of index is used for this table.

netsnmp_table_row_add_index() is used to specify the actual indexing
  for a particular row of this table.  It takes a list of *values* - which
  should match the type(s) specified in  netsnmp_table_set_add_indexes()

So you might have:

     /* myTable1 */
     netsnmp_table_set_add_indexes(  table, ASN_INTEGER,  /* End of
index list */ 0 );
     netsnmp_table_row_add_index(    row,    ASN_INTEGER, /* Row # */ 4 );

Or

     /* myTable2 */
     netsnmp_table_set_add_indexes(  table, ASN_OCTET_STR,
ASN_OCTET_STR, /* End of index list */ 0 );
     netsnmp_table_row_add_index(    row,    ASN_OCTET_STR, /*  first
index value */ "this" );
     netsnmp_table_row_add_index(    row,    ASN_OCTET_STR, /* second
index value */ "that" );


The first table would include objects indexed using      myTable1Column.4
The second table would include objects indexed using
myTable2Column."this"."that"

OK?

Dave

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
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




      Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com. 
http://mail.promotions.yahoo.com/newdomains/aa/
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
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

Reply via email to