diff options
author | Zandra <[email protected]> | 2015-10-12 16:44:43 +0200 |
---|---|---|
committer | Zandra <[email protected]> | 2015-10-12 16:44:43 +0200 |
commit | 1ee7a4e26e66aac66ee5a17c752e0a518c07ad10 (patch) | |
tree | c8b93fc5f53fd6192481425b3067a62f17b89ef0 /lib/kernel/src/inet6_tcp.erl | |
parent | 6326eb0c87c97ac463220cdc5138c3694e5ef7ec (diff) | |
parent | 8266a6056ff3b4292d98485665e5444addd689b6 (diff) | |
download | otp-1ee7a4e26e66aac66ee5a17c752e0a518c07ad10.tar.gz otp-1ee7a4e26e66aac66ee5a17c752e0a518c07ad10.tar.bz2 otp-1ee7a4e26e66aac66ee5a17c752e0a518c07ad10.zip |
Merge branch 'stolen/unified_dist' into maint
OTP-13040
* stolen/unified_dist:
kernel: inet6_tcp_dist: reuse inet_tcp_dist code
Conflicts:
lib/kernel/src/inet_tcp_dist.erl
Diffstat (limited to 'lib/kernel/src/inet6_tcp.erl')
-rw-r--r-- | lib/kernel/src/inet6_tcp.erl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/kernel/src/inet6_tcp.erl b/lib/kernel/src/inet6_tcp.erl index 2ea017285c..1978307b3c 100644 --- a/lib/kernel/src/inet6_tcp.erl +++ b/lib/kernel/src/inet6_tcp.erl @@ -25,10 +25,29 @@ -export([controlling_process/2]). -export([fdopen/2]). +-export([family/0, mask/2, parse_address/1]). -export([getserv/1, getaddr/1, getaddr/2, getaddrs/1, getaddrs/2]). -include("inet_int.hrl"). +%% my address family +family() -> inet6. + +%% Apply netmask on address +mask({M1,M2,M3,M4,M5,M6,M7,M8}, {IP1,IP2,IP3,IP4,IP5,IP6,IP7,IP8}) -> + {M1 band IP1, + M2 band IP2, + M3 band IP3, + M4 band IP4, + M5 band IP5, + M6 band IP6, + M7 band IP7, + M8 band IP8 }. + +%% Parse address string +parse_address(Host) -> + inet_parse:ipv6strict_address(Host). + %% inet_tcp port lookup getserv(Port) when is_integer(Port) -> {ok, Port}; getserv(Name) when is_atom(Name) -> inet:getservbyname(Name,tcp). |