summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Xu <martin.xu@intel.com>2013-07-03 17:49:25 -0700
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2013-07-03 17:49:25 -0700
commit77c54f46be486205875d56e3dd10553f4d5d7798 (patch)
tree0a6c8037d79d30911a65bc095c7c33522faec498
parentdd894d763e92f36ac9e746c0e06531e6188548e2 (diff)
parent6b50619cf3c8a920c988822991aaba7ab1f32b66 (diff)
downloadconnman-77c54f46be486205875d56e3dd10553f4d5d7798.tar.gz
connman-77c54f46be486205875d56e3dd10553f4d5d7798.tar.bz2
connman-77c54f46be486205875d56e3dd10553f4d5d7798.zip
Merge "Tizen: Export network get ifname API for telephony plugin" into tizen
-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,