diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-08-25 11:19:06 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-08-25 11:19:06 +0200 |
commit | 074d489a01de3dfb1fa2b8e9ad48bf42fff1302b (patch) | |
tree | c8a3d9331c9d442e62ee4819c86f8511d5819133 /include | |
parent | 910534c6b94fa23ade84f402e4aca9a9575e390a (diff) | |
download | connman-074d489a01de3dfb1fa2b8e9ad48bf42fff1302b.tar.gz connman-074d489a01de3dfb1fa2b8e9ad48bf42fff1302b.tar.bz2 connman-074d489a01de3dfb1fa2b8e9ad48bf42fff1302b.zip |
Add more advanced properties implementation
Diffstat (limited to 'include')
-rw-r--r-- | include/element.h | 16 | ||||
-rw-r--r-- | include/property.h | 22 |
2 files changed, 22 insertions, 16 deletions
diff --git a/include/element.h b/include/element.h index e2d7ea8a..57103d31 100644 --- a/include/element.h +++ b/include/element.h @@ -73,6 +73,7 @@ struct connman_driver; struct connman_element { gint refcount; GStaticMutex mutex; + gint index; gchar *name; gchar *path; enum connman_element_type type; @@ -89,12 +90,6 @@ struct connman_element { GSList *properties; struct { - int index; - short flags; - gchar *name; - } netdev; - - struct { gchar *identifier; } network; @@ -111,16 +106,19 @@ struct connman_element { #define connman_element_lock(element) g_static_mutex_lock(&(element)->mutex) #define connman_element_unlock(element) g_static_mutex_unlock(&(element)->mutex) -extern struct connman_element *connman_element_create(void); +extern struct connman_element *connman_element_create(const char *name); extern struct connman_element *connman_element_ref(struct connman_element *element); extern void connman_element_unref(struct connman_element *element); extern int connman_element_add_static_property(struct connman_element *element, const char *name, int type, const void *value); +extern int connman_element_define_properties(struct connman_element *element, ...); +extern int connman_element_create_property(struct connman_element *element, + const char *name, int type); extern int connman_element_set_property(struct connman_element *element, - enum connman_property_type type, const void *value); + enum connman_property_id id, const void *value); extern int connman_element_get_value(struct connman_element *element, - enum connman_property_type type, void *value); + enum connman_property_id id, void *value); extern int connman_element_register(struct connman_element *element, struct connman_element *parent); diff --git a/include/property.h b/include/property.h index d3439486..14198bef 100644 --- a/include/property.h +++ b/include/property.h @@ -32,21 +32,29 @@ extern "C" { * @short_description: Functions for handling properties */ -enum connman_property_type { - CONNMAN_PROPERTY_TYPE_INVALID = 0, +enum connman_property_id { + CONNMAN_PROPERTY_ID_INVALID = 0, - CONNMAN_PROPERTY_TYPE_IPV4_ADDRESS, - CONNMAN_PROPERTY_TYPE_IPV4_NETMASK, - CONNMAN_PROPERTY_TYPE_IPV4_GATEWAY, - CONNMAN_PROPERTY_TYPE_IPV4_NAMESERVER, + CONNMAN_PROPERTY_ID_IPV4_METHOD, + CONNMAN_PROPERTY_ID_IPV4_ADDRESS, + CONNMAN_PROPERTY_ID_IPV4_NETMASK, + CONNMAN_PROPERTY_ID_IPV4_GATEWAY, + CONNMAN_PROPERTY_ID_IPV4_NAMESERVER, }; +/** + * connman_property_flags: + * @CONNMAN_PROPERTY_FLAG_STATIC: read-only property + * @CONNMAN_PROPERTY_FLAG_REFERENCE: inheritated value (reference only) + */ enum connman_property_flags { - CONNMAN_PROPERTY_FLAG_STATIC = (1 << 0), + CONNMAN_PROPERTY_FLAG_STATIC = (1 << 0), + CONNMAN_PROPERTY_FLAG_REFERENCE = (1 << 1), }; struct connman_property { enum connman_property_flags flags; + enum connman_property_id id; char *name; int type; void *value; |