Commit 54935a74 authored by Ghislain MARY's avatar Ghislain MARY

Code changes to be able to compile belle_sip_tester with Visual Studio.

parent a67d23ea
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#ifndef AUTHENTICATION_HELPER_H_ #ifndef AUTHENTICATION_HELPER_H_
#define AUTHENTICATION_HELPER_H_ #define AUTHENTICATION_HELPER_H_
#include "belle-sip/defs.h"
#include "belle-sip/belle-sip.h" #include "belle-sip/belle-sip.h"
/** /**
...@@ -26,7 +28,7 @@ ...@@ -26,7 +28,7 @@
* @param authentication source to be used as input * @param authentication source to be used as input
* @return belle_sip_header_authorization_t* * @return belle_sip_header_authorization_t*
*/ */
belle_sip_header_authorization_t* belle_sip_auth_helper_create_authorization(const belle_sip_header_www_authenticate_t* authentication); BELLESIP_EXPORT belle_sip_header_authorization_t* belle_sip_auth_helper_create_authorization(const belle_sip_header_www_authenticate_t* authentication);
/** /**
* Create an proxy_authorization header from an www_authenticate header, all common parameters are copyed. * Create an proxy_authorization header from an www_authenticate header, all common parameters are copyed.
...@@ -34,7 +36,7 @@ belle_sip_header_authorization_t* belle_sip_auth_helper_create_authorization(con ...@@ -34,7 +36,7 @@ belle_sip_header_authorization_t* belle_sip_auth_helper_create_authorization(con
* @param authentication source to be used as input * @param authentication source to be used as input
* @return belle_sip_header_authorization_t* * @return belle_sip_header_authorization_t*
*/ */
belle_sip_header_proxy_authorization_t* belle_sip_auth_helper_create_proxy_authorization(const belle_sip_header_proxy_authenticate_t* proxy_authentication); BELLESIP_EXPORT belle_sip_header_proxy_authorization_t* belle_sip_auth_helper_create_proxy_authorization(const belle_sip_header_proxy_authenticate_t* proxy_authentication);
/** /**
* compute and set response value according to parameters * compute and set response value according to parameters
...@@ -44,14 +46,14 @@ belle_sip_header_proxy_authorization_t* belle_sip_auth_helper_create_proxy_autho ...@@ -44,14 +46,14 @@ belle_sip_header_proxy_authorization_t* belle_sip_auth_helper_create_proxy_autho
* *
* @return 0 if succeed * @return 0 if succeed
*/ */
int belle_sip_auth_helper_fill_authorization(belle_sip_header_authorization_t* authorization BELLESIP_EXPORT int belle_sip_auth_helper_fill_authorization(belle_sip_header_authorization_t* authorization
,const char* method ,const char* method
,const char* ha1); ,const char* ha1);
/** /**
* compute and set response value according to parameters * compute and set response value according to parameters
* @return 0 if succeed * @return 0 if succeed
*/ */
int belle_sip_auth_helper_fill_proxy_authorization(belle_sip_header_proxy_authorization_t* proxy_authorization BELLESIP_EXPORT int belle_sip_auth_helper_fill_proxy_authorization(belle_sip_header_proxy_authorization_t* proxy_authorization
,const char* method ,const char* method
,const char* ha1); ,const char* ha1);
...@@ -60,27 +62,27 @@ int belle_sip_auth_helper_fill_proxy_authorization(belle_sip_header_proxy_author ...@@ -60,27 +62,27 @@ int belle_sip_auth_helper_fill_proxy_authorization(belle_sip_header_proxy_author
* HA1=MD5(userid:realm:passwd) * HA1=MD5(userid:realm:passwd)
* return 0 in case of success * return 0 in case of success
* */ * */
int belle_sip_auth_helper_compute_ha1(const char* userid,const char* realm,const char* password, char ha1[33]); BELLESIP_EXPORT int belle_sip_auth_helper_compute_ha1(const char* userid,const char* realm,const char* password, char ha1[33]);
/* /*
* compute HA2 (NULL terminated) * compute HA2 (NULL terminated)
* HA2=MD5(method:uri) * HA2=MD5(method:uri)
* return 0 in case of success * return 0 in case of success
* */ * */
int belle_sip_auth_helper_compute_ha2(const char* method,const char* uri, char ha2[33]); BELLESIP_EXPORT int belle_sip_auth_helper_compute_ha2(const char* method,const char* uri, char ha2[33]);
/* /*
* compute response(NULL terminated) * compute response(NULL terminated)
* res=MD5(ha1:nonce:ha2) * res=MD5(ha1:nonce:ha2)
* return 0 in case of success * return 0 in case of success
* */ * */
int belle_sip_auth_helper_compute_response(const char* ha1,const char* nonce, const char* ha2, char response[33]); BELLESIP_EXPORT int belle_sip_auth_helper_compute_response(const char* ha1,const char* nonce, const char* ha2, char response[33]);
/* /*
* compute response(NULL terminated) * compute response(NULL terminated)
* res=MD5(HA1:nonce:nonce_count:cnonce:qop:HA2) * res=MD5(HA1:nonce:nonce_count:cnonce:qop:HA2)
* return 0 in case of success * return 0 in case of success
* */ * */
int belle_sip_auth_helper_compute_response_qop_auth( const char* ha1 BELLESIP_EXPORT int belle_sip_auth_helper_compute_response_qop_auth( const char* ha1
, const char* nonce , const char* nonce
, unsigned int nonce_count , unsigned int nonce_count
, const char* cnonce , const char* cnonce
......
This diff is collapsed.
...@@ -20,18 +20,7 @@ ...@@ -20,18 +20,7 @@
#include <stdlib.h> #include <stdlib.h>
#ifdef __cplusplus #include "belle-sip/defs.h"
#define BELLE_SIP_BEGIN_DECLS extern "C"{
#define BELLE_SIP_END_DECLS }
#else
#define BELLE_SIP_BEGIN_DECLS
#define BELLE_SIP_END_DECLS
#endif
#ifdef _MSC_VER
#define inline __inline
#endif
#include "belle-sip/object.h" #include "belle-sip/object.h"
/** /**
...@@ -122,9 +111,9 @@ enum belle_sip_interface_ids{ ...@@ -122,9 +111,9 @@ enum belle_sip_interface_ids{
BELLE_SIP_BEGIN_DECLS BELLE_SIP_BEGIN_DECLS
void *belle_sip_malloc(size_t size); void *belle_sip_malloc(size_t size);
void *belle_sip_malloc0(size_t size); BELLESIP_EXPORT void *belle_sip_malloc0(size_t size);
void *belle_sip_realloc(void *ptr, size_t size); void *belle_sip_realloc(void *ptr, size_t size);
void belle_sip_free(void *ptr); BELLESIP_EXPORT void belle_sip_free(void *ptr);
char * belle_sip_strdup(const char *s); char * belle_sip_strdup(const char *s);
BELLE_SIP_END_DECLS BELLE_SIP_END_DECLS
......
/*
belle-sip - SIP (RFC3261) library.
Copyright (C) 2010-2013 Belledonne Communications SARL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BELLE_SIP_DEFS_H
#define BELLE_SIP_DEFS_H
#ifdef __cplusplus
#define BELLE_SIP_BEGIN_DECLS extern "C"{
#define BELLE_SIP_END_DECLS }
#else
#define BELLE_SIP_BEGIN_DECLS
#define BELLE_SIP_END_DECLS
#endif
#ifdef _MSC_VER
#define inline __inline
#endif
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__)
#ifdef BELLESIP_EXPORTS
#define BELLESIP_EXPORT __declspec(dllexport)
#else
#define BELLESIP_EXPORT extern
#endif
#else
#define BELLESIP_EXPORT extern
#endif
#ifdef _MSC_VER
BELLESIP_EXPORT int gettimeofday (struct timeval *tv, void* tz);
#endif
#endif
...@@ -31,11 +31,11 @@ typedef enum belle_sip_dialog_state belle_sip_dialog_state_t; ...@@ -31,11 +31,11 @@ typedef enum belle_sip_dialog_state belle_sip_dialog_state_t;
BELLE_SIP_BEGIN_DECLS BELLE_SIP_BEGIN_DECLS
const char* belle_sip_dialog_state_to_string(const belle_sip_dialog_state_t state); BELLESIP_EXPORT const char* belle_sip_dialog_state_to_string(const belle_sip_dialog_state_t state);
belle_sip_request_t *belle_sip_dialog_create_ack(belle_sip_dialog_t *dialog, unsigned int cseq); BELLESIP_EXPORT belle_sip_request_t *belle_sip_dialog_create_ack(belle_sip_dialog_t *dialog, unsigned int cseq);
belle_sip_request_t *belle_sip_dialog_create_request(belle_sip_dialog_t *dialog, const char *method); BELLESIP_EXPORT belle_sip_request_t *belle_sip_dialog_create_request(belle_sip_dialog_t *dialog, const char *method);
/** /**
* Create a request within a dialog keeping non system header from an initial request. This function is very useful to resend request after expiration or chalenge. * Create a request within a dialog keeping non system header from an initial request. This function is very useful to resend request after expiration or chalenge.
* @param obj dialog associated to the request * @param obj dialog associated to the request
...@@ -73,7 +73,7 @@ const belle_sip_header_address_t *belle_sip_dialog_get_remote_target(belle_sip_d ...@@ -73,7 +73,7 @@ const belle_sip_header_address_t *belle_sip_dialog_get_remote_target(belle_sip_d
const belle_sip_list_t* belle_sip_dialog_get_route_set(belle_sip_dialog_t *dialog); const belle_sip_list_t* belle_sip_dialog_get_route_set(belle_sip_dialog_t *dialog);
belle_sip_dialog_state_t belle_sip_dialog_get_state(const belle_sip_dialog_t *dialog); BELLESIP_EXPORT belle_sip_dialog_state_t belle_sip_dialog_get_state(const belle_sip_dialog_t *dialog);
/* /*
* return the dialog state before last transition. Can be usefull to detect early avorted dialogs * return the dialog state before last transition. Can be usefull to detect early avorted dialogs
* @param dialog * @param dialog
...@@ -86,7 +86,7 @@ int belle_sip_dialog_is_server(const belle_sip_dialog_t *dialog); ...@@ -86,7 +86,7 @@ int belle_sip_dialog_is_server(const belle_sip_dialog_t *dialog);
int belle_sip_dialog_is_secure(const belle_sip_dialog_t *dialog); int belle_sip_dialog_is_secure(const belle_sip_dialog_t *dialog);
void belle_sip_dialog_send_ack(belle_sip_dialog_t *dialog, belle_sip_request_t *request); BELLESIP_EXPORT void belle_sip_dialog_send_ack(belle_sip_dialog_t *dialog, belle_sip_request_t *request);
void belle_sip_dialog_terminate_on_bye(belle_sip_dialog_t *dialog, int val); void belle_sip_dialog_terminate_on_bye(belle_sip_dialog_t *dialog, int val);
......
This diff is collapsed.
...@@ -39,7 +39,7 @@ belle_sip_list_t * belle_sip_list_delete_link(belle_sip_list_t * list, belle_sip ...@@ -39,7 +39,7 @@ belle_sip_list_t * belle_sip_list_delete_link(belle_sip_list_t * list, belle_sip
belle_sip_list_t * belle_sip_list_find(belle_sip_list_t * list, void *data); belle_sip_list_t * belle_sip_list_find(belle_sip_list_t * list, void *data);
belle_sip_list_t * belle_sip_list_free(belle_sip_list_t *list); belle_sip_list_t * belle_sip_list_free(belle_sip_list_t *list);
/*frees list elements and associated data, using the supplied function pointer*/ /*frees list elements and associated data, using the supplied function pointer*/
belle_sip_list_t * belle_sip_list_free_with_data(belle_sip_list_t *list, void (*freefunc)(void*)); BELLESIP_EXPORT belle_sip_list_t * belle_sip_list_free_with_data(belle_sip_list_t *list, void (*freefunc)(void*));
typedef int (*belle_sip_compare_func)(const void *, const void*); typedef int (*belle_sip_compare_func)(const void *, const void*);
belle_sip_list_t * belle_sip_list_find_custom(belle_sip_list_t * list, belle_sip_compare_func cmp, const void *user_data); belle_sip_list_t * belle_sip_list_find_custom(belle_sip_list_t * list, belle_sip_compare_func cmp, const void *user_data);
......
...@@ -42,14 +42,14 @@ BELLE_SIP_DECLARE_INTERFACE_END ...@@ -42,14 +42,14 @@ BELLE_SIP_DECLARE_INTERFACE_END
#define BELLE_SIP_LISTENER(obj) BELLE_SIP_INTERFACE_CAST(obj,belle_sip_listener_t) #define BELLE_SIP_LISTENER(obj) BELLE_SIP_INTERFACE_CAST(obj,belle_sip_listener_t)
/*Response event*/ /*Response event*/
belle_sip_response_t* belle_sip_response_event_get_response(const belle_sip_response_event_t* event); BELLESIP_EXPORT belle_sip_response_t* belle_sip_response_event_get_response(const belle_sip_response_event_t* event);
belle_sip_client_transaction_t *belle_sip_response_event_get_client_transaction(const belle_sip_response_event_t* event); BELLESIP_EXPORT belle_sip_client_transaction_t *belle_sip_response_event_get_client_transaction(const belle_sip_response_event_t* event);
belle_sip_dialog_t *belle_sip_response_event_get_dialog(const belle_sip_response_event_t* event); belle_sip_dialog_t *belle_sip_response_event_get_dialog(const belle_sip_response_event_t* event);
/*Request event*/ /*Request event*/
belle_sip_request_t* belle_sip_request_event_get_request(const belle_sip_request_event_t* event); BELLESIP_EXPORT belle_sip_request_t* belle_sip_request_event_get_request(const belle_sip_request_event_t* event);
belle_sip_server_transaction_t *belle_sip_request_event_get_server_transaction(const belle_sip_request_event_t* event); BELLESIP_EXPORT belle_sip_server_transaction_t *belle_sip_request_event_get_server_transaction(const belle_sip_request_event_t* event);
belle_sip_dialog_t *belle_sip_request_event_get_dialog(const belle_sip_request_event_t* event); BELLESIP_EXPORT belle_sip_dialog_t *belle_sip_request_event_get_dialog(const belle_sip_request_event_t* event);
/*Dialog terminated event*/ /*Dialog terminated event*/
belle_sip_dialog_t* belle_sip_dialog_terminated_get_dialog(const belle_sip_dialog_terminated_event_t *event); belle_sip_dialog_t* belle_sip_dialog_terminated_get_dialog(const belle_sip_dialog_terminated_event_t *event);
...@@ -69,17 +69,17 @@ belle_sip_server_transaction_t *belle_sip_transaction_terminated_event_get_serve ...@@ -69,17 +69,17 @@ belle_sip_server_transaction_t *belle_sip_transaction_terminated_event_get_serve
/*auth event*/ /*auth event*/
void belle_sip_auth_event_destroy(belle_sip_auth_event_t* event); void belle_sip_auth_event_destroy(belle_sip_auth_event_t* event);
const char* belle_sip_auth_event_get_username(const belle_sip_auth_event_t* event); BELLESIP_EXPORT const char* belle_sip_auth_event_get_username(const belle_sip_auth_event_t* event);
void belle_sip_auth_event_set_username(belle_sip_auth_event_t* event, const char* value); void belle_sip_auth_event_set_username(belle_sip_auth_event_t* event, const char* value);
const char* belle_sip_auth_event_get_userid(const belle_sip_auth_event_t* event); const char* belle_sip_auth_event_get_userid(const belle_sip_auth_event_t* event);
void belle_sip_auth_event_set_userid(belle_sip_auth_event_t* event, const char* value); void belle_sip_auth_event_set_userid(belle_sip_auth_event_t* event, const char* value);
const char* belle_sip_auth_event_get_realm(const belle_sip_auth_event_t* event); BELLESIP_EXPORT const char* belle_sip_auth_event_get_realm(const belle_sip_auth_event_t* event);
void belle_sip_auth_event_set_realm(belle_sip_auth_event_t* event, const char* value); void belle_sip_auth_event_set_realm(belle_sip_auth_event_t* event, const char* value);
const char* belle_sip_auth_event_get_passwd(const belle_sip_auth_event_t* event); const char* belle_sip_auth_event_get_passwd(const belle_sip_auth_event_t* event);
void belle_sip_auth_event_set_passwd(belle_sip_auth_event_t* event, const char* value); BELLESIP_EXPORT void belle_sip_auth_event_set_passwd(belle_sip_auth_event_t* event, const char* value);
const char* belle_sip_auth_event_get_ha1(const belle_sip_auth_event_t* event); const char* belle_sip_auth_event_get_ha1(const belle_sip_auth_event_t* event);
void belle_sip_auth_event_set_ha1(belle_sip_auth_event_t* event, const char* value); void belle_sip_auth_event_set_ha1(belle_sip_auth_event_t* event, const char* value);
...@@ -130,7 +130,7 @@ typedef struct belle_sip_listener_callbacks belle_sip_listener_callbacks_t; ...@@ -130,7 +130,7 @@ typedef struct belle_sip_listener_callbacks belle_sip_listener_callbacks_t;
* Creates an object implementing the belle_sip_listener_t interface. * Creates an object implementing the belle_sip_listener_t interface.
* This object passes the events to the callbacks, providing also the user context. * This object passes the events to the callbacks, providing also the user context.
**/ **/
belle_sip_listener_t *belle_sip_listener_create_from_callbacks(const belle_sip_listener_callbacks_t *callbacks, void *user_ctx); BELLESIP_EXPORT belle_sip_listener_t *belle_sip_listener_create_from_callbacks(const belle_sip_listener_callbacks_t *callbacks, void *user_ctx);
#endif #endif
...@@ -31,7 +31,7 @@ const char *belle_sip_listening_point_get_ip_address(const belle_sip_listening_ ...@@ -31,7 +31,7 @@ const char *belle_sip_listening_point_get_ip_address(const belle_sip_listening_
* @param lp object * @param lp object
* @param ms keep alive period in ms. Values <=0 disable keep alive * @param ms keep alive period in ms. Values <=0 disable keep alive
* */ * */
void belle_sip_listening_point_set_keep_alive(belle_sip_listening_point_t *lp,int ms); BELLESIP_EXPORT void belle_sip_listening_point_set_keep_alive(belle_sip_listening_point_t *lp,int ms);
/* /*
* get keep alive frequency in ms * get keep alive frequency in ms
...@@ -46,7 +46,7 @@ int belle_sip_listening_point_get_keep_alive(const belle_sip_listening_point_t * ...@@ -46,7 +46,7 @@ int belle_sip_listening_point_get_keep_alive(const belle_sip_listening_point_t *
* get the listening information as an URI * get the listening information as an URI
* @return IP/port/transport as an URI * @return IP/port/transport as an URI
*/ */
const belle_sip_uri_t* belle_sip_listening_point_get_uri(const belle_sip_listening_point_t *ip); BELLESIP_EXPORT const belle_sip_uri_t* belle_sip_listening_point_get_uri(const belle_sip_listening_point_t *ip);
int belle_sip_listening_point_is_reliable(const belle_sip_listening_point_t *lp); int belle_sip_listening_point_is_reliable(const belle_sip_listening_point_t *lp);
void belle_sip_listening_point_clean_channels(belle_sip_listening_point_t *lp); void belle_sip_listening_point_clean_channels(belle_sip_listening_point_t *lp);
int belle_sip_listening_point_get_well_known_port(const char *transport); int belle_sip_listening_point_get_well_known_port(const char *transport);
......
...@@ -106,12 +106,12 @@ void belle_sip_main_loop_run(belle_sip_main_loop_t *ml); ...@@ -106,12 +106,12 @@ void belle_sip_main_loop_run(belle_sip_main_loop_t *ml);
/** /**
* Executes the main loop for the time specified in milliseconds. * Executes the main loop for the time specified in milliseconds.
**/ **/
void belle_sip_main_loop_sleep(belle_sip_main_loop_t *ml, int milliseconds); BELLESIP_EXPORT void belle_sip_main_loop_sleep(belle_sip_main_loop_t *ml, int milliseconds);
/** /**
* Break out the main loop. * Break out the main loop.
**/ **/
int belle_sip_main_loop_quit(belle_sip_main_loop_t *ml); BELLESIP_EXPORT int belle_sip_main_loop_quit(belle_sip_main_loop_t *ml);
/** /**
* Cancel (removes) a source. It is not freed. * Cancel (removes) a source. It is not freed.
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
BELLE_SIP_BEGIN_DECLS BELLE_SIP_BEGIN_DECLS
belle_sip_message_t* belle_sip_message_parse(const char* raw); BELLESIP_EXPORT belle_sip_message_t* belle_sip_message_parse(const char* raw);
/** /**
* Parse sip message from a raw buffer * Parse sip message from a raw buffer
* @param [in] buff buffer to be parsed * @param [in] buff buffer to be parsed
...@@ -34,13 +34,13 @@ belle_sip_message_t* belle_sip_message_parse(const char* raw); ...@@ -34,13 +34,13 @@ belle_sip_message_t* belle_sip_message_parse(const char* raw);
* @param [out] message_length number of bytes read * @param [out] message_length number of bytes read
* @return parsed message * @return parsed message
*/ */
belle_sip_message_t* belle_sip_message_parse_raw (const char* buff, size_t buff_length,size_t* message_length ); BELLESIP_EXPORT belle_sip_message_t* belle_sip_message_parse_raw (const char* buff, size_t buff_length,size_t* message_length );
int belle_sip_message_is_request(belle_sip_message_t *msg); BELLESIP_EXPORT int belle_sip_message_is_request(belle_sip_message_t *msg);
belle_sip_request_t* belle_sip_request_new(); BELLESIP_EXPORT belle_sip_request_t* belle_sip_request_new();
belle_sip_request_t* belle_sip_request_parse(const char* raw); belle_sip_request_t* belle_sip_request_parse(const char* raw);
belle_sip_request_t* belle_sip_request_create(belle_sip_uri_t *requri, const char* method, BELLESIP_EXPORT belle_sip_request_t* belle_sip_request_create(belle_sip_uri_t *requri, const char* method,
belle_sip_header_call_id_t *callid, belle_sip_header_call_id_t *callid,
belle_sip_header_cseq_t *cseq, belle_sip_header_cseq_t *cseq,
belle_sip_header_from_t *from, belle_sip_header_from_t *from,
...@@ -51,22 +51,22 @@ belle_sip_request_t* belle_sip_request_create(belle_sip_uri_t *requri, const cha ...@@ -51,22 +51,22 @@ belle_sip_request_t* belle_sip_request_create(belle_sip_uri_t *requri, const cha
belle_sip_uri_t* belle_sip_request_get_uri(belle_sip_request_t* request); BELLESIP_EXPORT belle_sip_uri_t* belle_sip_request_get_uri(belle_sip_request_t* request);
void belle_sip_request_set_uri(belle_sip_request_t* request, belle_sip_uri_t* uri); void belle_sip_request_set_uri(belle_sip_request_t* request, belle_sip_uri_t* uri);
const char* belle_sip_request_get_method(const belle_sip_request_t* request); BELLESIP_EXPORT const char* belle_sip_request_get_method(const belle_sip_request_t* request);
void belle_sip_request_set_method(belle_sip_request_t* request,const char* method); void belle_sip_request_set_method(belle_sip_request_t* request,const char* method);
/** /**
* Guess the origin of the received sip message from VIA header (thanks to received/rport) * Guess the origin of the received sip message from VIA header (thanks to received/rport)
* @param req request to be analyzed * @param req request to be analyzed
* @ return a newly allocated uri * @ return a newly allocated uri
* */ * */
belle_sip_uri_t* belle_sip_request_extract_origin(const belle_sip_request_t* req); BELLESIP_EXPORT belle_sip_uri_t* belle_sip_request_extract_origin(const belle_sip_request_t* req);
int belle_sip_message_is_response(const belle_sip_message_t *msg); int belle_sip_message_is_response(const belle_sip_message_t *msg);
belle_sip_header_t *belle_sip_message_get_header(const belle_sip_message_t *msg, const char *header_name); BELLESIP_EXPORT belle_sip_header_t *belle_sip_message_get_header(const belle_sip_message_t *msg, const char *header_name);
belle_sip_object_t *_belle_sip_message_get_header_by_type_id(const belle_sip_message_t *message, belle_sip_type_id_t id); BELLESIP_EXPORT belle_sip_object_t *_belle_sip_message_get_header_by_type_id(const belle_sip_message_t *message, belle_sip_type_id_t id);
#define belle_sip_message_get_header_by_type(msg,header_type)\ #define belle_sip_message_get_header_by_type(msg,header_type)\
(header_type*)_belle_sip_message_get_header_by_type_id(BELLE_SIP_MESSAGE(msg),BELLE_SIP_TYPE_ID(header_type)) (header_type*)_belle_sip_message_get_header_by_type_id(BELLE_SIP_MESSAGE(msg),BELLE_SIP_TYPE_ID(header_type))
...@@ -83,7 +83,7 @@ belle_sip_list_t* belle_sip_message_get_all_headers(const belle_sip_message_t *m ...@@ -83,7 +83,7 @@ belle_sip_list_t* belle_sip_message_get_all_headers(const belle_sip_message_t *m
* @param msg * @param msg
* @param header to add, must be one of header type * @param header to add, must be one of header type
*/ */
void belle_sip_message_add_header(belle_sip_message_t *msg, belle_sip_header_t* header); BELLESIP_EXPORT void belle_sip_message_add_header(belle_sip_message_t *msg, belle_sip_header_t* header);
void belle_sip_message_add_headers(belle_sip_message_t *message, const belle_sip_list_t *header_list); void belle_sip_message_add_headers(belle_sip_message_t *message, const belle_sip_list_t *header_list);
...@@ -93,24 +93,24 @@ void belle_sip_message_remove_first(belle_sip_message_t *msg, const char *header ...@@ -93,24 +93,24 @@ void belle_sip_message_remove_first(belle_sip_message_t *msg, const char *header
void belle_sip_message_remove_last(belle_sip_message_t *msg, const char *header_name); void belle_sip_message_remove_last(belle_sip_message_t *msg, const char *header_name);
void belle_sip_message_remove_header(belle_sip_message_t *msg, const char *header_name); BELLESIP_EXPORT void belle_sip_message_remove_header(belle_sip_message_t *msg, const char *header_name);
char *belle_sip_message_to_string(belle_sip_message_t *msg); char *belle_sip_message_to_string(belle_sip_message_t *msg);
const char* belle_sip_message_get_body(belle_sip_message_t *msg); const char* belle_sip_message_get_body(belle_sip_message_t *msg);
void belle_sip_message_set_body(belle_sip_message_t *msg,const char* body,unsigned int size); BELLESIP_EXPORT void belle_sip_message_set_body(belle_sip_message_t *msg,const char* body,unsigned int size);
/*message keep ownership of the null terminated body buffer /*message keep ownership of the null terminated body buffer
void belle_sip_message_assign_body(belle_sip_message_t *msg,char* body);*/ void belle_sip_message_assign_body(belle_sip_message_t *msg,char* body);*/
int belle_sip_response_get_status_code(const belle_sip_response_t *response); BELLESIP_EXPORT int belle_sip_response_get_status_code(const belle_sip_response_t *response);
void belle_sip_response_set_status_code(belle_sip_response_t *response,int status); void belle_sip_response_set_status_code(belle_sip_response_t *response,int status);
const char* belle_sip_response_get_reason_phrase(const belle_sip_response_t *response); BELLESIP_EXPORT const char* belle_sip_response_get_reason_phrase(const belle_sip_response_t *response);
void belle_sip_response_set_reason_phrase(belle_sip_response_t *response,const char* reason_phrase); void belle_sip_response_set_reason_phrase(belle_sip_response_t *response,const char* reason_phrase);
belle_sip_response_t *belle_sip_response_new(void); BELLESIP_EXPORT belle_sip_response_t *belle_sip_response_new(void);
belle_sip_response_t *belle_sip_response_create_from_request(belle_sip_request_t *req, int status_code); BELLESIP_EXPORT belle_sip_response_t *belle_sip_response_create_from_request(belle_sip_request_t *req, int status_code);
/** /**
* This method takes the received rport value of the reponse and update the contact IP/port accordingly * This method takes the received rport value of the reponse and update the contact IP/port accordingly
* @param response use to extract received/rport from top most via. * @param response use to extract received/rport from top most via.
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef belle_sip_object_h #ifndef belle_sip_object_h
#define belle_sip_object_h #define belle_sip_object_h
#include "belle-sip/defs.h"
/* /*
* typedefs, macros and functions for object definition and manipulation. * typedefs, macros and functions for object definition and manipulation.
*/ */
...@@ -126,7 +128,7 @@ struct _belle_sip_object_vptr{ ...@@ -126,7 +128,7 @@ struct _belle_sip_object_vptr{
typedef struct _belle_sip_object_vptr belle_sip_object_vptr_t; typedef struct _belle_sip_object_vptr belle_sip_object_vptr_t;
extern belle_sip_object_vptr_t belle_sip_object_t_vptr; BELLESIP_EXPORT belle_sip_object_vptr_t belle_sip_object_t_vptr;
struct _belle_sip_object{ struct _belle_sip_object{
belle_sip_object_vptr_t *vptr; belle_sip_object_vptr_t *vptr;
...@@ -140,7 +142,7 @@ struct _belle_sip_object{ ...@@ -140,7 +142,7 @@ struct _belle_sip_object{
BELLE_SIP_BEGIN_DECLS BELLE_SIP_BEGIN_DECLS
belle_sip_object_t * _belle_sip_object_new(size_t objsize, belle_sip_object_vptr_t *vptr); BELLESIP_EXPORT belle_sip_object_t * _belle_sip_object_new(size_t objsize, belle_sip_object_vptr_t *vptr);
#define belle_sip_object_new(_type) (_type*)_belle_sip_object_new(sizeof(_type),(belle_sip_object_vptr_t*)&BELLE_SIP_OBJECT_VPTR_NAME(_type)) #define belle_sip_object_new(_type) (_type*)_belle_sip_object_new(sizeof(_type),(belle_sip_object_vptr_t*)&BELLE_SIP_OBJECT_VPTR_NAME(_type))
...@@ -152,13 +154,13 @@ int belle_sip_object_is_unowed(const belle_sip_object_t *obj); ...@@ -152,13 +154,13 @@ int belle_sip_object_is_unowed(const belle_sip_object_t *obj);
* If the object is initially unowed, this acquires the first reference. * If the object is initially unowed, this acquires the first reference.
* *
**/ **/
belle_sip_object_t * belle_sip_object_ref(void *obj); BELLESIP_EXPORT belle_sip_object_t * belle_sip_object_ref(void *obj);
/*#define BELLE_SIP_REF(object,type) (type*)belle_sip_object_ref(object);*/ /*#define BELLE_SIP_REF(object,type) (type*)belle_sip_object_ref(object);*/
/** /**
* Decrements the reference counter. When it drops to zero, the object is destroyed. * Decrements the reference counter. When it drops to zero, the object is destroyed.
**/ **/
void belle_sip_object_unref(void *obj); BELLESIP_EXPORT void belle_sip_object_unref(void *obj);
typedef void (*belle_sip_object_destroy_notify_t)(void *userpointer, belle_sip_object_t *obj_being_destroyed); typedef void (*belle_sip_object_destroy_notify_t)(void *userpointer, belle_sip_object_t *obj_being_destroyed);
...@@ -193,7 +195,7 @@ void _belle_sip_object_copy(belle_sip_object_t *newobj, const belle_sip_object_t ...@@ -193,7 +195,7 @@ void _belle_sip_object_copy(belle_sip_object_t *newobj, const belle_sip_object_t
* This clone function makes a deep copy of all object internal structure, so that the new object and the reference object have no dependencies at all. * This clone function makes a deep copy of all object internal structure, so that the new object and the reference object have no dependencies at all.
* *
**/ **/
belle_sip_object_t *belle_sip_object_clone(const belle_sip_object_t *obj); BELLESIP_EXPORT belle_sip_object_t *belle_sip_object_clone(const belle_sip_object_t *obj);
/** /**
* Same as #belle_sip_object_clone but with ref count set to 1 * Same as #belle_sip_object_clone but with ref count set to 1
...@@ -212,14 +214,14 @@ char *belle_sip_object_describe(void *obj); ...@@ -212,14 +214,14 @@ char *belle_sip_object_describe(void *obj);
**/ **/
char *belle_sip_object_describe_type_from_name(const char *name); char *belle_sip_object_describe_type_from_name(const char *name);
void *belle_sip_object_cast(belle_sip_object_t *obj, belle_sip_type_id_t id, const char *castname, const char *file, int fileno); BELLESIP_EXPORT void *belle_sip_object_cast(belle_sip_object_t *obj, belle_sip_type_id_t id, const char *castname, const char *file, int fileno);
/** /**
* Returns a newly allocated string representing the object. * Returns a newly allocated string representing the object.
* WHen the object is a sip header, uri or message, this is the textual representation of the header, uri or message. * WHen the object is a sip header, uri or message, this is the textual representation of the header, uri or message.
* This function internally calls belle_sip_object_marshal(). * This function internally calls belle_sip_object_marshal().
**/ **/
char* belle_sip_object_to_string(belle_sip_object_t* obj); BELLESIP_EXPORT char* belle_sip_object_to_string(belle_sip_object_t* obj);
/** /**
* Writes a string representation of the object into the supplied buffer. * Writes a string representation of the object into the supplied buffer.
...@@ -227,7 +229,7 @@ char* belle_sip_object_to_string(belle_sip_object_t* obj); ...@@ -227,7 +229,7 @@ char* belle_sip_object_to_string(belle_sip_object_t* obj);
**/ **/
int belle_sip_object_marshal(belle_sip_object_t* obj, char* buff,unsigned int offset,size_t buff_size); int belle_sip_object_marshal(belle_sip_object_t* obj, char* buff,unsigned int offset,size_t buff_size);
int belle_sip_object_is_instance_of(belle_sip_object_t * obj,belle_sip_type_id_t id); BELLESIP_EXPORT int belle_sip_object_is_instance_of(belle_sip_object_t * obj,belle_sip_type_id_t id);
BELLE_SIP_END_DECLS BELLE_SIP_END_DECLS
...@@ -249,7 +251,7 @@ typedef unsigned int belle_sip_interface_id_t; ...@@ -249,7 +251,7 @@ typedef unsigned int belle_sip_interface_id_t;
BELLE_SIP_BEGIN_DECLS BELLE_SIP_BEGIN_DECLS
void *belle_sip_object_interface_cast(belle_sip_object_t *obj, belle_sip_interface_id_t id, const char *castname, const char *file, int fileno); BELLESIP_EXPORT void *belle_sip_object_interface_cast(belle_sip_object_t *obj, belle_sip_interface_id_t id, const char *castname, const char *file, int fileno);
int belle_sip_object_implements(belle_sip_object_t *obj, belle_sip_interface_id_t id); int belle_sip_object_implements(belle_sip_object_t *obj, belle_sip_interface_id_t id);
......
...@@ -33,7 +33,7 @@ belle_sip_parameters_t* belle_sip_parameters_new(); ...@@ -33,7 +33,7 @@ belle_sip_parameters_t* belle_sip_parameters_new();
void belle_sip_parameters_clean(belle_sip_parameters_t* params); void belle_sip_parameters_clean(belle_sip_parameters_t* params);
const char* belle_sip_parameters_get_parameter(const belle_sip_parameters_t* obj,const char* name); BELLESIP_EXPORT const char* belle_sip_parameters_get_parameter(const belle_sip_parameters_t* obj,const char* name);
/* /*
* same as #belle_sip_parameters_get_parameter but name is case insensitive */ * same as #belle_sip_parameters_get_parameter but name is case insensitive */
const char* belle_sip_parameters_get_case_parameter(const belle_sip_parameters_t* params,const char* name); const char* belle_sip_parameters_get_case_parameter(const belle_sip_parameters_t* params,const char* name);
...@@ -41,7 +41,7 @@ const char* belle_sip_parameters_get_case_parameter(const belle_sip_parameters_t ...@@ -41,7 +41,7 @@ const char* belle_sip_parameters_get_case_parameter(const belle_sip_parameters_t
/** /**
* returns 0 if not found * returns 0 if not found
*/ */
unsigned int belle_sip_parameters_is_parameter(const belle_sip_parameters_t* obj,const char* name); BELLESIP_EXPORT unsigned int belle_sip_parameters_is_parameter(const belle_sip_parameters_t* obj,const char* name);
void belle_sip_parameters_set_parameter(belle_sip_parameters_t* obj,const char* name,const char* value); void belle_sip_parameters_set_parameter(belle_sip_parameters_t* obj,const char* name,const char* value);
......
...@@ -24,29 +24,29 @@ ...@@ -24,29 +24,29 @@
BELLE_SIP_BEGIN_DECLS BELLE_SIP_BEGIN_DECLS
int belle_sip_provider_add_listening_point(belle_sip_provider_t *p, belle_sip_listening_point_t *lp); BELLESIP_EXPORT int belle_sip_provider_add_listening_point(belle_sip_provider_t *p, belle_sip_listening_point_t *lp);
void belle_sip_provider_remove_listening_point(belle_sip_provider_t *p, belle_sip_listening_point_t *lp); void belle_sip_provider_remove_listening_point(belle_sip_provider_t *p, belle_sip_listening_point_t *lp);
belle_sip_listening_point_t *belle_sip_provider_get_listening_point(belle_sip_provider_t *p, const char *transport); BELLESIP_EXPORT belle_sip_listening_point_t *belle_sip_provider_get_listening_point(belle_sip_provider_t *p, const char *transport);
const belle_sip_list_t *belle_sip_provider_get_listening_points(belle_sip_provider_t *p); const belle_sip_list_t *belle_sip_provider_get_listening_points(belle_sip_provider_t *p);
void belle_sip_provider_add_sip_listener(belle_sip_provider_t *p, belle_sip_listener_t *l); BELLESIP_EXPORT void belle_sip_provider_add_sip_listener(belle_sip_provider_t *p, belle_sip_listener_t *l);
void belle_sip_provider_remove_sip_listener(belle_sip_provider_t *p, belle_sip_listener_t *l); BELLESIP_EXPORT void belle_sip_provider_remove_sip_listener(belle_sip_provider_t *p, belle_sip_listener_t *l);
belle_sip_header_call_id_t * belle_sip_provider_create_call_id(const belle_sip_provider_t *prov); BELLESIP_EXPORT belle_sip_header_call_id_t * belle_sip_provider_create_call_id(const belle_sip_provider_t *prov);
belle_sip_dialog_t *belle_sip_provider_create_dialog(belle_sip_provider_t *prov, belle_sip_transaction_t *t); BELLESIP_EXPORT belle_sip_dialog_t *belle_sip_provider_create_dialog(belle_sip_provider_t *prov, belle_sip_transaction_t *t);
belle_sip_client_transaction_t *belle_sip_provider_create_client_transaction(belle_sip_provider_t *p, belle_sip_request_t *req); BELLESIP_EXPORT belle_sip_client_transaction_t *belle_sip_provider_create_client_transaction(belle_sip_provider_t *p, belle_sip_request_t *req);
belle_sip_server_transaction_t *belle_sip_provider_create_server_transaction(belle_sip_provider_t *p, belle_sip_request_t *req); BELLESIP_EXPORT belle_sip_server_transaction_t *belle_sip_provider_create_server_transaction(belle_sip_provider_t *p, belle_sip_request_t *req);