http.h File Reference

HTTP IO functions. More...

Go to the source code of this file.

Functions

void http_callback_404 (httpd *webserver, request *r)
 Callback for libhttpd, main entry point for captive portal.
void http_callback_wifidog (httpd *webserver, request *r)
 Callback for libhttpd.
void http_callback_about (httpd *webserver, request *r)
 Callback for libhttpd.
void http_callback_status (httpd *webserver, request *r)
 Callback for libhttpd.
void http_callback_auth (httpd *webserver, request *r)
 Callback for libhttpd, main entry point post login for auth confirmation.
void http_wifidog_header (request *r, char *title)
 Sends HTML header+menu to web browser.
void http_wifidog_footer (request *r)
 Sends HTML footer to web browser.
void http_send_redirect (request *r, char *url, char *text)
 Sends a redirect to the web browser.
void http_send_redirect_to_auth (request *r, char *urlFragment, char *text)
 Convenience function to redirect the web browser to the authe server.


Detailed Description

HTTP IO functions.

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

Definition in file http.h.


Function Documentation

void http_callback_404 ( httpd *  webserver,
request *  r 
)

Callback for libhttpd, main entry point for captive portal.

The 404 handler is also responsible for redirecting to the auth server

Definition at line 60 of file http.c.

References t_auth_serv::authserv_login_script_path_fragment, config, config_get_config(), debug, get_auth_server(), s_config::gw_address, s_config::gw_id, s_config::gw_port, http_send_redirect_to_auth(), http_wifidog_footer(), http_wifidog_header(), is_auth_online(), is_online(), MAX_BUF, and safe_asprintf().

void http_callback_about ( httpd *  webserver,
request *  r 
)

Callback for libhttpd.

Definition at line 124 of file http.c.

References http_wifidog_footer(), and http_wifidog_header().

void http_callback_auth ( httpd *  webserver,
request *  r 
)

Callback for libhttpd, main entry point post login for auth confirmation.

Definition at line 214 of file http.c.

References auth_server_request(), s_config::auth_servers, authenticate_client(), t_auth_serv::authserv_msg_script_path_fragment, client_list_append(), client_list_delete(), client_list_find(), config, config_get_config(), t_client::counters, debug, t_client::fw_connection_state, GATEWAY_MESSAGE_ACCOUNT_LOGGED_OUT, get_auth_server(), http_send_redirect_to_auth(), http_wifidog_footer(), http_wifidog_header(), t_counters::incoming, t_client::ip, LOCK_CLIENT_LIST, t_client::mac, t_counters::outgoing, REQUEST_TYPE_LOGOUT, safe_asprintf(), safe_strdup(), t_client::token, and UNLOCK_CLIENT_LIST.

void http_callback_status ( httpd *  webserver,
request *  r 
)

Callback for libhttpd.

Definition at line 132 of file http.c.

References get_status_text(), http_wifidog_footer(), and http_wifidog_header().

void http_callback_wifidog ( httpd *  webserver,
request *  r 
)

Callback for libhttpd.

Definition at line 116 of file http.c.

References http_wifidog_footer(), and http_wifidog_header().

void http_send_redirect ( request *  r,
char *  url,
char *  text 
)

Sends a redirect to the web browser.

Parameters:
r The request
url The url to redirect to
text The text to include in the redirect header and the manual redirect link title. NULL is acceptable

Definition at line 177 of file http.c.

References debug, http_wifidog_footer(), http_wifidog_header(), and safe_asprintf().

void http_send_redirect_to_auth ( request *  r,
char *  urlFragment,
char *  text 
)

Convenience function to redirect the web browser to the authe server.

Convenience function to redirect the web browser to the authe server.

Parameters:
r The request
urlFragment The end of the auth server URL to redirect to (the part after path)
text The text to include in the redirect header ant the mnual redirect title

Definition at line 147 of file http.c.

References t_auth_serv::authserv_hostname, t_auth_serv::authserv_http_port, t_auth_serv::authserv_path, t_auth_serv::authserv_ssl_port, t_auth_serv::authserv_use_ssl, get_auth_server(), http_send_redirect(), and safe_asprintf().

void http_wifidog_footer ( request *  r  ) 

Sends HTML footer to web browser.

Definition at line 383 of file http.c.

void http_wifidog_header ( request *  r,
char *  title 
)

Sends HTML header+menu to web browser.

Definition at line 286 of file http.c.

References config_get_config().


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