config.h File Reference

WPA Supplicant / Configuration file structures. More...

#include "config_ssid.h"

Include dependency graph for config.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DEFAULT_EAPOL_VERSION   1
#define DEFAULT_AP_SCAN   1
#define DEFAULT_FAST_REAUTH   1

Functions

void wpa_config_free (struct wpa_config *ssid)
 Free configuration data.
void wpa_config_free_ssid (struct wpa_ssid *ssid)
 Free network/ssid configuration data.
wpa_ssidwpa_config_get_network (struct wpa_config *config, int id)
 Get configured network based on id.
wpa_ssidwpa_config_add_network (struct wpa_config *config)
 Add a new network with empty configuration.
int wpa_config_remove_network (struct wpa_config *config, int id)
 Remove a configured network based on id.
void wpa_config_set_network_defaults (struct wpa_ssid *ssid)
 Set network default values.
int wpa_config_set (struct wpa_ssid *ssid, const char *var, const char *value, int line)
 Set a variable in network configuration.
char * wpa_config_get (struct wpa_ssid *ssid, const char *var)
 Get a variable in network configuration.
char * wpa_config_get_no_key (struct wpa_ssid *ssid, const char *var)
 Get a variable in network configuration (no keys).
void wpa_config_update_psk (struct wpa_ssid *ssid)
 Update WPA PSK based on passphrase and SSID.
int wpa_config_add_prio_network (struct wpa_config *config, struct wpa_ssid *ssid)
 Add a network to priority lists.
const struct wpa_config_blobwpa_config_get_blob (struct wpa_config *config, const char *name)
 Get a named configuration blob.
void wpa_config_set_blob (struct wpa_config *config, struct wpa_config_blob *blob)
 Set or add a named configuration blob.
void wpa_config_free_blob (struct wpa_config_blob *blob)
 Free blob data.
int wpa_config_remove_blob (struct wpa_config *config, const char *name)
 Remove a named configuration blob.
wpa_configwpa_config_alloc_empty (const char *ctrl_interface, const char *driver_param)
 Allocate an empty configuration.
void wpa_config_debug_dump_networks (struct wpa_config *config)
 Debug dump of configured networks.
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 file structures.

Copyright
Copyright (c) 2003-2005, Jouni Malinen <[email protected]>
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.

Definition in file config.h.


Function Documentation

struct wpa_ssid* wpa_config_add_network struct wpa_config config  ) 
 

Add a new network with empty configuration.

Parameters:
config Configuration data from wpa_config_read()
Returns:
The new network configuration or NULL if operation failed

Definition at line 1413 of file config.c.

Here is the call graph for this function:

int wpa_config_add_prio_network struct wpa_config config,
struct wpa_ssid ssid
 

Add a network to priority lists.

Parameters:
config Configuration data from wpa_config_read()
ssid Pointer to the network configuration to be added to the list
Returns:
0 on success, -1 on failure
This function is used to add a network block to the priority list of networks. This must be called for each network when reading in the full configuration. In addition, this can be used indirectly when updating priorities by calling wpa_config_update_prio_list().

Definition at line 1194 of file config.c.

struct wpa_config* wpa_config_alloc_empty const char *  ctrl_interface,
const char *  driver_param
 

Allocate an empty configuration.

Parameters:
ctrl_interface Control interface parameters, e.g., path to UNIX domain socket
driver_param Driver parameters
Returns:
Pointer to allocated configuration data or NULL on failure

Definition at line 1731 of file config.c.

Here is the call graph for this function:

void wpa_config_debug_dump_networks struct wpa_config config  ) 
 

Debug dump of configured networks.

Parameters:
config Configuration data from wpa_config_read()

Definition at line 1758 of file config.c.

Here is the call graph for this function:

void wpa_config_free struct wpa_config config  ) 
 

Free configuration data.

Parameters:
config Configuration data from wpa_config_read()
This function frees all resources allocated for the configuration data by wpa_config_read().

Definition at line 1326 of file config.c.

Here is the call graph for this function:

void wpa_config_free_blob struct wpa_config_blob blob  ) 
 

Free blob data.

Parameters:
blob Pointer to blob to be freed

Definition at line 1685 of file config.c.

void wpa_config_free_ssid struct wpa_ssid ssid  ) 
 

Free network/ssid configuration data.

Parameters:
ssid Configuration data for the network
This function frees all resources allocated for the network configuration data.

Definition at line 1275 of file config.c.

char* wpa_config_get struct wpa_ssid ssid,
const char *  var
 

Get a variable in network configuration.

Parameters:
ssid Pointer to network configuration data
var Variable name, e.g., "ssid"
Returns:
Value of the variable or NULL on failure
This function can be used to get network configuration variables. The returned value is a copy of the configuration variable in text format, i.e,. the same format that the text-based configuration file and wpa_config_set() are using for the value. The caller is responsible for freeing the returned value.

Definition at line 1557 of file config.c.

const struct wpa_config_blob* wpa_config_get_blob struct wpa_config config,
const char *  name
 

Get a named configuration blob.

Parameters:
config Configuration data from wpa_config_read()
name Name of the blob
Returns:
Pointer to blob data or NULL if not found

Definition at line 1648 of file config.c.

struct wpa_ssid* wpa_config_get_network struct wpa_config config,
int  id
 

Get configured network based on id.

Parameters:
config Configuration data from wpa_config_read()
id Unique network id to search for
Returns:
Network configuration or NULL if not found

Definition at line 1392 of file config.c.

char* wpa_config_get_no_key struct wpa_ssid ssid,
const char *  var
 

Get a variable in network configuration (no keys).

Parameters:
ssid Pointer to network configuration data
var Variable name, e.g., "ssid"
Returns:
Value of the variable or NULL on failure
This function can be used to get network configuration variable like wpa_config_get(). The only difference is that this functions does not expose key/password material from the configuration. In case a key/password field is requested, the returned value is an empty string or NULL if the variable is not set or "*" if the variable is set (regardless of its value). The returned value is a copy of the configuration variable in text format, i.e,. the same format that the text-based configuration file and wpa_config_set() are using for the value. The caller is responsible for freeing the returned value.

Definition at line 1591 of file config.c.

Here is the call graph for this function:

struct wpa_config* wpa_config_read const char *  name  ) 
 

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.

Definition at line 245 of file config_file.c.

Here is the call graph for this function:

int wpa_config_remove_blob struct wpa_config config,
const char *  name
 

Remove a named configuration blob.

Parameters:
config Configuration data from wpa_config_read()
name Name of the blob to remove
Returns:
0 if blob was removed or -1 if blob was not found

Definition at line 1702 of file config.c.

Here is the call graph for this function:

int wpa_config_remove_network struct wpa_config config,
int  id
 

Remove a configured network based on id.

Parameters:
config Configuration data from wpa_config_read()
id Unique network id to search for
Returns:
0 on success, or -1 if the network was not found

Definition at line 1450 of file config.c.

Here is the call graph for this function:

int wpa_config_set struct wpa_ssid ssid,
const char *  var,
const char *  value,
int  line
 

Set a variable in network configuration.

Parameters:
ssid Pointer to network configuration data
var Variable name, e.g., "ssid"
value Variable value
line Line number in configuration file or 0 if not used
Returns:
0 on success, -1 on failure
This function can be used to set network configuration variables based on both the configuration file and management interface input. The value parameter must be in the same format as the text-based configuration file is using. For example, strings are using double quotation marks.

Definition at line 1509 of file config.c.

Here is the call graph for this function:

void wpa_config_set_blob struct wpa_config config,
struct wpa_config_blob blob
 

Set or add a named configuration blob.

Parameters:
config Configuration data from wpa_config_read()
blob New value for the blob
Adds a new configuration blob or replaces the current value of an existing blob.

Definition at line 1671 of file config.c.

Here is the call graph for this function:

void wpa_config_set_network_defaults struct wpa_ssid ssid  ) 
 

Set network default values.

Parameters:
ssid Pointer to network configuration data

Definition at line 1481 of file config.c.

void wpa_config_update_psk struct wpa_ssid ssid  ) 
 

Update WPA PSK based on passphrase and SSID.

Parameters:
ssid Pointer to network configuration data
This function must be called to update WPA PSK when either SSID or the passphrase has changed for the network configuration.

Definition at line 1630 of file config.c.

Here is the call graph for 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.

Definition at line 692 of file config_file.c.

Here is the call graph for this function:


Generated on Sun Dec 31 13:49:50 2006 for wpa_supplicant by  doxygen 1.4.2