|
Packit |
284210 |
/*
|
|
Packit |
284210 |
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
|
|
Packit |
284210 |
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
|
|
Packit |
284210 |
*
|
|
Packit |
284210 |
* You may not use this file except in compliance with
|
|
Packit |
284210 |
* the License. You may obtain a copy of the License at
|
|
Packit |
284210 |
*
|
|
Packit |
284210 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
Packit |
284210 |
*
|
|
Packit |
284210 |
* If any of the files related to licensing are missing or if you have any
|
|
Packit |
284210 |
* other questions related to licensing please contact Trustwave Holdings, Inc.
|
|
Packit |
284210 |
* directly using the email address security@modsecurity.org.
|
|
Packit |
284210 |
*/
|
|
Packit |
284210 |
|
|
Packit |
284210 |
#ifndef _APACHE2_H_
|
|
Packit |
284210 |
#define _APACHE2_H_
|
|
Packit |
284210 |
|
|
Packit |
284210 |
#include "http_core.h"
|
|
Packit |
284210 |
#include "http_request.h"
|
|
Packit |
284210 |
#include "httpd.h"
|
|
Packit |
284210 |
#include "ap_release.h"
|
|
Packit |
284210 |
|
|
Packit |
284210 |
#include <apr_general.h>
|
|
Packit |
284210 |
#include <apr_optional.h>
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
#if (!defined(NO_MODSEC_API))
|
|
Packit |
284210 |
/* Optional functions. */
|
|
Packit |
284210 |
|
|
Packit |
284210 |
APR_DECLARE_OPTIONAL_FN(void, modsec_register_tfn, (const char *name, void *fn));
|
|
Packit |
284210 |
APR_DECLARE_OPTIONAL_FN(void, modsec_register_operator, (const char *name, void *fn_init, void *fn_exec));
|
|
Packit |
284210 |
APR_DECLARE_OPTIONAL_FN(void, modsec_register_variable,
|
|
Packit |
284210 |
(const char *name, unsigned int type,
|
|
Packit |
284210 |
unsigned int argc_min, unsigned int argc_max,
|
|
Packit |
284210 |
void *fn_validate, void *fn_generate,
|
|
Packit |
284210 |
unsigned int is_cacheable, unsigned int availability));
|
|
Packit |
284210 |
APR_DECLARE_OPTIONAL_FN(void, modsec_register_reqbody_processor, (const char *name, void *fn_init, void *fn_process, void *fn_complete));
|
|
Packit |
284210 |
#endif
|
|
Packit |
284210 |
|
|
Packit |
284210 |
/* ap_get_server_version() is gone in 2.3.0.
|
|
Packit |
284210 |
* It was replaced by two calls in 2.2.4 and higher:
|
|
Packit |
284210 |
* ap_get_server_banner()
|
|
Packit |
284210 |
* ap_get_server_description()
|
|
Packit |
284210 |
*/
|
|
Packit |
284210 |
#if (AP_SERVER_MAJORVERSION_NUMBER > 2) \
|
|
Packit |
284210 |
|| ((AP_SERVER_MAJORVERSION_NUMBER == 2)&& (AP_SERVER_MINORVERSION_NUMBER > 2)) \
|
|
Packit |
284210 |
|| ((AP_SERVER_MAJORVERSION_NUMBER == 2) && (AP_SERVER_MINORVERSION_NUMBER == 2) && (AP_SERVER_PATCHLEVEL_NUMBER >= 4))
|
|
Packit |
284210 |
#define apache_get_server_version() ap_get_server_banner()
|
|
Packit |
284210 |
#else
|
|
Packit |
284210 |
#define apache_get_server_version() ap_get_server_version()
|
|
Packit |
284210 |
#endif
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
/* Configuration functions. */
|
|
Packit |
284210 |
|
|
Packit |
284210 |
void DSOLOCAL *create_directory_config(apr_pool_t *mp, char *path);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
void DSOLOCAL *merge_directory_configs(apr_pool_t *mp, void *_parent, void *_child);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
void DSOLOCAL init_directory_config(directory_config *dcfg);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
/* IO functions. */
|
|
Packit |
284210 |
|
|
Packit |
284210 |
apr_status_t DSOLOCAL input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
|
|
Packit |
284210 |
ap_input_mode_t mode, apr_read_type_e block, apr_off_t nbytes);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
apr_status_t DSOLOCAL output_filter(ap_filter_t *f, apr_bucket_brigade *bb_in);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
apr_status_t DSOLOCAL read_request_body(modsec_rec *msr, char **error_msg);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
/* Utility functions */
|
|
Packit |
284210 |
|
|
Packit |
284210 |
int DSOLOCAL perform_interception(modsec_rec *msr);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
apr_status_t DSOLOCAL send_error_bucket(modsec_rec *msr, ap_filter_t *f, int status);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
int DSOLOCAL apache2_exec(modsec_rec *msr, const char *command, const char **argv, char **output);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
void DSOLOCAL record_time_checkpoint(modsec_rec *msr, int checkpoint_no);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
char DSOLOCAL *get_apr_error(apr_pool_t *p, apr_status_t rc);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
char DSOLOCAL *get_env_var(request_rec *r, char *name);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
void DSOLOCAL msr_log(modsec_rec *msr, int level, const char *text, ...) PRINTF_ATTRIBUTE(3,4);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
void DSOLOCAL msr_log_error(modsec_rec *msr, const char *text, ...) PRINTF_ATTRIBUTE(2,3);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
void DSOLOCAL msr_log_warn(modsec_rec *msr, const char *text, ...) PRINTF_ATTRIBUTE(2,3);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
char DSOLOCAL *format_error_log_message(apr_pool_t *mp, error_message_t *em);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
const DSOLOCAL char *get_response_protocol(request_rec *r);
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
#endif
|
|
Packit |
284210 |
|