aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/gen_udp.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2018-09-17 15:42:01 +0200
committerRaimo Niskanen <[email protected]>2018-09-17 15:42:01 +0200
commitd6a08843e473da6eebbab0b0e7312efc978108ee (patch)
treef5069e18553ae965852bb3ae36005e03788611d6 /lib/kernel/src/gen_udp.erl
parent0aeb5144e03637698e261d49696e5cadfa537dd0 (diff)
parent6053725bb54f7302d3698d0df100eb01c4df4f12 (diff)
downloadotp-d6a08843e473da6eebbab0b0e7312efc978108ee.tar.gz
otp-d6a08843e473da6eebbab0b0e7312efc978108ee.tar.bz2
otp-d6a08843e473da6eebbab0b0e7312efc978108ee.zip
Merge branch 'raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145' into maint
* raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145: Write testcases for recvtos and friends Fix term buffer overflow bug Fix documentation due to feedback Implement socket option recvtos and friends
Diffstat (limited to 'lib/kernel/src/gen_udp.erl')
-rw-r--r--lib/kernel/src/gen_udp.erl19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/kernel/src/gen_udp.erl b/lib/kernel/src/gen_udp.erl
index 44eef9f3c5..d6e8652e77 100644
--- a/lib/kernel/src/gen_udp.erl
+++ b/lib/kernel/src/gen_udp.erl
@@ -51,6 +51,11 @@
{reuseaddr, boolean()} |
{sndbuf, non_neg_integer()} |
{tos, non_neg_integer()} |
+ {tclass, non_neg_integer()} |
+ {ttl, non_neg_integer()} |
+ {recvtos, boolean()} |
+ {recvtclass, boolean()} |
+ {recvttl, boolean()} |
{ipv6_v6only, boolean()}.
-type option_name() ::
active |
@@ -76,6 +81,12 @@
reuseaddr |
sndbuf |
tos |
+ tclass |
+ ttl |
+ recvtos |
+ recvtclass |
+ recvttl |
+ pktoptions |
ipv6_v6only.
-type socket() :: port().
@@ -147,11 +158,13 @@ send(S, Packet) when is_port(S) ->
end.
-spec recv(Socket, Length) ->
- {ok, {Address, Port, Packet}} | {error, Reason} when
+ {ok, RecvData} | {error, Reason} when
Socket :: socket(),
Length :: non_neg_integer(),
+ RecvData :: {Address, Port, Packet} | {Address, Port, AncData, Packet},
Address :: inet:ip_address() | inet:returned_non_ip_address(),
Port :: inet:port_number(),
+ AncData :: inet:ancillary_data(),
Packet :: string() | binary(),
Reason :: not_owner | inet:posix().
@@ -164,12 +177,14 @@ recv(S,Len) when is_port(S), is_integer(Len) ->
end.
-spec recv(Socket, Length, Timeout) ->
- {ok, {Address, Port, Packet}} | {error, Reason} when
+ {ok, RecvData} | {error, Reason} when
Socket :: socket(),
Length :: non_neg_integer(),
Timeout :: timeout(),
+ RecvData :: {Address, Port, Packet} | {Address, Port, AncData, Packet},
Address :: inet:ip_address() | inet:returned_non_ip_address(),
Port :: inet:port_number(),
+ AncData :: inet:ancillary_data(),
Packet :: string() | binary(),
Reason :: not_owner | inet:posix().