auth.h File Reference

Authentication handling thread. More...

Go to the source code of this file.

Data Structures

struct  t_authresponse
 This structure contains all the information returned by the authentication server. More...

Enumerations

enum  t_authcode {
  AUTH_ERROR = -1, AUTH_DENIED = 0, AUTH_ALLOWED = 1, AUTH_VALIDATION = 5,
  AUTH_VALIDATION_FAILED = 6, AUTH_LOCKED = 254
}
 Authentication codes returned by auth server. More...

Functions

void authenticate_client (request *)
 Authenticate a single client against the central server.
void thread_client_timeout_check (void *arg)
 Periodically check if connections expired.


Detailed Description

Authentication handling thread.

Author:
Copyright (C) 2004 Alexandre Carmel-Veilleux <acv@miniguru.ca>

Definition in file auth.h.


Enumeration Type Documentation

enum t_authcode

Authentication codes returned by auth server.

Authentication result codes returned by auth_server_request() corresponding to result code from the central server itself.

Enumerator:
AUTH_ERROR  An error occured during the validation process
AUTH_DENIED  Client was denied by the auth server
AUTH_ALLOWED  Client was granted access by the auth server
AUTH_VALIDATION  A misnomer. Client is in 15 min probation to validate his new account
AUTH_VALIDATION_FAILED  Client had X minutes to validate account by email and didn't = too late
AUTH_LOCKED  Account has been locked

Definition at line 38 of file auth.h.


Function Documentation

void authenticate_client ( request *  r  ) 

Authenticate a single client against the central server.

Authenticates a single client against the central server and returns when done Alters the firewall rules depending on what the auth server says

Parameters:
r httpd request struct

Definition at line 94 of file auth.c.

References AUTH_ALLOWED, AUTH_DENIED, AUTH_ERROR, auth_server_request(), AUTH_VALIDATION, AUTH_VALIDATION_FAILED, t_authresponse::authcode, t_auth_serv::authserv_msg_script_path_fragment, t_auth_serv::authserv_portal_script_path_fragment, client_list_find(), client_list_find_by_ip(), config, config_get_config(), debug, t_client::fw_connection_state, FW_MARK_KNOWN, FW_MARK_PROBATION, GATEWAY_MESSAGE_ACCOUNT_VALIDATION_FAILED, GATEWAY_MESSAGE_ACTIVATE_ACCOUNT, GATEWAY_MESSAGE_DENIED, get_auth_server(), s_config::gw_id, http_send_redirect_to_auth(), http_wifidog_footer(), http_wifidog_header(), t_client::ip, LOCK_CLIENT_LIST, t_client::mac, REQUEST_TYPE_LOGIN, safe_asprintf(), safe_strdup(), served_this_session, t_client::token, and UNLOCK_CLIENT_LIST.

void thread_client_timeout_check ( void *  arg  ) 

Periodically check if connections expired.

Launches a thread that periodically checks if any of the connections has timed out

Parameters:
arg Must contain a pointer to a string containing the IP adress of the client to check to check
Todo:
Also pass MAC adress?

This thread loops infinitely, need a watchdog to verify that it is still running?

Definition at line 63 of file auth.c.

References s_config::checkinterval, config_get_config(), and debug.


Generated on Sun Apr 13 21:55:00 2008 for WifiDog by  doxygen 1.5.3