summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--agent/agent.c25
-rw-r--r--agent/agent.h20
-rw-r--r--docs/reference/libnice/libnice-sections.txt1
-rw-r--r--nice/libnice.sym1
-rw-r--r--win32/vs9/libnice.def1
5 files changed, 48 insertions, 0 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 35f2764..5fef092 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -4817,3 +4817,28 @@ nice_agent_get_io_stream (NiceAgent *agent, guint stream_id,
return iostream;
}
+
+NICEAPI_EXPORT gboolean
+nice_agent_forget_relays (NiceAgent *agent, guint stream_id, guint component_id)
+{
+ Component *component;
+ gboolean ret = TRUE;
+
+ g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
+ g_return_val_if_fail (stream_id >= 1, FALSE);
+ g_return_val_if_fail (component_id >= 1, FALSE);
+
+ agent_lock ();
+
+ if (!agent_find_component (agent, stream_id, component_id, NULL, &component)) {
+ ret = FALSE;
+ goto done;
+ }
+
+ component_clean_turn_servers (component);
+
+ done:
+ agent_unlock_and_emit (agent);
+
+ return ret;
+}
diff --git a/agent/agent.h b/agent/agent.h
index 8ffa3a0..f0b7ee5 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -1447,6 +1447,26 @@ nice_agent_get_io_stream (
const gchar *
nice_component_state_to_string (NiceComponentState state);
+/**
+ * nice_agent_forget_relays:
+ * @agent: The #NiceAgent Object
+ * @stream_id: The ID of the stream
+ * @component_id: The ID of the component
+ *
+ * Forget all the relay servers previously added using
+ * nice_agent_set_relay_info(). Currently connected streams will keep
+ * using the relay as long as they have not been restarted and haven't
+ * succesfully negotiated a different path.
+ *
+ * Returns: %FALSE if the component could not be found, %TRUE otherwise
+ *
+ * Since: 0.1.6
+ */
+gboolean
+nice_agent_forget_relays (NiceAgent *agent,
+ guint stream_id,
+ guint component_id);
+
G_END_DECLS
#endif /* _AGENT_H */
diff --git a/docs/reference/libnice/libnice-sections.txt b/docs/reference/libnice/libnice-sections.txt
index edbdeef..856dc6b 100644
--- a/docs/reference/libnice/libnice-sections.txt
+++ b/docs/reference/libnice/libnice-sections.txt
@@ -17,6 +17,7 @@ nice_agent_set_port_range
nice_agent_add_stream
nice_agent_remove_stream
nice_agent_set_relay_info
+nice_agent_forget_relays
nice_agent_gather_candidates
nice_agent_set_remote_credentials
nice_agent_get_local_credentials
diff --git a/nice/libnice.sym b/nice/libnice.sym
index b2c92ca..2f0ef30 100644
--- a/nice/libnice.sym
+++ b/nice/libnice.sym
@@ -21,6 +21,7 @@ nice_agent_recv_messages
nice_agent_recv_nonblocking
nice_agent_recv_messages_nonblocking
nice_agent_attach_recv
+nice_agent_forget_relays
nice_agent_gather_candidates
nice_agent_generate_local_candidate_sdp
nice_agent_generate_local_sdp
diff --git a/win32/vs9/libnice.def b/win32/vs9/libnice.def
index 1ab1317..1faebc2 100644
--- a/win32/vs9/libnice.def
+++ b/win32/vs9/libnice.def
@@ -21,6 +21,7 @@ nice_address_to_string
nice_agent_add_local_address
nice_agent_add_stream
nice_agent_attach_recv
+nice_agent_forget_relays
nice_agent_gather_candidates
nice_agent_generate_local_candidate_sdp
nice_agent_generate_local_sdp