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
2a9bac88
Commit
2a9bac88
authored
Nov 12, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use stun_agent instead of turn_agent in order to be more generic
parent
6b81931a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
agent/agent.c
agent/agent.c
+3
-3
agent/conncheck.c
agent/conncheck.c
+4
-4
agent/discovery.c
agent/discovery.c
+2
-2
agent/discovery.h
agent/discovery.h
+2
-2
No files found.
agent/agent.c
View file @
2a9bac88
...
@@ -788,16 +788,16 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
...
@@ -788,16 +788,16 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
cdisco
->
agent
=
agent
;
cdisco
->
agent
=
agent
;
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
)
{
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
)
{
stun_agent_init
(
&
cdisco
->
tur
n_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
cdisco
->
stu
n_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_RFC5389
,
STUN_COMPATIBILITY_RFC5389
,
STUN_AGENT_USAGE_ADD_SOFTWARE
|
STUN_AGENT_USAGE_ADD_SOFTWARE
|
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
stun_agent_init
(
&
cdisco
->
tur
n_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
cdisco
->
stu
n_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_RFC3489
,
STUN_COMPATIBILITY_RFC3489
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
);
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
);
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
stun_agent_init
(
&
cdisco
->
tur
n_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
cdisco
->
stu
n_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_RFC3489
,
STUN_COMPATIBILITY_RFC3489
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_IGNORE_CREDENTIALS
);
STUN_AGENT_USAGE_IGNORE_CREDENTIALS
);
...
...
agent/conncheck.c
View file @
2a9bac88
...
@@ -576,7 +576,7 @@ static void priv_turn_allocate_refresh_tick_unlocked (CandidateRefresh *cand)
...
@@ -576,7 +576,7 @@ static void priv_turn_allocate_refresh_tick_unlocked (CandidateRefresh *cand)
password
=
g_base64_decode
((
gchar
*
)
password
,
&
password_len
);
password
=
g_base64_decode
((
gchar
*
)
password
,
&
password_len
);
}
}
buffer_len
=
stun_usage_turn_create_refresh
(
&
cand
->
tur
n_agent
,
buffer_len
=
stun_usage_turn_create_refresh
(
&
cand
->
stu
n_agent
,
&
cand
->
stun_message
,
cand
->
stun_buffer
,
sizeof
(
cand
->
stun_buffer
),
&
cand
->
stun_message
,
cand
->
stun_buffer
,
sizeof
(
cand
->
stun_buffer
),
cand
->
stun_resp_msg
.
buffer
==
NULL
?
NULL
:
&
cand
->
stun_resp_msg
,
-
1
,
cand
->
stun_resp_msg
.
buffer
==
NULL
?
NULL
:
&
cand
->
stun_resp_msg
,
-
1
,
username
,
username_len
,
username
,
username_len
,
...
@@ -1877,7 +1877,7 @@ priv_add_new_turn_refresh (CandidateDiscovery *cdisco, NiceCandidate *relay_cand
...
@@ -1877,7 +1877,7 @@ priv_add_new_turn_refresh (CandidateDiscovery *cdisco, NiceCandidate *relay_cand
cand
->
stream
=
cdisco
->
stream
;
cand
->
stream
=
cdisco
->
stream
;
cand
->
component
=
cdisco
->
component
;
cand
->
component
=
cdisco
->
component
;
cand
->
agent
=
cdisco
->
agent
;
cand
->
agent
=
cdisco
->
agent
;
memcpy
(
&
cand
->
turn_agent
,
&
cdisco
->
tur
n_agent
,
sizeof
(
StunAgent
));
memcpy
(
&
cand
->
stun_agent
,
&
cdisco
->
stu
n_agent
,
sizeof
(
StunAgent
));
nice_debug
(
"Agent %p : Adding new refresh candidate %p with timeout %d"
,
nice_debug
(
"Agent %p : Adding new refresh candidate %p with timeout %d"
,
agent
,
cand
,
(
lifetime
-
60
)
*
1000
);
agent
,
cand
,
(
lifetime
-
60
)
*
1000
);
agent
->
refresh_list
=
modified_list
;
agent
->
refresh_list
=
modified_list
;
...
@@ -2241,7 +2241,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
...
@@ -2241,7 +2241,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
if
(
d
->
type
==
NICE_CANDIDATE_TYPE_RELAYED
&&
if
(
d
->
type
==
NICE_CANDIDATE_TYPE_RELAYED
&&
d
->
stream
==
stream
&&
d
->
component
==
component
&&
d
->
stream
==
stream
&&
d
->
component
==
component
&&
d
->
nicesock
==
socket
)
{
d
->
nicesock
==
socket
)
{
valid
=
stun_agent_validate
(
&
d
->
tur
n_agent
,
&
req
,
valid
=
stun_agent_validate
(
&
d
->
stu
n_agent
,
&
req
,
(
uint8_t
*
)
buf
,
len
,
conncheck_stun_validater
,
&
validater_data
);
(
uint8_t
*
)
buf
,
len
,
conncheck_stun_validater
,
&
validater_data
);
if
(
valid
==
STUN_VALIDATION_UNMATCHED_RESPONSE
)
if
(
valid
==
STUN_VALIDATION_UNMATCHED_RESPONSE
)
...
@@ -2261,7 +2261,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
...
@@ -2261,7 +2261,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
stream
,
r
->
component
,
component
,
r
->
nicesock
,
r
->
relay_socket
,
socket
);
stream
,
r
->
component
,
component
,
r
->
nicesock
,
r
->
relay_socket
,
socket
);
if
(
r
->
stream
==
stream
&&
r
->
component
==
component
&&
if
(
r
->
stream
==
stream
&&
r
->
component
==
component
&&
(
r
->
nicesock
==
socket
||
r
->
relay_socket
==
socket
))
{
(
r
->
nicesock
==
socket
||
r
->
relay_socket
==
socket
))
{
valid
=
stun_agent_validate
(
&
r
->
tur
n_agent
,
&
req
,
valid
=
stun_agent_validate
(
&
r
->
stu
n_agent
,
&
req
,
(
uint8_t
*
)
buf
,
len
,
conncheck_stun_validater
,
&
validater_data
);
(
uint8_t
*
)
buf
,
len
,
conncheck_stun_validater
,
&
validater_data
);
nice_debug
(
"Validating gave %d"
,
valid
);
nice_debug
(
"Validating gave %d"
,
valid
);
if
(
valid
==
STUN_VALIDATION_UNMATCHED_RESPONSE
)
if
(
valid
==
STUN_VALIDATION_UNMATCHED_RESPONSE
)
...
...
agent/discovery.c
View file @
2a9bac88
...
@@ -186,7 +186,7 @@ void refresh_free_item (gpointer data, gpointer user_data)
...
@@ -186,7 +186,7 @@ void refresh_free_item (gpointer data, gpointer user_data)
password
=
g_base64_decode
((
gchar
*
)
password
,
&
password_len
);
password
=
g_base64_decode
((
gchar
*
)
password
,
&
password_len
);
}
}
buffer_len
=
stun_usage_turn_create_refresh
(
&
cand
->
tur
n_agent
,
buffer_len
=
stun_usage_turn_create_refresh
(
&
cand
->
stu
n_agent
,
&
cand
->
stun_message
,
cand
->
stun_buffer
,
sizeof
(
cand
->
stun_buffer
),
&
cand
->
stun_message
,
cand
->
stun_buffer
,
sizeof
(
cand
->
stun_buffer
),
cand
->
stun_resp_msg
.
buffer
==
NULL
?
NULL
:
&
cand
->
stun_resp_msg
,
0
,
cand
->
stun_resp_msg
.
buffer
==
NULL
?
NULL
:
&
cand
->
stun_resp_msg
,
0
,
username
,
username_len
,
username
,
username_len
,
...
@@ -848,7 +848,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
...
@@ -848,7 +848,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
password
=
g_base64_decode
((
gchar
*
)
password
,
&
password_len
);
password
=
g_base64_decode
((
gchar
*
)
password
,
&
password_len
);
}
}
buffer_len
=
stun_usage_turn_create
(
&
cand
->
tur
n_agent
,
buffer_len
=
stun_usage_turn_create
(
&
cand
->
stu
n_agent
,
&
cand
->
stun_message
,
cand
->
stun_buffer
,
sizeof
(
cand
->
stun_buffer
),
&
cand
->
stun_message
,
cand
->
stun_buffer
,
sizeof
(
cand
->
stun_buffer
),
cand
->
stun_resp_msg
.
buffer
==
NULL
?
NULL
:
&
cand
->
stun_resp_msg
,
cand
->
stun_resp_msg
.
buffer
==
NULL
?
NULL
:
&
cand
->
stun_resp_msg
,
STUN_USAGE_TURN_REQUEST_PORT_NORMAL
,
STUN_USAGE_TURN_REQUEST_PORT_NORMAL
,
...
...
agent/discovery.h
View file @
2a9bac88
...
@@ -53,7 +53,7 @@ typedef struct
...
@@ -53,7 +53,7 @@ typedef struct
Stream
*
stream
;
Stream
*
stream
;
Component
*
component
;
Component
*
component
;
TurnServer
*
turn
;
TurnServer
*
turn
;
StunAgent
tur
n_agent
;
StunAgent
stu
n_agent
;
uint8_t
*
msn_turn_username
;
uint8_t
*
msn_turn_username
;
uint8_t
*
msn_turn_password
;
uint8_t
*
msn_turn_password
;
stun_timer_t
timer
;
stun_timer_t
timer
;
...
@@ -72,7 +72,7 @@ typedef struct
...
@@ -72,7 +72,7 @@ typedef struct
Stream
*
stream
;
Stream
*
stream
;
Component
*
component
;
Component
*
component
;
TurnServer
*
turn
;
TurnServer
*
turn
;
StunAgent
tur
n_agent
;
StunAgent
stu
n_agent
;
GSource
*
timer_source
;
GSource
*
timer_source
;
GSource
*
tick_source
;
GSource
*
tick_source
;
uint8_t
*
msn_turn_username
;
uint8_t
*
msn_turn_username
;
...
...
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