aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
AgeCommit message (Collapse)Author
2018-09-18[socket-nif] Fixed getopt function specMicael Karlberg
2018-09-18[socket-nif-doc] More polishingMicael Karlberg
Also added (a very) temporary example. OTP-14831
2018-09-18[socket-nif-doc] Fixed socket type and function openMicael Karlberg
The doc for type socket was missing (as it is opaque), so instead its replaced with a simple text referring to the functions open and accept. The open function missed a spec (for open/2), the text for default protocol needed some omrpvement and finally the Extra argument needed explaining.
2018-09-18[socket-nif-doc] Add preliminary doc for socketMicael Karlberg
The doc now builds. Had to update the code (spec and types) to match. Though, te result is less then stellar. OTP-14831
2018-09-18[socket-nif] Updated socket preloaded beamMicael Karlberg
2018-09-18[socket-nif] More getoptMicael Karlberg
Added guards and type specs for native getopt.
2018-09-18[socket-nif] getopt partially implementedMicael Karlberg
There are still many options not implemented (just as for setopt), but this will have to do for now...
2018-09-18[socket-nif] setopt for socket option(s) rcvbuf and sndnufMicael Karlberg
2018-09-18[socket-nif] setopt of socket option broadcastMicael Karlberg
2018-09-18[socket-nif] setopt of socket option dontrouteMicael Karlberg
2018-09-18[socket-nif] setopt of socket option priorityMicael Karlberg
2018-09-18[socket-nif] setopt of socket option reuseaddrMicael Karlberg
2018-09-18[socket-nif] More setopt - udpMicael Karlberg
Add setopt for one udp option: cork. This is not platform independent. Aas fas as I know, it only works on linux, so for now this serves as a placeholder.
2018-09-18[socket-nif] More setoptMicael Karlberg
Add handling of nodelay tcp option setopt. Added placeholder sctp options autoclose and nodelay (since my machine does not actually have sctp installed...).
2018-09-18[socket-nif] setopt of (tcp) congestionMicael Karlberg
2018-09-18[socket-nif] Network interface mappings and sock addrMicael Karlberg
Add functions for mapping network interface names and indexes. Also refined the types for socket addresses: in4_sockaddr and in6_sockaddr.
2018-09-18[socket-nif] Preliminary setoptMicael Karlberg
*Very* partial setopt implementation.
2018-09-18[socket-nif] Completed the shutdown functionMicael Karlberg
2018-09-18[socket-nif] More close-related workMicael Karlberg
There are still some questions regarding what hapopens when writing / reading from an (remote) closed socket (I talking about "properly" closed sockets).
2018-09-18[socket-nif] "Completed" the close functionMicael Karlberg
There is probably a lot of things left to be here. For instance the handling of ECONNRESET when reading (recv and recvfrom). Also some stuff about setopt and getopt.
2018-09-18[socket-nif] Completed the recv and recvfrom functionsMicael Karlberg
Also updated the socket type (now a record for easy use).
2018-09-18[socket-nif] Corrected timout handlingMicael Karlberg
The timeout handling for accept and send was unnecessarily complex.
2018-09-18[socket-nif] Completed recvMicael Karlberg
Need to fix the use of the request ref (ID) handling in previous functions.
2018-09-18[socket-nif] Implemented sendtoMicael Karlberg
Still not handling queue'ing of multiple send requests.
2018-09-18[socket-nif] Completed sendMicael Karlberg
We still need to handle simultaneous ops. That is, handle if two different procs tries to send at the same time. Or a recv and send at the same time. Ops queue?
2018-09-18[socket-nif] Completed acceptMicael Karlberg
2018-09-18[socket-nif] Completed listenMicael Karlberg
2018-09-18[socket-nif] preliminary version of the new socket interface (nififying)Micael Karlberg
2018-09-17Merge branch 'maint'Raimo Niskanen
2018-09-17Merge branch 'raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145' into maintRaimo Niskanen
* 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
2018-09-17Merge branch 'maint'John Högberg
* maint: Improve trapping in lists:reverse/2 Fix unsafe use of lists:reverse/1
2018-09-13Fix unsafe use of lists:reverse/1John Högberg
We said reverse/2 but used reverse/1 which is unsafe to use in preloaded modules. This didn't have any effect in practice as the affected functions weren't used before the code server was started, but it's still an error.
2018-09-04Implement socket option recvtos and friendsRaimo Niskanen
Implement socket options recvtclass, recvtos, recvttl and pktoptions. Document the implemented socket options, new types and message formats. The options recvtclass, recvtos and recvttl are boolean options that when activated (true) for a socket will cause ancillary data to be received through recvmsg(). That is for packet oriented sockets (UDP and SCTP). The required options for this feature were recvtclass and recvtos, and recvttl was only added to test that the ancillary data parsing handled multiple data items in one message correctly. These options does not work on Windows since ancillary data is not handled by the Winsock2 API. For stream sockets (TCP) there is no clear connection between a received packet and what is returned when reading data from the socket, so recvmsg() is not useful. It is possible to get the same ancillary data through a getsockopt() call with the IPv6 socket option IPV6_PKTOPTIONS, on Linux named IPV6_2292PKTOPTIONS after the now obsoleted RFC where it originated. (unfortunately RFC 3542 that obsoletes it explicitly undefines this way to get packet ancillary data from a stream socket) Linux also has got a way to get packet ancillary data for IPv4 TCP sockets through a getsockopt() call with IP_PKTOPTIONS, which appears to be Linux specific. This implementation uses a flag field in the inet_drv.c socket internal data that records if any setsockopt() call with recvtclass, recvtos or recvttl (IPV6_RECVTCLASS, IP_RECVTOS or IP_RECVTTL) has been activated. If so recvmsg() is used instead of recvfrom(). Ancillary data is delivered to the application by a new return tuple format from gen_udp:recv/2,3 containing a list of ancillary data tuples [{tclass,TCLASS} | {tos,TOS} | {ttl,TTL}], as returned by recvmsg(). For a socket in active mode a new message format, containing the ancillary data list, delivers the data in the same way. For gen_sctp the ancillary data is delivered in the same way, except that the gen_sctp return tuple format already contained an ancillary data list so there are just more possible elements when using these socket options. Note that the active mode message format has got an extra tuple level for the ancillary data compared to what is now implemented gen_udp. The gen_sctp active mode format was considered to be the odd one - now all tuples containing ancillary data are flat, except for gen_sctp active mode. Note that testing has not shown that Linux SCTP sockets deliver any ancillary data for these socket options, so it is probably not implemented yet. Remains to be seen what FreeBSD does... For gen_tcp inet:getopts([pktoptions]) will deliver the latest received ancillary data for any activated socket option recvtclass, recvtos or recvttl, on platforms where IP_PKTOPTIONS is defined for an IPv4 socket, or where IPV6_PKTOPTIONS or IPV6_2292PKTOPTIONS is defined for an IPv6 socket. It will be delivered as a list of ancillary data items in the same way as for gen_udp (and gen_sctp). On some platforms, e.g the BSD:s, when you activate IP_RECVTOS you get ancillary data tagged IP_RECVTOS with the TOS value, but on Linux you get ancillary data tagged IP_TOS with the TOS value. Linux follows the style of RFC 2292, and the BSD:s use an older notion. For RFC 2292 that defines the IP_PKTOPTIONS socket option it is more logical to tag the items with the tag that is the item's, than with the tag that defines that you want the item. Therefore this implementation translates all BSD style ancillary data tags to the corresponding Linux style data tags, so the application will only see the tags 'tclass', 'tos' and 'ttl' on all platforms.
2018-07-30Merge pull request #1891 from ↵Raimo Niskanen
RaimoNiskanen/raimo/can_not-should-mostly-be-cannot OTP-14282 'can not' should mostly be 'cannot'
2018-07-27Change "can not" into "cannot"Raimo Niskanen
I did not find any legitimate use of "can not", however skipped changing e.g RFCs archived in the source tree.
2018-07-26Merge branch 'maint'John Högberg
2018-07-26Merge branch 'maint-21' into maintJohn Högberg
2018-07-18Fix node crash on passing bad arguments to file:read_file_info/2John Högberg
2018-07-11Merge branch 'maint'Sverker Eriksson
2018-07-09erts: Fix spec and docs for process_info 'monitored_by'Sverker Eriksson
to include ports and NIF resources. Added new opaque type 'nif_resource'.
2018-07-03Merge pull request #1854 from ↵John Högberg
jhogberg/john/erts/cross-type-carrier-migration/OTP-15063 Allow carrier migration between different allocator types
2018-06-28Allow cross-type carrier migrationJohn Högberg
2018-06-20Update system_info doc to include ets_countArtur Cygan
2018-06-18Update copyright yearHenrik Nord
2018-06-18Update preloaded modulesHenrik Nord
2018-06-04Merge branch 'sverker/erlang-memory-fix'Sverker Eriksson
* sverker/erlang-memory-fix: erts: Purge unused allocation types erts: Fix erlang:memory for 'processes' and 'processes_used'
2018-05-29erts: Improve contracts of zlibHans Bolinder
2018-05-28erts: Improve a contractHans Bolinder
2018-05-23Update preloadedSiri Hansen
2018-05-23Use system_time instead of monotonic_time as timestamp in loggerSiri Hansen