Integrating agenPro generated code with agent++

Crumpton, Neil Neil.Crumpton____quantumbeam.com
Tue Apr 22 18:00:20 CEST 2003


Hi Henning,
Thanks for the micro How To:... It was extremely useful. I have got my code
building with agent++ now and added my mib to the agent.cpp file as you
described. I am, however, a little stuck on step 6 - 

"6. Of course, you will have to fill the generated files with useful code to
actually get the agent to report what you want it to report. Have a look at
the "get_request" and "set" methods for starters."

Looking at the examples in the agent++/examples directory I see that most of
the MibLeaf inherited classes seem to have a get_request method yet my
generated code does not have this. Any idea why this might be? My generated
code only has a constructor, destructor and clone method for each mib leaf.
Am I missing any other methods?

Also should my get_request method (be it generated or hand crafted) just
call MibLeaf::get_request(req, ind) or should this be where I go and get my
data from my hardware and then call MibLeaf::get_request?

Thanks in advance for your help. It is much appreciated.
Regards,
Neil.


-----Original Message-----
From: Henning Eggers [mailto:henning.eggers____plath.de]
Sent: 17 April 2003 08:20
To: Crumpton, Neil
Cc: agentpp-dl____agentpp.com
Subject: Re: Integrating agenPro generated code with agent++


----- Original Message -----
> All you need to integrate your generated code
> with AGENT++ is to generate or copy it into
> the agent++/agentgen/agent/["src"|"include"]
> directories and run "make -f Makefile.<system>"

If you are not developing on Linux or Solaris or if you just want to know a
little more about the internals:
1. Take one of the sample-agents (like static_table) and find the "void
init(Mib& mib)" function definitions.
2. Your generated code should contain a top-level class for your mib called
"quantumbeam_mlink_mib" or whatever your MIB module is called. This class
has a constructor (of course ;-).
3. Chose a place in the "init" function to add you mib, probably right after
the other "add" calls. You might want to comment out the calls that add the
StaticTable example mibs...
4. Put your add call in there, something like:
mib.add( new quantumbeam_mlink_mib(...) );
I do not remember if there where any parameters to the constructor.
5. Place your generated .cpp and .h files into the soure directory with
agent.cpp and add them to the project.
6. Of course, you will have to fill the generated files with useful code to
actually get the agent to report what you want it to report. Have a look at
the "get_request" and "set" methods for starters.
7. Compile and run.

That's a micro-HowTo ... ;-)

Cheers,
Henning

 
---------------------------------------------------------------------------
The information transmitted in this e-mail is intended only for the person
or entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.  We do not accept
responsibility for changes made to this message after it was sent.
---------------------------------------------------------------------------
If you received this in error, please inform info at quantumbeam.com and delete
the material from your computer.



More information about the AGENTPP mailing list