Code Search for Developers
 
 
  

bulk__to__next_8c-source.html from net-snmp at Krugle


Show bulk__to__next_8c-source.html syntax highlighted

<!--#set var="section" value="development" -->
<!--#include virtual="/page-top.html" -->
<!-- CONTENT START -->
  <!-- Generated by Doxygen 1.3.9.1 -->

  <div class="qindex">
    <a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class=
    "qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class=
    "qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a> | <a class=
    "qindex" href="examples.html">Examples</a>
  </div>

  <div class="nav">
    <a class="el" href="dir_000003.html">agent</a>&nbsp;/&nbsp;<a class="el" href="dir_000004.html">helpers</a>
  </div>

  <h1>bulk_to_next.c</h1>

  <div class="fragment">
    <pre class="fragment">
00001 <span class="preprocessor">#include &lt;net-snmp/net-snmp-config.h&gt;</span>
00002 
00003 <span class="preprocessor">#if HAVE_STRING_H</span>
00004 <span class="preprocessor">#include &lt;string.h&gt;</span>
00005 <span class="preprocessor">#else</span>
00006 <span class="preprocessor">#include &lt;strings.h&gt;</span>
00007 <span class="preprocessor">#endif</span>
00008 
00009 <span class="preprocessor">#include &lt;net-snmp/net-snmp-includes.h&gt;</span>
00010 <span class="preprocessor">#include &lt;net-snmp/agent/net-snmp-agent-includes.h&gt;</span>
00011 
00012 <span class="preprocessor">#include &lt;net-snmp/agent/bulk_to_next.h&gt;</span>
00013 
00025 <a class="code" href="structnetsnmp__mib__handler__s.html">netsnmp_mib_handler</a> *
<a name="l00026" id="l00026"></a><a class="code" href="group__bulk__to__next.html#ga0">00026</a> <a class="code" href=
"group__bulk__to__next.html#ga0">netsnmp_get_bulk_to_next_handler</a>(<span class="keywordtype">void</span>)
00027 {
00028     <a class="code" href="structnetsnmp__mib__handler__s.html">netsnmp_mib_handler</a> *handler =
00029         <a class="code" href="group__handler.html#ga7">netsnmp_create_handler</a>(<span class=
"stringliteral">"bulk_to_next"</span>,
00030                                netsnmp_bulk_to_next_helper);
00031 
00032     <span class="keywordflow">if</span> (NULL != handler)
00033         handler-&gt;<a class="code" href="structnetsnmp__mib__handler__s.html#o2">flags</a> |= MIB_HANDLER_AUTO_NEXT;
00034 
00035     <span class="keywordflow">return</span> handler;
00036 }
00037 
00040 <span class="keywordtype">void</span>
<a name="l00041" id="l00041"></a><a class="code" href="group__bulk__to__next.html#ga1">00041</a> <a class="code" href=
"group__bulk__to__next.html#ga1">netsnmp_bulk_to_next_fix_requests</a>(<a class="code" href=
"structnetsnmp__request__info__s.html">netsnmp_request_info</a> *requests)
00042 {
00043     <a class="code" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *request;
00044     <span class="comment">/*</span>
00045 <span class="comment">     * update the varbinds for the next request series </span>
00046 <span class="comment">     */</span>
00047     <span class="keywordflow">for</span> (request = requests; request; request = request-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o13">next</a>) {
00048         <span class="keywordflow">if</span> (request-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o10">repeat</a> &gt; 0 &amp;&amp;
00049             request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code"
href="structvariable__list.html#o3">type</a> != ASN_NULL &amp;&amp;
00050             request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code"
href="structvariable__list.html#o3">type</a> != ASN_PRIV_RETRY &amp;&amp;
00051             request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code"
href="structvariable__list.html#o0">next_variable</a> ) {
00052             request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#o10">repeat</a>--;
00053             snmp_set_var_objid(request-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code" href=
"structvariable__list.html#o0">next_variable</a>,
00054                                request-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code" href="structvariable__list.html#o1">name</a>,
00055                                request-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code" href="structvariable__list.html#o2">name_length</a>);
00056             request-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o0">requestvb</a> = request-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code" href=
"structvariable__list.html#o0">next_variable</a>;
00057             request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code"
href="structvariable__list.html#o3">type</a> = ASN_PRIV_RETRY;
00058         }
00059     }
00060 }
00061 
00063 <span class="keywordtype">int</span>
00064 netsnmp_bulk_to_next_helper(<a class="code" href="structnetsnmp__mib__handler__s.html">netsnmp_mib_handler</a> *handler,
00065                             <a class="code" href=
"structnetsnmp__handler__registration__s.html">netsnmp_handler_registration</a> *reginfo,
00066                             <a class="code" href=
"structnetsnmp__agent__request__info__s.html">netsnmp_agent_request_info</a> *reqinfo,
00067                             <a class="code" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *requests)
00068 {
00069 
00070     <span class="keywordtype">int</span>             ret = SNMP_ERR_NOERROR;
00071 
00072     <span class="comment">/*</span>
00073 <span class="comment">     * this code depends on AUTO_NEXT being set</span>
00074 <span class="comment">     */</span>
00075     netsnmp_assert(handler-&gt;<a class="code" href=
"structnetsnmp__mib__handler__s.html#o2">flags</a> &amp; MIB_HANDLER_AUTO_NEXT);
00076 
00077     <span class="comment">/*</span>
00078 <span class="comment">     * don't do anything for any modes besides GETBULK. Just return, and</span>
00079 <span class="comment">     * the agent will call the next handler (AUTO_NEXT).</span>
00080 <span class="comment">     *</span>
00081 <span class="comment">     * for GETBULK, we munge the mode, call the next handler ourselves</span>
00082 <span class="comment">     * (setting AUTO_NEXT_OVERRRIDE so the agent knows what we did),</span>
00083 <span class="comment">     * restore the mode and fix up the requests.</span>
00084 <span class="comment">     */</span>
00085     <span class="keywordflow">if</span>(MODE_GETBULK == reqinfo-&gt;<a class="code" href=
"structnetsnmp__agent__request__info__s.html#o0">mode</a>) {
00086 
00087         DEBUGIF(<span class="stringliteral">"bulk_to_next"</span>) {
00088             <a class="code" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *req = requests;
00089             <span class="keywordflow">while</span>(req) {
00090                 DEBUGMSGTL((<span class="stringliteral">"bulk_to_next"</span>, <span class=
"stringliteral">"Got request: "</span>));
00091                 DEBUGMSGOID((<span class="stringliteral">"bulk_to_next"</span>, req-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code" href="structvariable__list.html#o1">name</a>,
00092                              req-&gt;<a class="code" href=
"structnetsnmp__request__info__s.html#o0">requestvb</a>-&gt;<a class="code" href=
"structvariable__list.html#o2">name_length</a>));
00093                 DEBUGMSG((<span class="stringliteral">"bulk_to_next"</span>, <span class="stringliteral">"\n"</span>));
00094                 req = req-&gt;<a class="code" href="structnetsnmp__request__info__s.html#o13">next</a>;
00095             }
00096         }
00097 
00098         reqinfo-&gt;<a class="code" href="structnetsnmp__agent__request__info__s.html#o0">mode</a> = MODE_GETNEXT;
00099         ret =
00100             <a class="code" href=
"group__handler.html#ga17">netsnmp_call_next_handler</a>(handler, reginfo, reqinfo, requests);
00101         reqinfo-&gt;<a class="code" href="structnetsnmp__agent__request__info__s.html#o0">mode</a> = MODE_GETBULK;
00102 
00103         <span class="comment">/*</span>
00104 <span class="comment">         * update the varbinds for the next request series </span>
00105 <span class="comment">         */</span>
00106         <a class="code" href="group__bulk__to__next.html#ga1">netsnmp_bulk_to_next_fix_requests</a>(requests);
00107 
00108         <span class="comment">/*</span>
00109 <span class="comment">         * let agent handler know that we've already called next handler</span>
00110 <span class="comment">         */</span>
00111         handler-&gt;<a class="code" href=
"structnetsnmp__mib__handler__s.html#o2">flags</a> |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
00112     }
00113 
00114     <span class="keywordflow">return</span> ret;
00115 }
00116 
00121 <span class="keywordtype">void</span>
<a name="l00122" id="l00122"></a><a class="code" href="group__bulk__to__next.html#ga3">00122</a> <a class="code" href=
"group__debug.html#ga6">netsnmp_init_bulk_to_next_helper</a>(<span class="keywordtype">void</span>)
00123 {
00124     <a class="code" href="group__handler.html#ga36">netsnmp_register_handler_by_name</a>(<span class=
"stringliteral">"bulk_to_next"</span>,
00125                                      <a class="code" href=
"group__bulk__to__next.html#ga0">netsnmp_get_bulk_to_next_handler</a>());
00126 }
</pre>
  </div>
  <hr size="1" />

  <address style="align: right;">
    <small>Generated on Fri Dec 30 13:47:44 2005 for net-snmp by&nbsp; <a href="http://www.doxygen.org/index.html"><img src=
    "doxygen.png" alt="doxygen" align="middle" border="0" /></a> 1.3.9.1</small>
  </address>
<!-- CONTENT END -->
<!--#include virtual="/page-bottom.html" -->





See more files for this project here

net-snmp

net-snmp provides tools and libraries relating to the Simple Network\r\nManagement Protocol including: An extensible agent, An SNMP library,\r\ntools to request or set information from SNMP agents, tools to\r\ngenerate and handle SNMP traps, etc.\r\n

Project homepage: http://sourceforge.net/projects/net-snmp
Programming language(s): C,Perl,Shell Script
License: other

  mfd/
  acconfig_8h-source.html
  acconfig_8h.html
  agent_2snmp__perl_8c-source.html
  agent__callbacks_8h-source.html
  agent__callbacks_8h.html
  agent__handler_8c-source.html
  agent__handler_8c.html
  agent__handler_8h-source.html
  agent__handler_8h.html
  agent__index_8c-source.html
  agent__index_8c.html
  agent__index_8h-source.html
  agent__index_8h.html
  agent__module__config_8h-source.html
  agent__read__config_8c-source.html
  agent__read__config_8c.html
  agent__read__config_8h-source.html
  agent__read__config_8h.html
  agent__registry_8c-source.html
  agent__registry_8c.html
  agent__registry_8h-source.html
  agent__registry_8h.html
  agent__trap_8c-source.html
  agent__trap_8c.html
  agent__trap_8h-source.html
  agent__trap_8h.html
  all__helpers_8c-source.html
  all__helpers_8h-source.html
  annotated.html
  asn1_8c-source.html
  asn1_8h-source.html
  auto__nlist_8c-source.html
  auto__nlist_8c.html
  auto__nlist_8h-source.html
  auto__nlist_8h.html
  autonlist_8h-source.html
  autonlist_8h.html
  baby__steps_8c-source.html
  baby__steps_8h-source.html
  blah.html
  bulk__to__next_8c-source.html
  bulk__to__next_8h-source.html
  cache__handler_8c-source.html
  cache__handler_8h-source.html
  callback_8c-source.html
  callback_8h-source.html
  check__varbind_8c-source.html
  check__varbind_8h-source.html
  cmu__compat_8c-source.html
  cmu__compat_8h-source.html
  config_8h-source.html
  config_8h.html
  config__api_8h-source.html
  container_8c-source.html
  container_8h-source.html
  container__binary__array_8c-source.html
  container__binary__array_8h-source.html
  container__iterator_8c-source.html
  container__iterator_8h-source.html
  container__list__ssll_8c-source.html
  container__list__ssll_8h-source.html
  container__null_8c-source.html
  container__null_8h-source.html
  data__list_8c-source.html
  data__list_8h-source.html
  data__set_8c-example.html
  data__set_8c-source.html
  data__set_8h-source.html
  debug__handler_8c-source.html
  debug__handler_8h-source.html
  default__store_8c-source.html
  default__store_8h-source.html
  default_store.html
  definitions_8h-source.html
  delayed__instance_8c-example.html
  delayed__instance_8c-source.html
  delayed__instance_8h-source.html
  deprecated.html
  dir_000000.html
  dir_000001.html
  dir_000002.html
  dir_000003.html
  dir_000004.html
  dir_000005.html
  dir_000006.html
  dir_000007.html
  dir_000008.html
  doxygen.css
  doxygen.gif
  doxygen.png
  ds__agent_8h-source.html
  ds__agent_8h.html
  example_8c-source.html
  example_8h-source.html
  examples.html
  factory_8h-source.html
  fd__event__manager_8c-source.html
  fd__event__manager_8h-source.html
  file__utils_8c-source.html
  file__utils_8h-source.html
  files.html