mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-13 00:53:14 -04:00
Commit of the new UDP Connection methods and
the rewrite of the retroshare core networking stack. This check-in commits the changes to the pqi code, and provides the majority of the improvements. (1) Introduced new interfaces for DHT and UPnP abstraction: p3dhtmgr.h, p3upnpmgr.h (2) Introduces abstraction for Authentication: p3authmgr.h (3) New Connection Manager to coordinate networking code: p3connmgr.h (4) New Configuration Manager: p3cfgmgr.h This library has been significantly modified to support DHT synced connections to enable connections between Firewalled Friends. The connection code has been rewritten within a new framework, which should make extensions easier to code. Also removed significant amount of old code relating to Tunnels, Channels etc. This will be recycled later as higher level services that should not be part of the core networking library. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@306 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
de0ce110b9
commit
6435357c07
63 changed files with 8336 additions and 10839 deletions
|
@ -29,11 +29,12 @@
|
|||
#define PQI_BIN_INTERFACE_HEADER
|
||||
|
||||
#include "pqi/pqi_base.h"
|
||||
#include "pqi/pqihash.h"
|
||||
|
||||
class BinFileInterface: public BinInterface
|
||||
{
|
||||
public:
|
||||
BinFileInterface(char *fname, int flags);
|
||||
BinFileInterface(const char *fname, int flags);
|
||||
virtual ~BinFileInterface();
|
||||
|
||||
virtual int tick() { return 1; }
|
||||
|
@ -56,11 +57,13 @@ virtual bool moretoread()
|
|||
|
||||
|
||||
virtual bool cansend() { return (bin_flags | BIN_FLAGS_WRITEABLE); }
|
||||
virtual std::string gethash();
|
||||
|
||||
private:
|
||||
int bin_flags;
|
||||
FILE *buf;
|
||||
int size;
|
||||
pqihash *hash;
|
||||
};
|
||||
|
||||
|
||||
|
@ -93,6 +96,7 @@ virtual bool moretoread()
|
|||
}
|
||||
|
||||
virtual bool cansend() { return (bin_flags | BIN_FLAGS_WRITEABLE); }
|
||||
virtual std::string gethash();
|
||||
|
||||
private:
|
||||
int bin_flags;
|
||||
|
@ -100,9 +104,42 @@ virtual bool cansend() { return (bin_flags | BIN_FLAGS_WRITEABLE); }
|
|||
int size;
|
||||
int recvsize;
|
||||
int readloc;
|
||||
pqihash *hash;
|
||||
};
|
||||
|
||||
|
||||
class NetBinDummy: public NetBinInterface
|
||||
{
|
||||
public:
|
||||
NetBinDummy(PQInterface *parent, std::string id, uint32_t t);
|
||||
virtual ~NetBinDummy() { return; }
|
||||
|
||||
// Net Interface
|
||||
virtual int connect(struct sockaddr_in raddr);
|
||||
virtual int listen();
|
||||
virtual int stoplistening();
|
||||
virtual int disconnect();
|
||||
virtual int reset();
|
||||
|
||||
// Bin Interface.
|
||||
virtual int tick();
|
||||
|
||||
virtual int senddata(void *data, int len);
|
||||
virtual int readdata(void *data, int len);
|
||||
virtual int netstatus();
|
||||
virtual int isactive();
|
||||
virtual bool moretoread();
|
||||
virtual bool cansend();
|
||||
virtual std::string gethash();
|
||||
|
||||
private:
|
||||
uint32_t type;
|
||||
bool dummyConnected;
|
||||
bool toConnect;
|
||||
uint32_t connectDelta;
|
||||
time_t connectTS;
|
||||
};
|
||||
|
||||
|
||||
#endif // PQI_BINARY_INTERFACES_HEADER
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue