summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMohamed Abbas <mohamed.abbas@intel.com>2009-12-08 11:53:06 -0800
committerMarcel Holtmann <marcel@holtmann.org>2009-12-09 00:13:50 +0100
commitcc3921c058080b2b9f6935ebb58f808e3fec261c (patch)
tree7decd0f7a1584001cc6dced633b203648549dd71 /include
parent424c620a3248b8850d839997d08336a7cf15818d (diff)
downloadconnman-cc3921c058080b2b9f6935ebb58f808e3fec261c.tar.gz
connman-cc3921c058080b2b9f6935ebb58f808e3fec261c.tar.bz2
connman-cc3921c058080b2b9f6935ebb58f808e3fec261c.zip
Add initial support for provider framework
Diffstat (limited to 'include')
-rw-r--r--include/dbus.h1
-rw-r--r--include/provider.h59
2 files changed, 60 insertions, 0 deletions
diff --git a/include/dbus.h b/include/dbus.h
index 5bc8288a..dce7af09 100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -43,6 +43,7 @@ extern "C" {
#define CONNMAN_DEVICE_INTERFACE CONNMAN_SERVICE ".Device"
#define CONNMAN_NETWORK_INTERFACE CONNMAN_SERVICE ".Network"
#define CONNMAN_CONNECTION_INTERFACE CONNMAN_SERVICE ".Connection"
+#define CONNMAN_PROVIDER_INTERFACE CONNMAN_SERVICE ".Provider"
DBusConnection *connman_dbus_get_connection(void);
diff --git a/include/provider.h b/include/provider.h
index 7e5d618e..81f7a19c 100644
--- a/include/provider.h
+++ b/include/provider.h
@@ -22,6 +22,8 @@
#ifndef __CONNMAN_PROVIDER_H
#define __CONNMAN_PROVIDER_H
+#include <connman/types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -32,6 +34,63 @@ extern "C" {
* @short_description: Functions for handling providers
*/
+enum connman_provider_state {
+ CONNMAN_PROVIDER_STATE_UNKNOWN = 0,
+ CONNMAN_PROVIDER_STATE_IDLE = 1,
+ CONNMAN_PROVIDER_STATE_CONNECT = 2,
+ CONNMAN_PROVIDER_STATE_READY = 3,
+ CONNMAN_PROVIDER_STATE_DISCONNECT = 4,
+ CONNMAN_PROVIDER_STATE_FAILURE = 5,
+};
+
+enum connman_provider_error {
+ CONNMAN_PROVIDER_ERROR_UNKNOWN = 0,
+ CONNMAN_PROVIDER_ERROR_CONNECT_FAILED = 1,
+};
+
+
+struct connman_provider;
+
+struct connman_provider *connman_provider_ref(struct connman_provider *provider);
+void connman_provider_unref(struct connman_provider *provider);
+
+int connman_provider_set_string(struct connman_provider *provider,
+ const char *key, const char *value);
+const char *connman_provider_get_string(struct connman_provider *provider,
+ const char *key);
+
+int connman_provider_set_connected(struct connman_provider *provider,
+ connman_bool_t connected);
+
+void connman_provider_set_index(struct connman_provider *provider, int index);
+int connman_provider_get_index(struct connman_provider *provider);
+
+void connman_provider_set_data(struct connman_provider *provider, void *data);
+void *connman_provider_get_data(struct connman_provider *provider);
+
+void connman_provider_set_gateway(struct connman_provider *provider,
+ const char *gateway);
+void connman_provider_set_address(struct connman_provider *provider,
+ const char *address);
+void connman_provider_set_netmask(struct connman_provider *provider,
+ const char *netmask);
+void connman_provider_set_dns(struct connman_provider *provider,
+ const char *dns);
+void connman_provider_set_domain(struct connman_provider *provider,
+ const char *domain);
+
+
+struct connman_provider_driver {
+ const char *name;
+ int (*probe) (struct connman_provider *provider);
+ int (*remove) (struct connman_provider *provider);
+ int (*connect) (struct connman_provider *provider);
+ int (*disconnect) (struct connman_provider *provider);
+};
+
+int connman_provider_driver_register(struct connman_provider_driver *driver);
+void connman_provider_driver_unregister(struct connman_provider_driver *driver);
+
#ifdef __cplusplus
}
#endif