projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add ip2int and int2ip functions to be able to store on pg IPV4 ip addresses
[brisk.git]
/
web
/
Obj
/
brisk.phh
diff --git
a/web/Obj/brisk.phh
b/web/Obj/brisk.phh
index
6c18990
..
f221518
100644
(file)
--- a/
web/Obj/brisk.phh
+++ b/
web/Obj/brisk.phh
@@
-345,6
+345,20
@@
$G_PG_cons_n = 345;
/* printf("\n"); */
/* } */
/* printf("\n"); */
/* } */
+function ip2int($s)
+{
+ $v = ip2long($s);
+ if (PHP_INT_SIZE == 4)
+ return ($v);
+
+ return ( ($v & 0x80000000 ? 0xffffffff00000000 : 0x00) | $v );
+}
+
+function int2ip($i)
+{
+ return long2ip($i & 0xffffffff);
+}
+
function nickserv_msg($dt, $msg) {
return sprintf('chatt_sub("%s",[0x040003,"%s"],"%s");', $dt, NICKSERV, $msg);
}
function nickserv_msg($dt, $msg) {
return sprintf('chatt_sub("%s",[0x040003,"%s"],"%s");', $dt, NICKSERV, $msg);
}