Go to the source code of this file.
Data Structures | |
struct | t_auth_serv |
struct | t_firewall_rule |
struct | t_firewall_ruleset |
struct | t_trusted_mac |
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_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/?" |
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 (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 (char *) |
Fetch a firewall rule set. | |
void | parse_trusted_mac_list (char *) |
Definition in file conf.h.
#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 67 of file conf.h.
Referenced by parse_auth_server().
#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 63 of file conf.h.
Referenced by parse_auth_server().
#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 65 of file conf.h.
Referenced by parse_auth_server().
#define DEFAULT_AUTHSERVPATH "/wifidog/" |
Note: The path must be prefixed by /, and must be suffixed /. Put / for the server root.
Definition at line 62 of file conf.h.
Referenced by parse_auth_server().
#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 66 of file conf.h.
Referenced by parse_auth_server().
#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 57 of file conf.h.
Referenced by parse_auth_server().
#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 64 of file conf.h.
Referenced by parse_auth_server().
#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 60 of file conf.h.
Referenced by parse_auth_server().
#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 58 of file conf.h.
Referenced by parse_auth_server().
#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 52 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 51 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 45 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 46 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 48 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 49 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 47 of file conf.h.
Referenced by config_init().
#define DEFAULT_HTTPDNAME "WiFiDog" |
#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 56 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 53 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 54 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 55 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.
Referenced by get_ext_iface().
#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 178 of file conf.h.
Referenced by connect_auth_server(), get_status_text(), and iptables_fw_init().
#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.
Referenced by get_ext_iface().
#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 184 of file conf.h.
Referenced by connect_auth_server(), get_status_text(), and iptables_fw_init().
s_config* config_get_config | ( | void | ) |
void config_init | ( | void | ) |
Initialise the conf system.
Sets the default config parameters and initialises the configuration system
Definition at line 152 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_HTTPDMAXCONN, 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::httpdmaxconn, s_config::httpdname, s_config::internal_sock, s_config::log_syslog, s_config::rulesets, safe_strdup(), 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 180 of file conf.c.
References s_config::daemon, and DEFAULT_DAEMON.
void config_read | ( | char * | filename | ) |
Reads the configuration file.
filename | Full path of the configuration file to be read |
Definition at line 621 of file conf.c.
References s_config::checkinterval, s_config::clienttimeout, config_parse_token(), 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::httpdmaxconn, s_config::httpdname, MAX_BUF, oAuthServer, oBadOption, oCheckInterval, oClientTimeout, oDaemon, oExternalInterface, oFirewallRuleSet, oGatewayAddress, oGatewayID, oGatewayInterface, oGatewayPort, oHTTPDMaxConn, oHTTPDName, opcode, oSyslogFacility, oTrustedMACList, oWdctlSocket, parse_auth_server(), parse_boolean_value(), parse_firewall_ruleset(), parse_trusted_mac_list(), safe_strdup(), 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 799 of file conf.c.
References s_config::auth_servers, config_notnull(), debug, s_config::gw_interface, and missing_parms.
t_auth_serv* get_auth_server | ( | void | ) |
Get the active auth server.
This function returns the current (first auth_server)
Definition at line 826 of file conf.c.
References s_config::auth_servers.
t_firewall_rule* get_ruleset | ( | char * | ) |
Fetch a firewall rule set.
Definition at line 604 of file conf.c.
References t_firewall_ruleset::name, t_firewall_ruleset::next, t_firewall_ruleset::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 838 of file conf.c.
References s_config::auth_servers, and t_auth_serv::next.