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

mod_setenvif.c File Reference

#include "apr.h"
#include "apr_strings.h"
#include "apr_strmatch.h"
#include "apr_want.h"
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"

Include dependency graph for mod_setenvif.c:

Go to the source code of this file.

Defines

#define APR_WANT_STRFUNC
#define ICASE_MAGIC   ((void *)(&setenvif_module))
#define SEI_MAGIC_HEIRLOOM   "setenvif-phase-flag"

Enumerations

enum  special {
  SPECIAL_NOT, SPECIAL_REMOTE_ADDR, SPECIAL_REMOTE_HOST, SPECIAL_REQUEST_URI,
  SPECIAL_REQUEST_METHOD, SPECIAL_REQUEST_PROTOCOL, SPECIAL_SERVER_ADDR
}

Functions

static void * create_setenvif_config (apr_pool_t *p)
static void * create_setenvif_config_svr (apr_pool_t *p, server_rec *dummy)
static void * create_setenvif_config_dir (apr_pool_t *p, char *dummy)
static void * merge_setenvif_config (apr_pool_t *p, void *basev, void *overridesv)
static int is_header_regex (apr_pool_t *p, const char *name)
static const char * non_regex_pattern (apr_pool_t *p, const char *s)
static const char * add_setenvif_core (cmd_parms *cmd, void *mconfig, char *fname, const char *args)
static const char * add_setenvif (cmd_parms *cmd, void *mconfig, const char *args)
static const char * add_browser (cmd_parms *cmd, void *mconfig, const char *args)
static int match_headers (request_rec *r)
static void register_hooks (apr_pool_t *p)

Variables

module AP_MODULE_DECLARE_DATA setenvif_module
static const command_rec setenvif_module_cmds []


Define Documentation

#define APR_WANT_STRFUNC
 

Definition at line 87 of file mod_setenvif.c.

#define ICASE_MAGIC   ((void *)(&setenvif_module))
 

Definition at line 165 of file mod_setenvif.c.

Referenced by add_setenvif_core().

#define SEI_MAGIC_HEIRLOOM   "setenvif-phase-flag"
 

Definition at line 166 of file mod_setenvif.c.

Referenced by match_headers().


Enumeration Type Documentation

enum special
 

Enumeration values:
SPECIAL_NOT 
SPECIAL_REMOTE_ADDR 
SPECIAL_REMOTE_HOST 
SPECIAL_REQUEST_URI 
SPECIAL_REQUEST_METHOD 
SPECIAL_REQUEST_PROTOCOL 
SPECIAL_SERVER_ADDR 

Definition at line 98 of file mod_setenvif.c.


Function Documentation

static const char* add_browser cmd_parms cmd,
void *  mconfig,
const char *  args
[static]
 

Definition at line 419 of file mod_setenvif.c.

References add_setenvif_core().

Here is the call graph for this function:

static const char* add_setenvif cmd_parms cmd,
void *  mconfig,
const char *  args
[static]
 

Definition at line 400 of file mod_setenvif.c.

References add_setenvif_core(), cmd_parms_struct::cmd, fname, command_struct::name, NULL, and cmd_parms_struct::pool.

Here is the call graph for this function:

static const char* add_setenvif_core cmd_parms cmd,
void *  mconfig,
char *  fname,
const char *  args
[static]
 

Definition at line 251 of file mod_setenvif.c.

References ap_get_module_config, cmd_parms_struct::cmd, sei_cfg_rec::conditionals, apr_array_header_t::elts, entries, ICASE_MAGIC, cmd_parms_struct::info, is_header_regex(), server_rec::module_config, name, command_struct::name, apr_array_header_t::nelts, non_regex_pattern(), NULL, cmd_parms_struct::path, cmd_parms_struct::pool, REG_EXTENDED, REG_ICASE, REG_NOSUB, regex, sconf, cmd_parms_struct::server, setenvif_module, SPECIAL_NOT, SPECIAL_REMOTE_ADDR, SPECIAL_REMOTE_HOST, SPECIAL_REQUEST_METHOD, SPECIAL_REQUEST_PROTOCOL, SPECIAL_REQUEST_URI, SPECIAL_SERVER_ADDR, and strcasecmp().

