#include <connman/property.h>
+/**
+ * SECTION:element
+ * @title: Element premitives
+ * @short_description: Functions for handling elements
+ */
+
enum connman_element_state {
CONNMAN_ELEMENT_STATE_UNKNOWN = 0,
CONNMAN_ELEMENT_STATE_CONNECT = 1,
CONNMAN_ELEMENT_TYPE_DHCP = 6,
CONNMAN_ELEMENT_TYPE_BOOTP = 7,
CONNMAN_ELEMENT_TYPE_ZEROCONF = 8,
+ CONNMAN_ELEMENT_TYPE_RESOLVER = 9,
- CONNMAN_ELEMENT_TYPE_CONNECTION = 42,
+ CONNMAN_ELEMENT_TYPE_INTERNET = 42,
};
enum connman_element_subtype {
struct connman_element {
gint refcount;
+ GStaticMutex mutex;
gchar *name;
gchar *path;
enum connman_element_type type;
enum connman_element_subtype subtype;
enum connman_element_state state;
+ gboolean enabled;
guint16 priority;
struct connman_element *parent;
} netdev;
struct {
+ gchar *identifier;
+ } network;
+
+ struct {
gchar *address;
gchar *netmask;
gchar *gateway;
} ipv4;
};
+#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_ref(struct connman_element *element);
extern void connman_element_unref(struct connman_element *element);
extern int connman_element_register(struct connman_element *element,
struct connman_element *parent);
extern void connman_element_unregister(struct connman_element *element);
+extern void connman_element_unregister_children(struct connman_element *element);
extern void connman_element_update(struct connman_element *element);
static inline void *connman_element_get_data(struct connman_element *element)