Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
b9749015
Commit
b9749015
authored
Sep 10, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove alternate server for ICE and add turn compatibility function
parent
ab9bf4a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
agent/conncheck.c
agent/conncheck.c
+17
-12
No files found.
agent/conncheck.c
View file @
b9749015
...
@@ -72,13 +72,22 @@ static int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restrict now)
...
@@ -72,13 +72,22 @@ static int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restrict now)
now
->
tv_sec
>=
timer
->
tv_sec
;
now
->
tv_sec
>=
timer
->
tv_sec
;
}
}
static
int
priv_agent_to_usag
e_compatibility
(
NiceAgent
*
agent
)
{
static
StunUsageIceCompatibility
priv_agent_to_ic
e_compatibility
(
NiceAgent
*
agent
)
{
return
agent
->
compatibility
==
NICE_COMPATIBILITY_ID19
?
return
agent
->
compatibility
==
NICE_COMPATIBILITY_ID19
?
STUN_USAGE_ICE_COMPATIBILITY_ID19
:
STUN_USAGE_ICE_COMPATIBILITY_ID19
:
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
?
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
?
STUN_USAGE_ICE_COMPATIBILITY_GOOGLE
:
STUN_USAGE_ICE_COMPATIBILITY_GOOGLE
:
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
?
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
?
STUN_USAGE_ICE_COMPATIBILITY_MSN
:
NICE_COMPATIBILITY_ID19
;
STUN_USAGE_ICE_COMPATIBILITY_MSN
:
STUN_USAGE_ICE_COMPATIBILITY_ID19
;
}
static
StunUsageTurnCompatibility
priv_agent_to_turn_compatibility
(
NiceAgent
*
agent
)
{
return
agent
->
compatibility
==
NICE_COMPATIBILITY_ID19
?
STUN_USAGE_TURN_COMPATIBILITY_TD9
:
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
?
STUN_USAGE_TURN_COMPATIBILITY_GOOGLE
:
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
?
STUN_USAGE_TURN_COMPATIBILITY_MSN
:
STUN_USAGE_TURN_COMPATIBILITY_TD9
;
}
}
...
@@ -1201,7 +1210,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1201,7 +1210,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
uname
,
uname_len
,
password
,
password_len
,
uname
,
uname_len
,
password
,
password_len
,
cand_use
,
controlling
,
priority
,
cand_use
,
controlling
,
priority
,
agent
->
tie_breaker
,
agent
->
tie_breaker
,
priv_agent_to_
usag
e_compatibility
(
agent
));
priv_agent_to_
ic
e_compatibility
(
agent
));
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
g_free
(
password
);
g_free
(
password
);
...
@@ -1547,8 +1556,6 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *
...
@@ -1547,8 +1556,6 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *
{
{
struct
sockaddr
sockaddr
;
struct
sockaddr
sockaddr
;
socklen_t
socklen
=
sizeof
(
sockaddr
);
socklen_t
socklen
=
sizeof
(
sockaddr
);
struct
sockaddr
alternate
;
socklen_t
alternatelen
=
sizeof
(
sockaddr
);
GSList
*
i
;
GSList
*
i
;
StunUsageIceReturn
res
;
StunUsageIceReturn
res
;
gboolean
trans_found
=
FALSE
;
gboolean
trans_found
=
FALSE
;
...
@@ -1564,15 +1571,12 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *
...
@@ -1564,15 +1571,12 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *
if
(
memcmp
(
discovery_id
,
response_id
,
sizeof
(
stun_transid_t
))
==
0
)
{
if
(
memcmp
(
discovery_id
,
response_id
,
sizeof
(
stun_transid_t
))
==
0
)
{
res
=
stun_usage_ice_conncheck_process
(
resp
,
&
sockaddr
,
&
socklen
,
res
=
stun_usage_ice_conncheck_process
(
resp
,
&
sockaddr
,
&
socklen
,
&
alternate
,
&
alternatelen
,
priv_agent_to_ice_compatibility
(
agent
));
priv_agent_to_usage_compatibility
(
agent
));
nice_debug
(
"Agent %p : stun_bind_process/conncheck for %p res %d "
nice_debug
(
"Agent %p : stun_bind_process/conncheck for %p res %d "
"(controlling=%d)."
,
agent
,
p
,
(
int
)
res
,
agent
->
controlling_mode
);
"(controlling=%d)."
,
agent
,
p
,
(
int
)
res
,
agent
->
controlling_mode
);
if
(
res
==
STUN_USAGE_ICE_RETURN_ALTERNATE_SERVER
)
{
if
(
res
==
STUN_USAGE_ICE_RETURN_SUCCESS
)
{
/* TODO : handle alternate server */
}
else
if
(
res
==
STUN_USAGE_ICE_RETURN_SUCCESS
)
{
/* case: found a matching connectivity check request */
/* case: found a matching connectivity check request */
CandidateCheckPair
*
ok_pair
=
NULL
;
CandidateCheckPair
*
ok_pair
=
NULL
;
...
@@ -1679,7 +1683,8 @@ static gboolean priv_map_reply_to_discovery_request (NiceAgent *agent, StunMessa
...
@@ -1679,7 +1683,8 @@ static gboolean priv_map_reply_to_discovery_request (NiceAgent *agent, StunMessa
for
(
i
=
agent
->
discovery_list
;
i
&&
trans_found
!=
TRUE
;
i
=
i
->
next
)
{
for
(
i
=
agent
->
discovery_list
;
i
&&
trans_found
!=
TRUE
;
i
=
i
->
next
)
{
CandidateDiscovery
*
d
=
i
->
data
;
CandidateDiscovery
*
d
=
i
->
data
;
if
(
d
->
stun_message
.
buffer
)
{
if
(
d
->
type
==
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
&&
d
->
stun_message
.
buffer
)
{
stun_message_id
(
&
d
->
stun_message
,
discovery_id
);
stun_message_id
(
&
d
->
stun_message
,
discovery_id
);
if
(
memcmp
(
discovery_id
,
response_id
,
sizeof
(
stun_transid_t
))
==
0
)
{
if
(
memcmp
(
discovery_id
,
response_id
,
sizeof
(
stun_transid_t
))
==
0
)
{
...
@@ -1926,7 +1931,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
...
@@ -1926,7 +1931,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
res
=
stun_usage_ice_conncheck_create_reply
(
&
agent
->
stun_agent
,
&
req
,
res
=
stun_usage_ice_conncheck_create_reply
(
&
agent
->
stun_agent
,
&
req
,
&
msg
,
rbuf
,
&
rbuf_len
,
&
sockaddr
,
sizeof
(
sockaddr
),
&
msg
,
rbuf
,
&
rbuf_len
,
&
sockaddr
,
sizeof
(
sockaddr
),
&
control
,
agent
->
tie_breaker
,
&
control
,
agent
->
tie_breaker
,
priv_agent_to_
usag
e_compatibility
(
agent
));
priv_agent_to_
ic
e_compatibility
(
agent
));
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
g_free
(
req
.
key
);
g_free
(
req
.
key
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment