sbin_PROGRAMS = connmand
-connmand_SOURCES = main.c connman.h manager.c plugin.c \
+connmand_SOURCES = main.c connman.h manager.c agent.c plugin.c \
iface.c iface-storage.c iface-helper.c \
iface-inet.c rtnl.c dhcp.c
--- /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 "connman.h"
+
+int __connman_agent_init(void)
+{
+ DBG("");
+
+ return 0;
+}
+
+void __connman_agent_cleanup(void)
+{
+ DBG("");
+}
+
+int __connman_agent_register(const char *path)
+{
+ DBG("");
+
+ return 0;
+}
+
+int __connman_agent_unregister(const char *path)
+{
+ DBG("");
+
+ return 0;
+}
int __connman_manager_init(DBusConnection *conn, int compat);
void __connman_manager_cleanup(void);
+int __connman_agent_init(void);
+void __connman_agent_cleanup(void);
+
+int __connman_agent_register(const char *path);
+int __connman_agent_unregister(const char *path);
+
#include <connman/plugin.h>
int __connman_plugin_init(void);
compat = 0;
}
+ __connman_agent_init();
+
__connman_manager_init(conn, compat);
__connman_plugin_init();
__connman_manager_cleanup();
+ __connman_agent_cleanup();
+
g_dbus_cleanup_connection(conn);
g_main_loop_unref(main_loop);
return reply;
}
+static DBusMessage *register_agent(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ DBusMessage *reply;
+ const char *path;
+
+ DBG("conn %p", conn);
+
+ dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path,
+ DBUS_TYPE_INVALID);
+
+ reply = dbus_message_new_method_return(msg);
+ if (reply == NULL)
+ return NULL;
+
+ dbus_message_append_args(reply, DBUS_TYPE_INVALID);
+
+ __connman_agent_register(path);
+
+ return reply;
+}
+
+static DBusMessage *unregister_agent(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ DBusMessage *reply;
+ const char *path;
+
+ DBG("conn %p", conn);
+
+ dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path,
+ DBUS_TYPE_INVALID);
+
+ reply = dbus_message_new_method_return(msg);
+ if (reply == NULL)
+ return NULL;
+
+ dbus_message_append_args(reply, DBUS_TYPE_INVALID);
+
+ __connman_agent_unregister(path);
+
+ return reply;
+}
+
static GDBusMethodTable manager_methods[] = {
- { "ListInterfaces", "", "ao", list_interfaces },
- { "GetState", "", "s", get_state },
+ { "ListInterfaces", "", "ao", list_interfaces },
+ { "GetState", "", "s", get_state },
+ { "RegisterAgent", "o", "", register_agent },
+ { "UnregisterAgent", "o", "", unregister_agent },
{ },
};