Major changes to the networking core of retroshare to introduce the new serialiser.

- Added new serialiser (PQItem -> RsItem), removed old one.
- switched packet sorting from ChanId (array of ids) to PeerId (string)
- introduced cleaner service interface (pqiservice).
- moved p3disc to service interface.
- modified streamers to use the new serialiser.
- moved msg/chat to service interface.
- removed old source code. (supernode / p3loopback).

I've disabled UDP connections / Proxy and Channels for the moment.
The code it still here, but is not compiled. The Proxy and Channels 
will become services, and the UDP connections will be reworked 
in the near future.




git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@274 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2007-12-12 01:29:14 +00:00
parent 07d33009b9
commit 2c9c31eaf0
36 changed files with 866 additions and 8116 deletions

View file

@ -50,7 +50,7 @@
class SearchModule
{
public:
int smi; // id.
std::string peerid;
PQInterface *pqi;
SecurityPolicy *sp;
};
@ -62,39 +62,30 @@ class pqihandler: public P3Interface
{
public:
pqihandler(SecurityPolicy *Global);
int AddSearchModule(SearchModule *mod, int chanid = -1);
int RemoveSearchModule(SearchModule *mod);
bool AddSearchModule(SearchModule *mod);
bool RemoveSearchModule(SearchModule *mod);
// P3Interface.
// 4 very similar outputs.....
virtual int Search(SearchItem *ns);
virtual int SearchSpecific(SearchItem *ns); /* search one person only */
virtual int CancelSearch(SearchItem *ns); /* no longer used? */
virtual int SendSearchResult(PQFileItem *);
virtual int SearchSpecific(RsCacheRequest *ns);
virtual int SendSearchResult(RsCacheItem *);
// inputs.
virtual PQFileItem * GetSearchResult();
virtual SearchItem * RequestedSearch();
virtual SearchItem * CancelledSearch();
virtual RsCacheRequest * RequestedSearch();
virtual RsCacheItem * GetSearchResult();
// file i/o
virtual int SendFileItem(PQFileItem *ns);
virtual PQFileItem * GetFileItem();
// Chat Interface
virtual int SendMsg(ChatItem *item);
virtual int SendGlobalMsg(ChatItem *ns); /* needed until chat complete */
virtual ChatItem *GetMsg();
virtual int SendFileRequest(RsFileRequest *ns);
virtual int SendFileData(RsFileData *ns);
virtual RsFileRequest * GetFileRequest();
virtual RsFileData * GetFileData();
// Rest of P3Interface
virtual int tick();
virtual int status();
// Control Interface
virtual int SendOtherPQItem(PQItem *);
virtual PQItem *GetOtherPQItem();
virtual PQItem *SelectOtherPQItem(bool (*tst)(PQItem *));
// Service Data Interface
virtual int SendRsRawItem(RsRawItem *);
virtual RsRawItem *GetRsRawItem();
// rate control.
void setMaxIndivRate(bool in, float val);
@ -106,19 +97,19 @@ float getMaxRate(bool in);
/* check to be overloaded by those that can
* generates warnings otherwise
*/
virtual int checkOutgoingPQItem(PQItem *item, int global);
virtual int checkOutgoingRsItem(RsItem *item, int global);
int HandlePQItem(PQItem *ns, int allowglobal);
int HandleRsItem(RsItem *ns, int allowglobal);
int GetItems();
void SortnStoreItem(PQItem *item);
void SortnStoreItem(RsItem *item);
std::map<int, SearchModule *> mods;
std::map<std::string, SearchModule *> mods;
SecurityPolicy *globsec;
// Temporary storage...
std::list<PQItem *> in_result, in_endsrch, in_reqsrch, in_reqfile,
in_file, in_chat, in_info, in_host, in_other;
std::list<RsItem *> in_result, in_search,
in_request, in_data, in_service;
private: