--===============0772162864==
Content-Type: multipart/alternative;
boundary="----=_Part_184498_6541082.1157499075476"

------=_Part_184498_6541082.1157499075476
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Thank you for your detail description!
For the first question, I have tried netsnmp_insert_iterator_context. But
unfortunately, it doesn't work yet ----- I get NULL.
The related codes is list:

printf("\npeter--notePCTable_createEntry ----------begin\n");
table_row = notePCTable_createEntry(table_info->indexes->val.string,
*NumberTemp, UserTemp, *StatusTemp);
printf("\npeter--notePCTable_createEntry ----------end\n");
if (table_row)
{
/*printf("\npeter--netsnmp_insert_table_row ----------begin\n");
netsnmp_insert_table_row(request, table_row); //Here I insert a
row to table. But why I get a NULL in the following code?
printf("\npeter--netsnmp_insert_table_row ----------end\n");
*/
printf("\npeter--netsnmp_insert_iterator_context 111
----------begin\n");
netsnmp_insert_iterator_context (request, (void
*)table_row); //Here I insert a row to table. But why I get a NULL in the
following code?
printf("\npeter--netsnmp_insert_iterator_context ----------end\n");

table_entry = (struct notePCTable_entry *)
netsnmp_extract_iterator_context(request);
if (!table_entry)
{
printf("\ntable_entry is
NULL###########################################\n");
}
else
{
printf("\n#######################table_entry is not
NULL###############################\n");
}
}
else
{
netsnmp_set_request_error(reqinfo, request,
SNMP_ERR_RESOURCEUNAVAILABLE);
return SNMP_ERR_NOERROR;
}

I wonder if there are some other things that I should do?
And, when I use mib2c.iterate.conf to generate my code. The
netsnmp_insert_table_row is generated automaticly. If this function is not
compatible to mib2c.iterate.conf, why it can be generated?
Thank you very much!

Sincerely
Peter





On 9/5/06, Dave Shield wrote:
>
> On 05/09/06, Zhang Chuan wrote:
> > I think the row can not be avaliable immediately after
> > netsnmp_table_data_add_row(), but can be avaliable immediately after
> > netsnmp_insert_table_row(). Am I right?

>
> That's too simplistic a description.
> Please see my explanation from yesterday.
>
> > 1.Why I can not get the table_entry just after

> netsnmp_insert_table_row() in
> > MODE_SET_RESERVE2? I can only get NULL.

>
>
> I've just clicked what the problem is.
> You're using the table_iterator helper (and
> 'netsnmp_extract_iterator_context' gives the row to work with). But
> you're not using the matching 'netsnmp_insert_iterator_context' call.
>
> netsnmp_insert_table_row belongs to a completely different helper, so
> it's not surprising that the iterator doesn't know about it.
>
> You can't mix different table helpers. If you're using the iterator
> helper, then use the API calls that belong to it - don't start
> throwing in calls from a different helper.
>
>
> > 2.Why I can not remove a table row when I send a remove command by

> AdventNet
> > Mib browser?

>
> No idea - what does the AdventNet "remove command" actually send?
>
>
>
> > 3.Basicly, when the rowStatus is not createAndGo, eg. active(1), what

> should
> > the code do?

>
> No idea - what does an "active" vs "notInService" row mean in the
> context of this table?
> I checked the descriptions in the MIB file, and they were even less
> helpfuil than normal!
>
> > Actually, I have no idea about the rowStatus concept.

>
> I suggest you get hold a copy of "Understanding SNMP MIBs", and read
> the section on row creation in that.
>
> In the meantime, you're probably better off ignoring most of the
> RowStatus behaviour, and just work with 'createAndGo(4)' and
> 'destroy(6)' values. That's sufficient for basic operation, until you
> can teach yourself the full details.
>
> Dave
>




--
you jump, I jump,she jump 3

------=_Part_184498_6541082.1157499075476
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Thank you for your detail description!

For the first question, I have tried netsnmp_insert_iterator_context. But unfortunately, it doesn't work yet ----- I get NULL.

The related codes is list:

 

   printf("\npeter--notePCTable_createEntry ----------begin\n");
   table_row = notePCTable_createEntry(table_info->indexes->val.string, *NumberTemp, UserTemp, *StatusTemp);
   printf("\npeter--notePCTable_createEntry ----------end\n");

   if (table_row)
   {
    /*printf("\npeter--netsnmp_insert_table_row ----------begin\n");
          netsnmp_insert_table_row(request, table_row); //Here I insert a row to table. But why I get a NULL in the following code?

    printf("\npeter--netsnmp_insert_table_row ----------end\n");
    */
    printf("\npeter--netsnmp_insert_iterator_context 111 ----------begin\n");
          netsnmp_insert_iterator_context (request, (void *)table_row); //Here I insert a row to table. But why I get a NULL in the following code?

    printf("\npeter--netsnmp_insert_iterator_context  ----------end\n");
    
    table_entry = (struct notePCTable_entry *) netsnmp_extract_iterator_context(request);
        if (!table_entry)
          {

                   printf("\ntable_entry is NULL###########################################\n" );
           }  
    else
    {
     printf("\n#######################table_en try is not NULL###############################\n");

    }
   }
   else
   {
        netsnmp_set_request_error(reqinfo, request, SNMP_ERR_RESOURCEUNAVAILABLE);
        return SNMP_ERR_NOERROR;
         }

 

I wonder if there are some other things that I should do?

And, when I use mib2c.iterate.conf to generate my code. The netsnmp_insert_table_row is generated automaticly. If this function is not compatible to mib2c.iterate.conf, why it can be generated?

Thank you very much!

 

Sincerely

Peter

 

 



 

On 9/5/06, Dave Shield <.T.Shield@csc.liv.ac.uk">D.T.Shield@csc.liv.ac.uk> wrote:
On 05/09/06, Zhang Chuan <chuanzhang@gmail.com> wrote:

> I think the row can not be avaliable immediately after
> netsnmp_table_data_add_row(), but can be avaliable immediately after
> netsnmp_insert_table_row(). Am I right?

That's too simplistic a description.

Please see my explanation from yesterday.

> 1.Why I can not get the table_entry just after netsnmp_insert_table_row() in
> MODE_SET_RESERVE2? I can only get NULL.

<Ping>
I've just clicked what the problem is.

You're using the table_iterator helper (and
'netsnmp_extract_iterator_context' gives the row to work with).   But
you're not using the matching 'netsnmp_insert_iterator_context' call.

netsnmp_insert_table_row belongs to a completely different helper, so

it's not surprising that the iterator doesn't know about it.

You can't mix different table helpers.  If you're using the iterator
helper, then use the API calls that belong to it - don't start
throwing in calls from a different helper.



> 2.Why I can not remove a table row when I send a remove command by AdventNet
> Mib browser?

No idea - what does the AdventNet "remove command" actually send?



> 3.Basicly
, when the rowStatus is not createAndGo, eg. active(1), what should
> the code do?

No idea - what does an "active" vs "notInService" row mean in the
context of this table?
I checked the descriptions in the MIB file, and they were even less

helpfuil than normal!

>   Actually, I have no idea about the rowStatus concept.

I suggest you get hold a copy of "Understanding SNMP MIBs", and read
the section on row creation in that.


In the meantime, you're probably better off ignoring most of the
RowStatus behaviour, and just work with 'createAndGo(4)' and
'destroy(6)' values.  That's sufficient for basic operation, until you
can teach yourself the full details.


Dave



--
you jump, I jump,she jump 3

------=_Part_184498_6541082.1157499075476--


--===============0772162864==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=...057&dat=121642
--===============0772162864==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--===============0772162864==--