aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src/socket.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-07-10 11:28:11 +0200
committerMicael Karlberg <[email protected]>2018-09-18 14:50:18 +0200
commit9110ba256099e6fa55461fc4ca90da5ec4b2966b (patch)
treec290bff6c491817266f2d62f5914212d8783ee67 /erts/preloaded/src/socket.erl
parent5329726352f8b983e419b6206a85c15cc8836676 (diff)
downloadotp-9110ba256099e6fa55461fc4ca90da5ec4b2966b.tar.gz
otp-9110ba256099e6fa55461fc4ca90da5ec4b2966b.tar.bz2
otp-9110ba256099e6fa55461fc4ca90da5ec4b2966b.zip
[socket-nif] Add support for socket (level socket) option oobinline
Added support for socket level socket option oobinline (both get and set). OTP-14831
Diffstat (limited to 'erts/preloaded/src/socket.erl')
-rw-r--r--erts/preloaded/src/socket.erl34
1 files changed, 23 insertions, 11 deletions
diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl
index 8f489bd681..278a3f17ad 100644
--- a/erts/preloaded/src/socket.erl
+++ b/erts/preloaded/src/socket.erl
@@ -476,16 +476,26 @@
-define(SOCKET_OPT_SOCK_KEEPALIVE, 10).
-define(SOCKET_OPT_SOCK_LINGER, 11).
%% -define(SOCKET_OPT_SOCK_MARK, 12).
-%% -define(SOCKET_OPT_SOCK_OOBINLLINE, 13).
+-define(SOCKET_OPT_SOCK_OOBINLINE, 13).
%% -define(SOCKET_OPT_SOCK_PASSCRED, 14).
--define(SOCKET_OPT_SOCK_PEEK_OFF, 16).
-%% -define(SOCKET_OPT_SOCK_PEEKCRED, 17).
--define(SOCKET_OPT_SOCK_PRIORITY, 18).
--define(SOCKET_OPT_SOCK_PROTOCOL, 19).
--define(SOCKET_OPT_SOCK_RCVBUF, 20).
--define(SOCKET_OPT_SOCK_REUSEADDR, 24).
--define(SOCKET_OPT_SOCK_SNDBUF, 30).
--define(SOCKET_OPT_SOCK_TYPE, 35).
+-define(SOCKET_OPT_SOCK_PEEK_OFF, 15).
+%% -define(SOCKET_OPT_SOCK_PEEKCRED, 16).
+-define(SOCKET_OPT_SOCK_PRIORITY, 17).
+-define(SOCKET_OPT_SOCK_PROTOCOL, 18).
+-define(SOCKET_OPT_SOCK_RCVBUF, 19).
+%% -define(SOCKET_OPT_SOCK_RCVBUFFORCE, 20).
+%% -define(SOCKET_OPT_SOCK_RCVLOWAT, 21).
+%% -define(SOCKET_OPT_SOCK_RCVTIMEO, 22).
+-define(SOCKET_OPT_SOCK_REUSEADDR, 23).
+%% -define(SOCKET_OPT_SOCK_REUSEPORT, 24).
+%% -define(SOCKET_OPT_SOCK_RXQ_OVFL, 25).
+%% -define(SOCKET_OPT_SOCK_SETFIB, 26).
+-define(SOCKET_OPT_SOCK_SNDBUF, 27).
+%% -define(SOCKET_OPT_SOCK_SNDBUFFORCE, 28).
+%% -define(SOCKET_OPT_SOCK_SNDLOWAT, 29).
+%% -define(SOCKET_OPT_SOCK_SNDTIMEO, 30).
+%% -define(SOCKET_OPT_SOCK_TIMESTAMP, 31).
+-define(SOCKET_OPT_SOCK_TYPE, 32).
-define(SOCKET_OPT_IP_RECVTOS, 25).
-define(SOCKET_OPT_IP_ROUTER_ALERT, 28).
@@ -1840,6 +1850,8 @@ enc_setopt_value(socket, linger, abort, D, T, P) ->
enc_setopt_value(socket, linger, {OnOff, Secs} = V, _D, _T, _P)
when is_boolean(OnOff) andalso is_integer(Secs) andalso (Secs >= 0) ->
V;
+enc_setopt_value(socket, oobinline, V, _D, _T, _P) when is_boolean(V) ->
+ V;
enc_setopt_value(socket, peek_off, V, _D, _T, _P) when is_integer(V) ->
V;
enc_setopt_value(socket, priority, V, _D, _T, _P) when is_integer(V) ->
@@ -2066,8 +2078,8 @@ enc_sockopt_key(socket, linger = _Opt, _Dir, _D, _T, _P) ->
?SOCKET_OPT_SOCK_LINGER;
enc_sockopt_key(socket = L, mark = Opt, _Dir, _D, _T, _P) ->
not_supported({L, Opt});
-enc_sockopt_key(socket, oobinline = Opt, _Dir, _D, _T, _P) ->
- not_supported(Opt);
+enc_sockopt_key(socket = _L, oobinline = _Opt, _Dir, _D, _T, _P) ->
+ ?SOCKET_OPT_SOCK_OOBINLINE;
enc_sockopt_key(socket = L, passcred = Opt, _Dir, _D, _T, _P) ->
not_supported({L, Opt});
enc_sockopt_key(socket = _L, peek_off = _Opt, _Dir, local = _D, _T, _P) ->