Referenced by add_browser(), and add_setenvif().

Here is the call graph for this function:

static void* create_setenvif_config apr_pool_t p  )  [static]
 

Definition at line 133 of file mod_setenvif.c.

Referenced by create_setenvif_config_dir(), and create_setenvif_config_svr().

static void* create_setenvif_config_dir apr_pool_t p,
char *  dummy
[static]
 

Definition at line 146 of file mod_setenvif.c.

References create_setenvif_config().

Here is the call graph for this function:

static void* create_setenvif_config_svr apr_pool_t p,
server_rec dummy
[static]
 

Definition at line 141 of file mod_setenvif.c.

References create_setenvif_config().

Here is the call graph for this function:

static int is_header_regex apr_pool_t p,
const char *  name
[static]
 

Definition at line 168 of file mod_setenvif.c.

References ap_assert, NULL, preg, REG_EXTENDED, and REG_NOSUB.

Referenced by add_setenvif_core().

static int match_headers request_rec r  )  [static]
 

Definition at line 447 of file mod_setenvif.c.

References ap_get_module_config, AP_MAX_REG_MATCH, ap_set_module_config, apr_strmatch, arr, b, sei_cfg_rec::conditionals, request_rec::connection, DECLINED, apr_array_header_t::elts, entries, sei_entry::features, request_rec::headers_in, apr_table_entry_t::key, conn_rec::local_ip, request_rec::method, server_rec::module_config, sei_entry::name, nelts, NULL, sei_entry::pattern, request_rec::per_dir_config, sei_entry::pnamereg, request_rec::pool, sei_entry::preg, request_rec::protocol, conn_rec::remote_ip, REMOTE_NAME, request_rec::request_config, sconf, SEI_MAGIC_HEIRLOOM, request_rec::server, setenvif_module, SPECIAL_NOT, SPECIAL_REMOTE_ADDR, SPECIAL_REMOTE_HOST, SPECIAL_REQUEST_METHOD, SPECIAL_REQUEST_PROTOCOL, SPECIAL_REQUEST_URI, SPECIAL_SERVER_ADDR, sei_entry::special_type, request_rec::subprocess_env, request_rec::uri, apr_table_entry_t::val, and val.

Referenced by register_hooks().

static void* merge_setenvif_config apr_pool_t p,
void *  basev,
void *  overridesv
[static]
 

Definition at line 151 of file mod_setenvif.c.

References apr_array_append(), apr_pcalloc, base, and sei_cfg_rec::conditionals.

Here is the call graph for this function:

static const char* non_regex_pattern apr_pool_t p,
const char *  s
[static]
 

Definition at line 192 of file mod_setenvif.c.

References NULL, and src.

Referenced by add_setenvif_core().

static void register_hooks apr_pool_t p  )  [static]
 

Definition at line 571 of file mod_setenvif.c.

References APR_HOOK_MIDDLE, match_headers(), and NULL.

Here is the call graph for this function:


Variable Documentation

module AP_MODULE_DECLARE_DATA setenvif_module
 

Initial value:

Definition at line 577 of file mod_setenvif.c.

Referenced by add_setenvif_core(), and match_headers().

const command_rec setenvif_module_cmds[] [static]
 

Initial value:

{
    AP_INIT_RAW_ARGS("SetEnvIf", add_setenvif, NULL, OR_FILEINFO,
                     "A header-name, regex and a list of variables."),
    AP_INIT_RAW_ARGS("SetEnvIfNoCase", add_setenvif, ICASE_MAGIC, OR_FILEINFO,
                     "a header-name, regex and a list of variables."),
    AP_INIT_RAW_ARGS("BrowserMatch", add_browser, NULL, OR_FILEINFO,
                     "A browser regex and a list of variables."),
    AP_INIT_RAW_ARGS("BrowserMatchNoCase", add_browser, ICASE_MAGIC,
                     OR_FILEINFO,
                     "A browser regex and a list of variables."),
    { NULL },
}

Definition at line 424 of file mod_setenvif.c.