On Tue, 2009-08-18 at 17:58 +0200, Prados, Cesar wrote:
> Hello,
>
> I'm really non an expert in SNMP but I'd be interested in the
> capabilities of SNMP over IEEE 802 Networks. I saw that this task is
> in the TO-DO list waiting to be grasped, and I could collaborate in
> this, but I'd need some mastermind to lead me in the begining to avoid
> not see the wood for the trees. So I don't know how this project works
> but if someone could help me to start, aside the doc that it's already
> available in the wiki.
Well, the simple part is about how to define a new transport.
I think the easiest would be if you started with an already available
transport and then modified it, I would suggest the IPX transport as a
base since that contains just the transport and no cruft.
Transports are usually defined in two files, snmplib/snmp<NAME>Domain.c
and include/net-snmp/library/snmp<NAME>Domain.h.
They are then instantiated from snmplib/snmp_transport.c and that is
also where any OID describing the transport is located.
The only function that need to be nonstatic in the transport module is
the constructor, in the IPX case that is netsnmp_ipx_ctor.
All public function names should be prefixed with netsnmp_.
The constructor returns a netsnmp_tdomain* that is filled in with data
about the transport, the domain names to match and how to create a
transport instance.
name - OID that identifies the transport
name_length - The length of the OID
prefix - NULL-terminated array of strings. prefix[0] is the name that
is used to describe the transport.
f_create_from_tstring - Deprecated, set to NULL.
f_create_from_ostring - Used to create a transport from an OID sequence,
usually just a wrapper around f_create_from_tstring_new
f_create_from_tstring_new - Used to create a transport from a name. The
first argument is what the user entered minus the prefix. The
second argument is a flag that tells if this is a client or a
server socket and the third argument is the default address to
use if some part of the user address was missing. An example of
a default address is ":161" that is used for SNMP over TCP or
UDP.
Now the transport structure that you return from the f_create_*
functions represents a connection ready to listen for events.
The file descriptor must exist.
Ask if there is more you wish to know.
Now to the hard part:
How to implement the actual access to the link layer. I looked on this a
couple of years back (but it looks like I have misplaced that code...)
and had a half working linux only solution using the linux llc headers.
This I think isn't very hard to get up and working.
A more ambitious approach is to use some portable library, I think there
was one the direction of packetfilter or some such thing, and implement
it on top of that but remember that you still must have access to a
selectable socket.
/MF
> Cheers,
>
> Cesar
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________ Net-snmp-coders mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders