Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * WPA Supplicant / Configuration backend: empty starting point |
| 3 | * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi> |
| 4 | * |
Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 7 | * |
| 8 | * This file implements dummy example of a configuration backend. None of the |
| 9 | * functions are actually implemented so this can be used as a simple |
| 10 | * compilation test or a starting point for a new configuration backend. |
| 11 | */ |
| 12 | |
| 13 | #include "includes.h" |
| 14 | |
| 15 | #include "common.h" |
| 16 | #include "config.h" |
| 17 | #include "base64.h" |
| 18 | |
| 19 | |
Dmitry Shmidt | 64f47c5 | 2013-04-16 10:41:54 -0700 | [diff] [blame^] | 20 | struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 21 | { |
| 22 | struct wpa_config *config; |
| 23 | |
Dmitry Shmidt | 64f47c5 | 2013-04-16 10:41:54 -0700 | [diff] [blame^] | 24 | if (name == NULL) |
| 25 | return NULL; |
| 26 | if (cfgp) |
| 27 | config = cfgp; |
| 28 | else |
| 29 | config = wpa_config_alloc_empty(NULL, NULL); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 30 | if (config == NULL) |
| 31 | return NULL; |
| 32 | /* TODO: fill in configuration data */ |
| 33 | return config; |
| 34 | } |
| 35 | |
| 36 | |
| 37 | int wpa_config_write(const char *name, struct wpa_config *config) |
| 38 | { |
| 39 | struct wpa_ssid *ssid; |
| 40 | struct wpa_config_blob *blob; |
| 41 | |
| 42 | wpa_printf(MSG_DEBUG, "Writing configuration file '%s'", name); |
| 43 | |
| 44 | /* TODO: write global config parameters */ |
| 45 | |
| 46 | |
| 47 | for (ssid = config->ssid; ssid; ssid = ssid->next) { |
| 48 | /* TODO: write networks */ |
| 49 | } |
| 50 | |
| 51 | for (blob = config->blobs; blob; blob = blob->next) { |
| 52 | /* TODO: write blobs */ |
| 53 | } |
| 54 | |
| 55 | return 0; |
| 56 | } |