Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

mod_usertrack.c File Reference

#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_want.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_request.h"

Include dependency graph for mod_usertrack.c:

Go to the source code of this file.

Defines

#define APR_WANT_STRFUNC
#define COOKIE_NAME   "Apache"
#define NUM_SUBS   3

Enumerations

enum  cookie_type_e { CT_UNSET, CT_NETSCAPE, CT_COOKIE, CT_COOKIE2 }

Functions

static void make_cookie (request_rec *r)
static void set_and_comp_regexp (cookie_dir_rec *dcfg, apr_pool_t *p, const char *cookie_name)
static int spot_cookie (request_rec *r)
static void * make_cookie_log_state (apr_pool_t *p, server_rec *s)
static void * make_cookie_dir (apr_pool_t *p, char *d)
static const char * set_cookie_enable (cmd_parms *cmd, void *mconfig, int arg)
static const char * set_cookie_exp (cmd_parms *parms, void *dummy, const char *arg)
static const char * set_cookie_name (cmd_parms *cmd, void *mconfig, const char *name)
static const char * set_cookie_domain (cmd_parms *cmd, void *mconfig, const char *name)
static const char * set_cookie_style (cmd_parms *cmd, void *mconfig, const char *name)
static void register_hooks (apr_pool_t *p)

Variables

module AP_MODULE_DECLARE_DATA usertrack_module
static const command_rec cookie_log_cmds []


Define Documentation

#define APR_WANT_STRFUNC
 

Definition at line 58 of file mod_usertrack.c.

#define COOKIE_NAME   "Apache"
 

Definition at line 93 of file mod_usertrack.c.

Referenced by make_cookie_dir().

#define NUM_SUBS   3
 

Definition at line 158 of file mod_usertrack.c.

Referenced by set_cookie_name(), and spot_cookie().


Enumeration Type Documentation

enum cookie_type_e
 

Enumeration values:
CT_UNSET 
CT_NETSCAPE 
CT_COOKIE 
CT_COOKIE2 

Definition at line 74 of file mod_usertrack.c.


Function Documentation

static void make_cookie request_rec r  )  [static]
 

Definition at line 95 of file mod_usertrack.c.

References ap_get_module_config, apr_day_snames, apr_month_snames, apr_time_from_sec, APR_TIME_T_FMT, request_rec::connection, cookie_dir_rec::cookie_domain, cookie_dir_rec::cookie_name, CT_COOKIE2, CT_NETSCAPE, CT_UNSET, cookie_log_state::expires, request_rec::headers_out, server_rec::module_config, request_rec::notes, NULL, request_rec::per_dir_config, request_rec::pool, REMOTE_NAME, request_rec::request_time, request_rec::server, cookie_dir_rec::style, and usertrack_module.

Referenced by spot_cookie().

static void* make_cookie_dir apr_pool_t p,
char *  d
[static]
 

Definition at line 257 of file mod_usertrack.c.

References apr_pcalloc, cookie_dir_rec::cookie_domain, COOKIE_NAME, cookie_dir_rec::cookie_name, CT_UNSET, cookie_dir_rec::enabled, NULL, set_and_comp_regexp(), and cookie_dir_rec::style.

Here is the call graph for this function:

static void* make_cookie_log_state apr_pool_t p,
server_rec s
[static]
 

Definition at line 247 of file mod_usertrack.c.

References cookie_log_state::expires.

static void register_hooks apr_pool_t p  )  [static]
 

Definition at line 441 of file mod_usertrack.c.

References APR_HOOK_MIDDLE, NULL, and spot_cookie().

Here is the call graph for this function:

static void set_and_comp_regexp cookie_dir_rec dcfg,
apr_pool_t p,
const char *  cookie_name
[static]
 

Definition at line 160 of file mod_usertrack.c.

References ap_assert, apr_isalnum, NULL, REG_EXTENDED, cookie_dir_rec::regexp, and cookie_dir_rec::regexp_string.

Referenced by make_cookie_dir(), and set_cookie_name().

static const char* set_cookie_domain cmd_parms cmd,
void *  mconfig,
const char *  name
[static]
 

Definition at line 374 of file mod_usertrack.c.

References ap_strchr_c, cookie_dir_rec::cookie_domain, NULL, and cmd_parms_struct::pool.

static const char* set_cookie_enable cmd_parms cmd,
void *  mconfig,
int  arg
[static]
 

Definition at line 274 of file mod_usertrack.c.

References cookie_dir_rec::enabled, and NULL.

static const char* set_cookie_exp cmd_parms parms,
void *  dummy,
const char *  arg
[static]
 

Definition at line 282 of file mod_usertrack.c.

References ap_get_module_config, apr_isdigit, cookie_log_state::expires, server_rec::module_config, NULL, num, cmd_parms_struct::pool, cmd_parms_struct::server, strncasecmp(), usertrack_module, and word.

Here is the call graph for this function:

static const char* set_cookie_name cmd_parms cmd,
void *  mconfig,
const char *  name
[static]
 

Definition at line 351 of file mod_usertrack.c.

References cookie_dir_rec::cookie_name, NULL, NUM_SUBS, cmd_parms_struct::pool, regex_t::re_nsub, cookie_dir_rec::regexp, and set_and_comp_regexp().

Here is the call graph for this function:

static const char* set_cookie_style cmd_parms cmd,
void *  mconfig,
const char *  name
[static]
 

Definition at line 401 of file mod_usertrack.c.

References cmd_parms_struct::cmd, CT_COOKIE, CT_COOKIE2, CT_NETSCAPE, command_struct::name, NULL, cmd_parms_struct::pool, strcasecmp(), and cookie_dir_rec::style.

Here is the call graph for this function:

static int spot_cookie request_rec r  )  [static]
 

Definition at line 208 of file mod_usertrack.c.

References ap_get_module_config, DECLINED, cookie_dir_rec::enabled, request_rec::headers_in, request_rec::main, make_cookie(), request_rec::notes, NULL, NUM_SUBS, OK, request_rec::per_dir_config, request_rec::pool, cookie_dir_rec::regexp, and usertrack_module.

Referenced by register_hooks().

Here is the call graph for this function:


Variable Documentation

const command_rec cookie_log_cmds[] [static]
 

Initial value:

 {
    AP_INIT_TAKE1("CookieExpires", set_cookie_exp, NULL, OR_FILEINFO,
                  "an expiry date code"),
    AP_INIT_TAKE1("CookieDomain", set_cookie_domain, NULL, OR_FILEINFO,
                  "domain to which this cookie applies"),
    AP_INIT_TAKE1("CookieStyle", set_cookie_style, NULL, OR_FILEINFO,
                  "'Netscape', 'Cookie' (RFC2109), or 'Cookie2' (RFC2965)"),
    AP_INIT_FLAG("CookieTracking", set_cookie_enable, NULL, OR_FILEINFO,
                 "whether or not to enable cookies"),
    AP_INIT_TAKE1("CookieName", set_cookie_name, NULL, OR_FILEINFO,
                  "name of the tracking cookie"),
    {NULL}
}

Definition at line 427 of file mod_usertrack.c.

module AP_MODULE_DECLARE_DATA usertrack_module
 

Initial value:

Definition at line 446 of file mod_usertrack.c.

Referenced by make_cookie(), set_cookie_exp(), and spot_cookie().