brectanus 2aa6e61605 Exported API for registering custom variables. See #120.
Simple example in api/mod_var_remote_host_port.c
2007-05-03 03:26:30 +00:00
..
2007-02-06 12:29:22 +00:00
2007-02-06 12:29:22 +00:00

This directory contains two examples how you can extend
ModSecurity without having to touch it directly, simply
by creating custom Apache modules.

1)

Module mod_tfn_reverse.c creates a custom transformation
function "reverse" that reverses the content it receives
on input.

To compile simply do:

  apxs -cia mod_tfn_reverse.c

2)

Module mod_op_strstr.c creates a custom operator "strstr"
that implements fast matching using the Boyer-Moore-Horspool
algorithm.

Compiling this module is more involved because it requires
access to ModSecurity structures. For example:

  apxs -I<MODSECURITY_SOURCE_CODE> -I/usr/include/libxml2 -cia mod_op_strstr.c

3)

Module mod_var_remote_addr_port.c creates a custom variable "REMOTE_ADDR_PORT"
that combines the REMOTE_ADDR and REMOTE_PORT into a.b.c.d:port format.

Compiling this module is more involved because it requires
access to ModSecurity structures. For example:

  apxs -I<MODSECURITY_SOURCE_CODE> -cia mod_var_remote_addr_port.c