Commit abb34777 authored by aymeric's avatar aymeric

fix msvc compilation with C compiler

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@324 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent a6beab6b
......@@ -29,6 +29,7 @@ extern MSFilterDesc ms_conf_desc;
extern MSFilterDesc ms_join_desc;
extern MSFilterDesc ms_resample_desc;
extern MSFilterDesc ms_volume_desc;
extern MSFilterDesc ms_ice_desc;
MSFilterDesc * ms_filter_descs[]={
&ms_alaw_dec_desc,
&ms_alaw_enc_desc,
......@@ -61,6 +62,7 @@ MSFilterDesc * ms_filter_descs[]={
&ms_resample_desc,
#endif
&ms_volume_desc,
&ms_ice_desc,
NULL
};
......@@ -63,8 +63,6 @@ EXPORTS
ms_list_remove
ms_filter_set_notify_callback
ice_sound_send_stun_request
ice_process_stun_message
ms_discover_mtu
ms_set_mtu
\ No newline at end of file
......@@ -365,6 +365,10 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath=".\mediastreamer2.def"
>
</File>
</Files>
<Globals>
</Globals>
......
......@@ -394,6 +394,8 @@ the method index (_cnt_) and the argument size */
#define MS_FILTER_SET_MAX_GAIN MS_FILTER_BASE_METHOD(25,int)
#define MS_CONF_SPEEX_PREPROCESS_MIC MS_FILTER_EVENT(MS_CONF_ID, 1, void*)
#define MS_CONF_CHANNEL_VOLUME MS_FILTER_EVENT(MS_CONF_ID, 3, void*)
#define MS_SPEEX_EC_PREPROCESS_MIC MS_FILTER_EVENT(MS_SPEEX_EC_ID, 1, void*)
#define MS_SPEEX_EC_ECHO_STATE MS_FILTER_EVENT(MS_SPEEX_EC_ID, 2, void*)
/** @} */
......
......@@ -50,10 +50,7 @@ ice_sendtest( struct IceCheckList *checklist, struct CandidatePair *remote_candi
check */
req.hasPriority = TRUE;
uint32_t type_preference = 110;
uint32_t interface_preference = 255;
uint32_t stun_priority=255;
req.priority.priority = (type_preference << 24) | (interface_preference << 16) | (stun_priority << 8)
req.priority.priority = (110 << 24) | (255 << 16) | (255 << 8)
| (256 - remote_candidate->remote_candidate.component_id);
/* TODO: put this parameter only for the candidate selected */
......@@ -611,6 +608,7 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
The password associated with that transport address ID is used to verify
the MESSAGE-INTEGRITY attribute, if one was present in the request.
*/
{
char hmac[20];
/* remove length of fingerprint if present */
if (msg.hasFingerprint==TRUE)
......@@ -639,6 +637,7 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
UInt16 newlen = htons(msg.msgHdr.msgLength); /* add back fingerprint size */
memcpy(lenpos, &newlen, sizeof(UInt16));
}
}
/* 7.2.1.1. Detecting and Repairing Role Conflicts */
......@@ -734,6 +733,7 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
}
}
{
struct CandidatePair *cand_pair;
int pos;
cand_pair=NULL;
......@@ -879,12 +879,14 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
}
}
}
}
{
UInt32 cookie = 0x2112A442;
resp.hasXorMappedAddress = TRUE;
resp.xorMappedAddress.ipv4.port = remote_addr.port^(cookie>>16);
resp.xorMappedAddress.ipv4.addr = remote_addr.addr^cookie;
}
resp.msgHdr.msgType = (STUN_METHOD_BINDING | STUN_SUCCESS_RESP);
......@@ -895,10 +897,12 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
/* ? any messageintegrity in response? */
resp.hasMessageIntegrity = TRUE;
{
const char serverName[] = "mediastreamer2 " STUN_VERSION;
resp.hasSoftware = TRUE;
memcpy( resp.softwareName.value, serverName, sizeof(serverName));
resp.softwareName.sizeValue = sizeof(serverName);
}
resp.hasFingerprint = TRUE;
......@@ -930,19 +934,22 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
return -1;
}
{
UInt32 cookie = 0x2112A442;
UInt16 cookie16 = 0x2112A442 >> 16;
mappedAddr.port = resp.xorMappedAddress.ipv4.port^cookie16;
mappedAddr.addr = resp.xorMappedAddress.ipv4.addr^cookie;
}
{
struct in_addr inaddr;
char mapped_addr[64];
struct CandidatePair *cand_pair;
int pos;
inaddr.s_addr = htonl (mappedAddr.addr);
snprintf(mapped_addr, sizeof(mapped_addr),
"%s", inet_ntoa (inaddr));
struct CandidatePair *cand_pair;
int pos;
for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++)
{
cand_pair = &remote_candidates[pos];
......@@ -1081,10 +1088,7 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
snprintf(new_pair.local_candidate.conn_addr, sizeof(new_pair.local_candidate.conn_addr),
"%s", mapped_addr);
uint32_t type_preference = 110;
uint32_t interface_preference = 255;
uint32_t stun_priority=255;
new_pair.remote_candidate.priority = (type_preference << 24) | (interface_preference << 16) | (stun_priority << 8)
new_pair.remote_candidate.priority = (110 << 24) | (255 << 16) | (255 << 8)
| (256 - new_pair.remote_candidate.component_id);
snprintf(new_pair.local_candidate.cand_type, sizeof(cand_pair->local_candidate.cand_type),
......@@ -1149,8 +1153,10 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
}
}
}
}
else if (STUN_IS_ERR_RESP(msg.msgHdr.msgType))
{
int pos;
StunMessage resp;
memset(&resp, 0, sizeof(StunMessage));
res = stunParseMessage((char*)mp->b_rptr, mp->b_wptr-mp->b_rptr,
......@@ -1161,7 +1167,6 @@ static int ice_process_stun_message(RtpSession *session, struct IceCheckList *ch
return -1;
}
int pos;
for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++)
{
struct CandidatePair *cand_pair = &remote_candidates[pos];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment