2008-02-28 02:34:43 +01:00
|
|
|
/*
|
|
|
|
* WPA Supplicant / Configuration backend: empty starting point
|
|
|
|
* Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
|
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-02-28 02:34:43 +01:00
|
|
|
*
|
|
|
|
* This file implements dummy example of a configuration backend. None of the
|
|
|
|
* functions are actually implemented so this can be used as a simple
|
|
|
|
* compilation test or a starting point for a new configuration backend.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "includes.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "base64.h"
|
|
|
|
|
|
|
|
|
2013-04-23 16:38:57 +02:00
|
|
|
struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp)
|
2008-02-28 02:34:43 +01:00
|
|
|
{
|
|
|
|
struct wpa_config *config;
|
|
|
|
|
2013-04-23 16:38:57 +02:00
|
|
|
if (name == NULL)
|
|
|
|
return NULL;
|
|
|
|
if (cfgp)
|
|
|
|
config = cfgp;
|
|
|
|
else
|
|
|
|
config = wpa_config_alloc_empty(NULL, NULL);
|
2008-02-28 02:34:43 +01:00
|
|
|
if (config == NULL)
|
|
|
|
return NULL;
|
|
|
|
/* TODO: fill in configuration data */
|
|
|
|
return config;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int wpa_config_write(const char *name, struct wpa_config *config)
|
|
|
|
{
|
|
|
|
struct wpa_ssid *ssid;
|
|
|
|
struct wpa_config_blob *blob;
|
|
|
|
|
|
|
|
wpa_printf(MSG_DEBUG, "Writing configuration file '%s'", name);
|
|
|
|
|
|
|
|
/* TODO: write global config parameters */
|
|
|
|
|
|
|
|
|
|
|
|
for (ssid = config->ssid; ssid; ssid = ssid->next) {
|
|
|
|
/* TODO: write networks */
|
|
|
|
}
|
|
|
|
|
|
|
|
for (blob = config->blobs; blob; blob = blob->next) {
|
|
|
|
/* TODO: write blobs */
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|