Commit 17d8474e authored by Olivier Crête's avatar Olivier Crête

merge bellet

parents 55276cbf 14b2f2d9
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
"phabricator.uri" : "https:\/\/phabricator.freedesktop.org\/", "phabricator.uri" : "https:\/\/phabricator.freedesktop.org\/",
"history.immutable" : true, "history.immutable" : true,
"project.name" : "libnice", "project.name" : "libnice",
"repository.callsign" : "LIBNICE" "repository.callsign" : "LIBNICE",
"default-reviewers" : "#libnice"
} }
...@@ -154,6 +154,7 @@ tests/test-restart ...@@ -154,6 +154,7 @@ tests/test-restart
tests/test-tcp tests/test-tcp
tests/test-thread tests/test-thread
tests/test-new-dribble tests/test-new-dribble
tests/test-nomination
# examples/ stuff # examples/ stuff
examples/simple-example examples/simple-example
......
...@@ -17,8 +17,8 @@ SUBDIRS = \ ...@@ -17,8 +17,8 @@ SUBDIRS = \
agent \ agent \
nice \ nice \
gst \ gst \
docs \
tests \ tests \
docs \
examples examples
DISTCHECK_CONFIGURE_FLAGS = --disable-assert -enable-gtk-doc --enable-introspection DISTCHECK_CONFIGURE_FLAGS = --disable-assert -enable-gtk-doc --enable-introspection
...@@ -47,6 +47,7 @@ dist_check_SCRIPTS = \ ...@@ -47,6 +47,7 @@ dist_check_SCRIPTS = \
# but not Linux, for no particular reason. They can’t be removed without # but not Linux, for no particular reason. They can’t be removed without
# breaking ABI. FIXME: Remove them when we next break ABI. # breaking ABI. FIXME: Remove them when we next break ABI.
win32/vs9/libnice.def: nice/libnice.sym win32/vs9/libnice.def: nice/libnice.sym
$(MKDIR_P) $(dir $@)
$(AM_V_GEN)(echo "LIBRARY libnice"; \ $(AM_V_GEN)(echo "LIBRARY libnice"; \
echo ""; \ echo ""; \
echo "EXPORTS"; \ echo "EXPORTS"; \
......
libnice 0.1.14 (2017-04-03)
===========================
Improved RFC compliance
Split verbose logs into a separate option
Numerous bug fixes
Use GnuTLS for hash functions
Implement NewReno in PseudoTCP
Requires GLib 2.44 GnuTLS 2.12
libnice 0.1.13 (2015-04-28) libnice 0.1.13 (2015-04-28)
=========================== ===========================
Fix build on non-Windows platforms that don't have getifaddrs() Fix build on non-Windows platforms that don't have getifaddrs()
......
...@@ -5,7 +5,7 @@ Nice: GLib ICE library ...@@ -5,7 +5,7 @@ Nice: GLib ICE library
Copyright Copyright
--------- ---------
(C) 2006-2011 Collabora Ltd. (C) 2006-2017 Collabora Ltd.
(C) 2006-2011 Nokia Corporation (C) 2006-2011 Nokia Corporation
License License
...@@ -16,10 +16,12 @@ See the file COPYING. ...@@ -16,10 +16,12 @@ See the file COPYING.
Requirements Requirements
------------ ------------
glib >= 2.10 glib >= 2.44
pkg-config pkg-config
gnutls >= 2.12.0
gupnp-igd >= 0.1.2 (optional) gupnp-igd >= 0.1.2 (optional)
gstreamer-0.10 >= 0.10.0 (optional) gstreamer-0.10 >= 0.10.0 (optional)
gstreamer-1.0 (optional)
Build instructions Build instructions
------------------ ------------------
...@@ -50,7 +52,7 @@ Relevant standards ...@@ -50,7 +52,7 @@ Relevant standards
These standards are relevant to nice's current implementation. These standards are relevant to nice's current implementation.
ICE draft 15 ICE RFC 5245
http://tools.ietf.org/html/rfc5245 http://tools.ietf.org/html/rfc5245
STUN STUN
http://tools.ietf.org/html/rfc3489 http://tools.ietf.org/html/rfc3489
......
...@@ -22,6 +22,12 @@ if WINDOWS ...@@ -22,6 +22,12 @@ if WINDOWS
AM_CFLAGS += -DWINVER=0x0501 # _WIN32_WINNT_WINXP AM_CFLAGS += -DWINVER=0x0501 # _WIN32_WINNT_WINXP
endif endif
BUILT_SOURCES = \
agent-enum-types.h \
agent-enum-types.c
CLEANFILES += $(BUILT_SOURCES)
noinst_LTLIBRARIES = libagent.la noinst_LTLIBRARIES = libagent.la
libagent_la_SOURCES = \ libagent_la_SOURCES = \
...@@ -54,6 +60,23 @@ libagent_la_SOURCES = \ ...@@ -54,6 +60,23 @@ libagent_la_SOURCES = \
pseudo-tcp-output-stream.h \ pseudo-tcp-output-stream.h \
$(BUILT_SOURCES) $(BUILT_SOURCES)
agent-enum-types.h: agent.h Makefile
$(AM_V_GEN)$(GLIB_MKENUMS) \
--fhead "#ifndef __AGENT_ENUM_TYPES_H__\n#define __AGENT_ENUM_TYPES_H__ 1\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define NICE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* !AGENT_ENUM_TYPES_H */" \
$(addprefix $(srcdir)/,agent.h) > $@
agent-enum-types.c: agent.h Makefile agent-enum-types.h
$(AM_V_GEN)$(GLIB_MKENUMS) \
--fhead "#include <config.h>\n#include <glib-object.h>\n#include \"agent.h\"\n#include \"agent-enum-types.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType type = 0;\n if (!type) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n type = g_@type@_register_static (\"@EnumName@\", values);\n }\n return type;\n}\n\n" \
$(addprefix $(srcdir)/,agent.h) > $@
libagent_la_LIBADD = \ libagent_la_LIBADD = \
$(top_builddir)/random/libnice-random.la \ $(top_builddir)/random/libnice-random.la \
$(top_builddir)/socket/libsocket.la \ $(top_builddir)/socket/libsocket.la \
......
...@@ -116,12 +116,32 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a, ...@@ -116,12 +116,32 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a,
* MTU and estimated typical sizes of ICE STUN packet */ * MTU and estimated typical sizes of ICE STUN packet */
#define MAX_STUN_DATAGRAM_PAYLOAD 1300 #define MAX_STUN_DATAGRAM_PAYLOAD 1300
#define NICE_COMPONENT_MAX_VALID_CANDIDATES 50 /* maximum number of validates remote candidates to keep, the number is arbitrary but hopefully large enough */
/* A convenient macro to test if the agent is compatible with RFC5245
* or OC2007R2. Specifically these two modes share the support
* of the regular or aggressive nomination mode */
#define NICE_AGENT_IS_COMPATIBLE_WITH_RFC5245_OR_OC2007R2(obj) \
((obj)->compatibility == NICE_COMPATIBILITY_RFC5245 || \
(obj)->compatibility == NICE_COMPATIBILITY_OC2007R2)
/* A grace period before declaring a component as failed, in msecs. This
* delay is added to reduce the chance to see the agent receiving new
* stun activity just after the conncheck list has been declared failed,
* reactiviting conncheck activity, and causing a (valid) state
* transitions like that: connecting -> failed -> connecting ->
* connected -> ready.
* Such transitions are not buggy per-se, but may break the
* test-suite, that counts precisely the number of time each state
* has been set, and doesnt expect these transcient failed states.
*/
#define NICE_AGENT_MAX_TIMER_GRACE_PERIOD 1000
struct _NiceAgent struct _NiceAgent
{ {
GObject parent; /* gobject pointer */ GObject parent; /* gobject pointer */
gboolean full_mode; /* property: full-mode */ gboolean full_mode; /* property: full-mode */
GTimeVal next_check_tv; /* property: next conncheck timestamp */
gchar *stun_server_ip; /* property: STUN server IP */ gchar *stun_server_ip; /* property: STUN server IP */
guint stun_server_port; /* property: STUN server port */ guint stun_server_port; /* property: STUN server port */
gchar *proxy_ip; /* property: Proxy server IP */ gchar *proxy_ip; /* property: Proxy server IP */
...@@ -134,6 +154,7 @@ struct _NiceAgent ...@@ -134,6 +154,7 @@ struct _NiceAgent
guint max_conn_checks; /* property: max connectivity checks */ guint max_conn_checks; /* property: max connectivity checks */
gboolean force_relay; /* property: force relay */ gboolean force_relay; /* property: force relay */
gboolean turn_short_term; /* property: turn short term credentials */ gboolean turn_short_term; /* property: turn short term credentials */
NiceNominationMode nomination_mode; /* property: Nomination mode */
GSList *local_addresses; /* list of NiceAddresses for local GSList *local_addresses; /* list of NiceAddresses for local
interfaces */ interfaces */
...@@ -167,6 +188,8 @@ struct _NiceAgent ...@@ -167,6 +188,8 @@ struct _NiceAgent
guint16 rfc4571_expecting_length; guint16 rfc4571_expecting_length;
gboolean use_ice_udp; gboolean use_ice_udp;
gboolean use_ice_tcp; gboolean use_ice_tcp;
guint conncheck_timer_grace_period; /* ongoing delay before timer stop */
/* XXX: add pointer to internal data struct for ABI-safe extensions */ /* XXX: add pointer to internal data struct for ABI-safe extensions */
}; };
......
This diff is collapsed.
...@@ -372,6 +372,26 @@ typedef enum ...@@ -372,6 +372,26 @@ typedef enum
NICE_PROXY_TYPE_LAST = NICE_PROXY_TYPE_HTTP, NICE_PROXY_TYPE_LAST = NICE_PROXY_TYPE_HTTP,
} NiceProxyType; } NiceProxyType;
/**
* NiceNominationMode:
* @NICE_NOMINATION_MODE_AGGRESSIVE: Aggressive nomination mode
* @NICE_NOMINATION_MODE_REGULAR: Regular nomination mode
*
* An enum to specity the kind of nomination mode to use by
* the agent, as described in RFC 5245. Two modes exists,
* regular and aggressive. They differ by the way the controlling
* agent chooses to put the USE-CANDIDATE attribute in its STUN
* messages. The aggressive mode is supposed to nominate a pair
* faster, than the regular mode, potentially causing the nominated
* pair to change until the connection check completes.
*
* Since: UNRELEASED
*/
typedef enum
{
NICE_NOMINATION_MODE_REGULAR = 0,
NICE_NOMINATION_MODE_AGGRESSIVE,
} NiceNominationMode;
/** /**
* NiceAgentRecvFunc: * NiceAgentRecvFunc:
...@@ -404,6 +424,26 @@ typedef void (*NiceAgentRecvFunc) ( ...@@ -404,6 +424,26 @@ typedef void (*NiceAgentRecvFunc) (
NiceAgent * NiceAgent *
nice_agent_new (GMainContext *ctx, NiceCompatibility compat); nice_agent_new (GMainContext *ctx, NiceCompatibility compat);
/**
* nice_agent_new_regular_nomination:
* @ctx: The Glib Mainloop Context to use for timers
* @compat: The compatibility mode of the agent
*
* Create a new #NiceAgent with regular nomination mode. The nomination
* mode is defined in the ICE specification and decribes the way pairs of
* connection candidates are selected by the agents. Two modes are
* available, aggressive and regular. libnice default mode is
* aggressive.
* The returned object must be freed with g_object_unref()
* <para> See also: #NiceNominationMode </para>
*
* Since: UNRELEASED
*
* Returns: The new agent GObject
*/
NiceAgent *
nice_agent_new_regular_nomination (GMainContext *ctx, NiceCompatibility compat);
/** /**
* nice_agent_add_local_address: * nice_agent_add_local_address:
* @agent: The #NiceAgent Object * @agent: The #NiceAgent Object
......
...@@ -191,21 +191,21 @@ nice_candidate_ice_local_preference (const NiceCandidate *candidate) ...@@ -191,21 +191,21 @@ nice_candidate_ice_local_preference (const NiceCandidate *candidate)
{ {
case NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE: case NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE:
if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE || if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE ||
candidate->type == NICE_CANDIDATE_TYPE_PREF_NAT_ASSISTED) candidate->type == NICE_CANDIDATE_TYPE_HOST)
direction_preference = 4; direction_preference = 4;
else else
direction_preference = 6; direction_preference = 6;
break; break;
case NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE: case NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE:
if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE || if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE ||
candidate->type == NICE_CANDIDATE_TYPE_PREF_NAT_ASSISTED) candidate->type == NICE_CANDIDATE_TYPE_HOST)
direction_preference = 2; direction_preference = 2;
else else
direction_preference = 4; direction_preference = 4;
break; break;
case NICE_CANDIDATE_TRANSPORT_TCP_SO: case NICE_CANDIDATE_TRANSPORT_TCP_SO:
if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE || if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE ||
candidate->type == NICE_CANDIDATE_TYPE_PREF_NAT_ASSISTED) candidate->type == NICE_CANDIDATE_TYPE_HOST)
direction_preference = 6; direction_preference = 6;
else else
direction_preference = 2; direction_preference = 2;
...@@ -360,3 +360,14 @@ nice_candidate_copy (const NiceCandidate *candidate) ...@@ -360,3 +360,14 @@ nice_candidate_copy (const NiceCandidate *candidate)
return copy; return copy;
} }
NICEAPI_EXPORT gboolean
nice_candidate_equal_target (const NiceCandidate *candidate1,
const NiceCandidate *candidate2)
{
g_return_val_if_fail (candidate1 != NULL, FALSE);
g_return_val_if_fail (candidate2 != NULL, FALSE);
return (candidate1->transport == candidate2->transport &&
nice_address_equal (&candidate1->addr, &candidate2->addr));
}
...@@ -230,7 +230,23 @@ nice_candidate_free (NiceCandidate *candidate); ...@@ -230,7 +230,23 @@ nice_candidate_free (NiceCandidate *candidate);
NiceCandidate * NiceCandidate *
nice_candidate_copy (const NiceCandidate *candidate); nice_candidate_copy (const NiceCandidate *candidate);
GType nice_candidate_get_type (void); /**
* nice_candidate_equal_target:
* @candidate1: A candidate
* @candidate2: A candidate
*
* Verifies that the candidates point to the same place, meaning they have
* the same transport and the same address. It ignores all other aspects.
*
* Returns: %TRUE if the candidates point to the same place
*
* Since: 0.1.15
*/
gboolean
nice_candidate_equal_target (const NiceCandidate *candidate1,
const NiceCandidate *candidate2);
GType nice_candidate_get_type (void);
/** /**
* NICE_TYPE_CANDIDATE: * NICE_TYPE_CANDIDATE:
......
...@@ -105,6 +105,13 @@ socket_source_attach (SocketSource *socket_source, GMainContext *context) ...@@ -105,6 +105,13 @@ socket_source_attach (SocketSource *socket_source, GMainContext *context)
if (socket_source->socket->fileno == NULL) if (socket_source->socket->fileno == NULL)
return; return;
/* Do not create a GSource for UDP turn socket, because it
* would duplicate the packets already received on the base
* UDP socket.
*/
if (socket_source->socket->type == NICE_SOCKET_TYPE_UDP_TURN)
return;
/* Create a source. */ /* Create a source. */
source = g_socket_create_source (socket_source->socket->fileno, source = g_socket_create_source (socket_source->socket->fileno,
G_IO_IN, NULL); G_IO_IN, NULL);
...@@ -402,7 +409,7 @@ nice_component_restart (NiceComponent *cmp) ...@@ -402,7 +409,7 @@ nice_component_restart (NiceComponent *cmp)
for (i = cmp->remote_candidates; i; i = i->next) { for (i = cmp->remote_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data; NiceCandidate *candidate = i->data;
/* note: do not remove the local candidate that is /* note: do not remove the remote candidate that is
* currently part of the 'selected pair', see ICE * currently part of the 'selected pair', see ICE
* 9.1.1.1. "ICE Restarts" (ID-19) */ * 9.1.1.1. "ICE Restarts" (ID-19) */
if (candidate == cmp->selected_pair.remote) { if (candidate == cmp->selected_pair.remote) {
...@@ -457,6 +464,8 @@ nice_component_update_selected_pair (NiceComponent *component, const CandidatePa ...@@ -457,6 +464,8 @@ nice_component_update_selected_pair (NiceComponent *component, const CandidatePa
component->selected_pair.remote = pair->remote; component->selected_pair.remote = pair->remote;
component->selected_pair.priority = pair->priority; component->selected_pair.priority = pair->priority;
component->selected_pair.prflx_priority = pair->prflx_priority; component->selected_pair.prflx_priority = pair->prflx_priority;
nice_component_add_valid_candidate (component, pair->remote);
} }
/* /*
...@@ -536,6 +545,11 @@ nice_component_set_selected_remote_candidate (NiceComponent *component, ...@@ -536,6 +545,11 @@ nice_component_set_selected_remote_candidate (NiceComponent *component,
component->selected_pair.remote = remote; component->selected_pair.remote = remote;
component->selected_pair.priority = priority; component->selected_pair.priority = priority;
/* Get into fallback mode where packets from any source is accepted once
* this has been called. This is the expected behavior of pre-ICE SIP.
*/
component->fallback_mode = TRUE;
return local; return local;
} }
...@@ -1026,7 +1040,7 @@ nice_component_class_init (NiceComponentClass *klass) ...@@ -1026,7 +1040,7 @@ nice_component_class_init (NiceComponentClass *klass)
* *
* The unique numeric ID of the component. * The unique numeric ID of the component.
* *
* Since: UNRELEASED * Since: 0.1.14
*/ */
g_object_class_install_property (object_class, PROP_ID, g_object_class_install_property (object_class, PROP_ID,
g_param_spec_uint ( g_param_spec_uint (
...@@ -1041,7 +1055,7 @@ nice_component_class_init (NiceComponentClass *klass) ...@@ -1041,7 +1055,7 @@ nice_component_class_init (NiceComponentClass *klass)
* *
* The #NiceAgent this component belongs to. * The #NiceAgent this component belongs to.
* *
* Since: UNRELEASED * Since: 0.1.14
*/ */
g_object_class_install_property (object_class, PROP_AGENT, g_object_class_install_property (object_class, PROP_AGENT,
g_param_spec_object ( g_param_spec_object (
...@@ -1056,7 +1070,7 @@ nice_component_class_init (NiceComponentClass *klass) ...@@ -1056,7 +1070,7 @@ nice_component_class_init (NiceComponentClass *klass)
* *
* The #NiceStream this component belongs to. * The #NiceStream this component belongs to.
* *
* Since: UNRELEASED * Since: 0.1.14
*/ */
g_object_class_install_property (object_class, PROP_STREAM, g_object_class_install_property (object_class, PROP_STREAM,
g_param_spec_object ( g_param_spec_object (
...@@ -1193,6 +1207,9 @@ nice_component_finalize (GObject *obj) ...@@ -1193,6 +1207,9 @@ nice_component_finalize (GObject *obj)
g_warn_if_fail (cmp->remote_candidates == NULL); g_warn_if_fail (cmp->remote_candidates == NULL);
g_warn_if_fail (cmp->incoming_checks == NULL); g_warn_if_fail (cmp->incoming_checks == NULL);
g_list_free_full (cmp->valid_candidates,
(GDestroyNotify) nice_candidate_free);
g_clear_object (&cmp->stop_cancellable); g_clear_object (&cmp->stop_cancellable);
g_clear_object (&cmp->datagram_based); g_clear_object (&cmp->datagram_based);
g_mutex_clear (&cmp->io_mutex); g_mutex_clear (&cmp->io_mutex);
...@@ -1630,3 +1647,83 @@ turn_server_unref (TurnServer *turn) ...@@ -1630,3 +1647,83 @@ turn_server_unref (TurnServer *turn)
g_slice_free (TurnServer, turn); g_slice_free (TurnServer, turn);
} }
} }
void
nice_component_add_valid_candidate (NiceComponent *component,
const NiceCandidate *candidate)
{
guint count = 0;
GList *item, *last = NULL;
for (item = component->valid_candidates; item; item = item->next) {
NiceCandidate *cand = item->data;
last = item;
count++;
if (nice_candidate_equal_target (cand, candidate))
return;
}
/* New candidate */
if (nice_debug_is_enabled ()) {
char str[INET6_ADDRSTRLEN];
nice_address_to_string (&candidate->addr, str);
nice_debug ("Agent %p : %d:%d Adding valid source"
" candidate: %s:%d trans: %d\n", component->agent,
candidate->stream_id, candidate->component_id, str,
nice_address_get_port (&candidate->addr), candidate->transport);
}
component->valid_candidates = g_list_prepend (
component->valid_candidates, nice_candidate_copy (candidate));
/* Delete the last one to make sure we don't have a list that is too long,
* the candidates are not freed on ICE restart as this would be more complex,
* we just keep the list not too long.
*/
if (count > NICE_COMPONENT_MAX_VALID_CANDIDATES) {
NiceCandidate *cand = last->data;
component->valid_candidates = g_list_delete_link (
component->valid_candidates, last);
nice_candidate_free (cand);
}
}
gboolean
nice_component_verify_remote_candidate (NiceComponent *component,
const NiceAddress *address, NiceSocket *nicesock)
{
GList *item;
if (component->fallback_mode)
return TRUE;
for (item = component->valid_candidates; item; item = item->next) {
NiceCandidate *cand = item->data;
if (((nicesock->type == NICE_SOCKET_TYPE_TCP_BSD &&
(cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE ||
cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE ||
cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_SO)) ||
cand->transport == NICE_CANDIDATE_TRANSPORT_UDP) &&
nice_address_equal (address, &cand->addr)) {
/* fast return if it's already the first */
if (item == component->valid_candidates)
return TRUE;
/* Put the current candidate at the top so that in the normal use-case,
* this function becomes O(1).
*/
component->valid_candidates = g_list_remove_link (
component->valid_candidates, item);
component->valid_candidates = g_list_concat (item,
component->valid_candidates);
return TRUE;
}
}
return FALSE;
}
...@@ -160,12 +160,14 @@ struct _NiceComponent { ...@@ -160,12 +160,14 @@ struct _NiceComponent {
NiceComponentState state; NiceComponentState state;
GSList *local_candidates; /* list of NiceCandidate objs */ GSList *local_candidates; /* list of NiceCandidate objs */
GSList *remote_candidates; /* list of NiceCandidate objs */ GSList *remote_candidates; /* list of NiceCandidate objs */
GList *valid_candidates; /* list of owned remote NiceCandidates that are part of valid pairs */
GSList *socket_sources; /* list of SocketSource objs; must only grow monotonically */ GSList *socket_sources; /* list of SocketSource objs; must only grow monotonically */
guint socket_sources_age; /* incremented when socket_sources changes */ guint socket_sources_age; /* incremented when socket_sources changes */
GSList *incoming_checks; /* list of IncomingCheck objs */ GSList *incoming_checks; /* list of IncomingCheck objs */
GList *turn_servers; /* List of TurnServer objs */ GList *turn_servers; /* List of TurnServer objs */
CandidatePair selected_pair; /* independent from checklists, CandidatePair selected_pair; /* independent from checklists,
see ICE 11.1. "Sending Media" (ID-19) */ see ICE 11.1. "Sending Media" (ID-19) */
gboolean fallback_mode; /* in this case, accepts packets from all, ignore candidate validation */
NiceCandidate *restart_candidate; /* for storing active remote candidate during a restart */ NiceCandidate *restart_candidate; /* for storing active remote candidate during a restart */
NiceCandidate *turn_candidate; /* for storing active turn candidate if turn servers have been cleared */ NiceCandidate *turn_candidate; /* for storing active turn candidate if turn servers have been cleared */
/* I/O handling. The main context must always be non-NULL, and is used for all /* I/O handling. The main context must always be non-NULL, and is used for all
...@@ -297,6 +299,14 @@ turn_server_ref (TurnServer *turn); ...@@ -297,6 +299,14 @@ turn_server_ref (TurnServer *turn);
void void
turn_server_unref (TurnServer *turn); turn_server_unref (TurnServer *turn);
void
nice_component_add_valid_candidate (NiceComponent *component,
const NiceCandidate *candidate);
gboolean
nice_component_verify_remote_candidate (NiceComponent *component,
const NiceAddress *address, NiceSocket *nicesock);
G_END_DECLS G_END_DECLS
......
This diff is collapsed.
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
* @NICE_CHECK_SUCCEEDED: Connection successfully checked. * @NICE_CHECK_SUCCEEDED: Connection successfully checked.
* @NICE_CHECK_FAILED: No connectivity; retransmissions ceased. * @NICE_CHECK_FAILED: No connectivity; retransmissions ceased.
* @NICE_CHECK_FROZEN: Waiting to be scheduled to %NICE_CHECK_WAITING. * @NICE_CHECK_FROZEN: Waiting to be scheduled to %NICE_CHECK_WAITING.
* @NICE_CHECK_CANCELLED: Check cancelled.
* @NICE_CHECK_DISCOVERED: A valid candidate pair not on the check list. * @NICE_CHECK_DISCOVERED: A valid candidate pair not on the check list.
* *
* States for checking a candidate pair. * States for checking a candidate pair.
...@@ -68,7 +67,6 @@ typedef enum ...@@ -68,7 +67,6 @@ typedef enum
NICE_CHECK_SUCCEEDED, NICE_CHECK_SUCCEEDED,
NICE_CHECK_FAILED, NICE_CHECK_FAILED,
NICE_CHECK_FROZEN, NICE_CHECK_FROZEN,