ProFTPD Developer's Guide: API Typedefs

ProFTPD Version 1.2

LPARAM

Comments: Longest bitsize compatible with a scalar and largest pointer; platform dependent.

Declaration:
 typedef unsigned long LPARAM;
Source File: include/proftpd.h

UCHAR

Declaration:
 typedef unsigned char UCHAR;
Source File: include/proftpd.h

UINT

Declaration:
 typedef unsigned int UINT;
Source File: include/proftpd.h

ULONG

Declaration:
 typedef unsigned long ULONG;
Source File: include/proftpd.h

XASET_COMPARE

Declaration:
 typedef int (*XASET_COMPARE)(xasetmember_t *v1, xasetmember_t *v2);
Source File: include/sets.h

XASET_MCOPY

Declaration:
 typedef xasetmember_t* (*XASET_MCOPY)(xasetmember_t *mem);
Source File: include/sets.h

array_header

Comments: Array management

Declaration:
 typedef struct {

   /* memory pool for this object */
   pool *pool;

   /* the size of an individual element */
   int elt_size;

   /* the number of elements currently stored */
   int nelts;

   /* the number of spaces allocated */
   int nalloc;

   /* pointer to the elements stored */
   void *elts;

 } array_header;
Source File: include/pool.h

authtable

Declaration:
 typedef struct {

   /* future use */
   int auth_type;

   char *name;
     
   modret_t *(*handler)(cmd_rec *);

   module *m;
 
 } authtable;
Source File: include/modules.h

callback_t

Declaration:
 typedef int (*callback_t)(CALLBACK_FRAME);
Source File: include/proftpd.h

cdir_t

Declaration:
 typedef struct cdir_struc {

   u_int_32 address;
   u_int_32 netmask;
   class_t *class;

 } cdir_t;
Source File: include/proftpd.h

class_t

Declaration:
 typedef struct class_struc {

   struct class_struc *next;

   /* class name */
   char *name;

   /* max number of users in this class */
   int max_connections;

   /* compiled regexp */
   void *preg;

 } class_t;
Source File: include/proftpd.h

cmd_rec

Declaration:
 typedef struct cmd_struc {

   /* Memory pool for this object */
   pool *pool;

   server_rec *server;
   config_rec *config;

   /* Temporary pool which only exists while the cmd's handler is running
    */
   pool *tmp_pool;

   int argc;
   char **argv;

   /* Entire argument (excluding command) */
   char *arg;

   /* Command group */
   char *group;

   /* Command class */
   int class;

   /* Hack to speed up symbol hashing in modules.c */
   int stash_index;

   /* Private data for passing/retaining among handlers */
   privdata_t *private;

   /* Internal use */
   array_header *privarr;

 } cmd_rec;
Source File: include/dirtree.h

cmdtable

Declaration:
 typedef struct {

   /* Command phase: PRE_CMD, CMD, POST_CMD, LOG_CMD */
   int cmd_type;

   char *command;

   /* Command group */
   char *group;

   modret_t *(*handler)(cmd_rec *);

   /* Is authentication required before this command may be used? */
   int requires_auth;

   /* Is allowed to be issued during transfers? */
   int interrupt_xfer;

   int class;
   module *m;

 } cmdtable;
Source File: include/modules.h

config_rec

Declaration:
 typedef struct config_struc config_rec;
Source File: include/dirtree.h

conftable

Declaration:
 typedef struct {

   char *directive;

   modret_t *(*handler)(cmd_rec *);

   /* Reference to owning module; set when the module is initialized
    */
   module *m;

 } conftable;
Source File: include/modules.h

conn_t

Declaration:
 typedef struct conn_struc {

   /* Memory pool for this object */
   pool *pool;

   /* Current connection mode */
   int mode;

   /* Listening connection's file descriptor */
   int listen_fd;

   /* Socket receive and send sizes */
   int rcvbuf, sndbuf;

   /* Set to errno if mode == CM_ERROR */
   int xerrno;

   /* IP addresses to which we're listening */
   array_header *iplist;
   int niplist;

   /* Read and write file descriptors */
   int rfd, wfd;

   /* I/O streams */
   pr_netio_stream_t *instrm, *outstrm;

   /* Remote address of this connection */
   p_in_addr_t *remote_ipaddr;

   /* Remote port of this connection */
   int remote_port;

   /* Local address of this connection */
   p_in_addr_t *local_ipaddr;

   /* Local port of this connection */
   int local_port;

   /* Remote FQDN of this connection */
   char *remote_name;

 } conn_t;
