6 add mh_* message help function handlers
9 add default replies for /HELP (mh_not_oper mh_not_server)
12 add mh_* functions - once finished they should be moved to their respective m_*.c files
16 add 377 RPL_HELP, 378 RPL_ENDOFHELP, 418 ERR_NOHELP
19 add function find_message_by_cmd to find the mh_* function to call
22 add mh_* functions in the message table
24 diff -r 3fc56aefcea6 include/handlers.h
25 --- a/include/handlers.h Tue Jan 27 18:27:54 2009 +0100
26 +++ b/include/handlers.h Tue Jan 27 20:49:11 2009 +0100
28 extern int ms_wallvoices(struct Client*, struct Client*, int, char*[]);
29 extern int ms_whois(struct Client*, struct Client*, int, char*[]);
31 +extern int mh_nohelp(struct Client*, struct Client*, int, char*[]);
32 +extern int mh_not_oper(struct Client*, struct Client*, int, char*[]);
33 +extern int mh_not_server(struct Client*, struct Client*, int, char*[]);
34 +extern int mh_admin(struct Client*, struct Client*, int, char*[]);
35 +extern int mh_asll(struct Client*, struct Client*, int, char*[]);
36 +extern int mh_away(struct Client*, struct Client*, int, char*[]);
37 +extern int mh_check(struct Client*, struct Client*, int, char*[]);
38 +extern int mh_clearmode(struct Client*, struct Client*, int, char*[]);
39 +extern int mh_close(struct Client*, struct Client*, int, char*[]);
40 +extern int mh_cnotice(struct Client*, struct Client*, int, char*[]);
41 +extern int mh_connect(struct Client*, struct Client*, int, char*[]);
42 +extern int mh_cprivmsg(struct Client*, struct Client*, int, char*[]);
43 +extern int mh_die(struct Client*, struct Client*, int, char*[]);
44 +extern int mh_get(struct Client*, struct Client*, int, char*[]);
45 +extern int mh_gline(struct Client*, struct Client*, int, char*[]);
46 +extern int mh_hash(struct Client*, struct Client*, int, char*[]);
47 +extern int mh_help(struct Client*, struct Client*, int, char*[]);
48 +extern int mh_info(struct Client*, struct Client*, int, char*[]);
49 +extern int mh_invite(struct Client*, struct Client*, int, char*[]);
50 +extern int mh_ison(struct Client*, struct Client*, int, char*[]);
51 +extern int mh_join(struct Client*, struct Client*, int, char*[]);
52 +extern int mh_jupe(struct Client*, struct Client*, int, char*[]);
53 +extern int mh_kick(struct Client*, struct Client*, int, char*[]);
54 +extern int mh_kill(struct Client*, struct Client*, int, char*[]);
55 +extern int mh_links(struct Client*, struct Client*, int, char*[]);
56 +extern int mh_list(struct Client*, struct Client*, int, char*[]);
57 +extern int mh_lusers(struct Client*, struct Client*, int, char*[]);
58 +extern int mh_map(struct Client*, struct Client*, int, char*[]);
59 +extern int mh_mode(struct Client*, struct Client*, int, char*[]);
60 +extern int mh_motd(struct Client*, struct Client*, int, char*[]);
61 +extern int mh_names(struct Client*, struct Client*, int, char*[]);
62 +extern int mh_nick(struct Client*, struct Client*, int, char*[]);
63 +extern int mh_notice(struct Client*, struct Client*, int, char*[]);
64 +extern int mh_oper(struct Client*, struct Client*, int, char*[]);
65 +extern int mh_opmode(struct Client*, struct Client*, int, char*[]);
66 +extern int mh_part(struct Client*, struct Client*, int, char*[]);
67 +extern int mh_pass(struct Client*, struct Client*, int, char*[]);
68 +extern int mh_ping(struct Client*, struct Client*, int, char*[]);
69 +extern int mh_pong(struct Client*, struct Client*, int, char*[]);
70 +extern int mh_privmsg(struct Client*, struct Client*, int, char*[]);
71 +extern int mh_privs(struct Client*, struct Client*, int, char*[]);
72 +extern int mh_quit(struct Client*, struct Client*, int, char*[]);
73 +extern int mh_rehash(struct Client*, struct Client*, int, char*[]);
74 +extern int mh_reset(struct Client*, struct Client*, int, char*[]);
75 +extern int mh_restart(struct Client*, struct Client*, int, char*[]);
76 +extern int mh_rping(struct Client*, struct Client*, int, char*[]);
77 +extern int mh_set(struct Client*, struct Client*, int, char*[]);
78 +extern int mh_sethost(struct Client*, struct Client*, int, char*[]);
79 +extern int mh_settime(struct Client*, struct Client*, int, char*[]);
80 +extern int mh_silence(struct Client*, struct Client*, int, char*[]);
81 +extern int mh_squit(struct Client*, struct Client*, int, char*[]);
82 +extern int mh_stats(struct Client*, struct Client*, int, char*[]);
83 +extern int mh_time(struct Client*, struct Client*, int, char*[]);
84 +extern int mh_topic(struct Client*, struct Client*, int, char*[]);
85 +extern int mh_trace(struct Client*, struct Client*, int, char*[]);
86 +extern int mh_uping(struct Client*, struct Client*, int, char*[]);
87 +extern int mh_user(struct Client*, struct Client*, int, char*[]);
88 +extern int mh_userhost(struct Client*, struct Client*, int, char*[]);
89 +extern int mh_userip(struct Client*, struct Client*, int, char*[]);
90 +extern int mh_version(struct Client*, struct Client*, int, char*[]);
91 +extern int mh_wallchops(struct Client*, struct Client*, int, char*[]);
92 +extern int mh_wallops(struct Client*, struct Client*, int, char*[]);
93 +extern int mh_wallusers(struct Client*, struct Client*, int, char*[]);
94 +extern int mh_wallvoices(struct Client*, struct Client*, int, char*[]);
95 +extern int mh_who(struct Client*, struct Client*, int, char*[]);
96 +extern int mh_whois(struct Client*, struct Client*, int, char*[]);
97 +extern int mh_whowas(struct Client*, struct Client*, int, char*[]);
103 #endif /* INCLUDED_handlers_h */
105 diff -r 3fc56aefcea6 include/ircd_handler.h
106 --- a/include/ircd_handler.h Tue Jan 27 18:27:54 2009 +0100
107 +++ b/include/ircd_handler.h Tue Jan 27 20:49:11 2009 +0100
109 SERVER_HANDLER, /**< Used for server conections. */
110 OPER_HANDLER, /**< Used for IRC operators. */
111 SERVICE_HANDLER, /**< Used for services connections. */
112 + HELP_HANDLER, /**< Used for /HELP <command> */
113 LAST_HANDLER_TYPE /**< NUmber of handler types. */
116 diff -r 3fc56aefcea6 include/msg.h
117 --- a/include/msg.h Tue Jan 27 18:27:54 2009 +0100
118 +++ b/include/msg.h Tue Jan 27 20:49:11 2009 +0100
120 * parv = parameter variable array
123 - * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, LAST
124 + * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, HELP, LAST
126 MessageHandler handlers[LAST_HANDLER_TYPE];
128 diff -r 3fc56aefcea6 include/numeric.h
129 --- a/include/numeric.h Tue Jan 27 18:27:54 2009 +0100
130 +++ b/include/numeric.h Tue Jan 27 20:49:11 2009 +0100
132 #define RPL_MOTDSTART 375
133 #define RPL_ENDOFMOTD 376
135 +#define RPL_HELP 377 /* QuakeNet extension */
136 +#define RPL_ENDOFHELP 378 /* QuakeNet extension */
138 /* RPL_KICKEXPIRED 377 aircd */
139 /* RPL_SPAM 377 austnet */
140 /* RPL_BANEXPIRED 378 aircd */
142 #define ERR_QUERYTOOLONG 416 /* Undernet extension */
143 /* ERR_TOOMANYMATCHES 416 IRCnet extension */
144 #define ERR_INPUTTOOLONG 417
145 +#define ERR_NOHELP 418 /* QuakeNet extension */
146 /* ERR_LENGTHTRUNCATED 419 aircd */
148 #define ERR_UNKNOWNCOMMAND 421
150 #define ERR_NOMANAGER 566 /* Undernet extension */
151 #define ERR_UPASS_SAME_APASS 567 /* Undernet extension */
152 #define ERR_LASTERROR 568
154 /* RPL_LOGON 600 dalnet,unreal
155 RPL_LOGOFF 601 dalnet,unreal
156 RPL_WATCHOFF 602 dalnet,unreal
157 diff -r 3fc56aefcea6 include/parse.h
158 --- a/include/parse.h Tue Jan 27 18:27:54 2009 +0100
159 +++ b/include/parse.h Tue Jan 27 20:49:11 2009 +0100
161 extern int parse_client(struct Client *cptr, char *buffer, char *bufend);
162 extern int parse_server(struct Client *cptr, char *buffer, char *bufend);
163 extern void initmsgtree(void);
164 +extern struct Message *find_message_by_cmd(char *cmd);
166 extern int register_mapping(struct s_map *map);
167 extern int unregister_mapping(struct s_map *map);
168 diff -r 3fc56aefcea6 ircd/m_defaults.c
169 --- a/ircd/m_defaults.c Tue Jan 27 18:27:54 2009 +0100
170 +++ b/ircd/m_defaults.c Tue Jan 27 20:49:11 2009 +0100
176 +int mh_nohelp(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
178 + return send_reply(sptr, ERR_NOHELP, parv[1]);
181 +int mh_not_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
183 + return send_reply(sptr, SND_EXPLICIT | RPL_HELP, "%s :This command is for IRC Operators only.", parv[1]);
186 +int mh_not_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
188 + return send_reply(sptr, SND_EXPLICIT | RPL_HELP, "%s :This command is for servers only.", parv[1]);
190 \ No newline at end of file
191 diff -r 3fc56aefcea6 ircd/m_help.c
192 --- a/ircd/m_help.c Tue Jan 27 18:27:54 2009 +0100
193 +++ b/ircd/m_help.c Tue Jan 27 20:49:11 2009 +0100
197 #include "numnicks.h"
201 /* #include <assert.h> -- Now using assert in ircd_log.h */
202 @@ -100,9 +101,1212 @@
203 int m_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
206 + struct Message* mptr;
207 + MessageHandler handler = 0;
210 - for (i = 0; msgtab[i].cmd; i++)
211 - sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
212 + /* list all commands */
214 + for (i = 0; msgtab[i].cmd; i++)
215 + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
220 + /* nothing found */
221 + if ((mptr = find_message_by_cmd(command)) == NULL)
222 + return send_reply(sptr, ERR_NOHELP, command);
224 + /* found a help handler function */
225 + handler = mptr->handlers[HELP_HANDLER];
227 + assert(0 != handler);
229 + /* call the help handler function */
230 + (*handler) (cptr, sptr, parc, parv);
231 + return send_reply(sptr, RPL_ENDOFHELP, command);
236 + * mh_help - help message handler
238 +int mh_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
240 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
241 + "HELP :HELP [<command>]");
242 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
243 + "HELP :Lists all server commands or info on the given command.");
249 + * TODO: move all the mh_ functions into the files of the commands they belong to
254 + * mh_admin - help message handler
255 + * TODO: check HIS remote
257 +int mh_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
259 + if (!IsAnOper(sptr))
260 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
263 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
264 + "ADMIN :ADMIN [<server>]");
265 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
266 + "ADMIN :Shows administrative contact for the server.");
272 + * mh_asll - help message handler
274 +int mh_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
276 + if (!IsAnOper(sptr))
277 + return mh_not_oper(cptr, sptr, parc, parv);
278 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
279 + "ASLL :ASLL <mask> [<server>]");
280 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
281 + "ASLL :Shows Asymmetric Link Latency information.");
282 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
283 + "ASLL :Parameter <mask> is matched against directly linked servers, and may have more than one match.");
289 + * mh_away - help message handler
291 +int mh_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
293 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
294 + "AWAY :AWAY [<message>]");
295 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
296 + "AWAY :Sets or clears the away message.");
302 + * mh_check - help message handler
304 +int mh_check(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
306 + if (!IsAnOper(sptr))
307 + return mh_not_oper(cptr, sptr, parc, parv);
308 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
309 + "CHECK :CHECK [<server>] <mask> [<flags>]");
310 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
311 + "CHECK :Shows detailed information about a user, a channel, a hostmask, or a server.");
312 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
313 + "CHECK :Flags are: -C show clones, -c show channels, -s show servernames, -e show more, "
314 + "-i show IPs, -I show hostnames and IPs, -u do not show users, -o show only channel operators, -l show oplevels.");
320 + * mh_clearmode - help message handler
322 +int mh_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
324 + if (!IsAnOper(sptr))
325 + return mh_not_oper(cptr, sptr, parc, parv);
326 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
327 + "CLEARMODE :CLEARMODE [!]<channel> [<modes>]");
328 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
329 + "CLEARMODE :Clears modes on a channel.");
330 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
331 + "CLEARMODE :Default modes are ovpsmikbl - o deops all channel operators, "
332 + "v devoices all channel voices, and b removes all channel bans.");
333 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
334 + "CLEARMODE :The ! prefix may be used to override a channel quarantine.");
340 + * mh_close - help message handler
342 +int mh_close(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
344 + if (!IsAnOper(sptr))
345 + return mh_not_oper(cptr, sptr, parc, parv);
346 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
348 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
349 + "CLOSE :Closes unregistered connections to the server.");
355 + * mh_cnotice - help message handler
357 +int mh_cnotice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
359 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
360 + "CNOTICE :CNOTICE <nick> <channel> :<message>");
361 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
362 + "CNOTICE :Sends a private notice to a user.");
363 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
364 + "CNOTICE :A channel voice or operator can use this to bypass the target flood limit "
365 + "(target change too fast error) when the user is on the channel.");
371 + * mh_connect - help message handler
373 +int mh_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
375 + if (!IsAnOper(sptr))
376 + return mh_not_oper(cptr, sptr, parc, parv);
377 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
378 + "CONNECT :CONNECT <server> [<port> [<remote server>]]");
379 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
380 + "CONNECT :Connects the server to another server.");
381 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
382 + "CONNECT :Special port 0 can be used to let the remote server workout the port to use.");
388 + * mh_cprivmsg - help message handler
390 +int mh_cprivmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
392 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
393 + "CPRIVMSG :CPRIVMSG <nick> <channel> :<message>");
394 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
395 + "CPRIVMSG :Sends a private message to a user.");
396 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
397 + "CPRIVMSG :A channel voice or operator can use this to bypass the target flood limit "
398 + "(target change too fast error) when the user is on the channel.");
404 + * mh_die - help message handler
406 +int mh_die(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
408 + if (!IsAnOper(sptr))
409 + return mh_not_oper(cptr, sptr, parc, parv);
410 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
411 + "DIE :DIE <server>");
412 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
413 + "DIE :Terminates the server. The servername needs to be given as sanity check.");
419 + * mh_get - help message handler
422 +int mh_get(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
424 + if (!IsAnOper(sptr))
425 + return mh_not_oper(cptr, sptr, parc, parv);
426 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
427 + "GET :GET <feature> [<parameters>]");
428 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
429 + "GET :Returns the value of a feature.");
435 + * mh_gline - help message handler
438 +int mh_gline(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
440 + if (!IsAnOper(sptr))
441 + return mh_not_oper(cptr, sptr, parc, parv);
442 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
443 + "GLINE :GLINE [[!][+|-|>|<]<mask> [<target>] [<duration> [:<reason>]]]");
444 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
445 + "GLINE :Views, sets or changes a gline.");
451 + * mh_hash - help message handler
454 +int mh_hash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
456 + if (!IsAnOper(sptr))
457 + return mh_not_oper(cptr, sptr, parc, parv);
458 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
460 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
461 + "HASH :Shows hash table statistics.");
467 + * mh_info - help message handler
468 + * TODO: check HIS remote
470 +int mh_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
472 + if (!IsAnOper(sptr)) {
473 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO");
474 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :Shows info about the IRCd.");
475 + return mh_not_oper(cptr, sptr, parc, parv);
477 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO [<server>]");
478 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
479 + "INFO :Show info about the IRCd. Lists a file hash and version number for its source files.");
486 + * mh_invite - help message handler
488 +int mh_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
490 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
491 + "INVITE :INVITE <nick> <channel>");
492 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
493 + "INVITE :Invites a user to a channel.");
499 + * mh_ison - help message handler
500 + * TODO: check that syntax is clear - no limit on number of nicks
502 +int mh_ison(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
504 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
505 + "ISON :ISON <nick> [<nick> [..]]");
506 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
507 + "ISON :Returns the nicks that are on the network.");
513 + * mh_join - help message handler
515 +int mh_join(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
517 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
518 + "JOIN :JOIN <channel> [<key>]");
519 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
520 + "JOIN :Joins a channel, where <channel> and <key> are a comma separated list of one or more elements.");
521 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
522 + "JOIN :Joining channel 0 can be used to leave all channels.");
528 + * mh_jupe - help message handler
531 +int mh_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
533 + if (!IsAnOper(sptr))
534 + return mh_not_oper(cptr, sptr, parc, parv);
535 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
536 + "JUPE :JUPE [[+|-]<server> [[<target>] <duration> :<reason>]]");
537 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
538 + "JUPE :Views or manipulates server jupes.");
544 + * mh_kick - help message handler
546 +int mh_kick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
548 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
549 + "KICK :KICK <channel> <nick> [:<reason>]");
550 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
551 + "KICK :Kicks a user from a channel.");
557 + * mh_kill - help message handler
559 +int mh_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
561 + if (!IsAnOper(sptr))
562 + return mh_not_oper(cptr, sptr, parc, parv);
563 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
564 + "KILL :KILL <nick> :<reason>");
565 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
566 + "KILL :Disconnects a user from the network.");
572 + * mh_links - help message handler
573 + * TODO: check HIS feature
575 +int mh_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
577 + if (!IsAnOper(sptr))
578 + return mh_not_oper(cptr, sptr, parc, parv);
579 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
580 + "LINKS :LINKS [[<remote server>] <mask>]");
581 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
582 + "LINKS :Shows server links on the network.");
588 + * mh_list - help message handler
590 +int mh_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
592 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
593 + "LIST :LIST :[<channel>|<parameters>|STOP]");
594 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
595 + "LIST :Lists channels on the network. See \"/QUOTE LIST :\" for more info.");
596 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
597 + "LIST :Parameter <channel> is a comma separated list of one or more channels.");
603 + * mh_lusers - help message handler
604 + * TODO: check HIS remote feature
606 +int mh_lusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
608 + if (!IsAnOper(sptr))
609 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
612 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
613 + "LUSERS :LUSERS [<dummy> [<remote server>]]");
614 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
615 + "LUSERS :Shows information about the number of users on the network.");
621 + * mh_map - help message handler
622 + * TODO: check HIS feature
624 +int mh_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
626 + if (!IsAnOper(sptr))
627 + return mh_not_oper(cptr, sptr, parc, parv);
628 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
629 + "MAP :MAP [<mask>]");
630 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
631 + "MAP :Shows a map of the servers on the network.");
637 + * mh_mode - help message handler
638 + * TODO: check syntax is clear
640 +int mh_mode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
642 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
643 + "MODE :MODE <channel>|<nick> [<modes>]");
644 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
645 + "MODE :Views or changes modes of a channel or user.");
651 + * mh_motd - help message handler
652 + * TODO: check HIS remote feature
654 +int mh_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
656 + if (!IsAnOper(sptr))
657 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
660 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
661 + "MOTD :MOTD [<server>]");
662 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
663 + "MOTD :Shows the Message Of The Day.");
669 + * mh_names - help message handler
670 + * TODO: check HIS remote feature
672 +int mh_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
674 + if (!IsAnOper(sptr))
675 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
676 + "NAMES :NAMES [[-D] <channel>]");
678 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
679 + "NAMES :NAMES [[[-D] [channel]] [<server>]]");
680 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
681 + "NAMES :Shows the names of users on the channel.");
682 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
683 + "NAMES :Parameter <channel> is a comma separated list of one or more channels,"
684 + " and the -D option is for listing delayedjoin users.");
690 + * mh_nick - help message handler
692 +int mh_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
694 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
695 + "NICK :NICK <newnick>");
696 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
697 + "NICK :Changes nickname.");
703 + * mh_notice - help message handler
705 +int mh_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
707 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
708 + "NOTICE :NOTICE <target> :<message>");
709 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
710 + "NOTICE :Sends a notice to a target, where <target> can be a comma separated list of one or more nicks or channels.");
711 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
712 + "NOTICE :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
713 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
714 + "NOTICE :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
715 + if (IsAnOper(sptr)) {
716 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
717 + "NOTICE :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
718 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
719 + "NOTICE :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
726 + * mh_oper - help message handler
728 +int mh_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
730 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
731 + "OPER :OPER <username> <password>");
732 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
733 + "OPER :Logs in as IRC Operator.");
739 + * mh_opmode - help message handler
741 +int mh_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
743 + if (!IsAnOper(sptr))
744 + return mh_not_oper(cptr, sptr, parc, parv);
745 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
746 + "OPMODE :OPMODE [!]<channel> <modes>");
747 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
748 + "OPMODE :Changes modes on a channel.");
749 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
750 + "OPMODE :The ! prefix may be used to override a channel quarantine.");
755 + * mh_part - help message handler
757 +int mh_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
759 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
760 + "PART :PART <channel> [:<message>]");
761 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
762 + "PART :Parts a channel with an optional message.");
763 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
764 + "PART :Parameter <channel> is a comma separated list of one or more channels.");
770 + * mh_pass - help message handler
772 +int mh_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
774 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
775 + "PASS :PASS :<password>");
776 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
777 + "PASS :Provides the password required to connect to the server.");
783 + * mh_ping - help message handler
786 +int mh_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
788 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
789 + "PING :PING :<text>");
790 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
791 + "PING :Sends a ping to the server.");
797 + * mh_pong - help message handler
800 +int mh_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
802 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
803 + "PONG :PONG :<text>");
804 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
805 + "PONG :Sends a pong as reply to a PING from the server.");
811 + * mh_privmsg - help message handler
813 +int mh_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
815 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
816 + "PRIVMSG :PRIVMSG <target> :<message>");
817 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
818 + "PRIVMSG :Sends a message to a target, where <target> can be a comma separated list of one or more nicks or channels.");
819 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
820 + "PRIVMSG :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
821 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
822 + "PRIVMSG :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
823 + if (IsAnOper(sptr)) {
824 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
825 + "PRIVMSG :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
826 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
827 + "PRIVMSG :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
834 + * mh_privs - help message handler
836 +int mh_privs(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
838 + if (!IsAnOper(sptr))
839 + return mh_not_oper(cptr, sptr, parc, parv);
840 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
841 + "PRIVS :PRIVS <nick> [<nick> [..]]");
842 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
843 + "PRIVS :Shows the privileges an IRC Operator has.");
844 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
845 + "PRIVS :CHAN_LIMIT oper has no channel limit (JOIN)");
846 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
847 + "PRIVS :MODE_LCHAN oper can mode local chans without channel operator status");
848 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
849 + "PRIVS :WALK_LCHAN oper can walk through local modes (JOIN &chan override)");
850 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
851 + "PRIVS :DEOP_LCHAN oper cannot be deoped on local chans");
852 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
853 + "PRIVS :SHOW_INVIS show local invisible users");
854 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
855 + "PRIVS :SHOW_ALL_INVIS show all invisible users");
856 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
857 + "PRIVS :UNLIMIT_QUERY unlimited results in WHO");
858 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
859 + "PRIVS :KILL oper can KILL");
860 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
861 + "PRIVS :LOCAL_KILL oper can local KILL");
862 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
863 + "PRIVS :REHASH oper can REHASH");
864 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
865 + "PRIVS :RESTART oper can RESTART");
866 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
867 + "PRIVS :DIE oper can DIE");
868 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
869 + "PRIVS :GLINE oper can GLINE");
870 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
871 + "PRIVS :LOCAL_GLINE oper can local GLINE");
872 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
873 + "PRIVS :JUPE oper can JUPE");
874 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
875 + "PRIVS :LOCAL_JUPE oper can local JUPE");
876 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
877 + "PRIVS :OPMODE oper can OPMODE and CLEARMODE");
878 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
879 + "PRIVS :LOCAL_OPMODE oper can local OPMODE and CLEARMODE");
880 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
881 + "PRIVS :SET oper can SET");
882 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
883 + "PRIVS :WHOX log oper's usage of WHO x");
884 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
885 + "PRIVS :BADCHAN oper can BADCHAN (GLINE)");
886 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
887 + "PRIVS :LOCAL_BADCHAN oper can local BADCHAN (GLINE)");
888 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
889 + "PRIVS :SEE_CHAN oper can see in secret chans");
890 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
891 + "PRIVS :PROPAGATE propagate oper status");
892 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
893 + "PRIVS :DISPLAY oper status is displayed");
894 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
895 + "PRIVS :SEE_OPERS oper can see hidden opers");
896 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
897 + "PRIVS :WIDE_GLINE oper can set wider GLINE");
898 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
899 + "PRIVS :LIST_CHAN oper can LIST secret channels");
900 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
901 + "PRIVS :FORCE_OPMODE can hack modes on quarantined channels");
902 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
903 + "PRIVS :FORCE_LOCAL_OPMODE can hack modes on quarantined local channels");
904 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
905 + "PRIVS :APASS_OPMODE can hack modes +A/-A/+U/-U");
906 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
907 + "PRIVS :CHANSERV oper can set usermode +k");
908 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
909 + "PRIVS :XTRA_OPER oper can set usermode +X");
910 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
911 + "PRIVS :NOIDLE oper can set usermode +I");
912 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
913 + "PRIVS :FREEFORM oper can use freeform SETHOST");
914 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
915 + "PRIVS :PARANOID oper can set usermode +P");
916 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
917 + "PRIVS :CHECK oper can use CHECK");
918 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
919 + "PRIVS :WALL oper can use WALLOPS and WALLUSERS");
920 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
921 + "PRIVS :CLOSE oper can use CLOSE");
922 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
923 + "PRIVS :ROUTE oper can use CONNECT and SQUIT");
924 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
925 + "PRIVS :ROUTEINFO oper can use MAP, TRACE, ASLL, LINKS, and view JUPE list");
926 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
927 + "PRIVS :USER_PRIVACY oper can bypass user privacy (see through usermode +x)");
928 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
929 + "PRIVS :CHANNEL_PRIVACY oper can bypass channel privacy (see info on channels they are not on)");
930 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
931 + "PRIVS :SERVERINFO oper can use GET, STATS, HASH, and retrieve remote information");
937 + * mh_quit - help message handler
938 + * TODO: Disconnect or Disconnects?
940 +int mh_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
942 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
943 + "QUIT :QUIT :<message>");
944 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
945 + "QUIT :Disconnect from the network with an optional message.");
951 + * mh_rehash - help message handler
952 + * TODO: check the options, etc.
954 +int mh_rehash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
956 + if (!IsAnOper(sptr))
957 + return mh_not_oper(cptr, sptr, parc, parv);
958 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
959 + "REHASH :REHASH [L|M|Q]");
960 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
961 + "REHASH :Reloads the server conf file, MOTD, and log files.");
962 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
963 + "REHASH :Where L reopens the log files, M flushes the MOTD cache, Q the DNS resolver is not restarted.");
969 + * mh_reset - help message handler
971 +int mh_reset(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
973 + if (!IsAnOper(sptr))
974 + return mh_not_oper(cptr, sptr, parc, parv);
975 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
976 + "RESET :RESET <feature> [<parameters>]");
977 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
978 + "RESET :Resets a feature to its default hardcoded value.");
984 + * mh_restart - help message handler
986 +int mh_restart(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
988 + if (!IsAnOper(sptr))
989 + return mh_not_oper(cptr, sptr, parc, parv);
990 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
991 + "RESTART :RESTART <server>");
992 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
993 + "RESTART :Restarts the server. The servername needs to be given as sanity check.");
999 + * mh_rping - help message handler
1002 +int mh_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1004 + if (!IsAnOper(sptr))
1005 + return mh_not_oper(cptr, sptr, parc, parv);
1006 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1007 + "RPING :RPING <server> [<remote server>] [:<text>]");
1008 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1009 + "RPING :Pings a remote server and returns the Round Trip Time in milliseconds.");
1015 + * mh_set - help message handler
1017 +int mh_set(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1019 + if (!IsAnOper(sptr))
1020 + return mh_not_oper(cptr, sptr, parc, parv);
1021 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1022 + "SET :SET <feature> [<parameters>] :<value>");
1023 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1024 + "SET :Changes the value of a feature.");
1030 + * mh_sethost - help message handler
1032 +int mh_sethost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1034 + if (!IsAnOper(sptr)) {
1035 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1036 + "SETHOST :SETHOST <spoofhost> <password>");
1037 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1038 + "SETHOST :Sets a spoof host.");
1040 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1041 + "SETHOST :SETHOST <user> <host>");
1042 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1043 + "SETHOST :Sets a spoof user@host.");
1050 + * mh_settime - help message handler
1052 +int mh_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1054 + if (!IsAnOper(sptr))
1055 + return mh_not_oper(cptr, sptr, parc, parv);
1056 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1057 + "SETTIME :SETTIME <timestamp> [<server>]");
1058 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1059 + "SETTIME :Changes the time on a server."
1060 + "When parameter <timestamp> is 0 the local server "
1061 + "uses its own timestamp before sending it to the remote server.");
1067 + * mh_silence - help message handler
1068 + * TODO: mention ~ exempt mask prefix
1070 +int mh_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1072 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1073 + "SILENCE :SILENCE [[+|-]<mask>|<nick>]");
1074 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1075 + "SILENCE :Views or changes the silence list.");
1076 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1077 + "SILENCE :Parameter <mask> is a comma separated list of one or more masks.");
1078 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1079 + "SILENCE :Silence is a server side ignore -"
1080 + " any message sent privately or invites from a user matching a silence mask is dropped.");
1086 + * mh_squit - help message handler
1088 +int mh_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1090 + if (!IsAnOper(sptr))
1091 + return mh_not_oper(cptr, sptr, parc, parv);
1092 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1093 + "SQUIT :SQUIT <server> [:<reason>]");
1094 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1095 + "SQUIT :Disconnects a server from the network.");
1101 + * mh_stats - help message handler
1102 + * TODO: check HIS (too many per stats type) / HIS remote?
1104 +int mh_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1106 + if (!IsAnOper(sptr))
1107 + return mh_not_oper(cptr, sptr, parc, parv);
1108 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1109 + "STATS :STATS [<type> [[<server>] [<mask>]]]");
1110 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1111 + "STATS :Shows server configuration and statistics.");
1117 + * mh_time - help message handler
1118 + * TODO: check HIS remote feature
1120 +int mh_time(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1122 + if (!IsAnOper(sptr)) {
1123 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1125 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1126 + "TIME :Shows the time on the server.");
1129 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1130 + "TIME :TIME [<server>]");
1131 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1132 + "TIME :Shows the time on the server.");
1133 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1134 + "TIME :Parameter <server> can be a * to view the time from all servers.");
1142 + * mh_topic - help message handler
1144 +int mh_topic(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1146 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1147 + "TOPIC :TOPIC <channel> [:<text>]");
1148 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1149 + "TOPIC :Views or changes the topic on a channel.");
1150 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1151 + "TOPIC :Parameter <channel> is a comma separated list of one or more channels.");
1157 + * mh_trace - help message handler
1158 + * TODO: check HIS / HIS remote?
1159 + * TODO: check <to server> parameter
1161 +int mh_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1163 + if (!IsAnOper(sptr))
1164 + return mh_not_oper(cptr, sptr, parc, parv);
1165 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1166 + "TRACE :TRACE [<nick>|<server> <to server>]");
1167 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1168 + "TRACE :Shows the route to a user or server.");
1174 + * mh_uping - help message handler
1175 + * TODO: default port 7007, define UDP_PORT
1177 +int mh_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1179 + if (!IsAnOper(sptr))
1180 + return mh_not_oper(cptr, sptr, parc, parv);
1181 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1182 + "UPING :UPING <server> [<port>] [<remote server>] [<number of packets>]");
1183 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1184 + "UPING :Pings the host of the server with UDP packets - server does not have to be linked.");
1185 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1186 + "UPING :By default port 7007 is used, and 5 packets are sent (maximum is 20).");
1192 + * mh_user - help message handler
1194 +int mh_user(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1196 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1197 + "USER :USER <username> <hostname> <servername> :<realname>");
1198 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1199 + "USER :Registers a new client connection. Parameters <hostname> and <servername> are ignored.");
1205 + * mh_userhost - help message handler
1206 + * TODO: syntax clear?
1209 +int mh_userhost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1211 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1212 + "USERHOST :USERHOST <nick> [<nick> [..]]");
1213 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1214 + "USERHOST :Returns the user@host for a user.");
1220 + * mh_userip - help message handler
1221 + * TODO: syntax clear?
1224 +int mh_userip(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1226 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1227 + "USERIP :USERIP <nick> [<nick> [..]]");
1228 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1229 + "USERIP :Returns the user@ip for a user.");
1235 + * mh_version - help message handler
1236 + * TODO: check HIS remote feature
1238 +int mh_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1240 + if (!IsAnOper(sptr)) {
1241 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1242 + "VERSION :VERSION");
1243 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1244 + "VERSION :Shows information about the server, and the supported features and settings.");
1247 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1248 + "VERSION :VERSION [<server>]");
1249 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1250 + "VERSION :Shows information about the server, and the supported features and settings.");
1251 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1252 + "VERSION :Parameter <server> can be a * to view the version info from all servers.");
1259 + * mh_wallchops - help message handler
1260 + * TODO: mention NOTICE @#channel?
1262 +int mh_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1264 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1265 + "WALLCHOPS :WALLCHOPS <channel> :<message>");
1266 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1267 + "WALLCHOPS :Sends a channel notice to the operators on a channel.");
1273 + * mh_wallops - help message handler
1274 + * TODO: check HIS ?
1276 +int mh_wallops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1278 + if (!IsAnOper(sptr))
1279 + return mh_not_oper(cptr, sptr, parc, parv);
1280 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1281 + "WALLOPS :WALLOPS :<message>");
1282 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1283 + "WALLOPS :Sends a message to all IRC Operators with usermode +w set.");
1289 + * mh_wallusers - help message handler
1291 +int mh_wallusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1293 + if (!IsAnOper(sptr))
1294 + return mh_not_oper(cptr, sptr, parc, parv);
1295 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1296 + "WALLUSERS :WALLUSERS :<message>");
1297 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1298 + "WALLUSERS :Sends a message to all users with usermode +w set.");
1304 + * mh_wallvoices - help message handler
1306 +int mh_wallvoices(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1308 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1309 + "WALLVOICES :WALLVOICES <channel> :<message>");
1310 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1311 + "WALLVOICES :Sends a channel notice to the voices and operators on a channel.");
1317 + * mh_who - help message handler
1318 + * TODO: this is all way too much to add here.. :(
1319 + * TODO: mention <mask> - chan, nick, user, host, ip, server, realname
1321 +d Join-delayed channel members
1322 +o IRC Operator (specifying this one means only opers are matched)
1324 + * TODO: x for operators
1327 +n Nick, u Username, h Hostname, i Numeric IP,
1328 +s Servername, r Realname, a Account name
1332 +t Include the querytype in the reply
1333 +c Include (first) channel name (* when none can be shown)
1334 +u Include userID with eventual ~
1337 +s Include server name
1340 +d Include "distance" in hops
1341 +l Include idle time (0 for remote users)
1342 +a Include account name (0 when the user has no account set)
1344 +r Include real name
1345 +b Include account ID
1347 + * TODO: HIS settings
1349 +int mh_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1351 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1352 + "WHO :WHO <mask> [[<match>][%<fields>[,<querytype>]] [:<mask>]]");
1353 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1354 + "WHO :Returns information on a user.");
1355 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1356 + "WHO :Parameter <mask> can be a comma separated list of one or more nicks and channels.");
1362 + * mh_whois - help message handler
1363 + * TODO: check HIS / HIS remote
1365 +int mh_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1367 + if (!IsAnOper(sptr)) {
1368 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1369 + "WHOIS :WHOIS [<dummy>] <nick>");
1370 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1371 + "WHOIS :Shows who someone is.");
1372 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1373 + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1374 + " <dummy> can be specified to get a reply from the user's server to show idle and signon time");
1377 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1378 + "WHOIS :WHOIS [<server>] <nick>");
1379 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1380 + "WHOIS :Shows who someone is.");
1381 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1382 + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1383 + " the same nick can be specified as <server> to get a reply from the user's server to show idle and signon time");
1390 + * mh_whowas - help message handler
1391 + * TODO: check HIS / HIS remote
1392 + * TODO: see if 20 is a define
1394 +int mh_whowas(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1396 + if (!IsAnOper(sptr)) {
1397 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1398 + "WHOWAS :WHOWAS <nick> [<max>]");
1399 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1400 + "WHOWAS :Shows who someone was.");
1401 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1402 + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1403 + " <max> is 0 by default (unlimited).");
1406 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1407 + "WHOWAS :WHOIS <nick> [<max> [<server>]]");
1408 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1409 + "WHOWAS :Shows who someone was.");
1410 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1411 + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1412 + " <max> is 0 by default (unlimited),"
1413 + " maximum number of results from a remote server is 20.");
1417 \ No newline at end of file
1418 diff -r 3fc56aefcea6 ircd/parse.c
1419 --- a/ircd/parse.c Tue Jan 27 18:27:54 2009 +0100
1420 +++ b/ircd/parse.c Tue Jan 27 20:49:11 2009 +0100
1421 @@ -110,534 +110,534 @@
1424 0, MAXPARA, MFLG_SLOW, 0, NULL,
1425 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1426 - { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore }
1427 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1428 + { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore, mh_privmsg }
1433 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1434 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1435 - { m_nick, m_nick, ms_nick, m_nick, m_ignore }
1436 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1437 + { m_nick, m_nick, ms_nick, m_nick, m_ignore, mh_nick }
1442 0, MAXPARA, MFLG_SLOW | MFLG_IGNORE, 0, NULL,
1443 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1444 - { m_ignore, m_notice, ms_notice, mo_notice, m_ignore }
1445 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1446 + { m_ignore, m_notice, ms_notice, mo_notice, m_ignore, mh_notice }
1451 0, MAXPARA, MFLG_SLOW, 0, NULL,
1452 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1453 - { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore }
1454 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1455 + { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore, mh_wallchops }
1460 0, MAXPARA, MFLG_SLOW, 0, NULL,
1461 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1462 - { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore }
1463 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1464 + { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore, mh_wallvoices }
1469 0, MAXPARA, MFLG_SLOW, 0, NULL,
1470 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1471 - { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore }
1472 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1473 + { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore, mh_cprivmsg }
1478 0, MAXPARA, MFLG_SLOW, 0, NULL,
1479 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1480 - { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore }
1481 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1482 + { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore, mh_cnotice }
1487 0, MAXPARA, MFLG_SLOW, 0, NULL,
1488 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1489 - { m_unregistered, m_join, ms_join, m_join, m_ignore }
1490 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1491 + { m_unregistered, m_join, ms_join, m_join, m_ignore, mh_join }
1496 0, MAXPARA, MFLG_SLOW, 0, NULL,
1497 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1498 - { m_unregistered, m_mode, ms_mode, m_mode, m_ignore }
1499 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1500 + { m_unregistered, m_mode, ms_mode, m_mode, m_ignore, mh_mode }
1505 0, MAXPARA, MFLG_SLOW, 0, NULL,
1506 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1507 - { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore }
1508 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1509 + { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore, mh_not_server }
1514 0, MAXPARA, MFLG_SLOW, 0, NULL,
1515 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1516 - { m_ignore, m_ignore, ms_create, m_ignore, m_ignore }
1517 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1518 + { m_ignore, m_ignore, ms_create, m_ignore, m_ignore, mh_not_server }
1523 0, MAXPARA, MFLG_SLOW, 0, NULL,
1524 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1525 - { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore }
1526 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1527 + { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore, mh_not_server }
1532 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1533 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1534 - { m_quit, m_quit, ms_quit, m_quit, m_ignore }
1535 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1536 + { m_quit, m_quit, ms_quit, m_quit, m_ignore, mh_quit }
1541 0, MAXPARA, MFLG_SLOW, 0, NULL,
1542 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1543 - { m_unregistered, m_part, ms_part, m_part, m_ignore }
1544 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1545 + { m_unregistered, m_part, ms_part, m_part, m_ignore, mh_part }
1550 0, MAXPARA, MFLG_SLOW, 0, NULL,
1551 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1552 - { m_unregistered, m_topic, ms_topic, m_topic, m_ignore }
1553 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1554 + { m_unregistered, m_topic, ms_topic, m_topic, m_ignore, mh_topic }
1559 0, MAXPARA, MFLG_SLOW, 0, NULL,
1560 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1561 - { m_unregistered, m_invite, ms_invite, m_invite, m_ignore }
1562 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1563 + { m_unregistered, m_invite, ms_invite, m_invite, m_ignore, mh_invite }
1568 0, MAXPARA, MFLG_SLOW, 0, NULL,
1569 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1570 - { m_unregistered, m_kick, ms_kick, m_kick, m_ignore }
1571 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1572 + { m_unregistered, m_kick, ms_kick, m_kick, m_ignore, mh_kick }
1577 0, MAXPARA, MFLG_SLOW, 0, NULL,
1578 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1579 - { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore }
1580 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1581 + { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore, mh_wallops }
1586 0, MAXPARA, MFLG_SLOW, 0, NULL,
1587 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1588 - { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore }
1589 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1590 + { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore, mh_wallusers }
1595 0, MAXPARA, MFLG_SLOW, 0, NULL,
1596 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1597 - { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore }
1598 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1599 + { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore, mh_not_server }
1604 0, MAXPARA, MFLG_SLOW, 0, NULL,
1605 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1606 - { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore }
1607 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1608 + { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore, mh_ping }
1613 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1614 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1615 - { mr_pong, m_pong, ms_pong, m_pong, m_ignore }
1616 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1617 + { mr_pong, m_pong, ms_pong, m_pong, m_ignore, mh_pong }
1622 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1623 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1624 - { mr_error, m_ignore, ms_error, m_ignore, m_ignore }
1625 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1626 + { mr_error, m_ignore, ms_error, m_ignore, m_ignore, mh_not_server }
1631 0, MAXPARA, MFLG_SLOW, 0, NULL,
1632 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1633 - { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore }
1634 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1635 + { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore, mh_kill }
1640 0, MAXPARA, MFLG_SLOW, 0, NULL,
1641 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1642 - { m_user, m_registered, m_ignore, m_registered, m_ignore }
1643 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1644 + { m_user, m_registered, m_ignore, m_registered, m_ignore, mh_user }
1649 0, MAXPARA, MFLG_SLOW, 0, NULL,
1650 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1651 - { m_unregistered, m_away, ms_away, m_away, m_ignore }
1652 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1653 + { m_unregistered, m_away, ms_away, m_away, m_ignore, mh_away }
1658 0, 1, MFLG_SLOW, 0, NULL,
1659 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1660 - { m_unregistered, m_ison, m_ignore, m_ison, m_ignore }
1661 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1662 + { m_unregistered, m_ison, m_ignore, m_ison, m_ignore, mh_ison }
1667 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1668 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1669 - { mr_server, m_registered, ms_server, m_registered, m_ignore }
1670 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1671 + { mr_server, m_registered, ms_server, m_registered, m_ignore, mh_not_server }
1676 0, MAXPARA, MFLG_SLOW, 0, NULL,
1677 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1678 - { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore }
1679 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1680 + { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore, mh_squit }
1685 0, MAXPARA, MFLG_SLOW, 0, NULL,
1686 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1687 - { m_unregistered, m_whois, ms_whois, m_whois, m_ignore }
1688 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1689 + { m_unregistered, m_whois, ms_whois, m_whois, m_ignore, mh_whois }
1694 0, MAXPARA, MFLG_SLOW, 0, NULL,
1695 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1696 - { m_unregistered, m_who, m_ignore, m_who, m_ignore }
1697 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1698 + { m_unregistered, m_who, m_ignore, m_who, m_ignore, mh_who }
1703 0, MAXPARA, MFLG_SLOW, 0, NULL,
1704 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1705 - { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore }
1706 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1707 + { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore, mh_whowas }
1712 0, MAXPARA, MFLG_SLOW, 0, NULL,
1713 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1714 - { m_unregistered, m_list, m_ignore, m_list, m_ignore }
1715 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1716 + { m_unregistered, m_list, m_ignore, m_list, m_ignore, mh_list }
1721 0, MAXPARA, MFLG_SLOW, 0, NULL,
1722 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1723 - { m_unregistered, m_names, m_names, m_names, m_ignore }
1724 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1725 + { m_unregistered, m_names, m_names, m_names, m_ignore, mh_names }
1730 0, 1, MFLG_SLOW, 0, NULL,
1731 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1732 - { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore }
1733 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1734 + { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore, mh_userhost }
1739 0, 1, MFLG_SLOW, 0, NULL,
1740 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1741 - { m_unregistered, m_userip, m_ignore, m_userip, m_ignore }
1742 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1743 + { m_unregistered, m_userip, m_ignore, m_userip, m_ignore, mh_userip }
1748 0, MAXPARA, MFLG_SLOW, 0, NULL,
1749 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1750 - { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore }
1751 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1752 + { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore, mh_trace }
1757 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1758 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1759 - { mr_pass, m_registered, m_ignore, m_registered, m_ignore }
1760 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1761 + { mr_pass, m_registered, m_ignore, m_registered, m_ignore, mh_pass }
1766 0, MAXPARA, MFLG_SLOW, 0, NULL,
1767 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1768 - { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore }
1769 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1770 + { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore, mh_lusers }
1775 0, MAXPARA, MFLG_SLOW, 0, NULL,
1776 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1777 - { m_unregistered, m_time, m_time, m_time, m_ignore }
1778 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1779 + { m_unregistered, m_time, m_time, m_time, m_ignore, mh_time }
1784 0, MAXPARA, MFLG_SLOW, 0, NULL,
1785 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1786 - { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore }
1787 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1788 + { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore, mh_settime }
1793 0, MAXPARA, MFLG_SLOW, 0, NULL,
1794 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1795 - { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore }
1796 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1797 + { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore, mh_rping }
1802 0, MAXPARA, MFLG_SLOW, 0, NULL,
1803 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1804 - { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore }
1805 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1806 + { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore, mh_not_server }
1811 0, MAXPARA, MFLG_SLOW, 0, NULL,
1812 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1813 - { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore }
1814 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1815 + { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore, mh_oper }
1820 0, MAXPARA, MFLG_SLOW, 0, NULL,
1821 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1822 - { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore }
1823 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1824 + { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore, mh_connect }
1829 0, MAXPARA, MFLG_SLOW, 0, NULL,
1830 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1831 - { m_unregistered, m_map, m_ignore, m_map, m_ignore }
1832 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1833 + { m_unregistered, m_map, m_ignore, m_map, m_ignore, mh_map }
1838 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1839 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1840 - { m_version, m_version, ms_version, mo_version, m_ignore }
1841 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1842 + { m_version, m_version, ms_version, mo_version, m_ignore, mh_version }
1847 0, MAXPARA, MFLG_SLOW, 0, NULL,
1848 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1849 - { m_unregistered, m_stats, m_stats, m_stats, m_ignore }
1850 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1851 + { m_unregistered, m_stats, m_stats, m_stats, m_ignore, mh_stats }
1856 0, MAXPARA, MFLG_SLOW, 0, NULL,
1857 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1858 - { m_unregistered, m_links, ms_links, m_links, m_ignore }
1859 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1860 + { m_unregistered, m_links, ms_links, m_links, m_ignore, mh_links }
1865 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1866 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1867 - { m_admin, m_admin, ms_admin, mo_admin, m_ignore }
1868 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1869 + { m_admin, m_admin, ms_admin, mo_admin, m_ignore, mh_admin }
1874 0, MAXPARA, MFLG_SLOW, 0, NULL,
1875 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1876 - { m_unregistered, m_help, m_ignore, m_help, m_ignore }
1877 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1878 + { m_unregistered, m_help, m_ignore, m_help, m_ignore, mh_help }
1883 0, MAXPARA, MFLG_SLOW, 0, NULL,
1884 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1885 - { m_unregistered, m_info, ms_info, mo_info, m_ignore }
1886 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1887 + { m_unregistered, m_info, ms_info, mo_info, m_ignore, mh_info }
1892 0, MAXPARA, MFLG_SLOW, 0, NULL,
1893 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1894 - { m_unregistered, m_motd, m_motd, m_motd, m_ignore }
1895 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1896 + { m_unregistered, m_motd, m_motd, m_motd, m_ignore, mh_motd }
1901 0, MAXPARA, MFLG_SLOW, 0, NULL,
1902 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1903 - { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore }
1904 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1905 + { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore, mh_close }
1910 0, MAXPARA, MFLG_SLOW, 0, NULL,
1911 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1912 - { m_unregistered, m_silence, ms_silence, m_silence, m_ignore }
1913 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1914 + { m_unregistered, m_silence, ms_silence, m_silence, m_ignore, mh_silence }
1919 0, MAXPARA, 0, 0, NULL,
1920 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1921 - { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore }
1922 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1923 + { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore, mh_gline }
1928 0, MAXPARA, MFLG_SLOW, 0, NULL,
1929 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1930 - { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore }
1931 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1932 + { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore, mh_jupe }
1937 0, MAXPARA, MFLG_SLOW, 0, NULL,
1938 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1939 - { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore }
1940 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1941 + { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore, mh_opmode }
1946 0, MAXPARA, MFLG_SLOW, 0, NULL,
1947 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1948 - { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore }
1949 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1950 + { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore, mh_clearmode }
1955 0, MAXPARA, MFLG_SLOW, 0, NULL,
1956 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1957 - { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore }
1958 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1959 + { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore, mh_uping }
1964 0, MAXPARA, MFLG_SLOW, 0, NULL,
1965 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1966 - { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore }
1967 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1968 + { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore, mh_not_server }
1971 MSG_END_OF_BURST_ACK,
1972 TOK_END_OF_BURST_ACK,
1973 0, MAXPARA, MFLG_SLOW, 0, NULL,
1974 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1975 - { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore }
1976 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1977 + { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore, mh_not_server }
1982 0, MAXPARA, MFLG_SLOW, 0, NULL,
1983 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1984 - { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore }
1985 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1986 + { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore, mh_not_server }
1991 0, MAXPARA, MFLG_SLOW, 0, NULL,
1992 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1993 - { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore }
1994 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1995 + { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore, mh_hash }
2000 0, MAXPARA, MFLG_SLOW, 0, NULL,
2001 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2002 - { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore }
2003 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2004 + { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore, mh_rehash }
2009 0, MAXPARA, MFLG_SLOW, 0, NULL,
2010 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2011 - { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore }
2012 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2013 + { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore, mh_restart }
2018 0, MAXPARA, MFLG_SLOW, 0, NULL,
2019 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2020 - { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore }
2021 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2022 + { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore, mh_die }
2027 0, MAXPARA, MFLG_SLOW, 0, NULL,
2028 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2029 - { m_proto, m_proto, m_proto, m_proto, m_ignore }
2030 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2031 + { m_proto, m_proto, m_proto, m_proto, m_ignore, mh_nohelp }
2036 0, MAXPARA, MFLG_SLOW, 0, NULL,
2037 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2038 - { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore }
2039 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2040 + { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore, mh_set }
2045 0, MAXPARA, MFLG_SLOW, 0, NULL,
2046 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2047 - { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore }
2048 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2049 + { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore, mh_reset }
2054 0, MAXPARA, MFLG_SLOW, 0, NULL,
2055 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2056 - { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore }
2057 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2058 + { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore, mh_get }
2063 0, MAXPARA, MFLG_SLOW, 0, NULL,
2064 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2065 - { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore }
2066 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2067 + { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore, mh_privs }
2072 0, MAXPARA, MFLG_SLOW, 0, NULL,
2073 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2074 - { m_ignore, m_ignore, ms_account, m_ignore, m_ignore }
2075 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2076 + { m_ignore, m_ignore, ms_account, m_ignore, m_ignore, mh_not_server }
2081 0, MAXPARA, MFLG_SLOW, 0, NULL,
2082 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2083 - { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore }
2084 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2085 + { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore, mh_asll }
2090 0, MAXPARA, MFLG_SLOW, 0, NULL,
2091 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2092 - { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore }
2093 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2094 + { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore, mh_sethost }
2096 #if WE_HAVE_A_REAL_CAPABILITY_NOW
2100 0, MAXPARA, 0, 0, NULL,
2101 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2102 - { m_cap, m_cap, m_ignore, m_cap, m_ignore }
2103 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2104 + { m_cap, m_cap, m_ignore, m_cap, m_ignore, mh_nohelp }
2111 0, MAXPARA, MFLG_SLOW, 0, NULL,
2112 - { m_unregistered, m_not_oper, m_check, m_check, m_ignore }
2113 + { m_unregistered, m_not_oper, m_check, m_check, m_ignore, mh_check }
2120 0, MAXPARA, MFLG_SLOW, 0, NULL,
2121 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2122 - { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore }
2123 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2124 + { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore, mh_nohelp }
2127 /* This command is an alias for QUIT during the unregistered part of
2131 0, MAXPARA, MFLG_SLOW, 0, NULL,
2132 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2133 - { m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
2134 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2135 + { m_quit, m_ignore, m_ignore, m_ignore, m_ignore, mh_nohelp }
2139 @@ -779,6 +779,14 @@
2143 +/** Look up a command in the message trie.
2144 + * @param cmd Text of command to look up.
2145 + * @return Pointer to matching message, or NULL if non exists.
2147 +struct Message *find_message_by_cmd(char *cmd) {
2148 + return msg_tree_parse(cmd, &msg_tree);
2151 /** Registers a service mapping to the pseudocommand handler.
2152 * @param[in] map Service mapping to add.
2153 * @return Non-zero on success; zero if a command already used the name.
2155 msg->handlers[SERVER_HANDLER] = m_ignore;
2156 msg->handlers[OPER_HANDLER] = m_pseudo;
2157 msg->handlers[SERVICE_HANDLER] = m_ignore;
2158 + msg->handlers[HELP_HANDLER] = mh_nohelp;
2160 add_msg_element(&msg_tree, msg, msg->cmd);
2162 diff -r 3fc56aefcea6 ircd/s_err.c
2163 --- a/ircd/s_err.c Tue Jan 27 18:27:54 2009 +0100
2164 +++ b/ircd/s_err.c Tue Jan 27 20:49:11 2009 +0100
2167 { RPL_ENDOFMOTD, ":End of /MOTD command.", "376" },
2170 + { RPL_HELP, 0, "377" },
2173 + { RPL_ENDOFHELP, "%s :End of /HELP report.", "378" },
2179 { ERR_INPUTTOOLONG, ":Input line was too long", "417" },
2182 + { ERR_NOHELP, "%s :No help found.", "418" },