config_none.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * WPA Supplicant / Configuration backend: empty starting point
  3. * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  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. #include "includes.h"
  13. #include "common.h"
  14. #include "config.h"
  15. #include "base64.h"
  16. struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp)
  17. {
  18. struct wpa_config *config;
  19. if (name == NULL)
  20. return NULL;
  21. if (cfgp)
  22. config = cfgp;
  23. else
  24. config = wpa_config_alloc_empty(NULL, NULL);
  25. if (config == NULL)
  26. return NULL;
  27. /* TODO: fill in configuration data */
  28. return config;
  29. }
  30. int wpa_config_write(const char *name, struct wpa_config *config)
  31. {
  32. struct wpa_ssid *ssid;
  33. struct wpa_config_blob *blob;
  34. wpa_printf(MSG_DEBUG, "Writing configuration file '%s'", name);
  35. /* TODO: write global config parameters */
  36. for (ssid = config->ssid; ssid; ssid = ssid->next) {
  37. /* TODO: write networks */
  38. }
  39. for (blob = config->blobs; blob; blob = blob->next) {
  40. /* TODO: write blobs */
  41. }
  42. return 0;
  43. }