working version of IP banning lists. Default settings should keep users safe from traffic re-routing based on DHT masquerading. Some GUI bugs remain.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8308 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-05-28 21:44:43 +00:00
parent fc97cdcfa2
commit 562c7c2c20
7 changed files with 338 additions and 95 deletions

View file

@ -38,10 +38,14 @@ extern RsBanList *rsBanList ;
#define RSBANLIST_REASON_UNKNOWN 0
#define RSBANLIST_REASON_USER 1
#define RSBANLIST_REASON_DHT 2
#define RSBANLIST_REASON_AUTO_RANGE 3
class BanListPeer
{
public:
BanListPeer() ;
struct sockaddr_storage addr;
uint8_t masked_bytes ; // 0 = []/32. 1=[]/24, 2=[]/16
uint32_t reason; // User, DHT
@ -60,6 +64,19 @@ public:
virtual bool isAddressAccepted(const struct sockaddr_storage& addr) =0;
virtual void getListOfBannedIps(std::list<BanListPeer>& list) =0;
virtual bool autoRangeEnabled() =0;
virtual void enableAutoRange(bool b) =0 ;
virtual int autoRangeLimit() =0;
virtual void setAutoRangeLimit(int n)=0;
virtual void enableIPsFromFriends(bool b) =0;
virtual bool IPsFromFriendsEnabled() =0;
virtual void enableIPsFromDHT(bool b) =0;
virtual bool iPsFromDHTEnabled() =0;
};