Current File : //usr/share/doc/net-snmp/html/netSnmpHostsTable_8c_source.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>net-snmp: netSnmpHostsTable.c Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">net-snmp
   &#160;<span id="projectnumber">5.4.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">netSnmpHostsTable.c</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Note: this file originally auto-generated by mib2c using</span>
<a name="l00003"></a>00003 <span class="comment"> *        : mib2c.iterate_access.conf,v 1.4 2003/07/01 00:15:11 hardaker Exp $</span>
<a name="l00004"></a>00004 <span class="comment"> */</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;net-snmp/net-snmp-config.h&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;net-snmp/net-snmp-includes.h&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;net-snmp/agent/net-snmp-agent-includes.h&gt;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;netSnmpHostsTable.h&quot;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;netSnmpHostsTable_checkfns.h&quot;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;netSnmpHostsTable_access.h&quot;</span>
<a name="l00012"></a>00012 
<a name="l00013"></a>00013 <span class="keyword">static</span> <a class="code" href="structnetsnmp__oid__stash__node__s.html">netsnmp_oid_stash_node</a> *undoStorage = NULL;
<a name="l00014"></a>00014 <span class="keyword">static</span> <a class="code" href="structnetsnmp__oid__stash__node__s.html">netsnmp_oid_stash_node</a> *commitStorage = NULL;
<a name="l00015"></a>00015 
<a name="l00016"></a><a class="code" href="structundoInfo.html">00016</a> <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> {
<a name="l00017"></a>00017     <span class="keywordtype">void</span>           *ptr;
<a name="l00018"></a>00018     <span class="keywordtype">size_t</span>          len;
<a name="l00019"></a>00019 };
<a name="l00020"></a>00020 
<a name="l00021"></a><a class="code" href="structcommitInfo.html">00021</a> <span class="keyword">struct </span><a class="code" href="structcommitInfo.html">commitInfo</a> {
<a name="l00022"></a>00022     <span class="keywordtype">void</span>           *data_context;
<a name="l00023"></a>00023     <span class="keywordtype">int</span>             have_committed;
<a name="l00024"></a>00024     <span class="keywordtype">int</span>             new_row;
<a name="l00025"></a>00025 };
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keywordtype">void</span>
<a name="l00028"></a>00028 netSnmpHostsTable_free_undoInfo(<span class="keywordtype">void</span> *vptr)
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui = vptr;
<a name="l00031"></a>00031     <span class="keywordflow">if</span> (!ui)
<a name="l00032"></a>00032         <span class="keywordflow">return</span>;
<a name="l00033"></a>00033     <a class="code" href="group__util.html#ga951e93edb6f0ea941e26155e3f8912a6" title="Frees a pointer only if it is !NULL and sets its value to NULL.">SNMP_FREE</a>(ui-&gt;ptr);
<a name="l00034"></a>00034     <a class="code" href="group__util.html#ga951e93edb6f0ea941e26155e3f8912a6" title="Frees a pointer only if it is !NULL and sets its value to NULL.">SNMP_FREE</a>(ui);
<a name="l00035"></a>00035 }
<a name="l00036"></a>00036 
<a name="l00038"></a>00038 <span class="keywordtype">void</span>
<a name="l00039"></a>00039 initialize_table_netSnmpHostsTable(<span class="keywordtype">void</span>)
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041     <span class="keyword">static</span> oid      netSnmpHostsTable_oid[] =
<a name="l00042"></a>00042         { 1, 3, 6, 1, 4, 1, 8072, 2, 2, 2 };
<a name="l00043"></a>00043     <a class="code" href="structnetsnmp__table__registration__info__s.html" title="Table registration structure.">netsnmp_table_registration_info</a> *table_info;
<a name="l00044"></a>00044     <a class="code" href="structnetsnmp__handler__registration__s.html" title="Root registration info.">netsnmp_handler_registration</a> *my_handler;
<a name="l00045"></a>00045     <a class="code" href="structnetsnmp__iterator__info__s.html" title="Holds iterator information containing functions which should be called by the iterator_handler to loo...">netsnmp_iterator_info</a> *iinfo;
<a name="l00046"></a>00046 
<a name="l00048"></a>00048     table_info = <a class="code" href="group__util.html#ga9cd013bb193de5048149afeb9d94e424" title="Mallocs memory of sizeof(t), zeros it and returns a pointer to it.">SNMP_MALLOC_TYPEDEF</a>(<a class="code" href="structnetsnmp__table__registration__info__s.html" title="Table registration structure.">netsnmp_table_registration_info</a>);
<a name="l00049"></a>00049     iinfo = <a class="code" href="group__util.html#ga9cd013bb193de5048149afeb9d94e424" title="Mallocs memory of sizeof(t), zeros it and returns a pointer to it.">SNMP_MALLOC_TYPEDEF</a>(<a class="code" href="structnetsnmp__iterator__info__s.html" title="Holds iterator information containing functions which should be called by the iterator_handler to loo...">netsnmp_iterator_info</a>);
<a name="l00050"></a>00050 
<a name="l00053"></a>00053     my_handler = netsnmp_create_handler_registration(<span class="stringliteral">&quot;netSnmpHostsTable&quot;</span>,
<a name="l00054"></a>00054                                                      netSnmpHostsTable_handler,
<a name="l00055"></a>00055                                                      netSnmpHostsTable_oid,
<a name="l00056"></a>00056                                                      OID_LENGTH
<a name="l00057"></a>00057                                                      (netSnmpHostsTable_oid),
<a name="l00058"></a>00058                                                      HANDLER_CAN_RWRITE);
<a name="l00059"></a>00059 
<a name="l00060"></a>00060     <span class="keywordflow">if</span> (!my_handler || !table_info || !iinfo) {
<a name="l00061"></a>00061         <a class="code" href="group__snmp__logging.html#ga9ba905368ea1c551b969af44b13e37c2" title="This snmp logging function allows variable argument list given the specified format and priority...">snmp_log</a>(LOG_ERR,
<a name="l00062"></a>00062                  <span class="stringliteral">&quot;malloc failed in initialize_table_netSnmpHostsTable&quot;</span>);
<a name="l00063"></a>00063         <span class="keywordflow">return</span>; 
<a name="l00064"></a>00064     }
<a name="l00065"></a>00065 
<a name="l00066"></a>00066     <span class="comment">/***************************************************</span>
<a name="l00067"></a>00067 <span class="comment">     * Setting up the table&#39;s definition</span>
<a name="l00068"></a>00068 <span class="comment">     */</span>
<a name="l00069"></a>00069     netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR,
<a name="l00071"></a>00071                                      0);
<a name="l00072"></a>00072 
<a name="l00075"></a>00075     table_info-&gt;<a class="code" href="structnetsnmp__table__registration__info__s.html#ae48fd51376f573a4c4e5aede809f7092" title="the minimum columns number.">min_column</a> = 2;
<a name="l00076"></a>00076     table_info-&gt;<a class="code" href="structnetsnmp__table__registration__info__s.html#a4b7f37faafced959b943e974ba58e008" title="the maximum columns number">max_column</a> = 5;
<a name="l00077"></a>00077 
<a name="l00079"></a>00079     iinfo-&gt;<a class="code" href="structnetsnmp__iterator__info__s.html#a98224fb1d34bf8794bc2e45eab33ce56" title="Responsible for: returning the first set of &quot;index&quot; data, a loop-context pointer, and optionally a da...">get_first_data_point</a> = netSnmpHostsTable_get_first_data_point;
<a name="l00080"></a>00080     iinfo-&gt;<a class="code" href="structnetsnmp__iterator__info__s.html#a9df181621eb551784037a5bfbea1e9a0" title="Given the previous loop context, this should return the next loop context, associated index set and o...">get_next_data_point</a> = netSnmpHostsTable_get_next_data_point;
<a name="l00081"></a>00081 
<a name="l00083"></a>00083     iinfo-&gt;<a class="code" href="structnetsnmp__iterator__info__s.html#a17fbe4838bb67d1d1a7f6cfbdf6750ba" title="If a data context wasn&#39;t supplied by the get_first_data_point or get_next_data_point functions and th...">make_data_context</a> = netSnmpHostsTable_context_convert_function;
<a name="l00084"></a>00084     iinfo-&gt;<a class="code" href="structnetsnmp__iterator__info__s.html#a21a0de492a8c6986be23bce6061c08a0" title="Frees a data context.">free_data_context</a> = netSnmpHostsTable_data_free;
<a name="l00085"></a>00085     iinfo-&gt;<a class="code" href="structnetsnmp__iterator__info__s.html#a79677e673db89809584498816821d1b0" title="Frees a loop context at the end of the entire iteration sequence.">free_loop_context_at_end</a> = netSnmpHostsTable_loop_free;
<a name="l00086"></a>00086 
<a name="l00088"></a>00088     iinfo-&gt;<a class="code" href="structnetsnmp__iterator__info__s.html#a2322feee30ec894a07007d2fa43fc5f2" title="A pointer to the netsnmp_table_registration_info object this iterator is registered along with...">table_reginfo</a> = table_info;
<a name="l00089"></a>00089 
<a name="l00090"></a>00090     <span class="comment">/***************************************************</span>
<a name="l00091"></a>00091 <span class="comment">     * registering the table with the master agent</span>
<a name="l00092"></a>00092 <span class="comment">     */</span>
<a name="l00093"></a>00093     DEBUGMSGTL((<span class="stringliteral">&quot;initialize_table_netSnmpHostsTable&quot;</span>,
<a name="l00094"></a>00094                 <span class="stringliteral">&quot;Registering table netSnmpHostsTable as a table iterator\n&quot;</span>));
<a name="l00095"></a>00095     <a class="code" href="group__table__iterator.html#ga3f10f7be6c67bed6f7284bdfe13c6a23" title="Creates and registers a table iterator helper handler calling netsnmp_create_handler with a handler n...">netsnmp_register_table_iterator</a>(my_handler, iinfo);
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097 
<a name="l00099"></a>00099 <span class="keywordtype">void</span>
<a name="l00100"></a>00100 init_netSnmpHostsTable(<span class="keywordtype">void</span>)
<a name="l00101"></a>00101 {
<a name="l00102"></a>00102 
<a name="l00104"></a>00104     initialize_table_netSnmpHostsTable();
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106 
<a name="l00108"></a>00108 <span class="keywordtype">int</span>
<a name="l00109"></a>00109 netSnmpHostsTable_handler(<a class="code" href="structnetsnmp__mib__handler__s.html" title="the mib handler structure to be registered">netsnmp_mib_handler</a> *handler,
<a name="l00110"></a>00110                           <a class="code" href="structnetsnmp__handler__registration__s.html" title="Root registration info.">netsnmp_handler_registration</a> *reginfo,
<a name="l00111"></a>00111                           <a class="code" href="structnetsnmp__agent__request__info__s.html" title="The agent transaction request structure.">netsnmp_agent_request_info</a> *reqinfo,
<a name="l00112"></a>00112                           <a class="code" href="structnetsnmp__request__info__s.html" title="The netsnmp request info structure.">netsnmp_request_info</a> *requests)
<a name="l00113"></a>00113 {
<a name="l00114"></a>00114 
<a name="l00115"></a>00115     <a class="code" href="structnetsnmp__request__info__s.html" title="The netsnmp request info structure.">netsnmp_request_info</a> *request;
<a name="l00116"></a>00116     <a class="code" href="structnetsnmp__table__request__info__s.html" title="The table request info structure.">netsnmp_table_request_info</a> *table_info;
<a name="l00117"></a>00117     <a class="code" href="structvariable__list.html" title="The netsnmp variable list binding structure, it&#39;s typedef&#39;d to netsnmp_variable_list.">netsnmp_variable_list</a> *var;
<a name="l00118"></a>00118     <span class="keyword">struct </span><a class="code" href="structcommitInfo.html">commitInfo</a> *ci = NULL;
<a name="l00119"></a>00119 
<a name="l00120"></a>00120     <span class="keywordtype">void</span>           *data_context = NULL;
<a name="l00121"></a>00121 
<a name="l00122"></a>00122     oid            *suffix;
<a name="l00123"></a>00123     <span class="keywordtype">size_t</span>          suffix_len;
<a name="l00124"></a>00124 
<a name="l00125"></a>00125     <span class="keywordflow">for</span> (request = requests; request; request = request-&gt;next) {
<a name="l00126"></a>00126         <span class="comment">/* column and row index encoded portion */</span>
<a name="l00127"></a>00127         var = request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>;
<a name="l00128"></a>00128         suffix     = var-&gt;<a class="code" href="structvariable__list.html#a7b5bdda01921550d24ea53033ce76146" title="Object identifier of variable.">name</a> + reginfo-&gt;rootoid_len + 1;
<a name="l00129"></a>00129         suffix_len = var-&gt;<a class="code" href="structvariable__list.html#a089e5b1a422bf8e693510ff5408a57a7" title="number of subid&#39;s in name">name_length</a> - (reginfo-&gt;rootoid_len + 1);
<a name="l00130"></a>00130 
<a name="l00131"></a>00131         <span class="keywordflow">if</span> (request-&gt;processed != 0)
<a name="l00132"></a>00132             <span class="keywordflow">continue</span>;
<a name="l00133"></a>00133 
<a name="l00134"></a>00134         <span class="keywordflow">switch</span> (reqinfo-&gt;mode) {
<a name="l00135"></a>00135         <span class="keywordflow">case</span> MODE_GET:
<a name="l00136"></a>00136         <span class="keywordflow">case</span> MODE_SET_RESERVE1:
<a name="l00137"></a>00137             data_context = <a class="code" href="group__table__iterator.html#ga10027da7b08c561e38845bfc20659a41" title="extracts the table_iterator specific data from a request.">netsnmp_extract_iterator_context</a>(request);
<a name="l00138"></a>00138             <span class="keywordflow">if</span> (data_context == NULL) {
<a name="l00139"></a>00139                 <span class="keywordflow">if</span> (reqinfo-&gt;mode == MODE_GET) {
<a name="l00140"></a>00140                     <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request,
<a name="l00141"></a>00141                                               SNMP_NOSUCHINSTANCE);
<a name="l00142"></a>00142                     <span class="keywordflow">continue</span>;
<a name="l00143"></a>00143                 }
<a name="l00144"></a>00144             }
<a name="l00145"></a>00145             <span class="keywordflow">break</span>;
<a name="l00146"></a>00146 
<a name="l00147"></a>00147         <span class="keywordflow">default</span>:               <span class="comment">/* == the other SET modes */</span>
<a name="l00148"></a>00148             ci = <a class="code" href="group__oid__stash.html#ga19552f5190110ab8d5e2fe1488039f3a" title="returns a data pointer associated with a given OID.">netsnmp_oid_stash_get_data</a>(commitStorage,
<a name="l00149"></a>00149                                             suffix + 1, suffix_len - 1);
<a name="l00150"></a>00150             <span class="keywordflow">break</span>;
<a name="l00151"></a>00151 
<a name="l00152"></a>00152         }
<a name="l00153"></a>00153 
<a name="l00155"></a>00155         table_info = <a class="code" href="group__table.html#ga0f2aa788814b909e3e3003b63b1dbd3a" title="Extracts the processed table information from a given request.">netsnmp_extract_table_info</a>(request);
<a name="l00161"></a>00161         <span class="keywordflow">if</span> (table_info == NULL) {
<a name="l00162"></a>00162             <span class="keywordflow">continue</span>;
<a name="l00163"></a>00163         }
<a name="l00164"></a>00164 
<a name="l00165"></a>00165         <span class="keywordflow">switch</span> (reqinfo-&gt;mode) {
<a name="l00166"></a>00166         <span class="keywordflow">case</span> MODE_GET:
<a name="l00167"></a>00167             <span class="keywordflow">switch</span> (table_info-&gt;<a class="code" href="structnetsnmp__table__request__info__s.html#afbed55ce9b6c75a98fafc84559462b34" title="0 if OID not long enough">colnum</a>) {
<a name="l00168"></a>00168             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTADDRESSTYPE:
<a name="l00169"></a>00169                 {
<a name="l00170"></a>00170                     <span class="keywordtype">long</span>           *retval;
<a name="l00171"></a>00171                     <span class="keywordtype">size_t</span>          retval_len = 0;
<a name="l00172"></a>00172                     retval =
<a name="l00173"></a>00173                         get_netSnmpHostAddressType(data_context,
<a name="l00174"></a>00174                                                    &amp;retval_len);
<a name="l00175"></a>00175                     <a class="code" href="group__snmp__client.html#ga63bee067f8a29d6454d96630e5e225a7" title="snmp_set_var_typed_value is used to set data into the netsnmp_variable_list structure.">snmp_set_var_typed_value</a>(var, ASN_INTEGER,
<a name="l00176"></a>00176                                              (<span class="keyword">const</span> u_char *) retval,
<a name="l00177"></a>00177                                              retval_len);
<a name="l00178"></a>00178                 }
<a name="l00179"></a>00179                 <span class="keywordflow">break</span>;
<a name="l00180"></a>00180 
<a name="l00181"></a>00181             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTADDRESS:
<a name="l00182"></a>00182                 {
<a name="l00183"></a>00183                     <span class="keywordtype">char</span>           *retval;
<a name="l00184"></a>00184                     <span class="keywordtype">size_t</span>          retval_len = 0;
<a name="l00185"></a>00185                     retval =
<a name="l00186"></a>00186                         get_netSnmpHostAddress(data_context, &amp;retval_len);
<a name="l00187"></a>00187                     <a class="code" href="group__snmp__client.html#ga63bee067f8a29d6454d96630e5e225a7" title="snmp_set_var_typed_value is used to set data into the netsnmp_variable_list structure.">snmp_set_var_typed_value</a>(var, ASN_OCTET_STR,
<a name="l00188"></a>00188                                              (<span class="keyword">const</span> u_char *) retval,
<a name="l00189"></a>00189                                              retval_len);
<a name="l00190"></a>00190                 }
<a name="l00191"></a>00191                 <span class="keywordflow">break</span>;
<a name="l00192"></a>00192 
<a name="l00193"></a>00193             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTSTORAGE:
<a name="l00194"></a>00194                 {
<a name="l00195"></a>00195                     <span class="keywordtype">long</span>           *retval;
<a name="l00196"></a>00196                     <span class="keywordtype">size_t</span>          retval_len = 0;
<a name="l00197"></a>00197                     retval =
<a name="l00198"></a>00198                         get_netSnmpHostStorage(data_context, &amp;retval_len);
<a name="l00199"></a>00199                     <a class="code" href="group__snmp__client.html#ga63bee067f8a29d6454d96630e5e225a7" title="snmp_set_var_typed_value is used to set data into the netsnmp_variable_list structure.">snmp_set_var_typed_value</a>(var, ASN_INTEGER,
<a name="l00200"></a>00200                                              (<span class="keyword">const</span> u_char *) retval,
<a name="l00201"></a>00201                                              retval_len);
<a name="l00202"></a>00202                 }
<a name="l00203"></a>00203                 <span class="keywordflow">break</span>;
<a name="l00204"></a>00204 
<a name="l00205"></a>00205             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTROWSTATUS:
<a name="l00206"></a>00206                 {
<a name="l00207"></a>00207                     <span class="keywordtype">long</span>           *retval;
<a name="l00208"></a>00208                     <span class="keywordtype">size_t</span>          retval_len = 0;
<a name="l00209"></a>00209                     retval =
<a name="l00210"></a>00210                         get_netSnmpHostRowStatus(data_context,
<a name="l00211"></a>00211                                                  &amp;retval_len);
<a name="l00212"></a>00212                     <a class="code" href="group__snmp__client.html#ga63bee067f8a29d6454d96630e5e225a7" title="snmp_set_var_typed_value is used to set data into the netsnmp_variable_list structure.">snmp_set_var_typed_value</a>(var, ASN_INTEGER,
<a name="l00213"></a>00213                                              (<span class="keyword">const</span> u_char *) retval,
<a name="l00214"></a>00214                                              retval_len);
<a name="l00215"></a>00215                 }
<a name="l00216"></a>00216                 <span class="keywordflow">break</span>;
<a name="l00217"></a>00217 
<a name="l00218"></a>00218             <span class="keywordflow">default</span>:
<a name="l00220"></a>00220                 <a class="code" href="group__snmp__logging.html#ga9ba905368ea1c551b969af44b13e37c2" title="This snmp logging function allows variable argument list given the specified format and priority...">snmp_log</a>(LOG_ERR,
<a name="l00221"></a>00221                          <span class="stringliteral">&quot;problem encountered in netSnmpHostsTable_handler: unknown column\n&quot;</span>);
<a name="l00222"></a>00222             }
<a name="l00223"></a>00223             <span class="keywordflow">break</span>;
<a name="l00224"></a>00224 
<a name="l00225"></a>00225         <span class="keywordflow">case</span> MODE_SET_RESERVE1:
<a name="l00226"></a>00226             ci = <a class="code" href="group__oid__stash.html#ga19552f5190110ab8d5e2fe1488039f3a" title="returns a data pointer associated with a given OID.">netsnmp_oid_stash_get_data</a>(commitStorage,
<a name="l00227"></a>00227                                             suffix + 1, suffix_len - 1);
<a name="l00228"></a>00228 
<a name="l00229"></a>00229             <span class="keywordflow">if</span> (!ci) {
<a name="l00231"></a>00231                 ci = <a class="code" href="group__util.html#ga6356941968481380ea6f4a646df4aaf9" title="Mallocs memory of sizeof(struct s), zeros it and returns a pointer to it.">SNMP_MALLOC_STRUCT</a>(<a class="code" href="structcommitInfo.html">commitInfo</a>);
<a name="l00232"></a>00232                 <span class="keywordflow">if</span> (!data_context) {
<a name="l00233"></a>00233                     ci-&gt;data_context =
<a name="l00234"></a>00234                         netSnmpHostsTable_create_data_context(table_info-&gt;
<a name="l00235"></a>00235                                                               indexes);
<a name="l00236"></a>00236                     ci-&gt;new_row = 1;
<a name="l00237"></a>00237                 } <span class="keywordflow">else</span> {
<a name="l00238"></a>00238                     ci-&gt;data_context = data_context;
<a name="l00239"></a>00239                 }
<a name="l00240"></a>00240                 <a class="code" href="group__oid__stash.html#gad879efc661146a2c5f0fa156221df895" title="adds data to the stash at a given oid.">netsnmp_oid_stash_add_data</a>(&amp;commitStorage,
<a name="l00241"></a>00241                                            suffix + 1, suffix_len - 1, ci);
<a name="l00242"></a>00242             }
<a name="l00243"></a>00243             <span class="keywordflow">break</span>;
<a name="l00244"></a>00244 
<a name="l00245"></a>00245         <span class="keywordflow">case</span> MODE_SET_RESERVE2:
<a name="l00246"></a>00246             <span class="keywordflow">switch</span> (table_info-&gt;<a class="code" href="structnetsnmp__table__request__info__s.html#afbed55ce9b6c75a98fafc84559462b34" title="0 if OID not long enough">colnum</a>) {
<a name="l00247"></a>00247             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTADDRESSTYPE:
<a name="l00248"></a>00248                 {
<a name="l00249"></a>00249                     <span class="keywordtype">long</span>           *retval;
<a name="l00250"></a>00250                     <span class="keywordtype">size_t</span>          retval_len = 0;
<a name="l00251"></a>00251                     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui = NULL;
<a name="l00252"></a>00252                     <span class="keywordtype">int</span>             ret;
<a name="l00253"></a>00253 
<a name="l00255"></a>00255                     retval =
<a name="l00256"></a>00256                         get_netSnmpHostAddressType(ci-&gt;data_context,
<a name="l00257"></a>00257                                                    &amp;retval_len);
<a name="l00258"></a>00258                     <span class="keywordflow">if</span> (retval) {
<a name="l00259"></a>00259                         ui = <a class="code" href="group__util.html#ga6356941968481380ea6f4a646df4aaf9" title="Mallocs memory of sizeof(struct s), zeros it and returns a pointer to it.">SNMP_MALLOC_STRUCT</a>(<a class="code" href="structundoInfo.html">undoInfo</a>);
<a name="l00260"></a>00260                         ui-&gt;len = retval_len;
<a name="l00261"></a>00261                         <a class="code" href="group__util.html#ga623784b8aac0469fcd84e24ccdeda0bd" title="Duplicates a memory block.">memdup</a>((u_char **) &amp; ui-&gt;ptr,
<a name="l00262"></a>00262                                (u_char *) retval, ui-&gt;len);
<a name="l00263"></a>00263                     }
<a name="l00264"></a>00264 
<a name="l00267"></a>00267                     ret =
<a name="l00268"></a>00268                         check_netSnmpHostAddressType(request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00269"></a>00269                                                      type,
<a name="l00270"></a>00270                                                      (<span class="keywordtype">long</span> *) request-&gt;
<a name="l00271"></a>00271                                                      requestvb-&gt;val.string,
<a name="l00272"></a>00272                                                      request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00273"></a>00273                                                      val_len, retval,
<a name="l00274"></a>00274                                                      retval_len);
<a name="l00275"></a>00275                     <span class="keywordflow">if</span> (ret != 0) {
<a name="l00276"></a>00276                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request, ret);
<a name="l00277"></a>00277                         netSnmpHostsTable_free_undoInfo(ui);
<a name="l00278"></a>00278                     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ui) {
<a name="l00280"></a>00280                         <a class="code" href="group__oid__stash.html#gad879efc661146a2c5f0fa156221df895" title="adds data to the stash at a given oid.">netsnmp_oid_stash_add_data</a>(&amp;undoStorage,
<a name="l00281"></a>00281                                                    suffix, suffix_len, ui);
<a name="l00282"></a>00282                     }
<a name="l00283"></a>00283 
<a name="l00284"></a>00284                 }
<a name="l00285"></a>00285                 <span class="keywordflow">break</span>;
<a name="l00286"></a>00286             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTADDRESS:
<a name="l00287"></a>00287                 {
<a name="l00288"></a>00288                     <span class="keywordtype">char</span>           *retval;
<a name="l00289"></a>00289                     <span class="keywordtype">size_t</span>          retval_len = 0;
<a name="l00290"></a>00290                     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui = NULL;
<a name="l00291"></a>00291                     <span class="keywordtype">int</span>             ret;
<a name="l00292"></a>00292 
<a name="l00294"></a>00294                     retval =
<a name="l00295"></a>00295                         get_netSnmpHostAddress(ci-&gt;data_context,
<a name="l00296"></a>00296                                                &amp;retval_len);
<a name="l00297"></a>00297                     <span class="keywordflow">if</span> (retval) {
<a name="l00298"></a>00298                         ui = <a class="code" href="group__util.html#ga6356941968481380ea6f4a646df4aaf9" title="Mallocs memory of sizeof(struct s), zeros it and returns a pointer to it.">SNMP_MALLOC_STRUCT</a>(<a class="code" href="structundoInfo.html">undoInfo</a>);
<a name="l00299"></a>00299                         ui-&gt;len = retval_len;
<a name="l00300"></a>00300                         <a class="code" href="group__util.html#ga623784b8aac0469fcd84e24ccdeda0bd" title="Duplicates a memory block.">memdup</a>((u_char **) &amp; ui-&gt;ptr,
<a name="l00301"></a>00301                                (u_char *) retval, ui-&gt;len);
<a name="l00302"></a>00302                     }
<a name="l00303"></a>00303 
<a name="l00306"></a>00306                     ret =
<a name="l00307"></a>00307                         check_netSnmpHostAddress(request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;<a class="code" href="structvariable__list.html#a8bd719974b3554116631ea80dc88b6aa" title="ASN type of variable.">type</a>,
<a name="l00308"></a>00308                                                  (<span class="keywordtype">char</span> *) request-&gt;
<a name="l00309"></a>00309                                                  requestvb-&gt;val.string,
<a name="l00310"></a>00310                                                  request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00311"></a>00311                                                  val_len, retval,
<a name="l00312"></a>00312                                                  retval_len);
<a name="l00313"></a>00313                     <span class="keywordflow">if</span> (ret != 0) {
<a name="l00314"></a>00314                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request, ret);
<a name="l00315"></a>00315                         netSnmpHostsTable_free_undoInfo(ui);
<a name="l00316"></a>00316                     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ui) {
<a name="l00318"></a>00318                         <a class="code" href="group__oid__stash.html#gad879efc661146a2c5f0fa156221df895" title="adds data to the stash at a given oid.">netsnmp_oid_stash_add_data</a>(&amp;undoStorage,
<a name="l00319"></a>00319                                                    suffix, suffix_len, ui);
<a name="l00320"></a>00320                     }
<a name="l00321"></a>00321 
<a name="l00322"></a>00322                 }
<a name="l00323"></a>00323                 <span class="keywordflow">break</span>;
<a name="l00324"></a>00324             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTSTORAGE:
<a name="l00325"></a>00325                 {
<a name="l00326"></a>00326                     <span class="keywordtype">long</span>           *retval;
<a name="l00327"></a>00327                     <span class="keywordtype">size_t</span>          retval_len = 0;
<a name="l00328"></a>00328                     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui = NULL;
<a name="l00329"></a>00329                     <span class="keywordtype">int</span>             ret;
<a name="l00330"></a>00330 
<a name="l00332"></a>00332                     retval =
<a name="l00333"></a>00333                         get_netSnmpHostStorage(ci-&gt;data_context,
<a name="l00334"></a>00334                                                &amp;retval_len);
<a name="l00335"></a>00335                     <span class="keywordflow">if</span> (retval) {
<a name="l00336"></a>00336                         ui = <a class="code" href="group__util.html#ga6356941968481380ea6f4a646df4aaf9" title="Mallocs memory of sizeof(struct s), zeros it and returns a pointer to it.">SNMP_MALLOC_STRUCT</a>(<a class="code" href="structundoInfo.html">undoInfo</a>);
<a name="l00337"></a>00337                         ui-&gt;len = retval_len;
<a name="l00338"></a>00338                         <a class="code" href="group__util.html#ga623784b8aac0469fcd84e24ccdeda0bd" title="Duplicates a memory block.">memdup</a>((u_char **) &amp; ui-&gt;ptr,
<a name="l00339"></a>00339                                (u_char *) retval, ui-&gt;len);
<a name="l00340"></a>00340                     }
<a name="l00341"></a>00341 
<a name="l00344"></a>00344                     ret =
<a name="l00345"></a>00345                         check_netSnmpHostStorage(request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;<a class="code" href="structvariable__list.html#a8bd719974b3554116631ea80dc88b6aa" title="ASN type of variable.">type</a>,
<a name="l00346"></a>00346                                                  (<span class="keywordtype">long</span> *) request-&gt;
<a name="l00347"></a>00347                                                  requestvb-&gt;val.string,
<a name="l00348"></a>00348                                                  request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00349"></a>00349                                                  val_len, retval,
<a name="l00350"></a>00350                                                  retval_len);
<a name="l00351"></a>00351                     <span class="keywordflow">if</span> (ret != 0) {
<a name="l00352"></a>00352                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request, ret);
<a name="l00353"></a>00353                         netSnmpHostsTable_free_undoInfo(ui);
<a name="l00354"></a>00354                     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ui) {
<a name="l00356"></a>00356                         <a class="code" href="group__oid__stash.html#gad879efc661146a2c5f0fa156221df895" title="adds data to the stash at a given oid.">netsnmp_oid_stash_add_data</a>(&amp;undoStorage,
<a name="l00357"></a>00357                                                    suffix, suffix_len, ui);
<a name="l00358"></a>00358                     }
<a name="l00359"></a>00359 
<a name="l00360"></a>00360                 }
<a name="l00361"></a>00361                 <span class="keywordflow">break</span>;
<a name="l00362"></a>00362             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTROWSTATUS:
<a name="l00363"></a>00363                 {
<a name="l00364"></a>00364                     <span class="keywordtype">long</span>           *retval;
<a name="l00365"></a>00365                     <span class="keywordtype">size_t</span>          retval_len = 0;
<a name="l00366"></a>00366                     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui = NULL;
<a name="l00367"></a>00367                     <span class="keywordtype">int</span>             ret;
<a name="l00368"></a>00368 
<a name="l00370"></a>00370                     retval =
<a name="l00371"></a>00371                         get_netSnmpHostRowStatus(ci-&gt;data_context,
<a name="l00372"></a>00372                                                  &amp;retval_len);
<a name="l00373"></a>00373                     <span class="keywordflow">if</span> (retval) {
<a name="l00374"></a>00374                         ui = <a class="code" href="group__util.html#ga6356941968481380ea6f4a646df4aaf9" title="Mallocs memory of sizeof(struct s), zeros it and returns a pointer to it.">SNMP_MALLOC_STRUCT</a>(<a class="code" href="structundoInfo.html">undoInfo</a>);
<a name="l00375"></a>00375                         ui-&gt;len = retval_len;
<a name="l00376"></a>00376                         <a class="code" href="group__util.html#ga623784b8aac0469fcd84e24ccdeda0bd" title="Duplicates a memory block.">memdup</a>((u_char **) &amp; ui-&gt;ptr,
<a name="l00377"></a>00377                                (u_char *) retval, ui-&gt;len);
<a name="l00378"></a>00378                     }
<a name="l00379"></a>00379 
<a name="l00382"></a>00382                     ret =
<a name="l00383"></a>00383                         check_netSnmpHostRowStatus(request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00384"></a>00384                                                    type,
<a name="l00385"></a>00385                                                    (<span class="keywordtype">long</span> *) request-&gt;
<a name="l00386"></a>00386                                                    requestvb-&gt;val.string,
<a name="l00387"></a>00387                                                    request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00388"></a>00388                                                    val_len, retval,
<a name="l00389"></a>00389                                                    retval_len);
<a name="l00390"></a>00390                     <span class="keywordflow">if</span> (ret != 0) {
<a name="l00391"></a>00391                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request, ret);
<a name="l00392"></a>00392                         netSnmpHostsTable_free_undoInfo(ui);
<a name="l00393"></a>00393                     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ui) {
<a name="l00395"></a>00395                         <a class="code" href="group__oid__stash.html#gad879efc661146a2c5f0fa156221df895" title="adds data to the stash at a given oid.">netsnmp_oid_stash_add_data</a>(&amp;undoStorage,
<a name="l00396"></a>00396                                                    suffix, suffix_len, ui);
<a name="l00397"></a>00397                     }
<a name="l00398"></a>00398 
<a name="l00399"></a>00399                 }
<a name="l00400"></a>00400                 <span class="keywordflow">break</span>;
<a name="l00401"></a>00401             <span class="keywordflow">default</span>:
<a name="l00402"></a>00402                 <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request,
<a name="l00403"></a>00403                                           SNMP_ERR_NOTWRITABLE);
<a name="l00404"></a>00404                 <span class="keywordflow">break</span>;
<a name="l00405"></a>00405             }
<a name="l00406"></a>00406             <span class="keywordflow">break</span>;
<a name="l00407"></a>00407 
<a name="l00408"></a>00408         <span class="keywordflow">case</span> MODE_SET_ACTION:
<a name="l00410"></a>00410             <span class="keywordflow">switch</span> (table_info-&gt;<a class="code" href="structnetsnmp__table__request__info__s.html#afbed55ce9b6c75a98fafc84559462b34" title="0 if OID not long enough">colnum</a>) {
<a name="l00411"></a>00411             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTADDRESSTYPE:
<a name="l00412"></a>00412                 {
<a name="l00413"></a>00413                     <span class="keywordtype">int</span>             ret;
<a name="l00414"></a>00414                     ret = set_netSnmpHostAddressType(ci-&gt;data_context,
<a name="l00415"></a>00415                                                      (<span class="keywordtype">long</span> *) request-&gt;
<a name="l00416"></a>00416                                                      requestvb-&gt;val.string,
<a name="l00417"></a>00417                                                      request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00418"></a>00418                                                      val_len);
<a name="l00419"></a>00419                     <span class="keywordflow">if</span> (ret) {
<a name="l00420"></a>00420                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request, ret);
<a name="l00421"></a>00421                     }
<a name="l00422"></a>00422                 }
<a name="l00423"></a>00423                 <span class="keywordflow">break</span>;
<a name="l00424"></a>00424             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTADDRESS:
<a name="l00425"></a>00425                 {
<a name="l00426"></a>00426                     <span class="keywordtype">int</span>             ret;
<a name="l00427"></a>00427                     ret = set_netSnmpHostAddress(ci-&gt;data_context,
<a name="l00428"></a>00428                                                  (<span class="keywordtype">char</span> *) request-&gt;
<a name="l00429"></a>00429                                                  requestvb-&gt;val.string,
<a name="l00430"></a>00430                                                  request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00431"></a>00431                                                  val_len);
<a name="l00432"></a>00432                     <span class="keywordflow">if</span> (ret) {
<a name="l00433"></a>00433                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request, ret);
<a name="l00434"></a>00434                     }
<a name="l00435"></a>00435                 }
<a name="l00436"></a>00436                 <span class="keywordflow">break</span>;
<a name="l00437"></a>00437             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTSTORAGE:
<a name="l00438"></a>00438                 {
<a name="l00439"></a>00439                     <span class="keywordtype">int</span>             ret;
<a name="l00440"></a>00440                     ret = set_netSnmpHostStorage(ci-&gt;data_context,
<a name="l00441"></a>00441                                                  (<span class="keywordtype">long</span> *) request-&gt;
<a name="l00442"></a>00442                                                  requestvb-&gt;val.string,
<a name="l00443"></a>00443                                                  request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00444"></a>00444                                                  val_len);
<a name="l00445"></a>00445                     <span class="keywordflow">if</span> (ret) {
<a name="l00446"></a>00446                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request, ret);
<a name="l00447"></a>00447                     }
<a name="l00448"></a>00448                 }
<a name="l00449"></a>00449                 <span class="keywordflow">break</span>;
<a name="l00450"></a>00450             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTROWSTATUS:
<a name="l00451"></a>00451                 {
<a name="l00452"></a>00452                     <span class="keywordtype">int</span>             ret;
<a name="l00453"></a>00453                     ret = set_netSnmpHostRowStatus(ci-&gt;data_context,
<a name="l00454"></a>00454                                                    (<span class="keywordtype">long</span> *) request-&gt;
<a name="l00455"></a>00455                                                    requestvb-&gt;val.string,
<a name="l00456"></a>00456                                                    request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;
<a name="l00457"></a>00457                                                    val_len);
<a name="l00458"></a>00458                     <span class="keywordflow">if</span> (ret) {
<a name="l00459"></a>00459                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request, ret);
<a name="l00460"></a>00460                     }
<a name="l00461"></a>00461                     <span class="keywordflow">if</span> (*request-&gt;<a class="code" href="structnetsnmp__request__info__s.html#a455d87f6b7178fe19ea564c60c0ccb6f" title="variable bindings">requestvb</a>-&gt;<a class="code" href="structvariable__list.html#a6ed7c00d712b83c174823b1cff6e9e29" title="value of variable">val</a>.integer == RS_DESTROY) {
<a name="l00462"></a>00462                         ci-&gt;new_row = -1;
<a name="l00463"></a>00463                     }
<a name="l00464"></a>00464                 }
<a name="l00465"></a>00465                 <span class="keywordflow">break</span>;
<a name="l00466"></a>00466             }
<a name="l00467"></a>00467             <span class="keywordflow">break</span>;
<a name="l00468"></a>00468 
<a name="l00469"></a>00469         <span class="keywordflow">case</span> MODE_SET_COMMIT:
<a name="l00470"></a>00470             <span class="keywordflow">if</span> (!ci-&gt;have_committed) {
<a name="l00472"></a>00472                 netSnmpHostsTable_commit_row(&amp;ci-&gt;data_context,
<a name="l00473"></a>00473                                              ci-&gt;new_row);
<a name="l00474"></a>00474                 ci-&gt;have_committed = 1;
<a name="l00475"></a>00475             }
<a name="l00476"></a>00476             <span class="keywordflow">break</span>;
<a name="l00477"></a>00477 
<a name="l00478"></a>00478         <span class="keywordflow">case</span> MODE_SET_UNDO:
<a name="l00480"></a>00480             <span class="keywordflow">switch</span> (table_info-&gt;<a class="code" href="structnetsnmp__table__request__info__s.html#afbed55ce9b6c75a98fafc84559462b34" title="0 if OID not long enough">colnum</a>) {
<a name="l00481"></a>00481             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTADDRESSTYPE:
<a name="l00482"></a>00482                 {
<a name="l00483"></a>00483                     <span class="keywordtype">int</span>             retval;
<a name="l00484"></a>00484                     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui;
<a name="l00485"></a>00485                     ui = <a class="code" href="group__oid__stash.html#ga19552f5190110ab8d5e2fe1488039f3a" title="returns a data pointer associated with a given OID.">netsnmp_oid_stash_get_data</a>(undoStorage,
<a name="l00486"></a>00486                                                     suffix, suffix_len);
<a name="l00487"></a>00487                     retval =
<a name="l00488"></a>00488                         set_netSnmpHostAddressType(ci-&gt;data_context,
<a name="l00489"></a>00489                                                    ui-&gt;ptr, ui-&gt;len);
<a name="l00490"></a>00490                     <span class="keywordflow">if</span> (retval) {
<a name="l00491"></a>00491                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request,
<a name="l00492"></a>00492                                                   SNMP_ERR_UNDOFAILED);
<a name="l00493"></a>00493                     }
<a name="l00494"></a>00494                 }
<a name="l00495"></a>00495                 <span class="keywordflow">break</span>;
<a name="l00496"></a>00496             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTADDRESS:
<a name="l00497"></a>00497                 {
<a name="l00498"></a>00498                     <span class="keywordtype">int</span>             retval;
<a name="l00499"></a>00499                     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui;
<a name="l00500"></a>00500                     ui = <a class="code" href="group__oid__stash.html#ga19552f5190110ab8d5e2fe1488039f3a" title="returns a data pointer associated with a given OID.">netsnmp_oid_stash_get_data</a>(undoStorage,
<a name="l00501"></a>00501                                                     suffix, suffix_len);
<a name="l00502"></a>00502                     retval =
<a name="l00503"></a>00503                         set_netSnmpHostAddress(ci-&gt;data_context, ui-&gt;ptr,
<a name="l00504"></a>00504                                                ui-&gt;len);
<a name="l00505"></a>00505                     <span class="keywordflow">if</span> (retval) {
<a name="l00506"></a>00506                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request,
<a name="l00507"></a>00507                                                   SNMP_ERR_UNDOFAILED);
<a name="l00508"></a>00508                     }
<a name="l00509"></a>00509                 }
<a name="l00510"></a>00510                 <span class="keywordflow">break</span>;
<a name="l00511"></a>00511             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTSTORAGE:
<a name="l00512"></a>00512                 {
<a name="l00513"></a>00513                     <span class="keywordtype">int</span>             retval;
<a name="l00514"></a>00514                     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui;
<a name="l00515"></a>00515                     ui = <a class="code" href="group__oid__stash.html#ga19552f5190110ab8d5e2fe1488039f3a" title="returns a data pointer associated with a given OID.">netsnmp_oid_stash_get_data</a>(undoStorage,
<a name="l00516"></a>00516                                                     suffix, suffix_len);
<a name="l00517"></a>00517                     retval =
<a name="l00518"></a>00518                         set_netSnmpHostStorage(ci-&gt;data_context, ui-&gt;ptr,
<a name="l00519"></a>00519                                                ui-&gt;len);
<a name="l00520"></a>00520                     <span class="keywordflow">if</span> (retval) {
<a name="l00521"></a>00521                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request,
<a name="l00522"></a>00522                                                   SNMP_ERR_UNDOFAILED);
<a name="l00523"></a>00523                     }
<a name="l00524"></a>00524                 }
<a name="l00525"></a>00525                 <span class="keywordflow">break</span>;
<a name="l00526"></a>00526             <span class="keywordflow">case</span> COLUMN_NETSNMPHOSTROWSTATUS:
<a name="l00527"></a>00527                 {
<a name="l00528"></a>00528                     <span class="keywordtype">int</span>             retval;
<a name="l00529"></a>00529                     <span class="keyword">struct </span><a class="code" href="structundoInfo.html">undoInfo</a> *ui;
<a name="l00530"></a>00530                     ui = <a class="code" href="group__oid__stash.html#ga19552f5190110ab8d5e2fe1488039f3a" title="returns a data pointer associated with a given OID.">netsnmp_oid_stash_get_data</a>(undoStorage,
<a name="l00531"></a>00531                                                     suffix, suffix_len);
<a name="l00532"></a>00532                     retval =
<a name="l00533"></a>00533                         set_netSnmpHostRowStatus(ci-&gt;data_context, ui-&gt;ptr,
<a name="l00534"></a>00534                                                  ui-&gt;len);
<a name="l00535"></a>00535                     <span class="keywordflow">if</span> (retval) {
<a name="l00536"></a>00536                         <a class="code" href="group__snmp__agent.html#gac0668f1fd9036ebc88a734d9d4a6a59b" title="set error for a request">netsnmp_set_request_error</a>(reqinfo, request,
<a name="l00537"></a>00537                                                   SNMP_ERR_UNDOFAILED);
<a name="l00538"></a>00538                     }
<a name="l00539"></a>00539                 }
<a name="l00540"></a>00540                 <span class="keywordflow">break</span>;
<a name="l00541"></a>00541             }
<a name="l00542"></a>00542             <span class="keywordflow">break</span>;
<a name="l00543"></a>00543 
<a name="l00544"></a>00544         <span class="keywordflow">case</span> MODE_SET_FREE:
<a name="l00545"></a>00545             <span class="keywordflow">break</span>;
<a name="l00546"></a>00546 
<a name="l00547"></a>00547         <span class="keywordflow">default</span>:
<a name="l00548"></a>00548             <a class="code" href="group__snmp__logging.html#ga9ba905368ea1c551b969af44b13e37c2" title="This snmp logging function allows variable argument list given the specified format and priority...">snmp_log</a>(LOG_ERR,
<a name="l00549"></a>00549                      <span class="stringliteral">&quot;problem encountered in netSnmpHostsTable_handler: unsupported mode\n&quot;</span>);
<a name="l00550"></a>00550         }
<a name="l00551"></a>00551     }
<a name="l00552"></a>00552 
<a name="l00554"></a>00554     <span class="keywordflow">switch</span> (reqinfo-&gt;mode) {
<a name="l00555"></a>00555     <span class="keywordflow">case</span> MODE_SET_UNDO:
<a name="l00556"></a>00556     <span class="keywordflow">case</span> MODE_SET_FREE:
<a name="l00557"></a>00557     <span class="keywordflow">case</span> MODE_SET_COMMIT:
<a name="l00559"></a>00559         <a class="code" href="group__oid__stash.html#ga8b3ab7792cfc2014af022a6eb2ecabc0" title="Frees the contents of a netsnmp_oid_stash tree.">netsnmp_oid_stash_free</a>(&amp;undoStorage,
<a name="l00560"></a>00560                                netSnmpHostsTable_free_undoInfo);
<a name="l00561"></a>00561         <a class="code" href="group__oid__stash.html#ga8b3ab7792cfc2014af022a6eb2ecabc0" title="Frees the contents of a netsnmp_oid_stash tree.">netsnmp_oid_stash_free</a>(&amp;commitStorage, netsnmp_oid_stash_no_free);
<a name="l00562"></a>00562     }
<a name="l00563"></a>00563 
<a name="l00564"></a>00564 
<a name="l00565"></a>00565     <span class="keywordflow">return</span> SNMP_ERR_NOERROR;
<a name="l00566"></a>00566 }
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>