Re: Index in Table .... request for explanation

"M. Zeeshan - IMS" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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 <[email protected]> wrote:
From: Dave Shield <[email protected]>
Subject: Re: Index in Table .... request for explanation
To: [email protected]
Cc: [email protected]
Date: Friday, 30 January, 2009, 1:52 PM

2009/1/29 M. Zeeshan - IMS <[email protected]>:
> 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
[email protected]
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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.