Hi folks,

I'm working to improve python bindings. Already done:
 * Session rewritten in C (removed a lot of unsafe transfers from python 
   to C and vice versa.
 * Added exceptions for errors handling
 * Reviewed/refactored/rewritten half of code


Unfortunately, I changed the interface of Session::get*(), Session::set()
functions. get*() takes as argument python list of Varbinds and returns
_new_ list of Varbinds with filled values and types. set() returns None.
All raise exceptions if error has occurred. (Next, also get*() will take
callback and return None for asynchronous call and a simple Varbind may be
passed to functions) It's ok?

I remind that in the current code get*() takes VarList  of Varbinds as
argument, changes the VarList and returns tuple ".val"s of Varbinds.
VarList - this is wrapper of python list.
http://git.sgu.ru/?p=net-snmp.git;a=blob;f=net-snmp/python/netsnmp/client.py;h=c7f1ac7e06e00112f19c1286a4876d28885e6477;hb=upstream#l66

My changes makes VarList unnecessary, functions's behavior more transparent
and clear.

So, I have a few questions about the next work.

Session members. I think, the Session object contains a lot of not
required members, a change that is no affected (such as, SecName,
SecSecEngineId, etc.). Also struct netsnmp_session contains part of these
members in readable form. Maybe leave only the main members, that can be
obtained from netsnmp_session (such as, .Use*, .DestHost, ports, etc.)?

To simplify the part of C code, Varbind in C needed (also for removing
a lot of transfers Python <-> C). May I merge tag and iid to simple ".name".
The snmplib allows me to work with the simple "name" in the bindings.

Setting output format. In the current code output format is set at the
library-wide.
http://git.sgu.ru/?p=net-snmp.git;a=blob;f=net-snmp/python/netsnmp/client_intf.c;h=bf0e7fe368b5601fe6fec9b832f1272e7ff4909d;hb=upstream#l1468
Maybe using NETSNMP_DS_APPLICATION_ID level and doesn't restore "old_format"?

I want to usе more snmplib, as is done in Net-SNMP "apps". Could you point me
to where the bindings code, makes what already implemented in snmplib?

Thanks!

P.S. Before implementing the new features, I would like to simplify and fix
current code.

-- 

John Khvatov

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to