Anope IRC Services  Version 1.8
shadowircd.c
Go to the documentation of this file.
1 /* ShadowIRCd functions
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  *
11  * Provided by the ShadowIRCd development group. See
12  * http://www.shadowircd.net for details.
13  */
14 
15 #include "services.h"
16 #include "pseudo.h"
17 #include "shadowircd.h"
18 #include "version.h"
19 
21  {"ShadowIRCd 4.0+", /* ircd name */
22  "+oiqSK", /* nickserv mode */
23  "+oiqSK", /* chanserv mode */
24  "+oiqSK", /* memoserv mode */
25  "+oiqSK", /* hostserv mode */
26  "+oiqSK", /* operserv mode */
27  "+oiqSK", /* botserv mode */
28  "+oiqSK", /* helpserv mode */
29  "+oiqSK", /* Dev/Null mode */
30  "+oiqSK", /* Global mode */
31  "+oiqSK", /* nickserv alias mode */
32  "+oiqSK", /* chanserv alias mode */
33  "+oiqSK", /* memoserv alias mode */
34  "+oiqSK", /* hostserv alias mode */
35  "+oiqSK", /* operserv alias mode */
36  "+oiqSK", /* botserv alias mode */
37  "+oiqSK", /* helpserv alias mode */
38  "+oiqSK", /* Dev/Null alias mode */
39  "+oiqSK", /* Global alias mode */
40  "+oiqSK", /* Used by BotServ Bots */
41  4, /* Chan Max Symbols */
42  "-cimnprstvzAEFGKLNOPRSTV", /* Modes to Remove */
43  "+o", /* Channel Umode used by Botserv bots */
44  1, /* SVSNICK */
45  1, /* Vhost */
46  0, /* Has Owner */
47  NULL, /* Mode to set for an owner */
48  NULL, /* Mode to unset for an owner */
49  "+a", /* Mode to set for channel admin */
50  "-a", /* Mode to unset for channel admin */
51  "+e", /* Mode On Reg */
52  NULL, /* Mode on ID for Roots */
53  NULL, /* Mode on ID for Admins */
54  NULL, /* Mode on ID for Opers */
55  "-e", /* Mode on UnReg */
56  "-e", /* Mode on Nick Change */
57  0, /* Supports SGlines */
58  1, /* Supports SQlines */
59  0, /* Supports SZlines */
60  1, /* Supports Halfop +h */
61  4, /* Number of server args */
62  0, /* Join 2 Set */
63  0, /* Join 2 Message */
64  1, /* Has exceptions +e */
65  0, /* TS Topic Forward */
66  0, /* TS Topci Backward */
67  0, /* Protected Umode */
68  1, /* Has Admin */
69  1, /* Chan SQlines */
70  1, /* Quit on Kill */
71  0, /* SVSMODE unban */
72  0, /* Has Protect */
73  0, /* Reverse */
74  1, /* Chan Reg */
75  1, /* Channel Mode */
76  1, /* vidents */
77  0, /* svshold */
78  0, /* time stamp on mode */
79  0, /* NICKIP */
80  1, /* UMODE */
81  0, /* O:LINE */
82  1, /* VHOST ON NICK */
83  1, /* Change RealName */
84  CMODE_K, /* No Knock */
85  CMODE_A, /* Admin Only */
86  DEFAULT_MLOCK, /* Default MLOCK */
87  UMODE_v, /* Vhost Mode */
88  0, /* +f */
89  0, /* +L */
90  0, /* +f Mode */
91  0, /* +L Mode */
92  1, /* On nick change check if they could be identified */
93  0, /* No Knock requires +i */
94  NULL, /* CAPAB Chan Modes */
95  0, /* We support TOKENS */
96  1, /* TOKENS are CASE inSensitive */
97  0, /* TIME STAMPS are BASE64 */
98  1, /* +I support */
99  0, /* SJOIN ban char */
100  0, /* SJOIN except char */
101  0, /* SJOIN invite char */
102  0, /* Can remove User Channel Modes with SVSMODE */
103  0, /* Sglines are not enforced until user reconnects */
104  "v", /* vhost char */
105  1, /* ts6 */
106  0, /* support helper umode */
107  0, /* p10 */
108  NULL, /* character set */
109  1, /* reports sync state */
110  0, /* CIDR channelbans */
111  0, /* +j */
112  0, /* +j mode */
113  0, /* Use delayed client introduction. */
114  }
115  ,
116  {NULL}
117 };
118 
119 /* ShadowIRCd does not use CAPAB */
121  {
122  0, /* NOQUIT */
123  0, /* TSMODE */
124  0, /* UNCONNECT */
125  0, /* NICKIP */
126  0, /* SJOIN */
127  0, /* ZIP */
128  0, /* BURST */
129  0, /* TS5 */
130  0, /* TS3 */
131  0, /* DKEY */
132  0, /* PT4 */
133  0, /* SCS */
134  0, /* QS */
135  0, /* UID */
136  0, /* KNOCK */
137  0, /* CLIENT */
138  0, /* IPV6 */
139  0, /* SSJ5 */
140  0, /* SN2 */
141  0, /* TOKEN */
142  0, /* VHOST */
143  0, /* SSJ3 */
144  0, /* NICK2 */
145  0, /* UMODE2 */
146  0, /* VL */
147  0, /* TLKEXT */
148  0, /* DODKEY */
149  0, /* DOZIP */
150  0, 0, 0}
151 };
152 
153 void shadowircd_set_umode(User * user, int ac, char **av)
154 {
155  int add = 1; /* 1 if adding modes, 0 if deleting */
156  char *modes = av[0];
157 
158  ac--;
159 
160  if (debug)
161  alog("debug: Changing mode for %s to %s", user->nick, modes);
162 
163  while (*modes) {
164 
165  /* This looks better, much better than "add ? (do_add) : (do_remove)".
166  * At least this is readable without paying much attention :) -GD
167  */
168  if (add)
169  user->mode |= umodes[(int) *modes];
170  else
171  user->mode &= ~umodes[(int) *modes];
172 
173  switch (*modes++) {
174  case '+':
175  add = 1;
176  break;
177  case '-':
178  add = 0;
179  break;
180  case 'o':
181  if (add) {
182  opcnt++;
183 
184  if (WallOper)
186  "\2%s\2 is now an IRC operator.",
187  user->nick);
188  display_news(user, NEWS_OPER);
189 
190  } else {
191  opcnt--;
192  }
193  break;
194  }
195  }
196 }
197 
198 unsigned long umodes[128] = {
199  0, 0, 0, /* Unused */
200  0, 0, 0, /* Unused */
201  0, 0, 0, /* Unused, Unused, Horzontal Tab */
202  0, 0, 0, /* Line Feed, Unused, Unused */
203  0, 0, 0, /* Carriage Return, Unused, Unused */
204  0, 0, 0, /* Unused */
205  0, 0, 0, /* Unused */
206  0, 0, 0, /* Unused */
207  0, 0, 0, /* Unused */
208  0, 0, 0, /* Unused */
209  0, 0, 0, /* Unused, Unused, Space */
210  0, 0, 0, /* ! " # */
211  0, 0, 0, /* $ % & */
212  0, 0, 0, /* ! ( ) */
213  0, 0, 0, /* * + , */
214  0, 0, 0, /* - . / */
215  0, 0, /* 0 1 */
216  0, 0, /* 2 3 */
217  0, 0, /* 4 5 */
218  0, 0, /* 6 7 */
219  0, 0, /* 8 9 */
220  0, 0, /* : ; */
221  0, 0, 0, /* < = > */
222  0, 0, /* ? @ */
223  UMODE_A, 0, 0, /* A B C */
224  0, UMODE_E, 0, /* D E F */
225  UMODE_G, 0, 0, /* G H I */
226  0, 0, 0, /* J K L */
227  0, 0, UMODE_O, /* M N O */
228  0, 0, UMODE_R, /* P Q R */
229  0, 0, 0, /* S T U */
230  0, 0, 0, /* V W X */
231  0, /* Y */
232  0, /* Z */
233  0, 0, 0, /* [ \ ] */
234  0, 0, 0, /* ^ _ ` */
235  UMODE_a, UMODE_b, 0, /* a b c */
236  UMODE_d, UMODE_e, 0, /* d e f */
237  UMODE_g, 0, UMODE_i, /* g h i */
238  0, 0, UMODE_l, /* j k l */
239  0, UMODE_n, UMODE_o, /* m n o */
240  0, 0, 0, /* p q r */
241  0, 0, UMODE_u, /* s t u */
242  UMODE_v, UMODE_w, UMODE_x, /* v w x */
243  0, /* y */
244  0, /* z */
245  0, 0, 0, /* { | } */
246  0, 0 /* ~ � */
247 };
248 
249 
250 char myCsmodes[128] = {
251  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
252  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
253 
254  0,
255  'a',
256  0, 0, 0,
257  'h',
258  0, 0, 0, 0,
259  0,
260 
261  'v', 0, 0, 0, 0,
262  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
263 
264  'o', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
265  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
266 
267  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
268  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
269 };
270 
272  {NULL}, {NULL}, {NULL},
273  {NULL}, {NULL}, {NULL},
274  {NULL}, {NULL}, {NULL},
275  {NULL}, {NULL}, {NULL},
276  {NULL}, {NULL}, {NULL},
277  {NULL}, {NULL}, {NULL},
278  {NULL}, {NULL}, {NULL},
279  {NULL}, {NULL}, {NULL},
280  {NULL}, {NULL}, {NULL},
281  {NULL}, {NULL}, {NULL},
282  {NULL}, {NULL}, {NULL},
283  {NULL}, {NULL}, {NULL},
284  {NULL}, {NULL}, {NULL},
285  {NULL}, {NULL}, {NULL},
286  {NULL}, {NULL}, {NULL},
287  {NULL}, {NULL}, {NULL},
288  {NULL}, {NULL}, {NULL},
289  {NULL}, {NULL}, {NULL},
290  {NULL}, {NULL}, {NULL},
291  {NULL}, {NULL}, {NULL},
292  {NULL}, {NULL}, {NULL},
293  {NULL}, {NULL}, {NULL},
294  {NULL}, {NULL}, {NULL}, /* BCD */
295  {NULL}, {NULL}, {NULL}, /* EFG */
296  {NULL}, /* H */
298  {NULL}, /* J */
299  {NULL}, {NULL}, {NULL}, /* KLM */
300  {NULL}, {NULL}, {NULL}, /* NOP */
301  {NULL}, {NULL}, {NULL}, /* QRS */
302  {NULL}, {NULL}, {NULL}, /* TUV */
303  {NULL}, {NULL}, {NULL}, /* WXY */
304  {NULL}, /* Z */
305  {NULL}, {NULL}, /* (char 91 - 92) */
306  {NULL}, {NULL}, {NULL}, /* (char 93 - 95) */
307  {NULL}, /* ` (char 96) */
308  {NULL}, /* a (char 97) */
309  {add_ban, del_ban},
310  {NULL},
311  {NULL},
313  {NULL},
314  {NULL},
315  {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
316  {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
317  {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}
318 };
319 
320 
322  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
323  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
324  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
325  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
326  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
327  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
328  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
329  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
330  {0},
331  {CMODE_A, 0, NULL, NULL}, /* A */
332  {0}, /* B */
333  {0}, /* C */
334  {0}, /* D */
335  {CMODE_E, 0, NULL, NULL}, /* E */
336  {CMODE_F, 0, NULL, NULL}, /* F */
337  {CMODE_G, 0, NULL, NULL}, /* G */
338  {0}, /* H */
339  {0}, /* I */
340  {0}, /* J */
341  {CMODE_K, 0, NULL, NULL}, /* K */
342  {CMODE_L, 0, NULL, NULL}, /* L */
343  {0}, /* M */
344  {CMODE_N, 0, NULL, NULL}, /* N */
345  {CMODE_O, 0, NULL, NULL}, /* O */
346  {CMODE_P, 0, NULL, NULL}, /* P */
347  {0}, /* Q */
348  {CMODE_R, 0, NULL, NULL}, /* R */
349  {CMODE_S, 0, NULL, NULL}, /* S */
350  {CMODE_T, 0, NULL, NULL}, /* T */
351  {0}, /* U */
352  {CMODE_V, 0, NULL, NULL}, /* V */
353  {0}, /* W */
354  {0}, /* X */
355  {0}, /* Y */
356  {0}, /* Z */
357  {0}, {0}, {0}, {0}, {0}, {0},
358  {0},
359  {0}, /* b */
360  {CMODE_c, 0, NULL, NULL},
361  {0}, /* d */
362  {0}, /* e */
363  {0}, /* f */
364  {0}, /* g */
365  {0}, /* h */
366  {CMODE_i, 0, NULL, NULL},
367  {0}, /* j */
370  {CMODE_m, 0, NULL, NULL},
371  {CMODE_n, 0, NULL, NULL},
372  {0}, /* o */
373  {CMODE_p, 0, NULL, NULL},
374  {0}, /* q */
375  {CMODE_r, 0, NULL, NULL},
376  {CMODE_s, 0, NULL, NULL},
377  {CMODE_t, 0, NULL, NULL},
378  {0},
379  {0}, /* v */
380  {0}, /* w */
381  {0}, /* x */
382  {0}, /* y */
383  {CMODE_z, 0, NULL, NULL}, /* z */
384  {0}, {0}, {0}, {0}
385 };
386 
388  {'c', CMODE_c, 0, NULL, NULL},
389  {'i', CMODE_i, 0, NULL, NULL},
390  {'k', CMODE_k, 0, get_key, cs_get_key},
392  {'m', CMODE_m, 0, NULL, NULL},
393  {'n', CMODE_n, 0, NULL, NULL},
394  {'p', CMODE_p, 0, NULL, NULL},
395  {'r', CMODE_r, 0, NULL, NULL},
396  {'s', CMODE_s, 0, NULL, NULL},
397  {'t', CMODE_t, 0, NULL, NULL},
398  {'z', CMODE_z, 0, NULL, NULL},
399  {'A', CMODE_A, 0, NULL, NULL},
400  {'E', CMODE_E, 0, NULL, NULL},
401  {'F', CMODE_F, 0, NULL, NULL},
402  {'G', CMODE_G, 0, NULL, NULL},
403  {'K', CMODE_K, 0, NULL, NULL},
404  {'L', CMODE_L, 0, NULL, NULL},
405  {'N', CMODE_N, 0, NULL, NULL},
406  {'O', CMODE_O, 0, NULL, NULL},
407  {'P', CMODE_P, 0, NULL, NULL},
408  {'S', CMODE_S, 0, NULL, NULL},
409  {'T', CMODE_T, 0, NULL, NULL},
410  {'V', CMODE_V, 0, NULL, NULL},
411  {0}
412 };
413 
414 
416  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
417  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
418  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
419  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
420 
421  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
422  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
423  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
424  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
425 
426  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
427  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
428  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
429  {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
430 
431  {0},
432 
434  {0}, /* b */
435  {0}, /* c */
436  {0}, /* d */
437  {0}, /* e */
438  {0}, /* f */
439  {0}, /* g */
441  {0}, /* i */
442  {0}, /* j */
443  {0}, /* k */
444  {0}, /* l */
445  {0}, /* m */
446  {0}, /* n */
448  {0}, /* p */
449  {0}, /* q */
450  {0}, /* r */
451  {0}, /* s */
452  {0}, /* t */
453  {0}, /* u */
454  {CUS_VOICE, 0, NULL},
455  {0}, /* w */
456  {0}, /* x */
457  {0}, /* y */
458  {0}, /* z */
459  {0}, {0}, {0}, {0}, {0}
460 };
461 
462 
463 
464 void shadowircd_cmd_notice(char *source, char *dest, char *buf)
465 {
466  Uid *ud;
467  User *u;
468 
469  if (!buf) {
470  return;
471  }
472 
473  if (NSDefFlags & NI_MSG) {
474  shadowircd_cmd_privmsg2(source, dest, buf);
475  } else {
476  ud = find_uid(source);
477  u = finduser(dest);
478  send_cmd((ud ? ud->uid : source), "NOTICE %s :%s",
479  (u ? u->uid : dest), buf);
480  }
481 }
482 
483 void shadowircd_cmd_notice2(char *source, char *dest, char *msg)
484 {
485  Uid *ud;
486  User *u;
487 
488  ud = find_uid(source);
489  u = finduser(dest);
490  send_cmd((ud ? ud->uid : source), "NOTICE %s :%s", (u ? u->uid : dest),
491  msg);
492 }
493 
494 void shadowircd_cmd_privmsg(char *source, char *dest, char *buf)
495 {
496  Uid *ud, *ud2;
497 
498  if (!buf) {
499  return;
500  }
501  ud = find_uid(source);
502  ud2 = find_uid(dest);
503 
504  send_cmd((ud ? ud->uid : source), "PRIVMSG %s :%s",
505  (ud2 ? ud2->uid : dest), buf);
506 }
507 
508 void shadowircd_cmd_privmsg2(char *source, char *dest, char *msg)
509 {
510  Uid *ud, *ud2;
511 
512  ud = find_uid(source);
513  ud2 = find_uid(dest);
514 
515  send_cmd((ud ? ud->uid : source), "PRIVMSG %s :%s",
516  (ud2 ? ud2->uid : dest), msg);
517 }
518 
519 void shadowircd_cmd_serv_notice(char *source, char *dest, char *msg)
520 {
521  send_cmd(source, "NOTICE $$%s :%s", dest, msg);
522 }
523 
524 void shadowircd_cmd_serv_privmsg(char *source, char *dest, char *msg)
525 {
526  send_cmd(source, "PRIVMSG $$%s :%s", dest, msg);
527 }
528 
529 
530 void shadowircd_cmd_global(char *source, char *buf)
531 {
532  Uid *u;
533 
534  if (!buf) {
535  return;
536  }
537 
538  if (source) {
539  u = find_uid(source);
540  if (u) {
541  send_cmd((u ? u->uid : source), "OPERWALL :%s", buf);
542  } else {
543  send_cmd(TS6SID, "OPERWALL :%s", buf);
544  }
545  } else {
546  send_cmd(TS6SID, "OPERWALL :%s", buf);
547  }
548 }
549 
550 /* GLOBOPS - to handle old WALLOPS */
551 void shadowircd_cmd_global_legacy(char *source, char *fmt)
552 {
553  Uid *u;
554 
555  if (source) {
556  u = find_uid(source);
557  if (u) {
558  send_cmd((u ? u->uid : source), "OPERWALL :%s", fmt);
559  } else {
560  send_cmd(TS6SID, "OPERWALL :%s", fmt);
561  }
562  } else {
563  send_cmd(TS6SID, "OPERWALL :%s", fmt);
564  }
565 
566  send_cmd(source ? source : ServerName, "OPERWALL :%s", fmt);
567 }
568 
569 int anope_event_sjoin(char *source, int ac, char **av)
570 {
571  do_sjoin(source, ac, av);
572  return MOD_CONT;
573 }
574 
575 /*
576  Non TS6
577 
578  av[0] = nick
579  av[1] = hop
580  av[2] = ts
581  av[3] = modes
582  av[4] = user
583  av[5] = host
584  av[6] = server
585  av[7] = info
586 
587  TS6
588  av[0] = nick
589  av[1] = hop
590  av[2] = ts
591  av[3] = modes
592  av[4] = user
593  av[5] = host
594  av[6] = IP
595  av[7] = UID
596  av[8] = vhost
597  av[9] = info
598 
599 */
600 int anope_event_nick(char *source, int ac, char **av)
601 {
602  Server *s = NULL;
603  User *user, *u2;
604 
605  if (ac == 10) {
606  s = findserver_uid(servlist, source);
607  /* Source is always the server */
608  *source = '\0';
609  user = do_nick(source, av[0], av[4], av[5], s->name, av[9],
610  strtoul(av[2], NULL, 10), 0, 0, av[8], av[7]);
611  if (user) {
612  anope_set_umode(user, 1, &av[3]);
613  }
614  } else if (ac == 8) {
615  /* Changed use of s->name to av[6], as s will be NULL
616  * if i can believe the above comments, this should be fine
617  * if anyone from shadowircd see's this, and its wrong, let
618  * me know? :)
619  */
620  user = do_nick(source, av[0], av[4], av[5], av[6], av[7],
621  strtoul(av[2], NULL, 10), 0, 0, NULL, NULL);
622  if (user) {
623  anope_set_umode(user, 1, &av[3]);
624  }
625  } else {
626  u2 = find_byuid(source);
627  do_nick((u2 ? u2->nick : source), av[0], NULL, NULL, NULL, NULL,
628  strtoul(av[1], NULL, 10), 0, 0, NULL, NULL);
629  }
630  return MOD_CONT;
631 }
632 
633 
634 int anope_event_chghost(char *source, int ac, char **av)
635 {
636  User *u;
637 
638  if (ac != 2)
639  return MOD_CONT;
640 
641  u = find_byuid(av[0]);
642  if (!u) {
643  if (debug) {
644  alog("debug: CHGHOST for nonexistent user %s", av[0]);
645  }
646  return MOD_CONT;
647  }
648 
649  change_user_host(u, av[1]);
650  return MOD_CONT;
651 }
652 
653 int anope_event_topic(char *source, int ac, char **av)
654 {
655  User *u;
656 
657  if (ac == 4) {
658  do_topic(source, ac, av);
659  } else {
660  Channel *c = findchan(av[0]);
661  time_t topic_time = time(NULL);
662 
663  if (!c) {
664  if (debug) {
665  alog("debug: TOPIC %s for nonexistent channel %s",
666  merge_args(ac - 1, av + 1), av[0]);
667  }
668  return MOD_CONT;
669  }
670 
671  if (check_topiclock(c, topic_time))
672  return MOD_CONT;
673 
674  if (c->topic) {
675  free(c->topic);
676  c->topic = NULL;
677  }
678  if (ac > 1 && *av[1])
679  c->topic = sstrdup(av[1]);
680 
681  u = find_byuid(source);
682  if (u) {
683  strscpy(c->topic_setter, u->nick, sizeof(c->topic_setter));
684  } else {
685  strscpy(c->topic_setter, source, sizeof(c->topic_setter));
686  }
687  c->topic_time = topic_time;
688 
689  record_topic(av[0]);
690 
691  if (ac > 1 && *av[1])
692  send_event(EVENT_TOPIC_UPDATED, 2, av[0], av[1]);
693  else
694  send_event(EVENT_TOPIC_UPDATED, 2, av[0], "");
695  }
696  return MOD_CONT;
697 }
698 
699 int anope_event_tburst(char *source, int ac, char **av)
700 {
701  char *setter;
702  Channel *c;
703  time_t topic_time;
704 
705  if (ac != 4) {
706  return MOD_CONT;
707  }
708 
709  setter = myStrGetToken(av[2], '!', 0);
710 
711  c = findchan(av[0]);
712  topic_time = strtol(av[1], NULL, 10);
713 
714  if (!c) {
715  if (debug) {
716  alog("debug: TOPIC %s for nonexistent channel %s",
717  merge_args(ac - 1, av + 1), av[0]);
718  }
719  if (setter)
720  free(setter);
721  return MOD_CONT;
722  }
723 
724  if (check_topiclock(c, topic_time)) {
725  if (setter)
726  free(setter);
727  return MOD_CONT;
728  }
729 
730  if (c->topic) {
731  free(c->topic);
732  c->topic = NULL;
733  }
734  if (ac > 1 && *av[3])
735  c->topic = sstrdup(av[3]);
736 
737  strscpy(c->topic_setter, setter, sizeof(c->topic_setter));
738  c->topic_time = topic_time;
739 
740  record_topic(av[0]);
741 
742  if (ac > 1 && *av[3])
743  send_event(EVENT_TOPIC_UPDATED, 2, av[0], av[3]);
744  else
745  send_event(EVENT_TOPIC_UPDATED, 2, av[0], "");
746 
747  if (setter)
748  free(setter);
749 
750  return MOD_CONT;
751 }
752 
753 int anope_event_436(char *source, int ac, char **av)
754 {
755  if (ac < 1)
756  return MOD_CONT;
757 
758  m_nickcoll(av[0]);
759  return MOD_CONT;
760 }
761 
762 
763 /* *INDENT-OFF* */
764 void moduleAddIRCDMsgs(void)
765 {
766  Message *m;
767 
768  updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+a","-a");
769 
771  UseTS6 = 1;
772 
814 
815 }
816 
817 /* *INDENT-ON* */
818 
819 
820 void shadowircd_cmd_sqline(char *mask, char *reason)
821 {
822  send_cmd(NULL, "RESV * %s :%s", mask, reason);
823 }
824 
825 void shadowircd_cmd_unsgline(char *mask)
826 {
827  /* Does not support */
828 }
829 
830 void shadowircd_cmd_unszline(char *mask)
831 {
832  /* Does not support */
833 }
834 
835 void shadowircd_cmd_szline(char *mask, char *reason, char *whom)
836 {
837  /* Does not support */
838 }
839 
840 void shadowircd_cmd_svsnoop(char *server, int set)
841 {
842  /* does not support */
843 }
844 
845 void shadowircd_cmd_svsadmin(char *server, int set)
846 {
847  shadowircd_cmd_svsnoop(server, set);
848 }
849 
850 void shadowircd_cmd_sgline(char *mask, char *reason)
851 {
852  /* does not support */
853 }
854 
855 void shadowircd_cmd_remove_akill(char *user, char *host)
856 {
857  Uid *ud;
858 
859  ud = find_uid(s_OperServ);
860  send_cmd((ud ? ud->uid : s_OperServ), "UNKLINE * %s %s", user, host);
861 }
862 
863 void shadowircd_cmd_topic(char *whosets, char *chan, char *whosetit,
864  char *topic, time_t when)
865 {
866  Uid *ud;
867 
868  ud = find_uid(whosets);
869  send_cmd((ud ? ud->uid : whosets), "TOPIC %s %s %ld :%s", chan,
870  whosetit, (long int) when, topic);
871 }
872 
874 {
875  send_cmd(NULL, "MODE %s -v", (u->uid ? u->uid : u->nick));
876 }
877 
878 void shadowircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost)
879 {
880  send_cmd(NULL, "SVSCLOAK %s %s", nick, vhost);
881 
882  if (vIdent)
883  send_cmd(NULL, "SVSIDENT %s %s", nick, vIdent);
884 }
885 
886 void shadowircd_cmd_unsqline(char *user)
887 {
888  send_cmd(NULL, "UNRESV * %s", user);
889 }
890 
891 void shadowircd_cmd_join(char *user, char *channel, time_t chantime)
892 {
893  Uid *ud;
894 
895  ud = find_uid(user);
896  send_cmd(NULL, "SJOIN %ld %s + :%s", (long int) chantime,
897  channel, (ud ? ud->uid : user));
898 }
899 
900 /*
901 oper: the nick of the oper performing the kline
902 target.server: the server(s) this kline is destined for
903 duration: the duration if a tkline, 0 if permanent.
904 user: the 'user' portion of the kline
905 host: the 'host' portion of the kline
906 reason: the reason for the kline.
907 */
908 
909 void shadowircd_cmd_akill(char *user, char *host, char *who, time_t when,
910  time_t expires, char *reason)
911 {
912  Uid *ud;
913 
914  ud = find_uid(s_OperServ);
915 
916  send_cmd((ud ? ud->uid : s_OperServ), "KLINE * %ld %s %s :%s",
917  (long int) (expires - (long) time(NULL)), user, host, reason);
918 }
919 
920 void shadowircd_cmd_svskill(char *source, char *user, char *buf)
921 {
922  Uid *ud;
923 
924  if (!buf) {
925  return;
926  }
927 
928  if (!source || !user) {
929  return;
930  }
931 
932  ud = find_uid(user);
933  send_cmd(NULL, "SVSKILL %s :%s", (ud ? ud->uid : user), buf);
934 }
935 
936 void shadowircd_cmd_svsmode(User * u, int ac, char **av)
937 {
938  send_cmd(TS6SID, "MODE %s %s", u->uid, av[0]);
939 }
940 
942 {
943  /* not used */
944 }
945 
946 /*
947  * SVINFO
948  * parv[0] = sender prefix
949  * parv[1] = TS_CURRENT for the server
950  * parv[2] = TS_MIN for the server
951  * parv[3] = server is standalone or connected to non-TS only
952  * parv[4] = server's idea of UTC time
953  */
955 {
956  send_cmd(NULL, "SVINFO 6 3 0 :%ld", (long int) time(NULL));
957 }
958 
960 {
961  /* ShadowIRCd does not use CAPAB */
962 }
963 
964 /* PASS */
965 void shadowircd_cmd_pass(char *pass)
966 {
967  send_cmd(NULL, "PASS %s TS 6 %s", pass, TS6SID);
968 }
969 
970 /* SERVER name protocol hop descript */
971 void shadowircd_cmd_server(char *servname, int hop, char *descript)
972 {
973  send_cmd(NULL, "SERVER %s %d %d :%s", servname, hop, PROTOCOL_REVISION,
974  descript);
975 }
976 
977 
979 {
980  me_server =
982  if (servernum == 1)
984  else if (servernum == 2)
986  else if (servernum == 3)
988 
992 }
993 
995 {
996  /* Not used */
997 }
998 
999 void shadowircd_cmd_bot_nick(char *nick, char *user, char *host,
1000  char *real, char *modes)
1001 {
1002  char *uidbuf = ts6_uid_retrieve();
1003 
1004  EnforceQlinedNick(nick, NULL);
1005  send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0.0.0.0 %s %s :%s", nick,
1006  (long int) time(NULL), modes, user, host, uidbuf, host,
1007  real);
1008  new_uid(nick, uidbuf);
1009  shadowircd_cmd_sqline(nick, "Reserved for services");
1010 }
1011 
1012 void shadowircd_cmd_part(char *nick, char *chan, char *buf)
1013 {
1014  Uid *ud;
1015 
1016  ud = find_uid(nick);
1017 
1018  if (buf) {
1019  send_cmd((ud ? ud->uid : nick), "PART %s :%s", chan, buf);
1020  } else {
1021  send_cmd((ud ? ud->uid : nick), "PART %s", chan);
1022  }
1023 }
1024 
1025 int anope_event_ping(char *source, int ac, char **av)
1026 {
1027  if (ac < 1)
1028  return MOD_CONT;
1029  shadowircd_cmd_pong(ac > 1 ? av[1] : ServerName, av[0]);
1030  return MOD_CONT;
1031 }
1032 
1033 int anope_event_away(char *source, int ac, char **av)
1034 {
1035  User *u = NULL;
1036 
1037  u = find_byuid(source);
1038 
1039  m_away(u->nick, (ac ? av[0] : NULL));
1040  return MOD_CONT;
1041 }
1042 
1043 int anope_event_kill(char *source, int ac, char **av)
1044 {
1045  if (ac != 2)
1046  return MOD_CONT;
1047 
1048  m_kill(av[0], av[1]);
1049  return MOD_CONT;
1050 }
1051 
1052 int anope_event_kick(char *source, int ac, char **av)
1053 {
1054  if (ac != 3)
1055  return MOD_CONT;
1056  do_kick(source, ac, av);
1057  return MOD_CONT;
1058 }
1059 
1061 {
1062  send_cmd(TS6SID, "EOB");
1063 }
1064 
1065 int anope_event_join(char *source, int ac, char **av)
1066 {
1067  if (ac != 1) {
1068  do_sjoin(source, ac, av);
1069  return MOD_CONT;
1070  } else {
1071  do_join(source, ac, av);
1072  }
1073  return MOD_CONT;
1074 }
1075 
1076 int anope_event_motd(char *source, int ac, char **av)
1077 {
1078  if (!source) {
1079  return MOD_CONT;
1080  }
1081 
1082  m_motd(source);
1083  return MOD_CONT;
1084 }
1085 
1086 int anope_event_privmsg(char *source, int ac, char **av)
1087 {
1088  User *u;
1089  Uid *ud;
1090 
1091  if (ac != 2) {
1092  return MOD_CONT;
1093  }
1094 
1095  u = find_byuid(source);
1096  ud = find_nickuid(av[0]);
1097 
1098  m_privmsg((u ? u->nick : source), (ud ? ud->nick : av[0]), av[1]);
1099  return MOD_CONT;
1100 }
1101 
1102 int anope_event_part(char *source, int ac, char **av)
1103 {
1104  User *u;
1105 
1106  if (ac < 1 || ac > 2) {
1107  return MOD_CONT;
1108  }
1109 
1110  u = find_byuid(source);
1111  do_part(u->nick, ac, av);
1112 
1113  return MOD_CONT;
1114 }
1115 
1116 int anope_event_whois(char *source, int ac, char **av)
1117 {
1118  Uid *ud;
1119 
1120  if (source && ac >= 1) {
1121  ud = find_nickuid(av[0]);
1122  m_whois(source, (ud ? ud->nick : source));
1123  }
1124  return MOD_CONT;
1125 }
1126 
1127 /* EVENT: SERVER */
1128 int anope_event_server(char *source, int ac, char **av)
1129 {
1130  if (!stricmp(av[1], "1")) {
1131  uplink = sstrdup(av[0]);
1132  if (TS6UPLINK) {
1133  do_server(source, av[0], av[1], av[2], TS6UPLINK);
1134  } else {
1135  do_server(source, av[0], av[1], av[2], NULL);
1136  }
1137  } else {
1138  do_server(source, av[0], av[1], av[2], NULL);
1139  }
1140  return MOD_CONT;
1141 }
1142 
1143 int anope_event_sid(char *source, int ac, char **av)
1144 {
1145  Server *s;
1146 
1147  /* :42X SID trystan.nomadirc.net 2 43X :ircd-ratbox test server */
1148 
1149  s = findserver_uid(servlist, source);
1150  do_server(s->name, av[0], av[1], av[3], av[2]);
1151  return MOD_CONT;
1152 }
1153 
1154 int anope_event_eos(char *source, int ac, char **av)
1155 {
1156  Server *s;
1157  s = findserver_uid(servlist, source);
1158  /* If we found a server with the given source, that one just
1159  * finished bursting. If there was no source, then our uplink
1160  * server finished bursting. -GD
1161  */
1162  if (!s && serv_uplink)
1163  s = serv_uplink;
1164  finish_sync(s, 1);
1165 
1166  return MOD_CONT;
1167 }
1168 
1169 int anope_event_squit(char *source, int ac, char **av)
1170 {
1171  if (ac != 2)
1172  return MOD_CONT;
1173  do_squit(source, ac, av);
1174  return MOD_CONT;
1175 }
1176 
1177 int anope_event_quit(char *source, int ac, char **av)
1178 {
1179  User *u;
1180 
1181  if (ac != 1) {
1182  return MOD_CONT;
1183  }
1184 
1185  u = find_byuid(source);
1186 
1187  do_quit(u->nick, ac, av);
1188  return MOD_CONT;
1189 }
1190 
1191 void shadowircd_cmd_372(char *source, char *msg)
1192 {
1193  send_cmd(TS6SID, "372 %s :- %s", source, msg);
1194 }
1195 
1196 void shadowircd_cmd_372_error(char *source)
1197 {
1198  send_cmd(TS6SID,
1199  "422 %s :- MOTD file not found! Please "
1200  "contact your IRC administrator.", source);
1201 }
1202 
1203 void shadowircd_cmd_375(char *source)
1204 {
1205  send_cmd(TS6SID,
1206  "375 %s :- %s Message of the Day", source, ServerName);
1207 }
1208 
1209 void shadowircd_cmd_376(char *source)
1210 {
1211  send_cmd(TS6SID, "376 %s :End of /MOTD command.", source);
1212 }
1213 
1214 /* 391 */
1215 void shadowircd_cmd_391(char *source, char *timestr)
1216 {
1217  if (!timestr) {
1218  return;
1219  }
1220  send_cmd(NULL, "391 :%s %s :%s", source, ServerName, timestr);
1221 }
1222 
1223 /* 250 */
1224 void shadowircd_cmd_250(char *buf)
1225 {
1226  if (!buf) {
1227  return;
1228  }
1229 
1230  send_cmd(NULL, "250 %s", buf);
1231 }
1232 
1233 /* 307 */
1234 void shadowircd_cmd_307(char *buf)
1235 {
1236  if (!buf) {
1237  return;
1238  }
1239 
1240  send_cmd(TS6SID, "307 %s", buf);
1241 }
1242 
1243 /* 311 */
1244 void shadowircd_cmd_311(char *buf)
1245 {
1246  if (!buf) {
1247  return;
1248  }
1249 
1250  send_cmd(TS6SID, "311 %s", buf);
1251 }
1252 
1253 /* 312 */
1254 void shadowircd_cmd_312(char *buf)
1255 {
1256  if (!buf) {
1257  return;
1258  }
1259 
1260  send_cmd(TS6SID, "312 %s", buf);
1261 }
1262 
1263 /* 317 */
1264 void shadowircd_cmd_317(char *buf)
1265 {
1266  if (!buf) {
1267  return;
1268  }
1269 
1270  send_cmd(TS6SID, "317 %s", buf);
1271 }
1272 
1273 /* 219 */
1274 void shadowircd_cmd_219(char *source, char *letter)
1275 {
1276  if (!source) {
1277  return;
1278  }
1279 
1280  if (letter) {
1281  send_cmd(NULL, "219 %s %c :End of /STATS report.", source,
1282  *letter);
1283  } else {
1284  send_cmd(NULL, "219 %s l :End of /STATS report.", source);
1285  }
1286 }
1287 
1288 /* 401 */
1289 void shadowircd_cmd_401(char *source, char *who)
1290 {
1291  if (!source || !who) {
1292  return;
1293  }
1294  send_cmd(TS6SID, "401 %s %s :No such service.", source, who);
1295 }
1296 
1297 /* 318 */
1298 void shadowircd_cmd_318(char *source, char *who)
1299 {
1300  if (!source || !who) {
1301  return;
1302  }
1303 
1304  send_cmd(TS6SID, "318 %s %s :End of /WHOIS list.", source, who);
1305 }
1306 
1307 /* 242 */
1308 void shadowircd_cmd_242(char *buf)
1309 {
1310  if (!buf) {
1311  return;
1312  }
1313 
1314  send_cmd(NULL, "242 %s", buf);
1315 }
1316 
1317 /* 243 */
1318 void shadowircd_cmd_243(char *buf)
1319 {
1320  if (!buf) {
1321  return;
1322  }
1323 
1324  send_cmd(NULL, "243 %s", buf);
1325 }
1326 
1327 /* 211 */
1328 void shadowircd_cmd_211(char *buf)
1329 {
1330  if (!buf) {
1331  return;
1332  }
1333 
1334  send_cmd(NULL, "211 %s", buf);
1335 }
1336 
1337 void shadowircd_cmd_mode(char *source, char *dest, char *buf)
1338 {
1339  Uid *ud;
1340  if (!buf) {
1341  return;
1342  }
1343 
1344  if (source) {
1345  ud = find_uid(source);
1346  send_cmd((ud ? ud->uid : source), "MODE %s %s", dest, buf);
1347  } else {
1348  send_cmd(source, "MODE %s %s", dest, buf);
1349  }
1350 }
1351 
1352 void shadowircd_cmd_tmode(char *source, char *dest, char *buf)
1353 {
1354 
1355  if (!buf) {
1356  return;
1357  }
1358 
1359  send_cmd(NULL, "MODE %s %s", dest, buf);
1360 }
1361 
1362 void shadowircd_cmd_nick(char *nick, char *name, char *mode)
1363 {
1364  char *uidbuf = ts6_uid_retrieve();
1365 
1366  EnforceQlinedNick(nick, NULL);
1367  send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0.0.0.0 %s %s :%s", nick,
1368  (long int) time(NULL), mode, ServiceUser, ServiceHost,
1369  uidbuf, ServiceHost, name);
1370  new_uid(nick, uidbuf);
1371  shadowircd_cmd_sqline(nick, "Reserved for services");
1372 }
1373 
1374 void shadowircd_cmd_kick(char *source, char *chan, char *user, char *buf)
1375 {
1376  Uid *ud;
1377  User *u;
1378 
1379  ud = find_uid(source);
1380  u = finduser(user);
1381 
1382  if (buf) {
1383  send_cmd((ud ? ud->uid : source), "KICK %s %s :%s", chan,
1384  (u ? u->uid : user), buf);
1385  } else {
1386  send_cmd((ud ? ud->uid : source), "KICK %s %s", chan,
1387  (u ? u->uid : user));
1388  }
1389 }
1390 
1391 void shadowircd_cmd_notice_ops(char *source, char *dest, char *buf)
1392 {
1393  if (!buf) {
1394  return;
1395  }
1396 
1397  send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
1398 }
1399 
1400 void shadowircd_cmd_bot_chan_mode(char *nick, char *chan)
1401 {
1402  Uid *u;
1403 
1404  u = find_uid(nick);
1405  anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode,
1406  (u ? u->uid : nick));
1407 }
1408 
1409 /* QUIT */
1410 void shadowircd_cmd_quit(char *source, char *buf)
1411 {
1412  Uid *ud;
1413 
1414  ud = find_uid(source);
1415 
1416  if (buf) {
1417  send_cmd((ud ? ud->uid : source), "QUIT :%s", buf);
1418  } else {
1419  send_cmd((ud ? ud->uid : source), "QUIT");
1420  }
1421 }
1422 
1423 /* PONG */
1424 void shadowircd_cmd_pong(char *servname, char *who)
1425 {
1426  send_cmd(TS6SID, "PONG %s", who);
1427 }
1428 
1429 /* INVITE */
1430 void shadowircd_cmd_invite(char *source, char *chan, char *nick)
1431 {
1432  Uid *ud;
1433  User *u;
1434 
1435  if (!source || !chan || !nick) {
1436  return;
1437  }
1438 
1439  ud = find_uid(source);
1440  u = finduser(nick);
1441 
1442  send_cmd((ud ? ud->uid : source), "INVITE %s %s",
1443  (u ? u->uid : nick), chan);
1444 }
1445 
1446 /* SQUIT */
1447 void shadowircd_cmd_squit(char *servname, char *message)
1448 {
1449  if (!servname || !message) {
1450  return;
1451  }
1452 
1453  send_cmd(NULL, "SQUIT %s :%s", servname, message);
1454 }
1455 
1456 int anope_event_mode(char *source, int ac, char **av)
1457 {
1458  User *u, *u2;
1459 
1460  if (ac < 2 || *av[0] == '&') {
1461  return MOD_CONT;
1462  }
1463 
1464  if (*av[0] == '#') {
1465  do_cmode(source, ac, av);
1466  } else {
1467  u = find_byuid(source);
1468  u2 = find_byuid(av[0]);
1469  av[0] = u2->nick;
1470  do_umode2((u ? u->nick : source), ac, av);
1471  }
1472  return MOD_CONT;
1473 }
1474 
1475 int anope_event_tmode(char *source, int ac, char **av)
1476 {
1477  if (*av[1] == '#' || *av[1] == '&') {
1478  do_cmode(source, ac, av);
1479  }
1480  return MOD_CONT;
1481 }
1482 
1483 void shadowircd_cmd_351(char *source)
1484 {
1485  send_cmd(TS6SID,
1486  "351 %s Anope-%s %s :%s (ShadowProtocol %d) - %s (%s) -- %s",
1487  source, version_number, ServerName, ircd->name,
1489 }
1490 
1491 /* Event: PROTOCTL */
1492 int anope_event_capab(char *source, int ac, char **av)
1493 {
1494  /* Not supported by ShadowIRCd. */
1495  return MOD_CONT;
1496 }
1497 
1498 /* SVSHOLD - set */
1499 void shadowircd_cmd_svshold(char *nick)
1500 {
1501  /* Not supported by this IRCD */
1502 }
1503 
1504 /* SVSHOLD - release */
1506 {
1507  /* Not Supported by this IRCD */
1508 }
1509 
1510 /* SVSNICK */
1511 void shadowircd_cmd_svsnick(char *nick, char *newnick, time_t when)
1512 {
1513  if (!nick || !newnick) {
1514  return;
1515  }
1516  send_cmd(NULL, "SVSNICK %s %s %ld", nick, newnick, (long int) when);
1517 }
1518 
1519 void shadowircd_cmd_guest_nick(char *nick, char *user, char *host,
1520  char *real, char *modes)
1521 {
1522  /* not supported */
1523 }
1524 
1525 void shadowircd_cmd_svso(char *source, char *nick, char *flag)
1526 {
1527  /* Not Supported by this IRCD */
1528 }
1529 
1530 void shadowircd_cmd_unban(char *name, char *nick)
1531 {
1532  /* Not Supported by this IRCD */
1533 }
1534 
1535 /* SVSMODE channel modes */
1536 
1537 void shadowircd_cmd_svsmode_chan(char *name, char *mode, char *nick)
1538 {
1539  /* Not Supported by this IRCD */
1540 }
1541 
1542 /* SVSMODE +d */
1543 /* sent if svid is something weird */
1544 void shadowircd_cmd_svid_umode(char *nick, time_t ts)
1545 {
1546  /* not supported */
1547 }
1548 
1549 /* SVSMODE +d */
1550 /* nc_change was = 1, and there is no na->status */
1552 {
1553  /* not supported */
1554 }
1555 
1556 /* SVSMODE +d */
1558 {
1559  /* not supported */
1560 }
1561 
1563 {
1564  /* not used */
1565 }
1566 
1567 /* NICK <newnick> */
1568 void shadowircd_cmd_chg_nick(char *oldnick, char *newnick)
1569 {
1570  Uid *ud;
1571 
1572  if (!oldnick || !newnick) {
1573  return;
1574  }
1575 
1576  ud = find_uid(oldnick);
1577  if (ud)
1578  strscpy(ud->nick, newnick, NICKMAX);
1579 
1580  send_cmd(oldnick, "NICK %s", newnick);
1581 }
1582 
1583 /*
1584  * SVINFO
1585  * parv[0] = sender prefix
1586  * parv[1] = TS_CURRENT for the server
1587  * parv[2] = TS_MIN for the server
1588  * parv[3] = server is standalone or connected to non-TS only
1589  * parv[4] = server's idea of UTC time
1590  */
1591 int anope_event_svinfo(char *source, int ac, char **av)
1592 {
1593  /* currently not used but removes the message : unknown message from server */
1594  return MOD_CONT;
1595 }
1596 
1597 int anope_event_pass(char *source, int ac, char **av)
1598 {
1599  TS6UPLINK = sstrdup(av[3]);
1600  return MOD_CONT;
1601 }
1602 
1603 void shadowircd_cmd_svsjoin(char *source, char *nick, char *chan, char *param)
1604 {
1605  /* Not Supported by this IRCD */
1606 }
1607 
1608 void shadowircd_cmd_svspart(char *source, char *nick, char *chan)
1609 {
1610  /* Not Supported by this IRCD */
1611 }
1612 
1613 void shadowircd_cmd_swhois(char *source, char *who, char *mask)
1614 {
1615  /* not supported */
1616 }
1617 
1618 int anope_event_notice(char *source, int ac, char **av)
1619 {
1620  return MOD_CONT;
1621 }
1622 
1623 int anope_event_admin(char *source, int ac, char **av)
1624 {
1625  return MOD_CONT;
1626 }
1627 
1628 int anope_event_invite(char *source, int ac, char **av)
1629 {
1630  return MOD_CONT;
1631 }
1632 
1633 int anope_event_bmask(char *source, int ac, char **av)
1634 {
1635  Channel *c;
1636  char *bans;
1637  char *b;
1638  int count, i;
1639 
1640  /* :42X BMASK 1106409026 #ircops b :*!*@*.aol.com */
1641  /* 0 1 2 3 */
1642  c = findchan(av[1]);
1643 
1644  if (c) {
1645  bans = sstrdup(av[3]);
1646  count = myNumToken(bans, ' ');
1647  for (i = 0; i <= count - 1; i++) {
1648  b = myStrGetToken(bans, ' ', i);
1649  if (!stricmp(av[2], "b")) {
1650  add_ban(c, b);
1651  }
1652  if (!stricmp(av[2], "e")) {
1653  add_exception(c, b);
1654  }
1655  if (!stricmp(av[2], "I")) {
1656  add_invite(c, b);
1657  }
1658  if (b)
1659  free(b);
1660  }
1661  free(bans);
1662  }
1663  return MOD_CONT;
1664 }
1665 
1667 {
1668  return 0;
1669 }
1670 
1671 int anope_event_error(char *source, int ac, char **av)
1672 {
1673  if (ac >= 1) {
1674  if (debug) {
1675  alog("debug: %s", av[0]);
1676  }
1677  }
1678  return MOD_CONT;
1679 }
1680 
1681 void shadowircd_cmd_jupe(char *jserver, char *who, char *reason)
1682 {
1683  char rbuf[256];
1684 
1685  snprintf(rbuf, sizeof(rbuf), "Juped by %s%s%s", who,
1686  reason ? ": " : "", reason ? reason : "");
1687 
1688  if (findserver(servlist, jserver))
1689  shadowircd_cmd_squit(jserver, rbuf);
1690  shadowircd_cmd_server(jserver, 2, rbuf);
1691  new_server(me_server, jserver, rbuf, SERVER_JUPED, NULL);
1692 }
1693 
1694 /*
1695  1 = valid nick
1696  0 = nick is in valid
1697 */
1698 int shadowircd_valid_nick(char *nick)
1699 {
1700  /* TS6 Save extension -Certus */
1701  if (isdigit(*nick))
1702  return 0;
1703  return 1;
1704 }
1705 
1706 /*
1707  1 = valid chan
1708  0 = chan is in valid
1709 */
1710 int shadowircd_valid_chan(char *chan)
1711 {
1712  /* no hard coded invalid chan */
1713  return 1;
1714 }
1715 
1716 
1717 void shadowircd_cmd_ctcp(char *source, char *dest, char *buf)
1718 {
1719  char *s;
1720 
1721  if (!buf) {
1722  return;
1723  } else {
1724  s = normalizeBuffer(buf);
1725  }
1726 
1727  send_cmd(source, "NOTICE %s :\1%s \1", dest, s);
1728  free(s);
1729 }
1730 
1736 {
1812 }
1813 
1817 int AnopeInit(int argc, char **argv)
1818 {
1819 
1820  moduleAddAuthor("Anope");
1821  moduleAddVersion(VERSION_STRING);
1823 
1824  pmodule_ircd_version("ShadowIRCd 4.0+");
1825  pmodule_ircd_cap(myIrcdcap);
1826  pmodule_ircd_var(myIrcd);
1827  pmodule_ircd_cbmodeinfos(myCbmodeinfos);
1828  pmodule_ircd_cumodes(myCumodes);
1831  pmodule_ircd_cbmodes(myCbmodes);
1832  pmodule_ircd_cmmodes(myCmmodes);
1835 
1845 
1848 
1849  return MOD_CONT;
1850 }
E void pmodule_cmd_vhost_off(void(*func)(User *u))
Definition: ircd.c:713
void shadowircd_cmd_pass(char *pass)
Definition: shadowircd.c:965
E void pmodule_permchan_mode(int mode)
Definition: ircd.c:1206
void shadowircd_cmd_svsjoin(char *source, char *nick, char *chan, char *param)
Definition: shadowircd.c:1603
E Uid * find_uid(const char *nick)
Definition: users.c:453
void shadowircd_cmd_351(char *source)
Definition: shadowircd.c:1483
E int32 opcnt
Definition: extern.h:1140
E char * RemotePassword3
Definition: extern.h:270
void shadowircd_cmd_ctcp(char *source, char *dest, char *buf)
Definition: shadowircd.c:1717
#define UMODE_e
Definition: bahamut.h:39
E void pmodule_cmd_svspart(void(*func)(char *source, char *nick, char *chan))
Definition: ircd.c:1056
E void do_topic(const char *source, int ac, char **av)
Definition: channels.c:1249
void shadowircd_cmd_privmsg(char *source, char *dest, char *buf)
Definition: shadowircd.c:494
E void do_server(const char *source, char *servername, char *hops, char *descript, char *numeric)
Definition: servers.c:360
void shadowircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes)
Definition: shadowircd.c:999
E void pmodule_cmd_notice2(void(*func)(char *source, char *dest, char *msg))
Definition: ircd.c:798
#define CMODE_z
Definition: charybdis.h:40
void shadowircd_cmd_nc_change(User *u)
Definition: shadowircd.c:1551
E char * RemotePassword
Definition: extern.h:264
int anope_event_sid(char *source, int ac, char **av)
Definition: shadowircd.c:1143
void shadowircd_cmd_svshold(char *nick)
Definition: shadowircd.c:1499
void shadowircd_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes)
Definition: shadowircd.c:1519
void shadowircd_cmd_global_legacy(char *source, char *fmt)
Definition: shadowircd.c:551
CBMode myCbmodes[128]
Definition: shadowircd.c:321
int anope_event_topic(char *source, int ac, char **av)
Definition: shadowircd.c:653
E void pmodule_cmd_bot_chan_mode(void(*func)(char *nick, char *chan))
Definition: ircd.c:827
#define UMODE_E
Definition: shadowircd.h:39
#define UMODE_R
Definition: bahamut.h:42
#define CMODE_T
Definition: inspircd12.h:52
char nick[NICKMAX]
Definition: services.h:875
E void do_squit(const char *source, int ac, char **av)
Definition: servers.c:398
E int snprintf(char *buf, size_t size, const char *fmt,...)
Definition: compat.c:37
int shadowircd_valid_nick(char *nick)
Definition: shadowircd.c:1698
E int anope_event_null(char *source, int ac, char **av)
Definition: messages.c:441
E void pmodule_cmd_351(void(*func)(char *source))
Definition: ircd.c:832
void shadowircd_cmd_307(char *buf)
Definition: shadowircd.c:1234
MDE void updateProtectDetails(char *level_info_protect_word, char *level_info_protectme_word, char *fant_protect_add, char *fant_protect_del, char *level_protect_word, char *protect_set_mode, char *protect_unset_mode)
Definition: modules.c:2512
E char * TS6UPLINK
Definition: extern.h:1159
void shadowircd_cmd_notice_ops(char *source, char *dest, char *buf)
Definition: shadowircd.c:1391
void shadowircd_set_umode(User *user, int ac, char **av)
Definition: shadowircd.c:153
void shadowircd_cmd_nick(char *nick, char *name, char *mode)
Definition: shadowircd.c:1362
void shadowircd_cmd_svskill(char *source, char *user, char *buf)
Definition: shadowircd.c:920
#define UMODE_w
Definition: bahamut.h:21
#define CBM_MINUS_NO_ARG
Definition: services.h:928
E IRCDVar * ircd
Definition: extern.h:39
void shadowircd_cmd_243(char *buf)
Definition: shadowircd.c:1318
E void pmodule_cmd_nick(void(*func)(char *nick, char *name, char *modes))
Definition: ircd.c:756
E void chan_set_key(Channel *chan, char *value)
Definition: channels.c:1998
void shadowircd_cmd_unszline(char *mask)
Definition: shadowircd.c:830
int anope_event_eos(char *source, int ac, char **av)
Definition: shadowircd.c:1154
E void pmodule_ircd_cmmodes(CMMode modes[128])
Definition: ircd.c:1143
void shadowircd_cmd_sqline(char *mask, char *reason)
Definition: shadowircd.c:820
E void do_kick(const char *source, int ac, char **av)
Definition: channels.c:638
unsigned long umodes[128]
Definition: shadowircd.c:198
E void pmodule_cmd_372_error(void(*func)(char *source))
Definition: ircd.c:741
E void do_umode2(const char *source, int ac, char **av)
Definition: users.c:834
#define CMODE_p
Definition: bahamut.h:47
MDE int addCoreMessage(MessageHash *msgTable[], Message *m)
Definition: modules.c:1597
E void pmodule_valid_nick(int(*func)(char *nick))
Definition: ircd.c:1082
E void cs_set_limit(ChannelInfo *ci, char *value)
Definition: chanserv.c:2558
void shadowircd_cmd_unsgline(char *mask)
Definition: shadowircd.c:825
#define CMODE_F
Definition: charybdis.h:42
#define PROTOCOL_REVISION
Definition: shadowircd.h:15
int anope_event_bmask(char *source, int ac, char **av)
Definition: shadowircd.c:1633
int anope_event_invite(char *source, int ac, char **av)
Definition: shadowircd.c:1628
E void pmodule_cmd_kick(void(*func)(char *source, char *chan, char *user, char *buf))
Definition: ircd.c:780
E void send_cmd(const char *source, const char *fmt,...) FORMAT(printf
void shadowircd_cmd_capab()
Definition: shadowircd.c:959
E void send_event(const char *name, int argc,...)
Definition: events.c:37
E void pmodule_cmd_vhost_on(void(*func)(char *nick, char *vIdent, char *vhost))
Definition: ircd.c:966
E void pmodule_cmd_svsjoin(void(*func)(char *source, char *nick, char *chan, char *param))
Definition: ircd.c:1048
E void pmodule_cmd_swhois(void(*func)(char *source, char *who, char *mask))
Definition: ircd.c:1061
E void pmodule_cmd_pong(void(*func)(char *servname, char *who))
Definition: ircd.c:842
E void pmodule_cmd_307(void(*func)(char *buf))
Definition: ircd.c:879
E char * get_limit(Channel *chan)
Definition: channels.c:1881
void shadowircd_cmd_391(char *source, char *timestr)
Definition: shadowircd.c:1215
E void pmodule_cmd_211(void(*func)(char *buf))
Definition: ircd.c:924
IRCDVar myIrcd[]
Definition: shadowircd.c:20
int anope_event_whois(char *source, int ac, char **av)
Definition: shadowircd.c:1116
void shadowircd_cmd_tmode(char *source, char *dest, char *buf)
Definition: shadowircd.c:1352
E void pmodule_cmd_unsqline(void(*func)(char *user))
Definition: ircd.c:853
void shadowircd_cmd_unban(char *name, char *nick)
Definition: shadowircd.c:1530
void shadowircd_cmd_join(char *user, char *channel, time_t chantime)
Definition: shadowircd.c:891
E void pmodule_cmd_sgline(void(*func)(char *mask, char *reason))
Definition: ircd.c:1007
E int stricmp(const char *s1, const char *s2)
Definition: compat.c:58
int anope_event_436(char *source, int ac, char **av)
Definition: shadowircd.c:753
E void pmodule_set_umode(void(*func)(User *user, int ac, char **av))
Definition: ircd.c:1077
E void pmodule_ircd_cap(IRCDCAPAB *cap)
Definition: ircd.c:1102
#define CMODE_l
Definition: bahamut.h:51
char * name
Definition: services.h:277
CUMode myCumodes[128]
Definition: shadowircd.c:415
#define CMODE_N
Definition: inspircd11.h:48
E void pmodule_cmd_nc_change(void(*func)(User *u))
Definition: ircd.c:1028
E void pmodule_cmd_372(void(*func)(char *source, char *msg))
Definition: ircd.c:736
int anope_event_admin(char *source, int ac, char **av)
Definition: shadowircd.c:1623
int anope_event_privmsg(char *source, int ac, char **av)
Definition: shadowircd.c:1086
void shadowircd_cmd_svsinfo()
Definition: shadowircd.c:941
E char * ServerDesc
Definition: extern.h:275
E void pmodule_cmd_bob(void(*func)())
Definition: ircd.c:976
void shadowircd_cmd_372_error(char *source)
Definition: shadowircd.c:1196
E void pmodule_ircd_flood_mode_char_remove(char *mode)
Definition: ircd.c:1130
void shadowircd_cmd_eob()
Definition: shadowircd.c:1060
E void del_invite(Channel *chan, char *mask)
Definition: channels.c:1833
E User * find_byuid(const char *uid)
Definition: users.c:378
E void pmodule_cmd_ctcp(void(*func)(char *source, char *dest, char *buf))
Definition: ircd.c:1043
char topic_setter[NICKMAX]
Definition: services.h:1004
E void pmodule_cmd_invite(void(*func)(char *source, char *chan, char *nick))
Definition: ircd.c:859
E void pmodule_ircd_var(IRCDVar *ircdvar)
Definition: ircd.c:1097
void shadowircd_cmd_svsnoop(char *server, int set)
Definition: shadowircd.c:840
#define UMODE_l
Definition: charybdis.h:24
void shadowircd_cmd_chg_nick(char *oldnick, char *newnick)
Definition: shadowircd.c:1568
int shadowircd_flood_mode_check(char *value)
Definition: shadowircd.c:1666
MDE Message * createMessage(const char *name, int(*func)(char *source, int ac, char **av))
Definition: modules.c:1470
E Uid * find_nickuid(const char *uid)
Definition: users.c:468
int anope_event_nick(char *source, int ac, char **av)
Definition: shadowircd.c:600
void shadowircd_cmd_mode(char *source, char *dest, char *buf)
Definition: shadowircd.c:1337
E void add_invite(Channel *chan, char *mask)
Definition: channels.c:1402
#define CUS_VOICE
Definition: services.h:1342
#define IRCD
Definition: modules.h:63
#define UMODE_g
Definition: bahamut.h:35
#define CMODE_A
Definition: inspircd11.h:35
#define UMODE_i
Definition: bahamut.h:18
E void pmodule_cmd_svsnoop(void(*func)(char *server, int set))
Definition: ircd.c:696
E void pmodule_cmd_squit(void(*func)(char *servname, char *message))
Definition: ircd.c:944
#define CMODE_n
Definition: bahamut.h:46
#define CMODE_R
Definition: bahamut.h:52
E char * strscpy(char *d, const char *s, size_t len)
Definition: db-merger.c:1886
E void pmodule_cmd_unsgline(void(*func)(char *mask))
Definition: ircd.c:991
void shadowircd_cmd_serv_notice(char *source, char *dest, char *msg)
Definition: shadowircd.c:519
void shadowircd_cmd_privmsg2(char *source, char *dest, char *msg)
Definition: shadowircd.c:508
char * uid
Definition: services.h:419
MDE void moduleAddAuthor(const char *author)
Definition: modules.c:1772
E void EnforceQlinedNick(char *nick, char *killer)
Definition: misc.c:837
#define CMODE_t
Definition: bahamut.h:49
E char * cs_get_key(ChannelInfo *ci)
Definition: chanserv.c:2447
MDE void moduleSetType(MODType type)
Definition: modules.c:818
#define CMODE_V
Definition: inspircd11.h:42
E void pmodule_cmd_jupe(void(*func)(char *jserver, char *who, char *reason))
Definition: ircd.c:1072
char * botchanumode
Definition: services.h:299
int anope_event_mode(char *source, int ac, char **av)
Definition: shadowircd.c:1456
E void pmodule_cmd_243(void(*func)(char *buf))
Definition: ircd.c:919
void shadowircd_cmd_invite(char *source, char *chan, char *nick)
Definition: shadowircd.c:1430
E Channel * findchan(const char *chan)
Definition: channels.c:394
E void do_sjoin(const char *source, int ac, char **av)
Definition: channels.c:803
E void anope_set_umode(User *user, int ac, char **av)
Definition: ircd.c:130
E char * sstrdup(const char *s)
Definition: memory.c:105
E void do_join(const char *source, int ac, char **av)
Definition: channels.c:556
int anope_event_motd(char *source, int ac, char **av)
Definition: shadowircd.c:1076
int anope_event_chghost(char *source, int ac, char **av)
Definition: shadowircd.c:634
void shadowircd_cmd_global(char *source, char *buf)
Definition: shadowircd.c:530
int anope_event_squit(char *source, int ac, char **av)
Definition: shadowircd.c:1169
E Uid * new_uid(const char *nick, char *uid)
Definition: users.c:435
void shadowircd_cmd_part(char *nick, char *chan, char *buf)
Definition: shadowircd.c:1012
char * uid
Definition: services.h:890
void shadowircd_cmd_318(char *source, char *who)
Definition: shadowircd.c:1298
E int m_nickcoll(char *user)
Definition: messages.c:20
E void pmodule_cmd_375(void(*func)(char *source))
Definition: ircd.c:746
E void pmodule_key_mode(int mode)
Definition: ircd.c:1196
E void pmodule_cmd_svsnick(void(*func)(char *source, char *guest, time_t when))
Definition: ircd.c:960
E char * s_OperServ
Definition: extern.h:289
void shadowircd_cmd_376(char *source)
Definition: shadowircd.c:1209
E void pmodule_invis_umode(int mode)
Definition: ircd.c:1171
E void pmodule_cmd_svid_umode2(void(*func)(User *u, char *ts))
Definition: ircd.c:1033
E void pmodule_cmd_chg_nick(void(*func)(char *oldnick, char *newnick))
Definition: ircd.c:954
void shadowircd_cmd_svinfo()
Definition: shadowircd.c:954
IRCDCAPAB myIrcdcap[]
Definition: shadowircd.c:120
E char * ServiceHost
Definition: extern.h:277
#define UMODE_x
Definition: bahamut.h:23
int anope_event_error(char *source, int ac, char **av)
Definition: shadowircd.c:1671
#define UMODE_b
Definition: bahamut.h:36
E void record_topic(const char *chan)
Definition: chanserv.c:1645
void moduleAddAnopeCmds()
Definition: shadowircd.c:1735
E char * EncModule
Definition: extern.h:580
E void pmodule_invite_cmode(int mode)
Definition: ircd.c:1181
E int myNumToken(const char *str, const char dilim)
Definition: misc.c:1112
void moduleAddIRCDMsgs(void)
Definition: shadowircd.c:764
#define CMODE_r
Definition: bahamut.h:53
E void pmodule_cmd_eob(void(*func)())
Definition: ircd.c:1066
#define CMODE_O
Definition: bahamut.h:57
E void pmodule_cmd_svid_umode3(void(*func)(User *u, char *ts))
Definition: ircd.c:1038
E void pmodule_cmd_376(void(*func)(char *source))
Definition: ircd.c:751
E char * uplink
Definition: extern.h:35
E char * ts6_uid_retrieve(void)
Definition: servers.c:617
void shadowircd_cmd_notice(char *source, char *dest, char *buf)
Definition: shadowircd.c:464
E User * finduser(const char *nick)
Definition: users.c:323
E int m_kill(char *nick, char *msg)
Definition: messages.c:49
E void pmodule_cmd_part(void(*func)(char *nick, char *chan, char *buf))
Definition: ircd.c:864
void shadowircd_cmd_svid_umode2(User *u, char *ts)
Definition: shadowircd.c:1557
void shadowircd_cmd_312(char *buf)
Definition: shadowircd.c:1254
E int m_away(char *source, char *msg)
Definition: messages.c:29
CBModeInfo myCbmodeinfos[]
Definition: shadowircd.c:387
MDE void moduleAddVersion(const char *version)
Definition: modules.c:1760
#define UMODE_a
Definition: bahamut.h:16
E void add_ban(Channel *chan, char *mask)
Definition: channels.c:1338
E void do_part(const char *source, int ac, char **av)
Definition: channels.c:710
#define CUS_HALFOP
Definition: services.h:1343
E void del_ban(Channel *chan, char *mask)
Definition: channels.c:1779
int anope_event_kick(char *source, int ac, char **av)
Definition: shadowircd.c:1052
char * name
Definition: services.h:854
E char * merge_args(int argc, char **argv)
Definition: misc.c:180
#define CUS_PROTECT
Definition: services.h:1345
E void pmodule_ircd_cumodes(CUMode modes[128])
Definition: ircd.c:1117
E const char version_flags[]
Definition: extern.h:771
void shadowircd_cmd_quit(char *source, char *buf)
Definition: shadowircd.c:1410
void shadowircd_cmd_release_svshold(char *nick)
Definition: shadowircd.c:1505
Command * c
Definition: ns_recover.c:17
void shadowircd_cmd_svid_umode3(User *u, char *ts)
Definition: shadowircd.c:1562
void shadowircd_cmd_jupe(char *jserver, char *who, char *reason)
Definition: shadowircd.c:1681
E int check_valid_admin(User *user, Channel *chan, int servermode)
Definition: chanserv.c:1255
E char * TS6SID
Definition: extern.h:1158
E void alog(const char *fmt,...) FORMAT(printf
int anope_event_svinfo(char *source, int ac, char **av)
Definition: shadowircd.c:1591
E int servernum
Definition: extern.h:615
#define UMODE_u
Definition: hybrid.h:27
void shadowircd_cmd_317(char *buf)
Definition: shadowircd.c:1264
#define MOD_CONT
Definition: modules.h:54
E int UseTS6
Definition: extern.h:364
E int m_motd(char *source)
Definition: messages.c:97
E void pmodule_cmd_svsmode(void(*func)(User *u, int ac, char **av))
Definition: ircd.c:731
E void do_quit(const char *source, int ac, char **av)
Definition: users.c:854
E void pmodule_cmd_bot_nick(void(*func)(char *nick, char *user, char *host, char *real, char *modes))
Definition: ircd.c:773
E void pmodule_private_cmode(int mode)
Definition: ircd.c:1191
void shadowircd_cmd_unsqline(char *user)
Definition: shadowircd.c:886
E void display_news(User *u, int16 type)
Definition: news.c:269
void shadowircd_cmd_pong(char *servname, char *who)
Definition: shadowircd.c:1424
#define CMODE_K
Definition: inspircd11.h:37
E Server * findserver(Server *s, const char *name)
Definition: servers.c:261
int anope_event_ping(char *source, int ac, char **av)
Definition: shadowircd.c:1025
#define CMODE_G
Definition: inspircd11.h:44
E void pmodule_cmd_svid_umode(void(*func)(char *nick, time_t ts))
Definition: ircd.c:1023
E int m_privmsg(char *source, char *receiver, char *msg)
Definition: messages.c:130
void shadowircd_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when)
Definition: shadowircd.c:863
void shadowircd_cmd_notice2(char *source, char *dest, char *msg)
Definition: shadowircd.c:483
E void pmodule_ircd_csmodes(char mode[128])
Definition: ircd.c:1151
E void pmodule_cmd_242(void(*func)(char *buf))
Definition: ircd.c:914
#define NI_MSG
Definition: services.h:1292
char nick[NICKMAX]
Definition: services.h:418
E int debug
Definition: extern.h:775
int anope_event_pass(char *source, int ac, char **av)
Definition: shadowircd.c:1597
void shadowircd_cmd_svsnick(char *nick, char *newnick, time_t when)
Definition: shadowircd.c:1511
#define EVENT_TOPIC_UPDATED
Definition: events.h:30
E void set_limit(Channel *chan, char *value)
Definition: channels.c:2011
E void finish_sync(Server *serv, int sync_links)
Definition: servers.c:531
#define CMODE_L
Definition: charybdis.h:43
E void pmodule_cmd_311(void(*func)(char *buf))
Definition: ircd.c:884
void shadowircd_cmd_svsadmin(char *server, int set)
Definition: shadowircd.c:845
E void pmodule_cmd_join(void(*func)(char *user, char *channel, time_t chantime))
Definition: ircd.c:848
void shadowircd_cmd_vhost_off(User *u)
Definition: shadowircd.c:873
E int NSDefFlags
Definition: extern.h:377
E void del_exception(Channel *chan, char *mask)
Definition: channels.c:1808
E void pmodule_cmd_318(void(*func)(char *source, char *who))
Definition: ircd.c:909
void shadowircd_cmd_401(char *source, char *who)
Definition: shadowircd.c:1289
void shadowircd_cmd_swhois(char *source, char *who, char *mask)
Definition: shadowircd.c:1613
E void pmodule_cmd_250(void(*func)(char *buf))
Definition: ircd.c:874
void shadowircd_cmd_squit(char *servname, char *message)
Definition: shadowircd.c:1447
char * topic
Definition: services.h:1003
int anope_event_capab(char *source, int ac, char **av)
Definition: shadowircd.c:1492
void shadowircd_cmd_bot_chan_mode(char *nick, char *chan)
Definition: shadowircd.c:1400
E void pmodule_ircd_version(char *version)
Definition: ircd.c:1107
E const char version_number[]
Definition: extern.h:767
void shadowircd_cmd_219(char *source, char *letter)
Definition: shadowircd.c:1274
void shadowircd_cmd_svsmode_chan(char *name, char *mode, char *nick)
Definition: shadowircd.c:1537
void shadowircd_cmd_akill(char *user, char *host, char *who, time_t when, time_t expires, char *reason)
Definition: shadowircd.c:909
#define CMODE_m
Definition: bahamut.h:45
E void pmodule_cmd_unszline(void(*func)(char *mask))
Definition: ircd.c:996
E int check_topiclock(Channel *c, time_t topic_time)
Definition: chanserv.c:1721
void shadowircd_cmd_remove_akill(char *user, char *host)
Definition: shadowircd.c:855
E void cs_set_key(ChannelInfo *ci, char *value)
Definition: chanserv.c:2538
E void anope_cmd_mode(char *source, char *dest, const char *fmt,...)
Definition: ircd.c:211
int anope_event_notice(char *source, int ac, char **av)
Definition: shadowircd.c:1618
E void pmodule_cmd_401(void(*func)(char *source, char *who))
Definition: ircd.c:904
E Server * serv_uplink
Definition: extern.h:1053
E int WallOper
Definition: extern.h:448
E void pmodule_cmd_svso(void(*func)(char *source, char *nick, char *flag))
Definition: ircd.c:949
int anope_event_server(char *source, int ac, char **av)
Definition: shadowircd.c:1128
E void pmodule_cmd_serv_privmsg(void(*func)(char *source, char *dest, char *msg))
Definition: ircd.c:821
void shadowircd_cmd_server(char *servname, int hop, char *descript)
Definition: shadowircd.c:971
int anope_event_tmode(char *source, int ac, char **av)
Definition: shadowircd.c:1475
E void pmodule_cmd_317(void(*func)(char *buf))
Definition: ircd.c:894
E void do_cmode(const char *source, int ac, char **av)
Definition: channels.c:1183
int AnopeInit(int argc, char **argv)
Definition: shadowircd.c:1817
E void pmodule_secret_cmode(int mode)
Definition: ircd.c:1186
E void pmodule_cmd_391(void(*func)(char *source, char *timestr))
Definition: ircd.c:869
void shadowircd_cmd_connect(int servernum)
Definition: shadowircd.c:978
#define NICKMAX
Definition: config.h:62
E void pmodule_cmd_remove_akill(void(*func)(char *user, char *host))
Definition: ircd.c:701
E void pmodule_ircd_cbmodes(CBMode modes[128])
Definition: ircd.c:1135
#define SERVER_JUPED
Definition: services.h:866
time_t topic_time
Definition: services.h:1005
void shadowircd_cmd_serv_privmsg(char *source, char *dest, char *msg)
Definition: shadowircd.c:524
void shadowircd_cmd_372(char *source, char *msg)
Definition: shadowircd.c:1191
E void pmodule_cmd_szline(void(*func)(char *mask, char *reason, char *whom))
Definition: ircd.c:1002
E char * myStrGetToken(const char *str, const char dilim, int token_number)
Definition: misc.c:654
E void pmodule_cmd_notice_ops(void(*func)(char *source, char *dest, char *buf))
Definition: ircd.c:787
E void pmodule_cmd_release_svshold(void(*func)(char *nick))
Definition: ircd.c:986
void shadowircd_cmd_250(char *buf)
Definition: shadowircd.c:1224
#define UMODE_A
Definition: bahamut.h:22
E void add_exception(Channel *chan, char *mask)
Definition: channels.c:1377
void shadowircd_cmd_bob()
Definition: shadowircd.c:994
void shadowircd_cmd_242(char *buf)
Definition: shadowircd.c:1308
#define CMODE_k
Definition: bahamut.h:50
E Server * findserver_uid(Server *s, const char *name)
Definition: servers.c:298
E void pmodule_cmd_unban(void(*func)(char *name, char *nick))
Definition: ircd.c:1012
#define CMODE_E
Definition: shadowircd.h:60
E void pmodule_cmd_notice(void(*func)(char *source, char *dest, char *buf))
Definition: ircd.c:792
int anope_event_part(char *source, int ac, char **av)
Definition: shadowircd.c:1102
E Server * servlist
Definition: extern.h:1051
Definition: services.h:416
void shadowircd_cmd_szline(char *mask, char *reason, char *whom)
Definition: shadowircd.c:835
#define DEFAULT_MLOCK
Definition: bahamut.h:59
E void pmodule_cmd_akill(void(*func)(char *user, char *host, char *who, time_t when, time_t expires, char *reason))
Definition: ircd.c:718
char myCsmodes[128]
Definition: shadowircd.c:250
E int check_valid_op(User *user, Channel *chan, int servermode)
Definition: chanserv.c:1290
E char * cs_get_limit(ChannelInfo *ci)
Definition: chanserv.c:2458
#define UMODE_n
Definition: bahamut.h:37
uint32 mode
Definition: services.h:889
void shadowircd_cmd_311(char *buf)
Definition: shadowircd.c:1244
E void pmodule_cmd_guest_nick(void(*func)(char *nick, char *user, char *host, char *real, char *modes))
Definition: ircd.c:761
E char * ServerName
Definition: extern.h:274
#define CMODE_c
Definition: bahamut.h:54
void shadowircd_cmd_svsmode(User *u, int ac, char **av)
Definition: shadowircd.c:936
#define UMODE_G
Definition: inspircd12.h:32
E void pmodule_valid_chan(int(*func)(char *chan))
Definition: ircd.c:1087
E void pmodule_cmd_privmsg(void(*func)(char *source, char *dest, char *buf))
Definition: ircd.c:804
void shadowircd_cmd_svso(char *source, char *nick, char *flag)
Definition: shadowircd.c:1525
E void pmodule_cmd_svshold(void(*func)(char *nick))
Definition: ircd.c:981
#define SERVER_ISME
Definition: services.h:865
CMMode myCmmodes[128]
Definition: shadowircd.c:271
int anope_event_join(char *source, int ac, char **av)
Definition: shadowircd.c:1065
E void pmodule_cmd_serv_notice(void(*func)(char *source, char *dest, char *msg))
Definition: ircd.c:816
int anope_event_away(char *source, int ac, char **av)
Definition: shadowircd.c:1033
int anope_event_tburst(char *source, int ac, char **av)
Definition: shadowircd.c:699
E char * get_key(Channel *chan)
Definition: channels.c:1874
E int m_whois(char *source, char *who)
Definition: messages.c:366
E char * RemotePassword2
Definition: extern.h:267
void shadowircd_cmd_211(char *buf)
Definition: shadowircd.c:1328
E void pmodule_cmd_topic(void(*func)(char *whosets, char *chan, char *whosetit, char *topic, time_t when))
Definition: ircd.c:706
E void pmodule_cmd_quit(void(*func)(char *source, char *buf))
Definition: ircd.c:837
E char * ServiceUser
Definition: extern.h:276
E Server * me_server
Definition: extern.h:1052
int anope_event_quit(char *source, int ac, char **av)
Definition: shadowircd.c:1177
E void pmodule_ircd_useTSMode(int use)
Definition: ircd.c:1164
E void pmodule_oper_umode(int mode)
Definition: ircd.c:1176
E Server * new_server(Server *uplink, const char *name, const char *desc, uint16 flags, char *suid)
Definition: servers.c:119
E void pmodule_flood_mode_check(int(*func)(char *value))
Definition: ircd.c:1092
#define NEWS_OPER
Definition: services.h:1050
int shadowircd_valid_chan(char *chan)
Definition: shadowircd.c:1710
E void pmodule_ircd_cbmodeinfos(CBModeInfo *modeinfos)
Definition: ircd.c:1112
void shadowircd_cmd_sgline(char *mask, char *reason)
Definition: shadowircd.c:850
E void pmodule_cmd_sqline(void(*func)(char *mask, char *reason))
Definition: ircd.c:939
E void pmodule_cmd_privmsg2(void(*func)(char *source, char *dest, char *msg))
Definition: ircd.c:810
E User * do_nick(const char *source, char *nick, char *username, char *host, char *server, char *realname, time_t ts, uint32 svid, uint32 ip, char *vhost, char *uid)
Definition: users.c:500
E void pmodule_cmd_connect(void(*func)(int servernum))
Definition: ircd.c:971
E void pmodule_cmd_global_legacy(void(*func)(char *source, char *fmt))
Definition: ircd.c:934
E void pmodule_cmd_mode(void(*func)(char *source, char *dest, char *buf))
Definition: ircd.c:768
E void pmodule_limit_mode(int mode)
Definition: ircd.c:1201
#define CMODE_i
Definition: bahamut.h:44
#define CMODE_S
Definition: hybrid.h:46
E char * Numeric
Definition: extern.h:362
E void pmodule_cmd_svskill(void(*func)(char *source, char *user, char *buf))
Definition: ircd.c:726
E void pmodule_cmd_svsmode_chan(void(*func)(char *name, char *mode, char *nick))
Definition: ircd.c:1018
E void pmodule_ircd_flood_mode_char_set(char *mode)
Definition: ircd.c:1125
void shadowircd_cmd_svid_umode(char *nick, time_t ts)
Definition: shadowircd.c:1544
int anope_event_kill(char *source, int ac, char **av)
Definition: shadowircd.c:1043
E void pmodule_cmd_312(void(*func)(char *buf))
Definition: ircd.c:889
E const char version_build[]
Definition: extern.h:769
void shadowircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost)
Definition: shadowircd.c:878
E void change_user_host(User *user, const char *host)
Definition: users.c:129
#define CMODE_s
Definition: bahamut.h:48
#define CUS_OP
Definition: services.h:1341
void shadowircd_cmd_375(char *source)
Definition: shadowircd.c:1203
E char * normalizeBuffer(char *)
Definition: botserv.c:1101
int anope_event_sjoin(char *source, int ac, char **av)
Definition: shadowircd.c:569
#define CMODE_P
Definition: charybdis.h:38
E void anope_cmd_global(char *source, const char *fmt,...)
Definition: ircd.c:506
E void pmodule_cmd_global(void(*func)(char *source, char *buf))
Definition: ircd.c:929
#define UMODE_d
Definition: bahamut.h:34
#define CUF_PROTECT_BOTSERV
Definition: services.h:956
#define UMODE_O
Definition: bahamut.h:28
void shadowircd_cmd_kick(char *source, char *chan, char *user, char *buf)
Definition: shadowircd.c:1374
#define UMODE_o
Definition: bahamut.h:19
E void pmodule_cmd_219(void(*func)(char *source, char *letter))
Definition: ircd.c:899
void shadowircd_cmd_svspart(char *source, char *nick, char *chan)
Definition: shadowircd.c:1608