How to implement C++ API for agent MIB implementation?

This is a discussion on How to implement C++ API for agent MIB implementation? within the SNMP Users forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. ------_=_NextPart_001_01C60A3F.59619187 Content-Type: text/plain; charset="us-ascii&...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-26-2005
Makavy, Erez
 
Posts: n/a
Default How to implement C++ API for agent MIB implementation?

This is a multi-part message in MIME format.

------_=_NextPart_001_01C60A3F.59619187
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hey,
=20
I'd like a simple C++ API for implementing MIBs.
Basically I'd like the new API to allow an object to implement a leaf,=20
meaning that the object should register for handling a certain leaf, and
it would have some predefined handle() method which will be called when
leaf processing is needed.
This would require some sort of special registration.
=20
Possibilities I thought of:
1) find out if there is already a C++ API?
=20
2) Use the OLD-API, and register a variableN array in which the
FindVarMethod would
use the oid as a key to lookup an handler_object in a global
data-structure,=20
and invokes a "handle" method of the handle_object.

3) Use the new Net-SNMP handler mechanism to register a handler with
some cookie which will contain the object (this) pointer.

=20
=20
Questions:
---------------
=20
A) Is there a C++ API for this? ( I guess not...not yet)
=20
B) since possibility number 1 is a bit awkward, I'll refer to the 2nd
possibility:
1) How do I register a handler with a cookie?
=20
C) Any better Ideas?
=20
thanks,
Erez.
=20
=20

------_=_NextPart_001_01C60A3F.59619187
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2>Hey,</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial size=3D2>I'd =
like&nbsp;a=20
simple C++ API for implementing MIBs.</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial =
size=3D2>Basically I'd=20
like&nbsp;the new API&nbsp;to&nbsp;allow an object to implement a leaf,=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial =
size=3D2>meaning that the=20
object should register for handling a certain leaf, and it would have =
some=20
predefined handle() method which will be called when leaf processing is=20
needed.</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial size=3D2>This =
would require=20
some&nbsp;sort of special registration.</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial =
size=3D2>Possibilities I=20
thought of:</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial size=3D2>1) =
find out if there=20
is already a C++ API?</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial =
size=3D2>2)&nbsp;Use the=20
OLD-API, and register a variableN&nbsp;array in which&nbsp;the =
FindVarMethod=20
would</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;=20
&nbsp;use the oid as a key to lookup an handler_object in a global=20
data-structure,&nbsp;</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial size=3D2>&nbsp; =
&nbsp;=20
and&nbsp;invokes a "handle" method of the=20
handle_object.<BR></DIV></FONT></SPAN><SPAN =
class=3D821094116-26122005><FONT=20
face=3DArial size=3D2></FONT></SPAN>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial size=3D2>3) Use =
the new=20
Net-SNMP handler mechanism to register a handler with some cookie which =
will=20
contain the object (this) pointer.<BR></DIV>
<DIV></FONT></SPAN><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2>Questions:</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2>---------------</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial size=3D2>A) Is =
there a C++=20
API for this? ( I guess not...not yet)</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial size=3D2>B)=20
</FONT></SPAN><SPAN class=3D821094116-26122005><FONT face=3DArial =
size=3D2>since=20
possibility number 1 is a bit awkward, I'll refer to the 2nd=20
possibility:</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;=20
1) How do I register a handler with a cookie?</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial size=3D2>C) Any =
better=20
Ideas?</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2>thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2>Erez.</FONT></SPAN></DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D821094116-26122005><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C60A3F.59619187--


-------------------------------------------------------
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_id=7637&alloc_id=16865&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:57 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0