aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAli Sabil <[email protected]>2013-06-19 22:32:44 +0200
committerFredrik Gustafsson <[email protected]>2013-10-10 11:49:39 +0200
commit442d802ae4b8a75d69c37d0d5251d4198c642624 (patch)
treec10b9c6f384eaf4a9596376a089d6ad90508cd35 /lib
parent3abf1b5ef82478b152581152ad3ec749e8b7edaa (diff)
downloadotp-442d802ae4b8a75d69c37d0d5251d4198c642624.tar.gz
otp-442d802ae4b8a75d69c37d0d5251d4198c642624.tar.bz2
otp-442d802ae4b8a75d69c37d0d5251d4198c642624.zip
Fix the typespec for the inet:ifget/2 and inet:ifget/3 return value
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/inet.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl
index 27f085c3aa..d4c78505da 100644
--- a/lib/kernel/src/inet.erl
+++ b/lib/kernel/src/inet.erl
@@ -120,6 +120,17 @@
'addr' | 'broadaddr' | 'dstaddr' |
'mtu' | 'netmask' | 'flags' |'hwaddr'.
+-type if_getopt_result() ::
+ {'addr', ip_address()} |
+ {'broadaddr', ip_address()} |
+ {'dstaddr', ip_address()} |
+ {'mtu', non_neg_integer()} |
+ {'netmask', ip_address()} |
+ {'flags', ['up' | 'down' | 'broadcast' | 'no_broadcast' |
+ 'pointtopoint' | 'no_pointtopoint' |
+ 'running' | 'multicast' | 'loopback']} |
+ {'hwaddr', ether_address()}.
+
-type address_family() :: 'inet' | 'inet6'.
-type socket_protocol() :: 'tcp' | 'udp' | 'sctp'.
-type socket_type() :: 'stream' | 'dgram' | 'seqpacket'.
@@ -266,13 +277,13 @@ getiflist() ->
-spec ifget(Socket :: socket(),
Name :: string() | atom(),
Opts :: [if_getopt()]) ->
- {'ok', [if_setopt()]} | {'error', posix()}.
+ {'ok', [if_getopt_result()]} | {'error', posix()}.
ifget(Socket, Name, Opts) ->
prim_inet:ifget(Socket, Name, Opts).
-spec ifget(Name :: string() | atom(), Opts :: [if_getopt()]) ->
- {'ok', [if_setopt()]} | {'error', posix()}.
+ {'ok', [if_getopt_result()]} | {'error', posix()}.
ifget(Name, Opts) ->
withsocket(fun(S) -> prim_inet:ifget(S, Name, Opts) end).