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