config_file.c File Reference

WPA Supplicant / Configuration backend: text file. More...

#include "includes.h"
#include "common.h"
#include "config.h"
#include "base64.h"
#include "uuid.h"
#include "eap_peer/eap_methods.h"

Data Structures

struct  global_parse_data

Defines

#define OFFSET(v)   ((void *) &((struct wpa_config *) 0)->v)
#define FUNC(f)   #f, wpa_config_process_ ## f, OFFSET(f), NULL, NULL
#define FUNC_NO_VAR(f)   #f, wpa_config_process_ ## f, NULL, NULL, NULL
#define _INT(f)   #f, wpa_config_parse_int, OFFSET(f)
#define INT(f)   _INT(f), NULL, NULL
#define INT_RANGE(f, min, max)   _INT(f), (void *) min, (void *) max
#define _STR(f)   #f, wpa_config_parse_str, OFFSET(f)
#define STR(f)   _STR(f), NULL, NULL
#define STR_RANGE(f, min, max)   _STR(f), (void *) min, (void *) max
#define NUM_GLOBAL_FIELDS   (sizeof(global_fields) / sizeof(global_fields[0]))
#define STR(t)   write_str(f, #t, ssid)
#define INT(t)   write_int(f, #t, ssid->t, 0)
#define INTe(t)   write_int(f, #t, ssid->eap.t, 0)
#define INT_DEF(t, def)   write_int(f, #t, ssid->t, def)
#define INT_DEFe(t, def)   write_int(f, #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: text file.

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 text files. All the configuration information is stored in a text file that uses a format described in the sample configuration file, wpa_supplicant.conf.


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