]>
Commit | Line | Data |
---|---|---|
edb26b39 P |
1 | # HG changeset patch |
2 | # Parent 3b7390e3248ec1fea327faf4d4ab1af59fe995f1 | |
3 | ||
4 | diff -r 3b7390e3248e include/handlers.h | |
5 | --- a/include/handlers.h Sun Jul 14 14:02:02 2013 +0100 | |
6 | +++ b/include/handlers.h Sun Jul 14 14:06:30 2013 +0100 | |
7 | @@ -224,6 +224,7 @@ | |
8 | extern int ms_privmsg(struct Client*, struct Client*, int, char*[]); | |
9 | extern int ms_privs(struct Client*, struct Client*, int, char*[]); | |
10 | extern int ms_quit(struct Client*, struct Client*, int, char*[]); | |
11 | +extern int ms_reburst(struct Client*, struct Client*, int, char*[]); | |
12 | extern int ms_rping(struct Client*, struct Client*, int, char*[]); | |
13 | extern int ms_rpong(struct Client*, struct Client*, int, char*[]); | |
14 | extern int ms_server(struct Client*, struct Client*, int, char*[]); | |
15 | diff -r 3b7390e3248e include/msg.h | |
16 | --- a/include/msg.h Sun Jul 14 14:02:02 2013 +0100 | |
17 | +++ b/include/msg.h Sun Jul 14 14:06:30 2013 +0100 | |
18 | @@ -363,6 +363,10 @@ | |
19 | #define TOK_SETHOST "SH" | |
20 | #define CMD_SETHOST MSG_SETHOST, TOK_SETHOST | |
21 | ||
22 | +#define MSG_REBURST "REBURST" /* REBURST */ | |
23 | +#define TOK_REBURST "RB" | |
24 | +#define CMD_REBURST MSG_REBURST, TOK_REBURST | |
25 | + | |
26 | #define MSG_CAP "CAP" | |
27 | #define TOK_CAP "CAP" | |
28 | #define CMD_CAP MSG_CAP, TOK_CAP | |
29 | diff -r 3b7390e3248e ircd/Makefile.in | |
30 | --- a/ircd/Makefile.in Sun Jul 14 14:02:02 2013 +0100 | |
31 | +++ b/ircd/Makefile.in Sun Jul 14 14:06:30 2013 +0100 | |
32 | @@ -161,6 +161,7 @@ | |
33 | m_proto.c \ | |
34 | m_pseudo.c \ | |
35 | m_quit.c \ | |
36 | + m_reburst.c \ | |
37 | m_rehash.c \ | |
38 | m_reset.c \ | |
39 | m_restart.c \ | |
40 | diff -r 3b7390e3248e ircd/m_reburst.c | |
41 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
42 | +++ b/ircd/m_reburst.c Sun Jul 14 14:06:30 2013 +0100 | |
43 | @@ -0,0 +1,137 @@ | |
44 | +/* | |
45 | + * IRC - Internet Relay Chat, ircd/m_reburst.c | |
46 | + * Copyright (C) 1990 Jarkko Oikarinen and | |
47 | + * University of Oulu, Computing Center | |
48 | + * | |
49 | + * See file AUTHORS in IRC package for additional names of | |
50 | + * the programmers. | |
51 | + * | |
52 | + * This program is free software; you can redistribute it and/or modify | |
53 | + * it under the terms of the GNU General Public License as published by | |
54 | + * the Free Software Foundation; either version 1, or (at your option) | |
55 | + * any later version. | |
56 | + * | |
57 | + * This program is distributed in the hope that it will be useful, | |
58 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
59 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
60 | + * GNU General Public License for more details. | |
61 | + * | |
62 | + * You should have received a copy of the GNU General Public License | |
63 | + * along with this program; if not, write to the Free Software | |
64 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
65 | + * | |
66 | + * $Id: m_burst.c,v 1.40.2.6 2008/01/03 00:07:21 klmitch Exp $ | |
67 | + */ | |
68 | + | |
69 | +/* | |
70 | + * m_functions execute protocol messages on this server: | |
71 | + * | |
72 | + * cptr is always NON-NULL, pointing to a *LOCAL* client | |
73 | + * structure (with an open socket connected!). This | |
74 | + * identifies the physical socket where the message | |
75 | + * originated (or which caused the m_function to be | |
76 | + * executed--some m_functions may call others...). | |
77 | + * | |
78 | + * sptr is the source of the message, defined by the | |
79 | + * prefix part of the message if present. If not | |
80 | + * or prefix not found, then sptr==cptr. | |
81 | + * | |
82 | + * (!IsServer(cptr)) => (cptr == sptr), because | |
83 | + * prefixes are taken *only* from servers... | |
84 | + * | |
85 | + * (IsServer(cptr)) | |
86 | + * (sptr == cptr) => the message didn't | |
87 | + * have the prefix. | |
88 | + * | |
89 | + * (sptr != cptr && IsServer(sptr) means | |
90 | + * the prefix specified servername. (?) | |
91 | + * | |
92 | + * (sptr != cptr && !IsServer(sptr) means | |
93 | + * that message originated from a remote | |
94 | + * user (not local). | |
95 | + * | |
96 | + * combining | |
97 | + * | |
98 | + * (!IsServer(sptr)) means that, sptr can safely | |
99 | + * taken as defining the target structure of the | |
100 | + * message in this server. | |
101 | + * | |
102 | + * *Always* true (if 'parse' and others are working correct): | |
103 | + * | |
104 | + * 1) sptr->from == cptr (note: cptr->from == cptr) | |
105 | + * | |
106 | + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr | |
107 | + * *cannot* be a local connection, unless it's | |
108 | + * actually cptr!). [MyConnect(x) should probably | |
109 | + * be defined as (x == x->from) --msa ] | |
110 | + * | |
111 | + * parc number of variable parameter strings (if zero, | |
112 | + * parv is allowed to be NULL) | |
113 | + * | |
114 | + * parv a NULL terminated list of parameter pointers, | |
115 | + * | |
116 | + * parv[0], sender (prefix string), if not present | |
117 | + * this points to an empty string. | |
118 | + * parv[1]...parv[parc-1] | |
119 | + * pointers to additional parameters | |
120 | + * parv[parc] == NULL, *always* | |
121 | + * | |
122 | + * note: it is guaranteed that parv[0]..parv[parc-1] are all | |
123 | + * non-NULL pointers. | |
124 | + */ | |
125 | +#include "config.h" | |
126 | + | |
127 | +#include "channel.h" | |
128 | +#include "client.h" | |
129 | +#include "hash.h" | |
130 | +#include "ircd.h" | |
131 | +#include "ircd_alloc.h" | |
132 | +#include "ircd_features.h" | |
133 | +#include "ircd_log.h" | |
134 | +#include "ircd_reply.h" | |
135 | +#include "ircd_string.h" | |
136 | +#include "list.h" | |
137 | +#include "match.h" | |
138 | +#include "msg.h" | |
139 | +#include "numeric.h" | |
140 | +#include "numnicks.h" | |
141 | +#include "s_conf.h" | |
142 | +#include "s_misc.h" | |
143 | +#include "send.h" | |
144 | +#include "struct.h" | |
145 | +#include "ircd_snprintf.h" | |
146 | +#include "gline.h" | |
147 | +#include "jupe.h" | |
148 | + | |
149 | +/* #include <assert.h> -- Now using assert in ircd_log.h */ | |
150 | +#include <stdlib.h> | |
151 | +#include <string.h> | |
152 | +#include <ctype.h> | |
153 | + | |
154 | + | |
155 | +/* | |
156 | + * ms_reburst - server message handler | |
157 | + */ | |
158 | +int ms_reburst(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) | |
159 | +{ | |
160 | + char *type = parv[1]; | |
161 | + | |
162 | + if (parc < 2) | |
163 | + return protocol_violation(sptr,"Too few parameters for REBURST"); | |
164 | + | |
165 | + assert(type); | |
166 | + | |
167 | + switch (*type) { | |
168 | + case 'g': | |
169 | + case 'G': | |
170 | + gline_burst(sptr); | |
171 | + break; | |
172 | + case 'j': | |
173 | + case 'J': | |
174 | + jupe_burst(sptr); | |
175 | + break; | |
176 | + default: | |
177 | + break; | |
178 | + } | |
179 | + return 0; | |
180 | +} | |
181 | diff -r 3b7390e3248e ircd/parse.c | |
182 | --- a/ircd/parse.c Sun Jul 14 14:02:02 2013 +0100 | |
183 | +++ b/ircd/parse.c Sun Jul 14 14:06:30 2013 +0100 | |
184 | @@ -541,6 +541,13 @@ | |
185 | { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore } | |
186 | }, | |
187 | { | |
188 | + MSG_REBURST, | |
189 | + TOK_REBURST, | |
190 | + 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
191 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
192 | + { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore } | |
193 | + }, | |
194 | + { | |
195 | MSG_HASH, | |
196 | TOK_HASH, | |
197 | 0, MAXPARA, MFLG_SLOW, 0, NULL, |