
Hi, I have a MIB and I have to write routines to convert the MIB into a 'C' data structure with all the parameters and routines accessing these parameters(set, get operations). These routines have to be 'C' routines. Can I use libsmi for my requirement?? If yes, can anyone guide me in generating 'C' routines??
thanks in advance, Kishore.
-- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

Krishna Kishore K R writes:
Krishna> Hi, I have a MIB and I have to write routines to convert the Krishna> MIB into a 'C' data structure with all the parameters and Krishna> routines accessing these parameters(set, get Krishna> operations). These routines have to be 'C' routines. Can I Krishna> use libsmi for my requirement?? If yes, can anyone guide me Krishna> in generating 'C' routines??
Sounds like libsmi is just the right thing you need. I suggest to look at the dump-stools.c or dump-netsnmp.c output drivers of the smidump utility as a starting point. If you know how the C routines should look like, than it is just a matter of some relatively trivial programming to produce the desired output.
(I think the dump-stools.c driver currently only exists in the anon CVS repository.)
/js
-- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

Juergen Schoenwaelder wrote:
Sounds like libsmi is just the right thing you need. I suggest to look at the dump-stools.c or dump-netsnmp.c output drivers of the smidump utility as a starting point. If you know how the C routines should look like, than it is just a matter of some relatively trivial programming to produce the desired output.
libsmi can certainly be used for such a task, but it looks to me like Kishore is being asked to implement an SNMP agent. In that case a more convenient approach (esp if one does not have advanced SNMP knowledge) is to use a toolkit for developing an extensible agent where you have a master agent/subagent decomposition where the subagent associates data structures in its address space with various MIB objects based on a API.
A commercial example of such a toolkit would be the PATROL SNMP toolkit from BMC Software.
Saurabh
____________________________________________________________________________ Saurabh Jang iDEN OMC Software, GTSS, Motorola Inc. Lead Software Engineer Email : Saurabh.Jang@motorola.com 1301 E. Algonquin Road, IL02-3346 Phone : +1-847-576-2630 Schaumburg, IL 60196, USA Fax : +1-847-538-5564 ____________________________________________________________________________ -- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

Hi!
Sounds like libsmi is just the right thing you need. I suggest to look at the dump-stools.c or dump-netsnmp.c output drivers of the smidump utility as a starting point. If you know how the C routines should look like, than it is just a matter of some relatively trivial programming to produce the desired output.
Saurabh> libsmi can certainly be used for such a task, but it looks to me Saurabh> like Kishore is being asked to implement an SNMP agent. In that case Saurabh> a more convenient approach (esp if one does not have advanced SNMP Saurabh> knowledge) is to use a toolkit for developing an extensible agent Saurabh> where you have a master agent/subagent decomposition where the Saurabh> subagent associates data structures in its address space with various Saurabh> MIB objects based on a API.
Saurabh> A commercial example of such a toolkit would be the PATROL SNMP Saurabh> toolkit from BMC Software.
A master-agent/sub-agent decomposition can also be achieved with the NET-SNMP toolkit based on the Standard AgentX technology, without any modification to the agent code.
-frank -- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

Hi!
Krishna> I have a MIB and I have to write routines to convert the MIB Krishna> into a 'C' data structure with all the parameters and routines Krishna> accessing these parameters(set, get operations). These Krishna> routines have to be 'C' routines. Can I use libsmi for my Krishna> requirement?? If yes, can anyone guide me in generating 'C' Krishna> routines??
Do you have to implement a manager that should make use of compiler generated MIB access functions? Then the smidump `stools' driver can be, what you are looking for (smidump -f stools <MIB>). This compiler driver creates C data structures and stubs to be used by the stools.
If you have to implement an agent module that should make use of a compiler generated template, then you might want to take a look at the smidump `net-snmp' driver (smidump -f netsnmp <MIB>). It generates C code for the NET-SNMP agent toolkit.
Note, that both drivers are under development. The latest drivers are not yet included with the libsmi tarballs. Please use the anonymous CVS repository, instead, as explained on the libsmi web pages.
http:/www.ibr.cs.tu-bs.de/projects/stools/ http://net-snmp.sourceforge.net/
-frank -- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.
participants (4)
-
Frank Strauss
-
Juergen Schoenwaelder
-
Krishna Kishore K R
-
Saurabh Jang