Started implementation of ban list. For now, just gathers the list of banned IPs from

the DHT and is not used to reject IPs yet (the DHT list is, even if DHT is desactivated).
Next steps: GUI with switch controls, exchange of IP ban lists between friends, handling IP ranges.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8297 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-05-26 21:17:09 +00:00
parent 5200f30a32
commit 047977b645
13 changed files with 337 additions and 204 deletions

View file

@ -26,6 +26,7 @@
*
*/
#include <netinet/in.h>
#include <inttypes.h>
#include <string>
#include <list>
@ -35,11 +36,9 @@
class RsDht;
extern RsDht *rsDht;
//std::ostream &operator<<(std::ostream &out, const RsPhotoShowDetails &detail);
//std::ostream &operator<<(std::ostream &out, const RsPhotoDetails &detail);
#define RSDHT_NETSTART_NETWORKMODE 0x0001
#define RSDHT_NETSTART_NATTYPE 0x0002
#define RSDHT_NETSTART_NATHOLE 0x0003
@ -157,7 +156,14 @@ class RsDhtRelayProxy
//time_t mLastBandwidthTS;
};
class RsDhtFilteredPeer
{
public:
struct sockaddr_in mAddr;
uint32_t mFilterFlags; /* reasons why we are filtering */
time_t mFilterTS;
time_t mLastSeen;
};
class RsDht
{
@ -196,6 +202,7 @@ virtual int setRelayAllowance(int classIdx, uint32_t count, uint32_t bandwidth
virtual bool getOwnDhtId(std::string &ownDhtId) = 0;
virtual bool isAddressBanned(const struct sockaddr_storage& raddr) =0;
virtual void getListOfBannedIps(std::list<RsDhtFilteredPeer>& lst) =0;
#if 0
virtual std::string getPeerStatusString();