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 5a1e5e09c766 include/handlers.h
25 --- a/include/handlers.h Sat Jan 31 18:46:47 2009 +0100
26 +++ b/include/handlers.h Sat Jan 31 18:51:08 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 5a1e5e09c766 include/ircd_handler.h
106 --- a/include/ircd_handler.h Sat Jan 31 18:46:47 2009 +0100
107 +++ b/include/ircd_handler.h Sat Jan 31 18:51:08 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 5a1e5e09c766 include/msg.h
117 --- a/include/msg.h Sat Jan 31 18:46:47 2009 +0100
118 +++ b/include/msg.h Sat Jan 31 18:51:08 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 5a1e5e09c766 include/numeric.h
129 --- a/include/numeric.h Sat Jan 31 18:46:47 2009 +0100
130 +++ b/include/numeric.h Sat Jan 31 18:51:08 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 5a1e5e09c766 include/parse.h
158 --- a/include/parse.h Sat Jan 31 18:46:47 2009 +0100
159 +++ b/include/parse.h Sat Jan 31 18:51:08 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 5a1e5e09c766 ircd/m_defaults.c
169 --- a/ircd/m_defaults.c Sat Jan 31 18:46:47 2009 +0100
170 +++ b/ircd/m_defaults.c Sat Jan 31 18:51:08 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 diff -r 5a1e5e09c766 ircd/m_help.c
191 --- a/ircd/m_help.c Sat Jan 31 18:46:47 2009 +0100
192 +++ b/ircd/m_help.c Sat Jan 31 18:51:08 2009 +0100
197 +#include "handlers.h"
200 #include "ircd_log.h"
204 #include "numnicks.h"
208 /* #include <assert.h> -- Now using assert in ircd_log.h */
209 @@ -100,9 +102,1212 @@
210 int m_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
213 + struct Message* mptr;
214 + MessageHandler handler = 0;
217 - for (i = 0; msgtab[i].cmd; i++)
218 - sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
219 + /* list all commands */
221 + for (i = 0; msgtab[i].cmd; i++)
222 + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
227 + /* nothing found */
228 + if ((mptr = find_message_by_cmd(command)) == NULL)
229 + return send_reply(sptr, ERR_NOHELP, command);
231 + /* found a help handler function */
232 + handler = mptr->handlers[HELP_HANDLER];
234 + assert(0 != handler);
236 + /* call the help handler function */
237 + (*handler) (cptr, sptr, parc, parv);
238 + return send_reply(sptr, RPL_ENDOFHELP, command);
243 + * mh_help - help message handler
245 +int mh_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
247 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
248 + "HELP :HELP [<command>]");
249 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
250 + "HELP :Lists all server commands or info on the given command.");
256 + * TODO: move all the mh_ functions into the files of the commands they belong to
261 + * mh_admin - help message handler
262 + * TODO: check HIS remote
264 +int mh_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
266 + if (!IsAnOper(sptr))
267 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
270 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
271 + "ADMIN :ADMIN [<server>]");
272 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
273 + "ADMIN :Shows administrative contact for the server.");
279 + * mh_asll - help message handler
281 +int mh_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
283 + if (!IsAnOper(sptr))
284 + return mh_not_oper(cptr, sptr, parc, parv);
285 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
286 + "ASLL :ASLL <mask> [<server>]");
287 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
288 + "ASLL :Shows Asymmetric Link Latency information.");
289 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
290 + "ASLL :Parameter <mask> is matched against directly linked servers, and may have more than one match.");
296 + * mh_away - help message handler
298 +int mh_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
300 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
301 + "AWAY :AWAY [<message>]");
302 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
303 + "AWAY :Sets or clears the away message.");
309 + * mh_check - help message handler
311 +int mh_check(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
313 + if (!IsAnOper(sptr))
314 + return mh_not_oper(cptr, sptr, parc, parv);
315 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
316 + "CHECK :CHECK [<server>] <mask> [<flags>]");
317 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
318 + "CHECK :Shows detailed information about a user, a channel, a hostmask, or a server.");
319 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
320 + "CHECK :Flags are: -C show clones, -c show channels, -s show servernames, -e show more, "
321 + "-i show IPs, -I show hostnames and IPs, -u do not show users, -o show only channel operators, -l show oplevels.");
327 + * mh_clearmode - help message handler
329 +int mh_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
331 + if (!IsAnOper(sptr))
332 + return mh_not_oper(cptr, sptr, parc, parv);
333 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
334 + "CLEARMODE :CLEARMODE [!]<channel> [<modes>]");
335 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
336 + "CLEARMODE :Clears modes on a channel.");
337 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
338 + "CLEARMODE :Default modes are ovpsmikbl - o deops all channel operators, "
339 + "v devoices all channel voices, and b removes all channel bans.");
340 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
341 + "CLEARMODE :The ! prefix may be used to override a channel quarantine.");
347 + * mh_close - help message handler
349 +int mh_close(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
351 + if (!IsAnOper(sptr))
352 + return mh_not_oper(cptr, sptr, parc, parv);
353 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
355 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
356 + "CLOSE :Closes unregistered connections to the server.");
362 + * mh_cnotice - help message handler
364 +int mh_cnotice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
366 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
367 + "CNOTICE :CNOTICE <nick> <channel> :<message>");
368 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
369 + "CNOTICE :Sends a private notice to a user.");
370 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
371 + "CNOTICE :A channel voice or operator can use this to bypass the target flood limit "
372 + "(target change too fast error) when the user is on the channel.");
378 + * mh_connect - help message handler
380 +int mh_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
382 + if (!IsAnOper(sptr))
383 + return mh_not_oper(cptr, sptr, parc, parv);
384 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
385 + "CONNECT :CONNECT <server> [<port> [<remote server>]]");
386 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
387 + "CONNECT :Connects the server to another server.");
388 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
389 + "CONNECT :Special port 0 can be used to let the remote server workout the port to use.");
395 + * mh_cprivmsg - help message handler
397 +int mh_cprivmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
399 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
400 + "CPRIVMSG :CPRIVMSG <nick> <channel> :<message>");
401 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
402 + "CPRIVMSG :Sends a private message to a user.");
403 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
404 + "CPRIVMSG :A channel voice or operator can use this to bypass the target flood limit "
405 + "(target change too fast error) when the user is on the channel.");
411 + * mh_die - help message handler
413 +int mh_die(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
415 + if (!IsAnOper(sptr))
416 + return mh_not_oper(cptr, sptr, parc, parv);
417 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
418 + "DIE :DIE <server>");
419 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
420 + "DIE :Terminates the server. The servername needs to be given as sanity check.");
426 + * mh_get - help message handler
429 +int mh_get(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
431 + if (!IsAnOper(sptr))
432 + return mh_not_oper(cptr, sptr, parc, parv);
433 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
434 + "GET :GET <feature> [<parameters>]");
435 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
436 + "GET :Returns the value of a feature.");
442 + * mh_gline - help message handler
445 +int mh_gline(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
447 + if (!IsAnOper(sptr))
448 + return mh_not_oper(cptr, sptr, parc, parv);
449 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
450 + "GLINE :GLINE [[!][+|-|>|<]<mask> [<target>] [<duration> [:<reason>]]]");
451 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
452 + "GLINE :Views, sets or changes a gline.");
458 + * mh_hash - help message handler
461 +int mh_hash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
463 + if (!IsAnOper(sptr))
464 + return mh_not_oper(cptr, sptr, parc, parv);
465 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
467 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
468 + "HASH :Shows hash table statistics.");
474 + * mh_info - help message handler
475 + * TODO: check HIS remote
477 +int mh_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
479 + if (!IsAnOper(sptr)) {
480 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO");
481 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :Shows info about the IRCd.");
482 + return mh_not_oper(cptr, sptr, parc, parv);
484 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO [<server>]");
485 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
486 + "INFO :Show info about the IRCd. Lists a file hash and version number for its source files.");
493 + * mh_invite - help message handler
495 +int mh_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
497 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
498 + "INVITE :INVITE <nick> <channel>");
499 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
500 + "INVITE :Invites a user to a channel.");
506 + * mh_ison - help message handler
507 + * TODO: check that syntax is clear - no limit on number of nicks
509 +int mh_ison(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
511 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
512 + "ISON :ISON <nick> [<nick> [..]]");
513 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
514 + "ISON :Returns the nicks that are on the network.");
520 + * mh_join - help message handler
522 +int mh_join(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
524 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
525 + "JOIN :JOIN <channel> [<key>]");
526 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
527 + "JOIN :Joins a channel, where <channel> and <key> are a comma separated list of one or more elements.");
528 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
529 + "JOIN :Joining channel 0 can be used to leave all channels.");
535 + * mh_jupe - help message handler
538 +int mh_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
540 + if (!IsAnOper(sptr))
541 + return mh_not_oper(cptr, sptr, parc, parv);
542 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
543 + "JUPE :JUPE [[+|-]<server> [[<target>] <duration> :<reason>]]");
544 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
545 + "JUPE :Views or manipulates server jupes.");
551 + * mh_kick - help message handler
553 +int mh_kick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
555 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
556 + "KICK :KICK <channel> <nick> [:<reason>]");
557 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
558 + "KICK :Kicks a user from a channel.");
564 + * mh_kill - help message handler
566 +int mh_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
568 + if (!IsAnOper(sptr))
569 + return mh_not_oper(cptr, sptr, parc, parv);
570 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
571 + "KILL :KILL <nick> :<reason>");
572 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
573 + "KILL :Disconnects a user from the network.");
579 + * mh_links - help message handler
580 + * TODO: check HIS feature
582 +int mh_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
584 + if (!IsAnOper(sptr))
585 + return mh_not_oper(cptr, sptr, parc, parv);
586 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
587 + "LINKS :LINKS [[<remote server>] <mask>]");
588 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
589 + "LINKS :Shows server links on the network.");
595 + * mh_list - help message handler
597 +int mh_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
599 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
600 + "LIST :LIST :[<channel>|<parameters>|STOP]");
601 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
602 + "LIST :Lists channels on the network. See \"/QUOTE LIST :\" for more info.");
603 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
604 + "LIST :Parameter <channel> is a comma separated list of one or more channels.");
610 + * mh_lusers - help message handler
611 + * TODO: check HIS remote feature
613 +int mh_lusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
615 + if (!IsAnOper(sptr))
616 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
619 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
620 + "LUSERS :LUSERS [<dummy> [<remote server>]]");
621 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
622 + "LUSERS :Shows information about the number of users on the network.");
628 + * mh_map - help message handler
629 + * TODO: check HIS feature
631 +int mh_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
633 + if (!IsAnOper(sptr))
634 + return mh_not_oper(cptr, sptr, parc, parv);
635 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
636 + "MAP :MAP [<mask>]");
637 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
638 + "MAP :Shows a map of the servers on the network.");
644 + * mh_mode - help message handler
645 + * TODO: check syntax is clear
647 +int mh_mode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
649 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
650 + "MODE :MODE <channel>|<nick> [<modes>]");
651 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
652 + "MODE :Views or changes modes of a channel or user.");
658 + * mh_motd - help message handler
659 + * TODO: check HIS remote feature
661 +int mh_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
663 + if (!IsAnOper(sptr))
664 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
667 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
668 + "MOTD :MOTD [<server>]");
669 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
670 + "MOTD :Shows the Message Of The Day.");
676 + * mh_names - help message handler
677 + * TODO: check HIS remote feature
679 +int mh_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
681 + if (!IsAnOper(sptr))
682 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
683 + "NAMES :NAMES [[-D] <channel>]");
685 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
686 + "NAMES :NAMES [[[-D] [channel]] [<server>]]");
687 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
688 + "NAMES :Shows the names of users on the channel.");
689 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
690 + "NAMES :Parameter <channel> is a comma separated list of one or more channels,"
691 + " and the -D option is for listing delayedjoin users.");
697 + * mh_nick - help message handler
699 +int mh_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
701 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
702 + "NICK :NICK <newnick>");
703 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
704 + "NICK :Changes nickname.");
710 + * mh_notice - help message handler
712 +int mh_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
714 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
715 + "NOTICE :NOTICE <target> :<message>");
716 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
717 + "NOTICE :Sends a notice to a target, where <target> can be a comma separated list of one or more nicks or channels.");
718 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
719 + "NOTICE :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
720 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
721 + "NOTICE :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
722 + if (IsAnOper(sptr)) {
723 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
724 + "NOTICE :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
725 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
726 + "NOTICE :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
733 + * mh_oper - help message handler
735 +int mh_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
737 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
738 + "OPER :OPER <username> <password>");
739 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
740 + "OPER :Logs in as IRC Operator.");
746 + * mh_opmode - help message handler
748 +int mh_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
750 + if (!IsAnOper(sptr))
751 + return mh_not_oper(cptr, sptr, parc, parv);
752 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
753 + "OPMODE :OPMODE [!]<channel> <modes>");
754 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
755 + "OPMODE :Changes modes on a channel.");
756 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
757 + "OPMODE :The ! prefix may be used to override a channel quarantine.");
762 + * mh_part - help message handler
764 +int mh_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
766 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
767 + "PART :PART <channel> [:<message>]");
768 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
769 + "PART :Parts a channel with an optional message.");
770 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
771 + "PART :Parameter <channel> is a comma separated list of one or more channels.");
777 + * mh_pass - help message handler
779 +int mh_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
781 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
782 + "PASS :PASS :<password>");
783 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
784 + "PASS :Provides the password required to connect to the server.");
790 + * mh_ping - help message handler
793 +int mh_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
795 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
796 + "PING :PING :<text>");
797 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
798 + "PING :Sends a ping to the server.");
804 + * mh_pong - help message handler
807 +int mh_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
809 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
810 + "PONG :PONG :<text>");
811 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
812 + "PONG :Sends a pong as reply to a PING from the server.");
818 + * mh_privmsg - help message handler
820 +int mh_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
822 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
823 + "PRIVMSG :PRIVMSG <target> :<message>");
824 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
825 + "PRIVMSG :Sends a message to a target, where <target> can be a comma separated list of one or more nicks or channels.");
826 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
827 + "PRIVMSG :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
828 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
829 + "PRIVMSG :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
830 + if (IsAnOper(sptr)) {
831 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
832 + "PRIVMSG :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
833 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
834 + "PRIVMSG :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
841 + * mh_privs - help message handler
843 +int mh_privs(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
845 + if (!IsAnOper(sptr))
846 + return mh_not_oper(cptr, sptr, parc, parv);
847 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
848 + "PRIVS :PRIVS <nick> [<nick> [..]]");
849 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
850 + "PRIVS :Shows the privileges an IRC Operator has.");
851 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
852 + "PRIVS :CHAN_LIMIT oper has no channel limit (JOIN)");
853 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
854 + "PRIVS :MODE_LCHAN oper can mode local chans without channel operator status");
855 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
856 + "PRIVS :WALK_LCHAN oper can walk through local modes (JOIN &chan override)");
857 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
858 + "PRIVS :DEOP_LCHAN oper cannot be deoped on local chans");
859 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
860 + "PRIVS :SHOW_INVIS show local invisible users");
861 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
862 + "PRIVS :SHOW_ALL_INVIS show all invisible users");
863 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
864 + "PRIVS :UNLIMIT_QUERY unlimited results in WHO");
865 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
866 + "PRIVS :KILL oper can KILL");
867 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
868 + "PRIVS :LOCAL_KILL oper can local KILL");
869 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
870 + "PRIVS :REHASH oper can REHASH");
871 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
872 + "PRIVS :RESTART oper can RESTART");
873 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
874 + "PRIVS :DIE oper can DIE");
875 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
876 + "PRIVS :GLINE oper can GLINE");
877 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
878 + "PRIVS :LOCAL_GLINE oper can local GLINE");
879 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
880 + "PRIVS :JUPE oper can JUPE");
881 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
882 + "PRIVS :LOCAL_JUPE oper can local JUPE");
883 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
884 + "PRIVS :OPMODE oper can OPMODE and CLEARMODE");
885 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
886 + "PRIVS :LOCAL_OPMODE oper can local OPMODE and CLEARMODE");
887 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
888 + "PRIVS :SET oper can SET");
889 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
890 + "PRIVS :WHOX log oper's usage of WHO x");
891 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
892 + "PRIVS :BADCHAN oper can BADCHAN (GLINE)");
893 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
894 + "PRIVS :LOCAL_BADCHAN oper can local BADCHAN (GLINE)");
895 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
896 + "PRIVS :SEE_CHAN oper can see in secret chans");
897 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
898 + "PRIVS :PROPAGATE propagate oper status");
899 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
900 + "PRIVS :DISPLAY oper status is displayed");
901 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
902 + "PRIVS :SEE_OPERS oper can see hidden opers");
903 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
904 + "PRIVS :WIDE_GLINE oper can set wider GLINE");
905 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
906 + "PRIVS :LIST_CHAN oper can LIST secret channels");
907 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
908 + "PRIVS :FORCE_OPMODE can hack modes on quarantined channels");
909 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
910 + "PRIVS :FORCE_LOCAL_OPMODE can hack modes on quarantined local channels");
911 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
912 + "PRIVS :APASS_OPMODE can hack modes +A/-A/+U/-U");
913 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
914 + "PRIVS :CHANSERV oper can set usermode +k");
915 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
916 + "PRIVS :XTRA_OPER oper can set usermode +X");
917 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
918 + "PRIVS :NOIDLE oper can set usermode +I");
919 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
920 + "PRIVS :FREEFORM oper can use freeform SETHOST");
921 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
922 + "PRIVS :PARANOID oper can set usermode +P");
923 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
924 + "PRIVS :CHECK oper can use CHECK");
925 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
926 + "PRIVS :WALL oper can use WALLOPS and WALLUSERS");
927 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
928 + "PRIVS :CLOSE oper can use CLOSE");
929 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
930 + "PRIVS :ROUTE oper can use CONNECT and SQUIT");
931 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
932 + "PRIVS :ROUTEINFO oper can use MAP, TRACE, ASLL, LINKS, and view JUPE list");
933 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
934 + "PRIVS :USER_PRIVACY oper can bypass user privacy (see through usermode +x)");
935 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
936 + "PRIVS :CHANNEL_PRIVACY oper can bypass channel privacy (see info on channels they are not on)");
937 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
938 + "PRIVS :SERVERINFO oper can use GET, STATS, HASH, and retrieve remote information");
944 + * mh_quit - help message handler
945 + * TODO: Disconnect or Disconnects?
947 +int mh_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
949 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
950 + "QUIT :QUIT :<message>");
951 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
952 + "QUIT :Disconnect from the network with an optional message.");
958 + * mh_rehash - help message handler
959 + * TODO: check the options, etc.
961 +int mh_rehash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
963 + if (!IsAnOper(sptr))
964 + return mh_not_oper(cptr, sptr, parc, parv);
965 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
966 + "REHASH :REHASH [L|M|Q]");
967 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
968 + "REHASH :Reloads the server conf file, MOTD, and log files.");
969 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
970 + "REHASH :Where L reopens the log files, M flushes the MOTD cache, Q the DNS resolver is not restarted.");
976 + * mh_reset - help message handler
978 +int mh_reset(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
980 + if (!IsAnOper(sptr))
981 + return mh_not_oper(cptr, sptr, parc, parv);
982 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
983 + "RESET :RESET <feature> [<parameters>]");
984 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
985 + "RESET :Resets a feature to its default hardcoded value.");
991 + * mh_restart - help message handler
993 +int mh_restart(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
995 + if (!IsAnOper(sptr))
996 + return mh_not_oper(cptr, sptr, parc, parv);
997 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
998 + "RESTART :RESTART <server>");
999 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1000 + "RESTART :Restarts the server. The servername needs to be given as sanity check.");
1006 + * mh_rping - help message handler
1009 +int mh_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1011 + if (!IsAnOper(sptr))
1012 + return mh_not_oper(cptr, sptr, parc, parv);
1013 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1014 + "RPING :RPING <server> [<remote server>] [:<text>]");
1015 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1016 + "RPING :Pings a remote server and returns the Round Trip Time in milliseconds.");
1022 + * mh_set - help message handler
1024 +int mh_set(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1026 + if (!IsAnOper(sptr))
1027 + return mh_not_oper(cptr, sptr, parc, parv);
1028 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1029 + "SET :SET <feature> [<parameters>] :<value>");
1030 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1031 + "SET :Changes the value of a feature.");
1037 + * mh_sethost - help message handler
1039 +int mh_sethost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1041 + if (!IsAnOper(sptr)) {
1042 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1043 + "SETHOST :SETHOST <spoofhost> <password>");
1044 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1045 + "SETHOST :Sets a spoof host.");
1047 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1048 + "SETHOST :SETHOST <user> <host>");
1049 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1050 + "SETHOST :Sets a spoof user@host.");
1057 + * mh_settime - help message handler
1059 +int mh_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1061 + if (!IsAnOper(sptr))
1062 + return mh_not_oper(cptr, sptr, parc, parv);
1063 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1064 + "SETTIME :SETTIME <timestamp> [<server>]");
1065 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1066 + "SETTIME :Changes the time on a server."
1067 + "When parameter <timestamp> is 0 the local server "
1068 + "uses its own timestamp before sending it to the remote server.");
1074 + * mh_silence - help message handler
1075 + * TODO: mention ~ exempt mask prefix
1077 +int mh_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1079 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1080 + "SILENCE :SILENCE [[+|-]<mask>|<nick>]");
1081 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1082 + "SILENCE :Views or changes the silence list.");
1083 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1084 + "SILENCE :Parameter <mask> is a comma separated list of one or more masks.");
1085 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1086 + "SILENCE :Silence is a server side ignore -"
1087 + " any message sent privately or invites from a user matching a silence mask is dropped.");
1093 + * mh_squit - help message handler
1095 +int mh_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1097 + if (!IsAnOper(sptr))
1098 + return mh_not_oper(cptr, sptr, parc, parv);
1099 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1100 + "SQUIT :SQUIT <server> [:<reason>]");
1101 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1102 + "SQUIT :Disconnects a server from the network.");
1108 + * mh_stats - help message handler
1109 + * TODO: check HIS (too many per stats type) / HIS remote?
1111 +int mh_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1113 + if (!IsAnOper(sptr))
1114 + return mh_not_oper(cptr, sptr, parc, parv);
1115 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1116 + "STATS :STATS [<type> [[<server>] [<mask>]]]");
1117 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1118 + "STATS :Shows server configuration and statistics.");
1124 + * mh_time - help message handler
1125 + * TODO: check HIS remote feature
1127 +int mh_time(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1129 + if (!IsAnOper(sptr)) {
1130 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1132 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1133 + "TIME :Shows the time on the server.");
1136 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1137 + "TIME :TIME [<server>]");
1138 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1139 + "TIME :Shows the time on the server.");
1140 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1141 + "TIME :Parameter <server> can be a * to view the time from all servers.");
1149 + * mh_topic - help message handler
1151 +int mh_topic(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1153 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1154 + "TOPIC :TOPIC <channel> [:<text>]");
1155 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1156 + "TOPIC :Views or changes the topic on a channel.");
1157 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1158 + "TOPIC :Parameter <channel> is a comma separated list of one or more channels.");
1164 + * mh_trace - help message handler
1165 + * TODO: check HIS / HIS remote?
1166 + * TODO: check <to server> parameter
1168 +int mh_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1170 + if (!IsAnOper(sptr))
1171 + return mh_not_oper(cptr, sptr, parc, parv);
1172 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1173 + "TRACE :TRACE [<nick>|<server> <to server>]");
1174 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1175 + "TRACE :Shows the route to a user or server.");
1181 + * mh_uping - help message handler
1182 + * TODO: default port 7007, define UDP_PORT
1184 +int mh_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1186 + if (!IsAnOper(sptr))
1187 + return mh_not_oper(cptr, sptr, parc, parv);
1188 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1189 + "UPING :UPING <server> [<port>] [<remote server>] [<number of packets>]");
1190 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1191 + "UPING :Pings the host of the server with UDP packets - server does not have to be linked.");
1192 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1193 + "UPING :By default port 7007 is used, and 5 packets are sent (maximum is 20).");
1199 + * mh_user - help message handler
1201 +int mh_user(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1203 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1204 + "USER :USER <username> <hostname> <servername> :<realname>");
1205 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1206 + "USER :Registers a new client connection. Parameters <hostname> and <servername> are ignored.");
1212 + * mh_userhost - help message handler
1213 + * TODO: syntax clear?
1216 +int mh_userhost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1218 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1219 + "USERHOST :USERHOST <nick> [<nick> [..]]");
1220 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1221 + "USERHOST :Returns the user@host for a user.");
1227 + * mh_userip - help message handler
1228 + * TODO: syntax clear?
1231 +int mh_userip(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1233 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1234 + "USERIP :USERIP <nick> [<nick> [..]]");
1235 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1236 + "USERIP :Returns the user@ip for a user.");
1242 + * mh_version - help message handler
1243 + * TODO: check HIS remote feature
1245 +int mh_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1247 + if (!IsAnOper(sptr)) {
1248 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1249 + "VERSION :VERSION");
1250 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1251 + "VERSION :Shows information about the server, and the supported features and settings.");
1254 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1255 + "VERSION :VERSION [<server>]");
1256 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1257 + "VERSION :Shows information about the server, and the supported features and settings.");
1258 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1259 + "VERSION :Parameter <server> can be a * to view the version info from all servers.");
1266 + * mh_wallchops - help message handler
1267 + * TODO: mention NOTICE @#channel?
1269 +int mh_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1271 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1272 + "WALLCHOPS :WALLCHOPS <channel> :<message>");
1273 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1274 + "WALLCHOPS :Sends a channel notice to the operators on a channel.");
1280 + * mh_wallops - help message handler
1281 + * TODO: check HIS ?
1283 +int mh_wallops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1285 + if (!IsAnOper(sptr))
1286 + return mh_not_oper(cptr, sptr, parc, parv);
1287 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1288 + "WALLOPS :WALLOPS :<message>");
1289 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1290 + "WALLOPS :Sends a message to all IRC Operators with usermode +w set.");
1296 + * mh_wallusers - help message handler
1298 +int mh_wallusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1300 + if (!IsAnOper(sptr))
1301 + return mh_not_oper(cptr, sptr, parc, parv);
1302 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1303 + "WALLUSERS :WALLUSERS :<message>");
1304 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1305 + "WALLUSERS :Sends a message to all users with usermode +w set.");
1311 + * mh_wallvoices - help message handler
1313 +int mh_wallvoices(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1315 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1316 + "WALLVOICES :WALLVOICES <channel> :<message>");
1317 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1318 + "WALLVOICES :Sends a channel notice to the voices and operators on a channel.");
1324 + * mh_who - help message handler
1325 + * TODO: this is all way too much to add here.. :(
1326 + * TODO: mention <mask> - chan, nick, user, host, ip, server, realname
1328 +d Join-delayed channel members
1329 +o IRC Operator (specifying this one means only opers are matched)
1331 + * TODO: x for operators
1334 +n Nick, u Username, h Hostname, i Numeric IP,
1335 +s Servername, r Realname, a Account name
1339 +t Include the querytype in the reply
1340 +c Include (first) channel name (* when none can be shown)
1341 +u Include userID with eventual ~
1344 +s Include server name
1347 +d Include "distance" in hops
1348 +l Include idle time (0 for remote users)
1349 +a Include account name (0 when the user has no account set)
1351 +r Include real name
1352 +b Include account ID
1354 + * TODO: HIS settings
1356 +int mh_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1358 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1359 + "WHO :WHO <mask> [[<match>][%<fields>[,<querytype>]] [:<mask>]]");
1360 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1361 + "WHO :Returns information on a user.");
1362 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1363 + "WHO :Parameter <mask> can be a comma separated list of one or more nicks and channels.");
1369 + * mh_whois - help message handler
1370 + * TODO: check HIS / HIS remote
1372 +int mh_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1374 + if (!IsAnOper(sptr)) {
1375 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1376 + "WHOIS :WHOIS [<dummy>] <nick>");
1377 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1378 + "WHOIS :Shows who someone is.");
1379 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1380 + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1381 + " <dummy> can be specified to get a reply from the user's server to show idle and signon time");
1384 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1385 + "WHOIS :WHOIS [<server>] <nick>");
1386 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1387 + "WHOIS :Shows who someone is.");
1388 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1389 + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1390 + " the same nick can be specified as <server> to get a reply from the user's server to show idle and signon time");
1397 + * mh_whowas - help message handler
1398 + * TODO: check HIS / HIS remote
1399 + * TODO: see if 20 is a define
1401 +int mh_whowas(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1403 + if (!IsAnOper(sptr)) {
1404 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1405 + "WHOWAS :WHOWAS <nick> [<max>]");
1406 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1407 + "WHOWAS :Shows who someone was.");
1408 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1409 + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1410 + " <max> is 0 by default (unlimited).");
1413 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1414 + "WHOWAS :WHOIS <nick> [<max> [<server>]]");
1415 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1416 + "WHOWAS :Shows who someone was.");
1417 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1418 + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1419 + " <max> is 0 by default (unlimited),"
1420 + " maximum number of results from a remote server is 20.");
1424 diff -r 5a1e5e09c766 ircd/parse.c
1425 --- a/ircd/parse.c Sat Jan 31 18:46:47 2009 +0100
1426 +++ b/ircd/parse.c Sat Jan 31 18:51:08 2009 +0100
1427 @@ -110,534 +110,534 @@
1430 0, MAXPARA, MFLG_SLOW, 0, NULL,
1431 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1432 - { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore }
1433 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1434 + { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore, mh_privmsg }
1439 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1440 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1441 - { m_nick, m_nick, ms_nick, m_nick, m_ignore }
1442 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1443 + { m_nick, m_nick, ms_nick, m_nick, m_ignore, mh_nick }
1448 0, MAXPARA, MFLG_SLOW | MFLG_IGNORE, 0, NULL,
1449 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1450 - { m_ignore, m_notice, ms_notice, mo_notice, m_ignore }
1451 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1452 + { m_ignore, m_notice, ms_notice, mo_notice, m_ignore, mh_notice }
1457 0, MAXPARA, MFLG_SLOW, 0, NULL,
1458 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1459 - { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore }
1460 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1461 + { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore, mh_wallchops }
1466 0, MAXPARA, MFLG_SLOW, 0, NULL,
1467 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1468 - { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore }
1469 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1470 + { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore, mh_wallvoices }
1475 0, MAXPARA, MFLG_SLOW, 0, NULL,
1476 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1477 - { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore }
1478 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1479 + { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore, mh_cprivmsg }
1484 0, MAXPARA, MFLG_SLOW, 0, NULL,
1485 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1486 - { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore }
1487 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1488 + { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore, mh_cnotice }
1493 0, MAXPARA, MFLG_SLOW, 0, NULL,
1494 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1495 - { m_unregistered, m_join, ms_join, m_join, m_ignore }
1496 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1497 + { m_unregistered, m_join, ms_join, m_join, m_ignore, mh_join }
1502 0, MAXPARA, MFLG_SLOW, 0, NULL,
1503 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1504 - { m_unregistered, m_mode, ms_mode, m_mode, m_ignore }
1505 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1506 + { m_unregistered, m_mode, ms_mode, m_mode, m_ignore, mh_mode }
1511 0, MAXPARA, MFLG_SLOW, 0, NULL,
1512 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1513 - { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore }
1514 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1515 + { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore, mh_not_server }
1520 0, MAXPARA, MFLG_SLOW, 0, NULL,
1521 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1522 - { m_ignore, m_ignore, ms_create, m_ignore, m_ignore }
1523 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1524 + { m_ignore, m_ignore, ms_create, m_ignore, m_ignore, mh_not_server }
1529 0, MAXPARA, MFLG_SLOW, 0, NULL,
1530 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1531 - { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore }
1532 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1533 + { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore, mh_not_server }
1538 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1539 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1540 - { m_quit, m_quit, ms_quit, m_quit, m_ignore }
1541 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1542 + { m_quit, m_quit, ms_quit, m_quit, m_ignore, mh_quit }
1547 0, MAXPARA, MFLG_SLOW, 0, NULL,
1548 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1549 - { m_unregistered, m_part, ms_part, m_part, m_ignore }
1550 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1551 + { m_unregistered, m_part, ms_part, m_part, m_ignore, mh_part }
1556 0, MAXPARA, MFLG_SLOW, 0, NULL,
1557 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1558 - { m_unregistered, m_topic, ms_topic, m_topic, m_ignore }
1559 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1560 + { m_unregistered, m_topic, ms_topic, m_topic, m_ignore, mh_topic }
1565 0, MAXPARA, MFLG_SLOW, 0, NULL,
1566 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1567 - { m_unregistered, m_invite, ms_invite, m_invite, m_ignore }
1568 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1569 + { m_unregistered, m_invite, ms_invite, m_invite, m_ignore, mh_invite }
1574 0, MAXPARA, MFLG_SLOW, 0, NULL,
1575 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1576 - { m_unregistered, m_kick, ms_kick, m_kick, m_ignore }
1577 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1578 + { m_unregistered, m_kick, ms_kick, m_kick, m_ignore, mh_kick }
1583 0, MAXPARA, MFLG_SLOW, 0, NULL,
1584 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1585 - { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore }
1586 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1587 + { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore, mh_wallops }
1592 0, MAXPARA, MFLG_SLOW, 0, NULL,
1593 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1594 - { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore }
1595 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1596 + { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore, mh_wallusers }
1601 0, MAXPARA, MFLG_SLOW, 0, NULL,
1602 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1603 - { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore }
1604 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1605 + { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore, mh_not_server }
1610 0, MAXPARA, MFLG_SLOW, 0, NULL,
1611 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1612 - { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore }
1613 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1614 + { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore, mh_ping }
1619 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1620 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1621 - { mr_pong, m_pong, ms_pong, m_pong, m_ignore }
1622 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1623 + { mr_pong, m_pong, ms_pong, m_pong, m_ignore, mh_pong }
1628 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1629 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1630 - { mr_error, m_ignore, ms_error, m_ignore, m_ignore }
1631 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1632 + { mr_error, m_ignore, ms_error, m_ignore, m_ignore, mh_not_server }
1637 0, MAXPARA, MFLG_SLOW, 0, NULL,
1638 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1639 - { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore }
1640 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1641 + { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore, mh_kill }
1646 0, MAXPARA, MFLG_SLOW, 0, NULL,
1647 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1648 - { m_user, m_registered, m_ignore, m_registered, m_ignore }
1649 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1650 + { m_user, m_registered, m_ignore, m_registered, m_ignore, mh_user }
1655 0, MAXPARA, MFLG_SLOW, 0, NULL,
1656 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1657 - { m_unregistered, m_away, ms_away, m_away, m_ignore }
1658 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1659 + { m_unregistered, m_away, ms_away, m_away, m_ignore, mh_away }
1664 0, 1, MFLG_SLOW, 0, NULL,
1665 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1666 - { m_unregistered, m_ison, m_ignore, m_ison, m_ignore }
1667 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1668 + { m_unregistered, m_ison, m_ignore, m_ison, m_ignore, mh_ison }
1673 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1674 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1675 - { mr_server, m_registered, ms_server, m_registered, m_ignore }
1676 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1677 + { mr_server, m_registered, ms_server, m_registered, m_ignore, mh_not_server }
1682 0, MAXPARA, MFLG_SLOW, 0, NULL,
1683 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1684 - { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore }
1685 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1686 + { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore, mh_squit }
1691 0, MAXPARA, MFLG_SLOW, 0, NULL,
1692 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1693 - { m_unregistered, m_whois, ms_whois, m_whois, m_ignore }
1694 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1695 + { m_unregistered, m_whois, ms_whois, m_whois, m_ignore, mh_whois }
1700 0, MAXPARA, MFLG_SLOW, 0, NULL,
1701 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1702 - { m_unregistered, m_who, m_ignore, m_who, m_ignore }
1703 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1704 + { m_unregistered, m_who, m_ignore, m_who, m_ignore, mh_who }
1709 0, MAXPARA, MFLG_SLOW, 0, NULL,
1710 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1711 - { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore }
1712 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1713 + { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore, mh_whowas }
1718 0, MAXPARA, MFLG_SLOW, 0, NULL,
1719 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1720 - { m_unregistered, m_list, m_ignore, m_list, m_ignore }
1721 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1722 + { m_unregistered, m_list, m_ignore, m_list, m_ignore, mh_list }
1727 0, MAXPARA, MFLG_SLOW, 0, NULL,
1728 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1729 - { m_unregistered, m_names, m_names, m_names, m_ignore }
1730 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1731 + { m_unregistered, m_names, m_names, m_names, m_ignore, mh_names }
1736 0, 1, MFLG_SLOW, 0, NULL,
1737 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1738 - { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore }
1739 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1740 + { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore, mh_userhost }
1745 0, 1, MFLG_SLOW, 0, NULL,
1746 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1747 - { m_unregistered, m_userip, m_ignore, m_userip, m_ignore }
1748 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1749 + { m_unregistered, m_userip, m_ignore, m_userip, m_ignore, mh_userip }
1754 0, MAXPARA, MFLG_SLOW, 0, NULL,
1755 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1756 - { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore }
1757 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1758 + { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore, mh_trace }
1763 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1764 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1765 - { mr_pass, m_registered, m_ignore, m_registered, m_ignore }
1766 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1767 + { mr_pass, m_registered, m_ignore, m_registered, m_ignore, mh_pass }
1772 0, MAXPARA, MFLG_SLOW, 0, NULL,
1773 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1774 - { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore }
1775 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1776 + { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore, mh_lusers }
1781 0, MAXPARA, MFLG_SLOW, 0, NULL,
1782 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1783 - { m_unregistered, m_time, m_time, m_time, m_ignore }
1784 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1785 + { m_unregistered, m_time, m_time, m_time, m_ignore, mh_time }
1790 0, MAXPARA, MFLG_SLOW, 0, NULL,
1791 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1792 - { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore }
1793 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1794 + { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore, mh_settime }
1799 0, MAXPARA, MFLG_SLOW, 0, NULL,
1800 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1801 - { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore }
1802 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1803 + { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore, mh_rping }
1808 0, MAXPARA, MFLG_SLOW, 0, NULL,
1809 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1810 - { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore }
1811 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1812 + { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore, mh_not_server }
1817 0, MAXPARA, MFLG_SLOW, 0, NULL,
1818 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1819 - { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore }
1820 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1821 + { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore, mh_oper }
1826 0, MAXPARA, MFLG_SLOW, 0, NULL,
1827 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1828 - { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore }
1829 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1830 + { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore, mh_connect }
1835 0, MAXPARA, MFLG_SLOW, 0, NULL,
1836 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1837 - { m_unregistered, m_map, m_ignore, m_map, m_ignore }
1838 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1839 + { m_unregistered, m_map, m_ignore, m_map, m_ignore, mh_map }
1844 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1845 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1846 - { m_version, m_version, ms_version, mo_version, m_ignore }
1847 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1848 + { m_version, m_version, ms_version, mo_version, m_ignore, mh_version }
1853 0, MAXPARA, MFLG_SLOW, 0, NULL,
1854 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1855 - { m_unregistered, m_stats, m_stats, m_stats, m_ignore }
1856 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1857 + { m_unregistered, m_stats, m_stats, m_stats, m_ignore, mh_stats }
1862 0, MAXPARA, MFLG_SLOW, 0, NULL,
1863 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1864 - { m_unregistered, m_links, ms_links, m_links, m_ignore }
1865 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1866 + { m_unregistered, m_links, ms_links, m_links, m_ignore, mh_links }
1871 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1872 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1873 - { m_admin, m_admin, ms_admin, mo_admin, m_ignore }
1874 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1875 + { m_admin, m_admin, ms_admin, mo_admin, m_ignore, mh_admin }
1880 0, MAXPARA, MFLG_SLOW, 0, NULL,
1881 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1882 - { m_unregistered, m_help, m_ignore, m_help, m_ignore }
1883 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1884 + { m_unregistered, m_help, m_ignore, m_help, m_ignore, mh_help }
1889 0, MAXPARA, MFLG_SLOW, 0, NULL,
1890 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1891 - { m_unregistered, m_info, ms_info, mo_info, m_ignore }
1892 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1893 + { m_unregistered, m_info, ms_info, mo_info, m_ignore, mh_info }
1898 0, MAXPARA, MFLG_SLOW, 0, NULL,
1899 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1900 - { m_unregistered, m_motd, m_motd, m_motd, m_ignore }
1901 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1902 + { m_unregistered, m_motd, m_motd, m_motd, m_ignore, mh_motd }
1907 0, MAXPARA, MFLG_SLOW, 0, NULL,
1908 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1909 - { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore }
1910 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1911 + { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore, mh_close }
1916 0, MAXPARA, MFLG_SLOW, 0, NULL,
1917 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1918 - { m_unregistered, m_silence, ms_silence, m_silence, m_ignore }
1919 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1920 + { m_unregistered, m_silence, ms_silence, m_silence, m_ignore, mh_silence }
1925 0, MAXPARA, 0, 0, NULL,
1926 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1927 - { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore }
1928 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1929 + { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore, mh_gline }
1934 0, MAXPARA, MFLG_SLOW, 0, NULL,
1935 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1936 - { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore }
1937 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1938 + { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore, mh_jupe }
1943 0, MAXPARA, MFLG_SLOW, 0, NULL,
1944 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1945 - { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore }
1946 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1947 + { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore, mh_opmode }
1952 0, MAXPARA, MFLG_SLOW, 0, NULL,
1953 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1954 - { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore }
1955 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1956 + { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore, mh_clearmode }
1961 0, MAXPARA, MFLG_SLOW, 0, NULL,
1962 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1963 - { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore }
1964 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1965 + { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore, mh_uping }
1970 0, MAXPARA, MFLG_SLOW, 0, NULL,
1971 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1972 - { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore }
1973 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1974 + { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore, mh_not_server }
1977 MSG_END_OF_BURST_ACK,
1978 TOK_END_OF_BURST_ACK,
1979 0, MAXPARA, MFLG_SLOW, 0, NULL,
1980 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1981 - { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore }
1982 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1983 + { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore, mh_not_server }
1988 0, MAXPARA, MFLG_SLOW, 0, NULL,
1989 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1990 - { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore }
1991 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1992 + { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore, mh_not_server }
1997 0, MAXPARA, MFLG_SLOW, 0, NULL,
1998 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1999 - { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore }
2000 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2001 + { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore, mh_hash }
2006 0, MAXPARA, MFLG_SLOW, 0, NULL,
2007 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2008 - { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore }
2009 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2010 + { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore, mh_rehash }
2015 0, MAXPARA, MFLG_SLOW, 0, NULL,
2016 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2017 - { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore }
2018 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2019 + { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore, mh_restart }
2024 0, MAXPARA, MFLG_SLOW, 0, NULL,
2025 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2026 - { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore }
2027 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2028 + { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore, mh_die }
2033 0, MAXPARA, MFLG_SLOW, 0, NULL,
2034 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2035 - { m_proto, m_proto, m_proto, m_proto, m_ignore }
2036 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2037 + { m_proto, m_proto, m_proto, m_proto, m_ignore, mh_nohelp }
2042 0, MAXPARA, MFLG_SLOW, 0, NULL,
2043 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2044 - { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore }
2045 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2046 + { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore, mh_set }
2051 0, MAXPARA, MFLG_SLOW, 0, NULL,
2052 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2053 - { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore }
2054 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2055 + { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore, mh_reset }
2060 0, MAXPARA, MFLG_SLOW, 0, NULL,
2061 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2062 - { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore }
2063 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2064 + { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore, mh_get }
2069 0, MAXPARA, MFLG_SLOW, 0, NULL,
2070 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2071 - { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore }
2072 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2073 + { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore, mh_privs }
2078 0, MAXPARA, MFLG_SLOW, 0, NULL,
2079 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2080 - { m_ignore, m_ignore, ms_account, m_ignore, m_ignore }
2081 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2082 + { m_ignore, m_ignore, ms_account, m_ignore, m_ignore, mh_not_server }
2087 0, MAXPARA, MFLG_SLOW, 0, NULL,
2088 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2089 - { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore }
2090 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2091 + { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore, mh_asll }
2096 0, MAXPARA, MFLG_SLOW, 0, NULL,
2097 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2098 - { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore }
2099 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2100 + { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore, mh_sethost }
2102 #if WE_HAVE_A_REAL_CAPABILITY_NOW
2106 0, MAXPARA, 0, 0, NULL,
2107 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2108 - { m_cap, m_cap, m_ignore, m_cap, m_ignore }
2109 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2110 + { m_cap, m_cap, m_ignore, m_cap, m_ignore, mh_nohelp }
2117 0, MAXPARA, MFLG_SLOW, 0, NULL,
2118 - { m_unregistered, m_not_oper, m_check, m_check, m_ignore }
2119 + { m_unregistered, m_not_oper, m_check, m_check, m_ignore, mh_check }
2126 0, MAXPARA, MFLG_SLOW, 0, NULL,
2127 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2128 - { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore }
2129 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2130 + { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore, mh_nohelp }
2133 /* This command is an alias for QUIT during the unregistered part of
2137 0, MAXPARA, MFLG_SLOW, 0, NULL,
2138 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2139 - { m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
2140 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2141 + { m_quit, m_ignore, m_ignore, m_ignore, m_ignore, mh_nohelp }
2145 @@ -779,6 +779,14 @@
2149 +/** Look up a command in the message trie.
2150 + * @param cmd Text of command to look up.
2151 + * @return Pointer to matching message, or NULL if non exists.
2153 +struct Message *find_message_by_cmd(char *cmd) {
2154 + return msg_tree_parse(cmd, &msg_tree);
2157 /** Registers a service mapping to the pseudocommand handler.
2158 * @param[in] map Service mapping to add.
2159 * @return Non-zero on success; zero if a command already used the name.
2161 msg->handlers[SERVER_HANDLER] = m_ignore;
2162 msg->handlers[OPER_HANDLER] = m_pseudo;
2163 msg->handlers[SERVICE_HANDLER] = m_ignore;
2164 + msg->handlers[HELP_HANDLER] = mh_nohelp;
2166 add_msg_element(&msg_tree, msg, msg->cmd);
2168 diff -r 5a1e5e09c766 ircd/s_err.c
2169 --- a/ircd/s_err.c Sat Jan 31 18:46:47 2009 +0100
2170 +++ b/ircd/s_err.c Sat Jan 31 18:51:08 2009 +0100
2173 { RPL_ENDOFMOTD, ":End of /MOTD command.", "376" },
2176 + { RPL_HELP, 0, "377" },
2179 + { RPL_ENDOFHELP, "%s :End of /HELP report.", "378" },
2185 { ERR_INPUTTOOLONG, ":Input line was too long", "417" },
2188 + { ERR_NOHELP, "%s :No help found.", "418" },