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 3 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
)
262 /* Need the libs and the headers if this is going to compile properly */
263 #if defined(HAVE_LIBGEOIP)&&defined(HAVE_GEOIP_H)&&defined(HAVE_GEOIPCITY_H)
265 const char *geoip_data_file
= NULL
;
266 const char *geoip_city_file
= NULL
;
268 geoip_data_file
= conf_get_data("services/opserv/geoip_data_file", RECDB_QSTRING
);
269 geoip_city_file
= conf_get_data("services/opserv/geoip_city_data_file", RECDB_QSTRING
);
271 if ((!geoip_data_file
&& !geoip_city_file
))
272 return; /* Admin doesnt want to use geoip functions */
274 if (geoip_data_file
&& !gi
)
275 gi
= GeoIP_open(geoip_data_file
, GEOIP_MEMORY_CACHE
| GEOIP_CHECK_CACHE
);
277 if (geoip_city_file
&& !cgi
)
278 cgi
= GeoIP_open(geoip_city_file
, GEOIP_MEMORY_CACHE
| GEOIP_CHECK_CACHE
);
281 gir
= GeoIP_record_by_name(cgi
, user
->hostname
);
283 user
->country_name
= strdup(gir
->country_name
? gir
->country_name
: "");
284 user
->country_code
= strdup(gir
->country_code
? gir
->country_code
: "");
285 user
->city
= strdup(gir
->city
? gir
->city
: "");
286 user
->region
= strdup(gir
->region
? gir
->region
: "");
287 user
->postal_code
= strdup(gir
->postal_code
? gir
->postal_code
: "");
289 user
->latitude
= gir
->latitude
? gir
->latitude
: 0;
290 user
->longitude
= gir
->longitude
? gir
->longitude
: 0;
291 user
->dma_code
= gir
->dma_code
? gir
->dma_code
: 0;
292 user
->area_code
= gir
->area_code
? gir
->area_code
: 0;
294 GeoIPRecord_delete(gir
);
299 const char *country
= GeoIP_country_name_by_name(gi
, user
->hostname
);
300 user
->country_name
= strdup(country
? country
: "");
308 static new_channel_func_t
*ncf_list
;
309 static unsigned int ncf_size
= 0, ncf_used
= 0;
312 reg_new_channel_func(new_channel_func_t handler
)
314 if (ncf_used
== ncf_size
) {
317 ncf_list
= realloc(ncf_list
, ncf_size
*sizeof(ncf_list
[0]));
320 ncf_list
= malloc(ncf_size
*sizeof(ncf_list
[0]));
323 ncf_list
[ncf_used
++] = handler
;
326 static join_func_t
*jf_list
;
327 static unsigned int jf_size
= 0, jf_used
= 0;
330 reg_join_func(join_func_t handler
)
332 if (jf_used
== jf_size
) {
335 jf_list
= realloc(jf_list
, jf_size
*sizeof(join_func_t
));
338 jf_list
= malloc(jf_size
*sizeof(join_func_t
));
341 jf_list
[jf_used
++] = handler
;
347 wipeout_channel(struct chanNode
*cNode
, time_t new_time
, char **modes
, unsigned int modec
) {
348 unsigned int orig_limit
;
349 chan_mode_t orig_modes
;
350 char orig_key
[KEYLEN
+1];
351 char orig_apass
[KEYLEN
+1];
352 char orig_upass
[KEYLEN
+1];
353 unsigned int nn
, argc
;
356 cNode
->topic
[0] = '\0';
357 cNode
->topic_nick
[0] = '\0';
358 cNode
->topic_time
= 0;
360 /* remember the old modes, and update them with the new */
361 orig_modes
= cNode
->modes
;
362 orig_limit
= cNode
->limit
;
363 strcpy(orig_key
, cNode
->key
);
364 strcpy(orig_upass
, cNode
->upass
);
365 strcpy(orig_apass
, cNode
->apass
);
367 mod_chanmode(NULL
, cNode
, modes
, modec
, 0);
368 cNode
->timestamp
= new_time
;
370 /* remove our old ban list, replace it with the new one */
371 for (nn
=0; nn
<cNode
->banlist
.used
; nn
++)
372 free(cNode
->banlist
.list
[nn
]);
373 cNode
->banlist
.used
= 0;
375 /* remove our old exe,[t list, replace it with the new one */
376 for (nn
=0; nn
<cNode
->exemptlist
.used
; nn
++)
377 free(cNode
->exemptlist
.list
[nn
]);
378 cNode
->exemptlist
.used
= 0;
380 /* deop anybody in the channel now, but count services to reop */
381 for (nn
=argc
=0; nn
<cNode
->members
.used
; nn
++) {
382 struct modeNode
*mn
= cNode
->members
.list
[nn
];
383 if ((mn
->modes
& MODE_CHANOP
) && IsService(mn
->user
) && IsLocal(mn
->user
))
388 struct mod_chanmode
*change
;
390 change
= mod_chanmode_alloc(argc
);
391 change
->modes_clear
= 0;
392 change
->modes_set
= orig_modes
;
393 change
->new_limit
= orig_limit
;
394 strcpy(change
->new_key
, orig_key
);
395 strcpy(change
->new_upass
, orig_upass
);
396 strcpy(change
->new_apass
, orig_apass
);
397 for (nn
= argc
= 0; nn
< cNode
->members
.used
; ++nn
) {
398 struct modeNode
*mn
= cNode
->members
.list
[nn
];
399 if ((mn
->modes
& MODE_CHANOP
) && IsService(mn
->user
) && IsLocal(mn
->user
)) {
400 change
->args
[argc
].mode
= MODE_CHANOP
;
401 change
->args
[argc
].u
.member
= mn
;
405 assert(argc
== change
->argc
);
406 change
->args
[0].u
.member
->modes
&= ~MODE_CHANOP
;
407 mod_chanmode_announce(change
->args
[0].u
.member
->user
, cNode
, change
);
408 mod_chanmode_free(change
);
413 AddChannel(const char *name
, time_t time_
, const char *modes
, char *banlist
, char *exemptlist
)
415 struct chanNode
*cNode
;
416 char new_modes
[MAXLEN
], *argv
[MAXNUMPARAMS
];
419 if (!IsChannelName(name
)) {
420 log_module(MAIN_LOG
, LOG_ERROR
, "Somebody asked to add channel '%s', which isn't a channel name!", name
);
426 safestrncpy(new_modes
, modes
, sizeof(new_modes
));
427 nn
= split_line(new_modes
, 0, ArrayLength(argv
), argv
);
428 if (!(cNode
= GetChannel(name
))) {
429 cNode
= calloc(1, sizeof(*cNode
) + strlen(name
));
430 strcpy(cNode
->name
, name
);
431 banList_init(&cNode
->banlist
);
432 exemptList_init(&cNode
->exemptlist
);
433 modeList_init(&cNode
->members
);
434 mod_chanmode(NULL
, cNode
, argv
, nn
, MCP_FROM_SERVER
);
435 dict_insert(channels
, cNode
->name
, cNode
);
436 cNode
->timestamp
= time_
;
438 } else if (cNode
->timestamp
> time_
) {
439 wipeout_channel(cNode
, time_
, argv
, nn
);
441 } else if (cNode
->timestamp
== time_
) {
442 mod_chanmode(NULL
, cNode
, argv
, nn
, MCP_FROM_SERVER
);
448 /* rel_age is the relative ages of our channel data versus what is
449 * in a BURST command. 1 means ours is younger, 0 means both are
450 * the same age, -1 means ours is older. */
452 /* if it's a new or updated channel, make callbacks */
454 for (nn
=0; nn
<ncf_used
; nn
++)
457 /* go through list of bans and add each one */
458 if (banlist
&& (rel_age
>= 0)) {
459 for (nn
=0; banlist
[nn
];) {
460 char *ban
= banlist
+ nn
;
462 while (banlist
[nn
] != ' ' && banlist
[nn
])
464 while (banlist
[nn
] == ' ')
466 bn
= calloc(1, sizeof(*bn
));
467 safestrncpy(bn
->ban
, ban
, sizeof(bn
->ban
));
468 safestrncpy(bn
->who
, "<unknown>", sizeof(bn
->who
));
470 banList_append(&cNode
->banlist
, bn
);
474 /* go through list of exempts and add each one */
475 if (exemptlist
&& (rel_age
>= 0)) {
476 for (nn
=0; exemptlist
[nn
];) {
477 char *exempt
= exemptlist
+ nn
;
478 struct exemptNode
*en
;
479 while (exemptlist
[nn
] != ' ' && exemptlist
[nn
])
481 while (exemptlist
[nn
] == ' ')
482 exemptlist
[nn
++] = 0;
483 en
= calloc(1, sizeof(*en
));
484 safestrncpy(en
->exempt
, exempt
, sizeof(en
->exempt
));
485 safestrncpy(en
->who
, "<unknown>", sizeof(en
->who
));
487 exemptList_append(&cNode
->exemptlist
, en
);
494 static del_channel_func_t
*dcf_list
;
495 static unsigned int dcf_size
= 0, dcf_used
= 0;
498 reg_del_channel_func(del_channel_func_t handler
)
500 if (dcf_used
== dcf_size
) {
503 dcf_list
= realloc(dcf_list
, dcf_size
*sizeof(dcf_list
[0]));
506 dcf_list
= malloc(dcf_size
*sizeof(dcf_list
[0]));
509 dcf_list
[dcf_used
++] = handler
;
513 DelChannel(struct chanNode
*channel
)
517 dict_remove(channels
, channel
->name
);
519 if (channel
->members
.used
|| channel
->locks
) {
520 log_module(MAIN_LOG
, LOG_ERROR
, "Warning: deleting channel %s with %d users and %d locks remaining.", channel
->name
, channel
->members
.used
, channel
->locks
);
523 /* go through all channel members and delete them from the channel */
524 for (n
=channel
->members
.used
; n
>0; )
525 DelChannelUser(channel
->members
.list
[--n
]->user
, channel
, NULL
, 1);
527 /* delete all channel bans */
528 for (n
=channel
->banlist
.used
; n
>0; )
529 free(channel
->banlist
.list
[--n
]);
530 channel
->banlist
.used
= 0;
532 /* delete all channel exempts */
533 for (n
=channel
->exemptlist
.used
; n
>0; )
534 free(channel
->exemptlist
.list
[--n
]);
535 channel
->exemptlist
.used
= 0;
537 for (n
=0; n
<dcf_used
; n
++)
538 dcf_list
[n
](channel
);
540 modeList_clean(&channel
->members
);
541 banList_clean(&channel
->banlist
);
542 exemptList_clean(&channel
->exemptlist
);
547 AddChannelUser(struct userNode
*user
, struct chanNode
* channel
)
549 struct modeNode
*mNode
;
552 mNode
= GetUserMode(channel
, user
);
556 mNode
= malloc(sizeof(*mNode
));
558 /* set up modeNode */
559 mNode
->channel
= channel
;
563 mNode
->idle_since
= now
;
565 /* Add modeNode to channel and to user.
566 * We have to do this before calling join funcs in case the
567 * modeNode is manipulated (e.g. chanserv ops the user).
569 modeList_append(&channel
->members
, mNode
);
570 modeList_append(&user
->channels
, mNode
);
572 if (channel
->members
.used
== 1
573 && !(channel
->modes
& MODE_REGISTERED
)
574 && !(channel
->modes
& MODE_APASS
))
575 mNode
->modes
|= MODE_CHANOP
;
577 for (n
=0; n
<jf_used
; n
++) {
578 /* Callbacks return true if they kick or kill the user,
579 * and we can continue without removing mNode. */
580 if (jf_list
[n
](mNode
))
585 irc_join(user
, channel
);
590 static part_func_t
*pf_list
;
591 static unsigned int pf_size
= 0, pf_used
= 0;
594 reg_part_func(part_func_t handler
)
596 if (pf_used
== pf_size
) {
599 pf_list
= realloc(pf_list
, pf_size
*sizeof(part_func_t
));
602 pf_list
= malloc(pf_size
*sizeof(part_func_t
));
605 pf_list
[pf_used
++] = handler
;
609 unreg_part_func(part_func_t handler
)
612 for (i
=0; i
<pf_used
; i
++)
613 if (pf_list
[i
] == handler
)
617 memmove(pf_list
+i
, pf_list
+i
+1, (pf_used
-i
-1)*sizeof(pf_list
[0]));
622 LockChannel(struct chanNode
* channel
)
628 UnlockChannel(struct chanNode
*channel
)
630 assert(channel
->locks
> 0);
631 if (!--channel
->locks
&& !channel
->members
.used
)
636 DelChannelUser(struct userNode
* user
, struct chanNode
* channel
, const char *reason
, int deleting
)
638 struct modeNode
* mNode
;
641 if (IsLocal(user
) && reason
)
642 irc_part(user
, channel
, reason
);
644 mNode
= GetUserMode(channel
, user
);
646 /* Sometimes we get a PART when the user has been KICKed.
647 * In this case, we get no usermode, and should not try to free it.
652 /* remove modeNode from channel and user */
653 modeList_remove(&channel
->members
, mNode
);
654 modeList_remove(&user
->channels
, mNode
);
657 for (n
=0; n
<pf_used
; n
++)
658 pf_list
[n
](mNode
, reason
);
663 /* A single check for APASS only should be enough here */
664 if (!deleting
&& !channel
->members
.used
&& !channel
->locks
665 && !(channel
->modes
& MODE_REGISTERED
) && !(channel
->modes
& MODE_APASS
))
669 static kick_func_t
*kf_list
;
670 static unsigned int kf_size
= 0, kf_used
= 0;
673 KickChannelUser(struct userNode
* target
, struct chanNode
* channel
, struct userNode
*kicker
, const char *why
)
677 if (!target
|| !channel
|| IsService(target
) || !GetUserMode(channel
, target
))
680 /* This may break things, but lets see.. -Rubin */
681 for (n
=0; n
<kf_used
; n
++)
682 kf_list
[n
](kicker
, target
, channel
);
684 /* don't remove them from the channel, since the server will send a PART */
685 irc_kick(kicker
, target
, channel
, why
);
689 /* NULL reason because we don't want a PART message to be
690 sent by DelChannelUser. */
691 DelChannelUser(target
, channel
, NULL
, 0);
696 reg_kick_func(kick_func_t handler
)
698 if (kf_used
== kf_size
) {
701 kf_list
= realloc(kf_list
, kf_size
*sizeof(kick_func_t
));
704 kf_list
= malloc(kf_size
*sizeof(kick_func_t
));
707 kf_list
[kf_used
++] = handler
;
711 ChannelUserKicked(struct userNode
* kicker
, struct userNode
* victim
, struct chanNode
* channel
)
716 if (!victim
|| !channel
|| !GetUserMode(channel
, victim
))
719 /* Update the kicker's idle time (kicker may be null if it was a server) */
720 if (kicker
&& (mn
= GetUserMode(channel
, kicker
)))
721 mn
->idle_since
= now
;
723 for (n
=0; n
<kf_used
; n
++)
724 kf_list
[n
](kicker
, victim
, channel
);
726 DelChannelUser(victim
, channel
, 0, 0);
729 irc_part(victim
, channel
, NULL
);
732 int ChannelBanExists(struct chanNode
*channel
, const char *ban
)
736 for (n
= 0; n
< channel
->banlist
.used
; n
++)
737 if (match_ircglobs(channel
->banlist
.list
[n
]->ban
, ban
))
742 int ChannelExemptExists(struct chanNode
*channel
, const char *exempt
)
746 for (n
= 0; n
< channel
->exemptlist
.used
; n
++)
747 if (match_ircglobs(channel
->exemptlist
.list
[n
]->exempt
, exempt
))
752 static topic_func_t
*tf_list
;
753 static unsigned int tf_size
= 0, tf_used
= 0;
756 reg_topic_func(topic_func_t handler
)
758 if (tf_used
== tf_size
) {
761 tf_list
= realloc(tf_list
, tf_size
*sizeof(topic_func_t
));
764 tf_list
= malloc(tf_size
*sizeof(topic_func_t
));
767 tf_list
[tf_used
++] = handler
;
771 SetChannelTopic(struct chanNode
*channel
, struct userNode
*service
, struct userNode
*user
, const char *topic
, int announce
)
775 char old_topic
[TOPICLEN
+1];
777 safestrncpy(old_topic
, channel
->topic
, sizeof(old_topic
));
778 safestrncpy(channel
->topic
, topic
, sizeof(channel
->topic
));
779 channel
->topic_time
= now
;
782 safestrncpy(channel
->topic_nick
, user
->nick
, sizeof(channel
->topic_nick
));
784 /* Update the setter's idle time */
785 if ((mn
= GetUserMode(channel
, user
)))
786 mn
->idle_since
= now
;
790 /* We don't really care if a local user messes with the topic,
791 * so don't call the tf_list functions. */
792 irc_topic(service
, user
, channel
, topic
);
794 for (n
=0; n
<tf_used
; n
++)
795 if (tf_list
[n
](user
, channel
, old_topic
))
801 GetChannel(const char *name
)
803 return dict_find(channels
, name
, NULL
);
807 GetUserMode(struct chanNode
*channel
, struct userNode
*user
)
810 struct modeNode
*mn
= NULL
;
813 verify(channel
->members
.list
);
815 verify(user
->channels
.list
);
816 if (channel
->members
.used
< user
->channels
.used
) {
817 for (n
=0; n
<channel
->members
.used
; n
++) {
818 verify(channel
->members
.list
[n
]);
819 if (user
== channel
->members
.list
[n
]->user
) {
820 mn
= channel
->members
.list
[n
];
825 for (n
=0; n
<user
->channels
.used
; n
++) {
826 verify(user
->channels
.list
[n
]);
827 if (channel
== user
->channels
.list
[n
]->channel
) {
828 mn
= user
->channels
.list
[n
];
836 struct userNode
*IsInChannel(struct chanNode
*channel
, struct userNode
*user
)
841 verify(channel
->members
.list
);
843 verify(user
->channels
.list
);
844 if (channel
->members
.used
< user
->channels
.used
) {
845 for (n
=0; n
<channel
->members
.used
; n
++) {
846 verify(channel
->members
.list
[n
]);
847 if (user
== channel
->members
.list
[n
]->user
) {
852 for (n
=0; n
<user
->channels
.used
; n
++) {
853 verify(user
->channels
.list
[n
]);
854 if (channel
== user
->channels
.list
[n
]->channel
) {
862 DEFINE_LIST(userList
, struct userNode
*)
863 DEFINE_LIST(modeList
, struct modeNode
*)
864 DEFINE_LIST(banList
, struct banNode
*)
865 DEFINE_LIST(exemptList
, struct exemptNode
*)
866 DEFINE_LIST(channelList
, struct chanNode
*)
867 DEFINE_LIST(serverList
, struct server
*)
872 dict_iterator_t it
, next
;
874 DelServer(self
, 0, NULL
);
875 for (it
= dict_first(channels
); it
; it
= next
) {
876 next
= iter_next(it
);
877 DelChannel(iter_data(it
));
879 dict_delete(channels
);
880 dict_delete(clients
);
881 dict_delete(servers
);
882 userList_clean(&curr_opers
);