ProFTPD Developer's Guide: "Module" Tables

ProFTPD Version 1.2

Table of Contents

"Module" Tables
The module table defines the main interface between the module and the core ProFTPD engine, providing pointers to the other handler tables, giving a name to the module, etc etc. The API version used by the module is denoted as well, so that ProFTPD can recognize whether it is capable of using this module, or whether the given API version is too old or too new. As ProFTPD maintains an internal list of modules in a doubly-linked list arrangment, the table defines two pointers to the others which are set when ProFTPD starts; do not define these fields yourself.

Each module can supply up to two initialization routines via this module table. The first initialization function is called immediately after the module is loaded, while the second is called after ProFTPD is connected to a client, and the main ProFTPD server (if not in inetd mode) has forked off. The second initialization function's purpose is to let the module perform any necessary preparatory work once a client is connected and ProFTPD is ready to provide service to the new client. In inetd mode, the "child init" function will be called immediately after ProFTPD is loaded, because ProFTPD is always in "child mode" when run from inetd. Note that both of these initialization routines are optional. If you don't need them, or only need one, simply set the function pointer to NULL in the module table.



module sample_module = {

  /* pointer to the next module -- always NULL (set internally) */

  /* pointer to the previous module -- always NULL (set internally) */

  /* Module API version (current version: 2.0) */

  /* this module's name */

  /* module configuration handler table */

  /* module command handler table */

  /* module authentication handler table */

  /* module initialization function */

  /* module "child mode" post-fork initialization function */

Table of Contents

Author: $Author: castaglia $
Last Updated: $Date: 2003/01/02 17:39:36 $

© Copyright 2000-2003 TJ Saunders
All Rights Reserved