#include <glib.h>
#include "lib/host_addr.h"
Go to the source code of this file.
Enumerations | |
enum | ban_type_t { BAN_OK = 0, BAN_FIRST = 1, BAN_FORCE = 2, BAN_MSG = 3 } |
Functions | |
void | ban_init (void) |
Initialize the banning system. | |
void | ban_close (void) |
Called at shutdown time to reclaim all memory. | |
ban_type_t | ban_allow (const host_addr_t addr) |
Check whether we can allow connection from `ip' to proceed. | |
void | ban_record (const host_addr_t addr, const gchar *msg) |
Record banning with specific message for a given IP, for MAX_BAN seconds. | |
void | ban_force (struct gnutella_socket *s) |
Force banning of the connection. | |
gint | ban_delay (const host_addr_t addr) |
gchar * | ban_message (const host_addr_t addr) |
gboolean | ban_is_banned (const host_addr_t addr) |
Check whether IP is already recorded as being banned. | |
void | ban_max_recompute (void) |
Recompute the maximum amount of file descriptors we dedicate to banning. | |
const gchar * | ban_vendor (const gchar *vendor) |
Check whether servent identified by its vendor string should be banned. |
|
|
|
Check whether we can allow connection from `ip' to proceed. Returns: BAN_OK ok, can proceed with connection. BAN_FIRST will ban, but send back message, then close connection. BAN_FORCE don't send back anything, and call ban_force(). BAN_MSG will ban with explicit message and tailored error code. Every BAN_REMIND attempts, return BAN_FIRST to let them know that they have been banned, in case they "missed" our previous indications or did not get the Retry-After right. --RAM, 2004-06-21 |
|
Called at shutdown time to reclaim all memory.
|
|
|
|
Force banning of the connection. We're putting it in a list and forgetting about it. |
|
Initialize the banning system.
|
|
Check whether IP is already recorded as being banned.
|
|
Recompute the maximum amount of file descriptors we dedicate to banning.
|
|
|
|
Record banning with specific message for a given IP, for MAX_BAN seconds.
|
|
Check whether servent identified by its vendor string should be banned. When we ban, we ban for both gnet and download connections. Such banning is exceptional, usually restricted to some versions and the servent's author is informed about the banning.
|