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
30275785
Commit
30275785
authored
Feb 23, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some turn defines and use an enum instead (StunUsageTurnRequestPorts) and document a little
parent
8a92ba94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
+29
-11
stun/usages/turn.c
stun/usages/turn.c
+1
-4
stun/usages/turn.h
stun/usages/turn.h
+28
-7
No files found.
stun/usages/turn.c
View file @
30275785
...
...
@@ -68,7 +68,7 @@
size_t
stun_usage_turn_create
(
StunAgent
*
agent
,
StunMessage
*
msg
,
uint8_t
*
buffer
,
size_t
buffer_len
,
StunMessage
*
previous_response
,
uint32_t
request_props
,
StunUsageTurnRequestPorts
request_props
,
int32_t
bandwidth
,
int32_t
lifetime
,
uint8_t
*
username
,
size_t
username_len
,
uint8_t
*
password
,
size_t
password_len
,
...
...
@@ -108,9 +108,6 @@ size_t stun_usage_turn_create (StunAgent *agent, StunMessage *msg,
}
else
if
(
request_props
&
STUN_USAGE_TURN_REQUEST_PORT_EVEN
)
{
req
|=
REQUESTED_PROPS_E
;
}
if
(
request_props
&
STUN_USAGE_TURN_REQUEST_PORT_PRESERVING
)
{
req
|=
REQUESTED_PROPS_P
;
}
if
(
stun_message_append32
(
msg
,
STUN_ATTRIBUTE_REQUESTED_PORT_PROPS
,
req
)
!=
STUN_MESSAGE_RETURN_SUCCESS
)
...
...
stun/usages/turn.h
View file @
30275785
...
...
@@ -53,12 +53,33 @@
extern
"C"
{
# endif
/**
* StunUsageTurnRequestPorts:
* @STUN_USAGE_TURN_REQUEST_PORT_NORMAL: Request a normal port
* @STUN_USAGE_TURN_REQUEST_PORT_EVEN: Request an even port
* @STUN_USAGE_TURN_REQUEST_PORT_EVEN_AND_RESERVE: Request an even port and
* reserve the next higher port
*
* This enum is used to specify which port configuration you want when creating
* a new Allocation
*/
typedef
enum
{
STUN_USAGE_TURN_REQUEST_PORT_NORMAL
=
0
,
STUN_USAGE_TURN_REQUEST_PORT_EVEN
=
1
,
STUN_USAGE_TURN_REQUEST_PORT_EVEN_AND_RESERVE
=
2
}
StunUsageTurnRequestPorts
;
#define STUN_USAGE_TURN_REQUEST_PORT_NORMAL (0)
#define STUN_USAGE_TURN_REQUEST_PORT_EVEN (1)
#define STUN_USAGE_TURN_REQUEST_PORT_EVEN_AND_RESERVE (1<<1)
#define STUN_USAGE_TURN_REQUEST_PORT_PRESERVING (1<<2)
/**
* StunUsageTurnCompatibility:
* @STUN_USAGE_TURN_COMPATIBILITY_DRAFT9: Use the specification compatible with
* TURN Draft 09
* @STUN_USAGE_TURN_COMPATIBILITY_GOOGLE: Use the specification compatible with
* Google Talk's relay server
* @STUN_USAGE_TURN_COMPATIBILITY_MSN: Use the specification compatible with
* MSN TURN servers
*
* Specifies which TURN specification compatibility to use
*/
typedef
enum
{
STUN_USAGE_TURN_COMPATIBILITY_DRAFT9
,
STUN_USAGE_TURN_COMPATIBILITY_GOOGLE
,
...
...
@@ -76,8 +97,8 @@ typedef enum {
size_t
stun_usage_turn_create
(
StunAgent
*
agent
,
StunMessage
*
msg
,
uint8_t
*
buffer
,
size_t
buffer_len
,
StunMessage
*
previous_re
quest
,
uint32_t
request_ports
,
StunMessage
*
previous_re
sponse
,
StunUsageTurnRequestPorts
request_ports
,
int32_t
bandwidth
,
int32_t
lifetime
,
uint8_t
*
username
,
size_t
username_len
,
uint8_t
*
password
,
size_t
password_len
,
...
...
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