FTP Proxy Server
Copyright(C) 2002 by Dmitry Udalov

Project files.
-------------
ftpp 		compiled FTP Proxy
ftppd		Shell for service ftpp.
adbmtool.h	Address database manager header.
adbmtool.cc	Address database manager routines.
cfgtool.cc	Configuration routines.
ctrlcmd.cc	FTP control commans handlers.
datacmd.cc	FTP data transfer commands handlers.
ftpp.conf	Configuration file.
ftppmain.cc	Main program file.
ftpproxy.cc	Main file for FTP proxy.
ftpproxy.h	Header file for all previos cc files.
logtool.cc	Log files routines.
scantool.cc	Scan net process.
cantool.h  	Header for scantool.cc.
unitools.cc	Useful rountines.
unitools.h 	Header for unitools.cc
Makefile	Make file for project

FTP Proxy work description.
---------------------------
Before start FTP Proxy need configure them. E.g. write parametrs to
ftpp.conf. Descriptions of ftpp.conf see follow. 

Important: IN TRANSPARENT MODE `root` RIGHTS FOR WORKING NEED!!!

FTP proxy in transparent mode must start after configure redirect 
chains with ipchains. For set redirect chains with ipchains tools use
follow command:

ipchains -A input -p TCP --dport 21 -j REDIRECT %dportnum

where:
%dportnum - port number which is working port for FTP Proxy.

Port number which set for redirect nessecary write to ftpp.conf file
as WORKINGPORT parametr. In next moment nessecary start ftppproxy.
For this target start file ftppd with argument `start`:

./ftppd start

For stopping FTP Proxy run follow command:

./ftppd stop

FTP Proxy configuration file format:
-----------------------------------
TRANSPARENTFTPP	- server working mode:
1 - need work as transparent ftp proxy, e.g. with netware scaner and redirect.
0 - need work as simple proxy server.
Example: TRANSPARENTFTPP 1

WORKINGADDR 	IP address of FTP Proxy, as string in format: %d.%d.%d.%d, 
without `"` and other dividers. 
Example: WORKINGADDR 127.0.0.1

WORKINGPORT 	Port number which listen server and accept clients. Digital value.
Example: WORKINGPORT 8021

MAXCLIENTS	Maximum clients number at one moment of time. Digital value.
Example: MAXCLIENTS 200

NETINTERFACE 	Netware interface for scanning netware. Can be lo, eth0, eth1 and others. String. 
Without `"` chars and other dividers.
Example: NETINTERFACE lo

SCANFILTER 	Filter for netware scaner. String. Without `"` chars and other dividers.
Example:SCANFILTER ip proto TCP && dst port 21

ADBMDELTIMEOUT 	Timeout for store ip addresses at database. Seconds. 
Example: ADBMDELTIMEOUT 15

ADDMREADTIMEOUT Timeout for wait before find address at database.
Example: ADDMREADTIMEOUT 500

MAXFILESIZE 	Maximum file size for transffered in bytes. 
Example: MAXFILESIZE 100000000

DEBUGLOGENABLE	Enable debug log flag.
1 - save debug log.
0 - don't save log.
Example: DEBUGLOGENABLE 1

LOGPATH 	Path for store debug log file. String value. 
Without `"` chars and other dividers.
Example: LOGPATH /home/admin/logs

LOGACCESSPATH 	Path for store data transfer statistics log file. String. 
Without `"` chars and other dividers.
Example: LOGACCESSPATH /home/admin/logs

At end of file must be list of ip addresses. Clients can connect to server 
ip address of which exists in this list.
Format of records follow: %d.%d.%d.%d, e.g. IP address.
Example:
127.0.0.1
193.233.88.39
193.233.88.37
193.233.88.77
193.233.88.246
172.16.172.34
192.168.10.183


Access log file format
----------------------
Access log file content information about all data transffer sessions. Every 
record at access log content following fields:
1. Date and time of session. Digital value.
2. Size of transffered data, bytes.
3. Clients IP address as string in format hhh.hhh.hhh.hhh.
4. Result of data transffer session:
   0 - succeful.
   1 - aborted by user.
   2 - error.
5. Time of session in seconds.
6. Server IP address as string in format hhh.hhh.hhh.hhh.
7. File name or command as string.








