Current File : //usr/share/doc/net-snmp/html/group__table__container.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: table_container</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><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">table_container</div>  </div>
<div class="ingroups"><a class="el" href="group__table.html">table</a></div></div><!--header-->
<div class="contents">

<p>Helps you implement a table when data can be found via a netsnmp_container.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga153cc1755e8dce01b081fcce242bbb99"></a><!-- doxytag: member="table_container::netsnmp_tcontainer_create_table" ref="ga153cc1755e8dce01b081fcce242bbb99" args="(const char *name, netsnmp_container *container, long flags)" -->
<a class="el" href="structcontainer__table__data__s.html">container_table_data</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>netsnmp_tcontainer_create_table</b> (const char *name, <a class="el" href="structnetsnmp__container__s.html">netsnmp_container</a> *container, long flags)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5c119036259576d0910d2e5112ba9eae"></a><!-- doxytag: member="table_container::netsnmp_tcontainer_delete_table" ref="ga5c119036259576d0910d2e5112ba9eae" args="(container_table_data *table)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>netsnmp_tcontainer_delete_table</b> (<a class="el" href="structcontainer__table__data__s.html">container_table_data</a> *table)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5d934ea2f05a889b66427084219718f2"></a><!-- doxytag: member="table_container::netsnmp_tcontainer_add_row" ref="ga5d934ea2f05a889b66427084219718f2" args="(container_table_data *table, netsnmp_index *row)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>netsnmp_tcontainer_add_row</b> (<a class="el" href="structcontainer__table__data__s.html">container_table_data</a> *table, <a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a> *row)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga034843b748b221926f743bccbc223f81"></a><!-- doxytag: member="table_container::netsnmp_tcontainer_remove_row" ref="ga034843b748b221926f743bccbc223f81" args="(container_table_data *table, netsnmp_index *row)" -->
<a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>netsnmp_tcontainer_remove_row</b> (<a class="el" href="structcontainer__table__data__s.html">container_table_data</a> *table, <a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a> *row)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga86bdecffedbf70f845841b618425880c"></a><!-- doxytag: member="table_container::netsnmp_tcontainer_replace_row" ref="ga86bdecffedbf70f845841b618425880c" args="(container_table_data *table, netsnmp_index *old_row, netsnmp_index *new_row)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>netsnmp_tcontainer_replace_row</b> (<a class="el" href="structcontainer__table__data__s.html">container_table_data</a> *table, <a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a> *old_row, <a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a> *new_row)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__handler.html#ga77f4225c0e0c1d549e634f58dba3de3d">netsnmp_mib_handler</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__table__container.html#gacbbedcbcf8aba6403231b90369d500af">netsnmp_container_table_handler_get</a> (<a class="el" href="structnetsnmp__table__registration__info__s.html">netsnmp_table_registration_info</a> *tabreg, <a class="el" href="structnetsnmp__container__s.html">netsnmp_container</a> *container, char key_type)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns a netsnmp_mib_handler object for the table_container helper  <a href="#gacbbedcbcf8aba6403231b90369d500af"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga444a252046603901277c20e4d8853f6c"></a><!-- doxytag: member="table_container::netsnmp_container_table_register" ref="ga444a252046603901277c20e4d8853f6c" args="(netsnmp_handler_registration *reginfo, netsnmp_table_registration_info *tabreg, netsnmp_container *container, char key_type)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>netsnmp_container_table_register</b> (<a class="el" href="group__handler.html#gac475ff73806c2d76ebfc78a87d921b8b">netsnmp_handler_registration</a> *reginfo, <a class="el" href="structnetsnmp__table__registration__info__s.html">netsnmp_table_registration_info</a> *tabreg, <a class="el" href="structnetsnmp__container__s.html">netsnmp_container</a> *container, char key_type)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structnetsnmp__container__s.html">netsnmp_container</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__table__container.html#ga05288452a065305b053d39d4386bea7f">netsnmp_container_table_container_extract</a> (<a class="el" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *request)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">retrieve the container used by the table_container helper  <a href="#ga05288452a065305b053d39d4386bea7f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__table__container.html#gad04d409ff9389bafefb0479f492d130b">netsnmp_container_table_row_extract</a> (<a class="el" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *request)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">find the context data used by the table_container helper  <a href="#gad04d409ff9389bafefb0479f492d130b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__table__container.html#ga3bb7aec363d7c7449a6b656b335ba297">netsnmp_container_table_extract_context</a> (<a class="el" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *request)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">find the context data used by the table_container helper  <a href="#ga3bb7aec363d7c7449a6b656b335ba297"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__table__container.html#ga23247a39cd60b0ce704bfea1fe840c76">netsnmp_container_table_row_insert</a> (<a class="el" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *request, <a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a> *row)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">inserts a newly created table_container entry into a request list  <a href="#ga23247a39cd60b0ce704bfea1fe840c76"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__table__container.html#gab81286d916b9a05eb53fd61bbe0eecf3">netsnmp_table_index_find_next_row</a> (<a class="el" href="structnetsnmp__container__s.html">netsnmp_container</a> *c, <a class="el" href="structnetsnmp__table__request__info__s.html">netsnmp_table_request_info</a> *tblreq)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">deprecated, backwards compatability only  <a href="#gab81286d916b9a05eb53fd61bbe0eecf3"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Helps you implement a table when data can be found via a netsnmp_container. </p>
<p>The table_container handler is used (automatically) in conjuntion with the <a class="el" href="group__table.html">table</a> handler.</p>
<p>This handler will use the index information provided by the <a class="el" href="group__table.html">table</a> handler to find the row needed to process the request.</p>
<p>The container must use one of 3 key types. It is the sub-handler's responsibility to ensure that the container and key type match (unless neither is specified, in which case a default will be used.)</p>
<p>The current key types are:</p>
<p>TABLE_CONTAINER_KEY_NETSNMP_INDEX The container should do comparisons based on a key that may be cast to a netsnmp index (netsnmp_index *). This index contains only the index portion of the OID, not the entire OID.</p>
<p>TABLE_CONTAINER_KEY_VARBIND_INDEX The container should do comparisons based on a key that may be cast to a netsnmp variable list (netsnmp_variable_list *). This variable list will contain one varbind for each index component.</p>
<p>TABLE_CONTAINER_KEY_VARBIND_RAW (NOTE: unimplemented) While not yet implemented, future plans include passing the request varbind with the full OID to a container.</p>
<p>If a key type is not specified at registration time, the default key type of TABLE_CONTAINER_KEY_NETSNMP_INDEX will be used. If a container is provided, or the handler name is aliased to a container type, the container must use a netsnmp index.</p>
<p>If no container is provided, a lookup will be made based on the sub-handler's name, or if that isn't found, "table_container". The table_container key type will be netsnmp_index.</p>
<p>The container must, at a minimum, implement find and find_next. If a NULL key is passed to the container, it must return the first item, if any. All containers provided by net-snmp fulfil this requirement.</p>
<p>This handler will only register to process 'data lookup' modes. In traditional net-snmp modes, that is any GET-like mode (GET, GET-NEXT, GET-BULK) or the first phase of a SET (RESERVE1). In the new baby-steps mode, DATA_LOOKUP is it's own mode, and is a pre-cursor to other modes.</p>
<p>When called, the handler will call the appropriate container method with the appropriate key type. If a row was not found, the result depends on the mode.</p>
<p>GET Processing An exact match must be found. If one is not, the error NOSUCHINSTANCE is set.</p>
<p>GET-NEXT / GET-BULK If no row is found, the column number will be increased (using any valid_columns structure that may have been provided), and the first row will be retrieved. If no first row is found, the processed flag will be set, so that the sub-handler can skip any processing related to the request. The agent will notice this unsatisfied request, and attempt to pass it to the next appropriate handler.</p>
<p>SET If the hander did not register with the HANDLER_CAN_NOT_CREATE flag set in the registration modes, it is assumed that this is a row creation request and a NULL row is added to the request's data list. The sub-handler is responsbile for dealing with any row creation contraints and inserting any newly created rows into the container and the request's data list.</p>
<p>If a row is found, it will be inserted into the request's data list. The sub-handler may retrieve it by calling netsnmp_container_table_extract_context(request); * NOTE NOTE NOTE:</p>
<p>This helper and it's API are still being tested and are subject to change. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga05288452a065305b053d39d4386bea7f"></a><!-- doxytag: member="table_container.c::netsnmp_container_table_container_extract" ref="ga05288452a065305b053d39d4386bea7f" args="(netsnmp_request_info *request)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structnetsnmp__container__s.html">netsnmp_container</a>* <a class="el" href="group__table__container.html#ga05288452a065305b053d39d4386bea7f">netsnmp_container_table_container_extract</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *&#160;</td>
          <td class="paramname"><em>request</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>retrieve the container used by the table_container helper </p>

