Re: Re: cvs: php4 /ext/snmp CREDITS php_snmp.h snmp.c
| From: | Harrie Hazewinkel | Date: | Wed, 13 Nov 2002 06:35:47 +0000 |
| Subject: | Re: Re: cvs: php4 /ext/snmp CREDITS php_snmp.h snmp.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-90950@lists.php.net to get a copy of this message | ||
--On Wednesday, November 13, 2002 2:33 AM +0200 Jani Taskinen <sniper@iki.fi> wrote:
Maybe it would be good idea to do something like
LDAP extension does? ie. have something similar to ldap_set_option()
to set the protocol version to be used? And have same
functions and thus not pollute the function namespace anymore?
This is an option, but then you put a bigger burden on the script
developer. It is very likely possible that SNMPv1 and SNMPv3 calls
are done in various orders in a script. Mainly because not all devices
support SNMPv3 yet.
So from not polluting the C-code portion and the function names used
you go and pollute the scripts. IMHO, that is not a good idea either
and that for just a version number. We as PHP developers of the C-part
should not forget we make this for others and we better make it as
easy as possible for them. Not for us or that things just look better.
An idea could be that a the complete 'session' is create and that is
then given to the data retrieval functions like snmpget.
A create_session would provide all parameters and the combined
arguments go into the data retrieval part by menas of the C-struct
'struct snmp_session' that is used.
iirc, the snmp command line tools have an option to select
which protocol version to use?
That is correct. However, I tried to avoid that. The
parameters betwen SNMPv1 and SNMPv3 are completely different.
Harrie
Internet Management Consulting
mailto: harrie@lisanza.net http://www.lisanza.net/-------------------------------------------------------------------- Author of MOD-SNMP, enabling SNMP management the Apache HTTP server