2 * ircd-ratbox: A slightly useful ircd.
3 * m_version.c: Shows ircd version information.
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2005 ircd-ratbox development team
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 * $Id: m_version.c 1887 2006-08-29 13:42:56Z jilles $
33 #include "supported.h"
39 static char *confopts(struct Client
*source_p
);
41 static int m_version(struct Client
*, struct Client
*, int, const char **);
42 static int mo_version(struct Client
*, struct Client
*, int, const char **);
44 struct Message version_msgtab
= {
45 "VERSION", 0, 0, 0, MFLG_SLOW
,
46 {mg_unreg
, {m_version
, 0}, {mo_version
, 0}, {mo_version
, 0}, mg_ignore
, {mo_version
, 0}}
49 mapi_clist_av1 version_clist
[] = { &version_msgtab
, NULL
};
50 DECLARE_MODULE_AV1(version
, NULL
, NULL
, version_clist
, NULL
, NULL
, "$Revision: 1887 $");
53 * m_version - VERSION command handler
54 * parv[0] = sender prefix
55 * parv[1] = remote server
58 m_version(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
60 static time_t last_used
= 0L;
64 if((last_used
+ ConfigFileEntry
.pace_wait
) > CurrentTime
)
66 /* safe enough to give this on a local connect only */
67 sendto_one(source_p
, form_str(RPL_LOAD2HI
),
68 me
.name
, source_p
->name
, "VERSION");
72 last_used
= CurrentTime
;
74 if(hunt_server(client_p
, source_p
, ":%s VERSION :%s", 1, parc
, parv
) != HUNTED_ISME
)
78 sendto_one_numeric(source_p
, RPL_VERSION
, form_str(RPL_VERSION
),
80 me
.name
, confopts(source_p
), TS_CURRENT
,
83 show_isupport(source_p
);
89 * mo_version - VERSION command handler
90 * parv[0] = sender prefix
91 * parv[1] = remote server
94 mo_version(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
96 if(hunt_server(client_p
, source_p
, ":%s VERSION :%s", 1, parc
, parv
) == HUNTED_ISME
)
98 sendto_one_numeric(source_p
, RPL_VERSION
, form_str(RPL_VERSION
),
100 me
.name
, confopts(source_p
), TS_CURRENT
,
102 show_isupport(source_p
);
109 * input - client pointer
110 * output - ircd.conf option string
111 * side effects - none
114 confopts(struct Client
*source_p
)
116 static char result
[15];
122 if(ConfigChannel
.use_except
)
125 if(ConfigFileEntry
.glines
)
129 /* might wanna hide this :P */
133 if(ConfigChannel
.use_invex
)
136 if(ConfigChannel
.use_knock
)
142 if(opers_see_all_users
|| ConfigFileEntry
.operspy_dont_care_user_info
)
144 #ifdef IGNORE_BOGUS_TS