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; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============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 ----- I get NULL.</div> <div>The related codes is list:</div> <div> </div> <div> printf("\npeter--notePCTable_createEntry ----------begin\n");<br> table_row = notePCTable_createEntry(table_info->indexes->val.string, *NumberTemp, UserTemp, *StatusTemp);<br> printf("\n peter--notePCTable_createEntry ----------end\n"); <br> if (table_row)<br> {<br> /*printf("\npeter--netsnmp_insert_table_row ----------begin\n");<br> & nbsp; netsnmp_insert_table_row(request, table_row); //Here I insert a row to table. But why I get a NULL in the following code? <br> printf("\npeter--netsnmp_insert_table_row ----------end\n");<br> */<br> printf("\npeter--netsnmp_insert_iterator_context 111 ----------begin\n");<br> & nbsp; 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? <br> printf("\npeter--netsnmp_insert_iterator_context ----------end\n");<br> <br>  ; table_entry = (struct notePCTable_entry *) netsnmp_extract_iterator_context(request);<br>&nbs p; if (!table_entry)<br> &n bsp; { <br> &nbs p; printf("\ntable_entry is NULL###########################################\n& quot;);<br> &nb sp; } <br> else<br> &n bsp; {<br> print f("\n#######################table_entry is not NULL###############################\n"); <br> }<br>   ;}<br> else<br> {<br> netsnmp_set_request_error(reqinf o, request, SNMP_ERR_RESOURCEUNAVAILABLE);<br> &nbs p; return SNMP_ERR_NOERROR;<br>   ; }</div> <div> </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> </div> <div>Sincerely</div> <div>Peter</div> <div> </div> <div> </div> <div><br><br> </div> <div><span class="gmail_quote">On 9/5/06, <b class="gmail_sendername">Dave Shield</b> <<a href="mailto:D.T.Shield@csc.liv.ac.uk">D.T.Shield@ csc.liv.ac.uk</a>> 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 <<a href="mailto:chuanzhang@gmail.com">chuanzhang@gmai l.com</a>> wrote:<br> > I think the row can not be avaliable immediately after<br>> netsnmp_table_data_add_row(), but can be avaliable immediately after<br>> netsnmp_insert_table_row(). Am I right?<br><br>That's too simplistic a description. <br>Please see my explanation from yesterday.<br><br>> 1.Why I can not get the table_entry just after netsnmp_insert_table_row() in<br>> MODE_SET_RESERVE2? I can only get NULL.<br><br><Ping><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). 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. 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>> 2.Why I can not remove a table row when I send a remove command by AdventNet<br>> Mib browser?<br><br>No idea - what does the AdventNet "remove command" actually send?<br><br><br><br>> 3.Basicly , when the rowStatus is not createAndGo, eg. active(1), what should<br>> the code do?<br><br>No idea - what does an "active" vs "notInService" 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>> Actually, I have no idea about the rowStatus concept.<br><br>I suggest you get hold a copy of "Understanding SNMP MIBs", 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. 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==-- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|