What do you think about this "ShoeHorning" design plan, to use C++ API
for implementing MIBs:

1) Basic idea for "registering" a C++ object method instead of C
function:
        - Register my own cpp_mib_handler with a C++ object pointer (P,
and we'll call the object a HandlerObject) as the handler's my_void
field,
          and a C access_method which calls P->AccessMethod(), with same
arguments as the access_method.

2) Handling generic tables:
        - register the cpp_mib_handler, but inject the
table_helper_handler before.

3) In the HandlerObject class we can:
        - Hold the MIB data, or access methods to that data.
        - Define a register method, which will do the registration.
        - Convert net-snmp C API (switch (mode): MODE_GET, MODE_SET,...)
to C++ easy to use API, 
           with access methods like: Get(), Next(), Reserve(), Set()
           These methods could use C++ objects as parameters
        (like Value and OID to simplify things)
                

Erez Makavy

-----Original Message-----
From: Dave Shield [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 11, 2006 12:32 PM
To: Makavy, Erez (Erez)
Cc: [email protected]
Subject: Re: How to implement C++ API for agent MIB implementation?

On Mon, 2005-12-26 at 19:11 +0200, Makavy, Erez (Erez) wrote:

> 1) find out if there is already a C++ API?

Not with this package, no.

 
> 2) Use the OLD-API

I would strongly recommend *against* doing anything based on
the old API.   All the development effort is now being concentrated
on the new handler-based mechanism.




> C) Any better Ideas?

My honest advice would actually be to consider using a different
SNMP toolkit.   One designed with classes in mind right from the
start is likely to prove much cleaner than trying to shoehorn a
C++ API on top of the C-based Net-SNMP toolkit.
   My personal preference would be for SNMP++/Agent++,  but that's
because it's C++ toolkit that I'm most familiar with.  There may be
others out there that are worth considering too.

But I'd also suggest that you look for something that support AgentX.
This would allow you to link your (C++) subagent with the main Net-SNMP
master agent (or any other AgentX master agent).

The other developers may well disagree with this suggestion, but that's
my advice!

Dave



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to