xref: /PHP-5.4/ext/snmp/tests/ipv6.phpt (revision 85d9d85c)
1--TEST--
2IPv6 support
3--CREDITS--
4Boris Lytochkin
5--SKIPIF--
6<?php
7require_once(dirname(__FILE__).'/skipif.inc');
8
9$packed = str_repeat(chr(0), 15) . chr(1);
10if (@inet_ntop($packed) === false) {
11	die("skip no IPv6 support");
12}
13?>
14--FILE--
15<?php
16require_once(dirname(__FILE__).'/snmp_include.inc');
17
18//EXPECTF format is quickprint OFF
19snmp_set_quick_print(false);
20snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
21
22var_dump(snmpget($hostname6_port, $community, '.1.3.6.1.2.1.1.1.0'));
23var_dump(snmpget('[dead:beef::', $community, '.1.3.6.1.2.1.1.1.0'));
24?>
25--EXPECTF--
26%unicode|string%(%d) "%s"
27
28Warning: snmpget(): malformed IPv6 address, closing square bracket missing in %s on line %d
29bool(false)