summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-11-12 12:07:36 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-23 10:58:51 (GMT)
commit2023b90de4066fe2cf28b48bfca58c35c92aab20 (patch)
tree3851fcd87a156051c7c66c0276d72a5f44ef78b0 /include
parent8bcd6b1b075bf2024ce2ba422e1f19d2f9f24652 (diff)
downloadconnman-2023b90de4066fe2cf28b48bfca58c35c92aab20.zip
connman-2023b90de4066fe2cf28b48bfca58c35c92aab20.tar.gz
connman-2023b90de4066fe2cf28b48bfca58c35c92aab20.tar.bz2
agent: Split agent code into generic and service specific parts
Diffstat (limited to 'include')
-rw-r--r--include/agent.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/include/agent.h b/include/agent.h
new file mode 100644
index 0000000..a084194
--- /dev/null
+++ b/include/agent.h
@@ -0,0 +1,73 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2012 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
+ *
+ */
+
+#ifndef __CONNMAN_AGENT_H
+#define __CONNMAN_AGENT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * SECTION:agent
+ * @title: agent primitives
+ * @short_description: Functions for handling generic agent details
+ */
+
+struct connman_agent;
+
+struct connman_agent_driver {
+ const char *name;
+ const char *interface;
+ int priority;
+ int (*probe) (struct connman_agent *agent);
+ void (*remove) (struct connman_agent *agent);
+ void * (*context_ref) (void *user_context);
+ void (*context_unref) (void *user_context);
+};
+
+int connman_agent_driver_register(struct connman_agent_driver *driver);
+void connman_agent_driver_unregister(struct connman_agent_driver *driver);
+
+typedef void (* report_error_cb_t) (void *user_context,
+ gboolean retry, void *user_data);
+
+int connman_agent_report_error(void *user_context, const char *path,
+ const char *error,
+ report_error_cb_t callback, void *user_data);
+
+int connman_agent_register(const char *sender, const char *path);
+int connman_agent_unregister(const char *sender, const char *path);
+void connman_agent_cancel(void *user_context);
+
+typedef void (*agent_queue_cb)(DBusMessage *reply, void *user_data);
+
+int connman_agent_queue_message(void *user_context,
+ DBusMessage *msg, int timeout,
+ agent_queue_cb callback, void *user_data);
+
+void connman_agent_get_info(const char **sender, const char **path);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CONNMAN_TECHNOLOGY_H */