| 1 |
/* |
| 2 |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
| 3 |
* handlers.h: A header for some built in command handlers. |
| 4 |
* |
| 5 |
* Copyright (C) 2002 by the past and present ircd coders, and others. |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or |
| 10 |
* (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 20 |
* USA |
| 21 |
* |
| 22 |
* $Id$ |
| 23 |
*/ |
| 24 |
|
| 25 |
#ifndef INCLUDED_handlers_h |
| 26 |
#define INCLUDED_handlers_h |
| 27 |
|
| 28 |
/* |
| 29 |
* m_functions execute protocol messages on this server: |
| 30 |
* int m_func(struct Client* client_p, struct Client* source_p, int parc, char* parv[]); |
| 31 |
* |
| 32 |
* client_p is always NON-NULL, pointing to a *LOCAL* client |
| 33 |
* structure (with an open socket connected!). This |
| 34 |
* identifies the physical socket where the message |
| 35 |
* originated (or which caused the m_function to be |
| 36 |
* executed--some m_functions may call others...). |
| 37 |
* |
| 38 |
* source_p is the source of the message, defined by the |
| 39 |
* prefix part of the message if present. If not |
| 40 |
* or prefix not found, then source_p==client_p. |
| 41 |
* |
| 42 |
* (!IsServer(client_p)) => (client_p == source_p), because |
| 43 |
* prefixes are taken *only* from servers... |
| 44 |
* |
| 45 |
* (IsServer(client_p)) |
| 46 |
* (source_p == client_p) => the message didn't |
| 47 |
* have the prefix. |
| 48 |
* |
| 49 |
* (source_p != client_p && IsServer(source_p) means |
| 50 |
* the prefix specified servername. (?) |
| 51 |
* |
| 52 |
* (source_p != client_p && !IsServer(source_p) means |
| 53 |
* that message originated from a remote |
| 54 |
* user (not local). |
| 55 |
* |
| 56 |
* |
| 57 |
* combining |
| 58 |
* |
| 59 |
* (!IsServer(source_p)) means that, source_p can safely |
| 60 |
* taken as defining the target structure of the |
| 61 |
* message in this server. |
| 62 |
* |
| 63 |
* *Always* true (if 'parse' and others are working correct): |
| 64 |
* |
| 65 |
* 1) source_p->from == client_p (note: client_p->from == client_p) |
| 66 |
* |
| 67 |
* 2) MyConnect(source_p) <=> source_p == client_p (e.g. source_p |
| 68 |
* *cannot* be a local connection, unless it's |
| 69 |
* actually client_p!). [MyConnect(x) should probably |
| 70 |
* be defined as (x == x->from) --msa ] |
| 71 |
* |
| 72 |
* parc number of variable parameter strings (if zero, |
| 73 |
* parv is allowed to be NULL) |
| 74 |
* |
| 75 |
* parv a NULL terminated list of parameter pointers, |
| 76 |
* |
| 77 |
* parv[0], sender (prefix string), if not present |
| 78 |
* this points to an empty string. |
| 79 |
* parv[1]...parv[parc-1] |
| 80 |
* pointers to additional parameters |
| 81 |
* parv[parc] == NULL, *always* |
| 82 |
* |
| 83 |
* note: it is guaranteed that parv[0]..parv[parc-1] are all |
| 84 |
* non-NULL pointers. |
| 85 |
*/ |
| 86 |
|
| 87 |
struct Client; |
| 88 |
|
| 89 |
/* generic handlers */ |
| 90 |
extern void ms_error(struct Client *, struct Client *, int, char *[]); |
| 91 |
extern void m_error(struct Client *, struct Client *,int, char *[]); |
| 92 |
extern void m_ignore(struct Client *, struct Client *, int, char *[]); |
| 93 |
extern void m_not_oper(struct Client *, struct Client *, int, char *[]); |
| 94 |
extern void m_registered(struct Client *, struct Client *, int, char *[]); |
| 95 |
extern void m_unregistered(struct Client *, struct Client *, int, char *[]); |
| 96 |
|
| 97 |
#endif /* INCLUDED_handlers_h */ |
| 98 |
|