diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2020-05-29 18:40:19 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2020-05-29 18:40:19 +0200 |
commit | 7a37483307e1f62c750ecde8a088edacbe03c51f (patch) | |
tree | e42a4de7fc0c2524b81a75f73d88200b4a5baa6d /src/misc.erl | |
parent | Modify ERL_LDFLAGS of deps when compiling on R23 on rebar2 (diff) |
Rename 'turn_v4_ip' and 'turn_v6_ip' options
The 'turn_ipv4_address' and 'turn_ipv6_address' option names are
probably more intuitive.
Diffstat (limited to 'src/misc.erl')
-rw-r--r-- | src/misc.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/misc.erl b/src/misc.erl index bb9d39d8..3b65aa55 100644 --- a/src/misc.erl +++ b/src/misc.erl @@ -40,8 +40,8 @@ read_css/1, read_img/1, read_js/1, read_lua/1, try_url/1, intersection/2, format_val/1, cancel_timer/1, unique_timestamp/0, is_mucsub_message/1, best_match/2, pmap/2, peach/2, format_exception/4, - get_my_v4_ip/0, get_my_v6_ip/0, parse_ip_mask/1, match_ip_mask/3, - format_hosts_list/1, format_cycle/1, delete_dir/1]). + get_my_ipv4_address/0, get_my_ipv6_address/0, parse_ip_mask/1, + match_ip_mask/3, format_hosts_list/1, format_cycle/1, delete_dir/1]). %% Deprecated functions -export([decode_base64/1, encode_base64/1]). @@ -509,16 +509,16 @@ format_exception(Level, Class, Reason, Stacktrace) -> end). -endif. --spec get_my_v4_ip() -> inet:ip4_address(). -get_my_v4_ip() -> +-spec get_my_ipv4_address() -> inet:ip4_address(). +get_my_ipv4_address() -> {ok, MyHostName} = inet:gethostname(), case inet:getaddr(MyHostName, inet) of {ok, Addr} -> Addr; {error, _} -> {127, 0, 0, 1} end. --spec get_my_v6_ip() -> inet:ip6_address(). -get_my_v6_ip() -> +-spec get_my_ipv6_address() -> inet:ip6_address(). +get_my_ipv6_address() -> {ok, MyHostName} = inet:gethostname(), case inet:getaddr(MyHostName, inet6) of {ok, Addr} -> Addr; |