Re: During getBulk

This is a discussion on Re: During getBulk within the SNMP Coders forums, part of the Networking and Network Related category; --===============1358494599== Content-Type: multipart/alternative; boundary="----=_Part_56229_2158110.1175210038147" ------=_Part_56229_2158110.1175210038147 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 03-30-2007
Zhang Chuan
 
Posts: n/a
Default Re: During getBulk

--===============1358494599==
Content-Type: multipart/alternative;
boundary="----=_Part_56229_2158110.1175210038147"

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

Hi, I have met the same problem with you. But I have not solve it very well,
I just let it be.
Maybe the reason is the Advenet(you use it, don't you?) will search the
next oid automaticly. So we can do nothing about it. If you do not use
Advenet, the problem will disappear.


On 3/29/07, Senthil Nathan <SNathan@alphion.com> wrote:
>
>
> Hi,
> Greetings to everyone.
>
> Regarding my project , i am using Net Snmp 5.3.0.1
> I have generated the .c code by using mib2c tool with iterator conf
> option.
> The Snmp agent implement like that i wont have the data directly,it will
> be getting by other lower layers.
>
> In the get_first and get_next routines, i am using position coount as my
> loop context.
> Here with i have given the sample code for you reference.
>
> The issue, i have faced, During getBulk query ,i have retrieved all the
> rows from the table e.g 40 rows.
> After that, it will call netsnmp next table handler api.
>
> Any one of you, help me to resolve this issue, so that during getbulk, it
> wont start call another table api.
>
> Here is the sample code...
>
> netsnmp_variable_list *
> ontEqpmtTable_get_first_data_point(void **my_loop_context,
> void **my_data_context,
> netsnmp_variable_list *put_index_data,
> netsnmp_iterator_info *mydata)
> {
> netsnmp_variable_list *vptr;
> ontEqpmtTableEntry* myEntry;
>
> /* We use the positinonal count as our loop context */
> int *position = (int*)malloc(sizeof(int));
> *position = 0;
>
>
> *my_loop_context = position /** XXX */ ;
>
> myEntry = getEqpmtOntIndex();
>
> *my_data_context = (void *)&myEntry[*position] /** XXX */ ;
>
> vptr = put_index_data;
>
> snmp_set_var_value(vptr, (u_char *)&myEntry[*position].ontID,
> sizeof(&myEntry[*position].ontID));
>
> vptr = vptr->next_variable;
>
> return put_index_data;
> }
>
>
> netsnmp_variable_list *
> ontEqpmtTable_get_next_data_point(void **my_loop_context,
> void **my_data_context,
> netsnmp_variable_list *put_index_data,
> netsnmp_iterator_info *mydata)
> {
>
> netsnmp_variable_list *vptr;
> ontEqpmtTableEntry *myEntry;
>
> int *position = (int *) *my_loop_context;
>
> /* make sure we were called correctly */
> if (!position)
> return NULL;
>
> /* go to the next route in the list */
> (*position)++;
>
> printf("Value of position = %d\n",*position);
> /* change for no of rows.....*/
> /* Are we beyond the end? */
> if (*position > 32 )
> {
>
>
> /* End of routes. stop here by returning NULL */
> SNMP_FREE(position);
> *my_loop_context = NULL;
> *my_data_context = NULL;
> free(Eqpmtentry);
> return NULL;
> }
>
> *my_loop_context = position /** XXX */ ;
>
> myEntry = getEqpmtOntIndex();
>
> *my_data_context = (void *)&myEntry[*position] /** XXX */ ;
>
> vptr = put_index_data;
>
> snmp_set_var_value(vptr, (u_char *)&myEntry[*position].ontID,
> sizeof(&myEntry[*position].ontID));
>
> vptr = vptr->next_variable;
>
> return put_index_data;
> }
>
>
>
>
>
>
>
>
> With thanks and Regards,
> D.SenthilNathan
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?p...rge&CID=DEVDEV
> _______________________________________________
> Net-snmp-coders mailing list
> Net-snmp-coders@lists.sourceforge.net
> https://lists.sourceforge.net/lists/...et-snmp-coders
>
>



--
you jump, I jump,she jump 3

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

Hi, I have met the same problem with you. But I have not solve it very well, I just let it be.
<div>&nbsp;</div>
<div>Maybe the reason is the Advenet(you use it,&nbsp;don't &nbsp;you?) will search the next oid automaticly. So we can do nothing about it. If you do not use Advenet, the problem will disappear.</div><br><br>
<div><span class="gmail_quote">On 3/29/07, <b class="gmail_sendername">Senthil Nathan</b> &lt;<a href="mailto:SNathan@alphion.com">SNathan@alphion. com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><br>
<p><font size="2">Hi,<br>Greetings to everyone.<br><br>Regarding my project , i am using Net Snmp <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://5.3.0.1/" target="_blank">5.3.0.1</a><br>I have generated the .c code by using mib2c tool with iterator conf&nbsp; option.
<br>The Snmp agent implement like that i wont have the data directly,it will be getting by other lower layers.<br><br>In the get_first and get_next routines, i am using position coount as my loop context.<br>Here with i have given the sample code for you reference.
<br><br>The issue, i have faced, During getBulk query ,i have retrieved all the rows from the table e.g 40 rows.<br>After that, it will call netsnmp next table handler api.<br><br>Any one of you, help me to resolve this issue, so that during getbulk, it wont start call another table api.
<br><br>Here is the sample code...<br><br>netsnmp_variable_list *<br>ontEqpmtTable_get_first_data_point(void **my_loop_context,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp; void **my_data_context,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp; netsnmp_variable_list *put_index_data,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp; netsnmp_iterator_info *mydata)<br>{&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nb sp;&nbsp; netsnmp_variable_list *vptr;<br>&nbsp;&nbsp;&nbsp; ontEqpmtTableEntry* myEntry;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;<br>&nbsp;&nbsp;&nbsp; /* We use the positinonal count as our loop context */<br>&nbsp;&nbsp;&nbsp; int *position = (int*)malloc(sizeof(int));
<br>&nbsp;&nbsp;&nbsp; *position = 0;<br><br><br>&nbsp;&nbsp;&nbsp; *my_loop_context = position /** XXX */ ;<br><br>&nbsp;&nbsp;&nbsp; myEntry = getEqpmtOntIndex();<br><br>&nbsp;&nbsp;&nbsp; *my_data_context = (void *)&amp;myEntry[*position] /** XXX */ ;<br><br>&nbsp;&nbsp;&nbsp; vptr = put_index_data;
<br><br>&nbsp;&nbsp;&nbsp; snmp_set_var_value(vptr, (u_char *)&amp;myEntry[*position].ontID,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sizeof(&amp;myEntry[*position].ontID));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;<br>&nbsp;&nbsp;&nbsp; vptr = vptr-&gt;next_variable;<br><br>&nbsp;&nbsp;&nbsp; return put_index_data;
<br>}<br><br><br>netsnmp_variable_list *<br>ontEqpmtTable_get_next_data_point(void **my_loop_context,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp; void **my_data_context,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp; netsnmp_variable_list *put_index_data,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp; netsnmp_iterator_info *mydata)<br>{<br>&nbsp;&nbsp;<br>&nbsp;&nbsp; netsnmp_variable_list *vptr;<br>&nbsp;&nbsp; ontEqpmtTableEntry *myEntry;<br><br>&nbsp;&nbsp;&nbsp; int *position = (int *) *my_loop_context;<br><br>&nbsp;&nbsp;&nbsp; /* make sure we were called correctly */
<br>&nbsp;&nbsp;&nbsp; if (!position)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp; return NULL;<br><br>&nbsp;&nbsp;&nbsp; /* go to the next route in the list */<br>&nbsp;&nbsp;&nbsp; (*position)++;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp; printf(&quot;Value of position = %d\n&quot;,*position);<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* change for no of rows.....*/
<br>&nbsp;&nbsp;&nbsp; /* Are we beyond the end? */<br>&nbsp;&nbsp;&nbsp; if (*position &gt; 32 )&nbsp;<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* End of routes.&nbsp; stop here by returning NULL */<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SNMP_FREE(position);<br>&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp; *my_loop_context = NULL;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *my_data_context = NULL;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ; free(Eqpmtentry);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp; return NULL;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; *my_loop_context = position /** XXX */ ;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myEntry = getEqpmtOntIndex();<br><br>&nbsp;&nbsp;&nbsp; *my_data_context = (void *)&amp;myEntry[*position] /** XXX */ ;
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vptr = put_index_data;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nb sp; snmp_set_var_value(vptr, (u_char *)&amp;myEntry[*position].ontID,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sizeof(&amp;myEntry[*position].ontID));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; vptr = vptr-&gt;next_variable;
<br><br>&nbsp;&nbsp;&nbsp; return put_index_data;<br>}<br><br><br><br><br><br><br><b r><br>With thanks and Regards,<br>D.SenthilNathan<br><br><br><br></font></p></div><br>-------------------------------------------------------------------------
<br>Take Surveys. Earn Cash. Influence the Future of IT<br>Join SourceForge.net's Techsay panel and you'll get the chance to share your<br>opinions on IT &amp; business topics through brief surveys-and earn cash<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CI D=DEVDEV" target="_blank">http://www.techsay.com/default.php?p...amp;CID=DEVDEV
</a><br>____________________________________________ ___<br>Net-snmp-coders mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Net-snmp-coders@lists.sourceforge.net">Net-snmp-coders@lists.sourceforge.net
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/net-snmp-coders" target="_blank">https://lists.sourceforge.net/lists/listinfo/net-snmp-coders</a><br><br>
</blockquote></div><br><br clear="all"><br>-- <br>you jump, I jump,she jump 3

------=_Part_56229_2158110.1175210038147--


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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?p...rge&CID=DEVDEV
--===============1358494599==
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

--===============1358494599==--

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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 10:51 PM.


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