
MESSAGE PROCESSING IN A FIREWALL 

This example shows how Oracle Berkeley DB can be used to implement a 
simple firewall.  It consists of three parts.

1. Message Generator - Simulates sending messages to the application.  
It stops after 100,000 messages are generated.

2. Firewall - Receives and filters the messages, dropping messages 
found to be from blocked sites, and forwarding messages from other sites.

3. Destination - Receives the messages forwarded by the firewall and 
prints out a statement each time it processes 10,000 messages.

BUILD AND RUN

Windows

To build, install Oracle Berkeley DB 6.1 and update the INCLUDE, LIB, 
and PATH environment variables to point to the include, lib, and bin 
directories in the install path.  Next, change to the BDBFirewallExample 
directory and open FirewallExample.sln with Visual Studio.  For each 
project, Destination, Firewall, and MessageGenerator, right click the 
project and select Properties->Configuration Properties->VC++ Directories.  
Update Executable Directories, Include Directories, and Library Directories 
to include the path to the Berkeley DB install directory.  Then select 
"Build Solution" from the Build menu.  

To run the example, click or run the file RunFirewallExample.bat.

Unix/Linux

To build, install Oracle Berkeley DB 6.1 and add compiler options that 
point to the installed include directory to the environment variable CFLAG, 
and linker options that point to the installed lib directory to LDFLAGS.  
Next change to the BDBFirewallExample directory and enter the following commands:
./configure
make

To run, execute the script RunFirewallExample.sh.
