~ubuntu-branches/ubuntu/karmic/gtk-gnutella/karmic

« back to all changes in this revision

Viewing changes to src/ban.h

  • Committer: Bazaar Package Importer
  • Author(s): Anand Kumria
  • Date: 2005-08-04 11:32:05 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050804113205-q746i4lgo3rtlegn
Tags: 0.95.4-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * $Id: ban.h,v 1.12 2004/01/11 09:19:23 rmanfredi Exp $
3
 
 *
4
 
 * Copyright (c) 2002-2003, Raphael Manfredi
5
 
 *
6
 
 * Banning control.
7
 
 *
8
 
 *----------------------------------------------------------------------
9
 
 * This file is part of gtk-gnutella.
10
 
 *
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.
15
 
 *
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.
20
 
 *
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
23
 
 *  Foundation, Inc.:
24
 
 *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
 
 *----------------------------------------------------------------------
26
 
 */
27
 
 
28
 
#ifndef _ban_h_
29
 
#define _ban_h_
30
 
 
31
 
#include <glib.h>
32
 
 
33
 
struct gnutella_socket;
34
 
 
35
 
/*
36
 
 * Return codes for ban_allow().
37
 
 */
38
 
 
39
 
typedef enum {
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 */
44
 
} ban_type_t;
45
 
 
46
 
void ban_init(void);
47
 
void ban_close(void);
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);
56
 
 
57
 
const gchar *ban_vendor(const gchar *vendor);
58
 
 
59
 
#endif  /* _ban_h_ */
60
 
 
61
 
/* vi: set ts=4: */
62