Commit 50fb51ff authored by Youness Alaoui's avatar Youness Alaoui
Browse files

Change ICE_COMPATIBILITY_ID19 into ICE_COMPATIBILITY_DRAFT19 for more clarity

parent cec76525
......@@ -199,8 +199,8 @@ nice_agent_class_init (NiceAgentClass *klass)
"compatibility",
"ICE specification compatibility",
"The compatibility mode for the agent",
NICE_COMPATIBILITY_ID19, NICE_COMPATIBILITY_LAST,
NICE_COMPATIBILITY_ID19,
NICE_COMPATIBILITY_DRAFT19, NICE_COMPATIBILITY_LAST,
NICE_COMPATIBILITY_DRAFT19,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class, PROP_STUN_SERVER,
......@@ -370,7 +370,7 @@ nice_agent_init (NiceAgent *agent)
agent->discovery_timer_id = 0;
agent->conncheck_timer_id = 0;
agent->keepalive_timer_id = 0;
agent->compatibility = NICE_COMPATIBILITY_ID19;
agent->compatibility = NICE_COMPATIBILITY_DRAFT19;
stun_agent_init (&agent->stun_agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_3489BIS,
......@@ -479,7 +479,7 @@ nice_agent_set_property (
case PROP_COMPATIBILITY:
agent->compatibility = g_value_get_uint (value);
if (agent->compatibility == NICE_COMPATIBILITY_ID19) {
if (agent->compatibility == NICE_COMPATIBILITY_DRAFT19) {
stun_agent_init (&agent->stun_agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_3489BIS,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS |
......@@ -701,7 +701,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
cdisco->component = stream_find_component_by_id (stream, component_id);
cdisco->agent = agent;
if (agent->compatibility == NICE_COMPATIBILITY_ID19) {
if (agent->compatibility == NICE_COMPATIBILITY_DRAFT19) {
stun_agent_init (&cdisco->turn_agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_3489BIS,
long_term ? STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS :
......
......@@ -99,7 +99,7 @@ typedef enum
typedef enum
{
NICE_COMPATIBILITY_ID19 = 0,
NICE_COMPATIBILITY_DRAFT19 = 0,
NICE_COMPATIBILITY_GOOGLE,
NICE_COMPATIBILITY_MSN,
NICE_COMPATIBILITY_LAST = NICE_COMPATIBILITY_MSN
......
......@@ -73,16 +73,16 @@ static int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restrict now)
}
static StunUsageIceCompatibility priv_agent_to_ice_compatibility (NiceAgent *agent) {
return agent->compatibility == NICE_COMPATIBILITY_ID19 ?
STUN_USAGE_ICE_COMPATIBILITY_ID19 :
return agent->compatibility == NICE_COMPATIBILITY_DRAFT19 ?
STUN_USAGE_ICE_COMPATIBILITY_DRAFT19 :
agent->compatibility == NICE_COMPATIBILITY_GOOGLE ?
STUN_USAGE_ICE_COMPATIBILITY_GOOGLE :
agent->compatibility == NICE_COMPATIBILITY_MSN ?
STUN_USAGE_ICE_COMPATIBILITY_MSN : STUN_USAGE_ICE_COMPATIBILITY_ID19;
STUN_USAGE_ICE_COMPATIBILITY_MSN : STUN_USAGE_ICE_COMPATIBILITY_DRAFT19;
}
static StunUsageTurnCompatibility priv_agent_to_turn_compatibility (NiceAgent *agent) {
return agent->compatibility == NICE_COMPATIBILITY_ID19 ?
return agent->compatibility == NICE_COMPATIBILITY_DRAFT19 ?
STUN_USAGE_TURN_COMPATIBILITY_TD9 :
agent->compatibility == NICE_COMPATIBILITY_GOOGLE ?
STUN_USAGE_TURN_COMPATIBILITY_GOOGLE :
......@@ -901,7 +901,7 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *
/* note: do not create pairs where local candidate is
* a srv-reflexive (ICE 5.7.3. "Pruning the Pairs" ID-19) */
if (agent->compatibility == NICE_COMPATIBILITY_ID19 &&
if (agent->compatibility == NICE_COMPATIBILITY_DRAFT19 &&
local->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE)
continue;
......@@ -1010,7 +1010,7 @@ size_t priv_gen_username (NiceAgent *agent, guint component_id,
gsize local_len = strlen (local);
if (remote_len > 0 && local_len > 0) {
if (agent->compatibility == NICE_COMPATIBILITY_ID19 &&
if (agent->compatibility == NICE_COMPATIBILITY_DRAFT19 &&
dest_len >= remote_len + local_len + 1) {
memcpy (dest, remote, remote_len);
len += remote_len;
......
......@@ -70,7 +70,7 @@ static inline int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restri
}
static StunUsageTurnCompatibility priv_agent_to_turn_compatibility (NiceAgent *agent) {
return agent->compatibility == NICE_COMPATIBILITY_ID19 ?
return agent->compatibility == NICE_COMPATIBILITY_DRAFT19 ?
STUN_USAGE_TURN_COMPATIBILITY_TD9 :
agent->compatibility == NICE_COMPATIBILITY_GOOGLE ?
STUN_USAGE_TURN_COMPATIBILITY_GOOGLE :
......
......@@ -57,7 +57,7 @@ main (void)
if (!nice_address_set_from_string (&addr, "127.0.0.1"))
g_assert_not_reached ();
agent = nice_agent_new (NULL, NICE_COMPATIBILITY_ID19);
agent = nice_agent_new (NULL, NICE_COMPATIBILITY_DRAFT19);
nice_agent_add_local_address (agent, &addr);
g_assert (nice_agent_add_stream (agent, 1) == 1);
......
......@@ -488,8 +488,8 @@ int main (void)
*/
/* step: create the agents L and R */
lagent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_ID19);
ragent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_ID19);
lagent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_DRAFT19);
ragent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_DRAFT19);
......
......@@ -775,8 +775,8 @@ int main (void)
*/
/* step: create the agents L and R */
lagent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_ID19);
ragent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_ID19);
lagent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_DRAFT19);
ragent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_DRAFT19);
/* step: add a timer to catch state changes triggered by signals */
timer_id = g_timeout_add (60000, timer_cb, NULL);
......
......@@ -75,7 +75,7 @@ main (void)
g_thread_init (NULL);
loop = g_main_loop_new (NULL, FALSE);
agent = nice_agent_new (g_main_loop_get_context (loop), NICE_COMPATIBILITY_ID19);
agent = nice_agent_new (g_main_loop_get_context (loop), NICE_COMPATIBILITY_DRAFT19);
nice_address_set_ipv4 (&addr, 0x7f000001);
nice_agent_add_local_address (agent, &addr);
stream = nice_agent_add_stream (agent, 1);
......
......@@ -89,7 +89,7 @@ main (void)
if (!nice_address_set_from_string (&addr, "127.0.0.1"))
g_assert_not_reached ();
agent = nice_agent_new (NULL, NICE_COMPATIBILITY_ID19);
agent = nice_agent_new (NULL, NICE_COMPATIBILITY_DRAFT19);
nice_agent_add_local_address (agent, &addr);
stream_id = nice_agent_add_stream (agent, 1);
nice_agent_gather_candidates (agent, stream_id);
......
......@@ -56,7 +56,7 @@ main (void)
g_thread_init (NULL);
/* set up agent */
agent = nice_agent_new (NULL, NICE_COMPATIBILITY_ID19);
agent = nice_agent_new (NULL, NICE_COMPATIBILITY_DRAFT19);
g_assert (nice_address_set_from_string (&addr, "192.168.0.1"));
nice_agent_add_local_address (agent, &addr);
stream_id = nice_agent_add_stream (agent, 1);
......
......@@ -394,8 +394,8 @@ int main (void)
/* step: create the agents L and R */
lagent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_ID19);
ragent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_ID19);
lagent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_DRAFT19);
ragent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_DRAFT19);
/* step: add a timer to catch state changes triggered by signals */
......
......@@ -62,7 +62,7 @@ main (void)
g_assert (nice_address_set_from_string (&addr_remote, "192.168.0.2"));
nice_address_set_port (&addr_remote, 2345);
agent = nice_agent_new ( NULL, NICE_COMPATIBILITY_ID19);
agent = nice_agent_new ( NULL, NICE_COMPATIBILITY_DRAFT19);
g_assert (agent->local_addresses == NULL);
......
......@@ -98,7 +98,7 @@ int main (void)
len = sizeof (resp_buf);
val = stun_usage_ice_conncheck_create_reply (&agent, &req,
&resp, resp_buf, &len, (struct sockaddr *)&ip4,
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_ID19);
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_DRAFT19);
assert (val == EINVAL);
assert (len == 0);
......@@ -112,7 +112,7 @@ int main (void)
len = sizeof (resp_buf);
val = stun_usage_ice_conncheck_create_reply (&agent, &req,
&resp, resp_buf, &len, (struct sockaddr *)&ip4,
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_ID19);
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_DRAFT19);
assert (val == EPROTO);
assert (len > 0);
......@@ -166,7 +166,7 @@ int main (void)
len = sizeof (resp_buf);
val = stun_usage_ice_conncheck_create_reply (&agent, &req,
&resp, resp_buf, &len, (struct sockaddr *)&ip4,
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_ID19);
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_DRAFT19);
assert (val == 0);
assert (len > 0);
assert (stun_agent_validate (&agent, &resp, resp_buf, len,
......@@ -186,7 +186,7 @@ int main (void)
len = sizeof (resp_buf);
val = stun_usage_ice_conncheck_create_reply (&agent, &req,
&resp, resp_buf, &len, (struct sockaddr *)&ip4,
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_ID19);
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_DRAFT19);
assert (val == EAFNOSUPPORT);
assert (len == 0);
......@@ -206,7 +206,7 @@ int main (void)
control = true;
val = stun_usage_ice_conncheck_create_reply (&agent, &req,
&resp, resp_buf, &len, (struct sockaddr *)&ip4,
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_ID19);
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_DRAFT19);
assert (val == EACCES);
assert (len > 0);
assert (control == false);
......@@ -227,7 +227,7 @@ int main (void)
control = false;
val = stun_usage_ice_conncheck_create_reply (&agent, &req,
&resp, resp_buf, &len, (struct sockaddr *)&ip4,
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_ID19);
sizeof (ip4), &control, tie, STUN_USAGE_ICE_COMPATIBILITY_DRAFT19);
assert (val == 0);
assert (len > 0);
assert (control == false);
......
......@@ -62,7 +62,7 @@ stun_usage_ice_conncheck_create (StunAgent *agent, StunMessage *msg,
stun_agent_init_request (agent, msg, buffer, buffer_len, STUN_BINDING);
if (compatibility == STUN_USAGE_ICE_COMPATIBILITY_ID19) {
if (compatibility == STUN_USAGE_ICE_COMPATIBILITY_DRAFT19) {
if (cand_use)
{
val = stun_message_append_flag (msg, STUN_ATTRIBUTE_USE_CANDIDATE);
......
......@@ -48,7 +48,7 @@ extern "C" {
# endif
typedef enum {
STUN_USAGE_ICE_COMPATIBILITY_ID19,
STUN_USAGE_ICE_COMPATIBILITY_DRAFT19,
STUN_USAGE_ICE_COMPATIBILITY_GOOGLE,
STUN_USAGE_ICE_COMPATIBILITY_MSN,
} StunUsageIceCompatibility;
......
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