net.i2p.router
public class Blocklist extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static String |
BLOCKLIST_FILE_DEFAULT |
(package private) static String |
PROP_BLOCKLIST_DETAIL |
(package private) static String |
PROP_BLOCKLIST_ENABLED |
(package private) static String |
PROP_BLOCKLIST_FILE |
Constructor and Description |
---|
Blocklist()
only for testing with main()
|
Blocklist(RouterContext context) |
Modifier and Type | Method and Description |
---|---|
void |
add(byte[] ip) |
void |
add(String ip) |
void |
disable() |
List<byte[]> |
getAddresses(Hash peer)
this tries to not return duplicates
but I suppose it could.
|
boolean |
isBlocklisted(byte[] ip) |
boolean |
isBlocklisted(Hash peer)
Does the peer's IP address appear in the blocklist?
If so, and it isn't shitlisted, shitlist it forever...
|
boolean |
isBlocklisted(String ip) |
static void |
main(String[] args) |
void |
renderStatusHTML(Writer out)
write directly to the stream so we don't OOM on a huge list
|
void |
shitlist(Hash peer)
We don't keep the comment field in-memory,
so we have to go back out to the file to find it.
|
void |
startup() |
static String |
toStr(byte[] ip) |
static final String PROP_BLOCKLIST_ENABLED
static final String PROP_BLOCKLIST_DETAIL
static final String PROP_BLOCKLIST_FILE
static final String BLOCKLIST_FILE_DEFAULT
public Blocklist(RouterContext context)
public Blocklist()
public void startup()
public void disable()
public void add(String ip)
public void add(byte[] ip)
public List<byte[]> getAddresses(Hash peer)
public boolean isBlocklisted(Hash peer)
public boolean isBlocklisted(String ip)
public boolean isBlocklisted(byte[] ip)
public static String toStr(byte[] ip)
public void shitlist(Hash peer)
public void renderStatusHTML(Writer out) throws IOException
IOException
public static void main(String[] args)