2
* $Id: ban.h,v 1.12 2004/01/11 09:19:23 rmanfredi Exp $
4
* Copyright (c) 2002-2003, Raphael Manfredi
8
*----------------------------------------------------------------------
9
* This file is part of gtk-gnutella.
11
* gtk-gnutella is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version.
16
* gtk-gnutella is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with gtk-gnutella; if not, write to the Free Software
24
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
*----------------------------------------------------------------------
33
struct gnutella_socket;
36
* Return codes for ban_allow().
40
BAN_OK = 0, /* OK, don't ban and accept the connection */
41
BAN_FIRST = 1, /* Initial banning, send polite denial */
42
BAN_FORCE = 2, /* Force banning, don't send back anything */
43
BAN_MSG = 3, /* Ban with explicit message */
48
ban_type_t ban_allow(guint32 ip);
49
void ban_record(guint32 ip, const gchar *msg);
50
void ban_force(struct gnutella_socket *s);
51
gint ban_delay(guint32 ip);
52
gboolean ban_reclaim_fd(void);
53
gchar *ban_message(guint32 ip);
54
gboolean ban_is_banned(guint32 ip);
55
void ban_max_recompute(void);
57
const gchar *ban_vendor(const gchar *vendor);