[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-users
Subject:    problem adding a new row usig data_set
From:       niepa inter <yanniepa () yahoo ! com>
Date:       2009-09-24 15:21:33
Message-ID: 356983.42167.qm () web56503 ! mail ! re3 ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi folks,

I have add difficulties adding a new row from the default row I already have. 
Basically I would like to have a "oid.COLUMN_SENSE1.1" and "oid.COLUMN_SENSE1.2"
but I can only make the first.
I have tried to do another netsnmp_create_table_data_row(); and repeat the process \
below but it does not work. 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~



      


[Attachment #5 (text/html)]

<html><head><style type="text/css"><!-- DIV {margin:0px;} \
--></style></head><body><div style="font-family:times new roman,new \
york,times,serif;font-size:12pt">Hi folks,<br><br>I have add difficulties adding a \
new row from the default row I already have. <br>Basically I would like to have a \
"oid.COLUMN_SENSE1.1" and "oid.COLUMN_SENSE1.2"<br>but I can only make the \
first.<br>I have tried to do another netsnmp_create_table_data_row(); and repeat the \
process below but it does not work.<br>Any idea ? Thanks<br><br>Here is my \
snippet:<br><br>.<br>.<br>&nbsp;&nbsp;&nbsp; netsnmp_table_dataset_add_row(table_set, \
row);<br><br>&nbsp;&nbsp;&nbsp; row = \
netsnmp_create_table_data_row();<br>&nbsp;&nbsp;&nbsp; \
netsnmp_table_row_add_index(row, ASN_INTEGER, &amp;pkt-&gt;index, \
sizeof(pkt-&gt;index));<br>&nbsp;&nbsp;&nbsp; netsnmp_table_row_add_index(row, \
ASN_INTEGER, &amp;pkt-&gt;index, sizeof(pkt-&gt;index));<br><br>&nbsp;&nbsp;&nbsp; \
current_index =  1;<br><br>&nbsp;&nbsp;&nbsp; \
while(current_index&lt;=COLUMN_SENSE1)<br>&nbsp;&nbsp;&nbsp; \
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
switch(current_index)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
{<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case \
COLUMN_SENSEINDEX:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
{<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
netsnmp_set_row_column(row, COLUMN_SENSEINDEX, ASN_INTEGER, (char*) \
&amp;pkt-&gt;senseIndex, sizeof(pkt-&gt;senseIndex));<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
netsnmp_mark_row_column_writable(row, COLUMN_SENSEINDEX, 0);<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; case COLUMN_SENSE1:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;  \
&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; netsnmp_set_row_column(row, COLUMN_SENSE1, ASN_OCTET_STR, \
pkt-&gt;senseText, strlen(pkt-&gt;senseText));<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
netsnmp_mark_row_column_writable(row, COLUMN_SENSE1, 1);<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
current_index++;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; \
netsnmp_table_dataset_add_row(table_set, \
row);<br>.<br>.<br>.<br><br>Yan~<br></div><br>

      </body></html>



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; 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&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf

_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic