1 /* hash.c - IRC network state database
2 * Copyright 2000-2004 srvx Development Team
4 * This file is part of x3.
6 * x3 is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with srvx; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 #if defined(HAVE_LIBGEOIP)&&defined(HAVE_GEOIP_H)&&defined(HAVE_GEOIPCITY_H)
28 #include <GeoIPCity.h>
38 unsigned int max_clients
, invis_clients
;
39 time_t max_clients_time
;
40 struct userList curr_opers
;
42 static void hash_cleanup(void);
44 void init_structs(void)
46 channels
= dict_new();
49 userList_init(&curr_opers
);
50 reg_exit_func(hash_cleanup
);
53 server_link_func_t
*slf_list
;
54 unsigned int slf_size
= 0, slf_used
= 0;
57 reg_server_link_func(server_link_func_t handler
)
59 if (slf_used
== slf_size
) {
62 slf_list
= realloc(slf_list
, slf_size
*sizeof(server_link_func_t
));
65 slf_list
= malloc(slf_size
*sizeof(server_link_func_t
));
68 slf_list
[slf_used
++] = handler
;
72 GetServerH(const char *name
)
74 return dict_find(servers
, name
, NULL
);
77 new_user_func_t
*nuf_list
;
78 unsigned int nuf_size
= 0, nuf_used
= 0;
81 reg_new_user_func(new_user_func_t handler
)
83 if (nuf_used
== nuf_size
) {
86 nuf_list
= realloc(nuf_list
, nuf_size
*sizeof(new_user_func_t
));
89 nuf_list
= malloc(nuf_size
*sizeof(new_user_func_t
));
92 nuf_list
[nuf_used
++] = handler
;
95 static nick_change_func_t
*ncf2_list
;
96 static unsigned int ncf2_size
= 0, ncf2_used
= 0;
99 reg_nick_change_func(nick_change_func_t handler
)
101 if (ncf2_used
== ncf2_size
) {
104 ncf2_list
= realloc(ncf2_list
, ncf2_size
*sizeof(nick_change_func_t
));
107 ncf2_list
= malloc(ncf2_size
*sizeof(nick_change_func_t
));
110 ncf2_list
[ncf2_used
++] = handler
;
114 del_user_func_t
*duf_list
;
115 unsigned int duf_size
= 0, duf_used
= 0;
118 reg_del_user_func(del_user_func_t handler
)
120 if (duf_used
== duf_size
) {
123 duf_list
= realloc(duf_list
, duf_size
*sizeof(del_user_func_t
));
126 duf_list
= malloc(duf_size
*sizeof(del_user_func_t
));
129 duf_list
[duf_used
++] = handler
;
133 unreg_del_user_func(del_user_func_t handler
)
136 for (i
=0; i
<duf_used
; i
++) {
137 if (duf_list
[i
] == handler
) break;
139 if (i
== duf_used
) return;
140 memmove(duf_list
+i
, duf_list
+i
+1, (duf_used
-i
-1)*sizeof(duf_list
[0]));
144 /* reintroduces a user after it has been killed. */
146 ReintroduceUser(struct userNode
*user
)
148 struct mod_chanmode change
;
152 mod_chanmode_init(&change
);
154 for (n
= 0; n
< user
->channels
.used
; n
++) {
155 struct modeNode
*mn
= user
->channels
.list
[n
];
156 irc_join(user
, mn
->channel
);
158 change
.args
[0].mode
= mn
->modes
;
159 change
.args
[0].u
.member
= mn
;
160 mod_chanmode_announce(user
, mn
->channel
, &change
);
166 NickChange(struct userNode
* user
, const char *new_nick
, int no_announce
)
171 /* don't do anything if there's no change */
172 old_nick
= user
->nick
;
173 if (!strncmp(new_nick
, old_nick
, NICKLEN
))
176 /* remove old entry from clients dictionary */
177 dict_remove(clients
, old_nick
);
178 #if !defined(WITH_PROTOCOL_P10)
179 /* Remove from uplink's clients dict */
180 dict_remove(user
->uplink
->users
, old_nick
);
183 user
->nick
= strdup(new_nick
);
184 dict_insert(clients
, user
->nick
, user
);
185 #if !defined(WITH_PROTOCOL_P10)
186 dict_insert(user
->uplink
->users
, user
->nick
, user
);
189 /* Make callbacks for nick changes. Do this with new nick in
190 * place because that is slightly more useful.
192 for (nn
=0; nn
<ncf2_used
; nn
++)
193 ncf2_list
[nn
](user
, old_nick
);
194 user
->timestamp
= now
;
195 if (IsLocal(user
) && !no_announce
)
196 irc_nick(user
, old_nick
);
201 GetUserH(const char *nick
)
203 return dict_find(clients
, nick
, NULL
);
206 static account_func_t account_func
;
209 reg_account_func(account_func_t handler
)
212 log_module(MAIN_LOG
, LOG_WARNING
, "Reregistering ACCOUNT handler.");
214 account_func
= handler
;
218 call_account_func(struct userNode
*user
, const char *stamp
)
220 /* We've received an account stamp for a user; notify
221 NickServ, which registers the sole account_func
224 P10 Protocol violation if (user->modes & FLAGS_STAMPED) here.
227 account_func(user
, stamp
);
229 #ifdef WITH_PROTOCOL_P10
230 /* Mark the user so we don't stamp it again. */
231 user
->modes
|= FLAGS_STAMPED
;
236 StampUser(struct userNode
*user
, const char *stamp
, time_t timestamp
)
238 #ifdef WITH_PROTOCOL_P10
239 /* The P10 protocol says we can't stamp users who already
245 irc_account(user
, stamp
, timestamp
);
246 user
->modes
|= FLAGS_STAMPED
;
250 assign_fakehost(struct userNode
*user
, const char *host
, int announce
)
252 safestrncpy(user
->fakehost
, host
, sizeof(user
->fakehost
));
254 irc_fakehost(user
, host
);
258 set_geoip_info(struct userNode
*user
)
260 /* Need the libs and the headers if this is going to compile properly */
261 #if defined(HAVE_LIBGEOIP)&&defined(HAVE_GEOIP_H)&&defined(HAVE_GEOIPCITY_H)
263 const char *geoip_data_file
= NULL
;
264 const char *geoip_city_file
= NULL
;
266 geoip_data_file
= conf_get_data("services/opserv/geoip_data_file", RECDB_QSTRING
);
267 geoip_city_file
= conf_get_data("services/opserv/geoip_city_data_file", RECDB_QSTRING
);
269 if ((!geoip_data_file
&& !geoip_city_file
) || IsLocal(user
))
270 return; /* Admin doesnt want to use geoip functions */
272 if (geoip_data_file
&& !gi
)
273 gi
= GeoIP_open(geoip_data_file
, GEOIP_MEMORY_CACHE
| GEOIP_CHECK_CACHE
);
275 if (geoip_city_file
&& !cgi
)
276 cgi
= GeoIP_open(geoip_city_file
, GEOIP_MEMORY_CACHE
| GEOIP_CHECK_CACHE
);
279 gir
= GeoIP_record_by_name(cgi
, user
->hostname
);
281 user
->country_name
= strdup(gir
->country_name
? gir
->country_name
: "");
282 user
->country_code
= strdup(gir
->country_code
? gir
->country_code
: "");
283 user
->city
= strdup(gir
->city
? gir
->city
: "");
284 user
->region
= strdup(gir
->region
? gir
->region
: "");
285 user
->postal_code
= strdup(gir
->postal_code
? gir
->postal_code
: "");
287 user
->latitude
= gir
->latitude
? gir
->latitude
: 0;
288 user
->longitude
= gir
->longitude
? gir
->longitude
: 0;
289 user
->dma_code
= gir
->dma_code
? gir
->dma_code
: 0;
290 user
->area_code
= gir
->area_code
? gir
->area_code
: 0;
292 GeoIPRecord_delete(gir
);
297 const char *country
= GeoIP_country_name_by_name(gi
, user
->hostname
);
298 user
->country_name
= strdup(country
? country
: "");
306 static new_channel_func_t
*ncf_list
;
307 static unsigned int ncf_size
= 0, ncf_used
= 0;
310 reg_new_channel_func(new_channel_func_t handler
)
312 if (ncf_used
== ncf_size
) {
315 ncf_list
= realloc(ncf_list
, ncf_size
*sizeof(ncf_list
[0]));
318 ncf_list
= malloc(ncf_size
*sizeof(ncf_list
[0]));
321 ncf_list
[ncf_used
++] = handler
;
324 static join_func_t
*jf_list
;
325 static unsigned int jf_size
= 0, jf_used
= 0;
328 reg_join_func(join_func_t handler
)
330 if (jf_used
== jf_size
) {
333 jf_list
= realloc(jf_list
, jf_size
*sizeof(join_func_t
));
336 jf_list
= malloc(jf_size
*sizeof(join_func_t
));
339 jf_list
[jf_used
++] = handler
;
345 wipeout_channel(struct chanNode
*cNode
, time_t new_time
, char **modes
, unsigned int modec
) {
346 unsigned int orig_limit
;
347 chan_mode_t orig_modes
;
348 char orig_key
[KEYLEN
+1];
349 char orig_apass
[KEYLEN
+1];
350 char orig_upass
[KEYLEN
+1];
351 unsigned int nn
, argc
;
354 cNode
->topic
[0] = '\0';
355 cNode
->topic_nick
[0] = '\0';
356 cNode
->topic_time
= 0;
358 /* remember the old modes, and update them with the new */
359 orig_modes
= cNode
->modes
;
360 orig_limit
= cNode
->limit
;
361 strcpy(orig_key
, cNode
->key
);
362 strcpy(orig_upass
, cNode
->upass
);
363 strcpy(orig_apass
, cNode
->apass
);
365 mod_chanmode(NULL
, cNode
, modes
, modec
, 0);
366 cNode
->timestamp
= new_time
;
368 /* remove our old ban list, replace it with the new one */
369 for (nn
=0; nn
<cNode
->banlist
.used
; nn
++)
370 free(cNode
->banlist
.list
[nn
]);
371 cNode
->banlist
.used
= 0;
373 /* remove our old exe,[t list, replace it with the new one */
374 for (nn
=0; nn
<cNode
->exemptlist
.used
; nn
++)
375 free(cNode
->exemptlist
.list
[nn
]);
376 cNode
->exemptlist
.used
= 0;
378 /* deop anybody in the channel now, but count services to reop */
379 for (nn
=argc
=0; nn
<cNode
->members
.used
; nn
++) {
380 struct modeNode
*mn
= cNode
->members
.list
[nn
];
381 if ((mn
->modes
& MODE_CHANOP
) && IsService(mn
->user
) && IsLocal(mn
->user
))
386 struct mod_chanmode
*change
;
388 change
= mod_chanmode_alloc(argc
);
389 change
->modes_clear
= 0;
390 change
->modes_set
= orig_modes
;
391 change
->new_limit
= orig_limit
;
392 strcpy(change
->new_key
, orig_key
);
393 strcpy(change
->new_upass
, orig_upass
);
394 strcpy(change
->new_apass
, orig_apass
);
395 for (nn
= argc
= 0; nn
< cNode
->members
.used
; ++nn
) {
396 struct modeNode
*mn
= cNode
->members
.list
[nn
];
397 if ((mn
->modes
& MODE_CHANOP
) && IsService(mn
->user
) && IsLocal(mn
->user
)) {
398 change
->args
[argc
].mode
= MODE_CHANOP
;
399 change
->args
[argc
].u
.member
= mn
;
403 assert(argc
== change
->argc
);
404 change
->args
[0].u
.member
->modes
&= ~MODE_CHANOP
;
405 mod_chanmode_announce(change
->args
[0].u
.member
->user
, cNode
, change
);
406 mod_chanmode_free(change
);
411 AddChannel(const char *name
, time_t time_
, const char *modes
, char *banlist
, char *exemptlist
)
413 struct chanNode
*cNode
;
414 char new_modes
[MAXLEN
], *argv
[MAXNUMPARAMS
];
417 if (!IsChannelName(name
)) {
418 log_module(MAIN_LOG
, LOG_ERROR
, "Somebody asked to add channel '%s', which isn't a channel name!", name
);
424 safestrncpy(new_modes
, modes
, sizeof(new_modes
));
425 nn
= split_line(new_modes
, 0, ArrayLength(argv
), argv
);
426 if (!(cNode
= GetChannel(name
))) {
427 cNode
= calloc(1, sizeof(*cNode
) + strlen(name
));
428 strcpy(cNode
->name
, name
);
429 banList_init(&cNode
->banlist
);
430 exemptList_init(&cNode
->exemptlist
);
431 modeList_init(&cNode
->members
);
432 mod_chanmode(NULL
, cNode
, argv
, nn
, MCP_FROM_SERVER
);
433 dict_insert(channels
, cNode
->name
, cNode
);
434 cNode
->timestamp
= time_
;
436 } else if (cNode
->timestamp
> time_
) {
437 wipeout_channel(cNode
, time_
, argv
, nn
);
439 } else if (cNode
->timestamp
== time_
) {
440 mod_chanmode(NULL
, cNode
, argv
, nn
, MCP_FROM_SERVER
);
446 /* rel_age is the relative ages of our channel data versus what is
447 * in a BURST command. 1 means ours is younger, 0 means both are
448 * the same age, -1 means ours is older. */
450 /* if it's a new or updated channel, make callbacks */
452 for (nn
=0; nn
<ncf_used
; nn
++)
455 /* go through list of bans and add each one */
456 if (banlist
&& (rel_age
>= 0)) {
457 for (nn
=0; banlist
[nn
];) {
458 char *ban
= banlist
+ nn
;
460 while (banlist
[nn
] != ' ' && banlist
[nn
])
462 while (banlist
[nn
] == ' ')
464 bn
= calloc(1, sizeof(*bn
));
465 safestrncpy(bn
->ban
, ban
, sizeof(bn
->ban
));
466 safestrncpy(bn
->who
, "<unknown>", sizeof(bn
->who
));
468 banList_append(&cNode
->banlist
, bn
);
472 /* go through list of exempts and add each one */
473 if (exemptlist
&& (rel_age
>= 0)) {
474 for (nn
=0; exemptlist
[nn
];) {
475 char *exempt
= exemptlist
+ nn
;
476 struct exemptNode
*en
;
477 while (exemptlist
[nn
] != ' ' && exemptlist
[nn
])
479 while (exemptlist
[nn
] == ' ')
480 exemptlist
[nn
++] = 0;
481 en
= calloc(1, sizeof(*en
));
482 safestrncpy(en
->exempt
, exempt
, sizeof(en
->exempt
));
483 safestrncpy(en
->who
, "<unknown>", sizeof(en
->who
));
485 exemptList_append(&cNode
->exemptlist
, en
);
492 static del_channel_func_t
*dcf_list
;
493 static unsigned int dcf_size
= 0, dcf_used
= 0;
496 reg_del_channel_func(del_channel_func_t handler
)
498 if (dcf_used
== dcf_size
) {
501 dcf_list
= realloc(dcf_list
, dcf_size
*sizeof(dcf_list
[0]));
504 dcf_list
= malloc(dcf_size
*sizeof(dcf_list
[0]));
507 dcf_list
[dcf_used
++] = handler
;
511 DelChannel(struct chanNode
*channel
)
515 dict_remove(channels
, channel
->name
);
517 if (channel
->members
.used
|| channel
->locks
) {
518 log_module(MAIN_LOG
, LOG_ERROR
, "Warning: deleting channel %s with %d users and %d locks remaining.", channel
->name
, channel
->members
.used
, channel
->locks
);
521 /* go through all channel members and delete them from the channel */
522 for (n
=channel
->members
.used
; n
>0; )
523 DelChannelUser(channel
->members
.list
[--n
]->user
, channel
, false, 1);
525 /* delete all channel bans */
526 for (n
=channel
->banlist
.used
; n
>0; )
527 free(channel
->banlist
.list
[--n
]);
528 channel
->banlist
.used
= 0;
530 /* delete all channel exempts */
531 for (n
=channel
->exemptlist
.used
; n
>0; )
532 free(channel
->exemptlist
.list
[--n
]);
533 channel
->exemptlist
.used
= 0;
535 for (n
=0; n
<dcf_used
; n
++)
536 dcf_list
[n
](channel
);
538 modeList_clean(&channel
->members
);
539 banList_clean(&channel
->banlist
);
540 exemptList_clean(&channel
->exemptlist
);
545 AddChannelUser(struct userNode
*user
, struct chanNode
* channel
)
547 struct modeNode
*mNode
;
550 mNode
= GetUserMode(channel
, user
);
554 mNode
= malloc(sizeof(*mNode
));
556 /* set up modeNode */
557 mNode
->channel
= channel
;
561 mNode
->idle_since
= now
;
563 /* Add modeNode to channel and to user.
564 * We have to do this before calling join funcs in case the
565 * modeNode is manipulated (e.g. chanserv ops the user).
567 modeList_append(&channel
->members
, mNode
);
568 modeList_append(&user
->channels
, mNode
);
570 if (channel
->members
.used
== 1
571 && !(channel
->modes
& MODE_REGISTERED
)
572 && !(channel
->modes
& MODE_APASS
))
573 mNode
->modes
|= MODE_CHANOP
;
575 for (n
=0; n
<jf_used
; n
++) {
576 /* Callbacks return true if they kick or kill the user,
577 * and we can continue without removing mNode. */
578 if (jf_list
[n
](mNode
))
583 irc_join(user
, channel
);
588 static part_func_t
*pf_list
;
589 static unsigned int pf_size
= 0, pf_used
= 0;
592 reg_part_func(part_func_t handler
)
594 if (pf_used
== pf_size
) {
597 pf_list
= realloc(pf_list
, pf_size
*sizeof(part_func_t
));
600 pf_list
= malloc(pf_size
*sizeof(part_func_t
));
603 pf_list
[pf_used
++] = handler
;
607 unreg_part_func(part_func_t handler
)
610 for (i
=0; i
<pf_used
; i
++)
611 if (pf_list
[i
] == handler
)
615 memmove(pf_list
+i
, pf_list
+i
+1, (pf_used
-i
-1)*sizeof(pf_list
[0]));
620 LockChannel(struct chanNode
* channel
)
626 UnlockChannel(struct chanNode
*channel
)
628 assert(channel
->locks
> 0);
629 if (!--channel
->locks
&& !channel
->members
.used
)
634 DelChannelUser(struct userNode
* user
, struct chanNode
* channel
, const char *reason
, int deleting
)
636 struct modeNode
* mNode
;
640 irc_part(user
, channel
, reason
);
642 mNode
= GetUserMode(channel
, user
);
644 /* Sometimes we get a PART when the user has been KICKed.
645 * In this case, we get no usermode, and should not try to free it.
650 /* remove modeNode from channel and user */
651 modeList_remove(&channel
->members
, mNode
);
652 modeList_remove(&user
->channels
, mNode
);
655 for (n
=0; n
<pf_used
; n
++)
656 pf_list
[n
](mNode
, reason
);
661 /* A single check for APASS only should be enough here */
662 if (!deleting
&& !channel
->members
.used
&& !channel
->locks
663 && !(channel
->modes
& MODE_REGISTERED
) && !(channel
->modes
& MODE_APASS
))
667 static kick_func_t
*kf_list
;
668 static unsigned int kf_size
= 0, kf_used
= 0;
671 KickChannelUser(struct userNode
* target
, struct chanNode
* channel
, struct userNode
*kicker
, const char *why
)
675 if (!target
|| !channel
|| IsService(target
) || !GetUserMode(channel
, target
))
678 /* This may break things, but lets see.. -Rubin */
679 for (n
=0; n
<kf_used
; n
++)
680 kf_list
[n
](kicker
, target
, channel
);
682 /* don't remove them from the channel, since the server will send a PART */
683 irc_kick(kicker
, target
, channel
, why
);
687 /* NULL reason because we don't want a PART message to be
688 sent by DelChannelUser. */
689 DelChannelUser(target
, channel
, NULL
, 0);
694 reg_kick_func(kick_func_t handler
)
696 if (kf_used
== kf_size
) {
699 kf_list
= realloc(kf_list
, kf_size
*sizeof(kick_func_t
));
702 kf_list
= malloc(kf_size
*sizeof(kick_func_t
));
705 kf_list
[kf_used
++] = handler
;
709 ChannelUserKicked(struct userNode
* kicker
, struct userNode
* victim
, struct chanNode
* channel
)
714 if (!victim
|| !channel
|| IsService(victim
) || !GetUserMode(channel
, victim
))
717 /* Update the kicker's idle time (kicker may be null if it was a server) */
718 if (kicker
&& (mn
= GetUserMode(channel
, kicker
)))
719 mn
->idle_since
= now
;
721 for (n
=0; n
<kf_used
; n
++)
722 kf_list
[n
](kicker
, victim
, channel
);
724 DelChannelUser(victim
, channel
, 0, 0);
727 irc_part(victim
, channel
, NULL
);
730 int ChannelBanExists(struct chanNode
*channel
, const char *ban
)
734 for (n
= 0; n
< channel
->banlist
.used
; n
++)
735 if (match_ircglobs(channel
->banlist
.list
[n
]->ban
, ban
))
740 int ChannelExemptExists(struct chanNode
*channel
, const char *exempt
)
744 for (n
= 0; n
< channel
->exemptlist
.used
; n
++)
745 if (match_ircglobs(channel
->exemptlist
.list
[n
]->exempt
, exempt
))
750 static topic_func_t
*tf_list
;
751 static unsigned int tf_size
= 0, tf_used
= 0;
754 reg_topic_func(topic_func_t handler
)
756 if (tf_used
== tf_size
) {
759 tf_list
= realloc(tf_list
, tf_size
*sizeof(topic_func_t
));
762 tf_list
= malloc(tf_size
*sizeof(topic_func_t
));
765 tf_list
[tf_used
++] = handler
;
769 SetChannelTopic(struct chanNode
*channel
, struct userNode
*service
, struct userNode
*user
, const char *topic
, int announce
)
773 char old_topic
[TOPICLEN
+1];
775 safestrncpy(old_topic
, channel
->topic
, sizeof(old_topic
));
776 safestrncpy(channel
->topic
, topic
, sizeof(channel
->topic
));
777 channel
->topic_time
= now
;
780 safestrncpy(channel
->topic_nick
, user
->nick
, sizeof(channel
->topic_nick
));
782 /* Update the setter's idle time */
783 if ((mn
= GetUserMode(channel
, user
)))
784 mn
->idle_since
= now
;
788 /* We don't really care if a local user messes with the topic,
789 * so don't call the tf_list functions. */
790 irc_topic(service
, user
, channel
, topic
);
792 for (n
=0; n
<tf_used
; n
++)
793 if (tf_list
[n
](user
, channel
, old_topic
))
799 GetChannel(const char *name
)
801 return dict_find(channels
, name
, NULL
);
805 GetUserMode(struct chanNode
*channel
, struct userNode
*user
)
808 struct modeNode
*mn
= NULL
;
811 verify(channel
->members
.list
);
813 verify(user
->channels
.list
);
814 if (channel
->members
.used
< user
->channels
.used
) {
815 for (n
=0; n
<channel
->members
.used
; n
++) {
816 verify(channel
->members
.list
[n
]);
817 if (user
== channel
->members
.list
[n
]->user
) {
818 mn
= channel
->members
.list
[n
];
823 for (n
=0; n
<user
->channels
.used
; n
++) {
824 verify(user
->channels
.list
[n
]);
825 if (channel
== user
->channels
.list
[n
]->channel
) {
826 mn
= user
->channels
.list
[n
];
834 struct userNode
*IsInChannel(struct chanNode
*channel
, struct userNode
*user
)
839 verify(channel
->members
.list
);
841 verify(user
->channels
.list
);
842 if (channel
->members
.used
< user
->channels
.used
) {
843 for (n
=0; n
<channel
->members
.used
; n
++) {
844 verify(channel
->members
.list
[n
]);
845 if (user
== channel
->members
.list
[n
]->user
) {
850 for (n
=0; n
<user
->channels
.used
; n
++) {
851 verify(user
->channels
.list
[n
]);
852 if (channel
== user
->channels
.list
[n
]->channel
) {
860 DEFINE_LIST(userList
, struct userNode
*)
861 DEFINE_LIST(modeList
, struct modeNode
*)
862 DEFINE_LIST(banList
, struct banNode
*)
863 DEFINE_LIST(exemptList
, struct exemptNode
*)
864 DEFINE_LIST(channelList
, struct chanNode
*)
865 DEFINE_LIST(serverList
, struct server
*)
870 dict_iterator_t it
, next
;
872 DelServer(self
, 0, NULL
);
873 for (it
= dict_first(channels
); it
; it
= next
) {
874 next
= iter_next(it
);
875 DelChannel(iter_data(it
));
877 dict_delete(channels
);
878 dict_delete(clients
);
879 dict_delete(servers
);
880 userList_clean(&curr_opers
);