diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/protocol.c | 32 | ||||
-rw-r--r-- | src/protocol.h | 22 | ||||
-rw-r--r-- | src/sip-connection-helpers.c | 70 | ||||
-rw-r--r-- | src/sip-connection-helpers.h | 6 | ||||
-rw-r--r-- | src/sip-connection-manager.c | 14 | ||||
-rw-r--r-- | src/sip-connection-manager.h | 28 | ||||
-rw-r--r-- | src/sip-connection-private.h | 10 | ||||
-rw-r--r-- | src/sip-connection.c | 66 | ||||
-rw-r--r-- | src/sip-connection.h | 38 | ||||
-rw-r--r-- | src/telepathy-rakia.c | 6 |
10 files changed, 146 insertions, 146 deletions
diff --git a/src/protocol.c b/src/protocol.c index dfc9ff9..5cb902b 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -31,7 +31,7 @@ #include <rakia/text-manager.h> #include <sofia-sip/su_glib.h> -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" #include "sip-connection.h" #include "sip-connection-helpers.h" @@ -125,7 +125,7 @@ static TpCMParamSpec rakia_params[] = { /* STUN port */ { "stun-port", DBUS_TYPE_UINT16_AS_STRING, G_TYPE_UINT, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, - GUINT_TO_POINTER(TPSIP_DEFAULT_STUN_PORT), PARAM_EASY, + GUINT_TO_POINTER(RAKIA_DEFAULT_STUN_PORT), PARAM_EASY, tp_cm_param_filter_uint_nonzero }, /* If the session content cannot be modified once initially set up */ @@ -158,7 +158,7 @@ static TpCMParamSpec rakia_params[] = { static void rakia_protocol_init (RakiaProtocol *self) { - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TPSIP_TYPE_PROTOCOL, + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, RAKIA_TYPE_PROTOCOL, RakiaProtocolPrivate); } @@ -172,18 +172,18 @@ static RakiaConnectionKeepaliveMechanism priv_parse_keepalive (const gchar *str) { if (str == NULL || strcmp (str, "auto") == 0) - return TPSIP_CONNECTION_KEEPALIVE_AUTO; + return RAKIA_CONNECTION_KEEPALIVE_AUTO; if (strcmp (str, "register") == 0) - return TPSIP_CONNECTION_KEEPALIVE_REGISTER; + return RAKIA_CONNECTION_KEEPALIVE_REGISTER; if (strcmp (str, "options") == 0) - return TPSIP_CONNECTION_KEEPALIVE_OPTIONS; + return RAKIA_CONNECTION_KEEPALIVE_OPTIONS; if (strcmp (str, "stun") == 0) - return TPSIP_CONNECTION_KEEPALIVE_STUN; + return RAKIA_CONNECTION_KEEPALIVE_STUN; if (strcmp (str, "off") == 0) - return TPSIP_CONNECTION_KEEPALIVE_NONE; + return RAKIA_CONNECTION_KEEPALIVE_NONE; WARNING ("unsupported keepalive-method value \"%s\", falling back to auto", str); - return TPSIP_CONNECTION_KEEPALIVE_AUTO; + return RAKIA_CONNECTION_KEEPALIVE_AUTO; } static gchar * @@ -273,7 +273,7 @@ new_connection (TpBaseProtocol *protocol, GHashTable *params, GError **error) { - RakiaProtocol *self = TPSIP_PROTOCOL (protocol); + RakiaProtocol *self = RAKIA_PROTOCOL (protocol); RakiaConnection *conn; guint i; const gchar *account; @@ -290,7 +290,7 @@ new_connection (TpBaseProtocol *protocol, transport = tp_asv_get_string (params, "transport"); port = tp_asv_get_uint32 (params, "port", NULL); - conn = g_object_new (TPSIP_TYPE_CONNECTION, + conn = g_object_new (RAKIA_TYPE_CONNECTION, "protocol", PROTOCOL_NAME, "sofia-root", self->priv->sofia_root, "address", account, @@ -438,8 +438,8 @@ get_connection_details (TpBaseProtocol *self, if (channel_managers != NULL) { GType types[] = { - TPSIP_TYPE_TEXT_MANAGER, - TPSIP_TYPE_MEDIA_MANAGER, + RAKIA_TYPE_TEXT_MANAGER, + RAKIA_TYPE_MEDIA_MANAGER, G_TYPE_INVALID }; *channel_managers = g_memdup (types, sizeof(types)); @@ -478,7 +478,7 @@ rakia_protocol_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - RakiaProtocol *self = TPSIP_PROTOCOL (object); + RakiaProtocol *self = RAKIA_PROTOCOL (object); switch (property_id) { @@ -498,7 +498,7 @@ rakia_protocol_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaProtocol *self = TPSIP_PROTOCOL (object); + RakiaProtocol *self = RAKIA_PROTOCOL (object); switch (property_id) { @@ -542,7 +542,7 @@ rakia_protocol_class_init (RakiaProtocolClass *klass) TpBaseProtocol * rakia_protocol_new (su_root_t *sofia_root) { - return g_object_new (TPSIP_TYPE_PROTOCOL, + return g_object_new (RAKIA_TYPE_PROTOCOL, "name", PROTOCOL_NAME, "sofia-root", sofia_root, NULL); diff --git a/src/protocol.h b/src/protocol.h index c7506ba..a7e9b25 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -17,8 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef TPSIP_PROTOCOL_H -#define TPSIP_PROTOCOL_H +#ifndef RAKIA_PROTOCOL_H +#define RAKIA_PROTOCOL_H #include <glib-object.h> #include <telepathy-glib/base-protocol.h> @@ -47,22 +47,22 @@ struct _RakiaProtocol { GType rakia_protocol_get_type (void); -#define TPSIP_TYPE_PROTOCOL \ +#define RAKIA_TYPE_PROTOCOL \ (rakia_protocol_get_type ()) -#define TPSIP_PROTOCOL(obj) \ +#define RAKIA_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TPSIP_TYPE_PROTOCOL, \ + RAKIA_TYPE_PROTOCOL, \ RakiaProtocol)) -#define TPSIP_PROTOCOL_CLASS(klass) \ +#define RAKIA_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TPSIP_TYPE_PROTOCOL, \ + RAKIA_TYPE_PROTOCOL, \ RakiaProtocolClass)) -#define TPSIP_IS_PROTOCOL_CLASS(klass) \ +#define RAKIA_IS_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TPSIP_TYPE_PROTOCOL)) -#define TPSIP_PROTOCOL_GET_CLASS(klass) \ + RAKIA_TYPE_PROTOCOL)) +#define RAKIA_PROTOCOL_GET_CLASS(klass) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TPSIP_TYPE_PROTOCOL, \ + RAKIA_TYPE_PROTOCOL, \ RakiaProtocolClass)) gchar *rakia_protocol_normalize_contact (const gchar *id, diff --git a/src/sip-connection-helpers.c b/src/sip-connection-helpers.c index 592b540..080aa5f 100644 --- a/src/sip-connection-helpers.c +++ b/src/sip-connection-helpers.c @@ -41,21 +41,21 @@ #include "sip-connection-private.h" -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" /* Default keepalive timeout in seconds, * a value obtained from Sofia-SIP documentation */ -#define TPSIP_CONNECTION_DEFAULT_KEEPALIVE_INTERVAL 120 +#define RAKIA_CONNECTION_DEFAULT_KEEPALIVE_INTERVAL 120 /* The user is not allowed to set keepalive timeout to lower than that, * to avoid wasting traffic and device power */ -#define TPSIP_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL 30 +#define RAKIA_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL 30 /* The user is not allowed to set keepalive timeout to lower than that * for REGISTER keepalives, to avoid wasting traffic and device power. * REGISTER is special because it may tie resources on the server side */ -#define TPSIP_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL_REGISTER 50 +#define RAKIA_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL_REGISTER 50 static sip_to_t * priv_sip_to_url_make (RakiaConnection *conn, @@ -72,7 +72,7 @@ static sip_from_t * priv_sip_from_url_make (RakiaConnection *conn, su_home_t *home) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); sip_from_t *from; gchar *alias = NULL; @@ -106,7 +106,7 @@ nua_handle_t * rakia_conn_create_register_handle (RakiaConnection *conn, TpHandle contact) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); nua_handle_t *result = NULL; su_home_t temphome[1] = { SU_HOME_INIT(temphome) }; sip_to_t *to; @@ -128,7 +128,7 @@ nua_handle_t * rakia_conn_create_request_handle (RakiaConnection *conn, TpHandle contact) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); nua_handle_t *result = NULL; su_home_t temphome[1] = { SU_HOME_INIT(temphome) }; sip_from_t *from; @@ -155,7 +155,7 @@ rakia_conn_create_request_handle (RakiaConnection *conn, void rakia_conn_update_proxy_and_transport (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); if (priv->proxy_url != NULL) { @@ -197,7 +197,7 @@ rakia_conn_update_proxy_and_transport (RakiaConnection *conn) const url_t * rakia_conn_get_local_url (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); url_t *url; url = url_make (priv->sofia_home, "sip:*:*"); @@ -340,7 +340,7 @@ priv_nua_set_outbound_options (nua_t* nua, GHashTable* option_table) void rakia_conn_update_nua_outbound (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); GHashTable *option_table; g_return_if_fail (priv->sofia_nua != NULL); @@ -353,22 +353,22 @@ rakia_conn_update_nua_outbound (RakiaConnection *conn) /* Set options that affect keepalive behavior */ switch (priv->keepalive_mechanism) { - case TPSIP_CONNECTION_KEEPALIVE_NONE: - case TPSIP_CONNECTION_KEEPALIVE_REGISTER: + case RAKIA_CONNECTION_KEEPALIVE_NONE: + case RAKIA_CONNECTION_KEEPALIVE_REGISTER: /* For REGISTER keepalives, we use NUTAG_M_FEATURES */ g_hash_table_insert (option_table, g_strdup ("options-keepalive"), GINT_TO_POINTER(FALSE)); break; - case TPSIP_CONNECTION_KEEPALIVE_OPTIONS: + case RAKIA_CONNECTION_KEEPALIVE_OPTIONS: g_hash_table_insert (option_table, g_strdup ("options-keepalive"), GINT_TO_POINTER(TRUE)); break; - case TPSIP_CONNECTION_KEEPALIVE_STUN: + case RAKIA_CONNECTION_KEEPALIVE_STUN: /* Not supported */ break; - case TPSIP_CONNECTION_KEEPALIVE_AUTO: + case RAKIA_CONNECTION_KEEPALIVE_AUTO: default: break; } @@ -394,9 +394,9 @@ priv_sanitize_keepalive_interval (RakiaConnectionPrivate *priv) if (priv->keepalive_interval != 0) { minimum_interval = - (priv->keepalive_mechanism == TPSIP_CONNECTION_KEEPALIVE_REGISTER) - ? TPSIP_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL_REGISTER - : TPSIP_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL; + (priv->keepalive_mechanism == RAKIA_CONNECTION_KEEPALIVE_REGISTER) + ? RAKIA_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL_REGISTER + : RAKIA_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL; if (priv->keepalive_interval < minimum_interval) { WARNING ("keepalive interval is too low, pushing to %u", minimum_interval); @@ -408,13 +408,13 @@ priv_sanitize_keepalive_interval (RakiaConnectionPrivate *priv) void rakia_conn_update_nua_keepalive_interval (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); long keepalive_interval; if (!priv->keepalive_interval_specified) return; - if (priv->keepalive_mechanism == TPSIP_CONNECTION_KEEPALIVE_NONE) + if (priv->keepalive_mechanism == RAKIA_CONNECTION_KEEPALIVE_NONE) keepalive_interval = 0; else { @@ -434,11 +434,11 @@ rakia_conn_update_nua_keepalive_interval (RakiaConnection *conn) void rakia_conn_update_nua_contact_features (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); char *contact_features; guint timeout; - if (priv->keepalive_mechanism != TPSIP_CONNECTION_KEEPALIVE_REGISTER) + if (priv->keepalive_mechanism != RAKIA_CONNECTION_KEEPALIVE_REGISTER) return; if (priv->keepalive_interval == 0) @@ -447,7 +447,7 @@ rakia_conn_update_nua_contact_features (RakiaConnection *conn) priv_sanitize_keepalive_interval (priv); timeout = priv->keepalive_interval_specified ? priv->keepalive_interval - : TPSIP_CONNECTION_DEFAULT_KEEPALIVE_INTERVAL; + : RAKIA_CONNECTION_DEFAULT_KEEPALIVE_INTERVAL; contact_features = g_strdup_printf ("expires=%u", timeout); nua_set_params(priv->sofia_nua, NUTAG_M_FEATURES(contact_features), @@ -458,7 +458,7 @@ rakia_conn_update_nua_contact_features (RakiaConnection *conn) static void rakia_conn_set_stun_server_address (RakiaConnection *conn, const gchar *address) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); g_return_if_fail (priv->media_manager != NULL); g_object_set (priv->media_manager, "stun-server", address, @@ -469,8 +469,8 @@ rakia_conn_set_stun_server_address (RakiaConnection *conn, const gchar *address) static void priv_stun_resolver_cb (sres_context_t *ctx, sres_query_t *query, sres_record_t **answers) { - RakiaConnection *conn = TPSIP_CONNECTION (ctx); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnection *conn = RAKIA_CONNECTION (ctx); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); sres_a_record_t *ans = NULL; if (NULL != answers) @@ -507,7 +507,7 @@ priv_stun_resolver_cb (sres_context_t *ctx, sres_query_t *query, sres_record_t * void rakia_conn_resolv_stun_server (RakiaConnection *conn, const gchar *stun_host) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); struct in_addr test_addr; if (stun_host == NULL) @@ -548,8 +548,8 @@ priv_stun_discover_cb (sres_context_t *ctx, sres_query_t *query, sres_record_t **answers) { - RakiaConnection *conn = TPSIP_CONNECTION (ctx); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnection *conn = RAKIA_CONNECTION (ctx); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); sres_srv_record_t *sel = NULL; int n_sel_items = 0; int i; @@ -643,7 +643,7 @@ priv_stun_discover_cb (sres_context_t *ctx, void rakia_conn_discover_stun_server (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); const char *url_host; char *srv_domain; struct in_addr test_addr; @@ -694,8 +694,8 @@ rakia_handle_normalize (TpHandleRepoIface *repo, gpointer context, GError **error) { - RakiaConnection *conn = TPSIP_CONNECTION (context); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnection *conn = RAKIA_CONNECTION (context); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); return rakia_normalize_contact (sipuri, priv->account_url, priv->transport, error); @@ -757,7 +757,7 @@ heartbeat_wakeup (su_root_magic_t *foo, void *user_data) { RakiaConnection *self = (RakiaConnection *) user_data; - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); DEBUG("tick"); @@ -781,7 +781,7 @@ void rakia_conn_heartbeat_init (RakiaConnection *self) { #ifdef HAVE_LIBIPHB - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); int wait_id; int reference_interval = 0; su_root_t *root = NULL; @@ -822,7 +822,7 @@ void rakia_conn_heartbeat_shutdown (RakiaConnection *self) { #ifdef HAVE_LIBIPHB - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); su_root_t *root = NULL; if (priv->heartbeat_wait_id == 0) diff --git a/src/sip-connection-helpers.h b/src/sip-connection-helpers.h index 29ed642..49f2f98 100644 --- a/src/sip-connection-helpers.h +++ b/src/sip-connection-helpers.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_HELPERS_H__ -#define __TPSIP_CONNECTION_HELPERS_H__ +#ifndef __RAKIA_CONNECTION_HELPERS_H__ +#define __RAKIA_CONNECTION_HELPERS_H__ #include <glib.h> @@ -59,4 +59,4 @@ void rakia_conn_heartbeat_shutdown (RakiaConnection *self); G_END_DECLS -#endif /* #ifndef __TPSIP_CONNECTION_HELPERS_H__*/ +#endif /* #ifndef __RAKIA_CONNECTION_HELPERS_H__*/ diff --git a/src/sip-connection-manager.c b/src/sip-connection-manager.c index e64cf56..2fd8efe 100644 --- a/src/sip-connection-manager.c +++ b/src/sip-connection-manager.c @@ -42,7 +42,7 @@ #include "sip-connection-manager.h" #include "sip-connection.h" -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" @@ -55,13 +55,13 @@ struct _RakiaConnectionManagerPrivate TpDebugSender *debug_sender; }; -#define TPSIP_CONNECTION_MANAGER_GET_PRIVATE(obj) ((obj)->priv) +#define RAKIA_CONNECTION_MANAGER_GET_PRIVATE(obj) ((obj)->priv) static void rakia_connection_manager_init (RakiaConnectionManager *obj) { RakiaConnectionManagerPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj, - TPSIP_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerPrivate); + RAKIA_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerPrivate); GSource *source; obj->priv = priv; @@ -75,14 +75,14 @@ rakia_connection_manager_init (RakiaConnectionManager *obj) g_log_set_default_handler (tp_debug_sender_log_handler, G_LOG_DOMAIN); #ifdef HAVE_LIBIPHB - su_root_set_max_defer (priv->sofia_root, TPSIP_DEFER_TIMEOUT * 1000L); + su_root_set_max_defer (priv->sofia_root, RAKIA_DEFER_TIMEOUT * 1000L); #endif } static void rakia_connection_manager_constructed (GObject *object) { - RakiaConnectionManager *self = TPSIP_CONNECTION_MANAGER (object); + RakiaConnectionManager *self = RAKIA_CONNECTION_MANAGER (object); TpBaseConnectionManager *base = (TpBaseConnectionManager *) self; void (*constructed) (GObject *) = ((GObjectClass *) rakia_connection_manager_parent_class)->constructed; @@ -116,8 +116,8 @@ rakia_connection_manager_class_init (RakiaConnectionManagerClass *klass) void rakia_connection_manager_finalize (GObject *object) { - RakiaConnectionManager *self = TPSIP_CONNECTION_MANAGER (object); - RakiaConnectionManagerPrivate *priv = TPSIP_CONNECTION_MANAGER_GET_PRIVATE (self); + RakiaConnectionManager *self = RAKIA_CONNECTION_MANAGER (object); + RakiaConnectionManagerPrivate *priv = RAKIA_CONNECTION_MANAGER_GET_PRIVATE (self); GSource *source; source = su_glib_root_gsource(priv->sofia_root); diff --git a/src/sip-connection-manager.h b/src/sip-connection-manager.h index 1def40a..ed89900 100644 --- a/src/sip-connection-manager.h +++ b/src/sip-connection-manager.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_MANAGER_H__ -#define __TPSIP_CONNECTION_MANAGER_H__ +#ifndef __RAKIA_CONNECTION_MANAGER_H__ +#define __RAKIA_CONNECTION_MANAGER_H__ #include <glib-object.h> @@ -43,21 +43,21 @@ struct _RakiaConnectionManager { GType rakia_connection_manager_get_type(void); /* TYPE MACROS */ -#define TPSIP_TYPE_CONNECTION_MANAGER \ +#define RAKIA_TYPE_CONNECTION_MANAGER \ (rakia_connection_manager_get_type()) -#define TPSIP_CONNECTION_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_CONNECTION_MANAGER, RakiaConnectionManager)) -#define TPSIP_CONNECTION_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerClass)) -#define TPSIP_IS_CONNECTION_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_CONNECTION_MANAGER)) -#define TPSIP_IS_CONNECTION_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_CONNECTION_MANAGER)) -#define TPSIP_CONNECTION_MANAGER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerClass)) +#define RAKIA_CONNECTION_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_CONNECTION_MANAGER, RakiaConnectionManager)) +#define RAKIA_CONNECTION_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerClass)) +#define RAKIA_IS_CONNECTION_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_CONNECTION_MANAGER)) +#define RAKIA_IS_CONNECTION_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_CONNECTION_MANAGER)) +#define RAKIA_CONNECTION_MANAGER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerClass)) extern const TpCMProtocolSpec rakia_protocols[]; G_END_DECLS -#endif /* #ifndef __TPSIP_CONNECTION_MANAGER_H__*/ +#endif /* #ifndef __RAKIA_CONNECTION_MANAGER_H__*/ diff --git a/src/sip-connection-private.h b/src/sip-connection-private.h index 4d25d51..9a572aa 100644 --- a/src/sip-connection-private.h +++ b/src/sip-connection-private.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_PRIVATE_H__ -#define __TPSIP_CONNECTION_PRIVATE_H__ +#ifndef __RAKIA_CONNECTION_PRIVATE_H__ +#define __RAKIA_CONNECTION_PRIVATE_H__ #include "config.h" @@ -78,8 +78,8 @@ struct _RakiaConnectionPrivate gboolean dispose_has_run; }; -/* #define TPSIP_PROTOCOL_STRING "sip" */ +/* #define RAKIA_PROTOCOL_STRING "sip" */ -#define TPSIP_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPSIP_TYPE_CONNECTION, RakiaConnectionPrivate)) +#define RAKIA_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RAKIA_TYPE_CONNECTION, RakiaConnectionPrivate)) -#endif /*__TPSIP_CONNECTION_PRIVATE_H__*/ +#endif /*__RAKIA_CONNECTION_PRIVATE_H__*/ diff --git a/src/sip-connection.c b/src/sip-connection.c index 84aa2d7..c611512 100644 --- a/src/sip-connection.c +++ b/src/sip-connection.c @@ -50,16 +50,16 @@ #include <sofia-sip/msg_header.h> #include <sofia-sip/tport_tag.h> -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" G_DEFINE_TYPE_WITH_CODE (RakiaConnection, rakia_connection, - TPSIP_TYPE_BASE_CONNECTION, + RAKIA_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING, rakia_connection_aliasing_svc_iface_init); - G_IMPLEMENT_INTERFACE (TPSIP_TYPE_CONNECTION_ALIASING, NULL); + G_IMPLEMENT_INTERFACE (RAKIA_TYPE_CONNECTION_ALIASING, NULL); ); @@ -134,15 +134,15 @@ rakia_create_handle_repos (TpBaseConnection *conn, static GPtrArray * rakia_connection_create_channel_managers (TpBaseConnection *conn) { - RakiaConnection *self = TPSIP_CONNECTION (conn); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnection *self = RAKIA_CONNECTION (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); GPtrArray *channel_managers = g_ptr_array_sized_new (2); g_ptr_array_add (channel_managers, - g_object_new (TPSIP_TYPE_TEXT_MANAGER, + g_object_new (RAKIA_TYPE_TEXT_MANAGER, "connection", self, NULL)); - priv->media_manager = g_object_new (TPSIP_TYPE_MEDIA_MANAGER, + priv->media_manager = g_object_new (RAKIA_TYPE_MEDIA_MANAGER, "connection", self, NULL); g_ptr_array_add (channel_managers, priv->media_manager); @@ -156,7 +156,7 @@ rakia_connection_create_channel_managers (TpBaseConnection *conn) static void rakia_connection_init (RakiaConnection *self) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); priv->sofia_home = su_home_new(sizeof (su_home_t)); @@ -170,7 +170,7 @@ rakia_connection_set_property (GObject *object, GParamSpec *pspec) { RakiaConnection *self = (RakiaConnection*) object; - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); switch (property_id) { case PROP_ADDRESS: { @@ -218,8 +218,8 @@ rakia_connection_set_property (GObject *object, RakiaConnectionKeepaliveMechanism mech = g_value_get_enum (value); if (priv->keepalive_interval_specified && priv->keepalive_interval == 0) { - if (mech != TPSIP_CONNECTION_KEEPALIVE_NONE - && mech != TPSIP_CONNECTION_KEEPALIVE_AUTO) + if (mech != RAKIA_CONNECTION_KEEPALIVE_NONE + && mech != RAKIA_CONNECTION_KEEPALIVE_AUTO) WARNING ("keep-alive mechanism selection is ignored when interval is 0"); } else @@ -238,7 +238,7 @@ rakia_connection_set_property (GObject *object, priv->keepalive_interval_specified = TRUE; if (priv->keepalive_interval == 0) { - priv->keepalive_mechanism = TPSIP_CONNECTION_KEEPALIVE_NONE; + priv->keepalive_mechanism = RAKIA_CONNECTION_KEEPALIVE_NONE; if (priv->sofia_nua != NULL) rakia_conn_update_nua_outbound (self); } @@ -305,7 +305,7 @@ rakia_connection_get_property (GObject *object, GParamSpec *pspec) { RakiaConnection *self = (RakiaConnection *) object; - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); switch (property_id) { case PROP_ADDRESS: { @@ -396,11 +396,11 @@ static void rakia_connection_finalize (GObject *object); static gchar * rakia_connection_unique_name (TpBaseConnection *base) { - RakiaConnection *conn = TPSIP_CONNECTION (base); + RakiaConnection *conn = RAKIA_CONNECTION (base); RakiaConnectionPrivate *priv; - g_assert (TPSIP_IS_CONNECTION (conn)); - priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + g_assert (RAKIA_IS_CONNECTION (conn)); + priv = RAKIA_CONNECTION_GET_PRIVATE (conn); return g_strdup (priv->address); } @@ -432,7 +432,7 @@ rakia_connection_class_init (RakiaConnectionClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); TpBaseConnectionClass *base_class = TP_BASE_CONNECTION_CLASS (klass); - RakiaBaseConnectionClass *sip_class = TPSIP_BASE_CONNECTION_CLASS (klass); + RakiaBaseConnectionClass *sip_class = RAKIA_BASE_CONNECTION_CLASS (klass); GParamSpec *param_spec; /* Implement pure-virtual methods */ @@ -510,7 +510,7 @@ rakia_connection_class_init (RakiaConnectionClass *klass) param_spec = g_param_spec_enum ("keepalive-mechanism", "Keepalive mechanism", "Keepalive mechanism for SIP registration", rakia_connection_keepalive_mechanism_get_type (), - TPSIP_CONNECTION_KEEPALIVE_AUTO, /*default value*/ + RAKIA_CONNECTION_KEEPALIVE_AUTO, /*default value*/ G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); INST_PROP(PROP_KEEPALIVE_MECHANISM); @@ -543,7 +543,7 @@ rakia_connection_class_init (RakiaConnectionClass *klass) param_spec = g_param_spec_uint ("stun-port", "STUN port", "STUN server port", 0, G_MAXUINT16, - TPSIP_DEFAULT_STUN_PORT, /*default value*/ + RAKIA_DEFAULT_STUN_PORT, /*default value*/ G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); INST_PROP(PROP_STUN_PORT); @@ -646,7 +646,7 @@ priv_handle_auth (RakiaConnection* self, const sip_t *sip, gboolean home_realm) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); sip_www_authenticate_t const *wa; sip_proxy_authenticate_t const *pa; const char *method = NULL; @@ -783,7 +783,7 @@ priv_password_manager_prompt_cb (GObject *source_object, else { RakiaConnectionPrivate *priv = - TPSIP_CONNECTION_GET_PRIVATE (data->self); + RAKIA_CONNECTION_GET_PRIVATE (data->self); password = password_string->str; /* also save it for later. */ @@ -856,7 +856,7 @@ rakia_connection_add_auth_handler (RakiaBaseConnection *self, static nua_handle_t * rakia_connection_create_nua_handle (RakiaBaseConnection *base, TpHandle handle) { - return rakia_conn_create_request_handle (TPSIP_CONNECTION (base), handle); + return rakia_conn_create_request_handle (RAKIA_CONNECTION (base), handle); } static gboolean @@ -913,12 +913,12 @@ rakia_connection_nua_r_register_cb (RakiaConnection *self, static void rakia_connection_shut_down (TpBaseConnection *base) { - RakiaConnection *self = TPSIP_CONNECTION (base); + RakiaConnection *self = RAKIA_CONNECTION (base); RakiaConnectionPrivate *priv; DEBUG ("enter"); - priv = TPSIP_CONNECTION_GET_PRIVATE (self); + priv = RAKIA_CONNECTION_GET_PRIVATE (self); /* We disposed of the REGISTER handle in the disconnected method */ g_assert (priv->register_op == NULL); @@ -936,9 +936,9 @@ rakia_connection_shut_down (TpBaseConnection *base) void rakia_connection_dispose (GObject *object) { - RakiaConnection *self = TPSIP_CONNECTION (object); + RakiaConnection *self = RAKIA_CONNECTION (object); TpBaseConnection *base = (TpBaseConnection *)self; - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); if (priv->dispose_has_run) return; @@ -965,8 +965,8 @@ rakia_connection_dispose (GObject *object) void rakia_connection_finalize (GObject *obj) { - RakiaConnection *self = TPSIP_CONNECTION (obj); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnection *self = RAKIA_CONNECTION (obj); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); /* free any data held directly by the object here */ @@ -1002,8 +1002,8 @@ static gboolean rakia_connection_start_connecting (TpBaseConnection *base, GError **error) { - RakiaConnection *self = TPSIP_CONNECTION (base); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnection *self = RAKIA_CONNECTION (base); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); TpHandleRepoIface *contact_repo; const gchar *sip_address; const url_t *local_url; @@ -1041,7 +1041,7 @@ rakia_connection_start_connecting (TpBaseConnection *base, /* step: create stack instance */ priv->sofia_nua = nua_create (root, rakia_base_connection_sofia_callback, - TPSIP_BASE_CONNECTION (self), + RAKIA_BASE_CONNECTION (self), SOATAG_AF(SOA_AF_IP4_IP6), SIPTAG_FROM_STR(sip_address), NUTAG_URL(local_url), @@ -1112,10 +1112,10 @@ rakia_connection_start_connecting (TpBaseConnection *base, static void rakia_connection_disconnected (TpBaseConnection *base) { - RakiaConnection *obj = TPSIP_CONNECTION (base); + RakiaConnection *obj = RAKIA_CONNECTION (base); RakiaConnectionPrivate *priv; - priv = TPSIP_CONNECTION_GET_PRIVATE (obj); + priv = RAKIA_CONNECTION_GET_PRIVATE (obj); DEBUG("enter"); diff --git a/src/sip-connection.h b/src/sip-connection.h index 5e79773..8f26bd5 100644 --- a/src/sip-connection.h +++ b/src/sip-connection.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_H__ -#define __TPSIP_CONNECTION_H__ +#ifndef __RAKIA_CONNECTION_H__ +#define __RAKIA_CONNECTION_H__ #include <glib-object.h> @@ -30,11 +30,11 @@ G_BEGIN_DECLS typedef enum { - TPSIP_CONNECTION_KEEPALIVE_AUTO = 0, /** Keepalive management is up to the implementation */ - TPSIP_CONNECTION_KEEPALIVE_NONE, /** Disable keepalive management */ - TPSIP_CONNECTION_KEEPALIVE_REGISTER, /** Maintain registration with REGISTER requests */ - TPSIP_CONNECTION_KEEPALIVE_OPTIONS, /** Maintain registration with OPTIONS requests */ - TPSIP_CONNECTION_KEEPALIVE_STUN, /** Maintain registration with STUN as described in IETF draft-sip-outbound */ + RAKIA_CONNECTION_KEEPALIVE_AUTO = 0, /** Keepalive management is up to the implementation */ + RAKIA_CONNECTION_KEEPALIVE_NONE, /** Disable keepalive management */ + RAKIA_CONNECTION_KEEPALIVE_REGISTER, /** Maintain registration with REGISTER requests */ + RAKIA_CONNECTION_KEEPALIVE_OPTIONS, /** Maintain registration with OPTIONS requests */ + RAKIA_CONNECTION_KEEPALIVE_STUN, /** Maintain registration with STUN as described in IETF draft-sip-outbound */ } RakiaConnectionKeepaliveMechanism; typedef struct _RakiaConnection RakiaConnection; @@ -51,18 +51,18 @@ struct _RakiaConnection { }; /* TYPE MACROS */ -#define TPSIP_TYPE_CONNECTION \ +#define RAKIA_TYPE_CONNECTION \ (rakia_connection_get_type()) -#define TPSIP_CONNECTION(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_CONNECTION, RakiaConnection)) -#define TPSIP_CONNECTION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_CONNECTION, RakiaConnectionClass)) -#define TPSIP_IS_CONNECTION(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_CONNECTION)) -#define TPSIP_IS_CONNECTION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_CONNECTION)) -#define TPSIP_CONNECTION_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_CONNECTION, RakiaConnectionClass)) +#define RAKIA_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_CONNECTION, RakiaConnection)) +#define RAKIA_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_CONNECTION, RakiaConnectionClass)) +#define RAKIA_IS_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_CONNECTION)) +#define RAKIA_IS_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_CONNECTION)) +#define RAKIA_CONNECTION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_CONNECTION, RakiaConnectionClass)) GType rakia_connection_get_type (void) G_GNUC_CONST; @@ -73,4 +73,4 @@ const gchar **rakia_connection_get_implemented_interfaces (void); G_END_DECLS -#endif /* #ifndef __TPSIP_CONNECTION_H__*/ +#endif /* #ifndef __RAKIA_CONNECTION_H__*/ diff --git a/src/telepathy-rakia.c b/src/telepathy-rakia.c index 76dffe7..7012a23 100644 --- a/src/telepathy-rakia.c +++ b/src/telepathy-rakia.c @@ -36,7 +36,7 @@ static TpBaseConnectionManager * construct_cm (void) { return (TpBaseConnectionManager *)g_object_new ( - TPSIP_TYPE_CONNECTION_MANAGER, NULL); + RAKIA_TYPE_CONNECTION_MANAGER, NULL); } @@ -55,12 +55,12 @@ main (int argc, char** argv) rakia_debug_set_flags_from_env (); #endif - if (g_getenv ("TPSIP_PERSIST") || g_getenv ("RAKIA_PERSIST")) + if (g_getenv ("RAKIA_PERSIST") || g_getenv ("RAKIA_PERSIST")) { tp_debug_set_persistent (TRUE); } - tp_debug_divert_messages (g_getenv ("TPSIP_LOGFILE")); + tp_debug_divert_messages (g_getenv ("RAKIA_LOGFILE")); logdata = rakia_sofia_log_init (); |