fw_iptables.h File Reference

Firewall iptables functions. More...

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.


Detailed Description

Firewall iptables functions.

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

Definition in file fw_iptables.h.


Define Documentation

#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().


Enumeration Type Documentation

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.


Function Documentation

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 
)

Helper function for iptables_fw_destroy.

Definition at line 428 of file fw_iptables.c.

References debug, and MAX_BUF.

int iptables_fw_init ( void   ) 

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.


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