summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-08-13 08:40:23 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-08-30 10:01:49 (GMT)
commitc7cd2709d524d8e5d7ee2f6ec1eff2166b4f1239 (patch)
treeee15ed8f7b2a5b994c627504ebaefeb68d389826 /plugins
parent3754e3487c99d2ddd5a5bd672daeca150fda1398 (diff)
downloadconnman-c7cd2709d524d8e5d7ee2f6ec1eff2166b4f1239.zip
connman-c7cd2709d524d8e5d7ee2f6ec1eff2166b4f1239.tar.gz
connman-c7cd2709d524d8e5d7ee2f6ec1eff2166b4f1239.tar.bz2
session: Add configuration plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/session_default.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/plugins/session_default.c b/plugins/session_default.c
new file mode 100644
index 0000000..0c01139
--- /dev/null
+++ b/plugins/session_default.c
@@ -0,0 +1,76 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2012 BMW Car IT GbmH. 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 <errno.h>
+#include <string.h>
+
+#define CONNMAN_API_SUBJECT_TO_CHANGE
+#include <connman/plugin.h>
+#include <connman/log.h>
+#include <connman/session.h>
+
+static int config_get_bool(const char *id, const char *key, connman_bool_t *val)
+{
+ DBG("id %s key %s", id, key);
+
+ *val = FALSE;
+
+ return -EINVAL;
+}
+
+static int config_get_string(const char *id, const char *key, char **val)
+{
+ DBG("id %s key %s", id, key);
+
+ *val = NULL;
+
+ return -EINVAL;
+}
+
+static struct connman_session_config session_config = {
+ .name = "session default configuration",
+ .get_bool = config_get_bool,
+ .get_string = config_get_string,
+};
+
+static int session_config_init(void)
+{
+ int err;
+
+ err = connman_session_config_register(&session_config);
+ if (err < 0)
+ return err;
+
+ return 0;
+}
+
+static void session_config_exit(void)
+{
+ connman_session_config_unregister(&session_config);
+}
+
+CONNMAN_PLUGIN_DEFINE(session_default, "Session default configuration plugin",
+ VERSION, CONNMAN_PLUGIN_PRIORITY_DEFAULT,
+ session_config_init, session_config_exit)