]>
Commit | Line | Data |
---|---|---|
189935b1 | 1 | /* |
2 | * IRC - Internet Relay Chat, ircd/m_proto.c | |
3 | * Copyright (C) 1990 Jarkko Oikarinen and | |
4 | * University of Oulu, Computing Center | |
5 | * | |
6 | * See file AUTHORS in IRC package for additional names of | |
7 | * the programmers. | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation; either version 1, or (at your option) | |
12 | * any later version. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
22 | * | |
23 | * $Id: m_defaults.c,v 1.6 2004/12/11 05:13:46 klmitch Exp $ | |
24 | */ | |
25 | #include "config.h" | |
26 | ||
27 | #include "client.h" | |
28 | #include "ircd.h" | |
29 | #include "ircd_log.h" | |
30 | #include "ircd_reply.h" | |
31 | #include "numeric.h" | |
32 | #include "numnicks.h" | |
33 | #include "send.h" | |
34 | #include "supported.h" | |
35 | #include "version.h" | |
36 | ||
37 | /* #include <assert.h> -- Now using assert in ircd_log.h */ | |
38 | ||
39 | /* | |
40 | * m_functions execute protocol messages on this server: | |
41 | * | |
42 | * cptr is always NON-NULL, pointing to a *LOCAL* client | |
43 | * structure (with an open socket connected!). This | |
44 | * identifies the physical socket where the message | |
45 | * originated (or which caused the m_function to be | |
46 | * executed--some m_functions may call others...). | |
47 | * | |
48 | * sptr is the source of the message, defined by the | |
49 | * prefix part of the message if present. If not | |
50 | * or prefix not found, then sptr==cptr. | |
51 | * | |
52 | * (!IsServer(cptr)) => (cptr == sptr), because | |
53 | * prefixes are taken *only* from servers... | |
54 | * | |
55 | * (IsServer(cptr)) | |
56 | * (sptr == cptr) => the message didn't | |
57 | * have the prefix. | |
58 | * | |
59 | * (sptr != cptr && IsServer(sptr) means | |
60 | * the prefix specified servername. (?) | |
61 | * | |
62 | * (sptr != cptr && !IsServer(sptr) means | |
63 | * that message originated from a remote | |
64 | * user (not local). | |
65 | * | |
66 | * combining | |
67 | * | |
68 | * (!IsServer(sptr)) means that, sptr can safely | |
69 | * taken as defining the target structure of the | |
70 | * message in this server. | |
71 | * | |
72 | * *Always* true (if 'parse' and others are working correct): | |
73 | * | |
74 | * 1) sptr->from == cptr (note: cptr->from == cptr) | |
75 | * | |
76 | * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr | |
77 | * *cannot* be a local connection, unless it's | |
78 | * actually cptr!). [MyConnect(x) should probably | |
79 | * be defined as (x == x->from) --msa ] | |
80 | * | |
81 | * parc number of variable parameter strings (if zero, | |
82 | * parv is allowed to be NULL) | |
83 | * | |
84 | * parv a NULL terminated list of parameter pointers, | |
85 | * | |
86 | * parv[0], sender (prefix string), if not present | |
87 | * this points to an empty string. | |
88 | * parv[1]...parv[parc-1] | |
89 | * pointers to additional parameters | |
90 | * parv[parc] == NULL, *always* | |
91 | * | |
92 | * note: it is guaranteed that parv[0]..parv[parc-1] are all | |
93 | * non-NULL pointers. | |
94 | */ | |
95 | ||
96 | int m_not_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
97 | { | |
98 | return send_reply(cptr, ERR_NOPRIVILEGES); | |
99 | } | |
100 | ||
101 | int m_unregistered(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
102 | { | |
103 | send_reply(cptr, SND_EXPLICIT | ERR_NOTREGISTERED, "%s :Register first.", | |
104 | parv[0]); | |
105 | return 0; | |
106 | } | |
107 | ||
108 | int m_registered(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
109 | { | |
110 | return send_reply(sptr, ERR_ALREADYREGISTRED); | |
111 | } | |
112 | ||
113 | int m_ignore(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
114 | { | |
115 | return 0; | |
116 | } | |
117 | ||
118 | int m_unsupported(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
119 | { | |
120 | return 0; | |
121 | } |