Source File: include/inet.h

exithandler_t

Declaration:
 typedef struct _exithandler {

   struct _exithandler *next, *prev;
   void (*f)();

 } exithandler_t;
Source File: src/support.c

glob_t

Declaration:
 typedef struct {

   /* count of paths matched by the pattern */
   int gl_pathc;

   /* list of matched pathnames */
   char **gl_pathv;

   /* slots to reserve in gl_pathv */
   int gl_offs;

   /* set to FLAGS, maybe |GLOB_MAGCHAR */
   int gl_flags;

   /* if the GLOB_ALTDIRFUNC flag is set, the following
    * functions are used instead of the normal file access
    * functions.
    */

   void (*gl_closedir) __P((void *));
   struct dirent *(*gl_readdir) __P((void *));
   void *(*gl_opendir) __P((const char *));
   int (*gl_lstat) __P((const char *, struct stat *));
   int (*gl_stat) __P((const char *, struct stat *));

 } glob_t;
Source File: include/libsupp.h

hostname_t

Declaration:
 typedef struct hostname_struc {

   struct hostname_struc *next;
   char *hostname;
   class_t *class;

 } hostname_t;
Source File: include/proftpd.h

logfile_t

Declaration:
 typedef struct logfile_struc logfile_t;
Source File: modules/mod_log.c

logformat_t

Declaration:
 typedef struct logformat_struc logformat_t;
Source File: modules/mod_log.c

modret_t

Declaration:
 typedef struct modret_struc modret_t;
Source File: include/modules.h

module

Declaration:
 typedef struct module_struc module;
Source File: include/modules.h

p_in_addr_t

Declaration:
 typedef struct in_addr p_in_addr_t;
Source File: include/conf.h

pidrec_t

Declaration:
 typedef struct _pidrec {

   struct _pidrec *next, *prev;
   pid_t pid;
   int dead;

 } pidrec_t;
Source File: src/main.c

pool

Declaration:
 typedef struct pool pool;
Source File: include/pool.h

privdata_t

Declaration:
 typedef struct privdata privdata_t;
Source File: include/dirtree.h

pr_response_t

Declaration:
 typedef struct resp_struc {
   struct resp_struc *next;
   char *num;
   char *msg;

 } pr_response_t;
Source File: include/proftpd.h

pr_scoreboard_entry_t

Comments: This structure is used for writing the scoreboard file

Declaration:
 typedef struct {
   pid_t sce_pid;
   uid_t sce_uid;
   gid_t sce_gid;
   char sce_user[32];
   p_in_addr_t *sce_server_ip;
   int sce_server_port;
   char sce_server_addr[80], sce_server_name[32];
   char sce_client_addr[80];
   char sce_class[32];
   char sce_cwd[PR_TUNABLE_SCOREBOARD_BUFFER_SIZE];
   char sce_cmd[PR_TUNABLE_SCOREBOARD_BUFFER_SIZE];
   time_t sce_begin_idle, sce_begin_session;
   off_t sce_xfer_size, sce_xfer_done;

 } pr_scoreboard_entry_t;
Source File: include/scoreboard.h

pr_scoreboard_header_t

Declaration:
 typedef struct {

  /* Always 0xDEADBEEF */
  unsigned long sch_magic;

  /* Version of proftpd that created the scoreboard file */
  unsigned long sch_version;

  /* PID of the process to which this scoreboard belongs, or zero if inetd */
  pid_t sch_pid;

  /* Time when the daemon wrote this header */
  time_t sch_uptime;

} pr_scoreboard_header_t;
Source File: include/scoreboard.h

sched_t

Declaration:
 typedef struct _sched {

   struct _sched *next, *prev;
   void (*f)(void *, void *, void *, void *);
   int loops;
   void *a1, *a2, *a3, *a4;

 } sched_t;
Source File: src/support.c

server_rec

Declaration:
 typedef struct server_struc {

   struct server_struc *next, *prev;

   /* memory pool for this object */
   pool *pool;

   /* set holding all the servers */
   xaset_t *set;

   /* this server's name */
   char *ServerName;

   /* this server's address */
   char *ServerAddress;

   /* this server's fully qualified domain name */
   char *ServerFQDN;

   /* this server administrator's name */
   char *ServerAdmin;

   /* this server's welcome message */
   char *ServerMessage;

   /* port number for this server */
   int ServerPort;

   /* receive/send windows */
   int tcp_rwin, tcp_swin;

   /* specifically override the TCP rwin */
   int tcp_rwin_override;

   /* specifically override the TCP swin */
   int tcp_swin_override;

   /* do not greet until after the user's logged in */
   int AnonymousGreeting;

   /* internal address of this server */
   p_in_addr_t *ipaddr;

   /* our listening connection */
   struct conn_struc *listen;

   /* configuration details */
   xaset_t *conf;

 } server_rec;
