services.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * (C) 2003-2007 Anope Team
00004  * Contact us at info@anope.org
00005  *
00006  * Please read COPYING and README for furhter details.
00007  *
00008  * Based on the original code of Epona by Lara.
00009  * Based on the original code of Services by Andy Church. 
00010  * 
00011  *
00012  */
00013 
00014 #ifndef SERVICES_H
00015 #define SERVICES_H
00016 
00017 /*************************************************************************/
00018 
00019 #include "sysconf.h"
00020 #include "config.h"
00021 
00022 #ifndef MAX_CMD_HASH
00023 #define MAX_CMD_HASH 1024
00024 #endif
00025 
00026 /* Some Linux boxes (or maybe glibc includes) require this for the
00027  * prototype of strsignal(). */
00028 #ifndef _GNU_SOURCE
00029 #define _GNU_SOURCE
00030 #endif
00031 
00032 /* Some SUN fixs */
00033 #ifdef __sun
00034 /* Solaris specific code, types that do not exist in Solaris'
00035  * sys/types.h
00036  **/
00037 #undef u_int8_t
00038 #undef u_int16_t
00039 #undef u_int32_t
00040 #undef u_int_64_t
00041 #define u_int8_t uint8_t
00042 #define u_int16_t uint16_t
00043 #define u_int32_t uint32_t
00044 #define u_int64_t uint64_t
00045 
00046 #ifndef INADDR_NONE
00047 #define INADDR_NONE (-1)
00048 #endif
00049 
00050 #endif
00051 
00052 
00053 #include <stdarg.h>
00054 #include <stdio.h>
00055 #include <stdlib.h>
00056 #include <string.h>
00057 
00058 /* Windows does not have:
00059  * unistd.h, grp.h,
00060  * netdb.h, netinet/in.h,
00061  * sys/socket.h, sys/time.h
00062  * Windows requires:
00063  * winsock.h
00064  * -- codemastr
00065  */
00066 
00067 #ifndef _WIN32
00068 #include <unistd.h>
00069 #endif
00070 
00071 #include <signal.h>
00072 #include <time.h>
00073 #include <errno.h>
00074 
00075 #ifndef _WIN32
00076 #include <grp.h>
00077 #endif
00078 
00079 #include <limits.h>
00080 
00081 #ifndef _WIN32
00082 #include <netdb.h>
00083 #include <netinet/in.h>
00084 #include <arpa/inet.h>
00085 #include <sys/socket.h>
00086 #else
00087 #include <winsock.h>
00088 #include <windows.h>
00089 #endif
00090 
00091 #include <sys/stat.h>   /* for umask() on some systems */
00092 #include <sys/types.h>
00093 
00094 #ifndef _WIN32
00095 #include <sys/time.h>
00096 #endif
00097 
00098 #ifdef _WIN32
00099 #include <sys/timeb.h>
00100 #include <direct.h>
00101 #include <io.h>
00102 #endif
00103 
00104 #include <fcntl.h>
00105 
00106 #ifndef _WIN32
00107 #ifdef HAVE_BACKTRACE
00108 #include <execinfo.h>
00109 #endif
00110 #endif
00111 
00112 #ifndef _WIN32
00113 #include <dirent.h>
00114 #endif
00115 
00116 #ifdef _WIN32
00117 /* VS2008 hates having this define before its own */
00118 #define vsnprintf               _vsnprintf
00119 #endif
00120 
00121 #ifdef USE_RDB
00122 # define MAX_SQL_BUF   4096
00123 #endif
00124 
00125 #ifdef USE_MYSQL
00126 # define MYSQL_WARNING 2
00127 # define MYSQL_ERROR   4
00128 # define MYSQL_DEFAULT_PORT 3306
00129 #ifdef MYSQL_HEADER_PREFIX
00130 # include <mysql/mysql.h>
00131 # include <mysql/errmsg.h>
00132 #else
00133 # include <mysql.h>
00134 # include <errmsg.h>
00135 #endif
00136 #endif
00137 
00138 #if HAVE_STRINGS_H
00139 # include <strings.h>
00140 #endif
00141 
00142 #if HAVE_SYS_SELECT_H
00143 # include <sys/select.h>
00144 #endif
00145 
00146 #include "sockets.h"
00147 
00148 #ifndef va_copy
00149 # ifdef __va_copy
00150 #  define VA_COPY(DEST,SRC) __va_copy((DEST),(SRC))
00151 # else
00152 #  define VA_COPY(DEST, SRC) memcpy ((&DEST), (&SRC), sizeof(va_list))
00153 # endif
00154 #else
00155 # ifdef HAVE_VA_LIST_AS_ARRAY
00156 #   define VA_COPY(DEST,SRC) (*(DEST) = *(SRC))
00157 # else
00158 #   define VA_COPY(DEST, SRC) va_copy(DEST, SRC)
00159 # endif
00160 #endif 
00161 
00162 #ifdef _AIX
00163 /* Some AIX boxes seem to have bogus includes that don't have these
00164  * prototypes. */
00165 extern int strcasecmp(const char *, const char *);
00166 extern int strncasecmp(const char *, const char *, size_t);
00167 # if 0  /* These break on some AIX boxes (4.3.1 reported). */
00168 extern int gettimeofday(struct timeval *, struct timezone *);
00169 extern int socket(int, int, int);
00170 extern int bind(int, struct sockaddr *, int);
00171 extern int connect(int, struct sockaddr *, int);
00172 extern int shutdown(int, int);
00173 # endif
00174 # undef FD_ZERO
00175 # define FD_ZERO(p) memset((p), 0, sizeof(*(p)))
00176 #endif /* _AIX */
00177 
00178 /* Alias stricmp/strnicmp to strcasecmp/strncasecmp if we have the latter
00179  * but not the former. */
00180 #if !HAVE_STRICMP && HAVE_STRCASECMP
00181 # define stricmp strcasecmp
00182 # define strnicmp strncasecmp
00183 #endif
00184 
00185 /* We have our own versions of toupper()/tolower(). */
00186 #include <ctype.h>
00187 #undef tolower
00188 #undef toupper
00189 #define tolower tolower_
00190 #define toupper toupper_
00191 
00192 /* We also have our own encrypt(). */
00193 #define encrypt encrypt_
00194 
00195 
00196 #ifdef __WINS__
00197 #ifndef BKCHECK
00198 #define BKCHECK
00199   extern "C" void __pfnBkCheck() {}
00200 #endif
00201 #endif
00202 
00203 
00204 #if INTTYPE_WORKAROUND
00205 # undef int16
00206 # undef int32
00207 #endif
00208 
00209 
00210 /* Miscellaneous definitions. */
00211 #include "defs.h"
00212 #include "slist.h"
00213 #include "events.h"
00214 
00215 /*************************************************************************/
00216 
00217 typedef struct server_ Server;
00218 typedef struct user_ User;
00219 typedef struct channel_ Channel;
00220 typedef struct ModuleData_ ModuleData;          /* ModuleData struct */
00221 typedef struct memo_ Memo;
00222 typedef struct nickrequest_ NickRequest;
00223 typedef struct nickalias_ NickAlias;
00224 typedef struct nickcore_ NickCore;
00225 typedef struct botinfo_ BotInfo;
00226 typedef struct chaninfo_ ChannelInfo;
00227 typedef struct badword_ BadWord;
00228 typedef struct bandata_ BanData;
00229 typedef struct userdata_ UserData;
00230 typedef struct mailinfo_ MailInfo;
00231 typedef struct akill_ Akill;
00232 typedef struct sxline_ SXLine;
00233 typedef struct hostcore_ HostCore;
00234 typedef struct newsitem_ NewsItem;
00235 typedef struct exception_ Exception;
00236 typedef struct cbmode_ CBMode;
00237 typedef struct cbmodeinfo_ CBModeInfo;
00238 typedef struct cmmode_ CMMode;
00239 typedef struct csmode_ CSMode;
00240 typedef struct cumode_ CUMode;
00241 typedef struct csmodeutil_ CSModeUtil;
00242 typedef struct session_ Session;
00243 typedef struct uid_ Uid;
00244 
00245 /*************************************************************************/
00246 
00247 /* Windows defines a boolean type as an 
00248  * unsigned char. It does however need
00249  * true/false. -- codemastr
00250  */
00251 #ifndef _WIN32
00252 typedef enum { false, true } boolean;
00253 #else
00254  #ifndef true
00255   #define true 1
00256  #endif
00257  #ifndef false
00258   #define false 0
00259  #endif
00260 #endif /* _WIN32 */
00261 
00262 /*************************************************************************/
00263 
00264 /* Protocol tweaks */
00265 
00266 typedef struct ircdvars_ IRCDVar;
00267 typedef struct ircdcapab_ IRCDCAPAB;
00268 
00269 struct ircdvars_ {
00270     char *name;             /* Name of the ChanServ command */
00271     char *nickservmode;         /* Mode used by NickServ    */
00272     char *chanservmode;         /* Mode used by ChanServ    */
00273     char *memoservmode;         /* Mode used by MemoServ    */
00274     char *hostservmode;         /* Mode used by HostServ    */
00275     char *operservmode;         /* Mode used by OperServ    */
00276     char *botservmode;          /* Mode used by BotServ     */
00277     char *helpservmode;         /* Mode used by HelpServ    */
00278     char *devnullmode;          /* Mode used by Dev/Null    */
00279     char *globalmode;           /* Mode used by Global      */
00280     char *nickservaliasmode;        /* Mode used by NickServ Alias  */
00281     char *chanservaliasmode;        /* Mode used by ChanServ Alias  */
00282     char *memoservaliasmode;        /* Mode used by MemoServ Alias  */
00283     char *hostservaliasmode;        /* Mode used by HostServ Alias  */
00284     char *operservaliasmode;        /* Mode used by OperServ Alias  */
00285     char *botservaliasmode;         /* Mode used by BotServ  Alias  */
00286     char *helpservaliasmode;        /* Mode used by HelpServ Alias  */
00287     char *devnullvaliasmode;        /* Mode used by Dev/Null Alias  */
00288     char *globalaliasmode;          /* Mode used by Global   Alias  */
00289     char *botserv_bot_mode;         /* Mode used by BotServ Bots    */
00290     int max_symbols;            /* Chan Max Symbols     */
00291     char *modestoremove;            /* Channel Modes to remove  */
00292     char *botchanumode;         /* Modes set when botserv joins a channel */
00293     int svsnick;                /* Supports SVSNICK     */
00294     int vhost;              /* Supports vhost       */
00295     int owner;              /* Supports Owner       */
00296     char *ownerset;             /* Mode to set for owner    */
00297     char *ownerunset;           /* Mode to unset for a owner    */
00298     char *adminset;             /* Mode to set for admin    */
00299     char *adminunset;           /* Mode to unset for admin  */
00300     char *modeonreg;            /* Mode on Register     */
00301     char *rootmodeonid;                     /* Mode on ID for ROOTS         */
00302     char *adminmodeonid;                    /* Mode on ID for ADMINS        */
00303     char *opermodeonid;                     /* Mode on ID for OPERS         */
00304     char *modeonunreg;          /* Mode on Unregister       */
00305     char *modeonnick;           /* Mode on nick change      */
00306     int sgline;             /* Supports SGline      */
00307     int sqline;             /* Supports SQline      */
00308     int szline;             /* Supports SZline      */
00309     int halfop;             /* Supports HalfOp      */
00310     int numservargs;            /* Number of Server Args    */
00311     int join2set;               /* Join 2 Set Modes     */
00312     int join2msg;               /* Join 2 Message       */
00313     int except;             /* exception +e         */
00314     int topictsforward;         /* TS on Topics Forward     */
00315     int topictsbackward;            /* TS on Topics Backward    */
00316     uint32 protectedumode;          /* What is the Protected Umode  */
00317     int admin;              /* Has Admin            */
00318     int chansqline;             /* Supports Channel Sqlines */
00319     int quitonkill;             /* IRCD sends QUIT when kill    */
00320     int svsmode_unban;          /* svsmode can be used to unban */
00321     int protect;                /* Has protect modes        */
00322     int reversekickcheck;           /* Can reverse ban check    */
00323     int chanreg;                /* channel mode +r for register */
00324     uint32 regmode;             /* Mode to use for +r       */
00325     int vident;             /* Supports vidents     */
00326     int svshold;                /* Supports svshold     */
00327     int tsonmode;               /* Timestamp on mode changes    */
00328     int nickip;                 /* Sends IP on NICK     */
00329     int omode;                  /* On the fly o:lines       */
00330     int umode;                  /* change user modes        */
00331     int nickvhost;              /* Users vhost sent during NICK */
00332     int chgreal;                /* Change RealName      */
00333     uint32 noknock;             /* Channel Mode for no knock    */
00334     uint32 adminmode;           /* Admin Only Channel Mode  */
00335     uint32 defmlock;            /* Default mlock modes      */
00336     uint32 vhostmode;           /* Vhost mode           */
00337     int fmode;                  /* +f               */
00338     int Lmode;                  /* +L               */
00339     uint32 chan_fmode;          /* Mode             */
00340     uint32 chan_lmode;          /* Mode             */
00341     int check_nick_id;          /* On nick change check if they could be identified */
00342     int knock_needs_i;          /* Check if we needed +i when setting NOKNOCK */
00343     char *chanmodes;            /* If the ircd sends CHANMODE in CAPAB this is where we store it */
00344     int token;                  /* Does Anope support the tokens for the ircd */
00345     int tokencaseless;          /* TOKEN are not case senstive - most its Unreal that is case senstive */
00346     int sjb64;                  /* Base 64 encode TIMESTAMP */
00347     int invitemode;             /* +I  */
00348     int sjoinbanchar;           /* use single quotes to define it */
00349     int sjoinexchar;            /* use single quotes to define it */
00350     int sjoininvchar;           /* use single quotes to define it */
00351     int svsmode_ucmode;         /* Can remove User Channel Modes with SVSMODE */
00352     int sglineenforce;
00353     char *vhostchar;            /* char used for vhosting */
00354     int ts6;                    /* ircd is TS6 */
00355     int supporthelper;          /* +h helper umodes */
00356     int p10;                    /* ircd is P10  */
00357     char *nickchars;            /* character set */
00358     int sync;                   /* reports sync state */
00359 };
00360 
00361 struct ircdcapab_ {
00362   uint32 noquit;
00363   uint32 tsmode;
00364   uint32 unconnect;  
00365   uint32 nickip;
00366   uint32 nsjoin;
00367   uint32 zip;
00368   uint32 burst;
00369   uint32 ts5;
00370   uint32 ts3;
00371   uint32 dkey;
00372   uint32 pt4;
00373   uint32 scs;
00374   uint32 qs;
00375   uint32 uid;
00376   uint32 knock;
00377   uint32 client;
00378   uint32 ipv6;
00379   uint32 ssj5;
00380   uint32 sn2;
00381   uint32 token;
00382   uint32 vhost;
00383   uint32 ssj3;
00384   uint32 nick2;
00385   uint32 umode2;
00386   uint32 vl;
00387   uint32 tlkext;
00388   uint32 dodkey;
00389   uint32 dozip;
00390   uint32 chanmodes;
00391   uint32 sjb64;
00392   uint32 nickchars;
00393 };
00394 
00395 /* tiny struct needed for P10 and other UID servers so we can track 
00396    services UID
00397 */
00398 struct uid_ {
00399     Uid *next, *prev;
00400     char nick[NICKMAX];
00401     char *uid;
00402 };
00403 
00404 /*************************************************************************/
00405 /* Config Details */
00406 /*************************************************************************/
00407 
00408 #define MAXPARAMS   8
00409 
00410 /* Configuration directives */
00411 
00412 typedef struct {
00413     char *name;
00414     struct {
00415         int type;               /* PARAM_* below */
00416         int flags;              /* Same */
00417         void *ptr;              /* Pointer to where to store the value */
00418     } params[MAXPARAMS];
00419 } Directive;
00420 
00421 #define PARAM_NONE  0
00422 #define PARAM_INT   1
00423 #define PARAM_POSINT    2       /* Positive integer only */
00424 #define PARAM_PORT  3       /* 1..65535 only */
00425 #define PARAM_STRING    4
00426 #define PARAM_TIME  5
00427 #define PARAM_STRING_ARRAY 6    /* Array of string */
00428 #define PARAM_SET   -1      /* Not a real parameter; just set the
00429                                  *    given integer variable to 1 */
00430 #define PARAM_DEPRECATED -2     /* Set for deprecated directives; `ptr'
00431                                  *    is a function pointer to call */
00432 
00433 /* Flags: */
00434 #define PARAM_OPTIONAL  0x01
00435 #define PARAM_FULLONLY  0x02    /* Directive only allowed if !STREAMLINED */
00436 #define PARAM_RELOAD    0x04    /* Directive is reloadable */
00437 
00438 /*************************************************************************/
00439 
00440 /* File version for each database. Was one version for all before but was
00441    changed so they are now easier to maintain. =) */
00442 
00443 #define BOT_VERSION         10
00444 #define CHAN_VERSION        16
00445 #define EXCEPTION_VERSION   9
00446 #define NEWS_VERSION        9
00447 #define NICK_VERSION        13
00448 #define PRE_NICK_VERSION    1
00449 #define OPER_VERSION        13
00450 #define HELP_VERSION        1
00451 #define HOST_VERSION        3
00452 
00453 /*************************************************************************/
00454 
00455 
00460 struct ModuleData_ {
00461     char *moduleName;                       /* Which module we belong to */
00462     char *key;                              /* The key */
00463     char *value;                            /* The Value */
00464     ModuleData *next;                       /* The next ModuleData record */
00465 };
00466  
00467  /*************************************************************************/
00468 
00469 /* Memo info structures.  Since both nicknames and channels can have memos,
00470  * we encapsulate memo data in a MemoList to make it easier to handle. */
00471 
00472 struct memo_ {
00473     uint32 number;  /* Index number -- not necessarily array position! */
00474     uint16 flags;
00475     time_t time;    /* When it was sent */
00476     char sender[NICKMAX];
00477     char *text;
00478     ModuleData *moduleData;     /* Module saved data attached to the Memo */
00479 #ifdef USE_MYSQL
00480     uint32 id;      /* Database ID; see mysql.c */
00481 #endif
00482 };
00483 
00484 typedef struct {
00485     int16 memocount, memomax;
00486     Memo *memos;
00487 } MemoInfo;
00488 
00489 /*************************************************************************/
00490 
00491 /* NickServ nickname structures. */
00492 
00493 
00494 struct nickrequest_ {
00495     NickRequest *next, *prev;
00496     char *nick;
00497     char *passcode;
00498     char *password;
00499     char *email;
00500     time_t requested;
00501     time_t lastmail;            /* Unsaved */
00502 };
00503 
00504 struct nickalias_ {
00505     NickAlias *next, *prev;
00506     char *nick;             /* Nickname */
00507     char *last_quit;            /* Last quit message */
00508     char *last_realname;            /* Last realname */
00509     char *last_usermask;            /* Last usermask */
00510         time_t time_registered;         /* When the nick was registered */
00511         time_t last_seen;           /* When it was seen online for the last time */
00512         uint16 status;              /* See NS_* below */
00513         NickCore *nc;               /* I'm an alias of this */
00514         /* Not saved */
00515         ModuleData *moduleData;         /* Module saved data attached to the nick alias */
00516         User *u;                /* Current online user that has me */
00517 };
00518 
00519 struct nickcore_ {
00520     NickCore *next, *prev;
00521 
00522     char *display;              /* How the nick is displayed */
00523     char *pass;             /* Password of the nicks */
00524     char *email;                /* E-mail associated to the nick */
00525     char *greet;                /* Greet associated to the nick */
00526     uint32 icq;             /* ICQ # associated to the nick */
00527     char *url;              /* URL associated to the nick */
00528     uint32 flags;               /* See NI_* below */
00529     uint16 language;            /* Language selected by nickname owner (LANG_*) */
00530         uint16 accesscount;         /* # of entries */
00531         char **access;              /* Array of strings */
00532         MemoInfo memos;
00533         uint16 channelcount;            /* Number of channels currently registered */
00534         uint16 channelmax;          /* Maximum number of channels allowed */
00535 
00536         /* Unsaved data */
00537         ModuleData *moduleData;     /* Module saved data attached to the NickCore */
00538         time_t lastmail;            /* Last time this nick record got a mail */
00539         SList aliases;              /* List of aliases */
00540 };
00541 
00542 
00543 /*************************************************************************/
00544 
00545 /* Bot info structures. Note that since there won't be many bots,
00546  * they're not in a hash list.
00547  *  --lara
00548  */
00549 
00550 struct botinfo_ {
00551     BotInfo *next, *prev;
00552 
00553     char *nick;             /* Nickname of the bot */
00554     char *user;             /* Its user name */
00555     char *host;             /* Its hostname */
00556     char *real;             /* Its real name */
00557     int16 flags;            /* Bot flags -- see BI_* below */
00558     time_t created;         /* Birth date ;) */
00559     int16 chancount;        /* Number of channels that use the bot. */
00560     /* Dynamic data */
00561     time_t lastmsg;         /* Last time we said something */
00562 };
00563 
00564 
00565 
00566 /* Channel info structures.  Stored similarly to the nicks, except that
00567  * the second character of the channel name, not the first, is used to
00568  * determine the list.  (Hashing based on the first character of the name
00569  * wouldn't get very far. ;) ) */
00570 
00571 /* Access levels for users. */
00572 typedef struct {
00573     uint16 in_use;  /* 1 if this entry is in use, else 0 */
00574     int16 level;
00575     NickCore *nc;   /* Guaranteed to be non-NULL if in use, NULL if not */
00576     time_t last_seen;
00577 } ChanAccess;
00578 
00579 /* Note that these two levels also serve as exclusive boundaries for valid
00580  * access levels.  ACCESS_FOUNDER may be assumed to be strictly greater
00581  * than any valid access level, and ACCESS_INVALID may be assumed to be
00582  * strictly less than any valid access level. Also read below.
00583  */
00584 #define ACCESS_FOUNDER  10000   /* Numeric level indicating founder access */
00585 #define ACCESS_INVALID  -10000  /* Used in levels[] for disabled settings */
00586 /* There is one exception to the above access levels: SuperAdmins will have
00587  * access level 10001. This level is never stored, however; it is only used
00588  * in comparison and to let SuperAdmins win from founders where needed
00589  */
00590 #define ACCESS_SUPERADMIN 10001
00591 
00592 /* Levels for xOP */
00593 
00594 #define ACCESS_VOP      3
00595 #define ACCESS_HOP          4
00596 #define ACCESS_AOP      5
00597 #define ACCESS_SOP      10
00598 
00599 /* AutoKick data. */
00600 typedef struct {
00601     int16 in_use;   /* Always 0 if not in use */
00602     int16 is_nick;  /* 1 if a regged nickname, 0 if a nick!user@host mask */
00603     uint16 flags;
00604     union {
00605         char *mask;     /* Guaranteed to be non-NULL if in use, NULL if not */
00606         NickCore *nc;   /* Same */
00607     } u;
00608     char *reason;
00609 
00610     char *creator;
00611     time_t addtime;
00612 } AutoKick;
00613 
00614 #define AK_USED     0x0001
00615 #define AK_ISNICK   0x0002
00616 #define AK_STUCK        0x0004
00617 
00618 /* Structure used to contain bad words. */
00619 
00620 struct badword_ {
00621     uint16 in_use;
00622     char *word;
00623     uint16 type;        /* BW_* below */
00624 };
00625 
00626 #define BW_ANY      0
00627 #define BW_SINGLE   1
00628 #define BW_START    2
00629 #define BW_END      3
00630 
00631 
00632 struct chaninfo_ {
00633     ChannelInfo *next, *prev;
00634     char name[CHANMAX];
00635     NickCore *founder;
00636     NickCore *successor;        /* Who gets the channel if the founder
00637                                  * nick is dropped or expires */
00638     char founderpass[PASSMAX];
00639     char *desc;
00640     char *url;
00641     char *email;
00642 
00643     time_t time_registered;
00644     time_t last_used;
00645     char *last_topic;           /* Last topic on the channel */
00646     char last_topic_setter[NICKMAX];    /* Who set the last topic */
00647     time_t last_topic_time;     /* When the last topic was set */
00648 
00649     uint32 flags;               /* See below */
00650     char *forbidby;
00651     char *forbidreason;
00652 
00653     int16 bantype;
00654     int16 *levels;              /* Access levels for commands */
00655 
00656     uint16 accesscount;
00657     ChanAccess *access;         /* List of authorized users */
00658     uint16 akickcount;
00659     AutoKick *akick;            /* List of users to kickban */
00660 
00661     uint32 mlock_on, mlock_off;     /* See channel modes below */
00662     uint32 mlock_limit;         /* 0 if no limit */
00663     char *mlock_key;            /* NULL if no key */
00664     char *mlock_flood;          /* NULL if no +f */
00665     char *mlock_redirect;       /* NULL if no +L */
00666 
00667     char *entry_message;        /* Notice sent on entering channel */
00668 
00669     MemoInfo memos;
00670 
00671     struct channel_ *c;         /* Pointer to channel record (if   *
00672                                  *    channel is currently in use) */
00673                                  
00674     ModuleData *moduleData;     /* Module saved data attached to the ChannelInfo */
00675 
00676     /* For BotServ */
00677 
00678     BotInfo *bi;                    /* Bot used on this channel */
00679     uint32 botflags;                /* BS_* below */
00680     int16 *ttb;                     /* Times to ban for each kicker */
00681 
00682     uint16 bwcount;
00683     BadWord *badwords;              /* For BADWORDS kicker */
00684     int16 capsmin, capspercent;     /* For CAPS kicker */
00685     int16 floodlines, floodsecs;    /* For FLOOD kicker */
00686     int16 repeattimes;              /* For REPEAT kicker */
00687 };
00688 
00689 /* Retain topic even after last person leaves channel */
00690 #define CI_KEEPTOPIC    0x00000001
00691 /* Don't allow non-authorized users to be opped */
00692 #define CI_SECUREOPS    0x00000002
00693 /* Hide channel from ChanServ LIST command */
00694 #define CI_PRIVATE  0x00000004
00695 /* Topic can only be changed by SET TOPIC */
00696 #define CI_TOPICLOCK    0x00000008
00697 /* Those not allowed ops are kickbanned */
00698 #define CI_RESTRICTED   0x00000010
00699 /* Don't allow ChanServ and BotServ commands to do bad things to bigger levels */
00700 #define CI_PEACE  0x00000020
00701 /* Don't allow any privileges unless a user is IDENTIFY'd with NickServ */
00702 #define CI_SECURE   0x00000040
00703 /* Don't allow the channel to be registered or used */
00704 #define CI_VERBOTEN 0x00000080
00705 /* Channel password is encrypted */
00706 #define CI_ENCRYPTEDPW  0x00000100
00707 /* Channel does not expire */
00708 #define CI_NO_EXPIRE    0x00000200
00709 /* Channel memo limit may not be changed */
00710 #define CI_MEMO_HARDMAX 0x00000400
00711 /* Send notice to channel on use of OP/DEOP */
00712 #define CI_OPNOTICE 0x00000800
00713 /* Stricter control of channel founder status */
00714 #define CI_SECUREFOUNDER 0x00001000
00715 /* Always sign kicks */
00716 #define CI_SIGNKICK 0x00002000
00717 /* Sign kicks if level is < than the one defined by the SIGNKICK level */
00718 #define CI_SIGNKICK_LEVEL 0x00004000
00719 /* Use the xOP lists */
00720 #define CI_XOP 0x00008000
00721 /* Channel is suspended */
00722 #define CI_SUSPENDED 0x00010000
00723 
00724 /* TEMPORARY - ChanServ is on the channel. */
00725 #define CI_INHABIT 0x80000000
00726 
00727 /* Indices for cmd_access[]: */
00728 #define CA_INVITE           0