function ip2int($s)
{
- $v = ip2long($s);
+ return (ip2long($s));
+}
+
+function int2ip($i)
+{
+ return (long2ip($i));
+}
+
+function int2four($l)
+{
if (PHP_INT_SIZE == 4)
- return ($v);
+ return ($l);
- return ( ($v & 0x80000000 ? 0xffffffff00000000 : 0x00) | $v );
+ return ( ($l & 0x80000000 ? 0xffffffff00000000 : 0x00) | $l );
}
-function int2ip($i)
+function four2int($s)
+{
+ return ($s & 0xffffffff);
+}
+
+function ip2four($s)
+{
+ return int2four( ip2int($s) );
+}
+
+function four2ip($i)
{
- return long2ip($i & 0xffffffff);
+ return int2ip( four2int($i) );
}
function nickserv_msg($dt, $msg) {