<p>Definition at line <a class="el" href="table__container_8c_source.html#l00320">320</a> of file <a class="el" href="table__container_8c_source.html">table_container.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga3bb7aec363d7c7449a6b656b335ba297"></a><!-- doxytag: member="table_container.c::netsnmp_container_table_extract_context" ref="ga3bb7aec363d7c7449a6b656b335ba297" args="(netsnmp_request_info *request)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="group__table__container.html#ga3bb7aec363d7c7449a6b656b335ba297">netsnmp_container_table_extract_context</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *&#160;</td>
          <td class="paramname"><em>request</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>find the context data used by the table_container helper </p>

<p>Definition at line <a class="el" href="table__container_8c_source.html#l00339">339</a> of file <a class="el" href="table__container_8c_source.html">table_container.c</a>.</p>

</div>
</div>
<a class="anchor" id="gacbbedcbcf8aba6403231b90369d500af"></a><!-- doxytag: member="table_container.c::netsnmp_container_table_handler_get" ref="gacbbedcbcf8aba6403231b90369d500af" args="(netsnmp_table_registration_info *tabreg, netsnmp_container *container, char key_type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__handler.html#ga77f4225c0e0c1d549e634f58dba3de3d">netsnmp_mib_handler</a>* <a class="el" href="group__table__container.html#gacbbedcbcf8aba6403231b90369d500af">netsnmp_container_table_handler_get</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnetsnmp__table__registration__info__s.html">netsnmp_table_registration_info</a> *&#160;</td>
          <td class="paramname"><em>tabreg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnetsnmp__container__s.html">netsnmp_container</a> *&#160;</td>
          <td class="paramname"><em>container</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>key_type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>returns a netsnmp_mib_handler object for the table_container helper </p>

