Source code Files
~~~~~~~~~~~~~~~~~
Always compiled:
  main.c      - General setup. Listen for and fork new sessions.
  ftp-proxy.c - session setup. Data connection forwarding.
  control.c   - Control session parsing commands.
  ftp-cmds.c  - List of ftp commands and functions to act on them.
  misc.c      - Miscellaneous functions, mainly socket stuff.
  linux.c     - Kernel specific stuff - ie. the transparent proxying code.
  configs.c   - Config file parsing, and carrying out some config file options.

Conditionally compiled:
  ntp.c       - Non transparent proxy support. (default on)
  linux.c     - Data connection NAT stuff.
  cache.c     - Generic cache code.
  httpcache.c - Cache module to route requests through an HTTP proxy.
 localcache.c - Local caching module.
  cachemgr.c  - Cache manager code for local cache.

Important Functions
~~~~~~~~~~~~~~~~~~~
The main loop is run_daemon() in main.c - it forks a new process for
each new connection and only terminates when sent a SIGKILL/SIGSTOP.

Each new connection starts in init_session() which gets a USER command
for ntp if necessary, makes the connection to the remote host, and
initialises the cache if this is an anonymous session.

run_loop() is the main loop for each session. It just loops calling
get_control_line() and {client,data}_control_forward().

get_control_line() selects on the necessary fds. It deals with
accepting and forwarding data connections as necessary, and only
returns once it has the control line it was asked for. If it was asked
for a control line from one of the client/server and data arrives on
the other it is buffered.

extract_{server,client}_cmd() are the functions which do the initial
reading and parsing of the raw control streams.

write_all() writes a buffer to an fd, and if it doesn't succeed before
timeout quits. This will probably go and be replaced by setting an
alarm() and quitting if SIGALRM arrives before it is reset.

Bugs/TODO
~~~~~~~~~

ftp-proxy.c, control.c and ftp-cmds.c have code which is probably in
the wrong file.

Header files could do with a reorganisation (ie. what goes in
common.h)

