Go to the source code of this file.
Defines | |
#define | TABLE_WIFIDOG_OUTGOING "WiFiDog_Outgoing" |
#define | TABLE_WIFIDOG_WIFI_TO_INTERNET "WiFiDog_WIFI2Internet" |
#define | TABLE_WIFIDOG_WIFI_TO_ROUTER "WiFiDog_WIFI2Router" |
#define | TABLE_WIFIDOG_INCOMING "WiFiDog_Incoming" |
#define | TABLE_WIFIDOG_AUTHSERVERS "WiFiDog_AuthServers" |
#define | TABLE_WIFIDOG_GLOBAL "WiFiDog_Global" |
#define | TABLE_WIFIDOG_VALIDATE "WiFiDog_Validate" |
#define | TABLE_WIFIDOG_KNOWN "WiFiDog_Known" |
#define | TABLE_WIFIDOG_UNKNOWN "WiFiDog_Unknown" |
#define | TABLE_WIFIDOG_LOCKED "WiFiDog_Locked" |
#define | TABLE_WIFIDOG_TRUSTED "WiFiDog_Trusted" |
Typedefs | |
typedef enum fw_access_t_ | fw_access_t |
Enumerations | |
enum | fw_access_t_ { FW_ACCESS_ALLOW, FW_ACCESS_DENY } |
Functions | |
int | iptables_fw_init (void) |
Initialize the firewall. | |
void | iptables_fw_set_authservers (void) |
Initializes the authservers table. | |
void | iptables_fw_clear_authservers (void) |
Clears the authservers table. | |
int | iptables_fw_destroy (void) |
Destroy the firewall. | |
int | iptables_fw_destroy_mention (char *table, char *chain, char *mention) |
Helper function for iptables_fw_destroy. | |
int | iptables_fw_access (fw_access_t type, char *ip, char *mac, int tag) |
Define the access of a specific client. | |
int | iptables_fw_counters_update (void) |
All counters in the client list. |
Definition in file fw_iptables.h.
#define TABLE_WIFIDOG_AUTHSERVERS "WiFiDog_AuthServers" |
Iptable table names used by WifiDog
Definition at line 38 of file fw_iptables.h.
Referenced by iptables_fw_clear_authservers(), iptables_fw_destroy(), iptables_fw_init(), and iptables_fw_set_authservers().
#define TABLE_WIFIDOG_GLOBAL "WiFiDog_Global" |
Iptable table names used by WifiDog
Definition at line 39 of file fw_iptables.h.
Referenced by iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_INCOMING "WiFiDog_Incoming" |
Iptable table names used by WifiDog
Definition at line 37 of file fw_iptables.h.
Referenced by iptables_fw_access(), iptables_fw_counters_update(), iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_KNOWN "WiFiDog_Known" |
Iptable table names used by WifiDog
Definition at line 41 of file fw_iptables.h.
Referenced by iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_LOCKED "WiFiDog_Locked" |
Iptable table names used by WifiDog
Definition at line 43 of file fw_iptables.h.
Referenced by iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_OUTGOING "WiFiDog_Outgoing" |
Iptable table names used by WifiDog
Definition at line 34 of file fw_iptables.h.
Referenced by iptables_fw_access(), iptables_fw_counters_update(), iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_TRUSTED "WiFiDog_Trusted" |
Iptable table names used by WifiDog
Definition at line 44 of file fw_iptables.h.
Referenced by iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_UNKNOWN "WiFiDog_Unknown" |
Iptable table names used by WifiDog
Definition at line 42 of file fw_iptables.h.
Referenced by iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_VALIDATE "WiFiDog_Validate" |
Iptable table names used by WifiDog
Definition at line 40 of file fw_iptables.h.
Referenced by iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_WIFI_TO_INTERNET "WiFiDog_WIFI2Internet" |
Iptable table names used by WifiDog
Definition at line 35 of file fw_iptables.h.
Referenced by iptables_fw_destroy(), and iptables_fw_init().
#define TABLE_WIFIDOG_WIFI_TO_ROUTER "WiFiDog_WIFI2Router" |
Iptable table names used by WifiDog
Definition at line 36 of file fw_iptables.h.
Referenced by iptables_fw_destroy(), and iptables_fw_init().
typedef enum fw_access_t_ fw_access_t |
Used by iptables_fw_access to select if the client should be granted of denied access
enum fw_access_t_ |
Used by iptables_fw_access to select if the client should be granted of denied access
Definition at line 48 of file fw_iptables.h.
int iptables_fw_access | ( | fw_access_t | type, | |
char * | ip, | |||
char * | mac, | |||
int | tag | |||
) |
Define the access of a specific client.
Set if a specific client has access through the firewall
Definition at line 453 of file fw_iptables.c.
References FW_ACCESS_ALLOW, FW_ACCESS_DENY, TABLE_WIFIDOG_INCOMING, and TABLE_WIFIDOG_OUTGOING.
void iptables_fw_clear_authservers | ( | void | ) |
Clears the authservers table.
Definition at line 160 of file fw_iptables.c.
References TABLE_WIFIDOG_AUTHSERVERS.
int iptables_fw_counters_update | ( | void | ) |
All counters in the client list.
Update the counters of all the clients in the client list
Definition at line 478 of file fw_iptables.c.
References client_list_find_by_ip(), t_client::counters, debug, t_counters::incoming, t_counters::incoming_history, t_counters::last_updated, LOCK_CLIENT_LIST, t_counters::outgoing, t_counters::outgoing_history, safe_asprintf(), TABLE_WIFIDOG_INCOMING, TABLE_WIFIDOG_OUTGOING, and UNLOCK_CLIENT_LIST.
int iptables_fw_destroy | ( | void | ) |
Destroy the firewall.
Remove the firewall rules This is used when we do a clean shutdown of WiFiDog and when it starts to make sure there are no rules left over
Definition at line 327 of file fw_iptables.c.
References debug, TABLE_WIFIDOG_AUTHSERVERS, TABLE_WIFIDOG_GLOBAL, TABLE_WIFIDOG_INCOMING, TABLE_WIFIDOG_KNOWN, TABLE_WIFIDOG_LOCKED, TABLE_WIFIDOG_OUTGOING, TABLE_WIFIDOG_TRUSTED, TABLE_WIFIDOG_UNKNOWN, TABLE_WIFIDOG_VALIDATE, TABLE_WIFIDOG_WIFI_TO_INTERNET, and TABLE_WIFIDOG_WIFI_TO_ROUTER.
int iptables_fw_destroy_mention | ( | char * | table, | |
char * | chain, | |||
char * | mention | |||
) |
Helper function for iptables_fw_destroy.
Definition at line 401 of file fw_iptables.c.
References debug, MAX_BUF, and safe_asprintf().
int iptables_fw_init | ( | void | ) |
Initialize the firewall.
Initialize the firewall rules
Definition at line 186 of file fw_iptables.c.
References config, config_get_config(), debug, s_config::external_interface, FW_MARK_KNOWN, FW_MARK_LOCKED, FW_MARK_PROBATION, get_ext_iface(), s_config::gw_address, s_config::gw_interface, s_config::gw_port, LOCK_CONFIG, t_trusted_mac::mac, t_trusted_mac::next, safe_strdup(), TABLE_WIFIDOG_AUTHSERVERS, TABLE_WIFIDOG_GLOBAL, TABLE_WIFIDOG_INCOMING, TABLE_WIFIDOG_KNOWN, TABLE_WIFIDOG_LOCKED, TABLE_WIFIDOG_OUTGOING, TABLE_WIFIDOG_TRUSTED, TABLE_WIFIDOG_UNKNOWN, TABLE_WIFIDOG_VALIDATE, TABLE_WIFIDOG_WIFI_TO_INTERNET, TABLE_WIFIDOG_WIFI_TO_ROUTER, s_config::trustedmaclist, and UNLOCK_CONFIG.
void iptables_fw_set_authservers | ( | void | ) |
Initializes the authservers table.
Definition at line 167 of file fw_iptables.c.
References s_config::auth_servers, config, config_get_config(), t_auth_serv::last_ip, t_auth_serv::next, and TABLE_WIFIDOG_AUTHSERVERS.