On Mon, 2005-04-18 at 14:08, Patrick Welche wrote: > On Mon, Apr 18, 2005 at 01:43:37PM +0100, Dave Shield wrote:
> > With the old v4 distributions (and even with v5, given a configure > > choice of SNMPv1 or SNMPv2c as the default version), then > > > > snmp_sess_init( &sess ); > > ss1 = snmp_open( &sess ); > > ss2 = snmp_open( &sess ); > > so this seems to be the real answer to my question on -users.. > this gives a case for not using the single session API (you used > snmp_open rather than snmp_sess_open) Sorry, that's something of a red-herring. The v3 engine probe handling comes at a lower level than the question of traditional-vs-SSI APIs. In fact, the traditional approach is implemented as a wrapper round the SSI call, and both of these end up calling an internal '_sess_open' routine (which then probes for the v3 engine ID). > > [I can't believe that I'm arguing to change this, having already > > documented this behaviour in the client-side programming chapter!] > > Where can I read this chapter? It looks promising: Where? In a (yet-to-be-published) book that I've been writing for the last three years or more! > Sure I can look > at the tutorial, but I could recode each tutorial using functions > out of snmp_client.h rather than snmp_api.h, <wry grin> Yes - the division of code between snmp_client.h and snmp_api.h isn't particularly clear or well defined. One of my (many) plans for this project has been to tidy up the structure of the library code. > single session API rather > than the plain snmp_open, snmp_parse_pdu rather than read_objid > etc. but there doesn't seem to be anywhere which says something > like "Unless you are really writing a multithreaded application, > steer clear of snmp_sess_open and stick to snmp_open" The closest thing for that would be README.thread.... > i.e., style recommendations / ... and CodingStyle > what is the actual API as opposed to a function > found under the bonnet / Again - one of the aims for the library re-write (see the provisional division of headers into <net-snmp/xxx_api.h> vs <net-snmp/library/xxx.h>) > what the intended use of the functions is... Partially handled by in-line Doxygen comments. But nowhere near enough. > Hopefully I'm missing something and could can say > "just read <url>" :-) That'd be nice, yes. Unfortunately, as with many Open Source projects, most of the active developers are more interested in writing code than documentation! I'd like to pretend that my book would be the answer to all your needs. But it won't. It'll cover a certain amount (like the difference between snmp_open and snmp_sess_open), but is more aimed at what you'd need to know in order to develop SNMP applications and agent modules, rather than covering every little bit of the Net-SNMP internals. It's already too long as it is! Dave ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders