From 4fa7cf664cdba7fa15cff29f2225dcdab454cf4a Mon Sep 17 00:00:00 2001
From: Ghislain MARY <ghislain.mary@belledonne-communications.com>
Date: Tue, 20 Dec 2016 17:23:57 +0100
Subject: [PATCH] Add some new header files.

---
 include/CMakeLists.txt        |   2 +
 include/linphone/Makefile.am  |   2 +
 include/linphone/auth_info.h  | 241 +++++++++++++++++++++++++++++++++
 include/linphone/call.h       |  12 ++
 include/linphone/core.h       | 248 +---------------------------------
 include/linphone/dictionary.h |  66 +++++++++
 include/linphone/error_info.h |  28 +++-
 include/linphone/lpconfig.h   |  94 +++----------
 8 files changed, 367 insertions(+), 326 deletions(-)
 create mode 100644 include/linphone/auth_info.h
 create mode 100644 include/linphone/dictionary.h

diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 8671d5dfba..8b4282e144 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -23,6 +23,7 @@
 set(HEADER_FILES
 	account_creator.h
 	address.h
+	auth_info.h
 	buffer.h
 	call.h
 	call_log.h
@@ -33,6 +34,7 @@ set(HEADER_FILES
 	content.h
 	core.h
 	core_utils.h
+	dictionary.h
 	error_info.h
 	event.h
 	friend.h
diff --git a/include/linphone/Makefile.am b/include/linphone/Makefile.am
index 006ea7bd1f..ed9cfb53b0 100644
--- a/include/linphone/Makefile.am
+++ b/include/linphone/Makefile.am
@@ -3,6 +3,7 @@ linphone_includedir=$(includedir)/linphone
 linphone_include_HEADERS=\
 	account_creator.h \
 	address.h \
+	auth_info.h \
 	buffer.h \
 	call.h \
 	call_log.h \
@@ -13,6 +14,7 @@ linphone_include_HEADERS=\
 	content.h \
 	core.h \
 	core_utils.h \
+	dictionary.h \
 	error_info.h \
 	event.h \
 	friend.h \
diff --git a/include/linphone/auth_info.h b/include/linphone/auth_info.h
new file mode 100644
index 0000000000..df9f12a432
--- /dev/null
+++ b/include/linphone/auth_info.h
@@ -0,0 +1,241 @@
+/*
+auth_info.h
+Copyright (C) 2016  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 2
+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, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*/
+
+#ifndef LINPHONE_AUTH_INFO_H
+#define LINPHONE_AUTH_INFO_H
+
+#include <mediastreamer2/mscommon.h>
+#ifndef LINPHONE_PUBLIC
+#define LINPHONE_PUBLIC MS2_PUBLIC
+#endif
+
+/**
+ * @addtogroup authentication
+ * @{
+ */
+
+/**
+ * Object holding authentication information.
+ *
+ * @note The object's fields should not be accessed directly. Prefer using
+ * the accessor methods.
+ *
+ * In most case, authentication information consists of a username and password.
+ * Sometimes, a userid is required by proxy, and realm can be useful to discriminate
+ * different SIP domains.
+ *
+ * Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in
+ * order to become known and used automatically when needed.
+ * Use linphone_core_add_auth_info() for that purpose.
+ *
+ * The LinphoneCore object can take the initiative to request authentication information
+ * when needed to the application through the auth_info_requested callback of the
+ * LinphoneCoreVTable structure.
+ *
+ * The application can respond to this information request later using
+ * linphone_core_add_auth_info(). This will unblock all pending authentication
+ * transactions and retry them with authentication headers.
+ *
+**/
+typedef struct _LinphoneAuthInfo LinphoneAuthInfo;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Creates a #LinphoneAuthInfo object with supplied information.
+ * The object can be created empty, that is with all arguments set to NULL.
+ * Username, userid, password, realm and domain can be set later using specific methods.
+ * At the end, username and passwd (or ha1) are required.
+ * @param username The username that needs to be authenticated
+ * @param userid The userid used for authenticating (use NULL if you don't know what it is)
+ * @param passwd The password in clear text
+ * @param ha1 The ha1-encrypted password if password is not given in clear text.
+ * @param realm The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter.
+ * @param domain The SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain.
+ * @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The LinphoneCore makes a copy of LinphoneAuthInfo
+ * passed through linphone_core_add_auth_info().
+**/
+LINPHONE_PUBLIC LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char *userid,
+	const char *passwd, const char *ha1,const char *realm, const char *domain);
+
+/**
+ * Instantiates a new auth info with values from source.
+ * @param[in] source The #LinphoneAuthInfo object to be cloned
+ * @return The newly created #LinphoneAuthInfo object.
+ */
+LINPHONE_PUBLIC LinphoneAuthInfo *linphone_auth_info_clone(const LinphoneAuthInfo* source);
+
+/**
+ * Sets the password.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] passwd The password.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *passwd);
+
+/**
+ * Sets the username.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] username The username.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *username);
+
+/**
+ * Sets the userid.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] userid The userid.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *userid);
+
+/**
+ * Sets the realm.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] realm The realm.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_realm(LinphoneAuthInfo *info, const char *realm);
+
+/**
+ * Sets the domain for which this authentication is valid.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] domain The domain.
+ * This should not be necessary because realm is supposed to be unique and sufficient.
+ * However, many SIP servers don't set realm correctly, then domain has to be used to distinguish between several SIP account bearing the same username.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_domain(LinphoneAuthInfo *info, const char *domain);
+
+/**
+ * Sets the ha1.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] ha1 The ha1.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_ha1(LinphoneAuthInfo *info, const char *ha1);
+
+/**
+ * Sets the TLS certificate.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] ha1 The TLS certificate.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_tls_cert(LinphoneAuthInfo *info, const char *tls_cert);
+
+/**
+ * Sets the TLS key.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] ha1 The TLS key.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_tls_key(LinphoneAuthInfo *info, const char *tls_key);
+
+/**
+ * Sets the TLS certificate path.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] ha1 The TLS certificate path.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_tls_cert_path(LinphoneAuthInfo *info, const char *tls_cert_path);
+
+/**
+ * Sets the TLS key path.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @param[in] ha1 The TLS key path.
+**/
+LINPHONE_PUBLIC void linphone_auth_info_set_tls_key_path(LinphoneAuthInfo *info, const char *tls_key_path);
+
+/**
+ * Gets the username.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The username.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_username(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the password.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The password.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the userid.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The userid.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the realm.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The realm.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_realm(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the domain.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The domain.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_domain(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the ha1.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The ha1.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_ha1(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the TLS certificate.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The TLS certificate.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_cert(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the TLS key.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The TLS key.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_key(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the TLS certificate path.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The TLS certificate path.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_cert_path(const LinphoneAuthInfo *info);
+
+/**
+ * Gets the TLS key path.
+ * @param[in] info The #LinphoneAuthInfo object
+ * @return The TLS key path.
+ */
+LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_key_path(const LinphoneAuthInfo *info);
+
+/* you don't need those function*/
+LINPHONE_PUBLIC void linphone_auth_info_destroy(LinphoneAuthInfo *info);
+LINPHONE_PUBLIC LinphoneAuthInfo * linphone_auth_info_new_from_config_file(LpConfig *config, int pos);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LINPHONE_AUTH_INFO_H */
diff --git a/include/linphone/call.h b/include/linphone/call.h
index fac2d67662..d97a68ec7d 100644
--- a/include/linphone/call.h
+++ b/include/linphone/call.h
@@ -20,6 +20,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 #ifndef LINPHONE_CALL_H
 #define LINPHONE_CALL_H
 
+#include <mediastreamer2/mscommon.h>
+#ifndef LINPHONE_PUBLIC
+#define LINPHONE_PUBLIC MS2_PUBLIC
+#endif
+
 #include "linphone/address.h"
 #include "linphone/call_log.h"
 #include "linphone/call_params.h"
@@ -87,6 +92,10 @@ typedef struct _LinphoneCall LinphoneCall;
 typedef void (*LinphoneCallCbFunc)(LinphoneCall *call, void *user_data);
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 LINPHONE_PUBLIC const char *linphone_call_state_to_string(LinphoneCallState cs);
 
 /**
@@ -571,5 +580,8 @@ LINPHONE_PUBLIC bool_t linphone_call_media_in_progress(LinphoneCall *call);
  * @}
  */
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* LINPHONE_CALL_H */
diff --git a/include/linphone/core.h b/include/linphone/core.h
index d4e4149c63..21756089ac 100644
--- a/include/linphone/core.h
+++ b/include/linphone/core.h
@@ -145,8 +145,7 @@ typedef enum _LinphoneStreamType LinphoneStreamType;
 
 LINPHONE_PUBLIC const char *linphone_stream_type_to_string(const LinphoneStreamType);
 
-typedef struct belle_sip_dict LinphoneDictionary;
-
+#include "linphone/dictionary.h"
 #include "linphone/error_info.h"
 
 /**
@@ -164,35 +163,6 @@ enum _LinphoneAuthMethod {
 **/
 typedef enum _LinphoneAuthMethod LinphoneAuthMethod;
 
-/* linphone dictionary */
-LINPHONE_PUBLIC LinphoneDictionary* linphone_dictionary_new(void);
-LINPHONE_PUBLIC LinphoneDictionary * linphone_dictionary_clone(const LinphoneDictionary* src);
-LINPHONE_PUBLIC LinphoneDictionary * linphone_dictionary_ref(LinphoneDictionary* obj);
-LINPHONE_PUBLIC void linphone_dictionary_unref(LinphoneDictionary* obj);
-LINPHONE_PUBLIC void linphone_dictionary_set_int(LinphoneDictionary* obj, const char* key, int value);
-LINPHONE_PUBLIC int linphone_dictionary_get_int(LinphoneDictionary* obj, const char* key, int default_value);
-LINPHONE_PUBLIC void linphone_dictionary_set_string(LinphoneDictionary* obj, const char* key, const char*value);
-LINPHONE_PUBLIC const char* linphone_dictionary_get_string(LinphoneDictionary* obj, const char* key, const char* default_value);
-LINPHONE_PUBLIC void linphone_dictionary_set_int64(LinphoneDictionary* obj, const char* key, int64_t value);
-LINPHONE_PUBLIC int64_t linphone_dictionary_get_int64(LinphoneDictionary* obj, const char* key, int64_t default_value);
-LINPHONE_PUBLIC int linphone_dictionary_remove(LinphoneDictionary* obj, const char* key);
-LINPHONE_PUBLIC void linphone_dictionary_clear(LinphoneDictionary* obj);
-LINPHONE_PUBLIC int linphone_dictionary_haskey(const LinphoneDictionary* obj, const char* key);
-LINPHONE_PUBLIC void linphone_dictionary_foreach( const LinphoneDictionary* obj, void (*apply_func)(const char*key, void* value, void* userdata), void* userdata);
-/**
- * Converts a config section into a dictionary.
- * @return a #LinphoneDictionary with all the keys from a section, or NULL if the section doesn't exist
- * @ingroup misc
- */
-LINPHONE_PUBLIC LinphoneDictionary* lp_config_section_to_dict( const LpConfig* lpconfig, const char* section );
-
-/**
- * Loads a dictionary into a section of the lpconfig. If the section doesn't exist it is created.
- * Overwrites existing keys, creates non-existing keys.
- * @ingroup misc
- */
-LINPHONE_PUBLIC void lp_config_load_dict_to_section( LpConfig* lpconfig, const char* section, const LinphoneDictionary* dict);
-
 
 /**
  * @addtogroup media_parameters
@@ -569,222 +539,8 @@ LINPHONE_PUBLIC const char *linphone_registration_state_to_string(LinphoneRegist
  * @}
  */
 
-/**
- * @addtogroup authentication
- * @{
- */
-
-/**
- * Object holding authentication information.
- *
- * @note The object's fields should not be accessed directly. Prefer using
- * the accessor methods.
- *
- * In most case, authentication information consists of a username and password.
- * Sometimes, a userid is required by proxy, and realm can be useful to discriminate
- * different SIP domains.
- *
- * Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in
- * order to become known and used automatically when needed.
- * Use linphone_core_add_auth_info() for that purpose.
- *
- * The LinphoneCore object can take the initiative to request authentication information
- * when needed to the application through the auth_info_requested callback of the
- * LinphoneCoreVTable structure.
- *
- * The application can respond to this information request later using
- * linphone_core_add_auth_info(). This will unblock all pending authentication
- * transactions and retry them with authentication headers.
- *
-**/
-typedef struct _LinphoneAuthInfo LinphoneAuthInfo;
-
-/**
- * Creates a #LinphoneAuthInfo object with supplied information.
- * The object can be created empty, that is with all arguments set to NULL.
- * Username, userid, password, realm and domain can be set later using specific methods.
- * At the end, username and passwd (or ha1) are required.
- * @param username The username that needs to be authenticated
- * @param userid The userid used for authenticating (use NULL if you don't know what it is)
- * @param passwd The password in clear text
- * @param ha1 The ha1-encrypted password if password is not given in clear text.
- * @param realm The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter.
- * @param domain The SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain.
- * @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The LinphoneCore makes a copy of LinphoneAuthInfo
- * passed through linphone_core_add_auth_info().
-**/
-LINPHONE_PUBLIC LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char *userid,
-	const char *passwd, const char *ha1,const char *realm, const char *domain);
-
-/**
- * Instantiates a new auth info with values from source.
- * @param[in] source The #LinphoneAuthInfo object to be cloned
- * @return The newly created #LinphoneAuthInfo object.
- */
-LINPHONE_PUBLIC LinphoneAuthInfo *linphone_auth_info_clone(const LinphoneAuthInfo* source);
-
-/**
- * Sets the password.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] passwd The password.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *passwd);
-
-/**
- * Sets the username.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] username The username.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *username);
-
-/**
- * Sets the userid.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] userid The userid.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *userid);
-
-/**
- * Sets the realm.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] realm The realm.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_realm(LinphoneAuthInfo *info, const char *realm);
-
-/**
- * Sets the domain for which this authentication is valid.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] domain The domain.
- * This should not be necessary because realm is supposed to be unique and sufficient.
- * However, many SIP servers don't set realm correctly, then domain has to be used to distinguish between several SIP account bearing the same username.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_domain(LinphoneAuthInfo *info, const char *domain);
-
-/**
- * Sets the ha1.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] ha1 The ha1.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_ha1(LinphoneAuthInfo *info, const char *ha1);
-
-/**
- * Sets the TLS certificate.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] ha1 The TLS certificate.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_tls_cert(LinphoneAuthInfo *info, const char *tls_cert);
-
-/**
- * Sets the TLS key.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] ha1 The TLS key.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_tls_key(LinphoneAuthInfo *info, const char *tls_key);
-
-/**
- * Sets the TLS certificate path.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] ha1 The TLS certificate path.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_tls_cert_path(LinphoneAuthInfo *info, const char *tls_cert_path);
-
-/**
- * Sets the TLS key path.
- * @param[in] info The #LinphoneAuthInfo object
- * @param[in] ha1 The TLS key path.
-**/
-LINPHONE_PUBLIC void linphone_auth_info_set_tls_key_path(LinphoneAuthInfo *info, const char *tls_key_path);
-
-/**
- * Gets the username.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The username.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_username(const LinphoneAuthInfo *info);
-
-/**
- * Gets the password.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The password.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *info);
-
-/**
- * Gets the userid.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The userid.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *info);
-
-/**
- * Gets the realm.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The realm.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_realm(const LinphoneAuthInfo *info);
-
-/**
- * Gets the domain.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The domain.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_domain(const LinphoneAuthInfo *info);
-
-/**
- * Gets the ha1.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The ha1.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_ha1(const LinphoneAuthInfo *info);
-
-/**
- * Gets the TLS certificate.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The TLS certificate.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_cert(const LinphoneAuthInfo *info);
-
-/**
- * Gets the TLS key.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The TLS key.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_key(const LinphoneAuthInfo *info);
-
-/**
- * Gets the TLS certificate path.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The TLS certificate path.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_cert_path(const LinphoneAuthInfo *info);
-
-/**
- * Gets the TLS key path.
- *
- * @param[in] info The #LinphoneAuthInfo object
- * @return The TLS key path.
- */
-LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_key_path(const LinphoneAuthInfo *info);
-
-/* you don't need those function*/
-LINPHONE_PUBLIC void linphone_auth_info_destroy(LinphoneAuthInfo *info);
-LINPHONE_PUBLIC LinphoneAuthInfo * linphone_auth_info_new_from_config_file(LpConfig *config, int pos);
-
-/**
- * @}
- */
-
-
 #include "linphone/account_creator.h"
+#include "linphone/auth_info.h"
 #include "linphone/friendlist.h"
 #include "linphone/linphone_proxy_config.h"
 
diff --git a/include/linphone/dictionary.h b/include/linphone/dictionary.h
new file mode 100644
index 0000000000..0893015d60
--- /dev/null
+++ b/include/linphone/dictionary.h
@@ -0,0 +1,66 @@
+/*
+dictionary.h
+Copyright (C) 2016  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 2
+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, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*/
+
+#ifndef LINPHONE_DICTIONARY_H
+#define LINPHONE_DICTIONARY_H
+
+#include <mediastreamer2/mscommon.h>
+#ifndef LINPHONE_PUBLIC
+#define LINPHONE_PUBLIC MS2_PUBLIC
+#endif
+
+typedef struct belle_sip_dict LinphoneDictionary;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LINPHONE_PUBLIC LinphoneDictionary* linphone_dictionary_new(void);
+
+LINPHONE_PUBLIC LinphoneDictionary * linphone_dictionary_clone(const LinphoneDictionary* src);
+
+LINPHONE_PUBLIC LinphoneDictionary * linphone_dictionary_ref(LinphoneDictionary* obj);
+
+LINPHONE_PUBLIC void linphone_dictionary_unref(LinphoneDictionary* obj);
+
+LINPHONE_PUBLIC void linphone_dictionary_set_int(LinphoneDictionary* obj, const char* key, int value);
+
+LINPHONE_PUBLIC int linphone_dictionary_get_int(LinphoneDictionary* obj, const char* key, int default_value);
+
+LINPHONE_PUBLIC void linphone_dictionary_set_string(LinphoneDictionary* obj, const char* key, const char*value);
+
+LINPHONE_PUBLIC const char* linphone_dictionary_get_string(LinphoneDictionary* obj, const char* key, const char* default_value);
+
+LINPHONE_PUBLIC void linphone_dictionary_set_int64(LinphoneDictionary* obj, const char* key, int64_t value);
+
+LINPHONE_PUBLIC int64_t linphone_dictionary_get_int64(LinphoneDictionary* obj, const char* key, int64_t default_value);
+
+LINPHONE_PUBLIC int linphone_dictionary_remove(LinphoneDictionary* obj, const char* key);
+
+LINPHONE_PUBLIC void linphone_dictionary_clear(LinphoneDictionary* obj);
+
+LINPHONE_PUBLIC int linphone_dictionary_haskey(const LinphoneDictionary* obj, const char* key);
+
+LINPHONE_PUBLIC void linphone_dictionary_foreach( const LinphoneDictionary* obj, void (*apply_func)(const char*key, void* value, void* userdata), void* userdata);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LINPHONE_DICTIONARY_H */
diff --git a/include/linphone/error_info.h b/include/linphone/error_info.h
index b25e31630a..b898877fbe 100644
--- a/include/linphone/error_info.h
+++ b/include/linphone/error_info.h
@@ -20,6 +20,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 #ifndef LINPHONE_ERROR_INFO_H
 #define LINPHONE_ERROR_INFO_H
 
+#include <mediastreamer2/mscommon.h>
+#ifndef LINPHONE_PUBLIC
+#define LINPHONE_PUBLIC MS2_PUBLIC
+#endif
+
 /**
  * @addtogroup misc
  * @{
@@ -65,6 +70,18 @@ enum _LinphoneReason{
 **/
 typedef enum _LinphoneReason LinphoneReason;
 
+/**
+ * Object representing full details about a signaling error or status.
+ * All LinphoneErrorInfo object returned by the liblinphone API are readonly and transcients. For safety they must be used immediately
+ * after obtaining them. Any other function call to the liblinphone may change their content or invalidate the pointer.
+**/
+typedef struct _LinphoneErrorInfo LinphoneErrorInfo;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Converts a LinphoneReason enum to a string.
  * @param[in] err A #LinphoneReason
@@ -79,13 +96,6 @@ LINPHONE_PUBLIC const char *linphone_reason_to_string(LinphoneReason err);
 **/
 LINPHONE_PUBLIC LinphoneReason linphone_error_code_to_reason(int err);
 
-/**
- * Object representing full details about a signaling error or status.
- * All LinphoneErrorInfo object returned by the liblinphone API are readonly and transcients. For safety they must be used immediately
- * after obtaining them. Any other function call to the liblinphone may change their content or invalidate the pointer.
-**/
-typedef struct _LinphoneErrorInfo LinphoneErrorInfo;
-
 /**
  * Get reason code from the error info.
  * @param[in] ei ErrorInfo object
@@ -120,4 +130,8 @@ LINPHONE_PUBLIC int linphone_error_info_get_protocol_code(const LinphoneErrorInf
  * @}
  */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LINPHONE_ERROR_INFO_H */
diff --git a/include/linphone/lpconfig.h b/include/linphone/lpconfig.h
index 09a1f8d974..02f8f2b945 100644
--- a/include/linphone/lpconfig.h
+++ b/include/linphone/lpconfig.h
@@ -24,17 +24,23 @@
 
 #ifndef LPCONFIG_H
 #define LPCONFIG_H
+
 #include <mediastreamer2/mscommon.h>
 #include <ortp/port.h>
+#include "linphone/dictionary.h"
 
 #ifndef LINPHONE_PUBLIC
 	#define LINPHONE_PUBLIC MS2_PUBLIC
 #endif
 
+/**
+ * @addtogroup misc
+ * @{
+ */
+
 /**
  * The LpConfig object is used to manipulate a configuration file.
  *
- * @ingroup misc
  * The format of the configuration file is a .ini like format:
  * - sections are defined in []
  * - each section contains a sequence of key=value pairs.
@@ -58,7 +64,6 @@ extern "C" {
 /**
  * Instantiates a LpConfig object from a user config file.
  * The caller of this constructor owns a reference. lp_config_unref() must be called when this object is no longer needed.
- * @ingroup misc
  * @param filename the filename of the config file to read to fill the instantiated LpConfig
  * @see lp_config_new_with_factory
  */
@@ -67,7 +72,6 @@ LINPHONE_PUBLIC LpConfig * lp_config_new(const char *filename);
 /**
  * Instantiates a LpConfig object from a user provided buffer.
  * The caller of this constructor owns a reference. lp_config_unref() must be called when this object is no longer needed.
- * @ingroup misc
  * @param buffer the buffer from which the lpconfig will be retrieved. We expect the buffer to be null-terminated.
  * @see lp_config_new_with_factory
  * @see lp_config_new
@@ -77,7 +81,6 @@ LINPHONE_PUBLIC LpConfig * lp_config_new_from_buffer(const char *buffer);
 /**
  * Instantiates a LpConfig object from a user config file and a factory config file.
  * The caller of this constructor owns a reference. lp_config_unref() must be called when this object is no longer needed.
- * @ingroup misc
  * @param config_filename the filename of the user config file to read to fill the instantiated LpConfig
  * @param factory_config_filename the filename of the factory config file to read to fill the instantiated LpConfig
  * @see lp_config_new
@@ -90,7 +93,6 @@ LINPHONE_PUBLIC LpConfig * lp_config_new_with_factory(const char *config_filenam
 
 /**
  * Reads a user config file and fill the LpConfig with the read config values.
- * @ingroup misc
  * @param lpconfig The LpConfig object to fill with the content of the file
  * @param filename The filename of the config file to read to fill the LpConfig
  */
@@ -99,7 +101,6 @@ LINPHONE_PUBLIC int lp_config_read_file(LpConfig *lpconfig, const char *filename
 /**
  * Retrieves a configuration item as a string, given its section, key, and default value.
  *
- * @ingroup misc
  * The default value string is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC const char *lp_config_get_string(const LpConfig *lpconfig, const char *section, const char *key, const char *default_string);
@@ -107,7 +108,6 @@ LINPHONE_PUBLIC const char *lp_config_get_string(const LpConfig *lpconfig, const
 /**
  * Retrieves a configuration item as a list of strings, given its section, key, and default value.
  * The default value is returned if the config item is not found.
- * @ingroup misc
  * @param[in] lpconfig A LpConfig object
  * @param[in] section The section from which to retrieve a configuration item
  * @param[in] key The name of the configuration item to retrieve
@@ -119,7 +119,6 @@ LINPHONE_PUBLIC bctbx_list_t * lp_config_get_string_list(const LpConfig *lpconfi
 /**
  * Retrieves a configuration item as a range, given its section, key, and default min and max values.
  *
- * @ingroup misc
  * @return TRUE if the value is successfully parsed as a range, FALSE otherwise.
  * If FALSE is returned, min and max are filled respectively with default_min and default_max values.
  */
@@ -128,7 +127,6 @@ LINPHONE_PUBLIC bool_t lp_config_get_range(const LpConfig *lpconfig, const char
 /**
  * Retrieves a configuration item as an integer, given its section, key, and default value.
  *
- * @ingroup misc
  * The default integer value is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC int lp_config_get_int(const LpConfig *lpconfig,const char *section, const char *key, int default_value);
@@ -136,7 +134,6 @@ LINPHONE_PUBLIC int lp_config_get_int(const LpConfig *lpconfig,const char *secti
 /**
  * Retrieves a configuration item as a 64 bit integer, given its section, key, and default value.
  *
- * @ingroup misc
  * The default integer value is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC int64_t lp_config_get_int64(const LpConfig *lpconfig,const char *section, const char *key, int64_t default_value);
@@ -144,21 +141,17 @@ LINPHONE_PUBLIC int64_t lp_config_get_int64(const LpConfig *lpconfig,const char
 /**
  * Retrieves a configuration item as a float, given its section, key, and default value.
  *
- * @ingroup misc
  * The default float value is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC float lp_config_get_float(const LpConfig *lpconfig,const char *section, const char *key, float default_value);
 
 /**
  * Sets a string config item
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_string(LpConfig *lpconfig,const char *section, const char *key, const char *value);
 
 /**
  * Sets a string list config item
- * @ingroup misc
  * @param[in] lpconfig A LpConfig object
  * @param[in] section The name of the section to put the configuration item into
  * @param[in] key The name of the configuration item to set
@@ -168,57 +161,41 @@ LINPHONE_PUBLIC void lp_config_set_string_list(LpConfig *lpconfig, const char *s
 
 /**
  * Sets a range config item
- *
- * @ingroup misc
  */
 LINPHONE_PUBLIC void lp_config_set_range(LpConfig *lpconfig, const char *section, const char *key, int min_value, int max_value);
 
 /**
  * Sets an integer config item
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_int(LpConfig *lpconfig,const char *section, const char *key, int value);
 
 /**
  * Sets an integer config item, but store it as hexadecimal
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_int_hex(LpConfig *lpconfig,const char *section, const char *key, int value);
 
 /**
  * Sets a 64 bits integer config item
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_int64(LpConfig *lpconfig,const char *section, const char *key, int64_t value);
 
 /**
  * Sets a float config item
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_float(LpConfig *lpconfig,const char *section, const char *key, float value);
 
 /**
  * Writes the config file to disk.
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC int lp_config_sync(LpConfig *lpconfig);
 
 /**
  * Returns 1 if a given section is present in the configuration.
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC int lp_config_has_section(const LpConfig *lpconfig, const char *section);
 
 /**
  * Removes every pair of key,value in a section and remove the section.
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_clean_section(LpConfig *lpconfig, const char *section);
 
@@ -227,8 +204,6 @@ LINPHONE_PUBLIC void lp_config_clean_section(LpConfig *lpconfig, const char *sec
  * @param[in] lpconfig The LpConfig object
  * @param[in] section
  * @param[in] key
- *
- * @ingroup misc
  **/
 LINPHONE_PUBLIC int lp_config_has_entry(const LpConfig *lpconfig, const char *section, const char *key);
 
@@ -237,8 +212,6 @@ LINPHONE_PUBLIC int lp_config_has_entry(const LpConfig *lpconfig, const char *se
  * @param[in] lpconfig The LpConfig object
  * @param[in] section
  * @param[in] key
- *
- * @ingroup misc
  **/
 LINPHONE_PUBLIC void lp_config_clean_entry(LpConfig *lpconfig, const char *section, const char *key);
 	
@@ -251,15 +224,11 @@ LINPHONE_PUBLIC const char** lp_config_get_sections_names(LpConfig *lpconfig);
 
 /**
  * Call a function for each section present in the configuration.
- *
- * @ingroup misc
 **/
 void lp_config_for_each_section(const LpConfig *lpconfig, void (*callback)(const char *section, void *ctx), void *ctx);
 
 /**
  * Call a function for each entry present in a section configuration.
- *
- * @ingroup misc
 **/
 void lp_config_for_each_entry(const LpConfig *lpconfig, const char *section, void (*callback)(const char *entry, void *ctx), void *ctx);
 
@@ -270,59 +239,46 @@ LINPHONE_PUBLIC void lp_config_destroy(LpConfig *cfg);
 
 /**
  * Retrieves a default configuration item as an integer, given its section, key, and default value.
- *
- * @ingroup misc
  * The default integer value is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC int lp_config_get_default_int(const LpConfig *lpconfig, const char *section, const char *key, int default_value);
 
 /**
  * Retrieves a default configuration item as a 64 bit integer, given its section, key, and default value.
- *
- * @ingroup misc
  * The default integer value is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC int64_t lp_config_get_default_int64(const LpConfig *lpconfig, const char *section, const char *key, int64_t default_value);
 
 /**
  * Retrieves a default configuration item as a float, given its section, key, and default value.
- *
- * @ingroup misc
  * The default float value is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC float lp_config_get_default_float(const LpConfig *lpconfig, const char *section, const char *key, float default_value);
 
 /**
  * Retrieves a default configuration item as a string, given its section, key, and default value.
- *
- * @ingroup misc
  * The default value string is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC const char* lp_config_get_default_string(const LpConfig *lpconfig, const char *section, const char *key, const char *default_value);
 
 /**
  * Retrieves a section parameter item as a string, given its section and key.
- *
- * @ingroup misc
  * The default value string is returned if the config item isn't found.
 **/
 LINPHONE_PUBLIC const char* lp_config_get_section_param_string(const LpConfig *lpconfig, const char *section, const char *key, const char *default_value);
 
-
 /**
  * increment reference count
- * @ingroup misc
 **/
 LINPHONE_PUBLIC LpConfig *lp_config_ref(LpConfig *lpconfig);
 
 /**
  * Decrement reference count, which will eventually free the object.
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_unref(LpConfig *lpconfig);
 
 /**
- * @brief Write a string in a file placed relatively with the Linphone configuration file.
+ * Write a string in a file placed relatively with the Linphone configuration file.
  * @param lpconfig LpConfig instance used as a reference
  * @param filename Name of the file where to write data. The name is relative to the place of the config file
  * @param data String to write
@@ -330,7 +286,7 @@ LINPHONE_PUBLIC void lp_config_unref(LpConfig *lpconfig);
 LINPHONE_PUBLIC void lp_config_write_relative_file(const LpConfig *lpconfig, const char *filename, const char *data);
 
 /**
- * @brief Read a string from a file placed beside the Linphone configuration file
+ * Read a string from a file placed beside the Linphone configuration file
  * @param lpconfig LpConfig instance used as a reference
  * @param filename Name of the file where data will be read from. The name is relative to the place of the config file
  * @param data Buffer where read string will be stored
@@ -348,8 +304,6 @@ LINPHONE_PUBLIC bool_t lp_config_relative_file_exists(const LpConfig *lpconfig,
  * Dumps the LpConfig as XML into a buffer
  * @param[in] lpconfig The LpConfig object
  * @return The buffer that contains the XML dump
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC char* lp_config_dump_as_xml(const LpConfig *lpconfig);
 
@@ -357,67 +311,61 @@ LINPHONE_PUBLIC char* lp_config_dump_as_xml(const LpConfig *lpconfig);
  * Dumps the LpConfig as INI into a buffer
  * @param[in] lpconfig The LpConfig object
  * @return The buffer that contains the config dump
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC char* lp_config_dump(const LpConfig *lpconfig);
 
 /**
  * Retrieves the overwrite flag for a config item
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC bool_t lp_config_get_overwrite_flag_for_entry(const LpConfig *lpconfig, const char *section, const char *key);
 
 /**
  * Sets the overwrite flag for a config item (used when dumping config as xml)
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_overwrite_flag_for_entry(LpConfig *lpconfig, const char *section, const char *key, bool_t value);
 
 /**
  * Retrieves the overwrite flag for a config section
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC bool_t lp_config_get_overwrite_flag_for_section(const LpConfig *lpconfig, const char *section);
 
 /**
  * Sets the overwrite flag for a config section (used when dumping config as xml)
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_overwrite_flag_for_section(LpConfig *lpconfig, const char *section, bool_t value);
 
 /**
  * Retrieves the skip flag for a config item
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC bool_t lp_config_get_skip_flag_for_entry(const LpConfig *lpconfig, const char *section, const char *key);
 
 /**
  * Sets the skip flag for a config item (used when dumping config as xml)
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_skip_flag_for_entry(LpConfig *lpconfig, const char *section, const char *key, bool_t value);
 
 /**
  * Retrieves the skip flag for a config section
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC bool_t lp_config_get_skip_flag_for_section(const LpConfig *lpconfig, const char *section);
 
 /**
  * Sets the skip flag for a config section (used when dumping config as xml)
- *
- * @ingroup misc
 **/
 LINPHONE_PUBLIC void lp_config_set_skip_flag_for_section(LpConfig *lpconfig, const char *section, bool_t value);
 
+/**
+ * Converts a config section into a dictionary.
+ * @return a #LinphoneDictionary with all the keys from a section, or NULL if the section doesn't exist
+ */
+LINPHONE_PUBLIC LinphoneDictionary * lp_config_section_to_dict( const LpConfig* lpconfig, const char* section );
+
+/**
+ * Loads a dictionary into a section of the lpconfig. If the section doesn't exist it is created.
+ * Overwrites existing keys, creates non-existing keys.
+ */
+LINPHONE_PUBLIC void lp_config_load_dict_to_section( LpConfig* lpconfig, const char* section, const LinphoneDictionary* dict);
+
 #ifdef __cplusplus
 }
 #endif
-- 
GitLab