Source File: include/dirtree.h

session_t

Declaration:
 typedef struct {

   /* Memory pool for this object */
   pool *pool;

   /* Session state flags */
   volatile int sf_flags;

   /* Session protection flags */
   volatile int sp_flags;

   /* Remote data address */
   p_in_addr_t data_addr;

   /* Remote data port */
   short data_port;

   /* Is RFC931 (ident) protocol used? */
   unsigned char ident_lookups;

   /* User identified by ident protocol */
   char *ident_user;

   /* RFC2228 authentication mechanism used */
   const char *rfc2228_mech;

   /* current working directory */
   char cwd[MAX_PATH_LEN];

   /* current virtual working directory */
   char vwd[MAX_PATH_LEN];

   /* closest matching configuration for
    * the current operation
    */
   struct config_struc *dir_config;

   /* the UIDs/GIDs are manipulated by the
    * PRIVS_* macros in privs.h
    */

   /* disable UID/GID switching */
   int disable_id_switching;

   /* currently running UID, original (ie startup)
    * UID, and current GID
    */
   uid_t uid, ouid;
   gid_t gid;

   array_header *gids;
   array_header *groups;

   /* saved file UID */
   uid_t fsuid;

   /* saved file GID */
   gid_t fsgid;

   /* username/groupname after login */
   char *user, *group;

   /* UID/GID after login, before the UID/GID fields
    * above are changed
    */
   uid_t login_uid;
   gid_t login_gid;

   /* session class */
   class_t *class;

   /* the "prefix" of our process name */
   char *proc_prefix;

   /* are we logging to wtmp? */
   int wtmp_log;

   /* control connection */
   struct conn_struc *c;

   /* data connection */
   struct conn_struc *d; 

   /* hide password from logs/ps listing */
   int hide_password;

   /* Chroot directory */
   char *chroot_path;

   /* <Anonymous> configuration */
   struct config_struc *anon_config;
           
   /* email address sent to us */
   char *anon_user;

   /* restart marked position */
   off_t restart_pos;

   struct {

     /* memory pool for this object */
     struct pool *p;

     /* xfer session attributes: default/append/hidden */
     int xfer_type;
     
     int direction;

     /* as shown to user */
     char *filename;

     /* as used in transfer */
     char *path;

     /* as used in hidden stores */
     char *path_hidden;

     char *bufstart, *buf;
     unsigned int int bufsize, buflen;
                
     /* Time current transfer started */
     struct timeval start_time;

     /* Total size of file (if known) */
     off_t file_size;

     /* Total bytes transferred */
     off_t total_bytes;

   } xfer;

   /* Total bytes transferred for this session */
   off_t total_bytes;

   /* Total number of files uploaded in this session */
   unsigned int total_files_in;

   /* Total number of files downloaded in this session */
   unsigned int total_files_out;

   /* Total number of files transferred (both uploaded and download) in this session */
   unsigned int total_files_xfer;

 } session_t;
Source File: include/proftpd.h

timer_t

Declaration:
 typedef struct timer_struc {

   struct timer_struc *next, *prev;

   /* amount of time remaining */
   long count;

   /* original length of timer */
   long interval;

   /* caller-dependent timer number */
   int timerno;

   /* module owning this timer */
   module *mod;

   /* function to call back */
   callback_t callback;

   /* internal use */
   char remove;

 } timer_t;
Source File: include/timers.h

u_int_16

Declaration:
 typedef unsigned short u_int_16;
Source File: include/proftpd.h

u_int_32

Declaration:
 typedef unsigned long u_int_32;
Source File: include/proftpd.h

u_int_8

Declaration:
 typedef unsigned char u_int_8;
Source File: include/proftpd.h

xaset_t

Declaration:
 typedef struct XAset xaset_t;
Source File: include/sets.h

xasetmember_t

Declaration:
 typedef struct XAsetmember xasetmember_t;
Source File: include/sets.h


Author: $Author: castaglia $
Last Updated: $Date: 2003/06/04 04:46:15 $


© Copyright 2000-2003 TJ Saunders
All Rights Reserved