#define CONNMAN_IFACE_BASEPATH "/interface"
#define CONNMAN_IFACE_INTERFACE CONNMAN_SERVICE ".Interface"
+int __connman_manager_init(DBusConnection *conn);
+void __connman_manager_cleanup(void);
+
#include <connman/plugin.h>
int __connman_plugin_init(void);
exit(1);
}
- g_dbus_register_object(conn, CONNMAN_MANAGER_PATH, NULL, NULL);
+ __connman_manager_init(conn);
__connman_plugin_init();
__connman_plugin_cleanup();
- g_dbus_unregister_object(conn, CONNMAN_MANAGER_PATH);
+ __connman_manager_cleanup();
g_dbus_cleanup_connection(conn);
--- /dev/null
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2007 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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 St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gdbus.h>
+
+#include "connman.h"
+
+static DBusConnection *connection = NULL;
+
+int __connman_manager_init(DBusConnection *conn)
+{
+ DBG("conn %p", conn);
+
+ connection = dbus_connection_ref(conn);
+ if (connection == NULL)
+ return -1;
+
+ g_dbus_register_object(connection, CONNMAN_MANAGER_PATH, NULL, NULL);
+
+ return 0;
+}
+
+void __connman_manager_cleanup(void)
+{
+ DBG("conn %p", connection);
+
+ g_dbus_unregister_object(connection, CONNMAN_MANAGER_PATH);
+
+ dbus_connection_unref(connection);
+}