Add skeletons for IP operation callbacks
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 10 Aug 2009 01:49:52 +0000 (18:49 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 10 Aug 2009 01:49:52 +0000 (18:49 -0700)
include/ipconfig.h
src/ipconfig.c

index e347063ac6360ec4c466a751a8da0b217e10a462..ad7cbc68324c369f29ac3a8c26d667fda40ce6ea 100644 (file)
@@ -47,10 +47,23 @@ enum connman_ipconfig_method {
 
 struct connman_ipconfig;
 
+struct connman_ipconfig_ops {
+       void (*up) (struct connman_ipconfig *ipconfig);
+       void (*down) (struct connman_ipconfig *ipconfig);
+       void (*lower_up) (struct connman_ipconfig *ipconfig);
+       void (*lower_down) (struct connman_ipconfig *ipconfig);
+};
+
 struct connman_ipconfig *connman_ipconfig_create(int index);
 struct connman_ipconfig *connman_ipconfig_ref(struct connman_ipconfig *ipconfig);
 void connman_ipconfig_unref(struct connman_ipconfig *ipconfig);
 
+void *connman_ipconfig_get_data(struct connman_ipconfig *ipconfig);
+void connman_ipconfig_set_data(struct connman_ipconfig *ipconfig, void *data);
+
+void connman_ipconfig_set_ops(struct connman_ipconfig *ipconfig,
+                                       struct connman_ipconfig_ops *ops);
+
 int connman_ipconfig_set_method(struct connman_ipconfig *ipconfig,
                                        enum connman_ipconfig_method method);
 
index 013a14f05db40a8cdc1a2fb0fd5efefacea3268f..2fd35596226c57879b625db646cb7c4cba3983a8 100644 (file)
@@ -44,6 +44,10 @@ struct connman_ipconfig {
        char *interface;
        unsigned short type;
        unsigned int flags;
+
+       struct connman_ipconfig_ops *ops;
+       void *ops_data;
+
        enum connman_ipconfig_method method;
        GSList *address_list;
        char *gateway;
@@ -145,6 +149,42 @@ void connman_ipconfig_unref(struct connman_ipconfig *ipconfig)
        }
 }
 
+/**
+ * connman_ipconfig_get_data:
+ * @ipconfig: ipconfig structure
+ *
+ * Get private data pointer
+ */
+void *connman_ipconfig_get_data(struct connman_ipconfig *ipconfig)
+{
+       return ipconfig->ops_data;
+}
+
+/**
+ * connman_ipconfig_set_data:
+ * @ipconfig: ipconfig structure
+ * @data: data pointer
+ *
+ * Set private data pointer
+ */
+void connman_ipconfig_set_data(struct connman_ipconfig *ipconfig, void *data)
+{
+       ipconfig->ops_data = data;
+}
+
+/**
+ * connman_ipconfig_set_ops:
+ * @ipconfig: ipconfig structure
+ * @ops: operation callbacks
+ *
+ * Set the operation callbacks
+ */
+void connman_ipconfig_set_ops(struct connman_ipconfig *ipconfig,
+                                       struct connman_ipconfig_ops *ops)
+{
+       ipconfig->ops = ops;
+}
+
 /**
  * connman_ipconfig_set_method:
  * @ipconfig: ipconfig structure