summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2012-10-10 10:38:06 +0800
committerZhang zhengguang <zhengguang.zhang@intel.com>2013-07-01 11:30:34 +0800
commit6b50619cf3c8a920c988822991aaba7ab1f32b66 (patch)
tree1adcac227248cf3c8d77797dbb78f9aad0a5d975
parent3e078e46d0cba52b4fc04c62085bd82fbd4fab26 (diff)
downloadconnman-6b50619cf3c8a920c988822991aaba7ab1f32b66.tar.gz
connman-6b50619cf3c8a920c988822991aaba7ab1f32b66.tar.bz2
connman-6b50619cf3c8a920c988822991aaba7ab1f32b66.zip
Tizen: Export network get ifname API for telephony plugin
Telephony stack may not send the dev_name to telephony plugin then we need this API to get the ifname
-rw-r--r--include/network.h1
-rw-r--r--src/network.c20
2 files changed, 21 insertions, 0 deletions
diff --git a/include/network.h b/include/network.h
index 9d7f5f90..6e92bc53 100644
--- a/include/network.h
+++ b/include/network.h
@@ -135,6 +135,7 @@ const char *connman_network_get_enc_mode(struct connman_network *network);
int connman_network_set_proxy(struct connman_network *network,
const char *proxies);
+const char *connman_network_get_ifname(struct connman_network *network);
#endif
int connman_network_set_name(struct connman_network *network,
diff --git a/src/network.c b/src/network.c
index 789925a6..1b176a63 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1788,6 +1788,26 @@ int connman_network_set_proxy(struct connman_network *network,
return 0;
}
+
+const char *connman_network_get_ifname(struct connman_network *network)
+{
+ struct connman_service *service;
+ struct connman_ipconfig *ipconfig;
+ const char *ifname = NULL;
+
+ service = connman_service_lookup_from_network(network);
+ if (service == NULL)
+ return NULL;
+
+ ipconfig = __connman_service_get_ip4config(service);
+
+ if (ipconfig != NULL)
+ ifname = __connman_ipconfig_get_ifname(ipconfig);
+
+ DBG("index %d, service %p ip4config %p ifname %s",
+ network->index, service, ipconfig, ifname);
+ return ifname;
+}
#endif
int connman_network_set_nameservers(struct connman_network *network,