<p>Definition at line <a class="el" href="table__container_8c_source.html#l00254">254</a> of file <a class="el" href="table__container_8c_source.html">table_container.c</a>.</p>

</div>
</div>
<a class="anchor" id="gad04d409ff9389bafefb0479f492d130b"></a><!-- doxytag: member="table_container.c::netsnmp_container_table_row_extract" ref="gad04d409ff9389bafefb0479f492d130b" args="(netsnmp_request_info *request)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="group__table__container.html#gad04d409ff9389bafefb0479f492d130b">netsnmp_container_table_row_extract</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *&#160;</td>
          <td class="paramname"><em>request</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>find the context data used by the table_container helper </p>

<p>Definition at line <a class="el" href="table__container_8c_source.html#l00329">329</a> of file <a class="el" href="table__container_8c_source.html">table_container.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga23247a39cd60b0ce704bfea1fe840c76"></a><!-- doxytag: member="table_container.c::netsnmp_container_table_row_insert" ref="ga23247a39cd60b0ce704bfea1fe840c76" args="(netsnmp_request_info *request, netsnmp_index *row)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__table__container.html#ga23247a39cd60b0ce704bfea1fe840c76">netsnmp_container_table_row_insert</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnetsnmp__request__info__s.html">netsnmp_request_info</a> *&#160;</td>
          <td class="paramname"><em>request</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a> *&#160;</td>
          <td class="paramname"><em>row</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>inserts a newly created table_container entry into a request list </p>

<p>Definition at line <a class="el" href="table__container_8c_source.html#l00351">351</a> of file <a class="el" href="table__container_8c_source.html">table_container.c</a>.</p>

</div>
</div>
<a class="anchor" id="gab81286d916b9a05eb53fd61bbe0eecf3"></a><!-- doxytag: member="table_container.c::netsnmp_table_index_find_next_row" ref="gab81286d916b9a05eb53fd61bbe0eecf3" args="(netsnmp_container *c, netsnmp_table_request_info *tblreq)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structnetsnmp__index__s.html">netsnmp_index</a>* <a class="el" href="group__table__container.html#gab81286d916b9a05eb53fd61bbe0eecf3">netsnmp_table_index_find_next_row</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnetsnmp__container__s.html">netsnmp_container</a> *&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnetsnmp__table__request__info__s.html">netsnmp_table_request_info</a> *&#160;</td>
          <td class="paramname"><em>tblreq</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>deprecated, backwards compatability only </p>
<p>expected impact to remove: none</p>
<ul>
<li>used between helpers, shouldn't have been used by end users</li>
</ul>
<p>replacement: none</p>
<ul>
<li>never should have been a public method in the first place </li>
</ul>

<p>Definition at line <a class="el" href="table__container_8c_source.html#l00721">721</a> of file <a class="el" href="table__container_8c_source.html">table_container.c</a>.</p>

</div>
</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>