diff options
author | Fredrik Gustafsson <[email protected]> | 2013-10-11 10:32:02 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-10-11 10:32:02 +0200 |
commit | 858c211223071184b533973e966643f6aba0cbc3 (patch) | |
tree | 5b481ee881737b9281bdb494be16aa8e4becf9b4 /lib/kernel/src/inet.erl | |
parent | 5a6baf6a221f5d862c78b521bd86800ebd41f450 (diff) | |
parent | c63d1054f837a935cb441fa23021bb8913dd8a12 (diff) | |
download | otp-858c211223071184b533973e966643f6aba0cbc3.tar.gz otp-858c211223071184b533973e966643f6aba0cbc3.tar.bz2 otp-858c211223071184b533973e966643f6aba0cbc3.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/kernel/src/inet.erl')
-rw-r--r-- | lib/kernel/src/inet.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl index 7261d6486f..ea06a07bb3 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). |