ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid-8/modules/m_close.c
Revision: 1029
Committed: Sun Nov 8 13:10:50 2009 UTC (16 years, 8 months ago) by michael
Content type: text/x-csrc
Original Path: ircd-hybrid-7.3/modules/m_close.c
File size: 2369 byte(s)
Log Message:
- branch off trunk to create 7.3 branch

File Contents

# User Rev Content
1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     * m_close.c: Closes all unregistered connections.
4     *
5     * Copyright (C) 2002 by the past and present ircd coders, and others.
6     *
7     * This program is free software; you can redistribute it and/or modify
8     * it under the terms of the GNU General Public License as published by
9     * the Free Software Foundation; either version 2 of the License, or
10     * (at your option) any later version.
11     *
12     * This program is distributed in the hope that it will be useful,
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     * GNU General Public License for more details.
16     *
17     * You should have received a copy of the GNU General Public License
18     * along with this program; if not, write to the Free Software
19     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20     * USA
21     *
22 knight 31 * $Id$
23 adx 30 */
24    
25     #include "stdinc.h"
26 michael 1011 #include "list.h"
27 adx 30 #include "handlers.h"
28     #include "client.h"
29     #include "ircd.h"
30     #include "numeric.h"
31     #include "send.h"
32     #include "msg.h"
33     #include "parse.h"
34     #include "modules.h"
35    
36 michael 970 static void mo_close(struct Client *, struct Client *, int, char *[]);
37 adx 30
38     struct Message close_msgtab = {
39     "CLOSE", 0, 0, 0, 0, MFLG_SLOW, 0,
40 michael 970 { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_close, m_ignore }
41 adx 30 };
42 michael 970
43 adx 30 #ifndef STATIC_MODULES
44     void
45     _modinit(void)
46     {
47     mod_add_cmd(&close_msgtab);
48     }
49    
50     void
51     _moddeinit(void)
52     {
53     mod_del_cmd(&close_msgtab);
54     }
55    
56 knight 31 const char *_version = "$Revision$";
57 adx 30 #endif
58    
59     /*
60     * mo_close - CLOSE message handler
61     * - added by Darren Reed Jul 13 1992.
62     */
63     static void
64     mo_close(struct Client *client_p, struct Client *source_p,
65     int parc, char *parv[])
66     {
67 michael 970 dlink_node *ptr = NULL, *ptr_next = NULL;
68     unsigned int closed = dlink_list_length(&unknown_list);
69 adx 30
70 michael 970
71 adx 30 DLINK_FOREACH_SAFE(ptr, ptr_next, unknown_list.head)
72     {
73 michael 970 struct Client *target_p = ptr->data;
74 adx 30
75 michael 970 sendto_one(source_p, form_str(RPL_CLOSING), me.name, source_p->name,
76 adx 30 get_client_name(target_p, SHOW_IP), target_p->status);
77 michael 970
78 michael 1011 /*
79     * exit here is safe, because it is guaranteed not to be source_p
80 adx 30 * because it is unregistered and source_p is an oper.
81     */
82     exit_client(target_p, target_p, "Oper Closing");
83     }
84    
85     sendto_one(source_p, form_str(RPL_CLOSEEND),
86     me.name, source_p->name, closed);
87     }

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision