aboutsummaryrefslogtreecommitdiff
path: root/src/jlib.erl
diff options
context:
space:
mode:
authorMickaël Rémond <mickael.remond@process-one.net>2008-05-14 17:49:23 +0000
committerMickaël Rémond <mickael.remond@process-one.net>2008-05-14 17:49:23 +0000
commit1f91eb0b1139e7a134e3c8300a9d74f07cdda911 (patch)
tree7927b5b848ad0626064e37f16980d63ead96b68f /src/jlib.erl
parentAdded missing ejabberd-2.0.0 tag. (diff)
* Adding experimental branch.
SVN Revision: 1324
Diffstat (limited to 'src/jlib.erl')
-rw-r--r--src/jlib.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/jlib.erl b/src/jlib.erl
index 1ee2e4ffa..4fd897599 100644
--- a/src/jlib.erl
+++ b/src/jlib.erl
@@ -59,7 +59,8 @@
now_to_local_string/1,
datetime_string_to_timestamp/1,
decode_base64/1,
- encode_base64/1]).
+ encode_base64/1,
+ ip_to_list/1]).
-include("jlib.hrl").
@@ -676,3 +677,9 @@ e(X) when X>51, X<62 -> X-4;
e(62) -> $+;
e(63) -> $/;
e(X) -> exit({bad_encode_base64_token, X}).
+
+%% Convert Erlang inet IP to list
+ip_to_list({IP, _Port}) ->
+ ip_to_list(IP);
+ip_to_list({A,B,C,D}) ->
+ lists:flatten(io_lib:format("~w.~w.~w.~w",[A,B,C,D])).