summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2012-10-09 08:20:45 (GMT)
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-07-17 05:01:05 (GMT)
commitb4478bc96cba87063776cfc91e42c728fc27e946 (patch)
tree73d564c38628851d728c95419c1e076d47fe57ad
parent66907e783512235e54371c9a9b7ef9f2f3f529f9 (diff)
downloadconnman-b4478bc96cba87063776cfc91e42c728fc27e946.zip
connman-b4478bc96cba87063776cfc91e42c728fc27e946.tar.gz
connman-b4478bc96cba87063776cfc91e42c728fc27e946.tar.bz2
Tizen: Export network proxy API for telephony plugin
Telephony plug-in requires manual PROXY setting function Telephony stack provides proxy address (3G profile). Change-Id: Iaa02f59465a687961c303667ee09051b419507d2
-rw-r--r--include/network.h3
-rw-r--r--src/connman.h4
-rw-r--r--src/network.c18
-rw-r--r--src/service.c16
4 files changed, 41 insertions, 0 deletions
diff --git a/include/network.h b/include/network.h
index 00b992e..c4fffcf 100644
--- a/include/network.h
+++ b/include/network.h
@@ -132,6 +132,9 @@ unsigned int connman_network_get_maxrate(struct connman_network *network);
int connman_network_set_enc_mode(struct connman_network *network,
const char *encryption_mode);
const char *connman_network_get_enc_mode(struct connman_network *network);
+
+int connman_network_set_proxy(struct connman_network *network,
+ const char *proxies);
#endif
int connman_network_set_name(struct connman_network *network,
diff --git a/src/connman.h b/src/connman.h
index 24db5f8..e8484d1 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -740,6 +740,10 @@ void __connman_service_timeserver_changed(struct connman_service *service,
GSList *ts_list);
void __connman_service_set_pac(struct connman_service *service,
const char *pac);
+#if defined TIZEN_EXT
+void __connman_service_set_proxy(struct connman_service *service,
+ const char *proxies);
+#endif
bool __connman_service_is_hidden(struct connman_service *service);
bool __connman_service_is_split_routing(struct connman_service *service);
bool __connman_service_index_is_split_routing(int index);
diff --git a/src/network.c b/src/network.c
index 3b974e0..01c0f4b 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1794,6 +1794,24 @@ const char *connman_network_get_enc_mode(struct connman_network *network)
return (const char *)network->wifi.encryption_mode;
}
+int connman_network_set_proxy(struct connman_network *network,
+ const char *proxies)
+{
+ struct connman_service *service;
+
+ DBG("network %p proxies %s", network, proxies);
+
+ service = connman_service_lookup_from_network(network);
+ if (service == NULL)
+ return -EINVAL;
+
+ __connman_service_set_proxy(service, proxies);
+
+ connman_service_set_proxy_method(service,
+ CONNMAN_SERVICE_PROXY_METHOD_MANUAL);
+
+ return 0;
+}
#endif
int connman_network_set_nameservers(struct connman_network *network,
diff --git a/src/service.c b/src/service.c
index e8c9224..17c1ac1 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2818,6 +2818,22 @@ void __connman_service_set_pac(struct connman_service *service,
proxy_changed(service);
}
+#if defined TIZEN_EXT
+void __connman_service_set_proxy(struct connman_service *service,
+ const char *proxies)
+{
+ char **proxies_array = NULL;
+
+ g_strfreev(service->proxies);
+ service->proxies = NULL;
+
+ if (proxies != NULL)
+ proxies_array = g_strsplit(proxies, " ", 0);
+
+ service->proxies = proxies_array;
+}
+#endif
+
void __connman_service_set_identity(struct connman_service *service,
const char *identity)
{