static void service_property_set_cb(const char *path,
					const char *property, void *user_data)
{
	update_header();
	update_ipv4();
	update_ipv6();
	update_dns();
	update_timeservers();
	update_proxy();
	update_provider();
	update_ethernet();

	ipv4_changed = FALSE;
	ipv6_changed = FALSE;
	proxy_changed = FALSE;
	nameservers_changed = FALSE;
	domains_changed = FALSE;
	timeservers_changed = FALSE;

	connman_service_set_property_changed_callback(path,
					service_property_changed_cb, NULL);
}
Example #2
0
/*!
 * \brief Parses a configuration string for proxy settings
 * Parses a configuration string for proxy settings and
 * updates the configuration structure.
 * \param settings: The configuration string in the following form:
\verbatim
 *              <id>=<host>:<port>[,<id>=<host>:<port>]...
\endverbatim
 * \return: 1 on success, -1 otherwise
 */
int conf_parse_proxy(char *settings)
{
	/* make a copy since we are modifying it */
	int len = strlen(settings);
	if (len==0) return 1;
	char *strc = (char *)pkg_malloc(len+1);
	if (strc == NULL) {
		PKG_MEM_ERROR;
		return -1;
	}
	memcpy(strc, settings, len+1);
	remove_spaces(strc);

	char *set_p = strc;
	char *token = NULL;
	while ((token = strsep(&set_p, ","))) {  /* iterate through list of settings */
		char *id_str = strsep(&token, "=");
		int id = conf_str2id(id_str);
		if (id<0) {
			LM_ERR("cannot parse id '%s'.\n", id_str);
			pkg_free(strc);
			return -1;
		}
		char *host = strsep(&token, ":");

		/* got all data for one setting -> update configuration now */
		if (update_proxy(id, host, token) < 0) {
			LM_ERR("cannot update proxy.\n");
			pkg_free(strc);
			return -1;
		}
	}

	pkg_free(strc);
	return 1;
}