summaryrefslogtreecommitdiff
path: root/include/driver.h
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-06-28 10:27:57 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-06-28 10:27:57 +0200
commitffb18df525c7435ec77ecb5ceac14cb357ca57d7 (patch)
tree89fa5a333ab73ec0388a56cc3801546d0748a92b /include/driver.h
parentabd3d59620a11ba5c9aec630bf28cf04ea6c3cf6 (diff)
downloadconnman-ffb18df525c7435ec77ecb5ceac14cb357ca57d7.tar.gz
connman-ffb18df525c7435ec77ecb5ceac14cb357ca57d7.tar.bz2
connman-ffb18df525c7435ec77ecb5ceac14cb357ca57d7.zip
Add new element infrastructure
Diffstat (limited to 'include/driver.h')
-rw-r--r--include/driver.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
new file mode 100644
index 00000000..3d0ad920
--- /dev/null
+++ b/include/driver.h
@@ -0,0 +1,54 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2007-2008 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_DRIVER_H
+#define __CONNMAN_DRIVER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <connman/element.h>
+
+#define CONNMAN_DRIVER_PRIORITY_LOW -100
+#define CONNMAN_DRIVER_PRIORITY_DEFAULT 0
+#define CONNMAN_DRIVER_PRIORITY_HIGH 100
+
+struct connman_driver {
+ const char *name;
+ enum connman_element_type type;
+ enum connman_element_type subtype;
+ int priority;
+ int (*probe) (struct connman_element *element);
+ void (*remove) (struct connman_element *element);
+ int (*update) (struct connman_element *element);
+ int (*connect) (struct connman_element *element);
+ int (*disconnect) (struct connman_element *element);
+};
+
+extern int connman_driver_register(struct connman_driver *driver);
+extern void connman_driver_unregister(struct connman_driver *driver);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CONNMAN_DRIVER_H */