aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common/inet_drv.c
AgeCommit message (Collapse)Author
2015-01-23erts: Use emergency close to close epmdBjörn-Egil Dahlberg
Closes all open socket before writing crashdump to file.
2015-01-14Merge branch 'maint'Marcus Arendt
2015-01-13erts: Extend driver interface with emergency_closeBjörn-Egil Dahlberg
The intention of this callback is to close all sockets associated to a port. It is closed only on crashdumps. This will currently only be used for the epmd port.
2014-12-08Fix inet:getopts involving #sctp_paddrinfo{}Simon Cornish
Handle peer addresses that are unconfirmed (i.e. in state SCTP_UNCONFIRMED). Handle unknown states instead of using ASSERT
2014-12-02erts: Add compile time assert ERTS_CT_ASSERTSverker Eriksson
and usage
2014-09-12erts: getsockname is not allowed on non-bound socketsLukas Larsson
This only produces an error on win32, but should not really be called on *nix either.
2014-08-25Fix misspellings of 'another'Tuncer Ayaz
2014-07-24Merge branch 'maint-r16' into maintHenrik Nord
Conflicts: erts/doc/src/notes.xml erts/preloaded/ebin/prim_inet.beam erts/vsn.mk lib/kernel/doc/src/notes.xml lib/kernel/vsn.mk
2014-07-22erts: Fix inet close on prebound fdsBjörn-Egil Dahlberg
Inet close must remove fd from select/poll without closing the fd.
2014-07-22kernel: When doing an fdopen we now also bind the fd to the specified addr/portLukas Larsson
2014-03-28erts: Move debug printout to eliminate gcc warningLukas Larsson
2014-03-26ose: Implement tcp inet driver for OSELukas Larsson
The inet driver for OSE has to handle signals instead of selects and thus the wrappers for ready_input/output are a little bit different. However the majority of the inet code remains the same.
2014-03-26ose: Add ifdefs for HAVE_UDPLukas Larsson
2014-02-24Added support for ENEA OSELukas Larsson
This port has support for both non-smp and smp. It contains a new way to do io checking in which erts_poll_wait receives the payload of the polled entity. This has implications for all linked-in drivers.
2014-01-27Merge branch 'lukas/erts/sendfile_passive_mode_fix/OTP-11614'Lukas Larsson
* lukas/erts/sendfile_passive_mode_fix/OTP-11614: erts: fix bug when using passive mode and sendfile
2014-01-27erts: fix bug when using passive mode and sendfileLukas Larsson
The bug incorrectly issued driver_select when un-ignoring an fd for a socket in passive mode, which caused an incorrect error tuple to be returned when the remote end closed the connection.
2013-12-13erts: Fix compiler warningSverker Eriksson
2013-11-26Merge branch 'maint'Raimo Niskanen
Conflicts: erts/preloaded/ebin/prim_inet.beam lib/kernel/test/gen_sctp_SUITE.erl
2013-11-26Merge branch 'maint-r16' into maintRaimo Niskanen
2013-11-20Suppress false valgrind warnings caused by sctp_getpaddrsSverker Eriksson
2013-11-11Clean up address family handling towards ErlangRaimo Niskanen
2013-11-07Implement prim_inet:socknames/1,2 and prim_inet:peernames/1,2Raimo Niskanen
2013-10-15Merge branch 'maint'Sverker Eriksson
Conflicts: erts/preloaded/ebin/erlang.beam
2013-09-30erts: Refactor the ASSERT macroSverker Eriksson
Introduce unconditional ERTS_ASSERT and use that for both ASSERT and ASSERT_EXPR.
2013-09-23add {active,N} socket option for TCP, UDP, and SCTPSteve Vinoski
Add the {active,N} socket option, where N is an integer in the range -32768..32767, to allow a caller to specify the number of data messages to be delivered to the controlling process. Once the socket's delivered message count either reaches 0 or is explicitly set to 0 with inet:setopts/2 or by including {active,0} as an option when the socket is created, the socket transitions to passive ({active, false}) mode and the socket's controlling process receives a message to inform it of the transition. TCP sockets receive {tcp_passive,Socket}, UDP sockets receive {udp_passive,Socket} and SCTP sockets receive {sctp_passive,Socket}. The socket's delivered message counter defaults to 0, but it can be set using {active,N} via any gen_tcp, gen_udp, or gen_sctp function that takes socket options as arguments, or via inet:setopts/2. New N values are added to the socket's current counter value, and negative numbers can be used to reduce the counter value. Specifying a number that would cause the socket's counter value to go above 32767 causes an einval error. If a negative number is specified such that the counter value would become negative, the socket's counter value is set to 0 and the socket transitions to passive mode. If the counter value is already 0 and inet:setopts(Socket, [{active,0}]) is specified, the counter value remains at 0 but the appropriate passive mode transition message is generated for the socket. This commit contains a modified preloaded prim_inet.beam due to changes in prim_inet.erl. Add tests for {active,N} mode for TCP, UDP, and SCTP sockets. Add documentation for {active,N} mode for inet, gen_tcp, gen_udp, and gen_sctp.
2013-07-17Implement netns for SCTP + bugfixesRaimo Niskanen
2013-07-17Implement emulator netns support for TCP and UDPRaimo Niskanen
2013-05-16Merge branch 'rickard/inet_opts/OTP-11075' into maintRickard Green
* rickard/inet_opts/OTP-11075: Make high_msgq_watermark and low_msgq_watermark generic inet options Conflicts: erts/preloaded/ebin/prim_inet.beam
2013-05-06Make high_msgq_watermark and low_msgq_watermark generic inet optionsRickard Green
2013-03-04erts: Use block comments - ansi styleBjörn-Egil Dahlberg
2013-02-22Update copyright yearsBjörn-Egil Dahlberg
2013-02-21Merge branch 'sverk/tcp-exit_on_close-false'Sverker Eriksson
* sverk/tcp-exit_on_close-false: inet_drv: Fix condition to reject INET_REQ_IGNOREFD for UDP and SCTP A stab at fixing bug with {exit_on_close,false} not working
2013-02-07inet_drv: Fix condition to reject INET_REQ_IGNOREFD for UDP and SCTPSverker Eriksson
2013-01-29A stab at fixing bug with {exit_on_close,false} not workingSverker Eriksson
when invalid packets are received.
2013-01-23Make _oct counters in inet_drv exactly 64 bitsPatrik Nyblom
Also, on 64 bit architectures, use 64 bit int's for the counters and be specific about the counter variables sizes utilizing datatypes from sys.h.
2013-01-23Fix inet_drv _oct counters 32bit/64bit bugPatrik Nyblom
2012-12-20Clean up and make the fix work on windows.Patrik Nyblom
Thanks to Tony Rogvall.
2012-12-20Add workaround for CentOS/RedHat writev bug to inet_drvPatrik Nyblom
2012-12-07Merge branch 'rickard/port-optimizations/OTP-10336' into ↵Rickard Green
rickard/r16/port-optimizations/OTP-10336 * rickard/port-optimizations/OTP-10336: Change annotate level for emacs-22 in cerl Update etp-commands Add documentation on communication in Erlang Add support for busy port message queue Add driver callback epilogue Implement true asynchronous signaling between processes and ports Add erl_drv_[send|output]_term Move busy port flag Use rwlock for driver list Optimize management of port tasks Improve configuration of process and port tables Remove R9 compatibility features Use ptab functionality also for ports Prepare for use of ptab functionality also for ports Atomic port state Generalize process table implementation Implement functionality for delaying thread progress from unmanaged threads Conflicts: erts/doc/src/erl_driver.xml erts/doc/src/erlang.xml erts/emulator/beam/beam_bif_load.c erts/emulator/beam/beam_bp.c erts/emulator/beam/beam_emu.c erts/emulator/beam/bif.c erts/emulator/beam/copy.c erts/emulator/beam/erl_alloc.c erts/emulator/beam/erl_alloc.types erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_bif_port.c erts/emulator/beam/erl_bif_trace.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_message.c erts/emulator/beam/erl_port_task.c erts/emulator/beam/erl_process.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_process_lock.c erts/emulator/beam/erl_trace.c erts/emulator/beam/export.h erts/emulator/beam/global.h erts/emulator/beam/io.c erts/emulator/sys/unix/sys.c erts/emulator/sys/vxworks/sys.c erts/emulator/test/port_SUITE.erl erts/etc/unix/cerl.src erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/src/prim_inet.erl lib/hipe/cerl/erl_bif_types.erl lib/kernel/doc/src/inet.xml lib/kernel/src/inet.erl
2012-12-07Add support for busy port message queueRickard Green
2012-12-03Add erl_drv_[send|output]_termRickard Green
2012-10-31Merge branch 'raimo/IPV6_V6ONLY/OTP-8928'Raimo Niskanen
* raimo/IPV6_V6ONLY/OTP-8928: kernel: Document socket option ipv6_v6only kernel: Add test cases for socket option ipv6_v6only erts,kernel: Implement socket option ipv6_v6only in erlang code erts: Implement socket option IPV6_V6ONLY erts: Add configure test for IPV6_V6ONLY
2012-10-31erts: Implement socket option IPV6_V6ONLYRaimo Niskanen
2012-10-08Set new peeled off SCTP socket to nonblocking socketJonas Falkevik
Peeloff feature of SCTP association creates a new socket which is not set to nonblocking. Function for receving data is shared with udp which has a default loop when reading packets which is set to 5. Calling the receive function more then once, is fine as long as there are more data to receive or socket are nonblocking. Set new peeled off socket to be nonblocking to prevent a erlang vm hangup.
2012-08-27Merge branch 'maint'Lukas Larsson
* maint: Bumped version nr ssl & public_key: Workaround that some certificates encode countryname as utf8 and close down gracefully if other ASN-1 errors occur. Add more cross reference links to ct docs Remove config option from common_test args Update user config to use nested tuple keys Allow mixed IPv4 and IPv6 addresses to sctp_bindx Add checks for in6addr_any and in6addr_loopback Fix SCTP multihoming observer: fix app file (Noticed-by: Motiejus Jakstys) Fix lib/src/test/ssh_basic_SUITE.erl to fix IPv6 option typos Prevent index from being corrupted if a nonexistent item is deleted Add tests showing that trying to delete non-existing object may corrupt the table index Fix Table Viewer search crash on new|changed|deleted rows Escape control characters in Table Viewer Fix Table Viewer crash after a 'Found' -> 'Not found' search sequence inet_drv.c: Set sockaddr lengths in inet_set_[f]address Conflicts: erts/preloaded/ebin/prim_inet.beam
2012-08-16Allow mixed IPv4 and IPv6 addresses to sctp_bindxTomas Abrahamsson
Also allow mixed address families to bind, since the first address on a multihomed sctp socket must be bound with bind, while the rest are to be bound using sctp_bindx. At least Linux supports adding address of mixing families. Make inet_set_faddress function available also when HAVE_SCTP is not defined, since we use it to find an address for bind to be able to mix ipv4 and ipv6 addresses.
2012-08-16Add checks for in6addr_any and in6addr_loopbackTomas Abrahamsson
These variables are normally declared by <netinet/in.h>, but for instance not on Windows 7, SDK 7.1. Work around that by using IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT if present, fallback to using :: and ::1.
2012-08-16Fix SCTP multihomingTomas Abrahamsson
Setting several ip addresses for an SCTP socket worked only for IPv4 on Linux. For IPv6 and for other for instance Solaris and FreeBSD, it failed with badarg for both IPv4 and IPv6. For the first address specified to gen_sctp:open, bind is now called, while for any following addresses, sctp_bindx is called, repeatedly, with one address at a time. Previously, sctp_bindx was called for all addresses in one go, with the addresses in reverse order, and bind was not called at all if more than one address was specified. Both Solaris and FreeBSD requires bind to have been called before calling sctp_bindx, and FreeBSD additionally allows at most one address at a time in the call to sctp_bindx. For some versions of Linux, for instance SuSE 10, the port can be 0 only for the call to bind but not for subsequent calls to sctp_bindx, so replace with the port number assigned by the operating system.
2012-07-19erts: Remove VxWorks from driversBjörn-Egil Dahlberg
2012-05-31inet_drv.c: Set sockaddr lengths in inet_set_[f]addressTomas Abrahamsson
Set appropriate values for the sockaddr length fields---sai.sin_len and sai6.sin6_len---if those fields exist; rely on the NO_SA_LEN configure check to see if they exist. The length field exists on at least FreeBSD, and there it needs to have a proper value for instance in the call to sctp_bindx, or else that will fail with EINVAL.