1218887Sdim/* 2218887Sdim * WPA Supplicant / Configuration backend: empty starting point 3218887Sdim * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi> 4218887Sdim * 5218887Sdim * This software may be distributed under the terms of the BSD license. 6218887Sdim * See README for more details. 7218887Sdim * 8218887Sdim * This file implements dummy example of a configuration backend. None of the 9218887Sdim * functions are actually implemented so this can be used as a simple 10221345Sdim * compilation test or a starting point for a new configuration backend. 11218887Sdim */ 12218887Sdim 13218887Sdim#include "includes.h" 14218887Sdim 15221345Sdim#include "common.h" 16249423Sdim#include "config.h" 17221345Sdim#include "base64.h" 18221345Sdim 19221345Sdim 20218887Sdimstruct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp) 21218887Sdim{ 22218887Sdim struct wpa_config *config; 23218887Sdim 24218887Sdim if (name == NULL) 25218887Sdim return NULL; 26221345Sdim if (cfgp) 27276479Sdim config = cfgp; 28221345Sdim else 29218887Sdim config = wpa_config_alloc_empty(NULL, NULL); 30226633Sdim if (config == NULL) 31226633Sdim return NULL; 32218887Sdim /* TODO: fill in configuration data */ 33218887Sdim return config; 34218887Sdim} 35221345Sdim 36226633Sdim 37221345Sdimint wpa_config_write(const char *name, struct wpa_config *config) 38218887Sdim{ 39218887Sdim struct wpa_ssid *ssid; 40218887Sdim struct wpa_config_blob *blob; 41261991Sdim 42261991Sdim wpa_printf(MSG_DEBUG, "Writing configuration file '%s'", name); 43261991Sdim 44261991Sdim /* TODO: write global config parameters */ 45261991Sdim 46261991Sdim 47261991Sdim for (ssid = config->ssid; ssid; ssid = ssid->next) { 48261991Sdim /* TODO: write networks */ 49296417Sdim } 50218887Sdim 51218887Sdim for (blob = config->blobs; blob; blob = blob->next) { 52218887Sdim /* TODO: write blobs */ 53218887Sdim } 54218887Sdim 55218887Sdim return 0; 56218887Sdim} 57276479Sdim