title: Looking for example code to implement a SNMP table using AgentX
body: <p>I've written an AgentX app (Linux, gcc, g++) which works well at sending back scalers.  Here is what I'm doing now:</p>
  
  <pre><code>init_agent( "blah" );
  netsnmp_register_read_only_scalar( netsnmp_create_handler_registration( "foo1", handle_foo1, oid, oid.size(), HANDLER_CAN_RONLY ) );
  init_snmp( "blah" );
  while ( true )
  {
      // internal stuff
      agent_check_and_process(1); // where 1==block
  }
  </code></pre>
  
  <p>The functions like <code>handle_foo1(...)</code> call <code>snmp_set_var_typed_value(...)</code> to return the values which are cached in a global C struct within the application.</p>
  
  <p>What I'm trying to do now is modify this code to also support a SNMP table.  The content of the table is stored/cached as a STL container within the application.  This is a relatively simple SNMP table, with consecutive rows, and all columns are composed of types like Integer32, Gauge32, InetAddress, and TruthValue.  The problem is I don't see great code examples on the net-snmp web site, just a lot of doxygen pages.</p>
  
  <p><em><strong>My question:</em></strong></p>
  
  <p>What API should I be looking at?  Are these the right calls:</p>
  
  <pre><code>netsnmp_register_read_only_table_data();
  netsnmp_create_table_data();
  netsnmp_create_table_data_row();
  netsnmp_table_data_add_row();
  </code></pre>
  
  <p>...or is there something simpler I should be using?</p>