00001 /* 00002 * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). 00003 * msg.h: A header for the message handler structure. 00004 * 00005 * Copyright (C) 2002 by the past and present ircd coders, and others. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 * USA 00021 * 00022 * $Id: msg.h 33 2005-10-02 20:50:00Z knight $ 00023 */ 00024 00025 #ifndef INCLUDED_msg_h 00026 #define INCLUDED_msg_h 00027 00028 #include "ircd_handler.h" 00029 00030 /* 00031 * Message table structure 00032 */ 00033 struct Message 00034 { 00035 const char *cmd; 00036 unsigned int count; /* number of times command used */ 00037 unsigned int rcount; /* number of times command used by server */ 00038 unsigned int parameters; /* at least this many args must be passed 00039 * or an error will be sent to the user 00040 * before the m_func is even called 00041 */ 00042 unsigned int maxpara; /* maximum permitted parameters */ 00043 unsigned int flags; /* bit 0 set means that this command is allowed 00044 * to be used only on the average of once per 2 00045 * seconds -SRB 00046 */ 00047 unsigned long bytes; /* bytes received for this message */ 00048 /* 00049 * client_p = Connected client ptr 00050 * source_p = Source client ptr 00051 * parc = parameter count 00052 * parv = parameter variable array 00053 */ 00054 /* handlers: 00055 * UNREGISTERED, CLIENT, SERVER, ENCAP, OPER, DUMMY, LAST 00056 */ 00057 MessageHandler handlers[LAST_HANDLER_TYPE]; 00058 }; 00059 00060 /* 00061 * Constants 00062 */ 00063 #define MFLG_SLOW 0x001 /* Command can be executed roughly 00064 * once per 2 seconds. 00065 */ 00066 #define MFLG_UNREG 0x002 /* Command available to unregistered 00067 * clients. 00068 */ 00069 00070 #define MAXPARA 15 00071 00072 #endif /* INCLUDED_msg_h */