problem creating rows with data-set
niepa inter <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I have generated a code for snmp using mib-2c (data-set). It works, howerver it won't let me add additional column to the predefined ones. Let say I have the oid ".1.2.3.4.COLUMN_SENSE1". I can add a row to it and I obtain ".1.2.3.4.COLUMN_SENSE1.1" but I don't have a way to add and additional column with for example oid ".1.2.3.4.COLUMN_SENSE1.2" that will follow directly the previous oid while remaining in the same table.
I have tried to do another netsnmp_create_table_data_row(); and repeat the process below but it does not work. It just add row an additional row to the oid and I end up with something like this : ".1.2.3.4.COLUMN_SENSE1.1.1". I have part of my code below.
Any idea ? Thanks
Here is my snippet:
.
.
netsnmp_table_dataset_add_row(table_set, row);
row = netsnmp_create_table_data_row();
netsnmp_table_row_add_index(row, ASN_INTEGER, &pkt->index, sizeof(pkt->index));
netsnmp_table_row_add_index(row, ASN_INTEGER, &pkt->index, sizeof(pkt->index));
current_index = 1;
while(current_index<=COLUMN_SENSE1)
{
switch(current_index)
{
case COLUMN_SENSEINDEX:
{
netsnmp_set_row_column(row, COLUMN_SENSEINDEX, ASN_INTEGER,
(char*) &pkt->senseIndex, sizeof(pkt->senseIndex));
netsnmp_mark_row_column_writable(row, COLUMN_SENSEINDEX, 0);
break;
}
case COLUMN_SENSE1:
{
netsnmp_set_row_column(row, COLUMN_SENSE1, ASN_OCTET_STR, pkt->senseText, strlen(pkt->senseText));
netsnmp_mark_row_column_writable(row, COLUMN_SENSE1, 1);
break;
}
}
current_index++;
}
netsnmp_table_dataset_add_row(table_set, row);
.
.
.
Yan~
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
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