[AGENT++] Need help with MibTable

Johnny Ljunggren johnny at navtek.no
Wed Oct 25 21:37:14 CEST 2006


Hello again

AgenPro automagically made source code for my mib, but I'm struggling with
how to control it. Especially how to actually create a mibtable and fill
it up with sensible data. I've looked at the if_mib.cpp subagent example
but that one uses AgentXSharedTable vs MibTable for my mib.
I couldn't find any documentation on this (apart from the doxygen docs) so
this is what I came up with:

  SnmpSyntax* unit_entry[2];
  for (int i=0; i<2; i++)
    unit_entry[i] = 0;
  unit_entry[0] = SnmpInt32(49);
  unit_entry[1] = new OctetStr("Test");

  MibTableRow* r = new MibTableRow(generator);
  r->get_nth(0)->replace_value(unit_entry[0]);
  unit_entry[0] = 0;
  Oidx idx = get_next_avail_index();
  add_row(idx);

  r->get_nth(1)->replace_value(unit_entry[1]);
  unit_entry[1] = 0;
  idx = get_next_avail_index();
  add_row(idx);

Any words on how to correctly do this would be highly appreciated.

thanks
-- 
Johnny Ljunggren, Navtek AS




More information about the AGENTPP mailing list