config_winreg.c File Reference

WPA Supplicant / Configuration backend: Windows registry. More...

#include "includes.h"
#include "common.h"
#include "uuid.h"
#include "config.h"

Defines

#define WPA_KEY_ROOT   HKEY_LOCAL_MACHINE
#define WPA_KEY_PREFIX   TEXT("SOFTWARE\\wpa_supplicant")
#define TSTR   "%s"
#define TNAMELEN   255
#define STR(t)   write_str(netw, #t, ssid)
#define INT(t)   write_int(netw, #t, ssid->t, 0)
#define INTe(t)   write_int(netw, #t, ssid->eap.t, 0)
#define INT_DEF(t, def)   write_int(netw, #t, ssid->t, def)
#define INT_DEFe(t, def)   write_int(netw, #t, ssid->eap.t, def)

Functions

struct wpa_configwpa_config_read (const char *name)
 Read and parse configuration database.
int wpa_config_write (const char *name, struct wpa_config *config)
 Write or update configuration data.

Detailed Description

WPA Supplicant / Configuration backend: Windows registry.

Copyright
Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Alternatively, this software may be distributed under the terms of BSD license.

See README and COPYING for more details.

This file implements a configuration backend for Windows registry. All the configuration information is stored in the registry and the format for network configuration fields is same as described in the sample configuration file, wpa_supplicant.conf.

Configuration data is in HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs key. Each configuration profile has its own key under this. In terms of text files, each profile would map to a separate text file with possibly multiple networks. Under each profile, there is a networks key that lists all networks as a subkey. Each network has set of values in the same way as network block in the configuration file. In addition, blobs subkey has possible blobs as values.

Example network configuration block:

HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs\test\networks\0000
   ssid="example"
   key_mgmt=WPA-PSK

Function Documentation

struct wpa_config* wpa_config_read ( const char *  name  )  [read]

Read and parse configuration database.

Parameters:
name Name of the configuration (e.g., path and file name for the configuration file)
Returns:
Pointer to allocated configuration data or NULL on failure

This function reads configuration data, parses its contents, and allocates data structures needed for storing configuration information. The allocated data can be freed with wpa_config_free().

Each configuration backend needs to implement this function.

int wpa_config_write ( const char *  name,
struct wpa_config config 
)

Write or update configuration data.

Parameters:
name Name of the configuration (e.g., path and file name for the configuration file)
config Configuration data from wpa_config_read()
Returns:
0 on success, -1 on failure

This function write all configuration data into an external database (e.g., a text file) in a format that can be read with wpa_config_read(). This can be used to allow wpa_supplicant to update its configuration, e.g., when a new network is added or a password is changed.

Each configuration backend needs to implement this function.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 28 23:07:51 2009 for wpa_supplicant/hostapd by  doxygen 1.6.1