Commit b6e22402 authored by Youness Alaoui's avatar Youness Alaoui

Adapt libnice to new turn usage API

parent 8d92c858
...@@ -55,6 +55,8 @@ ...@@ -55,6 +55,8 @@
#include "conncheck.h" #include "conncheck.h"
#include "discovery.h" #include "discovery.h"
#include "stun/usages/ice.h" #include "stun/usages/ice.h"
#include "stun/usages/bind.h"
#include "stun/usages/turn.h"
static void priv_update_check_list_failed_components (NiceAgent *agent, Stream *stream); static void priv_update_check_list_failed_components (NiceAgent *agent, Stream *stream);
static void priv_prune_pending_checks (Stream *stream, guint component_id); static void priv_prune_pending_checks (Stream *stream, guint component_id);
......
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#include "agent-signals-marshal.h" #include "agent-signals-marshal.h"
#include "component.h" #include "component.h"
#include "discovery.h" #include "discovery.h"
#include "stun/usages/bind.h"
#include "stun/usages/turn.h"
static inline int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restrict now) static inline int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restrict now)
{ {
...@@ -564,7 +566,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer) ...@@ -564,7 +566,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
NiceAgent *agent = pointer; NiceAgent *agent = pointer;
GSList *i; GSList *i;
int not_done = 0; /* note: track whether to continue timer */ int not_done = 0; /* note: track whether to continue timer */
size_t buffer_len; size_t buffer_len = 0;
#ifndef NDEBUG #ifndef NDEBUG
{ {
...@@ -606,9 +608,13 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer) ...@@ -606,9 +608,13 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
&cand->stun_message, cand->stun_buffer, sizeof(cand->stun_buffer)); &cand->stun_message, cand->stun_buffer, sizeof(cand->stun_buffer));
} else if (cand->type == NICE_CANDIDATE_TYPE_RELAYED) { } else if (cand->type == NICE_CANDIDATE_TYPE_RELAYED) {
buffer_len = stun_usage_turn_create (&agent->stun_agent, buffer_len = stun_usage_turn_create (&agent->stun_agent,
agent->turn_username, strlen (agent->turn_username), &cand->stun_message, cand->stun_buffer, sizeof(cand->stun_buffer),
agent->turn_password, strlen (agent->turn_password), NULL,
&cand->stun_message, cand->stun_buffer, sizeof(cand->stun_buffer)); STUN_USAGE_TURN_REQUEST_PORT_NORMAL,
0, 0,
(uint8_t *)agent->turn_username, (size_t) strlen (agent->turn_username),
(uint8_t *)agent->turn_password, (size_t) strlen (agent->turn_password),
STUN_USAGE_TURN_COMPATIBILITY_GOOGLE);
} }
if (buffer_len > 0) { if (buffer_len > 0) {
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
/* note: this is a private header to libnice */ /* note: this is a private header to libnice */
#include "stun/usages/bind.h"
#include "stream.h" #include "stream.h"
#include "agent.h" #include "agent.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment