Commit fbe1ae17 authored by Guillaume BIENKOWSKI's avatar Guillaume BIENKOWSKI

Implemented a key-value storage in the belle_sip_object_t structure.

Added a belle_sip_dict_t that has base accessors over this storage, and the appropriate unit tests.
parent 91edb97c
......@@ -20,6 +20,7 @@ bellesip_HEADERS=\
belle-sip.h \
refresher.h \
defs.h \
resolver.h
resolver.h \
dict.h
EXTRA_DIST=$(bellesip_HEADERS)
......@@ -22,6 +22,7 @@
#include "belle-sip/defs.h"
#include "belle-sip/object.h"
#include "belle-sip/dict.h"
/**
* This enum declares all object types used in belle-sip (see belle_sip_object_t)
......@@ -113,7 +114,8 @@ BELLE_SIP_DECLARE_TYPES_BEGIN(belle_sip,1)
BELLE_SIP_TYPE_ID(belle_sip_signing_key_t),
BELLE_SIP_TYPE_ID(belle_sip_dns_srv_t),
BELLE_SIP_TYPE_ID(belle_sip_simple_resolver_context_t),
BELLE_SIP_TYPE_ID(belle_sip_combined_resolver_context_t)
BELLE_SIP_TYPE_ID(belle_sip_combined_resolver_context_t),
BELLE_SIP_TYPE_ID(belle_sip_dict_t)
BELLE_SIP_DECLARE_TYPES_END
......
/*
belle-sip - SIP (RFC3261) library.
Copyright (C) 2010 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 DICT_H
#define DICT_H
#include <sys/types.h>
#include "object.h"
typedef struct belle_sip_dict belle_sip_dict_t;
#define BELLE_SIP_DICT(obj) BELLE_SIP_CAST(obj,belle_sip_dict_t)
/**
* @brief belle_sip_dict_create
* @return an instance of a belle_sip_dict_t object.
* @note The object is not owned by default.
* @note all belle_sip_dict_set_* functions will overwrite existing values.
*/
belle_sip_dict_t* belle_sip_dict_create();
/**
* @brief belle_sip_dict_set_int stores an integer into the dictionary
* @param obj the dictionary instance
* @param key the name of the integer to store
* @param value value to store
*/
void belle_sip_dict_set_int(belle_sip_dict_t* obj, const char* key, int value);
/**
* @brief belle_sip_dict_get_int retrieves an integer from the dictionary
* @param obj the dictionary instance
* @param key name of the integer to retrieve
* @param default_value value to return if the key is not found
* @return the searched integer if the key exists, default_value if not found
*/
int belle_sip_dict_get_int(belle_sip_dict_t* obj, const char* key, int default_value);
/**
* @brief belle_sip_dict_set_string stores a string into the dictionary
* @param obj the dictionary instance
* @param key the name of the string to store
* @param value value to store
*/
void belle_sip_dict_set_string(belle_sip_dict_t* obj, const char* key, const char*value);
/**
* @brief belle_sip_dict_get_string retrieves a string from the dictionary
* @param obj the dictionary instance
* @param key the name of the string to retrieve
* @param default_value
* @return the searched string if the key exists, default_value if not found
*/
const char* belle_sip_dict_get_string(belle_sip_dict_t* obj, const char* key, const char* default_value);
/**
* @brief belle_sip_dict_set_int64 stores an int64 in the dictionary
* @param obj the dictionary instance
* @param key the name of the integer to store
* @param value value to store
*/
void belle_sip_dict_set_int64(belle_sip_dict_t* obj, const char* key, int64_t value);
/**
* @brief belle_sip_dict_get_int64 retrieves an int64 from the dictionary
* @param obj the dictionary instance
* @param key the name of the integer to retrieve
* @param default_value value to return if the key is not found
* @return the searched int64 if the key exists, default_value if not found
*/
int64_t belle_sip_dict_get_int64(belle_sip_dict_t* obj, const char* key, int64_t default_value);
/**
* @brief belle_sip_dict_remove will erase the value for a key
* @param obj the dictionary instance
* @param key the name of the integer to remove
* @return 0 if the key was found, 1 otherwise
*/
int belle_sip_dict_remove(belle_sip_dict_t* obj, const char* key);
/**
* @brief belle_sip_dict_clear will clear the object's dictionary.
* @param obj the dictionary instance
*/
void belle_sip_dict_clear(belle_sip_dict_t* obj);
/**
* @brief belle_sip_dict_haskey tells if a key exists in the dictionary.
* @param obj the dictionary instance
* @param key the key to look for
* @return 1 if the key exists, 0 otherwise
* @todo create unit test
*/
int belle_sip_dict_haskey(belle_sip_dict_t* obj, const char* key);
#endif // DICT_H
/*
belle-sip - SIP (RFC3261) library.
Copyright (C) 2010 Belledonne Communications SARL
Copyright (C) 2010 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 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.
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/>.
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_object_h
......@@ -77,40 +77,42 @@ typedef unsigned int belle_sip_type_id_t;
* It is the base class for all belle sip non trivial objects.
* It owns a reference count which allows to trigger the destruction of the object when the last
* user of it calls belle_sip_object_unref().
*
*
* It contains a generic data store that allows users to store named data in it and retrieve them afterwards.
*
* About object lifecycle<br>
* In belle-sip, objects can be, depending on their types, initially owned, that there are created with a ref count of 1, or
* initially unowned, that is with reference count of 0. Such objets are also referred as "floating object". They are automatically destroyed
* by the main loop iteration, so a floating object can be seen as a temporary object, until someones calls belle_sip_object_ref() on it.
*
* In order to know whether a kind of object is initially owned or initially unowned, you can use the test program tester/belle_sip_object_destribe.
*
* In order to know whether a kind of object is initially owned or initially unowned, you can use the test program tester/belle_sip_object_describe.
* This tool gives the hierarchy and properties of the object type whose name is supplied in argument. For example:
*
*
* <pre>./tester/belle_sip_object_describe belle_sip_request_t</pre>
*
*
* The object memory management depends slightly on whether an object type is created initially owned or not.
* In order not to be lost and make memory fault or leaks, consider the following rules:
*
*
* When an object is of type initially unowned:
* * call belle_sip_object_ref() on it only if you need a pointer to this object to be used outside the scope of the current function.
* * call belle_sip_object_unref() on it only if you previously called belle_sip_object_ref().
*
*
* When an object is of type initially owned:
* * you can safely store its pointer.
* * use belle_sip_object_unref() when you no longer need it.
*
* Also, keep in mind that most objects of belle-sip are initially unowned, especially
*
* Also, keep in mind that most objects of belle-sip are initially unowned, especially
* * all objects who are usually required to be used inside another object (for example: an URI is part of a from header, a contact header is part of a message)
* * all objects whose lifecyle is maintained by the stack: transactions, dialogs.
*
*
* On the contrary, top level objects whose lifecyle belongs only to the application are initially owned:
* * belle_sip_provider_t, belle_sip_stack_t, belle_sip_source_t.
*
*
* Internally, belle-sip objects containing pointers to other objects must take a reference count on the other objects they hold; and leave this reference
* when they no longer need it. This rule must be strictly followed by developers doing things inside belle-sip.
**/
typedef struct _belle_sip_object belle_sip_object_t;
typedef void (*belle_sip_object_destroy_t)(belle_sip_object_t*);
typedef void (*belle_sip_object_clone_t)(belle_sip_object_t* obj, const belle_sip_object_t *orig);
......@@ -138,12 +140,13 @@ struct _belle_sip_object{
struct weak_ref *weak_refs;
struct belle_sip_object_pool *pool;
struct _belle_sip_list *pool_iterator;
struct _belle_sip_list *data_store;
};
BELLE_SIP_BEGIN_DECLS
BELLESIP_VAR_EXPORT belle_sip_object_vptr_t belle_sip_object_t_vptr;
BELLESIP_VAR_EXPORT belle_sip_object_vptr_t belle_sip_object_t_vptr;
BELLESIP_EXPORT belle_sip_object_t * _belle_sip_object_new(size_t objsize, belle_sip_object_vptr_t *vptr);
......@@ -163,7 +166,7 @@ int belle_sip_object_is_unowed(const belle_sip_object_t *obj);
/**
* Increments reference counter, which prevents the object from being destroyed.
* If the object is initially unowed, this acquires the first reference.
*
*
**/
BELLESIP_EXPORT belle_sip_object_t * belle_sip_object_ref(void *obj);
......@@ -202,9 +205,9 @@ void _belle_sip_object_copy(belle_sip_object_t *newobj, const belle_sip_object_t
/**
* Clone an object.
*
*
* 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.
*
*
**/
BELLESIP_EXPORT belle_sip_object_t *belle_sip_object_clone(const belle_sip_object_t *obj);
......@@ -215,6 +218,72 @@ BELLESIP_EXPORT belle_sip_object_t *belle_sip_object_clone(const belle_sip_objec
belle_sip_object_t *belle_sip_object_clone_and_ref(const belle_sip_object_t *obj);
typedef void (*belle_sip_data_destroy)(void* data);
typedef void* (*belle_sip_data_clone)(const char* name, void* data);
/**
* Add an entry to the object's embedded data store, with the key name specified.
* The destroy function is used when the data is cleaned.
*
* If an entry already exists, the existing data will be cleaned by calling its destroy function and the new data will be placed instead.
*
* Returns -1 in case of error, 0 in case the insertion was successful, and 1 if existing data was present.
**/
BELLESIP_EXPORT int belle_sip_object_data_set( belle_sip_object_t *obj, const char* name, void* data, belle_sip_data_destroy destroy_func );
/**
* Retrieve data that has been stored in the object data store.
**/
BELLESIP_EXPORT void* belle_sip_object_data_get( belle_sip_object_t *obj, const char* name );
/**
* Return 1 if the key exists in the data store, 0 otherwise
**/
BELLESIP_EXPORT int belle_sip_object_data_exists( belle_sip_object_t *obj, const char* name );
/**
* Destroys the named data associated by the name provided.
*
* Returns 0 for success, -1 for error
**/
BELLESIP_EXPORT int belle_sip_object_data_remove( belle_sip_object_t *obj, const char* name);
/**
* Retrieve the data from the data store and removes it from the data store, without calling the destructor.
* This transfers ownership of the data to the caller, which will be in charge of releasing it.
**/
BELLESIP_EXPORT void* belle_sip_object_data_grab( belle_sip_object_t* obj, const char* name);
/**
* Clears all data in the object's storage, invoking the destroy_func when possible
**/
BELLESIP_EXPORT void belle_sip_object_data_clear( belle_sip_object_t* obj );
/**
* clones the object's data store to another one, using the provided clone function to clone individual data items.
*
* The destination data store will be cleaned before pushing the source data into it.
* For a merge, use #belle_sip_object_data_merge.
* This is equivalent to the following code:
* {
* belle_sip_object_data_clear(dst);
* belle_sip_object_data_merge(src, dst, clone_func);
* }
*
* Note that providing NULL as a cloning function will simply assign the src object's data to the dst object.
*
**/
BELLESIP_EXPORT void belle_sip_object_data_clone( belle_sip_object_t* src, belle_sip_object_t* dst, belle_sip_data_clone clone_func);
/**
* Merge the source data store into the destination data store.
*
* Same function as #belle_sip_object_data_clone, except the destination data store is not cleared before inserting the source data.
* This overwrites common keys, and keeps existing keys.
*/
BELLESIP_EXPORT void belle_sip_object_data_merge( belle_sip_object_t* src, belle_sip_object_t* dst, belle_sip_data_clone clone_func);
/**
* Returns a string describing the inheritance diagram and implemented interfaces of object obj.
**/
......@@ -292,7 +361,7 @@ typedef struct belle_sip_interface_desc{
typedef struct struct_methods_##interface_name BELLE_SIP_INTERFACE_METHODS_TYPE(interface_name);\
struct struct_methods_##interface_name {\
belle_sip_interface_desc_t desc;\
#define BELLE_SIP_DECLARE_INTERFACE_END };
......@@ -339,23 +408,25 @@ belle_sip_object_pool_t * belle_sip_object_pool_get_current();
int belle_sip_object_pool_cleanable(belle_sip_object_pool_t *pool);
void belle_sip_object_pool_clean(belle_sip_object_pool_t *obj);
BELLE_SIP_DECLARE_VPTR(belle_sip_object_t);
BELLE_SIP_END_DECLS
/**
* Adding a new type in belle-sip in 5 steps
* =========================================
*
*
* Let's suppose you want to add an object called belle_sip_something_t
* 1) Declare the type in the enum in belle-sip.h:
* BELLE_SIP_TYPE_ID(belle_sip_something_t)
* 2) Declare the api of the new object in .h, including a typedef and a cast macro:
* typedef struct belle_sip_something belle_sip_something_t;
* #define BELLE_SIP_SOMETHING(obj) BELLE_SIP_CAST(obj,belle_sip_something_t)
*
*
* belle_sip_something_t *belle_sip_something_create(int arg1, int arg2);
* void belle_sip_something_do_cooking(belle_sip_something_t *obj);
* Do not add any destructor, belle_sip_object_unref() does it for all objects.
*
*
* 3) in the c file contaning the object's implementation, define the internal structure for your object.
* The first field of the struct must be the parent type.
* struct belle_sip_something{
......@@ -369,7 +440,7 @@ BELLE_SIP_END_DECLS
* static void belle_sip_something_destroy(belle_sip_something_t *obj){
* if (obj->mychar) belle_sip_free(obj->mychar);
* }
*
*
* belle_sip_something_t *belle_sip_something_create(int arg1, int arg2){
* belle_sip_something_t *obj=belle_sip_object_new(belle_sip_something_t);
* obj->myint1=arg1;
......@@ -380,7 +451,7 @@ BELLE_SIP_END_DECLS
* Declare the interfaces implemented by the object (to be documented) and instanciate its "vptr", necessary for dynamic casting.
* BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(belle_sip_something_t);
* BELLE_SIP_INSTANCIATE_VPTR(belle_sip_something_t, belle_sip_object_t,belle_sip_something_destroy, NULL, NULL,FALSE);
*
*
* 5) in .h file included everywhere in the source (typically belle_sip_internal.h), declare the vptr
* BELLE_SIP_DECLARE_VPTR(belle_sip_dns_srv_t);
*/
......
......@@ -62,7 +62,8 @@ libbellesip_la_SOURCES= \
transports/stream_channel.h \
transports/stream_listeningpoint.c \
refresher.c \
dns.c dns.h
dns.c dns.h \
belle_sip_dict.c
if BUILD_TUNNEL
libbellesip_la_SOURCES+= transports/tunnel_listeningpoint.c \
......
/*
belle-sip - SIP (RFC3261) library.
Copyright (C) 2010 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/>.
*/
#include "belle-sip/dict.h"
#include "belle-sip/object.h"
#include "belle-sip/belle-sip.h"
#include "belle_sip_internal.h"
#define BELLE_SIP_DICT(obj) BELLE_SIP_CAST(obj,belle_sip_dict_t)
static void belle_sip_dict_string_destroy( void* data )
{
belle_sip_free(data);
}
belle_sip_dict_t* belle_sip_dict_create()
{
return belle_sip_object_new(belle_sip_dict_t);
}
static void belle_sip_dict_destroy( belle_sip_dict_t* obj)
{
}
void belle_sip_dict_set_int(belle_sip_dict_t* obj, const char* key, int value)
{
char tmp[30];
snprintf(tmp,sizeof(tmp),"%i",value);
belle_sip_dict_set_string(obj, key, tmp);
}
int belle_sip_dict_get_int(belle_sip_dict_t* obj, const char* key, int default_value)
{
const char *str=belle_sip_object_data_get(BELLE_SIP_OBJECT(obj),key);
if (str!=NULL) {
int ret=0;
if (strstr(str,"0x")==str){
sscanf(str,"%x",&ret);
}else ret=atoi(str);
return ret;
}
else return default_value;
}
void belle_sip_dict_set_string(belle_sip_dict_t* obj, const char*key, const char*value)
{
belle_sip_object_data_set( BELLE_SIP_OBJECT(obj), key, (void*)belle_sip_strdup(value), belle_sip_dict_string_destroy );
}
const char* belle_sip_dict_get_string(belle_sip_dict_t* obj, const char* key, const char* default_value)
{
void* data = belle_sip_object_data_get( BELLE_SIP_OBJECT(obj), key );
if( data ) return (const char *)data;
else return default_value;
}
void belle_sip_dict_set_int64(belle_sip_dict_t* obj, const char* key, int64_t value)
{
char tmp[30];
snprintf(tmp,sizeof(tmp),"%lli",(long long)value);
belle_sip_dict_set_string(obj,key,tmp);
}
int64_t belle_sip_dict_get_int64(belle_sip_dict_t* obj, const char* key, int64_t default_value)
{
const char *str= belle_sip_object_data_get( BELLE_SIP_OBJECT(obj), key );
if (str!=NULL) {
#ifdef WIN32
return (int64_t)_atoi64(str);
#else
return atoll(str);
#endif
}
else return default_value;
}
int belle_sip_dict_remove(belle_sip_dict_t* obj, const char*key)
{
return belle_sip_object_data_remove(BELLE_SIP_OBJECT(obj), key);
}
int belle_sip_dict_haskey(belle_sip_dict_t* obj, const char* key)
{
return belle_sip_object_data_exists(BELLE_SIP_OBJECT(obj), key);
}
void belle_sip_dict_clear(belle_sip_dict_t* obj)
{
return belle_sip_object_data_clear(BELLE_SIP_OBJECT(obj));
}
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(belle_sip_dict_t);
BELLE_SIP_INSTANCIATE_VPTR(belle_sip_dict_t, belle_sip_object_t,
belle_sip_dict_destroy,
NULL,
NULL,
TRUE);
/*
belle-sip - SIP (RFC3261) library.
Copyright (C) 2010 Belledonne Communications SARL
Copyright (C) 2010 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 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.
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/>.
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_utils_h
#define belle_utils_h
......@@ -124,7 +124,6 @@ void belle_sip_object_pool_remove(belle_sip_object_pool_t *pool, belle_sip_objec
/*list of all vptrs (classes) used in belle-sip*/
BELLE_SIP_DECLARE_VPTR(belle_sip_object_t);
BELLE_SIP_DECLARE_VPTR(belle_sip_stack_t);
BELLE_SIP_DECLARE_VPTR(belle_sip_datagram_listening_point_t);
BELLE_SIP_DECLARE_VPTR(belle_sip_provider_t);
......@@ -190,6 +189,7 @@ BELLE_SIP_DECLARE_VPTR(belle_sip_header_privacy_t);
BELLE_SIP_DECLARE_VPTR(belle_sip_certificates_chain_t);
BELLE_SIP_DECLARE_VPTR(belle_sip_signing_key_t);
BELLE_SIP_DECLARE_VPTR(belle_sip_dns_srv_t);
BELLE_SIP_DECLARE_VPTR(belle_sip_dict_t)
BELLE_SIP_DECLARE_CUSTOM_VPTR_BEGIN(belle_sip_resolver_context_t,belle_sip_source_t)
......@@ -237,7 +237,7 @@ void belle_sip_source_uninit(belle_sip_source_t *s);
#define belle_sip_new(type) (type*)belle_sip_malloc(sizeof(type))
#define belle_sip_new0(type) (type*)belle_sip_malloc0(sizeof(type))
belle_sip_list_t *belle_sip_list_new(void *data);
belle_sip_list_t* belle_sip_list_append_link(belle_sip_list_t* elem,belle_sip_list_t *new_elem);
belle_sip_list_t *belle_sip_list_delete_custom(belle_sip_list_t *list, belle_sip_compare_func compare_func, const void *user_data);
......@@ -245,7 +245,10 @@ belle_sip_list_t *belle_sip_list_delete_custom(belle_sip_list_t *list, belle_sip
#define belle_sip_list_next(elem) ((elem)->next)
/* dictionary */
struct belle_sip_dict {
belle_sip_object_t base;
};
#undef MIN
......@@ -404,7 +407,7 @@ belle_sip_##object_type##_t* belle_sip_##object_type##_parse (const char* value)
return l_object;\
}
#define BELLE_SIP_NEW_HEADER(object_type,super_type,name) BELLE_SIP_NEW_HEADER_INIT(object_type,super_type,name,header)
#define BELLE_SIP_NEW_HEADER_INIT(object_type,super_type,name,init_type) \
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(belle_sip_##object_type##_t); \
......@@ -528,8 +531,8 @@ void belle_sip_provider_add_client_transaction(belle_sip_provider_t *prov, belle
belle_sip_client_transaction_t *belle_sip_provider_find_matching_client_transaction(belle_sip_provider_t *prov, belle_sip_response_t *resp);
void belle_sip_provider_remove_client_transaction(belle_sip_provider_t *prov, belle_sip_client_transaction_t *t);
void belle_sip_provider_add_server_transaction(belle_sip_provider_t *prov, belle_sip_server_transaction_t *t);
belle_sip_server_transaction_t * belle_sip_provider_find_matching_server_transaction(belle_sip_provider_t *prov,
belle_sip_request_t *req);
belle_sip_server_transaction_t * belle_sip_provider_find_matching_server_transaction(belle_sip_provider_t *prov,
belle_sip_request_t *req);
void belle_sip_provider_remove_server_transaction(belle_sip_provider_t *prov, belle_sip_server_transaction_t *t);
void belle_sip_provider_set_transaction_terminated(belle_sip_provider_t *p, belle_sip_transaction_t *t);
belle_sip_channel_t * belle_sip_provider_get_channel(belle_sip_provider_t *p, const belle_sip_hop_t *hop);
......@@ -560,7 +563,7 @@ struct _belle_sip_message {
char* body;
unsigned int body_length;
};
struct _belle_sip_request {
belle_sip_message_t message;
char* method;
......@@ -569,7 +572,7 @@ struct _belle_sip_request {
char *rfc2543_branch; /*computed 'branch' id in case we receive this request from an old RFC2543 stack*/
unsigned char dialog_queued;
};
/*
belle_sip_transaction_t
*/
......@@ -585,7 +588,7 @@ struct belle_sip_transaction{
belle_sip_transaction_state_t state;
void *appdata;
unsigned char is_internal;
unsigned char timed_out;
unsigned char timed_out;
};
......@@ -718,7 +721,7 @@ belle_sip_nist_t * belle_sip_nist_new(belle_sip_provider_t *prov, belle_sip_requ
/*
* Dialogs
*/
*/
struct belle_sip_dialog{
belle_sip_object_t base;
void *appdata;
......
......@@ -158,13 +158,14 @@ belle_sip_object_vptr_t belle_sip_object_t_vptr={
void belle_sip_object_delete(void *ptr){
belle_sip_object_t *obj=BELLE_SIP_OBJECT(ptr);