com.limegroup.gnutella.filters
Class IPFilter

java.lang.Object
  extended bycom.limegroup.gnutella.filters.SpamFilter
      extended bycom.limegroup.gnutella.filters.IPFilter

public final class IPFilter
extends SpamFilter

Blocks messages and hosts based on IP address. Formerly know as BlackListFilter. Immutable.


Method Summary
 boolean allow(byte[] host)
          Checks to see if a given host is banned.
 boolean allow(Message m)
          Checks if a given Message's host is banned.
 boolean allow(java.lang.String host)
          Checks if a given host is banned.
static IPFilter instance()
          Returns the current active instance of IPFilter.
static void refreshIPFilter()
          Refresh the IPFilter's instance.
 
Methods inherited from class com.limegroup.gnutella.filters.SpamFilter
newPersonalFilter, newRouteFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static IPFilter instance()
Returns the current active instance of IPFilter.


refreshIPFilter

public static void refreshIPFilter()
Refresh the IPFilter's instance.


allow

public boolean allow(java.lang.String host)
Checks if a given host is banned. This method will be called when accepting an incomming or outgoing connection.

Parameters:
host - preferably an IP in the form of A.B.C.D, but if it is a DNS name then a lookup will be performed.
Returns:
true if this host is allowed, false if it is banned or we are unable to create correct IP addr out of it.

allow

public boolean allow(byte[] host)
Checks to see if a given host is banned.

Parameters:
host - the host's IP in byte form.

allow

public boolean allow(Message m)
Checks if a given Message's host is banned.

Specified by:
allow in class SpamFilter
Returns:
true if this Message's host is allowed, false if it is banned or we are unable to create correct IP addr out of it.