php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch php_bug42918.diff for SNMP related Bug #42918

Patch version 2011-08-21 23:35 UTC

Return to Bug #42918 | Download this patch
Patch Revisions:

Developer: ch@php.net

Index: tests/snmpget.phpt
===================================================================
--- tests/snmpget.phpt	(Revision 315258)
+++ tests/snmpget.phpt	(Arbeitskopie)
@@ -46,6 +46,8 @@
 echo "Multiple OID\n";
 var_dump(snmpget($hostname, $community, array('.1.3.6.1.2.1.1.1.0', '.1.3.6.1.2.1.1.3.220'), $timeout, $retries));
 
+echo "IPv6 adresses\n";
+var_dump(snmpget($hostname6, $community, '.1.3.6.1.2.1.1.1.0', $timeout, $retries));
 
 ?>
 --EXPECTF--
@@ -107,3 +109,5 @@
   ["%s"]=>
   %unicode|string%(%d) "%s"
 }
+IPv6 adresses
+%unicode|string%(%d) "%s"
\ No newline at end of file
Index: tests/snmp_include.inc
===================================================================
--- tests/snmp_include.inc	(Revision 315258)
+++ tests/snmp_include.inc	(Arbeitskopie)
@@ -7,6 +7,7 @@
 */
 
 $hostname =	getenv('SNMP_HOSTNAME')		? getenv('SNMP_HOSTNAME') :	'127.0.0.1';
+$hostname6 =	getenv('SNMP_HOSTNAME6')        ? getenv('SNMP_HOSTNAME6') :	'udp6:[::1]';
 $port =		getenv('SNMP_PORT')		? getenv('SNMP_PORT') :		'161';
 $hostname .= ":$port";
 $community =	getenv('SNMP_COMMUNITY')	? getenv('SNMP_COMMUNITY') :	'public';
Index: tests/snmp-object.phpt
===================================================================
--- tests/snmp-object.phpt	(Revision 315258)
+++ tests/snmp-object.phpt	(Arbeitskopie)
@@ -30,6 +30,11 @@
 var_dump($session->getnext('.1.3.6.1.2.1.1.1.0'));
 var_dump($session->close());
 
+echo "SNMPv2 with IPv6 adresses\n";
+$session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
+var_dump($session->get('.1.3.6.1.2.1.1.1.0'));
+var_dump($session->close());
+
 echo "GET with preserving original OID names\n";
 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
 $orig = array('.1.3.6.1.2.1.1.1.0', '.1.3.6.1.2.1.1.5.0');
@@ -144,6 +149,9 @@
 string(%d) "%S"
 string(%d) "%S"
 bool(true)
+SNMPv2 with IPv6 adresses
+string(%d) "%S"
+bool(true)
 GET with preserving original OID names
 string(%d) "%s"
 string(%d) "%s"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 20:01:27 2024 UTC