1 diff -urN Net_IPv6-1.2.1.org/Net/IPv6.php Net_IPv6-1.2.1/Net/IPv6.php
2 --- Net_IPv6-1.2.1.org/Net/IPv6.php 2011-02-07 22:41:59.000000000 +0100
3 +++ Net_IPv6-1.2.1/Net/IPv6.php 2017-12-08 11:59:42.918728932 +0100
8 - function separate($ip)
9 + public static function separate($ip)
17 - function removeNetmaskSpec($ip)
18 + public static function removeNetmaskSpec($ip)
21 $elements = Net_IPv6::separate($ip);
23 * @see removeNetmaskSpec()
26 - function removePrefixLength($ip)
27 + public static function removePrefixLength($ip)
29 $pos = strrpos($ip, '/');
35 - function getNetmaskSpec($ip)
36 + public static function getNetmaskSpec($ip)
39 $elements = Net_IPv6::separate($ip);
44 - function getPrefixLength($ip)
45 + public static function getPrefixLength($ip)
47 if (preg_match("/^([0-9a-fA-F:]{2,39})\/(\d{1,3})*$/",
53 - function getNetmask($ip, $bits = null)
54 + public static function getNetmask($ip, $bits = null)
62 - function isInNetmask($ip, $netmask, $bits=null)
63 + public static function isInNetmask($ip, $netmask, $bits=null)
65 // try to get the bit count
68 * @see NET_IPV6_LOOPBACK
69 * @see NET_IPV6_UNKNOWN_TYPE
71 - function getAddressType($ip)
72 + public static function getAddressType($ip)
74 $ip = Net_IPv6::removeNetmaskSpec($ip);
75 $binip = Net_IPv6::_ip2Bin($ip);
77 * Uncompresses an IPv6 adress
79 * RFC 2373 allows you to compress zeros in an adress to '::'. This
80 - * function expects an valid IPv6 adress and expands the '::' to
81 + * public static function expects an valid IPv6 adress and expands the '::' to
84 * Example: FF01::101 -> FF01:0:0:0:0:0:0:101
87 * @author Pascal Uhlmann
89 - function uncompress($ip, $leadingZeros = false)
90 + public static function uncompress($ip, $leadingZeros = false)
93 $prefix = Net_IPv6::getPrefixLength($ip);
95 * Compresses an IPv6 adress
97 * RFC 2373 allows you to compress zeros in an adress to '::'. This
98 - * function expects an valid IPv6 adress and compresses successive zeros
99 + * public static function expects an valid IPv6 adress and compresses successive zeros
102 * Example: FF01:0:0:0:0:0:0:101 -> FF01::101
105 * @author elfrink at introweb dot nl
107 - function compress($ip, $force = false)
108 + public static function compress($ip, $force = false)
111 if(false !== strpos($ip, '::')) { // its already compressed
114 * @author Manuel Schmitt
116 - function isCompressible($ip)
117 + public static function isCompressible($ip)
120 return (bool)($ip != Net_IPv6::compress($address));
125 - function SplitV64($ip, $uncompress = true)
126 + public static function SplitV64($ip, $uncompress = true)
128 $ip = Net_IPv6::removeNetmaskSpec($ip);
134 - function checkIPv6($ip)
135 + public static function checkIPv6($ip)
137 $ip = Net_IPv6::removePrefixLength($ip);
138 $ip = Net_IPv6::removeNetmaskSpec($ip);
140 * @author Nicholas Williams
143 - function parseAddress($ipToParse, $bits = null)
144 + public static function parseAddress($ipToParse, $bits = null)
152 - function _ip2Bin($ip)
153 + protected static function _ip2Bin($ip)
157 @@ -1013,7 +1013,7 @@
161 - function _bin2Ip($bin)
162 + protected static function _bin2Ip($bin)