1189251Ssam/* 2189251Ssam * WPA Supplicant / Configuration backend: empty starting point 3189251Ssam * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi> 4189251Ssam * 5252726Srpaulo * This software may be distributed under the terms of the BSD license. 6252726Srpaulo * See README for more details. 7189251Ssam * 8189251Ssam * This file implements dummy example of a configuration backend. None of the 9189251Ssam * functions are actually implemented so this can be used as a simple 10189251Ssam * compilation test or a starting point for a new configuration backend. 11189251Ssam */ 12189251Ssam 13189251Ssam#include "includes.h" 14189251Ssam 15189251Ssam#include "common.h" 16189251Ssam#include "config.h" 17189251Ssam#include "base64.h" 18189251Ssam 19189251Ssam 20281806Srpaulostruct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp) 21189251Ssam{ 22189251Ssam struct wpa_config *config; 23189251Ssam 24281806Srpaulo if (name == NULL) 25281806Srpaulo return NULL; 26281806Srpaulo if (cfgp) 27281806Srpaulo config = cfgp; 28281806Srpaulo else 29281806Srpaulo config = wpa_config_alloc_empty(NULL, NULL); 30189251Ssam if (config == NULL) 31189251Ssam return NULL; 32189251Ssam /* TODO: fill in configuration data */ 33189251Ssam return config; 34189251Ssam} 35189251Ssam 36189251Ssam 37189251Ssamint wpa_config_write(const char *name, struct wpa_config *config) 38189251Ssam{ 39189251Ssam struct wpa_ssid *ssid; 40189251Ssam struct wpa_config_blob *blob; 41189251Ssam 42189251Ssam wpa_printf(MSG_DEBUG, "Writing configuration file '%s'", name); 43189251Ssam 44189251Ssam /* TODO: write global config parameters */ 45189251Ssam 46189251Ssam 47189251Ssam for (ssid = config->ssid; ssid; ssid = ssid->next) { 48189251Ssam /* TODO: write networks */ 49189251Ssam } 50189251Ssam 51189251Ssam for (blob = config->blobs; blob; blob = blob->next) { 52189251Ssam /* TODO: write blobs */ 53189251Ssam } 54189251Ssam 55189251Ssam return 0; 56189251Ssam} 57