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 a9a01fcf9bfb include/handlers.h
25 --- a/include/handlers.h Thu Jan 29 21:48:27 2009 +0100
26 +++ b/include/handlers.h Thu Jan 29 21:50: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 a9a01fcf9bfb include/ircd_handler.h
106 --- a/include/ircd_handler.h Thu Jan 29 21:48:27 2009 +0100
107 +++ b/include/ircd_handler.h Thu Jan 29 21:50: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 a9a01fcf9bfb include/msg.h
117 --- a/include/msg.h Thu Jan 29 21:48:27 2009 +0100
118 +++ b/include/msg.h Thu Jan 29 21:50: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 a9a01fcf9bfb include/numeric.h
129 --- a/include/numeric.h Thu Jan 29 21:48:27 2009 +0100
130 +++ b/include/numeric.h Thu Jan 29 21:50: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 a9a01fcf9bfb include/parse.h
158 --- a/include/parse.h Thu Jan 29 21:48:27 2009 +0100
159 +++ b/include/parse.h Thu Jan 29 21:50: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 a9a01fcf9bfb ircd/m_defaults.c
169 --- a/ircd/m_defaults.c Thu Jan 29 21:48:27 2009 +0100
170 +++ b/ircd/m_defaults.c Thu Jan 29 21:50: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 diff -r a9a01fcf9bfb ircd/m_help.c
191 --- a/ircd/m_help.c Thu Jan 29 21:48:27 2009 +0100
192 +++ b/ircd/m_help.c Thu Jan 29 21:50:11 2009 +0100
196 #include "numnicks.h"
200 /* #include <assert.h> -- Now using assert in ircd_log.h */
201 @@ -100,9 +101,1212 @@
202 int m_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
205 + struct Message* mptr;
206 + MessageHandler handler = 0;
209 - for (i = 0; msgtab[i].cmd; i++)
210 - sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
211 + /* list all commands */
213 + for (i = 0; msgtab[i].cmd; i++)
214 + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd);
219 + /* nothing found */
220 + if ((mptr = find_message_by_cmd(command)) == NULL)
221 + return send_reply(sptr, ERR_NOHELP, command);
223 + /* found a help handler function */
224 + handler = mptr->handlers[HELP_HANDLER];
226 + assert(0 != handler);
228 + /* call the help handler function */
229 + (*handler) (cptr, sptr, parc, parv);
230 + return send_reply(sptr, RPL_ENDOFHELP, command);
235 + * mh_help - help message handler
237 +int mh_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
239 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
240 + "HELP :HELP [<command>]");
241 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
242 + "HELP :Lists all server commands or info on the given command.");
248 + * TODO: move all the mh_ functions into the files of the commands they belong to
253 + * mh_admin - help message handler
254 + * TODO: check HIS remote
256 +int mh_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
258 + if (!IsAnOper(sptr))
259 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
262 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
263 + "ADMIN :ADMIN [<server>]");
264 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
265 + "ADMIN :Shows administrative contact for the server.");
271 + * mh_asll - help message handler
273 +int mh_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
275 + if (!IsAnOper(sptr))
276 + return mh_not_oper(cptr, sptr, parc, parv);
277 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
278 + "ASLL :ASLL <mask> [<server>]");
279 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
280 + "ASLL :Shows Asymmetric Link Latency information.");
281 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
282 + "ASLL :Parameter <mask> is matched against directly linked servers, and may have more than one match.");
288 + * mh_away - help message handler
290 +int mh_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
292 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
293 + "AWAY :AWAY [<message>]");
294 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
295 + "AWAY :Sets or clears the away message.");
301 + * mh_check - help message handler
303 +int mh_check(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
305 + if (!IsAnOper(sptr))
306 + return mh_not_oper(cptr, sptr, parc, parv);
307 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
308 + "CHECK :CHECK [<server>] <mask> [<flags>]");
309 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
310 + "CHECK :Shows detailed information about a user, a channel, a hostmask, or a server.");
311 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
312 + "CHECK :Flags are: -C show clones, -c show channels, -s show servernames, -e show more, "
313 + "-i show IPs, -I show hostnames and IPs, -u do not show users, -o show only channel operators, -l show oplevels.");
319 + * mh_clearmode - help message handler
321 +int mh_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
323 + if (!IsAnOper(sptr))
324 + return mh_not_oper(cptr, sptr, parc, parv);
325 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
326 + "CLEARMODE :CLEARMODE [!]<channel> [<modes>]");
327 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
328 + "CLEARMODE :Clears modes on a channel.");
329 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
330 + "CLEARMODE :Default modes are ovpsmikbl - o deops all channel operators, "
331 + "v devoices all channel voices, and b removes all channel bans.");
332 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
333 + "CLEARMODE :The ! prefix may be used to override a channel quarantine.");
339 + * mh_close - help message handler
341 +int mh_close(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
343 + if (!IsAnOper(sptr))
344 + return mh_not_oper(cptr, sptr, parc, parv);
345 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
347 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
348 + "CLOSE :Closes unregistered connections to the server.");
354 + * mh_cnotice - help message handler
356 +int mh_cnotice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
358 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
359 + "CNOTICE :CNOTICE <nick> <channel> :<message>");
360 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
361 + "CNOTICE :Sends a private notice to a user.");
362 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
363 + "CNOTICE :A channel voice or operator can use this to bypass the target flood limit "
364 + "(target change too fast error) when the user is on the channel.");
370 + * mh_connect - help message handler
372 +int mh_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
374 + if (!IsAnOper(sptr))
375 + return mh_not_oper(cptr, sptr, parc, parv);
376 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
377 + "CONNECT :CONNECT <server> [<port> [<remote server>]]");
378 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
379 + "CONNECT :Connects the server to another server.");
380 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
381 + "CONNECT :Special port 0 can be used to let the remote server workout the port to use.");
387 + * mh_cprivmsg - help message handler
389 +int mh_cprivmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
391 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
392 + "CPRIVMSG :CPRIVMSG <nick> <channel> :<message>");
393 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
394 + "CPRIVMSG :Sends a private message to a user.");
395 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
396 + "CPRIVMSG :A channel voice or operator can use this to bypass the target flood limit "
397 + "(target change too fast error) when the user is on the channel.");
403 + * mh_die - help message handler
405 +int mh_die(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
407 + if (!IsAnOper(sptr))
408 + return mh_not_oper(cptr, sptr, parc, parv);
409 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
410 + "DIE :DIE <server>");
411 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
412 + "DIE :Terminates the server. The servername needs to be given as sanity check.");
418 + * mh_get - help message handler
421 +int mh_get(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
423 + if (!IsAnOper(sptr))
424 + return mh_not_oper(cptr, sptr, parc, parv);
425 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
426 + "GET :GET <feature> [<parameters>]");
427 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
428 + "GET :Returns the value of a feature.");
434 + * mh_gline - help message handler
437 +int mh_gline(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
439 + if (!IsAnOper(sptr))
440 + return mh_not_oper(cptr, sptr, parc, parv);
441 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
442 + "GLINE :GLINE [[!][+|-|>|<]<mask> [<target>] [<duration> [:<reason>]]]");
443 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
444 + "GLINE :Views, sets or changes a gline.");
450 + * mh_hash - help message handler
453 +int mh_hash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
455 + if (!IsAnOper(sptr))
456 + return mh_not_oper(cptr, sptr, parc, parv);
457 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
459 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
460 + "HASH :Shows hash table statistics.");
466 + * mh_info - help message handler
467 + * TODO: check HIS remote
469 +int mh_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
471 + if (!IsAnOper(sptr)) {
472 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO");
473 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :Shows info about the IRCd.");
474 + return mh_not_oper(cptr, sptr, parc, parv);
476 + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO [<server>]");
477 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
478 + "INFO :Show info about the IRCd. Lists a file hash and version number for its source files.");
485 + * mh_invite - help message handler
487 +int mh_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
489 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
490 + "INVITE :INVITE <nick> <channel>");
491 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
492 + "INVITE :Invites a user to a channel.");
498 + * mh_ison - help message handler
499 + * TODO: check that syntax is clear - no limit on number of nicks
501 +int mh_ison(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
503 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
504 + "ISON :ISON <nick> [<nick> [..]]");
505 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
506 + "ISON :Returns the nicks that are on the network.");
512 + * mh_join - help message handler
514 +int mh_join(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
516 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
517 + "JOIN :JOIN <channel> [<key>]");
518 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
519 + "JOIN :Joins a channel, where <channel> and <key> are a comma separated list of one or more elements.");
520 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
521 + "JOIN :Joining channel 0 can be used to leave all channels.");
527 + * mh_jupe - help message handler
530 +int mh_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
532 + if (!IsAnOper(sptr))
533 + return mh_not_oper(cptr, sptr, parc, parv);
534 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
535 + "JUPE :JUPE [[+|-]<server> [[<target>] <duration> :<reason>]]");
536 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
537 + "JUPE :Views or manipulates server jupes.");
543 + * mh_kick - help message handler
545 +int mh_kick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
547 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
548 + "KICK :KICK <channel> <nick> [:<reason>]");
549 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
550 + "KICK :Kicks a user from a channel.");
556 + * mh_kill - help message handler
558 +int mh_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
560 + if (!IsAnOper(sptr))
561 + return mh_not_oper(cptr, sptr, parc, parv);
562 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
563 + "KILL :KILL <nick> :<reason>");
564 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
565 + "KILL :Disconnects a user from the network.");
571 + * mh_links - help message handler
572 + * TODO: check HIS feature
574 +int mh_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
576 + if (!IsAnOper(sptr))
577 + return mh_not_oper(cptr, sptr, parc, parv);
578 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
579 + "LINKS :LINKS [[<remote server>] <mask>]");
580 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
581 + "LINKS :Shows server links on the network.");
587 + * mh_list - help message handler
589 +int mh_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
591 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
592 + "LIST :LIST :[<channel>|<parameters>|STOP]");
593 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
594 + "LIST :Lists channels on the network. See \"/QUOTE LIST :\" for more info.");
595 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
596 + "LIST :Parameter <channel> is a comma separated list of one or more channels.");
602 + * mh_lusers - help message handler
603 + * TODO: check HIS remote feature
605 +int mh_lusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
607 + if (!IsAnOper(sptr))
608 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
611 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
612 + "LUSERS :LUSERS [<dummy> [<remote server>]]");
613 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
614 + "LUSERS :Shows information about the number of users on the network.");
620 + * mh_map - help message handler
621 + * TODO: check HIS feature
623 +int mh_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
625 + if (!IsAnOper(sptr))
626 + return mh_not_oper(cptr, sptr, parc, parv);
627 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
628 + "MAP :MAP [<mask>]");
629 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
630 + "MAP :Shows a map of the servers on the network.");
636 + * mh_mode - help message handler
637 + * TODO: check syntax is clear
639 +int mh_mode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
641 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
642 + "MODE :MODE <channel>|<nick> [<modes>]");
643 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
644 + "MODE :Views or changes modes of a channel or user.");
650 + * mh_motd - help message handler
651 + * TODO: check HIS remote feature
653 +int mh_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
655 + if (!IsAnOper(sptr))
656 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
659 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
660 + "MOTD :MOTD [<server>]");
661 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
662 + "MOTD :Shows the Message Of The Day.");
668 + * mh_names - help message handler
669 + * TODO: check HIS remote feature
671 +int mh_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
673 + if (!IsAnOper(sptr))
674 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
675 + "NAMES :NAMES [[-D] <channel>]");
677 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
678 + "NAMES :NAMES [[[-D] [channel]] [<server>]]");
679 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
680 + "NAMES :Shows the names of users on the channel.");
681 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
682 + "NAMES :Parameter <channel> is a comma separated list of one or more channels,"
683 + " and the -D option is for listing delayedjoin users.");
689 + * mh_nick - help message handler
691 +int mh_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
693 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
694 + "NICK :NICK <newnick>");
695 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
696 + "NICK :Changes nickname.");
702 + * mh_notice - help message handler
704 +int mh_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
706 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
707 + "NOTICE :NOTICE <target> :<message>");
708 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
709 + "NOTICE :Sends a notice to a target, where <target> can be a comma separated list of one or more nicks or channels.");
710 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
711 + "NOTICE :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
712 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
713 + "NOTICE :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
714 + if (IsAnOper(sptr)) {
715 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
716 + "NOTICE :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
717 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
718 + "NOTICE :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
725 + * mh_oper - help message handler
727 +int mh_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
729 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
730 + "OPER :OPER <username> <password>");
731 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
732 + "OPER :Logs in as IRC Operator.");
738 + * mh_opmode - help message handler
740 +int mh_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
742 + if (!IsAnOper(sptr))
743 + return mh_not_oper(cptr, sptr, parc, parv);
744 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
745 + "OPMODE :OPMODE [!]<channel> <modes>");
746 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
747 + "OPMODE :Changes modes on a channel.");
748 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
749 + "OPMODE :The ! prefix may be used to override a channel quarantine.");
754 + * mh_part - help message handler
756 +int mh_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
758 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
759 + "PART :PART <channel> [:<message>]");
760 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
761 + "PART :Parts a channel with an optional message.");
762 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
763 + "PART :Parameter <channel> is a comma separated list of one or more channels.");
769 + * mh_pass - help message handler
771 +int mh_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
773 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
774 + "PASS :PASS :<password>");
775 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
776 + "PASS :Provides the password required to connect to the server.");
782 + * mh_ping - help message handler
785 +int mh_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
787 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
788 + "PING :PING :<text>");
789 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
790 + "PING :Sends a ping to the server.");
796 + * mh_pong - help message handler
799 +int mh_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
801 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
802 + "PONG :PONG :<text>");
803 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
804 + "PONG :Sends a pong as reply to a PING from the server.");
810 + * mh_privmsg - help message handler
812 +int mh_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
814 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
815 + "PRIVMSG :PRIVMSG <target> :<message>");
816 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
817 + "PRIVMSG :Sends a message to a target, where <target> can be a comma separated list of one or more nicks or channels.");
818 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
819 + "PRIVMSG :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS).");
820 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
821 + "PRIVMSG :Parameter <target> can be in the form of <nick>@<server> to send to a service.");
822 + if (IsAnOper(sptr)) {
823 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
824 + "PRIVMSG :Parameter <target> can be a $<servername> to broadcast a message to all users on a server.");
825 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
826 + "PRIVMSG :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host.");
833 + * mh_privs - help message handler
835 +int mh_privs(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
837 + if (!IsAnOper(sptr))
838 + return mh_not_oper(cptr, sptr, parc, parv);
839 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
840 + "PRIVS :PRIVS <nick> [<nick> [..]]");
841 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
842 + "PRIVS :Shows the privileges an IRC Operator has.");
843 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
844 + "PRIVS :CHAN_LIMIT oper has no channel limit (JOIN)");
845 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
846 + "PRIVS :MODE_LCHAN oper can mode local chans without channel operator status");
847 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
848 + "PRIVS :WALK_LCHAN oper can walk through local modes (JOIN &chan override)");
849 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
850 + "PRIVS :DEOP_LCHAN oper cannot be deoped on local chans");
851 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
852 + "PRIVS :SHOW_INVIS show local invisible users");
853 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
854 + "PRIVS :SHOW_ALL_INVIS show all invisible users");
855 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
856 + "PRIVS :UNLIMIT_QUERY unlimited results in WHO");
857 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
858 + "PRIVS :KILL oper can KILL");
859 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
860 + "PRIVS :LOCAL_KILL oper can local KILL");
861 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
862 + "PRIVS :REHASH oper can REHASH");
863 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
864 + "PRIVS :RESTART oper can RESTART");
865 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
866 + "PRIVS :DIE oper can DIE");
867 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
868 + "PRIVS :GLINE oper can GLINE");
869 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
870 + "PRIVS :LOCAL_GLINE oper can local GLINE");
871 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
872 + "PRIVS :JUPE oper can JUPE");
873 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
874 + "PRIVS :LOCAL_JUPE oper can local JUPE");
875 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
876 + "PRIVS :OPMODE oper can OPMODE and CLEARMODE");
877 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
878 + "PRIVS :LOCAL_OPMODE oper can local OPMODE and CLEARMODE");
879 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
880 + "PRIVS :SET oper can SET");
881 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
882 + "PRIVS :WHOX log oper's usage of WHO x");
883 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
884 + "PRIVS :BADCHAN oper can BADCHAN (GLINE)");
885 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
886 + "PRIVS :LOCAL_BADCHAN oper can local BADCHAN (GLINE)");
887 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
888 + "PRIVS :SEE_CHAN oper can see in secret chans");
889 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
890 + "PRIVS :PROPAGATE propagate oper status");
891 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
892 + "PRIVS :DISPLAY oper status is displayed");
893 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
894 + "PRIVS :SEE_OPERS oper can see hidden opers");
895 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
896 + "PRIVS :WIDE_GLINE oper can set wider GLINE");
897 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
898 + "PRIVS :LIST_CHAN oper can LIST secret channels");
899 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
900 + "PRIVS :FORCE_OPMODE can hack modes on quarantined channels");
901 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
902 + "PRIVS :FORCE_LOCAL_OPMODE can hack modes on quarantined local channels");
903 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
904 + "PRIVS :APASS_OPMODE can hack modes +A/-A/+U/-U");
905 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
906 + "PRIVS :CHANSERV oper can set usermode +k");
907 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
908 + "PRIVS :XTRA_OPER oper can set usermode +X");
909 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
910 + "PRIVS :NOIDLE oper can set usermode +I");
911 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
912 + "PRIVS :FREEFORM oper can use freeform SETHOST");
913 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
914 + "PRIVS :PARANOID oper can set usermode +P");
915 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
916 + "PRIVS :CHECK oper can use CHECK");
917 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
918 + "PRIVS :WALL oper can use WALLOPS and WALLUSERS");
919 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
920 + "PRIVS :CLOSE oper can use CLOSE");
921 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
922 + "PRIVS :ROUTE oper can use CONNECT and SQUIT");
923 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
924 + "PRIVS :ROUTEINFO oper can use MAP, TRACE, ASLL, LINKS, and view JUPE list");
925 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
926 + "PRIVS :USER_PRIVACY oper can bypass user privacy (see through usermode +x)");
927 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
928 + "PRIVS :CHANNEL_PRIVACY oper can bypass channel privacy (see info on channels they are not on)");
929 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
930 + "PRIVS :SERVERINFO oper can use GET, STATS, HASH, and retrieve remote information");
936 + * mh_quit - help message handler
937 + * TODO: Disconnect or Disconnects?
939 +int mh_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
941 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
942 + "QUIT :QUIT :<message>");
943 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
944 + "QUIT :Disconnect from the network with an optional message.");
950 + * mh_rehash - help message handler
951 + * TODO: check the options, etc.
953 +int mh_rehash(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
955 + if (!IsAnOper(sptr))
956 + return mh_not_oper(cptr, sptr, parc, parv);
957 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
958 + "REHASH :REHASH [L|M|Q]");
959 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
960 + "REHASH :Reloads the server conf file, MOTD, and log files.");
961 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
962 + "REHASH :Where L reopens the log files, M flushes the MOTD cache, Q the DNS resolver is not restarted.");
968 + * mh_reset - help message handler
970 +int mh_reset(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
972 + if (!IsAnOper(sptr))
973 + return mh_not_oper(cptr, sptr, parc, parv);
974 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
975 + "RESET :RESET <feature> [<parameters>]");
976 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
977 + "RESET :Resets a feature to its default hardcoded value.");
983 + * mh_restart - help message handler
985 +int mh_restart(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
987 + if (!IsAnOper(sptr))
988 + return mh_not_oper(cptr, sptr, parc, parv);
989 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
990 + "RESTART :RESTART <server>");
991 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
992 + "RESTART :Restarts the server. The servername needs to be given as sanity check.");
998 + * mh_rping - help message handler
1001 +int mh_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1003 + if (!IsAnOper(sptr))
1004 + return mh_not_oper(cptr, sptr, parc, parv);
1005 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1006 + "RPING :RPING <server> [<remote server>] [:<text>]");
1007 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1008 + "RPING :Pings a remote server and returns the Round Trip Time in milliseconds.");
1014 + * mh_set - help message handler
1016 +int mh_set(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1018 + if (!IsAnOper(sptr))
1019 + return mh_not_oper(cptr, sptr, parc, parv);
1020 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1021 + "SET :SET <feature> [<parameters>] :<value>");
1022 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1023 + "SET :Changes the value of a feature.");
1029 + * mh_sethost - help message handler
1031 +int mh_sethost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1033 + if (!IsAnOper(sptr)) {
1034 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1035 + "SETHOST :SETHOST <spoofhost> <password>");
1036 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1037 + "SETHOST :Sets a spoof host.");
1039 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1040 + "SETHOST :SETHOST <user> <host>");
1041 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1042 + "SETHOST :Sets a spoof user@host.");
1049 + * mh_settime - help message handler
1051 +int mh_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1053 + if (!IsAnOper(sptr))
1054 + return mh_not_oper(cptr, sptr, parc, parv);
1055 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1056 + "SETTIME :SETTIME <timestamp> [<server>]");
1057 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1058 + "SETTIME :Changes the time on a server."
1059 + "When parameter <timestamp> is 0 the local server "
1060 + "uses its own timestamp before sending it to the remote server.");
1066 + * mh_silence - help message handler
1067 + * TODO: mention ~ exempt mask prefix
1069 +int mh_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1071 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1072 + "SILENCE :SILENCE [[+|-]<mask>|<nick>]");
1073 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1074 + "SILENCE :Views or changes the silence list.");
1075 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1076 + "SILENCE :Parameter <mask> is a comma separated list of one or more masks.");
1077 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1078 + "SILENCE :Silence is a server side ignore -"
1079 + " any message sent privately or invites from a user matching a silence mask is dropped.");
1085 + * mh_squit - help message handler
1087 +int mh_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1089 + if (!IsAnOper(sptr))
1090 + return mh_not_oper(cptr, sptr, parc, parv);
1091 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1092 + "SQUIT :SQUIT <server> [:<reason>]");
1093 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1094 + "SQUIT :Disconnects a server from the network.");
1100 + * mh_stats - help message handler
1101 + * TODO: check HIS (too many per stats type) / HIS remote?
1103 +int mh_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1105 + if (!IsAnOper(sptr))
1106 + return mh_not_oper(cptr, sptr, parc, parv);
1107 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1108 + "STATS :STATS [<type> [[<server>] [<mask>]]]");
1109 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1110 + "STATS :Shows server configuration and statistics.");
1116 + * mh_time - help message handler
1117 + * TODO: check HIS remote feature
1119 +int mh_time(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1121 + if (!IsAnOper(sptr)) {
1122 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1124 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1125 + "TIME :Shows the time on the server.");
1128 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1129 + "TIME :TIME [<server>]");
1130 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1131 + "TIME :Shows the time on the server.");
1132 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1133 + "TIME :Parameter <server> can be a * to view the time from all servers.");
1141 + * mh_topic - help message handler
1143 +int mh_topic(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1145 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1146 + "TOPIC :TOPIC <channel> [:<text>]");
1147 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1148 + "TOPIC :Views or changes the topic on a channel.");
1149 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1150 + "TOPIC :Parameter <channel> is a comma separated list of one or more channels.");
1156 + * mh_trace - help message handler
1157 + * TODO: check HIS / HIS remote?
1158 + * TODO: check <to server> parameter
1160 +int mh_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1162 + if (!IsAnOper(sptr))
1163 + return mh_not_oper(cptr, sptr, parc, parv);
1164 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1165 + "TRACE :TRACE [<nick>|<server> <to server>]");
1166 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1167 + "TRACE :Shows the route to a user or server.");
1173 + * mh_uping - help message handler
1174 + * TODO: default port 7007, define UDP_PORT
1176 +int mh_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1178 + if (!IsAnOper(sptr))
1179 + return mh_not_oper(cptr, sptr, parc, parv);
1180 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1181 + "UPING :UPING <server> [<port>] [<remote server>] [<number of packets>]");
1182 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1183 + "UPING :Pings the host of the server with UDP packets - server does not have to be linked.");
1184 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1185 + "UPING :By default port 7007 is used, and 5 packets are sent (maximum is 20).");
1191 + * mh_user - help message handler
1193 +int mh_user(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1195 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1196 + "USER :USER <username> <hostname> <servername> :<realname>");
1197 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1198 + "USER :Registers a new client connection. Parameters <hostname> and <servername> are ignored.");
1204 + * mh_userhost - help message handler
1205 + * TODO: syntax clear?
1208 +int mh_userhost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1210 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1211 + "USERHOST :USERHOST <nick> [<nick> [..]]");
1212 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1213 + "USERHOST :Returns the user@host for a user.");
1219 + * mh_userip - help message handler
1220 + * TODO: syntax clear?
1223 +int mh_userip(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1225 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1226 + "USERIP :USERIP <nick> [<nick> [..]]");
1227 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1228 + "USERIP :Returns the user@ip for a user.");
1234 + * mh_version - help message handler
1235 + * TODO: check HIS remote feature
1237 +int mh_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1239 + if (!IsAnOper(sptr)) {
1240 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1241 + "VERSION :VERSION");
1242 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1243 + "VERSION :Shows information about the server, and the supported features and settings.");
1246 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1247 + "VERSION :VERSION [<server>]");
1248 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1249 + "VERSION :Shows information about the server, and the supported features and settings.");
1250 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1251 + "VERSION :Parameter <server> can be a * to view the version info from all servers.");
1258 + * mh_wallchops - help message handler
1259 + * TODO: mention NOTICE @#channel?
1261 +int mh_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1263 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1264 + "WALLCHOPS :WALLCHOPS <channel> :<message>");
1265 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1266 + "WALLCHOPS :Sends a channel notice to the operators on a channel.");
1272 + * mh_wallops - help message handler
1273 + * TODO: check HIS ?
1275 +int mh_wallops(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1277 + if (!IsAnOper(sptr))
1278 + return mh_not_oper(cptr, sptr, parc, parv);
1279 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1280 + "WALLOPS :WALLOPS :<message>");
1281 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1282 + "WALLOPS :Sends a message to all IRC Operators with usermode +w set.");
1288 + * mh_wallusers - help message handler
1290 +int mh_wallusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1292 + if (!IsAnOper(sptr))
1293 + return mh_not_oper(cptr, sptr, parc, parv);
1294 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1295 + "WALLUSERS :WALLUSERS :<message>");
1296 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1297 + "WALLUSERS :Sends a message to all users with usermode +w set.");
1303 + * mh_wallvoices - help message handler
1305 +int mh_wallvoices(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1307 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1308 + "WALLVOICES :WALLVOICES <channel> :<message>");
1309 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1310 + "WALLVOICES :Sends a channel notice to the voices and operators on a channel.");
1316 + * mh_who - help message handler
1317 + * TODO: this is all way too much to add here.. :(
1318 + * TODO: mention <mask> - chan, nick, user, host, ip, server, realname
1320 +d Join-delayed channel members
1321 +o IRC Operator (specifying this one means only opers are matched)
1323 + * TODO: x for operators
1326 +n Nick, u Username, h Hostname, i Numeric IP,
1327 +s Servername, r Realname, a Account name
1331 +t Include the querytype in the reply
1332 +c Include (first) channel name (* when none can be shown)
1333 +u Include userID with eventual ~
1336 +s Include server name
1339 +d Include "distance" in hops
1340 +l Include idle time (0 for remote users)
1341 +a Include account name (0 when the user has no account set)
1343 +r Include real name
1344 +b Include account ID
1346 + * TODO: HIS settings
1348 +int mh_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1350 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1351 + "WHO :WHO <mask> [[<match>][%<fields>[,<querytype>]] [:<mask>]]");
1352 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1353 + "WHO :Returns information on a user.");
1354 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1355 + "WHO :Parameter <mask> can be a comma separated list of one or more nicks and channels.");
1361 + * mh_whois - help message handler
1362 + * TODO: check HIS / HIS remote
1364 +int mh_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1366 + if (!IsAnOper(sptr)) {
1367 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1368 + "WHOIS :WHOIS [<dummy>] <nick>");
1369 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1370 + "WHOIS :Shows who someone is.");
1371 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1372 + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1373 + " <dummy> can be specified to get a reply from the user's server to show idle and signon time");
1376 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1377 + "WHOIS :WHOIS [<server>] <nick>");
1378 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1379 + "WHOIS :Shows who someone is.");
1380 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1381 + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks,"
1382 + " the same nick can be specified as <server> to get a reply from the user's server to show idle and signon time");
1389 + * mh_whowas - help message handler
1390 + * TODO: check HIS / HIS remote
1391 + * TODO: see if 20 is a define
1393 +int mh_whowas(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
1395 + if (!IsAnOper(sptr)) {
1396 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1397 + "WHOWAS :WHOWAS <nick> [<max>]");
1398 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1399 + "WHOWAS :Shows who someone was.");
1400 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1401 + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1402 + " <max> is 0 by default (unlimited).");
1405 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1406 + "WHOWAS :WHOIS <nick> [<max> [<server>]]");
1407 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1408 + "WHOWAS :Shows who someone was.");
1409 + send_reply(sptr, SND_EXPLICIT | RPL_HELP,
1410 + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks,"
1411 + " <max> is 0 by default (unlimited),"
1412 + " maximum number of results from a remote server is 20.");
1416 diff -r a9a01fcf9bfb ircd/parse.c
1417 --- a/ircd/parse.c Thu Jan 29 21:48:27 2009 +0100
1418 +++ b/ircd/parse.c Thu Jan 29 21:50:11 2009 +0100
1419 @@ -110,534 +110,534 @@
1422 0, MAXPARA, MFLG_SLOW, 0, NULL,
1423 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1424 - { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore }
1425 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1426 + { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore, mh_privmsg }
1431 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1432 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1433 - { m_nick, m_nick, ms_nick, m_nick, m_ignore }
1434 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1435 + { m_nick, m_nick, ms_nick, m_nick, m_ignore, mh_nick }
1440 0, MAXPARA, MFLG_SLOW | MFLG_IGNORE, 0, NULL,
1441 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1442 - { m_ignore, m_notice, ms_notice, mo_notice, m_ignore }
1443 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1444 + { m_ignore, m_notice, ms_notice, mo_notice, m_ignore, mh_notice }
1449 0, MAXPARA, MFLG_SLOW, 0, NULL,
1450 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1451 - { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore }
1452 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1453 + { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore, mh_wallchops }
1458 0, MAXPARA, MFLG_SLOW, 0, NULL,
1459 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1460 - { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore }
1461 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1462 + { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore, mh_wallvoices }
1467 0, MAXPARA, MFLG_SLOW, 0, NULL,
1468 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1469 - { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore }
1470 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1471 + { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore, mh_cprivmsg }
1476 0, MAXPARA, MFLG_SLOW, 0, NULL,
1477 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1478 - { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore }
1479 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1480 + { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore, mh_cnotice }
1485 0, MAXPARA, MFLG_SLOW, 0, NULL,
1486 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1487 - { m_unregistered, m_join, ms_join, m_join, m_ignore }
1488 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1489 + { m_unregistered, m_join, ms_join, m_join, m_ignore, mh_join }
1494 0, MAXPARA, MFLG_SLOW, 0, NULL,
1495 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1496 - { m_unregistered, m_mode, ms_mode, m_mode, m_ignore }
1497 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1498 + { m_unregistered, m_mode, ms_mode, m_mode, m_ignore, mh_mode }
1503 0, MAXPARA, MFLG_SLOW, 0, NULL,
1504 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1505 - { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore }
1506 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1507 + { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore, mh_not_server }
1512 0, MAXPARA, MFLG_SLOW, 0, NULL,
1513 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1514 - { m_ignore, m_ignore, ms_create, m_ignore, m_ignore }
1515 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1516 + { m_ignore, m_ignore, ms_create, m_ignore, m_ignore, mh_not_server }
1521 0, MAXPARA, MFLG_SLOW, 0, NULL,
1522 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1523 - { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore }
1524 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1525 + { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore, mh_not_server }
1530 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1531 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1532 - { m_quit, m_quit, ms_quit, m_quit, m_ignore }
1533 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1534 + { m_quit, m_quit, ms_quit, m_quit, m_ignore, mh_quit }
1539 0, MAXPARA, MFLG_SLOW, 0, NULL,
1540 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1541 - { m_unregistered, m_part, ms_part, m_part, m_ignore }
1542 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1543 + { m_unregistered, m_part, ms_part, m_part, m_ignore, mh_part }
1548 0, MAXPARA, MFLG_SLOW, 0, NULL,
1549 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1550 - { m_unregistered, m_topic, ms_topic, m_topic, m_ignore }
1551 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1552 + { m_unregistered, m_topic, ms_topic, m_topic, m_ignore, mh_topic }
1557 0, MAXPARA, MFLG_SLOW, 0, NULL,
1558 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1559 - { m_unregistered, m_invite, ms_invite, m_invite, m_ignore }
1560 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1561 + { m_unregistered, m_invite, ms_invite, m_invite, m_ignore, mh_invite }
1566 0, MAXPARA, MFLG_SLOW, 0, NULL,
1567 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1568 - { m_unregistered, m_kick, ms_kick, m_kick, m_ignore }
1569 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1570 + { m_unregistered, m_kick, ms_kick, m_kick, m_ignore, mh_kick }
1575 0, MAXPARA, MFLG_SLOW, 0, NULL,
1576 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1577 - { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore }
1578 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1579 + { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore, mh_wallops }
1584 0, MAXPARA, MFLG_SLOW, 0, NULL,
1585 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1586 - { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore }
1587 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1588 + { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore, mh_wallusers }
1593 0, MAXPARA, MFLG_SLOW, 0, NULL,
1594 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1595 - { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore }
1596 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1597 + { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore, mh_not_server }
1602 0, MAXPARA, MFLG_SLOW, 0, NULL,
1603 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1604 - { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore }
1605 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1606 + { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore, mh_ping }
1611 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1612 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1613 - { mr_pong, m_pong, ms_pong, m_pong, m_ignore }
1614 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1615 + { mr_pong, m_pong, ms_pong, m_pong, m_ignore, mh_pong }
1620 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1621 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1622 - { mr_error, m_ignore, ms_error, m_ignore, m_ignore }
1623 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1624 + { mr_error, m_ignore, ms_error, m_ignore, m_ignore, mh_not_server }
1629 0, MAXPARA, MFLG_SLOW, 0, NULL,
1630 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1631 - { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore }
1632 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1633 + { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore, mh_kill }
1638 0, MAXPARA, MFLG_SLOW, 0, NULL,
1639 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1640 - { m_user, m_registered, m_ignore, m_registered, m_ignore }
1641 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1642 + { m_user, m_registered, m_ignore, m_registered, m_ignore, mh_user }
1647 0, MAXPARA, MFLG_SLOW, 0, NULL,
1648 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1649 - { m_unregistered, m_away, ms_away, m_away, m_ignore }
1650 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1651 + { m_unregistered, m_away, ms_away, m_away, m_ignore, mh_away }
1656 0, 1, MFLG_SLOW, 0, NULL,
1657 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1658 - { m_unregistered, m_ison, m_ignore, m_ison, m_ignore }
1659 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1660 + { m_unregistered, m_ison, m_ignore, m_ison, m_ignore, mh_ison }
1665 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1666 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1667 - { mr_server, m_registered, ms_server, m_registered, m_ignore }
1668 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1669 + { mr_server, m_registered, ms_server, m_registered, m_ignore, mh_not_server }
1674 0, MAXPARA, MFLG_SLOW, 0, NULL,
1675 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1676 - { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore }
1677 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1678 + { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore, mh_squit }
1683 0, MAXPARA, MFLG_SLOW, 0, NULL,
1684 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1685 - { m_unregistered, m_whois, ms_whois, m_whois, m_ignore }
1686 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1687 + { m_unregistered, m_whois, ms_whois, m_whois, m_ignore, mh_whois }
1692 0, MAXPARA, MFLG_SLOW, 0, NULL,
1693 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1694 - { m_unregistered, m_who, m_ignore, m_who, m_ignore }
1695 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1696 + { m_unregistered, m_who, m_ignore, m_who, m_ignore, mh_who }
1701 0, MAXPARA, MFLG_SLOW, 0, NULL,
1702 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1703 - { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore }
1704 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1705 + { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore, mh_whowas }
1710 0, MAXPARA, MFLG_SLOW, 0, NULL,
1711 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1712 - { m_unregistered, m_list, m_ignore, m_list, m_ignore }
1713 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1714 + { m_unregistered, m_list, m_ignore, m_list, m_ignore, mh_list }
1719 0, MAXPARA, MFLG_SLOW, 0, NULL,
1720 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1721 - { m_unregistered, m_names, m_names, m_names, m_ignore }
1722 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1723 + { m_unregistered, m_names, m_names, m_names, m_ignore, mh_names }
1728 0, 1, MFLG_SLOW, 0, NULL,
1729 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1730 - { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore }
1731 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1732 + { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore, mh_userhost }
1737 0, 1, MFLG_SLOW, 0, NULL,
1738 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1739 - { m_unregistered, m_userip, m_ignore, m_userip, m_ignore }
1740 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1741 + { m_unregistered, m_userip, m_ignore, m_userip, m_ignore, mh_userip }
1746 0, MAXPARA, MFLG_SLOW, 0, NULL,
1747 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1748 - { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore }
1749 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1750 + { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore, mh_trace }
1755 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1756 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1757 - { mr_pass, m_registered, m_ignore, m_registered, m_ignore }
1758 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1759 + { mr_pass, m_registered, m_ignore, m_registered, m_ignore, mh_pass }
1764 0, MAXPARA, MFLG_SLOW, 0, NULL,
1765 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1766 - { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore }
1767 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1768 + { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore, mh_lusers }
1773 0, MAXPARA, MFLG_SLOW, 0, NULL,
1774 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1775 - { m_unregistered, m_time, m_time, m_time, m_ignore }
1776 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1777 + { m_unregistered, m_time, m_time, m_time, m_ignore, mh_time }
1782 0, MAXPARA, MFLG_SLOW, 0, NULL,
1783 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1784 - { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore }
1785 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1786 + { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore, mh_settime }
1791 0, MAXPARA, MFLG_SLOW, 0, NULL,
1792 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1793 - { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore }
1794 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1795 + { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore, mh_rping }
1800 0, MAXPARA, MFLG_SLOW, 0, NULL,
1801 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1802 - { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore }
1803 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1804 + { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore, mh_not_server }
1809 0, MAXPARA, MFLG_SLOW, 0, NULL,
1810 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1811 - { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore }
1812 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1813 + { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore, mh_oper }
1818 0, MAXPARA, MFLG_SLOW, 0, NULL,
1819 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1820 - { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore }
1821 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1822 + { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore, mh_connect }
1827 0, MAXPARA, MFLG_SLOW, 0, NULL,
1828 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1829 - { m_unregistered, m_map, m_ignore, m_map, m_ignore }
1830 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1831 + { m_unregistered, m_map, m_ignore, m_map, m_ignore, mh_map }
1836 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1837 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1838 - { m_version, m_version, ms_version, mo_version, m_ignore }
1839 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1840 + { m_version, m_version, ms_version, mo_version, m_ignore, mh_version }
1845 0, MAXPARA, MFLG_SLOW, 0, NULL,
1846 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1847 - { m_unregistered, m_stats, m_stats, m_stats, m_ignore }
1848 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1849 + { m_unregistered, m_stats, m_stats, m_stats, m_ignore, mh_stats }
1854 0, MAXPARA, MFLG_SLOW, 0, NULL,
1855 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1856 - { m_unregistered, m_links, ms_links, m_links, m_ignore }
1857 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1858 + { m_unregistered, m_links, ms_links, m_links, m_ignore, mh_links }
1863 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL,
1864 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1865 - { m_admin, m_admin, ms_admin, mo_admin, m_ignore }
1866 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1867 + { m_admin, m_admin, ms_admin, mo_admin, m_ignore, mh_admin }
1872 0, MAXPARA, MFLG_SLOW, 0, NULL,
1873 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1874 - { m_unregistered, m_help, m_ignore, m_help, m_ignore }
1875 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1876 + { m_unregistered, m_help, m_ignore, m_help, m_ignore, mh_help }
1881 0, MAXPARA, MFLG_SLOW, 0, NULL,
1882 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1883 - { m_unregistered, m_info, ms_info, mo_info, m_ignore }
1884 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1885 + { m_unregistered, m_info, ms_info, mo_info, m_ignore, mh_info }
1890 0, MAXPARA, MFLG_SLOW, 0, NULL,
1891 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1892 - { m_unregistered, m_motd, m_motd, m_motd, m_ignore }
1893 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1894 + { m_unregistered, m_motd, m_motd, m_motd, m_ignore, mh_motd }
1899 0, MAXPARA, MFLG_SLOW, 0, NULL,
1900 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1901 - { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore }
1902 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1903 + { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore, mh_close }
1908 0, MAXPARA, MFLG_SLOW, 0, NULL,
1909 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1910 - { m_unregistered, m_silence, ms_silence, m_silence, m_ignore }
1911 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1912 + { m_unregistered, m_silence, ms_silence, m_silence, m_ignore, mh_silence }
1917 0, MAXPARA, 0, 0, NULL,
1918 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1919 - { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore }
1920 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1921 + { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore, mh_gline }
1926 0, MAXPARA, MFLG_SLOW, 0, NULL,
1927 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1928 - { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore }
1929 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1930 + { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore, mh_jupe }
1935 0, MAXPARA, MFLG_SLOW, 0, NULL,
1936 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1937 - { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore }
1938 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1939 + { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore, mh_opmode }
1944 0, MAXPARA, MFLG_SLOW, 0, NULL,
1945 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1946 - { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore }
1947 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1948 + { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore, mh_clearmode }
1953 0, MAXPARA, MFLG_SLOW, 0, NULL,
1954 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1955 - { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore }
1956 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1957 + { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore, mh_uping }
1962 0, MAXPARA, MFLG_SLOW, 0, NULL,
1963 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1964 - { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore }
1965 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1966 + { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore, mh_not_server }
1969 MSG_END_OF_BURST_ACK,
1970 TOK_END_OF_BURST_ACK,
1971 0, MAXPARA, MFLG_SLOW, 0, NULL,
1972 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1973 - { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore }
1974 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1975 + { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore, mh_not_server }
1980 0, MAXPARA, MFLG_SLOW, 0, NULL,
1981 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1982 - { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore }
1983 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1984 + { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore, mh_not_server }
1989 0, MAXPARA, MFLG_SLOW, 0, NULL,
1990 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
1991 - { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore }
1992 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
1993 + { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore, mh_hash }
1998 0, MAXPARA, MFLG_SLOW, 0, NULL,
1999 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2000 - { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore }
2001 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2002 + { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore, mh_rehash }
2007 0, MAXPARA, MFLG_SLOW, 0, NULL,
2008 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2009 - { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore }
2010 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2011 + { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore, mh_restart }
2016 0, MAXPARA, MFLG_SLOW, 0, NULL,
2017 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2018 - { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore }
2019 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2020 + { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore, mh_die }
2025 0, MAXPARA, MFLG_SLOW, 0, NULL,
2026 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2027 - { m_proto, m_proto, m_proto, m_proto, m_ignore }
2028 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2029 + { m_proto, m_proto, m_proto, m_proto, m_ignore, mh_nohelp }
2034 0, MAXPARA, MFLG_SLOW, 0, NULL,
2035 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2036 - { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore }
2037 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2038 + { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore, mh_set }
2043 0, MAXPARA, MFLG_SLOW, 0, NULL,
2044 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2045 - { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore }
2046 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2047 + { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore, mh_reset }
2052 0, MAXPARA, MFLG_SLOW, 0, NULL,
2053 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2054 - { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore }
2055 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2056 + { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore, mh_get }
2061 0, MAXPARA, MFLG_SLOW, 0, NULL,
2062 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2063 - { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore }
2064 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2065 + { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore, mh_privs }
2070 0, MAXPARA, MFLG_SLOW, 0, NULL,
2071 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2072 - { m_ignore, m_ignore, ms_account, m_ignore, m_ignore }
2073 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2074 + { m_ignore, m_ignore, ms_account, m_ignore, m_ignore, mh_not_server }
2079 0, MAXPARA, MFLG_SLOW, 0, NULL,
2080 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2081 - { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore }
2082 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2083 + { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore, mh_asll }
2088 0, MAXPARA, MFLG_SLOW, 0, NULL,
2089 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2090 - { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore }
2091 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2092 + { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore, mh_sethost }
2094 #if WE_HAVE_A_REAL_CAPABILITY_NOW
2098 0, MAXPARA, 0, 0, NULL,
2099 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2100 - { m_cap, m_cap, m_ignore, m_cap, m_ignore }
2101 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2102 + { m_cap, m_cap, m_ignore, m_cap, m_ignore, mh_nohelp }
2109 0, MAXPARA, MFLG_SLOW, 0, NULL,
2110 - { m_unregistered, m_not_oper, m_check, m_check, m_ignore }
2111 + { m_unregistered, m_not_oper, m_check, m_check, m_ignore, mh_check }
2118 0, MAXPARA, MFLG_SLOW, 0, NULL,
2119 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2120 - { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore }
2121 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2122 + { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore, mh_nohelp }
2125 /* This command is an alias for QUIT during the unregistered part of
2129 0, MAXPARA, MFLG_SLOW, 0, NULL,
2130 - /* UNREG, CLIENT, SERVER, OPER, SERVICE */
2131 - { m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
2132 + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */
2133 + { m_quit, m_ignore, m_ignore, m_ignore, m_ignore, mh_nohelp }
2137 @@ -779,6 +779,14 @@
2141 +/** Look up a command in the message trie.
2142 + * @param cmd Text of command to look up.
2143 + * @return Pointer to matching message, or NULL if non exists.
2145 +struct Message *find_message_by_cmd(char *cmd) {
2146 + return msg_tree_parse(cmd, &msg_tree);
2149 /** Registers a service mapping to the pseudocommand handler.
2150 * @param[in] map Service mapping to add.
2151 * @return Non-zero on success; zero if a command already used the name.
2153 msg->handlers[SERVER_HANDLER] = m_ignore;
2154 msg->handlers[OPER_HANDLER] = m_pseudo;
2155 msg->handlers[SERVICE_HANDLER] = m_ignore;
2156 + msg->handlers[HELP_HANDLER] = mh_nohelp;
2158 add_msg_element(&msg_tree, msg, msg->cmd);
2160 diff -r a9a01fcf9bfb ircd/s_err.c
2161 --- a/ircd/s_err.c Thu Jan 29 21:48:27 2009 +0100
2162 +++ b/ircd/s_err.c Thu Jan 29 21:50:11 2009 +0100
2165 { RPL_ENDOFMOTD, ":End of /MOTD command.", "376" },
2168 + { RPL_HELP, 0, "377" },
2171 + { RPL_ENDOFHELP, "%s :End of /HELP report.", "378" },
2177 { ERR_INPUTTOOLONG, ":Input line was too long", "417" },
2180 + { ERR_NOHELP, "%s :No help found.", "418" },