Re: NET SNMP Sub agent Row of multiple indexes

Ashish vashishtha <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
yes you are right.

before calling netsnmp_table_data_add_row() i am calling
netsnmp_table_row_add_index twice.

        netsnmp_table_row *row;
        row = netsnmp_create_table_data_row();
        netsnmp_table_row_add_index(row, ASN_GAUGE,&nIndex,sizeof(nIndex));
       netsnmp_table_row_add_index(row,
ASN_GAUGE,&componentId,sizeof(componentId));
       netsnmp_table_dataset_add_row(table_set,row);

Now in the handler function of the table how i can get the two indices ?

row = netsnmp_extract_table_row(requests); will return the row.

in this row i am unable to find the two indices, i am only able to see one
index(row->index_oid).

 can we have two index of same type in a table?


Regards
Ashish




On Fri, Mar 5, 2010 at 4:01 PM, Dave Shield <[email protected]>wrote:

> On 5 March 2010 09:55, Ashish vashishtha <[email protected]>
> wrote:
> > for adding the row to the table i am using netsnmp_table_row_add_index
> > function.
> >
> > netsnmp_table_row_add_index(row,ASN_GAUGE,&Index,sizeof(Index))
>
> No.
>     netsnmp_table_row_add_index()  is used to define the indexing
> for this row of the table.
>
>   It does *not* itself add a new row to the table. That's handled by
> netsnmp_table_data_add_row()
>
>
> > Now i want to add one more index to the same row before adding it to the
> > table.
> >
> > How I can achieve the same.
>
> Call netsnmp_table_row_add_index()  twice, before adding the row.
> See mibgroup/testhandler.c  which does precisely this.
>
> Dave
>



-- 
Regards
Ashish Vashishtha

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

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