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
9eba3b31
Commit
9eba3b31
authored
Sep 30, 2010
by
Jakub Adam
Committed by
Youness Alaoui
Oct 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compatibility with MSOC 2007 R2
parent
67130554
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
9 deletions
+62
-9
agent/agent.c
agent/agent.c
+9
-0
agent/agent.h
agent/agent.h
+3
-1
agent/conncheck.c
agent/conncheck.c
+9
-4
stun/stunmessage.h
stun/stunmessage.h
+5
-1
stun/usages/ice.c
stun/usages/ice.c
+27
-2
stun/usages/ice.h
stun/usages/ice.h
+9
-1
No files found.
agent/agent.c
View file @
9eba3b31
...
@@ -149,6 +149,10 @@ agent_to_ice_compatibility (NiceAgent *agent)
...
@@ -149,6 +149,10 @@ agent_to_ice_compatibility (NiceAgent *agent)
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
:
STUN_USAGE_ICE_COMPATIBILITY_MSN
:
agent
->
compatibility
==
NICE_COMPATIBILITY_WLM2009
?
STUN_USAGE_ICE_COMPATIBILITY_WLM2009
:
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007R2
?
STUN_USAGE_ICE_COMPATIBILITY_WLM2009
:
STUN_USAGE_ICE_COMPATIBILITY_RFC5245
;
STUN_USAGE_ICE_COMPATIBILITY_RFC5245
;
}
}
...
@@ -840,6 +844,11 @@ nice_agent_set_property (
...
@@ -840,6 +844,11 @@ nice_agent_set_property (
STUN_COMPATIBILITY_WLM2009
,
STUN_COMPATIBILITY_WLM2009
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_AGENT_USAGE_USE_FINGERPRINT
);
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007R2
)
{
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_WLM2009
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_USE_FINGERPRINT
);
}
else
{
}
else
{
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_RFC5389
,
STUN_COMPATIBILITY_RFC5389
,
...
...
agent/agent.h
View file @
9eba3b31
...
@@ -213,6 +213,7 @@ typedef enum
...
@@ -213,6 +213,7 @@ typedef enum
* @NICE_COMPATIBILITY_MSN: Use compatibility for MSN Messenger specs
* @NICE_COMPATIBILITY_MSN: Use compatibility for MSN Messenger specs
* @NICE_COMPATIBILITY_WLM2009: Use compatibility with Windows Live Messenger
* @NICE_COMPATIBILITY_WLM2009: Use compatibility with Windows Live Messenger
* 2009
* 2009
* @NICE_COMPATIBILITY_OC2007R2: Use compatibility with Microsoft Office Communicator 2007 R2
* @NICE_COMPATIBILITY_DRAFT19: Use compatibility for ICE Draft 19 specs
* @NICE_COMPATIBILITY_DRAFT19: Use compatibility for ICE Draft 19 specs
* @NICE_COMPATIBILITY_LAST: Dummy last compatibility mode
* @NICE_COMPATIBILITY_LAST: Dummy last compatibility mode
*
*
...
@@ -229,8 +230,9 @@ typedef enum
...
@@ -229,8 +230,9 @@ typedef enum
NICE_COMPATIBILITY_GOOGLE
,
NICE_COMPATIBILITY_GOOGLE
,
NICE_COMPATIBILITY_MSN
,
NICE_COMPATIBILITY_MSN
,
NICE_COMPATIBILITY_WLM2009
,
NICE_COMPATIBILITY_WLM2009
,
NICE_COMPATIBILITY_OC2007R2
,
NICE_COMPATIBILITY_DRAFT19
=
NICE_COMPATIBILITY_RFC5245
,
NICE_COMPATIBILITY_DRAFT19
=
NICE_COMPATIBILITY_RFC5245
,
NICE_COMPATIBILITY_LAST
=
NICE_COMPATIBILITY_
WLM2009
,
NICE_COMPATIBILITY_LAST
=
NICE_COMPATIBILITY_
OC2007R2
,
}
NiceCompatibility
;
}
NiceCompatibility
;
/**
/**
...
...
agent/conncheck.c
View file @
9eba3b31
...
@@ -599,6 +599,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
...
@@ -599,6 +599,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
uname
,
uname_len
,
password
,
password_len
,
uname
,
uname_len
,
password
,
password_len
,
agent
->
controlling_mode
,
agent
->
controlling_mode
,
priority
,
agent
->
controlling_mode
,
agent
->
controlling_mode
,
priority
,
agent
->
tie_breaker
,
agent
->
tie_breaker
,
NULL
,
agent_to_ice_compatibility
(
agent
));
agent_to_ice_compatibility
(
agent
));
nice_debug
(
"Agent %p: conncheck created %d - %p"
,
nice_debug
(
"Agent %p: conncheck created %d - %p"
,
...
@@ -1314,7 +1315,8 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *
...
@@ -1314,7 +1315,8 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *
/* note: do not create pairs where local candidate is
/* note: do not create pairs where local candidate is
* a srv-reflexive (ICE 5.7.3. "Pruning the Pairs" ID-19) */
* a srv-reflexive (ICE 5.7.3. "Pruning the Pairs" ID-19) */
if
((
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
||
if
((
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
||
agent
->
compatibility
==
NICE_COMPATIBILITY_WLM2009
)
&&
agent
->
compatibility
==
NICE_COMPATIBILITY_WLM2009
||
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007R2
)
&&
local
->
type
==
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
)
local
->
type
==
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
)
continue
;
continue
;
...
@@ -1434,7 +1436,8 @@ size_t priv_gen_username (NiceAgent *agent, guint component_id,
...
@@ -1434,7 +1436,8 @@ size_t priv_gen_username (NiceAgent *agent, guint component_id,
len
++
;
len
++
;
memcpy
(
dest
+
len
,
local
,
local_len
);
memcpy
(
dest
+
len
,
local
,
local_len
);
len
+=
local_len
;
len
+=
local_len
;
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_WLM2009
&&
}
else
if
((
agent
->
compatibility
==
NICE_COMPATIBILITY_WLM2009
||
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007R2
)
&&
dest_len
>=
remote_len
+
local_len
+
4
)
{
dest_len
>=
remote_len
+
local_len
+
4
)
{
memcpy
(
dest
,
remote
,
remote_len
);
memcpy
(
dest
,
remote
,
remote_len
);
len
+=
remote_len
;
len
+=
remote_len
;
...
@@ -1635,6 +1638,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1635,6 +1638,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
,
pair
->
foundation
,
agent_to_ice_compatibility
(
agent
));
agent_to_ice_compatibility
(
agent
));
nice_debug
(
"Agent %p: conncheck created %d - %p"
,
agent
,
buffer_len
,
pair
->
stun_message
.
buffer
);
nice_debug
(
"Agent %p: conncheck created %d - %p"
,
agent
,
buffer_len
,
pair
->
stun_message
.
buffer
);
...
@@ -1769,8 +1773,9 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream,
...
@@ -1769,8 +1773,9 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream,
* aggressive nomination mode, send a new triggered
* aggressive nomination mode, send a new triggered
* check to nominate the pair */
* check to nominate the pair */
if
((
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
||
if
((
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
||
agent
->
compatibility
==
NICE_COMPATIBILITY_WLM2009
)
&&
agent
->
compatibility
==
NICE_COMPATIBILITY_WLM2009
||
agent
->
controlling_mode
)
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007R2
)
&&
agent
->
controlling_mode
)
priv_conn_check_initiate
(
agent
,
p
);
priv_conn_check_initiate
(
agent
,
p
);
}
}
...
...
stun/stunmessage.h
View file @
9eba3b31
...
@@ -218,6 +218,8 @@ typedef enum
...
@@ -218,6 +218,8 @@ typedef enum
* defined by ICE draft 19
* defined by ICE draft 19
* @STUN_ATTRIBUTE_ICE_CONTROLLING: The ICE-CONTROLLING optional attribute as
* @STUN_ATTRIBUTE_ICE_CONTROLLING: The ICE-CONTROLLING optional attribute as
* defined by ICE draft 19
* defined by ICE draft 19
* @STUN_ATTRIBUTE_CANDIDATE_IDENTIFIER: The CANDIDATE-IDENTIFIER optional
* attribute as defined by [MS-ICE2]
*
*
* Known STUN attribute types as defined by various RFCs and drafts
* Known STUN attribute types as defined by various RFCs and drafts
*/
*/
...
@@ -288,7 +290,9 @@ typedef enum
...
@@ -288,7 +290,9 @@ typedef enum
STUN_ATTRIBUTE_FINGERPRINT
=
0x8028
,
/* RFC5389 */
STUN_ATTRIBUTE_FINGERPRINT
=
0x8028
,
/* RFC5389 */
STUN_ATTRIBUTE_ICE_CONTROLLED
=
0x8029
,
/* ICE-19 */
STUN_ATTRIBUTE_ICE_CONTROLLED
=
0x8029
,
/* ICE-19 */
STUN_ATTRIBUTE_ICE_CONTROLLING
=
0x802A
,
/* ICE-19 */
STUN_ATTRIBUTE_ICE_CONTROLLING
=
0x802A
,
/* ICE-19 */
/* 0x802B-0xFFFF */
/* reserved */
/* 0x802B-0x8053 */
/* reserved */
STUN_ATTRIBUTE_CANDIDATE_IDENTIFIER
=
0x8054
/* MS-ICE2 */
/* 0x8055-0xFFFF */
/* reserved */
}
StunAttribute
;
}
StunAttribute
;
...
...
stun/usages/ice.c
View file @
9eba3b31
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <string.h>
#include <string.h>
#include <assert.h>
#include <assert.h>
#include <stdlib.h>
#ifdef _WIN32
#ifdef _WIN32
#include <winsock2.h>
#include <winsock2.h>
...
@@ -64,13 +65,15 @@ stun_usage_ice_conncheck_create (StunAgent *agent, StunMessage *msg,
...
@@ -64,13 +65,15 @@ stun_usage_ice_conncheck_create (StunAgent *agent, StunMessage *msg,
const
uint8_t
*
username
,
const
size_t
username_len
,
const
uint8_t
*
username
,
const
size_t
username_len
,
const
uint8_t
*
password
,
const
size_t
password_len
,
const
uint8_t
*
password
,
const
size_t
password_len
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
uint64_t
tie
,
StunUsageIceCompatibility
compatibility
)
uint64_t
tie
,
const
char
*
candidate_identifier
,
StunUsageIceCompatibility
compatibility
)
{
{
StunMessageReturn
val
;
StunMessageReturn
val
;
stun_agent_init_request
(
agent
,
msg
,
buffer
,
buffer_len
,
STUN_BINDING
);
stun_agent_init_request
(
agent
,
msg
,
buffer
,
buffer_len
,
STUN_BINDING
);
if
(
compatibility
==
STUN_USAGE_ICE_COMPATIBILITY_RFC5245
)
{
if
(
compatibility
==
STUN_USAGE_ICE_COMPATIBILITY_RFC5245
||
compatibility
==
STUN_USAGE_ICE_COMPATIBILITY_WLM2009
)
{
if
(
cand_use
)
if
(
cand_use
)
{
{
val
=
stun_message_append_flag
(
msg
,
STUN_ATTRIBUTE_USE_CANDIDATE
);
val
=
stun_message_append_flag
(
msg
,
STUN_ATTRIBUTE_USE_CANDIDATE
);
...
@@ -97,6 +100,28 @@ stun_usage_ice_conncheck_create (StunAgent *agent, StunMessage *msg,
...
@@ -97,6 +100,28 @@ stun_usage_ice_conncheck_create (StunAgent *agent, StunMessage *msg,
return
0
;
return
0
;
}
}
if
(
compatibility
==
STUN_USAGE_ICE_COMPATIBILITY_WLM2009
)
{
size_t
identifier_len
=
strlen
(
candidate_identifier
);
size_t
buffer_len
=
identifier_len
;
int
modulo4
=
identifier_len
%
4
;
uint8_t
*
buf
;
if
(
modulo4
)
buffer_len
+=
4
-
modulo4
;
buf
=
malloc
(
buffer_len
);
memset
(
buf
,
0
,
buffer_len
);
memcpy
(
buf
,
candidate_identifier
,
identifier_len
);
val
=
stun_message_append_bytes
(
msg
,
STUN_ATTRIBUTE_CANDIDATE_IDENTIFIER
,
buf
,
buffer_len
);
free
(
buf
);
if
(
val
!=
STUN_MESSAGE_RETURN_SUCCESS
)
return
0
;
}
return
stun_agent_finish_message
(
agent
,
msg
,
password
,
password_len
);
return
stun_agent_finish_message
(
agent
,
msg
,
password
,
password_len
);
}
}
...
...
stun/usages/ice.h
View file @
9eba3b31
...
@@ -65,6 +65,8 @@ extern "C" {
...
@@ -65,6 +65,8 @@ extern "C" {
* implementation of ICE
* implementation of ICE
* @STUN_USAGE_ICE_COMPATIBILITY_MSN: The ICE compatibility with MSN's
* @STUN_USAGE_ICE_COMPATIBILITY_MSN: The ICE compatibility with MSN's
* implementation of ICE
* implementation of ICE
* @STUN_USAGE_ICE_COMPATIBILITY_WLM2009: The ICE compatibility with Windows
* Live Messenger and Microsoft Office Communicator 2007 R2 implementation of ICE
* @STUN_USAGE_ICE_COMPATIBILITY_DRAFT19: The ICE compatibility with draft 19
* @STUN_USAGE_ICE_COMPATIBILITY_DRAFT19: The ICE compatibility with draft 19
*
*
* This enum defines which compatibility modes this ICE usage can use
* This enum defines which compatibility modes this ICE usage can use
...
@@ -78,6 +80,7 @@ typedef enum {
...
@@ -78,6 +80,7 @@ typedef enum {
STUN_USAGE_ICE_COMPATIBILITY_RFC5245
,
STUN_USAGE_ICE_COMPATIBILITY_RFC5245
,
STUN_USAGE_ICE_COMPATIBILITY_GOOGLE
,
STUN_USAGE_ICE_COMPATIBILITY_GOOGLE
,
STUN_USAGE_ICE_COMPATIBILITY_MSN
,
STUN_USAGE_ICE_COMPATIBILITY_MSN
,
STUN_USAGE_ICE_COMPATIBILITY_WLM2009
,
STUN_USAGE_ICE_COMPATIBILITY_DRAFT19
=
STUN_USAGE_ICE_COMPATIBILITY_RFC5245
,
STUN_USAGE_ICE_COMPATIBILITY_DRAFT19
=
STUN_USAGE_ICE_COMPATIBILITY_RFC5245
,
}
StunUsageIceCompatibility
;
}
StunUsageIceCompatibility
;
...
@@ -130,12 +133,16 @@ typedef enum {
...
@@ -130,12 +133,16 @@ typedef enum {
* @priority: The value of the PRIORITY attribute
* @priority: The value of the PRIORITY attribute
* @tie: The value of the tie-breaker to put in the ICE-CONTROLLED or
* @tie: The value of the tie-breaker to put in the ICE-CONTROLLED or
* ICE-CONTROLLING attribute
* ICE-CONTROLLING attribute
* @candidate_identifier: The foundation value to put in the
* CANDIDATE-IDENTIFIER attribute
* @compatibility: The compatibility mode to use for building the conncheck
* @compatibility: The compatibility mode to use for building the conncheck
* request
* request
*
*
* Builds an ICE connectivity check STUN message.
* Builds an ICE connectivity check STUN message.
* If the compatibility is not #STUN_USAGE_ICE_COMPATIBILITY_RFC5245, the
* If the compatibility is not #STUN_USAGE_ICE_COMPATIBILITY_RFC5245, the
* @cand_use, @controlling, @priority and @tie arguments are not used.
* @cand_use, @controlling, @priority and @tie arguments are not used.
* If the compatibility is not #STUN_USAGE_ICE_COMPATIBILITY_WLM2009, the
* @candidate_identifier argument is not used.
* Returns: The length of the message built.
* Returns: The length of the message built.
*/
*/
size_t
size_t
...
@@ -144,7 +151,8 @@ stun_usage_ice_conncheck_create (StunAgent *agent, StunMessage *msg,
...
@@ -144,7 +151,8 @@ stun_usage_ice_conncheck_create (StunAgent *agent, StunMessage *msg,
const
uint8_t
*
username
,
const
size_t
username_len
,
const
uint8_t
*
username
,
const
size_t
username_len
,
const
uint8_t
*
password
,
const
size_t
password_len
,
const
uint8_t
*
password
,
const
size_t
password_len
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
uint64_t
tie
,
StunUsageIceCompatibility
compatibility
);
uint64_t
tie
,
const
char
*
candidate_identifier
,
StunUsageIceCompatibility
compatibility
);
/**
/**
...
...
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