aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/inet_tcp.erl
diff options
context:
space:
mode:
authorZandra <[email protected]>2015-10-12 16:44:43 +0200
committerZandra <[email protected]>2015-10-12 16:44:43 +0200
commit1ee7a4e26e66aac66ee5a17c752e0a518c07ad10 (patch)
treec8b93fc5f53fd6192481425b3067a62f17b89ef0 /lib/kernel/src/inet_tcp.erl
parent6326eb0c87c97ac463220cdc5138c3694e5ef7ec (diff)
parent8266a6056ff3b4292d98485665e5444addd689b6 (diff)
downloadotp-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/inet_tcp.erl')
-rw-r--r--lib/kernel/src/inet_tcp.erl16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/kernel/src/inet_tcp.erl b/lib/kernel/src/inet_tcp.erl
index b5c758c02c..f551af9709 100644
--- a/lib/kernel/src/inet_tcp.erl
+++ b/lib/kernel/src/inet_tcp.erl
@@ -27,11 +27,25 @@
-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() -> inet.
+
+%% Apply netmask on address
+mask({M1,M2,M3,M4}, {IP1,IP2,IP3,IP4}) ->
+ {M1 band IP1,
+ M2 band IP2,
+ M3 band IP3,
+ M4 band IP4}.
+
+%% Parse address string
+parse_address(Host) ->
+ inet_parse:ipv4strict_address(Host).
+
%% inet_tcp port lookup
getserv(Port) when is_integer(Port) -> {ok, Port};
getserv(Name) when is_atom(Name) -> inet:getservbyname(Name,tcp).