conf.h File Reference

Config file parsing. More...

Go to the source code of this file.

Data Structures

struct  _auth_serv_t
struct  _firewall_rule_t
struct  _firewall_ruleset_t
struct  _trusted_mac_t
struct  s_config

Defines

#define LOCK_CONFIG()
#define UNLOCK_CONFIG()
#define NUM_EXT_INTERFACE_DETECT_RETRY   0
#define EXT_INTERFACE_DETECT_RETRY_INTERVAL   1
#define DEFAULT_CONFIGFILE   "/etc/wifidog.conf"
#define DEFAULT_HTMLMSGFILE   "/etc/wifidog-msg.html"
#define DEFAULT_DAEMON   1
#define DEFAULT_DEBUGLEVEL   LOG_INFO
#define DEFAULT_HTTPDMAXCONN   10
#define DEFAULT_GATEWAYID   NULL
#define DEFAULT_GATEWAYPORT   2060
#define DEFAULT_HTTPDNAME   "WiFiDog"
#define DEFAULT_CLIENTTIMEOUT   5
#define DEFAULT_CHECKINTERVAL   60
#define DEFAULT_LOG_SYSLOG   0
#define DEFAULT_SYSLOG_FACILITY   LOG_DAEMON
#define DEFAULT_WDCTL_SOCK   "/tmp/wdctl.sock"
#define DEFAULT_INTERNAL_SOCK   "/tmp/wifidog.sock"
#define DEFAULT_AUTHSERVPORT   80
#define DEFAULT_AUTHSERVSSLPORT   443
#define DEFAULT_AUTHSERVSSLAVAILABLE   0
#define DEFAULT_AUTHSERVPATH   "/wifidog/"
#define DEFAULT_AUTHSERVLOGINPATHFRAGMENT   "login/?"
#define DEFAULT_AUTHSERVPORTALPATHFRAGMENT   "portal/?"
#define DEFAULT_AUTHSERVMSGPATHFRAGMENT   "gw_message.php?"
#define DEFAULT_AUTHSERVPINGPATHFRAGMENT   "ping/?"
#define DEFAULT_AUTHSERVAUTHPATHFRAGMENT   "auth/?"

Typedefs

typedef struct _auth_serv_t t_auth_serv
typedef struct _firewall_rule_t t_firewall_rule
typedef struct _firewall_ruleset_t t_firewall_ruleset
typedef struct _trusted_mac_t t_trusted_mac

Functions

s_configconfig_get_config (void)
 Get the current gateway configuration.
void config_init (void)
 Initialise the conf system.
void config_init_override (void)
 Initialize the variables we override with the command line.
void config_read (const char *filename)
 Reads the configuration file.
void config_validate (void)
 Check that the configuration is valid.
t_auth_servget_auth_server (void)
 Get the active auth server.
void mark_auth_server_bad (t_auth_serv *)
 Bump server to bottom of the list.
t_firewall_ruleget_ruleset (const char *)
 Fetch a firewall rule set.
void parse_trusted_mac_list (char *)


Detailed Description

Config file parsing.

Author:
Copyright (C) 2004 Philippe April <papril777@yahoo.com>

Definition in file conf.h.


Define Documentation

#define DEFAULT_AUTHSERVAUTHPATHFRAGMENT   "auth/?"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 69 of file conf.h.

#define DEFAULT_AUTHSERVLOGINPATHFRAGMENT   "login/?"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 65 of file conf.h.

#define DEFAULT_AUTHSERVMSGPATHFRAGMENT   "gw_message.php?"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 67 of file conf.h.

#define DEFAULT_AUTHSERVPATH   "/wifidog/"

Note: The path must be prefixed by /, and must be suffixed /. Put / for the server root.

Definition at line 64 of file conf.h.

#define DEFAULT_AUTHSERVPINGPATHFRAGMENT   "ping/?"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 68 of file conf.h.

#define DEFAULT_AUTHSERVPORT   80

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 59 of file conf.h.

#define DEFAULT_AUTHSERVPORTALPATHFRAGMENT   "portal/?"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 66 of file conf.h.

#define DEFAULT_AUTHSERVSSLAVAILABLE   0

Note that DEFAULT_AUTHSERVSSLAVAILABLE must be 0 or 1, even if the config file syntax is yes or no

Definition at line 62 of file conf.h.

#define DEFAULT_AUTHSERVSSLPORT   443

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 60 of file conf.h.

#define DEFAULT_CHECKINTERVAL   60

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 54 of file conf.h.

Referenced by config_init().

#define DEFAULT_CLIENTTIMEOUT   5

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 53 of file conf.h.

Referenced by config_init().

#define DEFAULT_CONFIGFILE   "/etc/wifidog.conf"

