Go to the source code of this file.
Defines | |
#define | TABLE_WIFIDOG_OUTGOING "WiFiDog_$ID$_Outgoing" |
#define | TABLE_WIFIDOG_WIFI_TO_INTERNET "WiFiDog_$ID$_WIFI2Internet" |
#define | TABLE_WIFIDOG_WIFI_TO_ROUTER "WiFiDog_$ID$_WIFI2Router" |
#define | TABLE_WIFIDOG_INCOMING "WiFiDog_$ID$_Incoming" |
#define | TABLE_WIFIDOG_AUTHSERVERS "WiFiDog_$ID$_AuthServers" |
#define | TABLE_WIFIDOG_GLOBAL "WiFiDog_$ID$_Global" |
#define | TABLE_WIFIDOG_VALIDATE "WiFiDog_$ID$_Validate" |
#define | TABLE_WIFIDOG_KNOWN "WiFiDog_$ID$_Known" |
#define | TABLE_WIFIDOG_UNKNOWN "WiFiDog_$ID$_Unknown" |
#define | TABLE_WIFIDOG_LOCKED "WiFiDog_$ID$_Locked" |
#define | TABLE_WIFIDOG_TRUSTED "WiFiDog_$ID$_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 (const char *table, const char *chain, const char *mention) |
Helper function for iptables_fw_destroy. | |
int | iptables_fw_access (fw_access_t type, const char *ip, const 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_$ID$_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_$ID$_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_$ID$_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_$ID$_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_$ID$_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_$ID$_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_$ID$_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_$ID$_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_$ID$_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_$ID$_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_$ID$_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().
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, | |
const char * | ip, | |||
const char * | mac, | |||
int | tag | |||
) |
Define the access of a specific client.
Set if a specific client has access through the firewall
Definition at line 485 of file fw_iptables.c.
References TABLE_WIFIDOG_INCOMING, and TABLE_WIFIDOG_OUTGOING.
void iptables_fw_clear_authservers | ( | void | ) |
Clears the authservers table.
Definition at line 194 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 510 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, _t_counters::outgoing, _t_counters::outgoing_history, TABLE_WIFIDOG_INCOMING, and TABLE_WIFIDOG_OUTGOING.
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 354 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 | ( | const char * | table, | |
const char * | chain, | |||
const char * | mention | |||
) |
int iptables_fw_init | ( | void | ) |
Initialize the firewall.
Initialize the firewall rules
Definition at line 220 of file fw_iptables.c.
References config_get_config(), debug, s_config::external_interface, FW_MARK_KNOWN, FW_MARK_LOCKED, FW_MARK_PROBATION, s_config::gw_address, s_config::gw_interface, s_config::gw_port, _trusted_mac_t::mac, _trusted_mac_t::next, 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, and s_config::trustedmaclist.
void iptables_fw_set_authservers | ( | void | ) |
Initializes the authservers table.
Definition at line 201 of file fw_iptables.c.
References s_config::auth_servers, config_get_config(), _auth_serv_t::last_ip, _auth_serv_t::next, and TABLE_WIFIDOG_AUTHSERVERS.