From 7cfbad4c56b9ecb710c2cba35a6c5d72442b611b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 7 Dec 2009 09:03:10 +0100 Subject: [PATCH] Add driver data handling for DHCP --- include/dhcp.h | 3 +++ src/dhcp.c | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/dhcp.h b/include/dhcp.h index e96d83c..f0be4f4 100644 --- a/include/dhcp.h +++ b/include/dhcp.h @@ -55,6 +55,9 @@ void connman_dhcp_bound(struct connman_dhcp *dhcp); void connman_dhcp_renew(struct connman_dhcp *dhcp); void connman_dhcp_fail(struct connman_dhcp *dhcp); +void *connman_dhcp_get_data(struct connman_dhcp *dhcp); +void connman_dhcp_set_data(struct connman_dhcp *dhcp, void *data); + struct connman_dhcp_driver { const char *name; int priority; diff --git a/src/dhcp.c b/src/dhcp.c index 0c0fc30..68bbc42 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -175,6 +175,29 @@ void connman_dhcp_fail(struct connman_dhcp *dhcp) CONNMAN_ELEMENT_ERROR_FAILED); } +/** + * connman_dhcp_get_data: + * @dhcp: DHCP structure + * + * Get private DHCP data pointer + */ +void *connman_dhcp_get_data(struct connman_dhcp *dhcp) +{ + return dhcp->driver_data; +} + +/** + * connman_dhcp_set_data: + * @dhcp: DHCP structure + * @data: data pointer + * + * Set private DHCP data pointer + */ +void connman_dhcp_set_data(struct connman_dhcp *dhcp, void *data) +{ + dhcp->driver_data = data; +} + static GSList *driver_list = NULL; static gint compare_priority(gconstpointer a, gconstpointer b) -- 2.7.4