Back to index

courier  0.68.2
cddrvinfo.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright 1998 - 2007 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #ifndef       cddrvinfo_h
00007 #define cddrvinfo_h
00008 
00009 #include      "mybuf.h"
00010 #include      <sys/types.h>
00011 #include      <time.h>
00012 #include      <stdio.h>
00013 
00014 #include      <list>
00015 #include      <vector>
00016 
00017 struct rw_transport;
00018 
00019 class delinfo;
00020 class dlvrhost;
00021 class rcptinfo;
00022 class pendelinfo;
00023 
00024 class drvinfo {
00025 public:
00026     struct mybuf module_from;      // Pipe from the module driver.
00027     struct rw_transport *module;
00028               // Points to the rw_transport structure libcourier.a has
00029               // allocated for the module.
00030     std::vector<delinfo> delinfo_list;
00031               // Current delivery attempts.  Array allocated at startup,
00032               // and never deallocated.  Size of the array is specified
00033               // by maxdels from the module config file
00034     std::vector<dlvrhost> hosts_list;
00035               // Hosts where current delivery attempts are going to.
00036               // Array allocated at startup.  Size of the array is specified
00037               // by maxdels from the module config file
00038     unsigned maxhost, maxrcpt;     // From the config file
00039 
00040     delinfo *delpfreefirst;
00041               // Link list of unused delinfos in delinfo_list,
00042               // linked by freenext.
00043 
00044     dlvrhost *hdlvrpfree;
00045               // Link list of unused drvhosts in hosts_list, linked by next.
00046 
00047     dlvrhost *hdlvrpfirst, *hdlvrplast;
00048               // MRU list of drvhosts in hosts_list, linked by next and prev
00049 
00050     std::list<pendelinfo> pendelinfo_list;
00051 
00052     pid_t module_pid;       // Pid of module
00053     FILE *module_to; // Pipe to the module
00054 
00055 static drvinfo *modules;
00056 static unsigned nmodules;
00057 static drvinfo *module_dsn;
00058 
00059 static void init();
00060 static void cleanup();
00061 
00062     drvinfo();
00063     ~drvinfo();
00064 } ;
00065 
00066 #endif