From 217e0391609f18725d7d6267045b21960bd81faa Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 7 Dec 2009 07:06:19 +0100 Subject: [PATCH] Add function to get index value from DHCP structure --- include/dhcp.h | 1 + src/dhcp.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/dhcp.h b/include/dhcp.h index 7651293..2d6704c 100644 --- a/include/dhcp.h +++ b/include/dhcp.h @@ -45,6 +45,7 @@ struct connman_dhcp; struct connman_dhcp *connman_dhcp_ref(struct connman_dhcp *dhcp); void connman_dhcp_unref(struct connman_dhcp *dhcp); +int connman_dhcp_get_index(struct connman_dhcp *dhcp); char *connman_dhcp_get_interface(struct connman_dhcp *dhcp); void connman_dhcp_bound(struct connman_dhcp *dhcp); diff --git a/src/dhcp.c b/src/dhcp.c index 93401d7..f0f28e4 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -64,6 +64,17 @@ void connman_dhcp_unref(struct connman_dhcp *dhcp) } /** + * connman_dhcp_get_index: + * @dhcp: DHCP structure + * + * Get network index of DHCP + */ +int connman_dhcp_get_index(struct connman_dhcp *dhcp) +{ + return dhcp->index; +} + +/** * connman_dhcp_get_interface: * @dhcp: DHCP structure * -- 2.7.4