Hi Gabriele, Thanks for reply!
On Mon, Mar 16, 2009 at 12:07:42PM +0100, Gabriele Messineo wrote: > the changes seem fine and the code really clean. Thanks. > - I think too that VarList is an added complexity. > However, your implementation seems to me like a good tradeoff > to keep > backward-compatibility and promote new style coding (by declaring the VarList > class inheriting the list class). You can add a comment or a programming > guideline in which you can discourage its usage, suggesting the use of simple > python lists. Yes, if my changes will be applied to mainline I'll add it to documentation. > - The Varbind tag <-> iid attributes have ever been a source of > confusion > (and unexpected behaviors). > IMHO I would really remove the iid attribute (I'm actually > using only > the 'tag' one only)... I'm not sure if there's an equivalent property in > other snmplib bindings. It would only be a matter of taste... is there anyone > using it? > But I wouldn't introduce a new attribute 'name', can't we reuse > the 'tag' > one (or support both 'name' and 'tag' names to access the same information)? > (if not we are effectively forcing anyone to change its code). I implement this idea in the experimental branch[1]. So, I left tag, val, type members of Varbind. > - the Session object > if I understood it right you're proposing to give only the > possibility to > set but not to get some members like SecName, ... am I right? So when I'm > creating a new Session object the Python binding pass 'em directly to snmplib > without keeping track. That's a 'security' question... it's unsafe to keep > track of too much informations and you're right to be wanting to avoid it. > The only issue it would be a 'transparent' reuse of snmplib from the binding > (eg: the binding that reset the library out-of- python code control), that > would become impratical. Are there situation where this behavior can be > useful (like asynchronous calls)? More yes. Sorry for my English. I mean that some members of the class Session not needed. Most of them are used only during initialization of object (passed to net-snmp create session). Does not make sense to set members in runtime (excluding some, such as UseLongNames, ...). Why keep them in the object? (The issue of security is also here) > - the snmplib > well, I'm not an snmplib coder, so I would skip this question, > however, for > the little I saw, actual binding code has a lot of duplicated > functionalities... I think you can easily find them by comparing the > following implementations: > > python/netsnmp/client_intf.c:netsnmp_get() > apps/snmpget.c:main() > perl/SNMP/SNMP.xs:snmp_get() > > these codes would do in practice the same. it's just right to > think to share > some code. Just think at > [__is_numeric_oid, __is_leaf, __translate_appl_type, __translate_asn_type, > __snprint_value, __sprint_num_objid, __scan_num_objid, __get_type_str, > __get_label_iid, ... ] (these are implemented in both python and perl > bindings, they share the same code, but somehow they differs, probably > different bug fixes...). > All of that is already handled in the apps code. I think you > can find a > common way to translate the parsing of the input parameters (probably the > bindings should share a lot of code except for different error reporting / > return codes and parameters parsing functionalities). In experimental[1] I started working on this. Parsing tag is already handled by snmplib, etc. Changes has not been sufficiently tested. But it's works. :) [1] To get experimental branch: $ git clone git://git.sgu.ru/net-snmp.git $ git checkout -t -b experimental origin/experimental or via gitweb: http://git.sgu.ru/?p=net-snmp.git;a=shortlog;h=refs/heads/experimental -- 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