#31772 [Opn]: [PATCH] Net-SNMP 5.2.x ++ Workaround in PHP_SNMP Incorrectly Coded
| From: | harrie@php.net | Date: | Wed, 16 Mar 2005 12:52:41 +0000 |
| Subject: | #31772 [Opn]: [PATCH] Net-SNMP 5.2.x ++ Workaround in PHP_SNMP Incorrectly Coded | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76924@lists.php.net to get a copy of this message | ||
ID: 31772
Updated by: harrie@php.net
Reported By: harrie@php.net
Status: Open
Bug Type: SNMP related
Operating System: Win32
PHP Version: 5.0.3
New Comment:
As for creating a set_version function this is not
useful if in a single PHP script multiple SNMP versions
are needed. This is not that unlikely if one wants to
access more then one single SNMP agent.
A better solution would be to setup a SNMP session and use
this struct as the argument for SNMP retrieval functions.
But since backwards compatibility seems an issue the
solution of adding version specific functions is easier.
Maybe even clearer to a user (PHP programmer).
Previous Comments:
------------------------------------------------------------------------
[2005-03-16 13:47:39] harrie@php.net
I do not see this patch as the correct solution.
It duplicates the same function of parsing the SNMPv1
arguments with the exception of the version itself.
Therefore, a proper solution would be to add a version
parameter to the parsing of the SNMPv1 arguments and
use that to configure the version.
This avoids the duplicated code where the handling of
SNMPv1 and SNMPv2c (both community based) are simply
equal except the version number.
------------------------------------------------------------------------
[2005-03-06 20:39:11] LarryJAdams at comcast dot net
I had the same question for Harrie (one of the authors) and he did not
want to go that way. However, there is another workaround that was
sent to me by another user that could be incorporated except for the
"bulk" operations.
Either way, this code works and the SNMPv3 is so different anyway, we
can't go down to one function easily.
------------------------------------------------------------------------
[2005-03-06 17:40:06] sniper@php.net
What's wrong with adding something like 'snmp_set_version()' func
instead of having separate functions for v1/v2/v3 ???
------------------------------------------------------------------------
[2005-03-01 01:24:53] LarryJAdams at comcast dot net
The prior post was for the snmp.c files. The php_snmp.h files are
patched as follows:
php_snmp.h for php4.3.x
http://home.comcast.net/~larryjadams/php_snmp.4.3.x.diff
php_snmp.h for php5.0.x
http://home.comcast.net/~larryjadams/php_snmp.5.0.x.diff
php_snmp.h for php5.1.x
http://home.comcast.net/~larryjadams/php_snmp.5.1.x.diff
TheWitness
------------------------------------------------------------------------
[2005-03-01 00:52:58] LarryJAdams at comcast dot net
Your links are as follows:
php_snmp for php4.3.x
http://home.comcast.net/~larryjadams/snmp4.3.x.diff
php_snmp for php5.0.x
http://home.comcast.net/~larryjadams/snmp5.0.x.diff
php_snmp for php5.1.x
http://home.comcast.net/~larryjadams/snmp5.1.x.diff
TheWitness
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/31772
--
Edit this bug report at http://bugs.php.net/?id=31772&edit=1