diff options
author | Micael Karlberg <[email protected]> | 2018-07-25 12:29:41 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 14:50:18 +0200 |
commit | 70a5b8d6a01b91a6044c6a5a0f8ed8919afd509b (patch) | |
tree | 878cf90a617b2d9404c81b29e48cc589601752c3 /lib/kernel | |
parent | 587d3a9a76b6ef2c88b850d007d39d34c37b5825 (diff) | |
download | otp-70a5b8d6a01b91a6044c6a5a0f8ed8919afd509b.tar.gz otp-70a5b8d6a01b91a6044c6a5a0f8ed8919afd509b.tar.bz2 otp-70a5b8d6a01b91a6044c6a5a0f8ed8919afd509b.zip |
[socket-nif] Add support for socket (level ip) option pktinfo
Added support for ip level socket option PKTINFO.
This option requires sendmsg and/or recvmsg to actually use,
so we cannot test this fully at the moment (although both set
and get works).
OTP-14831
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/test/socket_server.erl | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/kernel/test/socket_server.erl b/lib/kernel/test/socket_server.erl index 4b032c586c..0ae6bb2dd0 100644 --- a/lib/kernel/test/socket_server.erl +++ b/lib/kernel/test/socket_server.erl @@ -636,6 +636,7 @@ handler_init(Manager, ID, Peek, Sock) -> MLoop4 = GIP4(multicast_loop), MTTL = GIP4(multicast_ttl), NF = GIP4(nodefrag), % raw only + PktInfo = GIP4(pktinfo), % dgram only RecvErr4 = GIP4(recverr), RecvIF = GIP4(recvif), % Only dgram and raw (and FreeBSD) RecvOPTS = GIP4(recvopts), % Not stream @@ -677,6 +678,7 @@ handler_init(Manager, ID, Peek, Sock) -> "~n (ip) Multicast Loop: ~s" "~n (ip) Multicast TTL: ~s" "~n (ip) Node Frag: ~s" + "~n (ip) Pkt Info: ~s" "~n (ip) Recv Err: ~s" "~n (ip) Recv IF: ~s" "~n (ip) Recv OPTS: ~s" @@ -699,17 +701,28 @@ handler_init(Manager, ID, Peek, Sock) -> RcvBuf, RcvLW, RcvTO, SndBuf, SndLW, SndTO, Linger, Timestamp, FreeBind, MTU, MTUDisc, MALL, MIF4, MLoop4, MTTL, - NF, RecvErr4, RecvIF, RecvOPTS, RecvTOS, RecvTTL, + NF, PktInfo,RecvErr4, RecvIF, RecvOPTS, RecvTOS, RecvTTL, MHops, MIF6, MLoop6, RecvErr6, RecvPktInfo, RtHdr, AuthHdr, HopLimit, HopOpts, DstOpts, FlowInfo, UHops]), - + handler_loop(#handler{peek = Peek, manager = Manager, type = Type, socket = Sock}) end. +%% so(Sock, Lvl, Opt, Val) -> +%% ok = socket:setopt(Sock, Lvl, Opt, Val). + +%% soso(Sock, Opt, Val) -> +%% so(Sock, socket, Opt, Val). + +%% soip(Sock, Opt, Val) -> +%% so(Sock, ip, Opt, Val). + +%% soipv6(Sock, Opt, Val) -> +%% so(Sock, ipv6, Opt, Val). handler_loop(H) -> i("try read message"), |