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_config * | config_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_serv * | get_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_rule * | get_ruleset (const char *) |
Fetch a firewall rule set. | |
void | parse_trusted_mac_list (char *) |
Definition in file conf.h.
#define DEFAULT_AUTHSERVAUTHPATHFRAGMENT "auth/?" |
#define DEFAULT_AUTHSERVLOGINPATHFRAGMENT "login/?" |
#define DEFAULT_AUTHSERVMSGPATHFRAGMENT "gw_message.php?" |
#define DEFAULT_AUTHSERVPATH "/wifidog/" |
#define DEFAULT_AUTHSERVPINGPATHFRAGMENT "ping/?" |
#define DEFAULT_AUTHSERVPORT 80 |
#define DEFAULT_AUTHSERVPORTALPATHFRAGMENT "portal/?" |
#define DEFAULT_AUTHSERVSSLAVAILABLE 0 |
#define DEFAULT_AUTHSERVSSLPORT 443 |
#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" |
#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 |
#define LOCK_CONFIG | ( | ) |
Value:
do { \ debug(LOG_DEBUG, "Locking config"); \ pthread_mutex_lock(&config_mutex); \ debug(LOG_DEBUG, "Config locked"); \ } while (0)
#define NUM_EXT_INTERFACE_DETECT_RETRY 0 |
#define UNLOCK_CONFIG | ( | ) |
Value:
do { \ debug(LOG_DEBUG, "Unlocking config"); \ pthread_mutex_unlock(&config_mutex); \ debug(LOG_DEBUG, "Config unlocked"); \ } while (0)
s_config* config_get_config | ( | void | ) |
Get the current gateway configuration.
Accessor for the current gateway configuration
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 | ) |
Initialise the conf system.
Sets the default config parameters and initialises the configuration system
Definition at line 159 of file conf.c.
References s_config::auth_servers, s_config::checkinterval, s_config::clienttimeout, s_config::configfile, s_config::daemon, debug, s_config::debuglevel, DEFAULT_CHECKINTERVAL, DEFAULT_CLIENTTIMEOUT, DEFAULT_CONFIGFILE, DEFAULT_DEBUGLEVEL, DEFAULT_GATEWAYID, DEFAULT_GATEWAYPORT, DEFAULT_HTMLMSGFILE, DEFAULT_HTTPDMAXCONN, DEFAULT_HTTPDNAME, DEFAULT_INTERNAL_SOCK, DEFAULT_LOG_SYSLOG, DEFAULT_SYSLOG_FACILITY, DEFAULT_WDCTL_SOCK, s_config::external_interface, s_config::gw_address, s_config::gw_id, s_config::gw_interface, s_config::gw_port, s_config::htmlmsgfile, s_config::httpdmaxconn, s_config::httpdname, s_config::httpdpassword, s_config::httpdrealm, s_config::httpdusername, s_config::internal_sock, s_config::log_syslog, s_config::rulesets, s_config::syslog_facility, s_config::trustedmaclist, and s_config::wdctl_sock.
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 | ) |
Reads the configuration file.
filename | Full path of the configuration file to be read |
Definition at line 632 of file conf.c.
References s_config::checkinterval, s_config::clienttimeout, s_config::daemon, debug, s_config::external_interface, s_config::gw_address, s_config::gw_id, s_config::gw_interface, s_config::gw_port, s_config::htmlmsgfile, s_config::httpdmaxconn, s_config::httpdname, s_config::httpdpassword, s_config::httpdrealm, s_config::httpdusername, MAX_BUF, s_config::syslog_facility, and s_config::wdctl_sock.
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().