Commit a5b61d2b authored by Guillaume Beraudo's avatar Guillaume Beraudo

Merge branch 'master' of git.linphone.org:ortp into zrtp

Conflicts:
	src/zrtp.c
parents bc93801e 9e9265f9
......@@ -21,19 +21,7 @@ for lt in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do
libtoolize=$lt ; break
fi
done
AUTOMAKE_FLAGS=""
case $libtoolize in
*glibtoolize)
AUTOMAKE_FLAGS="-i"
;;
esac
if test -d /opt/local/share/aclocal ; then
ACLOCAL_ARGS="-I /opt/local/share/aclocal"
fi
if test -d /opt/local/share/aclocal ; then
ACLOCAL_ARGS="-I /opt/local/share/aclocal"
fi
if test -d /usr/local/share/aclocal ; then
ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal"
fi
......@@ -48,6 +36,6 @@ rm -rf config.cache autom4te.cache
$libtoolize --copy --force
$ACLOCAL $ACLOCAL_ARGS
autoheader
$AUTOMAKE --add-missing --copy ${AUTOMAKE_FLAGS}
$AUTOMAKE --force-missing --add-missing --copy
autoconf
......@@ -39,7 +39,6 @@ extern "C"{
#endif
typedef struct OrtpZrtpParams {
const char *zid; // ZRTP identifier (coded hexa; 96 bits in the end)
const char *zid_file; // File where to store secrets and other information
} OrtpZrtpParams;
......
......@@ -541,7 +541,7 @@ PayloadType payload_type_vp8={
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(256000),
MIME_TYPE ("VP8-DRAFT-0-3-2"),
MIME_TYPE ("VP8"),
CHANNELS(0)
};
......
......@@ -435,6 +435,7 @@ void rtp_session_send_rtcp_APP(RtpSession *session, uint8_t subtype, const char
mblk_t *d;
h->b_wptr+=rtcp_app_init(session,h->b_wptr,subtype,name,datalen+sizeof(rtcp_app_t));
d=esballoc((uint8_t*)data,datalen,0,NULL);
d->b_wptr+=datalen;
h->b_cont=d;
rtp_session_rtcp_send(session,h);
}
......
......@@ -21,14 +21,17 @@
#include "ortp/ortp.h"
#include "utils.h"
static int rtcp_get_size(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch==NULL) return -1;
return (1+rtcp_common_header_get_length(ch))*4;
}
/*in case of coumpound packet, set read pointer of m to the beginning of the next RTCP
packet */
bool_t rtcp_next_packet(mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch){
int nextlen=sizeof(rtcp_common_header_t)+
(rtcp_common_header_get_length(ch)*4);
int nextlen=rtcp_get_size(m);
if (nextlen>=0){
if (m->b_rptr+nextlen<m->b_wptr){
m->b_rptr+=nextlen;
return TRUE;
......@@ -83,7 +86,7 @@ const sender_info_t * rtcp_SR_get_sender_info(const mblk_t *m){
const report_block_t * rtcp_SR_get_report_block(const mblk_t *m, int idx){
rtcp_sr_t *sr=(rtcp_sr_t*)m->b_rptr;
report_block_t *rb=&sr->rb[idx];
int size=sizeof(rtcp_common_header_t)+(4*rtcp_common_header_get_length(&sr->ch));
int size=rtcp_get_size(m);
if ( ( (uint8_t*)rb)+sizeof(report_block_t) <= m->b_rptr + size ) {
return rb;
}else{
......@@ -115,7 +118,7 @@ uint32_t rtcp_RR_get_ssrc(const mblk_t *m){
const report_block_t * rtcp_RR_get_report_block(const mblk_t *m,int idx){
rtcp_rr_t *rr=(rtcp_rr_t*)m->b_rptr;
report_block_t *rb=&rr->rb[idx];
int size=sizeof(rtcp_common_header_t)+(4*rtcp_common_header_get_length(&rr->ch));
int size=rtcp_get_size(m);
if ( ( (uint8_t*)rb)+sizeof(report_block_t) <= (m->b_rptr + size ) ){
return rb;
}else{
......@@ -130,8 +133,7 @@ const report_block_t * rtcp_RR_get_report_block(const mblk_t *m,int idx){
bool_t rtcp_is_SDES(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch && rtcp_common_header_get_packet_type(ch)==RTCP_SDES){
if (msgdsize(m)<sizeof(rtcp_common_header_t)+
(4*rtcp_common_header_get_length(ch))){
if (msgdsize(m)<rtcp_get_size(m)){
ortp_warning("Too short RTCP SDES packet.");
return FALSE;
}
......@@ -143,8 +145,7 @@ bool_t rtcp_is_SDES(const mblk_t *m){
void rtcp_sdes_parse(const mblk_t *m, SdesItemFoundCallback cb, void *user_data){
uint8_t *rptr=(uint8_t*)m->b_rptr+sizeof(rtcp_common_header_t);
const rtcp_common_header_t *ch=(rtcp_common_header_t*)m->b_rptr;
uint8_t *end=rptr+sizeof(rtcp_common_header_t)+
(4*rtcp_common_header_get_length(ch));
uint8_t *end=rptr+(4*(rtcp_common_header_get_length(ch)+1));
uint32_t ssrc=0;
int nchunk=0;
bool_t chunk_start=TRUE;
......@@ -195,8 +196,7 @@ void rtcp_sdes_parse(const mblk_t *m, SdesItemFoundCallback cb, void *user_data)
bool_t rtcp_is_BYE(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch && rtcp_common_header_get_packet_type(ch)==RTCP_BYE){
if (msgdsize(m)<sizeof(rtcp_common_header_t)+
rtcp_common_header_get_length(ch)){
if (msgdsize(m)<rtcp_get_size(m)){
ortp_warning("Too short RTCP BYE packet.");
return FALSE;
}
......@@ -224,9 +224,8 @@ bool_t rtcp_BYE_get_ssrc(const mblk_t *m, int idx, uint32_t *ssrc){
bool_t rtcp_BYE_get_reason(const mblk_t *m, const char **reason, int *reason_len){
rtcp_bye_t *bye=(rtcp_bye_t*)m->b_rptr;
int rc=rtcp_common_header_get_rc(&bye->ch);
int len=rtcp_common_header_get_length(&bye->ch);
uint8_t *rptr=(uint8_t*)m->b_rptr+sizeof(rtcp_common_header_t)+rc*4;
uint8_t *end=(uint8_t*)(m->b_rptr+sizeof(rtcp_common_header_t)+len);
uint8_t *end=(uint8_t*)(m->b_rptr+rtcp_get_size(m));
if (rptr<end){
uint8_t content_len=rptr[0];
if (rptr+1+content_len<=end){
......@@ -244,14 +243,13 @@ bool_t rtcp_BYE_get_reason(const mblk_t *m, const char **reason, int *reason_len
/*APP accessors */
bool_t rtcp_is_APP(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
int size=rtcp_get_size(m);
if (ch!=NULL && rtcp_common_header_get_packet_type(ch)==RTCP_APP){
if (msgdsize(m)<sizeof(rtcp_common_header_t)+
rtcp_common_header_get_length(ch)){
if (msgdsize(m)<size){
ortp_warning("Too short RTCP APP packet.");
return FALSE;
}
if (sizeof(rtcp_common_header_t)+rtcp_common_header_get_length(ch)
< sizeof(rtcp_app_t)){
if (size < sizeof(rtcp_app_t)){
ortp_warning("Bad RTCP APP packet.");
return FALSE;
}
......@@ -276,8 +274,7 @@ void rtcp_APP_get_name(const mblk_t *m, char *name){
}
/* retrieve the data. when returning, data points directly into the mblk_t */
void rtcp_APP_get_data(const mblk_t *m, uint8_t **data, int *len){
rtcp_app_t *app=(rtcp_app_t*)m->b_rptr;
int datalen=sizeof(rtcp_common_header_t)+rtcp_common_header_get_length(&app->ch)-8;
int datalen=rtcp_get_size(m)-sizeof(rtcp_app_t);
if (datalen>0){
*data=(uint8_t*)m->b_rptr+sizeof(rtcp_app_t);
*len=datalen;
......
......@@ -909,18 +909,18 @@ void ortp_zrtp_context_destroy(OrtpZrtpContext *ctx) {
OrtpZrtpContext* ortp_zrtp_context_new(RtpSession *s, OrtpZrtpParams *params){
ortp_message("ZRTP is disabled - not compiled");
ortp_message("ZRTP is disabled - not implemented yet");
return NULL;
}
OrtpZrtpContext* ortp_zrtp_multistream_new(OrtpZrtpContext* activeContext, RtpSession *s, OrtpZrtpParams *params) {
ortp_message("ZRTP is disabled - not compiled - not adding stream");
ortp_message("ZRTP is disabled - not implemented yet - not adding stream");
return NULL;
}
bool_t ortp_zrtp_available(){return FALSE;}
bool_t ortp_zrtp_availSable(){return FALSE;}
void ortp_zrtp_sas_verified(OrtpZrtpContext* ctx){}
void ortp_zrtp_sas_reset_verified(OrtpZrtpContext* ctx){}
void ortp_zrtSp_sas_reset_verified(OrtpZrtpContext* ctx){}
void ortp_zrtp_context_destroy(OrtpZrtpContext *ctx){}
#endif
......
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