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 @@
#ifndef AUTHENTICATION_HELPER_H_
#define AUTHENTICATION_HELPER_H_
#include "belle-sip/defs.h"
#include "belle-sip/belle-sip.h"
/**
......@@ -26,7 +28,7 @@
* @param authentication source to be used as input
* @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.
......@@ -34,7 +36,7 @@ belle_sip_header_authorization_t* belle_sip_auth_helper_create_authorization(con
* @param authentication source to be used as input
* @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
......@@ -44,14 +46,14 @@ belle_sip_header_proxy_authorization_t* belle_sip_auth_helper_create_proxy_autho
*
* @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* ha1);
/**
* compute and set response value according to parameters
* @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* ha1);
......@@ -60,27 +62,27 @@ int belle_sip_auth_helper_fill_proxy_authorization(belle_sip_header_proxy_author
* HA1=MD5(userid:realm:passwd)
* 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)
* HA2=MD5(method:uri)
* 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)
* res=MD5(ha1:nonce:ha2)
* 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)
* res=MD5(HA1:nonce:nonce_count:cnonce:qop:HA2)
* 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
, unsigned int nonce_count
, const char* cnonce
......
This diff is collapsed.
......@@ -20,18 +20,7 @@
#include <stdlib.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
#include "belle-sip/defs.h"
#include "belle-sip/object.h"
/**
......@@ -122,9 +111,9 @@ enum belle_sip_interface_ids{
BELLE_SIP_BEGIN_DECLS
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_free(void *ptr);
BELLESIP_EXPORT void belle_sip_free(void *ptr);
char * belle_sip_strdup(const char *s);
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;
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.
* @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
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
* @param 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);
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);
......
This diff is collapsed.
......@@ -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_free(belle_sip_list_t *list);
/*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*);
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
#define BELLE_SIP_LISTENER(obj) BELLE_SIP_INTERFACE_CAST(obj,belle_sip_listener_t)
/*Response event*/
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_response_t* belle_sip_response_event_get_response(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);
/*Request event*/
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);
belle_sip_dialog_t *belle_sip_request_event_get_dialog(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);
BELLESIP_EXPORT belle_sip_server_transaction_t *belle_sip_request_event_get_server_transaction(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*/
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
/*auth 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);
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);
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);
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);
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;
* Creates an object implementing the belle_sip_listener_t interface.
* 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
......@@ -31,7 +31,7 @@ const char *belle_sip_listening_point_get_ip_address(const belle_sip_listening_
* @param lp object
* @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
......@@ -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
* @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);
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);
......
......@@ -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.
**/
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.
**/
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.
......
......@@ -26,7 +26,7 @@
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
* @param [in] buff buffer to be parsed
......@@ -34,13 +34,13 @@ belle_sip_message_t* belle_sip_message_parse(const char* raw);
* @param [out] message_length number of bytes read
* @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);
belle_sip_request_t* belle_sip_request_new();
BELLESIP_EXPORT int belle_sip_message_is_request(belle_sip_message_t *msg);
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_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_cseq_t *cseq,
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
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);
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);
/**
* Guess the origin of the received sip message from VIA header (thanks to received/rport)
* @param req request to be analyzed
* @ 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);
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)\
(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
* @param msg
* @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);
......@@ -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_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);
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
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);
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);
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
* @param response use to extract received/rport from top most via.
......
......@@ -19,6 +19,8 @@
#ifndef belle_sip_object_h
#define belle_sip_object_h
#include "belle-sip/defs.h"
/*
* typedefs, macros and functions for object definition and manipulation.
*/
......@@ -126,7 +128,7 @@ struct _belle_sip_object_vptr{
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{
belle_sip_object_vptr_t *vptr;
......@@ -140,7 +142,7 @@ struct _belle_sip_object{
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))
......@@ -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.
*
**/
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);*/
/**
* 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);
......@@ -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.
*
**/
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
......@@ -212,14 +214,14 @@ char *belle_sip_object_describe(void *obj);
**/
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.
* 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().
**/
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.
......@@ -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_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
......@@ -249,7 +251,7 @@ typedef unsigned int belle_sip_interface_id_t;
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);
......
......@@ -33,7 +33,7 @@ belle_sip_parameters_t* belle_sip_parameters_new();
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 */
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
/**
* 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);
......
......@@ -24,29 +24,29 @@
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);
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);
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);
belle_sip_stack_t *belle_sip_provider_get_sip_stack(belle_sip_provider_t *p);
void belle_sip_provider_send_request(belle_sip_provider_t *p, belle_sip_request_t *req);
BELLESIP_EXPORT void belle_sip_provider_send_request(belle_sip_provider_t *p, belle_sip_request_t *req);
void belle_sip_provider_send_response(belle_sip_provider_t *p, belle_sip_response_t *resp);
......@@ -62,7 +62,7 @@ void belle_sip_provider_clean_channels(belle_sip_provider_t *p);
* @returns 0 in case of success,
*
**/
int belle_sip_provider_add_authorization(belle_sip_provider_t *p, belle_sip_request_t* request,belle_sip_response_t *resp,belle_sip_list_t** auth_infos);
BELLESIP_EXPORT int belle_sip_provider_add_authorization(belle_sip_provider_t *p, belle_sip_request_t* request,belle_sip_response_t *resp,belle_sip_list_t** auth_infos);
/**
* Can be used to simulate network recv error, for tests.
......
......@@ -35,7 +35,7 @@ typedef void (*belle_sip_refresher_listener_t) ( const belle_sip_refresher_t* re
/**
* add a refresher listener
*/
void belle_sip_refresher_set_listener(belle_sip_refresher_t* refresher, belle_sip_refresher_listener_t listener,void* user_pointer);
BELLESIP_EXPORT void belle_sip_refresher_set_listener(belle_sip_refresher_t* refresher, belle_sip_refresher_listener_t listener,void* user_pointer);
/**
* start the refresher
......@@ -44,7 +44,7 @@ int belle_sip_refresher_start(belle_sip_refresher_t* refresher);
/**
* stop refresher
*/
void belle_sip_refresher_stop(belle_sip_refresher_t* refresher);
BELLESIP_EXPORT void belle_sip_refresher_stop(belle_sip_refresher_t* refresher);
/**
* Manually initiate a new transaction .
......@@ -52,7 +52,7 @@ void belle_sip_refresher_stop(belle_sip_refresher_t* refresher);
* @param expires -1 means value extrated from the transaction
* @return 0 if succeed
*/
int belle_sip_refresher_refresh(belle_sip_refresher_t* refresher,int expires);
BELLESIP_EXPORT int belle_sip_refresher_refresh(belle_sip_refresher_t* refresher,int expires);
/**
* returns current expires value;
*/
......
......@@ -39,37 +39,37 @@ typedef struct belle_sip_timer_config belle_sip_timer_config_t;
BELLE_SIP_BEGIN_DECLS
belle_sip_stack_t * belle_sip_stack_new(const char *properties);
BELLESIP_EXPORT belle_sip_stack_t * belle_sip_stack_new(const char *properties);
belle_sip_listening_point_t *belle_sip_stack_create_listening_point(belle_sip_stack_t *s, const char *ipaddress, int port, const char *transport);
BELLESIP_EXPORT belle_sip_listening_point_t *belle_sip_stack_create_listening_point(belle_sip_stack_t *s, const char *ipaddress, int port, const char *transport);
void belle_sip_stack_delete_listening_point(belle_sip_stack_t *s, belle_sip_listening_point_t *lp);
belle_sip_provider_t *belle_sip_stack_create_provider(belle_sip_stack_t *s, belle_sip_listening_point_t *lp);
BELLESIP_EXPORT belle_sip_provider_t *belle_sip_stack_create_provider(belle_sip_stack_t *s, belle_sip_listening_point_t *lp);
belle_sip_main_loop_t* belle_sip_stack_get_main_loop(belle_sip_stack_t *stack);
BELLESIP_EXPORT belle_sip_main_loop_t* belle_sip_stack_get_main_loop(belle_sip_stack_t *stack);
void belle_sip_stack_main(belle_sip_stack_t *stack);
void belle_sip_stack_sleep(belle_sip_stack_t *stack, unsigned int milliseconds);
BELLESIP_EXPORT void belle_sip_stack_sleep(belle_sip_stack_t *stack, unsigned int milliseconds);
int belle_sip_stack_get_transport_timeout(const belle_sip_stack_t *stack);
int belle_sip_stack_get_dns_timeout(const belle_sip_stack_t *stack);
BELLESIP_EXPORT int belle_sip_stack_get_dns_timeout(const belle_sip_stack_t *stack);
void belle_sip_hop_free(belle_sip_hop_t *hop);
/**
* Can be used to simulate network transmission delays, for tests.
**/
void belle_sip_stack_set_tx_delay(belle_sip_stack_t *stack, int delay_ms);
BELLESIP_EXPORT void belle_sip_stack_set_tx_delay(belle_sip_stack_t *stack, int delay_ms);
/**
* Can be used to simulate network sending error, for tests.
* @param stack
* @param send_error if <0, will cause channel error to be reported
**/
void belle_sip_stack_set_send_error(belle_sip_stack_t *stack, int send_error);
BELLESIP_EXPORT void belle_sip_stack_set_send_error(belle_sip_stack_t *stack, int send_error);
BELLE_SIP_END_DECLS
......
......@@ -39,31 +39,31 @@ void belle_sip_transaction_set_application_data(belle_sip_transaction_t *t, void
const char *belle_sip_transaction_get_branch_id(const belle_sip_transaction_t *t);
belle_sip_transaction_state_t belle_sip_transaction_get_state(const belle_sip_transaction_t *t);
void belle_sip_transaction_terminate(belle_sip_transaction_t *t);
belle_sip_request_t *belle_sip_transaction_get_request(const belle_sip_transaction_t *t);
belle_sip_dialog_t* belle_sip_transaction_get_dialog(const belle_sip_transaction_t *t);
BELLESIP_EXPORT belle_sip_request_t *belle_sip_transaction_get_request(const belle_sip_transaction_t *t);
BELLESIP_EXPORT belle_sip_dialog_t* belle_sip_transaction_get_dialog(const belle_sip_transaction_t *t);
void belle_sip_server_transaction_send_response(belle_sip_server_transaction_t *t, belle_sip_response_t *resp);
BELLESIP_EXPORT void belle_sip_server_transaction_send_response(belle_sip_server_transaction_t *t, belle_sip_response_t *resp);
belle_sip_request_t * belle_sip_client_transaction_create_cancel(belle_sip_client_transaction_t *t);
int belle_sip_client_transaction_send_request(belle_sip_client_transaction_t *t);
BELLESIP_EXPORT int belle_sip_client_transaction_send_request(belle_sip_client_transaction_t *t);
/*
* Same as #belle_sip_client_transaction_send_request but with a predefined route.
* @param t belle_sip_client_transaction_t
* @param outbound_proxy uri use to directly send the request, useful for outbound proxy.
* */
int belle_sip_client_transaction_send_request_to(belle_sip_client_transaction_t *t,belle_sip_uri_t* outbound_proxy);
BELLESIP_EXPORT int belle_sip_client_transaction_send_request_to(belle_sip_client_transaction_t *t,belle_sip_uri_t* outbound_proxy);
/**
* Creates an a sip refresher for transaction like REGISTER/SUBSCRIBE or INVITE which could be refreshed.
* Transaction must in be in stated BELLE_SIP_TRANSACTION_COMPLETED. Refresher is created and started. A ref is taken on object transaction
* */
belle_sip_refresher_t* belle_sip_client_transaction_create_refresher(belle_sip_client_transaction_t *t);
BELLESIP_EXPORT belle_sip_refresher_t* belle_sip_client_transaction_create_refresher(belle_sip_client_transaction_t *t);
/**
* Create an authenticated request based on an existing terminated transaction.
* <br>This function, update cseq, put route set and try to fill authorization headers. Initial request is not cloned.
* @param transaction . must be in state completed
* */
belle_sip_request_t* belle_sip_client_transaction_create_authenticated_request(belle_sip_client_transaction_t *t);
BELLESIP_EXPORT belle_sip_request_t* belle_sip_client_transaction_create_authenticated_request(belle_sip_client_transaction_t *t);
#define BELLE_SIP_TRANSACTION(t) BELLE_SIP_CAST(t,belle_sip_transaction_t)
#define BELLE_SIP_SERVER_TRANSACTION(t) BELLE_SIP_CAST(t,belle_sip_server_transaction_t)
......
......@@ -8,15 +8,16 @@
#ifndef BELLE_SIP_URI_H_
#define BELLE_SIP_URI_H_
#include "belle-sip/defs.h"
#include "belle-sip/list.h"
/*inherite from belle_sip_parameters_t*/
typedef struct _belle_sip_uri belle_sip_uri_t;
/**
*
*/
belle_sip_uri_t* belle_sip_uri_new();
BELLESIP_EXPORT belle_sip_uri_t* belle_sip_uri_new();
/**
*
*/
......@@ -24,18 +25,18 @@ typedef struct _belle_sip_uri belle_sip_uri_t;
/**
*
*/
belle_sip_uri_t* belle_sip_uri_parse (const char* uri) ;
BELLESIP_EXPORT belle_sip_uri_t* belle_sip_uri_parse (const char* uri) ;
/**
*
*/
belle_sip_uri_t* belle_sip_uri_create (const char* username,const char* host) ;
BELLESIP_EXPORT belle_sip_uri_t* belle_sip_uri_create (const char* username,const char* host) ;
/**
* Returns the value of the named header, or null if it is not set.
*
*/
const char* belle_sip_uri_get_header(const belle_sip_uri_t* uri,const char* name);
BELLESIP_EXPORT const char* belle_sip_uri_get_header(const belle_sip_uri_t* uri,const char* name);
/**
* Returns an Iterator over the const char*names of all headers present in this SipURI.
*
......@@ -45,22 +46,22 @@ typedef struct _belle_sip_uri belle_sip_uri_t;
* Returns the host part of this SipURI.
*
*/
const char* belle_sip_uri_get_host(const belle_sip_uri_t* uri) ;
BELLESIP_EXPORT const char* belle_sip_uri_get_host(const belle_sip_uri_t* uri) ;
/**
* Returns the value of the maddr parameter, or null if this is not set.
*
*/
const char* belle_sip_uri_get_maddr_param(const belle_sip_uri_t* uri) ;
BELLESIP_EXPORT const char* belle_sip_uri_get_maddr_param(const belle_sip_uri_t* uri) ;
/**
* Returns the value of the method parameter, or null if this is not set.
*
*/
const char* belle_sip_uri_get_method_param(const belle_sip_uri_t* uri) ;
BELLESIP_EXPORT const char* belle_sip_uri_get_method_param(const belle_sip_uri_t* uri) ;
/**
* Returns the port part of this SipURI.
*
*/
unsigned int belle_sip_uri_get_port(const belle_sip_uri_t* uri) ;
BELLESIP_EXPORT unsigned int belle_sip_uri_get_port(const belle_sip_uri_t* uri) ;
/**
* Returns the port of the uri, if not specified in the uri returns the well known port according to the transport.
**/
......@@ -69,22 +70,22 @@ typedef struct _belle_sip_uri belle_sip_uri_t;
* Returns the value of the "transport" parameter, or null if this is not set.
*
*/
const char* belle_sip_uri_get_transport_param(const belle_sip_uri_t* uri) ;
BELLESIP_EXPORT const char* belle_sip_uri_get_transport_param(const belle_sip_uri_t* uri) ;
/**
* Returns the value of the "ttl" parameter, or -1 if this is not set.
*
*/
int belle_sip_uri_get_ttl_param(const belle_sip_uri_t* uri) ;
BELLESIP_EXPORT int belle_sip_uri_get_ttl_param(const belle_sip_uri_t* uri) ;
/**