Defaults configuration values

Definition at line 41 of file conf.h.

Referenced by config_init().

#define DEFAULT_DAEMON   1

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 47 of file conf.h.

Referenced by config_init_override().

#define DEFAULT_DEBUGLEVEL   LOG_INFO

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 48 of file conf.h.

Referenced by config_init().

#define DEFAULT_GATEWAYID   NULL

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 50 of file conf.h.

Referenced by config_init().

#define DEFAULT_GATEWAYPORT   2060

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 51 of file conf.h.

Referenced by config_init().

#define DEFAULT_HTMLMSGFILE   "/etc/wifidog-msg.html"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 42 of file conf.h.

Referenced by config_init().

#define DEFAULT_HTTPDMAXCONN   10

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 49 of file conf.h.

Referenced by config_init().

#define DEFAULT_HTTPDNAME   "WiFiDog"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 52 of file conf.h.

Referenced by config_init().

#define DEFAULT_INTERNAL_SOCK   "/tmp/wifidog.sock"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 58 of file conf.h.

Referenced by config_init().

#define DEFAULT_LOG_SYSLOG   0

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 55 of file conf.h.

Referenced by config_init().

#define DEFAULT_SYSLOG_FACILITY   LOG_DAEMON

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 56 of file conf.h.

Referenced by config_init().

#define DEFAULT_WDCTL_SOCK   "/tmp/wdctl.sock"

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 57 of file conf.h.

Referenced by config_init().

#define EXT_INTERFACE_DETECT_RETRY_INTERVAL   1

How often should we try to detect the interface with the default route if it isn't up yet (interval in seconds)

Definition at line 37 of file conf.h.

 
#define LOCK_CONFIG (  ) 

Value:

do { \
        debug(LOG_DEBUG, "Locking config"); \
        pthread_mutex_lock(&config_mutex); \
        debug(LOG_DEBUG, "Config locked"); \
} while (0)

Definition at line 184 of file conf.h.

#define NUM_EXT_INTERFACE_DETECT_RETRY   0

Defines How many times should we try detecting the interface with the default route (in seconds). If set to 0, it will keep retrying forever

Definition at line 34 of file conf.h.

 
#define UNLOCK_CONFIG (  ) 

Value:

do { \
        debug(LOG_DEBUG, "Unlocking config"); \
        pthread_mutex_unlock(&config_mutex); \
        debug(LOG_DEBUG, "Config unlocked"); \
} while (0)

Definition at line 190 of file conf.h.


Function Documentation

s_config* config_get_config ( void   ) 

Get the current gateway configuration.

Accessor for the current gateway configuration

Returns:
: A pointer to the current config. The pointer isn't opaque, but should be treated as READ-ONLY

Definition at line 152 of file conf.c.

Referenced by _connect_auth_server(), auth_server_request(), authenticate_client(), fw_sync_with_authserver(), http_callback_404(), http_callback_auth(), http_callback_status(), iptables_fw_init(), iptables_fw_set_authservers(), parse_commandline(), ping(), send_http_page(), thread_client_timeout_check(), and thread_ping().

void config_init ( void   ) 

void config_init_override ( void   ) 

Initialize the variables we override with the command line.

If the command-line didn't provide a config, use the default.

Definition at line 191 of file conf.c.

References s_config::daemon, and DEFAULT_DAEMON.

void config_read ( const char *  filename  ) 

void config_validate ( void   ) 

Check that the configuration is valid.

Verifies if the configuration is complete and valid. Terminates the program if it isn't

Definition at line 828 of file conf.c.

References s_config::auth_servers, debug, and s_config::gw_interface.

t_auth_serv* get_auth_server ( void   ) 

Get the active auth server.

This function returns the current (first auth_server)

Definition at line 855 of file conf.c.

References s_config::auth_servers.

Referenced by auth_server_request(), authenticate_client(), http_callback_404(), http_callback_auth(), http_send_redirect_to_auth(), and ping().

t_firewall_rule* get_ruleset ( const char *   ) 

Fetch a firewall rule set.

Definition at line 615 of file conf.c.

References _firewall_ruleset_t::name, _firewall_ruleset_t::next, _firewall_ruleset_t::rules, and s_config::rulesets.

void mark_auth_server_bad ( t_auth_serv bad_server  ) 

Bump server to bottom of the list.

This function marks the current auth_server, if it matches the argument, as bad. Basically, the "bad" server becomes the last one on the list.

Definition at line 867 of file conf.c.

References s_config::auth_servers, and _auth_serv_t::next.

Referenced by _connect_auth_server().


Generated on Fri Sep 25 15:28:43 2009 for WifiDog by  doxygen 1.5.5