void get_ip(inetface_t *iface, bool update_hwaddr) { header_list_t *list; if (!iface->up || (iface->up && is_ip_public(iface->ip))) { if (!switch_to_private_network(iface)) { log_error("Could not switch to private network"); return; } } list = retrieve_configuration(iface); if (list == NULL) { log_error("Could not retrieve configuration information"); return; } configure_network(iface, list, update_hwaddr); if (Config.update_passwd) configure_password(list); header_list_free(list); }
void terminate(void) { if (List != NULL) header_list_free(List); string_list_free(Config.proxy_list); }
bool update_password_config() { bool ok; header_list_t *list; log_info("Update password configuration, updating password is done"); if (file_exist(Config.config_file)) { list = hl_load_config(Config.config_file); if (list == NULL) { log_error("Could not load configuration"); return false; } } else { list = header_list_new(); } hl_set(list, "update_password", "no", rel_none); ok = hl_write_config(Config.config_file, list); if (!ok) { log_error("Could not write configuration"); return false; } header_list_free(list); return true; }
void http_request_free(http_request_t * const request) { header_list_free(request->headers); multimap_free(request->params, free, free); if (request->path) { free(request->path); } if (request->query_string) { free(request->query_string); } if (request->host) { free(request->host); } if (request->method) { free(request->method); } if (request->scheme) { free(request->scheme); } if (request->handler_data) { free(request->handler_data); } free(request); }