Imported Upstream version 0.1.17
[platform/upstream/libnice.git] / agent / agent-priv.h
index ee1000e..d6c488c 100644 (file)
@@ -106,7 +106,7 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a,
 
 #define NICE_AGENT_TIMER_TA_DEFAULT 20      /* timer Ta, msecs (impl. defined) */
 #define NICE_AGENT_TIMER_TR_DEFAULT 25000   /* timer Tr, msecs (impl. defined) */
-#define NICE_AGENT_MAX_CONNECTIVITY_CHECKS_DEFAULT 100 /* see spec 5.7.3 (ID-19) */
+#define NICE_AGENT_MAX_CONNECTIVITY_CHECKS_DEFAULT 100 /* see RFC 8445 6.1.2.5 */
 
 
 /* An upper limit to size of STUN packets handled (based on Ethernet
@@ -122,18 +122,6 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a,
   ((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
 {
   GObject parent;                 /* gobject pointer */
@@ -157,10 +145,12 @@ struct _NiceAgent
   guint stun_reliable_timeout;    /* property: stun reliable timeout */
   NiceNominationMode nomination_mode; /* property: Nomination mode */
   gboolean support_renomination;  /* property: support RENOMINATION STUN attribute */
+  guint idle_timeout;             /* property: conncheck timeout before stop */
 
   GSList *local_addresses;        /* list of NiceAddresses for local
                                     interfaces */
   GSList *streams;                /* list of Stream objects */
+  GSList *pruning_streams;        /* list of Streams current being shut down */
   GMainContext *main_context;     /* main context pointer */
   guint next_candidate_id;        /* id of next created candidate */
   guint next_stream_id;           /* id of next created candidate */
@@ -193,7 +183,7 @@ struct _NiceAgent
   gboolean use_ice_tcp;
   gboolean use_ice_trickle;
 
-  guint conncheck_timer_grace_period; /* ongoing delay before timer stop */
+  guint conncheck_ongoing_idle_delay; /* ongoing delay before timer stop */
   gboolean controlling_mode;          /* controlling mode used by the
                                          conncheck */
   /* XXX: add pointer to internal data struct for ABI-safe extensions */
@@ -239,6 +229,10 @@ void agent_signal_initial_binding_request_received (NiceAgent *agent, NiceStream
 
 guint64 agent_candidate_pair_priority (NiceAgent *agent, NiceCandidate *local, NiceCandidate *remote);
 
+NiceSocket * agent_create_tcp_turn_socket (NiceAgent *agent,
+    NiceStream *stream, NiceComponent *component, NiceSocket *nicesock,
+    NiceAddress *server, NiceRelayType type, gboolean reliable_tcp);
+
 typedef gboolean (*NiceTimeoutLockedCallback)(NiceAgent *agent,
     gpointer user_data);
 void agent_timeout_add_with_context (NiceAgent *agent, GSource **out,
@@ -285,7 +279,6 @@ input_message_get_size (const NiceInputMessage *message);
 gssize agent_socket_send (NiceSocket *sock, const NiceAddress *addr, gsize len,
     const gchar *buf);
 
-
 guint32
 nice_candidate_jingle_priority (NiceCandidate *candidate);
 
@@ -307,6 +300,11 @@ nice_candidate_ms_ice_priority (const NiceCandidate *candidate,
 guint64
 nice_candidate_pair_priority (guint32 o_prio, guint32 a_prio);
 
+#define NICE_CANDIDATE_PAIR_PRIORITY_MAX_SIZE 32
+
+void
+nice_candidate_pair_priority_to_string (guint64 prio, gchar *string);
+
 /*
  * nice_debug_init:
  *