summaryrefslogtreecommitdiff
path: root/agent/agent-priv.h
Commit message (Collapse)AuthorAgeFilesLines
* agent: Add warning on ignored resultOlivier Crête2016-05-201-1/+1
|
* conncheck: implement a "triggered queue" listFabrice Bellet2016-04-041-0/+1
| | | | | | | | | | | | The checks should not be sent immediately in priv_conn_check_initiate(), but be put into the "triggered queue", see "7.2.1.4 Triggered Checks". This patch implements this triggered checks list, and uses it to enforce a pacing of STUN transactions, no more than one per Ta ms, according to "B.1. Pacing of STUN Transactions". Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: Philip Withnall <philip@tecnocode.co.uk> Differential Revision: https://phabricator.freedesktop.org/D802
* agent: Correctly namespace Component and its methodsPhilip Withnall2015-10-011-1/+1
| | | | | | | | Remove all references to the old, unnamespaced versions. This should cause no functional changes. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D309
* agent: Correctly namespace Stream and its methodsPhilip Withnall2015-10-011-3/+3
| | | | | | | | Remove all references to the old, unnamespaced versions. This should cause no functional changes. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D308
* conncheck: set writable callback to socket from TCP active connectJakub Adam2015-07-031-0/+2
| | | | | | | | | | | | | | | | | A new socket created in nice_tcp_active_socket_connect() should have its writable callback set, because it's possible for it to become a base socket of a peer reflexive candidate, if some is discovered by connection checks on that TCP active candidate. Previously, when such prflx candidate became selected, without write_cb on the socket the agent was never notified about it becoming writable again after the socket's buffer got filled up. This caused the data flow to hang permanently. Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: Olivier Crête <olivier.crete@collabora.com> http://phabricator.freedesktop.org/T117
* Split "verbose" on-every-packet messages to a verbose logOlivier Crête2015-06-241-0/+4
| | | | This way, the regular log will only contain connection-time information.
* agent: Avoid leaking UPnP mappings between streamsOlivier Crête2014-10-091-0/+3
| | | | Clean up the UPnP mappings of each stream when closing it
* agent: Improve comments for container element typesPhilip Withnall2014-09-221-1/+1
| | | | To allow enhanced grepping for what structs point to other structs.
* agent: Clear existing GSource timeouts before adding new onesPhilip Withnall2014-09-191-2/+2
| | | | | | | | | | | | | | | | Modify agent_timeout_add_with_context() to force destroying and freeing of an existing GSource before overwriting it with a new one (probably with an updated timeout period). This fixes a case in priv_map_reply_to_relay_refresh() where the TURN candidate refresh timer was being overwritten with a new one, without the old one being destroyed. This lead to two timeouts existing, only one of which would be destroyed when the CandidateRefresh struct was freed, leaking the other one (in the main context) and allowing it to be later dispatched with a dangling CandidateRefresh pointer. The modification to agent_timeout_add_with_context() should prevent this happening in new code in future.
* agent: Add names to timer GSourcesPhilip Withnall2014-09-191-1/+2
| | | | | | Modify the agent_timeout_add_with_context() utility function to automatically add names to the timer GSources it creates. This makes them a little easier to identify when debugging.
* agent: Put one StunAgent per ComponentOlivier Crête2014-09-011-1/+2
| | | | | | | | Otherwise we risk running out of space in the space limited saved ids list. So the easiest way to do that is to put one StunAgent in each component. It may be advisable to just give up on not allocating memory inside libstun and just use a regular hash table in there instead.
* agent: Add "keepalive-conncheck" property to make keepalives be conncheckOlivier Crête2014-08-211-0/+1
| | | | | | | This is to use keepalives to check if the connection is still ongoing. If they don't get a reply, then we can assume that the connection has died. This needs to not happen in the case of ICE-TCP.
* Add support for ICE-TCPYouness Alaoui2014-05-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | This is a massive commit that can't be split. We add ice-tcp support into the agent by creating local host tcp-active/tcp-passive candidates. We also need to find the local and remote candidates whenever we discover a peer-reflexive because their data is important to setup the peer-reflexive so a few changes were added to look for the local or remote candidate. For TCP-ACTIVE remote peer-reflexive candidates, we can't add conncheck pairs normally because TCP-PASSIVE (local) do not generate candidate pairs, and we also can't have a connection from any local host, so we can only create a single candidatepair with the local/remote that are connected. The pair->socket of a candidate check pair will hold the connected tcp socket (through connect for ACT or accept for PASS) and we will either have a remote or a local peer-reflexive which will create a new candidate pair, we cannot trigger checks on the initial candidate pair, we must only do it on the new check pairs. but in the case of a tcp-passive, we don't get a new local peer-reflexive candidate, so there is no new candidate with a new NiceSocket, so when we get a triggered check, we need to match it to the candidate check pair or when we select a pair, it will still use the original TCP-PASS socket. We must store the new connected tcp socket in the peer reflexive candidates since they represent that unique peer-reflx candidate's connection
* Add support for RFC4571 framing (packetized mode) for ICE-TCP candidatesYouness Alaoui2014-05-171-0/+1
|
* Add support for MS-ICE2 candidate priorization for OC2007R2 compatibilityYouness Alaoui2014-05-151-0/+4
|
* Remove priority functions from public header file and move to agent-priv.hYouness Alaoui2014-05-151-0/+18
|
* Add a nice_socket_send_reliable API for internal use.Youness Alaoui2014-05-151-0/+3
| | | | | | | | | | | | | | One issue with tcp-bsd is that it will queue messages when the tcp socket is not writable, but it will also drop messages when the queue is full. If we want to do proper reliable ice-tcp, we need to make sure that messages don't get dropped, also, this would affect http/socks5/pseudossl if their messages get dropped. For ice-tcp, when the socket is not writable we want to return 0, not queue the message. The change here is to allow connchecks and other important protocol messages to be sent as 'reliable' on tcp transports by queuing them and in the various socket layers and to never drop them, but all user messages will be dropped. if the tcp socket is not writable.
* Some refactoring to allow for ice-tcp (non pseudotcp reliable)Youness Alaoui2014-05-151-2/+2
|
* agent: Delay signal emission after the lock has been releasedOlivier Crête2014-02-241-0/+3
| | | | This way, there can be no annoying re-entrancy in our code.
* agent: Fix inlining of nice_debug() if NDEBUG is definedPhilip Withnall2014-02-241-2/+2
|
* agent: Add nice_input_message_iter_compare()Philip Withnall2014-02-241-0/+3
| | | | Use it instead of memcmp() to avoid comparing padding bytes.
* agent: Avoid calling nice_address_to_string() when debugging is disabledOlivier Crête2014-01-311-0/+16
|
* Remove the "length" parameter from NiceOutputMessageOlivier Crête2014-01-311-1/+5
| | | | It was used correctly only half the time anyway
* socket: Add vectored I/O support for sending on socketsPhilip Withnall2014-01-311-0/+3
| | | | | | | | | | | | | | | | | Replace the send() API with a send_messages() API, which supports sending multiple messages, each with multiple buffers rather than a single monolithic buffer. This doesn’t break API, as the socket API is not exposed outside libnice. It does introduce a new struct: NiceOutputMessage, which is analogous to struct mmsghdr and NiceInputMessage. This includes updates to the test-bsd test to cover the changed API. The existing nice_socket_send() API has been retained as a thin wrapper around nice_socket_send_messages(), for convenience only. It’s hoped that internal usage of this API will decline to the point where it can be removed.
* agent: Add support for vectored I/O for receivesPhilip Withnall2014-01-311-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new public functions: • nice_agent_recv_messages() • nice_agent_recv_messages_nonblocking() which allow receiving multiple messages in a single call, and support vectors of buffers to receive the messages into. The existing nice_agent_recv[_nonblocking]() APIs have been left untouched. This tidies up a lot of the message handling code internally, and eliminates a couple of memcpy()s. There are still a few more memcpy()s on the critical path, which could be eliminated with further work. In the reliable agent case, every message is memcpy()ed twice: once into the pseudo-TCP receive buffer, and once out of it. The copy on input could be eliminated (in the case of in-order delivery of packets) by receiving directly into the receive buffer. The copy on output can’t be eliminated except in the I/O callback case (when nice_agent_attach_recv() has been used), in which case the callback could be invoked with a pointer directly into the pseudo-TCP receive buffer. In the non-reliable agent case, zero memcpy()s are used. A couple of the more complex socket implementations (TURN and HTTP) have slow paths during setup, and partially also during normal use. These could be optimised further, and FIXME comments have been added.
* socket: Add vectored I/O support for receiving on socketsPhilip Withnall2014-01-311-0/+6
| | | | | | | | | | | | Replace the recv() API with a recv_messages() API, which supports receiving multiple messages, each with multiple buffers rather than a single monolithic buffer. This doesn’t break API, as the socket API is not exposed outside libnice. It does introduce a new struct: NiceInputMessage, which is analogous to struct mmsghdr. This includes updates to the test-bsd test to cover the changed API.
* agent: Add nice_agent_recv() allowing blocking receives on socketsPhilip Withnall2014-01-311-0/+3
| | | | | | | | This is a blocking receive function, designed to be called from a worker thread. It cannot be used in conjunction with the existing nice_agent_attach_recv() API, as the blocking receive and the GSource would compete over access to the single copy of the data in the kernel’s receive buffer.
* agent: Move GSource handling into ComponentPhilip Withnall2014-01-311-5/+6
| | | | | | | Rather than handle GSource creation, attachment and removal in NiceAgent, handle it inside Component. This brings it closer to the networking code, and improves encapsulation of the state of each Component.
* Fix copyright headers for all filesYouness Alaoui2010-02-161-3/+4
|
* Add nice_agent_new_reliable to the libnice API which uses pseudotcpYouness Alaoui2010-02-161-0/+1
|
* Adding a nice_agent_set_software APIYouness Alaoui2009-11-041-0/+1
|
* Change new API to nice_agent_set_stream_tos, save the tos and apply it to ↵Youness Alaoui2009-07-281-0/+2
| | | | new sockets
* Use a global mutex for all nice agents and use g_source_is_destroyed to ↵Youness Alaoui2009-06-161-1/+3
| | | | avoid the race condition of a source being destroyed while we wait for the mutex
* fix keepalive issue when there is network/cpu bottleneckYouness Alaoui2009-06-091-0/+1
|
* Use thread-safe version of GUPnP Simple IGDOlivier Crête2009-06-021-2/+2
|
* Add UPnP support to libniceYouness Alaoui2009-04-241-0/+18
|
* Clean the files from unwanted gtk-doc tagsYouness Alaoui2009-02-161-29/+29
|
* add proxy properties to NiceAgentYouness Alaoui2008-12-101-0/+5
|
* Change the priv_agent_to_turn_* functions into non static functions instead ↵Youness Alaoui2008-12-081-0/+6
| | | | of duplicating them
* change priv_attach_stream_component_socket to ↵Youness Alaoui2008-11-041-1/+1
| | | | agent_attach_stream_component_socket
* Add full support for refreshs as well as retransmissions of those turn ↵Youness Alaoui2008-10-161-0/+1
| | | | refresh requests
* Remove unused includes and files from pkgincludeYouness Alaoui2008-10-081-0/+1
|
* Port nice agent to the new API of NiceSocketYouness Alaoui2008-10-071-2/+0
|
* Port libnice to the new NiceSocket APIYouness Alaoui2008-10-061-3/+3
|
* Remove timeout sources from the right contextSjoerd Simons2008-09-221-4/+4
|
* Removing turn properties from nice agentYouness Alaoui2008-08-071-4/+0
|
* Adding turn support to libniceYouness Alaoui2008-08-041-0/+2
|
* Remove the socket factory from nice_agent_newYouness Alaoui2008-08-041-1/+2
|
* (WIP) Ported libnice to the new API...Youness Alaoui2008-06-201-0/+2
|
* Do not unlock the mutex when emitting the signal because it might unlock ↵Youness Alaoui2008-04-301-1/+1
| | | | | | another thread which could cause a race condition. To avoid a deadlock when a signal callback calls an API function that does a g_mutex_lock while the lock is already taken. Change the mutex into a recursive mutex