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
2dea9ea9
Commit
2dea9ea9
authored
Apr 05, 2014
by
Youness Alaoui
Committed by
Olivier Crête
May 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate valid TCP connection check pairs
parent
f5dd8ac5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
agent/conncheck.c
agent/conncheck.c
+27
-1
No files found.
agent/conncheck.c
View file @
2dea9ea9
...
...
@@ -1302,9 +1302,28 @@ static void priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Componen
}
}
static
NiceCandidateTransport
priv_match_transport
(
NiceCandidateTransport
transport
)
{
switch
(
transport
)
{
case
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
:
return
NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE
;
break
;
case
NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE
:
return
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
;
break
;
case
NICE_CANDIDATE_TRANSPORT_TCP_SO
:
case
NICE_CANDIDATE_TRANSPORT_UDP
:
default:
return
transport
;
break
;
}
}
static
gboolean
priv_conn_check_add_for_candidate_pair
(
NiceAgent
*
agent
,
guint
stream_id
,
Component
*
component
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
)
{
gboolean
ret
=
FALSE
;
/* note: do not create pairs where the local candidate is
* a srv-reflexive (ICE 5.7.3. "Pruning the pairs" ID-9) */
if
((
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
||
...
...
@@ -1314,10 +1333,17 @@ static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent, guint
return
FALSE
;
}
/* note: do not create pairs where local candidate has TCP passive transport
* (ice-tcp-13 6.2. "Forming the Check Lists") */
if
(
local
->
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE
)
{
return
FALSE
;
}
/* note: match pairs only if transport and address family are the same */
if
(
local
->
transport
==
remote
->
transport
&&
if
(
local
->
transport
==
priv_match_transport
(
remote
->
transport
)
&&
local
->
addr
.
s
.
addr
.
sa_family
==
remote
->
addr
.
s
.
addr
.
sa_family
)
{
nice_debug
(
"Agent %p, Adding check pair between %s and %s"
,
agent
,
local
->
foundation
,
remote
->
foundation
);
priv_add_new_check_pair
(
agent
,
stream_id
,
component
,
local
,
remote
,
NICE_CHECK_FROZEN
,
FALSE
);
ret
=
TRUE
;
if
(
component
->
state
<
NICE_COMPONENT_STATE_CONNECTED
)
{
...
...
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