# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1206747479 -3600
# Node ID d56062e64d5b134459d7e25e0cbe8aca28cd321a
# Parent 312b968780884c180786147e70a8b677a29a41ff
fix prototypes and include files
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/include/crypto.h
--- a/wifo/sVoIP/include/crypto.h Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/include/crypto.h Sat Mar 29 00:37:59 2008 +0100
@@ -34,7 +34,7 @@
#ifndef _CRYPTO_H_
#define _CRYPTO_H_
-extern int evrb_crypto_init();
+extern int evrb_crypto_init(void);
extern int evrb_decrypt(void* distant_ctx, void* data, size_t* len);
extern int evrb_encrypt(void* local_ctx, void* data, size_t* len);
extern char* evrb_cryptokey_get(void* ctx);
@@ -43,5 +43,6 @@ extern void evrb_crypto_clean_exchanged_
extern void evrb_crypto_clean_exchanged_key(void* ctx);
extern char* evrb_cryptokey_gen();
extern int evrb_crypto_keys_compute(void* local_ctx, void* distant_ctx, int
caller);
+extern int evrb_cryptokey_set_gen(void** ctx);
#endif
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/include/dh.h
--- a/wifo/sVoIP/include/dh.h Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/include/dh.h Sat Mar 29 00:37:59 2008 +0100
@@ -32,19 +32,19 @@
*/
/** Diffie hellman structure (from OpenSSL) */
-typedef struct DH DH;
+typedef struct dh_st DH;
/**
* Initialize Diffie Hellman engine
*/
-void dh_init();
+void dh_init(void);
/**
* Create a DH structure containing default generator parameters
* (Oakley 5)
* @return Diffie hellman structure
*/
-DH *dh_create_default();
+DH *dh_create_default(void);
/**
* Generate a (or b) and compute g^a (or g^a) of Diffie Hellman
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/include/sdp.h
--- a/wifo/sVoIP/include/sdp.h Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/include/sdp.h Sat Mar 29 00:37:59 2008 +0100
@@ -38,7 +38,8 @@
#include "error.h"
#define EVRB_KEY "a=evrb_key:"
-extern int sdp_parse(char * buf, size_t len, char **rtp_ip, unsigned short
*rtp_port, char **crypt_key);
+extern int sdp_parse(const char * buf, size_t len, char **rtp_ip, unsigned
short *rtp_port, char **crypt_key);
extern int sdp_modify(char * buf, size_t len, char ** newbuf, size_t* newlen,
char *crypt_key);
+extern int sdp_create(char **buf, size_t* len, char *crypt_key);
#endif
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/include/sessionsManager.h
--- a/wifo/sVoIP/include/sessionsManager.h Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/include/sessionsManager.h Sat Mar 29 00:37:59 2008 +0100
@@ -60,7 +60,7 @@ extern tSession sessions[MAX_CALLS];
*
* @return 0 on succes
*/
-extern sVoIP_ErrorCode smInit();
+extern sVoIP_ErrorCode smInit(void);
/**
* get session at id.
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/include/svoip.h
--- a/wifo/sVoIP/include/svoip.h Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/include/svoip.h Sat Mar 29 00:37:59 2008 +0100
@@ -44,7 +44,7 @@
/*
API initialize
*/
-extern sVoIP_ErrorCode sVoIP_init();
+extern sVoIP_ErrorCode sVoIP_init(void);
/**
* entry point for a given session, prepare the session for a _cipher type
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/include/svoip_phapi.h
--- a/wifo/sVoIP/include/svoip_phapi.h Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/include/svoip_phapi.h Sat Mar 29 00:37:59 2008 +0100
@@ -58,7 +58,7 @@ void sVoIP_phapi_setCipherMode(int ciphe
* Get the status of ciphering on calls
* @return 0 = No crypto, 1 = Crypted
*/
-int sVoIP_phapi_getCipherMode();
+int sVoIP_phapi_getCipherMode(void);
/*
* Indicate if the call is crypted or not
@@ -117,7 +117,6 @@ extern int sVoIP_phapi_handle_ok_out(int
*/
extern int sVoIP_phapi_handle_bye_out(int cid, osip_message_t *sip);
-#if 0
/*
* call when a rtp is reiceived in phapi
* @param cid CID
@@ -125,7 +124,7 @@ extern int sVoIP_phapi_handle_bye_out(in
* @param buffer buffer to receive data
* @param len buffer size
*/
-extern void sVoIP_phapi_recvRtp(int cid, void *error, void *buffer, int *len);
+extern void sVoIP_phapi_recvRtp(int cid, void *error, void *buffer, size_t
*len);
/*
* call before a rtp is send in phapi
@@ -134,7 +133,6 @@ extern void sVoIP_phapi_recvRtp(int cid,
* @param buffer buffer to send
* @param len bytes to send
*/
-extern void sVoIP_phapi_sendRtp(int cid, void *error, void *buffer, int *len);
-#endif
+extern void sVoIP_phapi_sendRtp(int cid, void *error, void *buffer, size_t
*len);
#endif
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/src/crypto.c
--- a/wifo/sVoIP/src/crypto.c Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/src/crypto.c Sat Mar 29 00:37:59 2008 +0100
@@ -61,7 +61,7 @@ int evrb_crypto_init()
{
#ifdef USE_SRTP
int i=0;
- if(i=srtp_init()) {
+ if((i=srtp_init())) {
fprintf(stderr,"srtp_init() return %i\n",i);
return -1;
}
@@ -77,7 +77,7 @@ evrb_encrypt(void* local_ctx, void* data
int i;
if (local_ctx == NULL || ((EVRB_CRYPTO*)local_ctx)->srtp_session ==
NULL)
return -1;
- if(i=srtp_protect(((EVRB_CRYPTO*)local_ctx)->srtp_session, data,
(int*)len)) {
+ if((i=srtp_protect(((EVRB_CRYPTO*)local_ctx)->srtp_session, data,
(int*)len))) {
#ifndef NDEBUG
fprintf(stdout,"-srtp_protect-%i--\n",i);fflush(stdout);
#endif
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/src/dh.c
--- a/wifo/sVoIP/src/dh.c Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/src/dh.c Sat Mar 29 00:37:59 2008 +0100
@@ -49,6 +49,8 @@
#endif
#define _DEBUG_
+
+#include <dh.h>
void dh_init()
{
@@ -125,6 +127,7 @@ DH *dh_create_default()
return dh;
}
+static
DH *dh_create()
{
DH *a;
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/src/sdp.c
--- a/wifo/sVoIP/src/sdp.c Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/src/sdp.c Sat Mar 29 00:37:59 2008 +0100
@@ -49,7 +49,7 @@
#endif
-int sdp_parse(char *buf, size_t len, char **rtp_ip, unsigned short *rtp_port,
char **crypt_key)
+int sdp_parse(const char *buf, size_t len, char **rtp_ip, unsigned short
*rtp_port, char **crypt_key)
{
char *tmpbuf;
char *tmpline;
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/src/sessionsManager.c
--- a/wifo/sVoIP/src/sessionsManager.c Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/src/sessionsManager.c Sat Mar 29 00:37:59 2008 +0100
@@ -37,7 +37,9 @@
#include <crypto.h>
#include <sessionsManager.h>
+#ifdef WIN32
#pragma warning(disable:4100)
+#endif
tSession sessions[MAX_CALLS];
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/src/svoip.c
--- a/wifo/sVoIP/src/svoip.c Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/src/svoip.c Sat Mar 29 00:37:59 2008 +0100
@@ -188,7 +188,7 @@ sVoIP_ErrorCode sVoIP_SIPAugmentINVITE2(
if (evrb_cryptokey_get(session->local.crypto) == 0)
evrb_cryptokey_set_gen(&session->local.crypto);
- i = sdp_create(sdp, len, evrb_cryptokey_get(session->local.crypto));
+ i = sdp_create((char **) sdp, len,
evrb_cryptokey_get(session->local.crypto));
if (i!= SOK)
return i;
@@ -221,7 +221,7 @@ sVoIP_ErrorCode sVoIP_SIPAugmentOK2(CID
if (evrb_cryptokey_get(session->local.crypto) == 0)
evrb_cryptokey_set_gen(&session->local.crypto);
- i = sdp_create(sdp, len, evrb_cryptokey_get(session->local.crypto));
+ i = sdp_create((char **) sdp, len,
evrb_cryptokey_get(session->local.crypto));
if (i!= SOK)
return i;
diff -r 312b96878088 -r d56062e64d5b wifo/sVoIP/src/svoip_phapi.c
--- a/wifo/sVoIP/src/svoip_phapi.c Sat Mar 29 00:31:21 2008 +0100
+++ b/wifo/sVoIP/src/svoip_phapi.c Sat Mar 29 00:37:59 2008 +0100
@@ -218,6 +218,7 @@ int sVoIP_phapi_handle_cancel_in(int cid
return SOK;
}
+static
int sVoIP_phapi_add_crypto_attribute(osip_message_t *sip, const char
*crypto_key)
{
osip_body_t *body;
@@ -242,7 +243,7 @@ int sVoIP_phapi_add_crypto_attribute(osi
if (sdp_message_attribute_get(sdp, -1, 0))
{
#ifndef NDEBUG
- fprintf(stdout,"sVoIP_phapi_add_crypto_attribute: the cryto key
is already added\n",i);
+ fprintf(stdout,"sVoIP_phapi_add_crypto_attribute: the cryto key
is already added\n");
#endif
sdp_message_free(sdp);
return -1;
@@ -323,7 +324,7 @@ int sVoIP_phapi_handle_invite_out(int ci
#ifndef NDEBUG
fprintf(stdout,"outgoing INVITE message %i %i %p %i\n"
,cid,i,ses,cipherMode); fflush(stdout);
#endif
- i = sVoIP_SIPAugmentINVITE2(cid,&sdp,&size);
+ i = sVoIP_SIPAugmentINVITE2(cid,(const char **)&sdp,&size);
if (i != SOK)
{
SVOIP_PERROR(i,stdout,"sVoIP_phapi_handle_invite_out");
@@ -350,7 +351,7 @@ int sVoIP_phapi_handle_ok_out(int cid, o
int cipherMode = 0;
EVRB_SESSION* ses = NULL;
char *sdp;
- int size;
+ size_t size;
assert(cid >= 0 && sip != NULL);
#ifndef NDEBUG
@@ -366,7 +367,7 @@ int sVoIP_phapi_handle_ok_out(int cid, o
#ifndef NDEBUG
fprintf(stdout,"outgoing OK message %i %i %p %i\n"
,cid,i,ses,cipherMode); fflush(stdout);
#endif
- i = sVoIP_SIPAugmentOK2(cid,&sdp,&size);
+ i = sVoIP_SIPAugmentOK2(cid,(const char **)&sdp,&size);
if (i != SOK)
{
SVOIP_PERROR(i,stdout,"sVoIP_phapi_handle_ok_out");
@@ -415,7 +416,7 @@ int initialize = 0;
int initialize = 0;
#endif
-void sVoIP_phapi_recvRtp(int cid, void *error, void *buffer, int *len){
+void sVoIP_phapi_recvRtp(int cid, void *error, void *buffer, size_t *len){
int i;
#ifndef NDEBUG
@@ -434,7 +435,7 @@ void sVoIP_phapi_recvRtp(int cid, void *
}
}
-void sVoIP_phapi_sendRtp(int cid, void *error, void *buffer, int *len){
+void sVoIP_phapi_sendRtp(int cid, void *error, void *buffer, size_t *len){
int i;
#ifndef NDEBUG
_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel