Re: CreateAndGot(4) and CreateAndWait(5) problem

This is a discussion on Re: CreateAndGot(4) and CreateAndWait(5) problem within the SNMP Coders forums, part of the Networking and Network Related category; --===============0772162864== Content-Type: multipart/alternative; boundary="----=_Part_184498_6541082.1157499075476" ------=_Part_184498_6541082.1157499075476 Content-Type: text/plain; charset=ISO-8859-1; ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-06-2006
Zhang Chuan
 
Posts: n/a
Default Re: CreateAndGot(4) and CreateAndWait(5) problem

--===============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 <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
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div>Thank you for your detail description!</div>
<div>For the first question, I have tried netsnmp_insert_iterator_context. But unfortunately, it doesn't work yet&nbsp;-----&nbsp;I get NULL.</div>
<div>The related codes is list:</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;printf(&quot;\npeter--notePCTable_createEntry ----------begin\n&quot;);<br>&nbsp;&nbsp;&nbsp;table_row = notePCTable_createEntry(table_info-&gt;indexes-&gt;val.string, *NumberTemp, UserTemp, *StatusTemp);<br>&nbsp;&nbsp;&nbsp;printf(&quot;\n peter--notePCTable_createEntry ----------end\n&quot;);
<br>&nbsp;&nbsp;&nbsp;if (table_row)<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp; &nbsp;&nbsp;/*printf(&quot;\npeter--netsnmp_insert_table_row ----------begin\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp; &nbsp;netsnmp_insert_table_row(request, table_row);&nbsp;//Here I insert a row to table. But why I get a NULL in the following code?
<br>&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;\npeter--netsnmp_insert_table_row ----------end\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;\npeter--netsnmp_insert_iterator_context 111 ----------begin\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp; &nbsp;netsnmp_insert_iterator_context (request, (void *)table_row);&nbsp;//Here I insert a row to table. But why I get a NULL in the following code?
<br>&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;\npeter--netsnmp_insert_iterator_context&nbsp; ----------end\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp ;&nbsp;&nbsp;&nbsp;table_entry = (struct notePCTable_entry *) netsnmp_extract_iterator_context(request);<br>&nbs p;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;if (!table_entry)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp; &nbsp;{
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;printf(&quot;\ntable_entry is NULL###########################################\n& quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;}&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&n bsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print f(&quot;\n#######################table_entry is not NULL###############################\n&quot;);
<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp ;}<br>&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;netsnmp_set_request_error(reqinf o, request, SNMP_ERR_RESOURCEUNAVAILABLE);<br>&nbsp;&nbsp;&nbs p;&nbsp; &nbsp;&nbsp;&nbsp;return SNMP_ERR_NOERROR;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp; &nbsp;}</div>
<div>&nbsp;</div>
<div>I wonder if there are some other things that I should do? </div>
<div>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?</div>
<div>Thank you very much!</div>
<div>&nbsp;</div>
<div>Sincerely</div>
<div>Peter</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 9/5/06, <b class="gmail_sendername">Dave Shield</b> &lt;<a href="mailto:D.T.Shield@csc.liv.ac.uk">D.T.Shield@ csc.liv.ac.uk</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On 05/09/06, Zhang Chuan &lt;<a href="mailto:chuanzhang@gmail.com">chuanzhang@gmai l.com</a>&gt; wrote:<br>
&gt; I think the row can not be avaliable immediately after<br>&gt; netsnmp_table_data_add_row(), but can be avaliable immediately after<br>&gt; netsnmp_insert_table_row(). Am I right?<br><br>That's too simplistic a description.
<br>Please see my explanation from yesterday.<br><br>&gt; 1.Why I can not get the table_entry just after netsnmp_insert_table_row() in<br>&gt; MODE_SET_RESERVE2? I can only get NULL.<br><br>&lt;Ping&gt;<br>I've just clicked what the problem is.
<br>You're using the table_iterator helper (and<br>'netsnmp_extract_iterator_context' gives the row to work with).&nbsp;&nbsp; But<br>you're not using the matching 'netsnmp_insert_iterator_context' call.<br><br>netsnmp_insert_table_row belongs to a completely different helper, so
<br>it's not surprising that the iterator doesn't know about it.<br><br>You can't mix different table helpers.&nbsp;&nbsp;If you're using the iterator<br>helper, then use the API calls that belong to it - don't start<br>throwing in calls from a different helper.
<br><br><br>&gt; 2.Why I can not remove a table row when I send a remove command by AdventNet<br>&gt; Mib browser?<br><br>No idea - what does the AdventNet &quot;remove command&quot; actually send?<br><br><br><br>&gt; 3.Basicly
, when the rowStatus is not createAndGo, eg. active(1), what should<br>&gt; the code do?<br><br>No idea - what does an &quot;active&quot; vs &quot;notInService&quot; row mean in the<br>context of this table?<br>I checked the descriptions in the MIB file, and they were even less
<br>helpfuil than normal!<br><br>&gt;&nbsp;&nbsp; Actually, I have no idea about the rowStatus concept.<br><br>I suggest you get hold a copy of &quot;Understanding SNMP MIBs&quot;, and read<br>the section on row creation in that.<br>
<br>In the meantime, you're probably better off ignoring most of the<br>RowStatus behaviour, and just work with 'createAndGo(4)' and<br>'destroy(6)' values.&nbsp;&nbsp;That's sufficient for basic operation, until you<br>can teach yourself the full details.
<br><br>Dave<br></blockquote></div><br><br clear="all"><br>-- <br>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==--

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:02 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0