minimum implementation for smtp-set

Frank Fock Frank.Fock____t-online.de
Fri Jun 21 19:47:27 CEST 2002


Jochen,

Basically there is no need to implement anything.
Using a MibLeaf instance constructed with OID and
correct syntax will already provide all functionality
to support SNMP SET requests.

In addition, AgentGen generated code is ready to
use. No extra implementation is needed. If the agent
crashes in "replace_value", then the initial value is
not properly initialized or you might have modified
the generated code...

What kind of explanation of the example code do
you expect? More comments on structure? Method
calls?

Best regards,
Frank

"Nölle, Jochen" wrote:

> Hello,
>
> could someone tell me what code implementation has to be done to set a
> variable from a management system in an agent++ application?
> I tried to implement a small piece of code using MS Visual C++6.0.
> Snmp-get works but if a set-pdu has been received the application
> crashes in
> function "void MibLeaf::replace_value(SnmpSyntax* v)" in the
> delete-function. VC++ says "HEAP[AgentppTest.exe]: Invalid Address
> specified to RtlValidateHeap( 310000, 89a980 )".
>
> Previously I compiled a mib-class "my_test_mib" with the agentgen-tool
> containing an octet-string and an integer value.
>
> This is the code:
> --------------------
>  Mib mib;
>  int status;
>  Snmpx snmp(status, 163);
>
>  if(status !=SNMP_CLASS_SUCCESS)
>  {
>         return FALSE;
>  }
>  RequestList ReqList;
>
>  mib.set_request_list(&ReqList);
>  mib.add(new my_test_mib);
>  ReqList.set_snmp(&snmp);
>         for(;;)
>         {
>                 req = ReqList.receive(30);
>
>                 if(req)
>                         mib.process_request(req);
>         }
>         return TRUE;  // return TRUE  unless you set the focus to a
> control
> --------------------
>
> In my opinion, it is hard work for a newcomer, who just makes first
> steps working with snmp trying to make agent++ work because of missing
> introduction to the package. The example code comes with no explanation
> about its functionality.
>
> Could someone give me some help?
>
> Thanks,
>
> Jochen Noelle





More information about the AGENTPP mailing list