int __connman_ipconfig_set_address(struct connman_ipconfig *ipconfig);
int __connman_ipconfig_clear_address(struct connman_ipconfig *ipconfig);
+int __connman_ipconfig_set_proxy_autoconfig(struct connman_ipconfig *ipconfig,
+ const char *url);
+
int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
GKeyFile *keyfile, const char *identifier, const char *prefix);
int __connman_ipconfig_save(struct connman_ipconfig *ipconfig,
const char *domainname);
const char *__connman_service_get_domainname(struct connman_service *service);
const char *__connman_service_get_nameserver(struct connman_service *service);
+void __connman_service_set_proxy_autoconfig(struct connman_service *service,
+ const char *url);
unsigned long __connman_service_stats_get_rx_packets(struct connman_service *service);
unsigned long __connman_service_stats_get_tx_packets(struct connman_service *service);
return 0;
}
+int __connman_ipconfig_set_proxy_autoconfig(struct connman_ipconfig *ipconfig,
+ const char *url)
+{
+ struct connman_ipdevice *ipdevice;
+
+ DBG("ipconfig %p", ipconfig);
+
+ if (ipconfig == NULL || ipconfig->index < 0)
+ return -ENODEV;
+
+ ipdevice = g_hash_table_lookup(ipdevice_hash,
+ GINT_TO_POINTER(ipconfig->index));
+ if (ipdevice == NULL)
+ return -ENXIO;
+
+ g_free(ipdevice->pac);
+ ipdevice->pac = g_strdup(url);
+
+ return 0;
+}
+
int __connman_ipconfig_enable(struct connman_ipconfig *ipconfig)
{
struct connman_ipdevice *ipdevice;
DBUS_TYPE_STRING, append_domainconfig, service);
}
+static void proxy_changed(struct connman_service *service)
+{
+ if (is_connected(service) == FALSE)
+ return;
+
+ connman_dbus_property_changed_dict(service->path,
+ CONNMAN_SERVICE_INTERFACE, "Proxy",
+ append_proxy, service);
+}
+
static void append_properties(DBusMessageIter *dict, dbus_bool_t limited,
struct connman_service *service)
{
g_sequence_foreach(service_list, append_struct, iter);
}
+void __connman_service_set_proxy_autoconfig(struct connman_service *service,
+ const char *url)
+{
+ if (service == NULL)
+ return;
+
+ if (__connman_ipconfig_set_proxy_autoconfig(service->ipconfig,
+ url) < 0)
+ return;
+
+ proxy_changed(service);
+}
+
static DBusMessage *get_properties(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{