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
65d4782c
Commit
65d4782c
authored
Sep 16, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more clarity : COMPATIBILITY_TD9 becomes COMPATIBILITY_DRAFT9 for TURN compat
parent
932fa92f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
17 deletions
+29
-17
agent/conncheck.c
agent/conncheck.c
+2
-2
agent/discovery.c
agent/discovery.c
+16
-4
stun/tests/test-turn.c
stun/tests/test-turn.c
+5
-5
stun/usages/turn.c
stun/usages/turn.c
+4
-4
stun/usages/turn.h
stun/usages/turn.h
+1
-1
udp/udp-turn.h
udp/udp-turn.h
+1
-1
No files found.
agent/conncheck.c
View file @
65d4782c
...
...
@@ -83,11 +83,11 @@ static StunUsageIceCompatibility priv_agent_to_ice_compatibility (NiceAgent *age
static
StunUsageTurnCompatibility
priv_agent_to_turn_compatibility
(
NiceAgent
*
agent
)
{
return
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
?
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
:
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
:
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
?
STUN_USAGE_TURN_COMPATIBILITY_GOOGLE
:
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
?
STUN_USAGE_TURN_COMPATIBILITY_MSN
:
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
;
STUN_USAGE_TURN_COMPATIBILITY_MSN
:
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
;
}
...
...
agent/discovery.c
View file @
65d4782c
...
...
@@ -69,13 +69,25 @@ static inline int priv_timer_expired (GTimeVal *restrict timer, GTimeVal *restri
now
->
tv_sec
>=
timer
->
tv_sec
;
}
static
StunUsageTurnCompatibility
priv_agent_to_turn_compatibility
(
NiceAgent
*
agent
)
{
static
StunUsageTurnCompatibility
priv_agent_to_turn_compatibility
(
NiceAgent
*
agent
)
{
return
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
?
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
:
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
:
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
;
STUN_USAGE_TURN_COMPATIBILITY_MSN
:
STUN_USAGE_TURN_COMPATIBILITY_DRAFT9
;
}
static
NiceUdpTurnSocketCompatibility
priv_agent_to_udp_turn_compatibility
(
NiceAgent
*
agent
)
{
return
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
?
NICE_UDP_TURN_SOCKET_COMPATIBILITY_DRAFT9
:
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
?
NICE_UDP_TURN_SOCKET_COMPATIBILITY_GOOGLE
:
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
?
NICE_UDP_TURN_SOCKET_COMPATIBILITY_MSN
:
NICE_UDP_TURN_SOCKET_COMPATIBILITY_DRAFT9
;
}
/**
...
...
@@ -424,7 +436,7 @@ discovery_add_relay_candidate (
if
(
nice_udp_turn_create_socket_full
(
&
agent
->
relay_socket_factory
,
relay_socket
,
address
,
base_socket
,
&
component
->
turn_server
,
component
->
turn_username
,
component
->
turn_password
,
NICE_UDP_TURN_SOCKET_COMPATIBILITY_GOOGLE
))
{
priv_agent_to_udp_turn_compatibility
(
agent
)
))
{
candidate
->
sockptr
=
relay_socket
;
candidate
->
base_addr
=
base_socket
->
addr
;
...
...
stun/tests/test-turn.c
View file @
65d4782c
...
...
@@ -157,7 +157,7 @@ static void numb (void)
STUN_USAGE_TURN_REQUEST_PORT_NORMAL
,
0
,
0
,
username
,
strlen
(
username
),
password
,
strlen
(
password
),
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
);
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
);
assert
(
req_len
>
0
);
val
=
send
(
fd
,
req
,
req_len
,
MSG_NOSIGNAL
);
...
...
@@ -174,7 +174,7 @@ static void numb (void)
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
,
(
struct
sockaddr
*
)
&
alternate_addr
,
&
alternate_addrlen
,
&
bandwidth
,
&
lifetime
,
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
);
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
);
assert
(
val
==
STUN_USAGE_TURN_RETURN_ERROR
);
req_len
=
stun_usage_turn_create
(
&
agent
,
&
req_msg
,
req
,
sizeof
(
req
),
...
...
@@ -182,7 +182,7 @@ static void numb (void)
STUN_USAGE_TURN_REQUEST_PORT_NORMAL
,
0
,
0
,
username
,
strlen
(
username
),
password
,
strlen
(
password
),
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
);
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
);
assert
(
req_len
>
0
);
val
=
send
(
fd
,
req
,
req_len
,
MSG_NOSIGNAL
);
...
...
@@ -199,7 +199,7 @@ static void numb (void)
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
,
(
struct
sockaddr
*
)
&
alternate_addr
,
&
alternate_addrlen
,
&
bandwidth
,
&
lifetime
,
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
);
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
);
assert
(
val
==
STUN_USAGE_TURN_RETURN_MAPPED_SUCCESS
);
printaddr
(
"Relay address found : "
,
(
struct
sockaddr
*
)
&
relay_addr
,
relay_addrlen
);
...
...
@@ -207,7 +207,7 @@ static void numb (void)
req_len
=
stun_usage_turn_create_refresh
(
&
agent
,
&
refresh_msg
,
refresh
,
sizeof
(
refresh
),
&
req_msg
,
0
,
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
);
sizeof
(
refresh
),
&
req_msg
,
0
,
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
);
assert
(
req_len
>
0
);
val
=
send
(
fd
,
refresh
,
req_len
,
MSG_NOSIGNAL
);
...
...
stun/usages/turn.c
View file @
65d4782c
...
...
@@ -75,7 +75,7 @@ size_t stun_usage_turn_create (StunAgent *agent, StunMessage *msg,
{
stun_agent_init_request
(
agent
,
msg
,
buffer
,
buffer_len
,
STUN_ALLOCATE
);
if
(
compatibility
==
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
)
{
if
(
compatibility
==
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
)
{
if
(
stun_message_append32
(
msg
,
STUN_ATTRIBUTE_REQUESTED_TRANSPORT
,
TURN_REQUESTED_TRANSPORT_UDP
)
!=
0
)
return
0
;
...
...
@@ -93,7 +93,7 @@ size_t stun_usage_turn_create (StunAgent *agent, StunMessage *msg,
return
0
;
}
if
(
compatibility
==
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
&&
if
(
compatibility
==
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
&&
request_props
!=
STUN_USAGE_TURN_REQUEST_PORT_NORMAL
)
{
uint32_t
req
=
0
;
...
...
@@ -158,7 +158,7 @@ size_t stun_usage_turn_create_refresh (StunAgent *agent, StunMessage *msg,
uint8_t
*
username
=
NULL
;
uint16_t
len
;
if
(
compatibility
==
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
)
{
if
(
compatibility
==
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
)
{
stun_agent_init_request
(
agent
,
msg
,
buffer
,
buffer_len
,
STUN_REFRESH
);
if
(
lifetime
>=
0
)
{
if
(
stun_message_append32
(
msg
,
STUN_ATTRIBUTE_LIFETIME
,
lifetime
)
!=
0
)
...
...
@@ -250,7 +250,7 @@ StunUsageTurnReturn stun_usage_turn_process (StunMessage *msg,
stun_debug
(
"Received %u-bytes STUN message
\n
"
,
stun_message_length
(
msg
));
if
(
compatibility
==
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
)
{
if
(
compatibility
==
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
)
{
val
=
stun_message_find_xor_addr
(
msg
,
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS
,
addr
,
addrlen
);
...
...
stun/usages/turn.h
View file @
65d4782c
...
...
@@ -57,7 +57,7 @@ extern "C" {
#define STUN_USAGE_TURN_REQUEST_PORT_PRESERVING (1<<2)
typedef
enum
{
STUN_USAGE_TURN_COMPATIBILITY_
TD
9
,
STUN_USAGE_TURN_COMPATIBILITY_
DRAFT
9
,
STUN_USAGE_TURN_COMPATIBILITY_GOOGLE
,
STUN_USAGE_TURN_COMPATIBILITY_MSN
,
}
StunUsageTurnCompatibility
;
...
...
udp/udp-turn.h
View file @
65d4782c
...
...
@@ -43,7 +43,7 @@
G_BEGIN_DECLS
typedef
enum
{
NICE_UDP_TURN_SOCKET_COMPATIBILITY_
TD
9
,
NICE_UDP_TURN_SOCKET_COMPATIBILITY_
DRAFT
9
,
NICE_UDP_TURN_SOCKET_COMPATIBILITY_GOOGLE
,
NICE_UDP_TURN_SOCKET_COMPATIBILITY_MSN
,
}
NiceUdpTurnSocketCompatibility
;
...
...
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